From 94532052611812554f3a815c4dbeb5f1d10b8731 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Mon, 19 Aug 2024 13:57:16 +0300 Subject: [PATCH 1/4] Client: PortalSettings: SSO: fix style --- .../styled-containers/StyledSsoPageContainer.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledSsoPageContainer.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledSsoPageContainer.js index f37c6e5d73..6222f03346 100644 --- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledSsoPageContainer.js +++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/styled-containers/StyledSsoPageContainer.js @@ -51,16 +51,6 @@ const StyledSsoPage = styled.div` margin-bottom: 4px; } - .field-label { - display: flex; - align-items: center; - height: auto; - font-weight: 600; - line-height: 20px; - overflow: visible; - white-space: normal; - } - .xml-input { .field-label-icon { margin-bottom: 8px; From 2e734ff6667d27fb4bf59c83350264313f805a34 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Mon, 19 Aug 2024 14:21:24 +0300 Subject: [PATCH 2/4] Fix Bug 69012 No validation of required fields on SSO settings page --- .../integration/SingleSignOn/SubmitButton.js | 16 +++-------- packages/client/src/store/SsoFormStore.js | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SubmitButton.js b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SubmitButton.js index 4c12848b89..7ebc1416c6 100644 --- a/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SubmitButton.js +++ b/packages/client/src/pages/PortalSettings/categories/integration/SingleSignOn/SubmitButton.js @@ -41,13 +41,11 @@ const SubmitResetButtons = (props) => { resetForm, confirmationResetModal, isSubmitLoading, - hasErrors, - hasChanges, isLoadingXml, - enableSso, isSSOAvailable, closeResetModal, confirmReset, + isDisabledSaveButton, } = props; return ( @@ -62,9 +60,7 @@ const SubmitResetButtons = (props) => { displaySettings={true} hasScroll={true} isSaving={isSubmitLoading} - saveButtonDisabled={ - !enableSso || hasErrors || !hasChanges || isLoadingXml - } + saveButtonDisabled={isDisabledSaveButton} disableRestoreToDefault={ isSubmitLoading || isLoadingXml || !isSSOAvailable } @@ -90,12 +86,10 @@ export default inject(({ ssoStore, currentQuotaStore }) => { resetForm, confirmationResetModal, isSubmitLoading, - hasErrors, - hasChanges, isLoadingXml, - enableSso, closeResetModal, confirmReset, + isDisabledSaveButton, } = ssoStore; const { isSSOAvailable } = currentQuotaStore; @@ -106,12 +100,10 @@ export default inject(({ ssoStore, currentQuotaStore }) => { resetForm, confirmationResetModal, isSubmitLoading, - hasErrors, - hasChanges, isLoadingXml, - enableSso, isSSOAvailable, closeResetModal, confirmReset, + isDisabledSaveButton, }; })(observer(SubmitResetButtons)); diff --git a/packages/client/src/store/SsoFormStore.js b/packages/client/src/store/SsoFormStore.js index 3ba3500ef1..0d31489d6e 100644 --- a/packages/client/src/store/SsoFormStore.js +++ b/packages/client/src/store/SsoFormStore.js @@ -946,6 +946,33 @@ class SsoFormStore { ); } + get isDisabledSaveButton() { + return ( + !this.enableSso || + this.hasErrors || + !this.hasChanges || + this.isLoadingXml || + this.isRequiredFieldsEmpty + ); + } + + get isRequiredFieldsEmpty() { + return ( + this.entityId.trim().length === 0 || + (this.ssoBinding === BINDING_POST && + this.ssoUrlPost.trim().length === 0) || + (this.sloBinding === BINDING_POST && + this.sloUrlPost.trim().length === 0) || + (this.ssoBinding === BINDING_REDIRECT && + this.ssoUrlRedirect.trim().length === 0) || + (this.sloBinding === BINDING_REDIRECT && + this.sloUrlRedirect.trim().length === 0) || + this.firstName.trim().length === 0 || + this.lastName.trim().length === 0 || + this.email.trim().length === 0 + ); + } + scrollToField = () => { for (let key in this) { if (key.includes("HasError") && this[key] !== false) { From ee6df901ac96077c0388626c7699c9fa847df89b Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Mon, 19 Aug 2024 15:32:59 +0400 Subject: [PATCH 3/4] Fix Bug 69732 - [LDAP] User quota field does not work in LDAP settings because quotas are disabled by default on the portal --- i18next/client.babel | 132 ++++++++++++++++++ packages/client/public/locales/en/Ldap.json | 1 + .../LDAP/sub-components/AttributeMapping.js | 44 +++++- 3 files changed, 174 insertions(+), 3 deletions(-) diff --git a/i18next/client.babel b/i18next/client.babel index 0b92949171..d9db8a8af7 100644 --- a/i18next/client.babel +++ b/i18next/client.babel @@ -95638,6 +95638,138 @@ + + LdapQuotaInfo + + + + + + ar-SA + false + + + az-Latn-AZ + false + + + bg-BG + false + + + cs-CZ + false + + + de-DE + false + + + el-GR + false + + + en-US + false + + + es-ES + false + + + fi-FI + false + + + fr-FR + false + + + hy-AM + false + + + it-IT + false + + + ja-JP + false + + + ko-KR + false + + + lo-LA + false + + + lv-LV + false + + + nl-NL + false + + + pl-PL + false + + + pt-BR + false + + + pt-PT + false + + + ro-RO + false + + + ru-RU + false + + + si-SI + false + + + sk-SK + false + + + sl-SI + false + + + sr-Cyrl-RS + false + + + sr-Latn-RS + false + + + tr-TR + false + + + uk-UA + false + + + vi-VN + false + + + zh-CN + false + + + LdapSecondName diff --git a/packages/client/public/locales/en/Ldap.json b/packages/client/public/locales/en/Ldap.json index 6d492fca57..f8eb100cce 100644 --- a/packages/client/public/locales/en/Ldap.json +++ b/packages/client/public/locales/en/Ldap.json @@ -36,6 +36,7 @@ "LdapPortNumber": "Port Number", "LdapPortNumberTooltip": "Enter the port number for your LDAP server/Active Directory.", "LdapQuota": "User quota", + "LdapQuotaInfo": "To be able to use this attribute, enable user quota in the <0>Storage management settings", "LdapSecondName": "Second name", "LdapSendWelcomeLetter": "Send welcome letter", "LdapSendWelcomeLetterTooltip": "If checked all new users will receive welcome letter. Available only when Mail Attribute is mapped to LDAP.", diff --git a/packages/client/src/pages/PortalSettings/categories/integration/LDAP/sub-components/AttributeMapping.js b/packages/client/src/pages/PortalSettings/categories/integration/LDAP/sub-components/AttributeMapping.js index 3505190b34..4254f9f825 100644 --- a/packages/client/src/pages/PortalSettings/categories/integration/LDAP/sub-components/AttributeMapping.js +++ b/packages/client/src/pages/PortalSettings/categories/integration/LDAP/sub-components/AttributeMapping.js @@ -26,7 +26,8 @@ import React, { useRef } from "react"; import { inject, observer } from "mobx-react"; -import { useTranslation } from "react-i18next"; +import { Trans, useTranslation } from "react-i18next"; +import { useNavigate } from "react-router-dom"; import { Box } from "@docspace/shared/components/box"; import { TextInput } from "@docspace/shared/components/text-input"; @@ -39,6 +40,8 @@ import { FieldContainer } from "@docspace/shared/components/field-container"; import AccessSelector from "SRC_DIR/components/AccessSelector"; import { isMobile } from "@docspace/shared/utils"; import LdapFieldComponent from "./LdapFieldComponent"; +import { Link } from "@docspace/shared/components/link"; +import { globalColors } from "@docspace/shared/themes"; const FIRST_NAME = "firstName", SECOND_NAME = "secondName", @@ -68,10 +71,14 @@ const AttributeMapping = (props) => { isLdapEnabled, isUIDisabled, + + isDefaultUsersQuotaSet, } = props; const { t } = useTranslation("Ldap"); + const navigate = useNavigate(); + const inputsRef = useRef(); const onChangeValue = (e) => { @@ -100,6 +107,10 @@ const AttributeMapping = (props) => { setUserType(option.access); }; + const goToStarageManagement = () => { + navigate("/portal-settings/management/disk-space"); + }; + return ( <>
@@ -202,9 +213,32 @@ const AttributeMapping = (props) => { onChange={onChangeValue} value={userQuotaLimit} scale - isDisabled={!isLdapEnabled || isUIDisabled} + isDisabled={ + !isDefaultUsersQuotaSet || !isLdapEnabled || isUIDisabled + } tabIndex={11} /> + {!isDefaultUsersQuotaSet && ( + + , + ]} + /> + + )} @@ -250,7 +284,7 @@ const AttributeMapping = (props) => { ); }; -export default inject(({ ldapStore }) => { +export default inject(({ ldapStore, currentQuotaStore }) => { const { setMail, setFirstName, @@ -274,6 +308,8 @@ export default inject(({ ldapStore }) => { userType, } = requiredSettings; + const { isDefaultUsersQuotaSet } = currentQuotaStore; + return { setFirstName, setSecondName, @@ -292,5 +328,7 @@ export default inject(({ ldapStore }) => { errors, isLdapEnabled, isUIDisabled, + + isDefaultUsersQuotaSet, }; })(observer(AttributeMapping)); From eda4eee0c56e6899cb6be90ea19219a73898e1d4 Mon Sep 17 00:00:00 2001 From: Aleksandr Lushkin Date: Mon, 19 Aug 2024 14:02:03 +0200 Subject: [PATCH 4/4] Client: Add temporary empty screen for inside group. Hide filter if group is empty --- .../Home/Section/AccountsBody/EmptyScreen.js | 12 ++++++++++++ .../InsideGroup/RowView/PeopleRowContainer.js | 6 ++++-- .../InsideGroup/TableView/TableContainer.js | 5 ++++- packages/client/src/pages/Home/index.js | 9 ++++++++- packages/client/src/store/GroupsStore.ts | 18 ++++++++++++++++++ 5 files changed, 46 insertions(+), 4 deletions(-) diff --git a/packages/client/src/pages/Home/Section/AccountsBody/EmptyScreen.js b/packages/client/src/pages/Home/Section/AccountsBody/EmptyScreen.js index d5a86b17cf..9394d1ecb4 100644 --- a/packages/client/src/pages/Home/Section/AccountsBody/EmptyScreen.js +++ b/packages/client/src/pages/Home/Section/AccountsBody/EmptyScreen.js @@ -42,6 +42,7 @@ const EmptyScreen = ({ resetInsideGroupFilter, setIsLoading, theme, + isEmptyGroup = false, }) => { const { t } = useTranslation(["People", "Common"]); const isPeopleAccounts = window.location.pathname.includes("accounts/people"); @@ -57,6 +58,17 @@ const EmptyScreen = ({ const imageSrc = theme.isBase ? EmptyScreenPersonSvgUrl : EmptyScreenPersonSvgDarkUrl; + + if (isEmptyGroup) { + return ( + + ); + } + return ( <> { useViewEffect({ view: accountsViewAs, @@ -113,7 +114,7 @@ const PeopleRowContainer = ({ ))} ) : ( - + ); }; @@ -126,7 +127,7 @@ export default inject(({ peopleStore, filesStore, settingsStore }) => { } = peopleStore; const { theme, withPaging, currentDeviceType } = settingsStore; const { isVisible: infoPanelVisible } = infoPanelStore; - const { currentGroup } = peopleStore.groupsStore; + const { currentGroup, insideGroupIsFiltered } = peopleStore.groupsStore; const { peopleList } = usersStore; return { @@ -138,5 +139,6 @@ export default inject(({ peopleStore, filesStore, settingsStore }) => { infoPanelVisible, withPaging, currentDeviceType, + insideGroupIsFiltered, }; })(observer(PeopleRowContainer)); diff --git a/packages/client/src/pages/Home/Section/AccountsBody/InsideGroup/TableView/TableContainer.js b/packages/client/src/pages/Home/Section/AccountsBody/InsideGroup/TableView/TableContainer.js index bf403b0dce..7dcc3257c4 100644 --- a/packages/client/src/pages/Home/Section/AccountsBody/InsideGroup/TableView/TableContainer.js +++ b/packages/client/src/pages/Home/Section/AccountsBody/InsideGroup/TableView/TableContainer.js @@ -157,6 +157,7 @@ const Table = ({ insideGroupIsLoading, fetchMoreInsideGroupUsers, insideGroupFilterTotal, + insideGroupIsFiltered, hasMoreInsideGroupUsers, }) => { const ref = useRef(null); @@ -177,7 +178,7 @@ const Table = ({ const isEmptyPage = !insideGroupIsLoading && peopleList.length === 0; return isEmptyPage ? ( - + ) : ( { getFolderModel, scrollToTop, isEmptyGroups, + isCurrentGroupEmpty, wsCreatedPDFForm, disableUploadPanelOpen, } = props; @@ -176,7 +177,11 @@ const PureHome = (props) => { const isPeopleAccounts = location.pathname.includes("accounts/people"); const isGroupsAccounts = location.pathname.includes("accounts/groups") && !groupId; - const isAccountsEmptyFilter = isGroupsAccounts && isEmptyGroups; + const isInsideGroup = + location.pathname.includes("accounts/groups") && groupId; + const isAccountsEmptyFilter = + (isGroupsAccounts && isEmptyGroups) || + (isInsideGroup && isCurrentGroupEmpty); const { onDrop } = useFiles({ t, @@ -574,6 +579,7 @@ export default inject( fetchGroup, groups, groupsIsFiltered, + isCurrentGroupEmpty, } = groupsStore; const isEmptyGroups = !groupsIsFiltered && @@ -692,6 +698,7 @@ export default inject( getFolderModel, scrollToTop, isEmptyGroups, + isCurrentGroupEmpty, wsCreatedPDFForm, }; }, diff --git a/packages/client/src/store/GroupsStore.ts b/packages/client/src/store/GroupsStore.ts index cb05a4f998..ca184a7265 100644 --- a/packages/client/src/store/GroupsStore.ts +++ b/packages/client/src/store/GroupsStore.ts @@ -152,6 +152,24 @@ class GroupsStore { return false; } + get insideGroupIsFiltered() { + return ( + this.insideGroupFilter.activationStatus || + this.insideGroupFilter.employeeStatus || + this.insideGroupFilter.payments || + this.insideGroupFilter.search || + this.insideGroupFilter.role || + this.insideGroupFilter.accountLoginType + ); + } + + get isCurrentGroupEmpty() { + return ( + !this.insideGroupIsFiltered && + this.peopleStore.usersStore.peopleList.length === 0 + ); + } + // Inside Group Filter setInsideGroupFilter = (filter) => {