Web: Client: Data Import: change routes / header

This commit is contained in:
Vladimir Khvan 2024-07-03 15:24:53 +05:00
parent b79e679a93
commit 1a1a1c1bed
4 changed files with 71 additions and 125 deletions

View File

@ -242,12 +242,6 @@ const ArticleBodyContent = (props) => {
return "Common:FreeAccessToLicensedVersion";
case "DataImport":
return t("DataImport");
case "ImportFromGoogle":
return t("ImportFromGoogle");
case "ImportFromNextcloud":
return t("ImportFromNextcloud");
case "ImportFromPortal":
return t("ImportFromPortal");
case "StorageManagement":
return t("StorageManagement");
default:

View File

@ -185,6 +185,7 @@ const SectionHeaderContent = (props) => {
setIsLoadedSectionHeader,
isSSOAvailable,
organizationName,
workspace,
} = props;
const navigate = useNavigate();
@ -341,13 +342,6 @@ const SectionHeaderContent = (props) => {
},
];
const pathname = location.pathname;
const isServicePage =
pathname.includes("google") ||
pathname.includes("nextcloud") ||
pathname.includes("onlyoffice");
return (
<StyledContainer isHeaderVisible={isHeaderVisible}>
{isHeaderVisible ? (
@ -386,7 +380,18 @@ const SectionHeaderContent = (props) => {
className="arrow-button"
/>
)}
{t(header, { organizationName })}
{t(
header === "ImportHeader"
? workspace === "GoogleWorkspace"
? "ImportFromGoogle"
: workspace === "Nextcloud"
? "ImportFromNextcloud"
: workspace === "Workspace"
? "ImportFromPortal"
: "DataImport"
: header,
{ organizationName },
)}
</div>
{isNeedPaidIcon ? (
<Badge
@ -422,51 +427,62 @@ const SectionHeaderContent = (props) => {
);
};
export default inject(({ settingsStore, currentQuotaStore, setup, common }) => {
const {
isBrandingAndCustomizationAvailable,
isRestoreAndAutoBackupAvailable,
isSSOAvailable,
} = currentQuotaStore;
const { addUsers, removeAdmins } = setup.headerAction;
const { toggleSelector } = setup;
const {
selected,
setSelected,
isHeaderIndeterminate,
isHeaderChecked,
isHeaderVisible,
deselectUser,
selectAll,
selection,
} = setup.selectionStore;
const { admins, selectorIsOpen } = setup.security.accessRight;
const { isLoadedSectionHeader, setIsLoadedSectionHeader } = common;
export default inject(
({
settingsStore,
currentQuotaStore,
setup,
common,
importAccountsStore,
}) => {
const {
isBrandingAndCustomizationAvailable,
isRestoreAndAutoBackupAvailable,
isSSOAvailable,
} = currentQuotaStore;
const { addUsers, removeAdmins } = setup.headerAction;
const { toggleSelector } = setup;
const {
selected,
setSelected,
isHeaderIndeterminate,
isHeaderChecked,
isHeaderVisible,
deselectUser,
selectAll,
selection,
} = setup.selectionStore;
const { admins, selectorIsOpen } = setup.security.accessRight;
const { isLoadedSectionHeader, setIsLoadedSectionHeader } = common;
const { organizationName } = settingsStore;
const { organizationName } = settingsStore;
return {
addUsers,
removeAdmins,
selected,
setSelected,
admins,
isHeaderIndeterminate,
isHeaderChecked,
isHeaderVisible,
deselectUser,
selectAll,
toggleSelector,
selectorIsOpen,
selection,
isLoadedSectionHeader,
setIsLoadedSectionHeader,
isBrandingAndCustomizationAvailable,
isRestoreAndAutoBackupAvailable,
isSSOAvailable,
organizationName,
};
})(
const { workspace } = importAccountsStore;
return {
addUsers,
removeAdmins,
selected,
setSelected,
admins,
isHeaderIndeterminate,
isHeaderChecked,
isHeaderVisible,
deselectUser,
selectAll,
toggleSelector,
selectorIsOpen,
selection,
isLoadedSectionHeader,
setIsLoadedSectionHeader,
isBrandingAndCustomizationAvailable,
isRestoreAndAutoBackupAvailable,
isSSOAvailable,
organizationName,
workspace,
};
},
)(
withLoading(
withTranslation(["Settings", "SingleSignOn", "Common", "JavascriptSdk"])(
observer(SectionHeaderContent),

View File

@ -371,38 +371,10 @@ export const settingsTree = [
isHeader: true,
children: [
{
id: "portal-settings_catalog-data-migration",
id: "portal-settings_catalog-data-import-child",
key: "5-0",
icon: "",
link: "migration",
tKey: "DataImport",
isCategory: true,
children: [
{
id: "portal-settings_catalog-google-data-migration",
key: "5-0-0",
icon: "",
link: "google",
tKey: "ImportFromGoogle",
isCategory: true,
},
{
id: "portal-settings_catalog-nextcloud-data-migration",
key: "5-0-1",
icon: "",
link: "nextcloud",
tKey: "ImportFromNextcloud",
isCategory: true,
},
{
id: "portal-settings_catalog-onlyoffice-data-migration",
key: "5-0-2",
icon: "",
link: "onlyoffice",
tKey: "ImportFromPortal",
isCategory: true,
},
],
link: "",
tKey: "ImportHeader",
},
],
},

View File

@ -239,30 +239,6 @@ const DataImport = loadable(() =>
() => import("../pages/PortalSettings/categories/data-import/index.tsx"),
),
);
const GoogleDataImport = loadable(() =>
componentLoader(
() =>
import(
"../pages/PortalSettings/categories/data-import/GoogleWorkspace/index.tsx"
),
),
);
const NextcloudDataImport = loadable(() =>
componentLoader(
() =>
import(
"../pages/PortalSettings/categories/data-import/NextcloudWorkspace/index.tsx"
),
),
);
const OnlyofficeDataImport = loadable(() =>
componentLoader(
() =>
import(
"../pages/PortalSettings/categories/data-import/OnlyofficeWorkspace/index.tsx"
),
),
);
const WebhookHistory = loadable(() =>
componentLoader(
@ -537,19 +513,7 @@ const PortalSettingsRoutes = {
element: <DeveloperTools />,
},
{
path: "data-import/migration",
element: <DataImport />,
},
{
path: "data-import/migration/google",
element: <DataImport />,
},
{
path: "data-import/migration/nextcloud",
element: <DataImport />,
},
{
path: "data-import/migration/onlyoffice",
path: "data-import",
element: <DataImport />,
},
{