diff --git a/packages/client/src/components/dialogs/AvatarEditorDialog/index.js b/packages/client/src/components/dialogs/AvatarEditorDialog/index.js index 07d8b4f351..f26667550f 100644 --- a/packages/client/src/components/dialogs/AvatarEditorDialog/index.js +++ b/packages/client/src/components/dialogs/AvatarEditorDialog/index.js @@ -43,7 +43,9 @@ const AvatarEditorDialog = (props) => { const { visible, onClose, profile, updateCreatedAvatar, setHasAvatar } = props; const [avatar, setAvatar] = useState({ - uploadedFile: profile.hasAvatar ? profile.avatarMax : DefaultUserAvatarMax, + uploadedFile: profile.hasAvatar + ? profile.avatarOriginal + : DefaultUserAvatarMax, x: 0.5, y: 0.5, zoom: 1, @@ -63,7 +65,6 @@ const AvatarEditorDialog = (props) => { onClose(); return; } - const file = await dataUrlToFile(preview); const avatarData = new FormData(); diff --git a/packages/client/src/pages/Confirm/withLoader.js b/packages/client/src/pages/Confirm/withLoader.js index d26f97ce5e..d48b49fd87 100644 --- a/packages/client/src/pages/Confirm/withLoader.js +++ b/packages/client/src/pages/Confirm/withLoader.js @@ -35,28 +35,26 @@ export default function withLoader(WrappedComponent) { type === "EmpInvite") && !passwordSettings ) { - axios - .all([getSettings(), getPortalPasswordSettings(confirmHeader)]) - .catch((error) => { - let errorMessage = ""; - if (typeof error === "object") { - errorMessage = - error?.response?.data?.error?.message || - error?.statusText || - error?.message || - ""; - } else { - errorMessage = error; - } + getPortalPasswordSettings(confirmHeader).catch((error) => { + let errorMessage = ""; + if (typeof error === "object") { + errorMessage = + error?.response?.data?.error?.message || + error?.statusText || + error?.message || + ""; + } else { + errorMessage = error; + } - console.error(errorMessage); - navigate( - combineUrl( - window.DocSpaceConfig?.proxy?.url, - `/login/error?message=${errorMessage}` - ) - ); - }); + console.error(errorMessage); + navigate( + combineUrl( + window.DocSpaceConfig?.proxy?.url, + `/login/error?message=${errorMessage}`, + ), + ); + }); } }, [passwordSettings]); @@ -77,8 +75,8 @@ export default function withLoader(WrappedComponent) { navigate( combineUrl( window.DocSpaceConfig?.proxy?.url, - `/login/error?message=${errorMessage}` - ) + `/login/error?message=${errorMessage}`, + ), ); }); } diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/SsoComboBox.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/SsoComboBox.js index 542a465363..105d0f3b30 100644 --- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/SsoComboBox.js +++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/sub-components/SsoComboBox.js @@ -22,8 +22,8 @@ const SsoComboBox = (props) => { const currentOption = options.find((option) => option.key === value) || options[0]; - const onSelect = () => { - setComboBox(currentOption, name); + const onSelect = (option) => { + setComboBox(option, name); }; return ( diff --git a/packages/client/src/store/TargetUserStore.js b/packages/client/src/store/TargetUserStore.js index 081cdaab15..a3143452c6 100644 --- a/packages/client/src/store/TargetUserStore.js +++ b/packages/client/src/store/TargetUserStore.js @@ -84,14 +84,15 @@ class TargetUserStore { }; updateCreatedAvatar = (avatar) => { - const { big, small, medium, max } = avatar; + const { big, small, medium, max, main } = avatar; this.targetUser.avatar = big; this.targetUser.avatarSmall = small; this.targetUser.avatarMedium = medium; this.targetUser.avatarMax = max; + this.targetUser.avatarOriginal = main; - this.userStore.updateAvatarInfo(big, small, medium, max); + this.userStore.updateAvatarInfo(big, small, medium, max, main); console.log("updateCreatedAvatar", { targetUser: this.targetUser, @@ -138,7 +139,7 @@ class TargetUserStore { isEnableBadges, isEnableRoomsActivity, isEnableDailyFeed, - isEnableTips + isEnableTips, ) => { this.badgesSubscription = isEnableBadges; this.roomsActivitySubscription = isEnableRoomsActivity; diff --git a/packages/shared/api/people/types.ts b/packages/shared/api/people/types.ts index 3ad25f7bcc..59047cae3d 100644 --- a/packages/shared/api/people/types.ts +++ b/packages/shared/api/people/types.ts @@ -15,6 +15,7 @@ export type TUser = { workFrom: string; avatarMax: string; avatarMedium: string; + avatarOriginal: string; avatar: string; isAdmin: boolean; isRoomAdmin: boolean; diff --git a/packages/shared/components/filter/Filter.styled.ts b/packages/shared/components/filter/Filter.styled.ts index 0370e6d841..7b304e85c6 100644 --- a/packages/shared/components/filter/Filter.styled.ts +++ b/packages/shared/components/filter/Filter.styled.ts @@ -541,6 +541,14 @@ const StyledSortButton = styled.div<{ viewAs: TViewAs; isDesc: boolean }>` .icon-button_svg { cursor: pointer; } + :hover { + border-color: ${(props) => props.theme.iconButton.color}; + svg { + path { + fill: ${(props) => props.theme.iconButton.hoverColor}; + } + } + } } .sort-combo-box { diff --git a/packages/shared/components/image-editor/Dropzone/index.tsx b/packages/shared/components/image-editor/Dropzone/index.tsx index 91d885fbdf..28301b07f6 100644 --- a/packages/shared/components/image-editor/Dropzone/index.tsx +++ b/packages/shared/components/image-editor/Dropzone/index.tsx @@ -70,9 +70,12 @@ const Dropzone = ({ throw new Error("recursion depth exceeded"); } - return new Promise(() => { - resizeRecursiveAsync(img, canvas, compressionRatio + 1, depth + 1); - }); + return new Promise((resolve) => { + // eslint-disable-next-line no-promise-executor-return + return resolve(file); + }).then(() => + resizeRecursiveAsync(img, canvas, compressionRatio + 1, depth + 1), + ); } const onDrop = async ([file]: [File]) => { diff --git a/packages/shared/components/navigation/Navigation.tsx b/packages/shared/components/navigation/Navigation.tsx index 8d89686193..91f1405827 100644 --- a/packages/shared/components/navigation/Navigation.tsx +++ b/packages/shared/components/navigation/Navigation.tsx @@ -67,11 +67,6 @@ const Navigation = ({ const isDesktop = currentDeviceType === DeviceType.desktop; - const infoPanelIsVisible = React.useMemo( - () => isDesktop && (!isEmptyPage || (isEmptyPage && isRoom)), - [isDesktop, isEmptyPage, isRoom], - ); - const toggleDropBox = useCallback(() => { if (navigationItems?.length === 0) return; if (isRootFolder) return setIsOpen(false); @@ -263,7 +258,7 @@ const Navigation = ({ isEmptyPage={isEmptyPage} /> - {infoPanelIsVisible && !hideInfoPanel && ( + {isDesktop && !hideInfoPanel && ( = passwordSettings.minLength; + } return { - allowed: allowedCharacters, + allowed, digits, capital, special, - length: passwordSettings.minLength - ? value.trim().length >= passwordSettings.minLength - : true, + length, }; } return {} as TPasswordValidation; @@ -597,3 +597,4 @@ export { PasswordInput }; // PasswordInput.displayName = "PasswordInput"; // export { PasswordInput }; + diff --git a/packages/shared/store/SettingsStore.ts b/packages/shared/store/SettingsStore.ts index 20ca2dcefc..390d5c365f 100644 --- a/packages/shared/store/SettingsStore.ts +++ b/packages/shared/store/SettingsStore.ts @@ -186,7 +186,7 @@ class SettingsStore { limitedAccessSpace = null; - passwordSettings: TPasswordSettings = {} as TPasswordSettings; + passwordSettings: TPasswordSettings | null = null; hasShortenService = false; @@ -1100,3 +1100,4 @@ class SettingsStore { } export { SettingsStore }; + diff --git a/packages/shared/store/UserStore.ts b/packages/shared/store/UserStore.ts index a464ba26dc..a3015345fe 100644 --- a/packages/shared/store/UserStore.ts +++ b/packages/shared/store/UserStore.ts @@ -126,6 +126,7 @@ class UserStore { avatarSmall: string, avatarMedium: string, avatarMax: string, + avatarOriginal: string, ) => { if (this.user) { this.user = { @@ -134,6 +135,7 @@ class UserStore { avatarSmall, avatarMedium, avatarMax, + avatarOriginal, }; } };