From 216ae6ef55c313a34bc31821a27055261aae65e3 Mon Sep 17 00:00:00 2001 From: rique223 Date: Thu, 17 Nov 2022 17:11:05 -0300 Subject: [PATCH 01/15] style: :lipstick: Refactor app details page header style Increased the rightside margin of the app avatar, removed the 'by' substring from the app author metadata and changed the fontScale and colors for the metadata section and short description. --- .../client/components/avatar/AppAvatar.tsx | 14 ++-------- .../AppDetailsPage/AppDetailsPageHeader.tsx | 28 +++++++++++++------ .../rocketchat-i18n/i18n/en.i18n.json | 1 - 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/apps/meteor/client/components/avatar/AppAvatar.tsx b/apps/meteor/client/components/avatar/AppAvatar.tsx index fc19fca92e1d..07a1e569984e 100644 --- a/apps/meteor/client/components/avatar/AppAvatar.tsx +++ b/apps/meteor/client/components/avatar/AppAvatar.tsx @@ -1,21 +1,13 @@ import { Box } from '@rocket.chat/fuselage'; -import React, { ReactElement } from 'react'; +import React, { ComponentProps, ReactElement } from 'react'; import BaseAvatar from './BaseAvatar'; -// TODO: frontend chapter day - Remove inline Styling - type AppAvatarProps = { - /* @deprecated */ - size: 'x36' | 'x28' | 'x16' | 'x40' | 'x124'; - /* @deprecated */ - mie?: 'x80' | 'x20' | 'x16' | 'x8'; - /* @deprecated */ - alignSelf?: 'center'; - iconFileContent: string; iconFileData: string; -}; + size: ComponentProps['size']; +} & ComponentProps; export default function AppAvatar({ iconFileContent, size, iconFileData, ...props }: AppAvatarProps): ReactElement { return ( diff --git a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx index 381b09135497..8e51bc69875d 100644 --- a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx +++ b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx @@ -11,12 +11,12 @@ import AppStatus from './tabs/AppStatus'; const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { const t = useTranslation(); - const { iconFileData, name, author, version, iconFileContent, installed, isSubscribed, modifiedAt, bundledIn } = app; + const { iconFileData, name, author, version, iconFileContent, installed, isSubscribed, modifiedAt, bundledIn, shortDescription } = app; const lastUpdated = modifiedAt && moment(modifiedAt).fromNow(); return ( - + @@ -24,21 +24,31 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { {bundledIn && Boolean(bundledIn.length) && } - {app?.shortDescription && {app.shortDescription}} + {shortDescription && ( + + {shortDescription} + + )} {(installed || isSubscribed) && } - - {t('By_author', { author: author?.name })} + + {author?.name} + + + | + + + {t('Version_version', { version })} - | - {t('Version_version', { version })} {lastUpdated && ( <> - | - + + | + + {t('Marketplace_app_last_updated', { lastUpdated, })} diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 4465d96e271d..8a8d61215763 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -765,7 +765,6 @@ "Buy": "Buy", "By": "By", "by": "by", - "By_author": "By __author__", "cache_cleared": "Cache cleared", "Call": "Call", "Calling": "Calling", From 206de926313d1b65f75e0364b0be9b61e4a3ce8c Mon Sep 17 00:00:00 2001 From: Felipe <84182706+felipe-rod123@users.noreply.github.com> Date: Mon, 5 Dec 2022 14:07:50 -0300 Subject: [PATCH 02/15] change Tag variant to 'enterprise' --- apps/meteor/client/views/admin/apps/BundleChips.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/views/admin/apps/BundleChips.tsx b/apps/meteor/client/views/admin/apps/BundleChips.tsx index 7150893f8026..d6b95acfca34 100644 --- a/apps/meteor/client/views/admin/apps/BundleChips.tsx +++ b/apps/meteor/client/views/admin/apps/BundleChips.tsx @@ -23,7 +23,7 @@ const BundleChips = ({ bundledIn }: BundleChipsProps): ReactElement => { {bundledIn.map((bundle) => ( setIsHovered(true)} onMouseLeave={(): void => setIsHovered(false)}> - {bundle.bundleName} + {bundle.bundleName} } From 64bbbec7e0a2f3a9eda08bee3344328094eee196 Mon Sep 17 00:00:00 2001 From: Felipe <84182706+felipe-rod123@users.noreply.github.com> Date: Fri, 9 Dec 2022 18:02:44 -0300 Subject: [PATCH 03/15] fix imports --- apps/meteor/client/views/admin/apps/BundleChips.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/meteor/client/views/admin/apps/BundleChips.tsx b/apps/meteor/client/views/admin/apps/BundleChips.tsx index 24b0306bbc51..f7f669863170 100644 --- a/apps/meteor/client/views/admin/apps/BundleChips.tsx +++ b/apps/meteor/client/views/admin/apps/BundleChips.tsx @@ -1,7 +1,7 @@ -import { Tag } from '@rocket.chat/fuselage'; +import { Box, PositionAnimated, Tag, Tooltip, AnimatedVisibility } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; -import React from 'react'; +import type { ReactElement, RefObject } from 'react'; +import React, { Fragment, useRef, useState } from 'react'; import type { App } from './types'; @@ -15,13 +15,14 @@ type BundleChipsProps = { const BundleChips = ({ bundledIn }: BundleChipsProps): ReactElement => { const t = useTranslation(); - + const bundleRef = useRef(); + const [isHovered, setIsHovered] = useState(false); return ( <> {bundledIn.map((bundle) => ( setIsHovered(true)} onMouseLeave={(): void => setIsHovered(false)}> - {bundle.bundleName} + {bundle.bundleName} } From 2ecfa79aba6b61c1866694d6e3692df136f43dae Mon Sep 17 00:00:00 2001 From: Felipe <84182706+felipe-rod123@users.noreply.github.com> Date: Wed, 14 Dec 2022 12:18:12 -0300 Subject: [PATCH 04/15] fix 'featured' variant and conflicts --- .../AppDetailsPage/AppDetailsPageHeader.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx index 4c3eff25586e..51238eb316e1 100644 --- a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx +++ b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx @@ -22,7 +22,19 @@ const versioni18nKey = (app: App): string => { const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { const t = useTranslation(); - const { iconFileData, name, author, version, iconFileContent, installed, isSubscribed, modifiedAt, bundledIn, shortDescription } = app; + const { + iconFileData, + name, + author, + version, + iconFileContent, + installed, + modifiedAt, + bundledIn, + versionIncompatible, + isSubscribed, + shortDescription, + } = app; const lastUpdated = modifiedAt && moment(modifiedAt).fromNow(); const incompatibleStatus = versionIncompatible ? appIncompatibleStatusProps() : undefined; @@ -65,13 +77,13 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { | - {t('Marketplace_app_last_updated', { + {t('Marketplace_app_last_updated', { lastUpdated, })} )} - + | @@ -88,7 +100,6 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { )} - From ff54978633df01302f7dbc8a63d072055501c497 Mon Sep 17 00:00:00 2001 From: Felipe <84182706+felipe-rod123@users.noreply.github.com> Date: Thu, 15 Dec 2022 12:48:47 -0300 Subject: [PATCH 05/15] fix lint --- apps/meteor/client/components/avatar/AppAvatar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/meteor/client/components/avatar/AppAvatar.tsx b/apps/meteor/client/components/avatar/AppAvatar.tsx index 07a1e569984e..c146eb4b10fc 100644 --- a/apps/meteor/client/components/avatar/AppAvatar.tsx +++ b/apps/meteor/client/components/avatar/AppAvatar.tsx @@ -1,5 +1,6 @@ import { Box } from '@rocket.chat/fuselage'; -import React, { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React from 'react'; import BaseAvatar from './BaseAvatar'; From f204458e3278271b9b793c4619749085d3c3babd Mon Sep 17 00:00:00 2001 From: rique223 Date: Tue, 10 Jan 2023 15:56:34 -0300 Subject: [PATCH 06/15] Refactor unnecessary code for enterprise tag tooltip --- .../client/views/admin/apps/BundleChips.tsx | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/apps/meteor/client/views/admin/apps/BundleChips.tsx b/apps/meteor/client/views/admin/apps/BundleChips.tsx index f7f669863170..80e824adbb44 100644 --- a/apps/meteor/client/views/admin/apps/BundleChips.tsx +++ b/apps/meteor/client/views/admin/apps/BundleChips.tsx @@ -1,7 +1,7 @@ -import { Box, PositionAnimated, Tag, Tooltip, AnimatedVisibility } from '@rocket.chat/fuselage'; +import { Box, Tag } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement, RefObject } from 'react'; -import React, { Fragment, useRef, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { Fragment, useRef } from 'react'; import type { App } from './types'; @@ -16,26 +16,20 @@ type BundleChipsProps = { const BundleChips = ({ bundledIn }: BundleChipsProps): ReactElement => { const t = useTranslation(); const bundleRef = useRef(); - const [isHovered, setIsHovered] = useState(false); return ( <> {bundledIn.map((bundle) => ( - setIsHovered(true)} onMouseLeave={(): void => setIsHovered(false)}> - {bundle.bundleName} - - } - placement='top-middle' - margin={8} - visible={isHovered ? AnimatedVisibility.VISIBLE : AnimatedVisibility.HIDDEN} - > - - {t('this_app_is_included_with_subscription', { + + - + > + {bundle.bundleName} + + ))} From b6fd6bb543411a5478d5c775f70799b526ffdd27 Mon Sep 17 00:00:00 2001 From: rique223 Date: Tue, 10 Jan 2023 16:57:09 -0300 Subject: [PATCH 07/15] style: :lipstick: Remove unnecessary AppMenu margin --- .../views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx index 614368b007c2..ac2f1d3e9b4d 100644 --- a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx +++ b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx @@ -58,7 +58,7 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { - {(installed || isSubscribed) && } + {(installed || isSubscribed) && } From 9c78c32416f8b11a9cebe0e3c682275494a59cd9 Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Tue, 10 Jan 2023 17:39:53 -0300 Subject: [PATCH 08/15] review --- .../AppDetailsPage/AppDetailsPageHeader.tsx | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx index 614368b007c2..d360748423b8 100644 --- a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx +++ b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx @@ -60,23 +60,19 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { {(installed || isSubscribed) && } - - - {author?.name} - - + + {author?.name} + | - - {t('Version_version', { version })} - + {t('Version_version', { version })} {lastUpdated && ( <> - + | - + {t('Marketplace_app_last_updated', { lastUpdated, })} @@ -84,14 +80,14 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { )} - | - - - {t('Version_version', { version: versioni18nKey(app) })} + + | + {t('Version_version', { version: versioni18nKey(app) })} + {versionIncompatible && ( - + Date: Tue, 10 Jan 2023 18:04:43 -0300 Subject: [PATCH 09/15] remove mis from AppStatus to align with other elements --- .../admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/views/admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx b/apps/meteor/client/views/admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx index e6d92cd2adf0..b120c6db8c87 100644 --- a/apps/meteor/client/views/admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx +++ b/apps/meteor/client/views/admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx @@ -122,7 +122,7 @@ const AppStatus = ({ app, showStatus = true, isAppDetailsPage, installed, ...pro const shouldShowPriceDisplay = isAppDetailsPage && button; return ( - + {button && isAppDetailsPage && ( Date: Tue, 10 Jan 2023 18:09:06 -0300 Subject: [PATCH 10/15] replace Button custom styling with small variant --- .../admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/views/admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx b/apps/meteor/client/views/admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx index b120c6db8c87..330b8f26a251 100644 --- a/apps/meteor/client/views/admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx +++ b/apps/meteor/client/views/admin/apps/AppDetailsPage/tabs/AppStatus/AppStatus.tsx @@ -132,7 +132,7 @@ const AppStatus = ({ app, showStatus = true, isAppDetailsPage, installed, ...pro borderRadius='x4' invisible={!showStatus && !loading} > - {shouldShowPriceDisplay && !installed && ( - - - + )} )} {statuses?.map((status, index) => ( - + {status.tooltipText ? ( {status.label} diff --git a/apps/meteor/client/views/admin/apps/AppsList/AppRow.tsx b/apps/meteor/client/views/admin/apps/AppsList/AppRow.tsx index 05271b590d1a..ef07ed5482ee 100644 --- a/apps/meteor/client/views/admin/apps/AppsList/AppRow.tsx +++ b/apps/meteor/client/views/admin/apps/AppsList/AppRow.tsx @@ -96,7 +96,11 @@ const AppRow = (props: AppRowProps): ReactElement => { - {canUpdate && } + {canUpdate && ( + + + + )} From e21632305c60f34796c598c7c1c3a60f9b329593 Mon Sep 17 00:00:00 2001 From: rique223 Date: Fri, 13 Jan 2023 13:44:51 -0300 Subject: [PATCH 14/15] fix: :bug: Remove duplicated app version from AppDetailsPageHeader --- .../admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx index bfcc72d279bf..61477500a3cb 100644 --- a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx +++ b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx @@ -26,7 +26,6 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { iconFileData, name, author, - version, iconFileContent, installed, modifiedAt, @@ -65,7 +64,8 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { | - {t('Version_version', { version })} + + {t('Version_version', { version: versioni18nKey(app) })} {lastUpdated && ( <> @@ -84,8 +84,6 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { | - {t('Version_version', { version: versioni18nKey(app) })} - {versionIncompatible && ( Date: Fri, 13 Jan 2023 16:59:43 -0300 Subject: [PATCH 15/15] chore: divider --- .../AppDetailsPage/AppDetailsPageHeader.tsx | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx index 61477500a3cb..383b4e1cde98 100644 --- a/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx +++ b/apps/meteor/client/views/admin/apps/AppDetailsPage/AppDetailsPageHeader.tsx @@ -80,19 +80,21 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { )} - - | - - {versionIncompatible && ( - - - {incompatibleStatus?.label} - - + <> + + | + + + + + {incompatibleStatus?.label} + + + )}