;
+ updateProfileMenuItem?: (item: IProfileMenuItem) => void;
+};
diff --git a/packages/client/src/helpers/plugins/utils.js b/packages/client/src/helpers/plugins/utils.js
index 54a8181845..59ce2c6f8e 100644
--- a/packages/client/src/helpers/plugins/utils.js
+++ b/packages/client/src/helpers/plugins/utils.js
@@ -3,7 +3,7 @@ import { toastr } from "@docspace/shared/components/toast";
import config from "PACKAGE_FILE";
-import { PluginActions, PluginToastType } from "./constants";
+import { PluginActions, PluginToastType } from "./enums";
import { Events } from "@docspace/shared/enums";
export const messageActions = (
@@ -26,7 +26,7 @@ export const messageActions = (
updateEventListenerItems,
updateFileItems,
- updatePlugin
+ updatePlugin,
) => {
if (!message || !message.actions || message.actions.length === 0) return;
@@ -152,7 +152,7 @@ export const messageActions = (
if (frame) {
frame.contentWindow.postMessage(
JSON.stringify(postMessage.message),
- "*"
+ "*",
);
}
@@ -177,6 +177,6 @@ export const getPluginUrl = (url, file) => {
window.DocSpaceConfig?.proxy?.url,
config.homepage,
path,
- file
+ file,
);
};
diff --git a/packages/client/src/helpers/utils.js b/packages/client/src/helpers/utils.js
index 869c950300..a4c1baa72a 100644
--- a/packages/client/src/helpers/utils.js
+++ b/packages/client/src/helpers/utils.js
@@ -7,7 +7,7 @@ import { FolderType, ShareAccessRights } from "@docspace/shared/enums";
import { translations } from "./autoGeneratedTranslations";
// import router from "SRC_DIR/router";
-export const setDocumentTitle = (subTitle = null) => {
+export const setDocumentTitle = (subTitle = "") => {
const { isAuthenticated, product: currentModule } = authStore;
const { organizationName } = settingsStore;
diff --git a/packages/client/src/pages/Bonus/index.js b/packages/client/src/pages/Bonus/index.js
index fc5c5415aa..3ed9fd0fa3 100644
--- a/packages/client/src/pages/Bonus/index.js
+++ b/packages/client/src/pages/Bonus/index.js
@@ -32,8 +32,8 @@ const Bonus = ({ standaloneInit, isInitPaymentPage }) => {
);
};
-export default inject(({ payments }) => {
- const { standaloneInit, isInitPaymentPage } = payments;
+export default inject(({ paymentStore }) => {
+ const { standaloneInit, isInitPaymentPage } = paymentStore;
return {
standaloneInit,
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/Home/InfoPanel/Body/views/Accounts/index.js b/packages/client/src/pages/Home/InfoPanel/Body/views/Accounts/index.js
index 8fd99e1ea0..dde1304439 100644
--- a/packages/client/src/pages/Home/InfoPanel/Body/views/Accounts/index.js
+++ b/packages/client/src/pages/Home/InfoPanel/Body/views/Accounts/index.js
@@ -10,6 +10,7 @@ import { ComboBox } from "@docspace/shared/components/combobox";
import { getUserStatus } from "SRC_DIR/helpers/people-helpers";
import { StyledAccountContent } from "../../styles/accounts";
+import { getUserTypeLabel } from "@docspace/shared/utils/common";
const Accounts = (props) => {
const {
@@ -46,21 +47,6 @@ const Accounts = (props) => {
}
}, [infoPanelSelection]);
- const getUserTypeLabel = React.useCallback((role) => {
- switch (role) {
- case "owner":
- return t("Common:Owner");
- case "admin":
- return t("Common:DocSpaceAdmin");
- case "manager":
- return t("Common:RoomAdmin");
- case "collaborator":
- return t("Common:PowerUser");
- case "user":
- return t("Common:User");
- }
- }, []);
-
const getTypesOptions = React.useCallback(() => {
const options = [];
@@ -128,10 +114,10 @@ const Accounts = (props) => {
setIsLoading(false);
}
},
- [infoPanelSelection, changeUserType, t]
+ [infoPanelSelection, changeUserType, t],
);
- const typeLabel = getUserTypeLabel(role);
+ const typeLabel = React.useCallback(() => getUserTypeLabel(role, t), [])();
const renderTypeData = () => {
const typesOptions = getTypesOptions();
@@ -248,7 +234,7 @@ export default inject(
getPeopleListItem: usersStore.getPeopleListItem,
setInfoPanelSelection,
};
- }
+ },
)(
withTranslation([
"People",
@@ -263,7 +249,7 @@ export default inject(
"Translations",
])(
withLoader(observer(Accounts))(
-
- )
- )
+ ,
+ ),
+ ),
);
diff --git a/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js b/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js
index feb5c56efd..fd2dc9f02d 100644
--- a/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js
+++ b/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js
@@ -9,9 +9,8 @@ import { toastr } from "@docspace/shared/components/toast";
import { isMobileOnly, isMobile } from "react-device-detect";
import { decode } from "he";
import { filterUserRoleOptions } from "SRC_DIR/helpers";
-import { capitalize } from "lodash";
-import { getUserRole } from "@docspace/shared/utils/common";
+import { getUserRole, getUserTypeLabel } from "@docspace/shared/utils/common";
import { Text } from "@docspace/shared/components/text";
import EmailPlusReactSvgUrl from "PUBLIC_DIR/images/e-mail+.react.svg?url";
import { StyledUserTypeHeader } from "../../styles/members";
@@ -48,7 +47,7 @@ const User = ({
const fullRoomRoleOptions = membersHelper.getOptionsByRoomType(
infoPanelSelection.roomType,
- canChangeUserRole
+ canChangeUserRole,
);
const userRole = membersHelper.getOptionByUserAccess(user.access, user);
@@ -57,7 +56,7 @@ const User = ({
const onRepeatInvitation = async () => {
resendEmailInvitations(infoPanelSelection.id, true)
.then(() =>
- toastr.success(t("PeopleTranslations:SuccessSentMultipleInvitatios"))
+ toastr.success(t("PeopleTranslations:SuccessSentMultipleInvitatios")),
)
.catch((err) => toastr.error(err));
};
@@ -77,10 +76,10 @@ const User = ({
const newMembers = {
users: infoPanelMembers.users?.filter((m) => m.id !== user.id),
administrators: infoPanelMembers.administrators?.filter(
- (m) => m.id !== user.id
+ (m) => m.id !== user.id,
),
expected: infoPanelMembers.expected?.filter(
- (m) => m.id !== user.id
+ (m) => m.id !== user.id,
),
};
@@ -129,13 +128,13 @@ const User = ({
setInfoPanelMembers({
roomId: infoPanelSelection.id,
users: infoPanelMembers.users?.map((m) =>
- m.id === user.id ? { ...m, access: option.access } : m
+ m.id === user.id ? { ...m, access: option.access } : m,
),
administrators: infoPanelMembers.administrators?.map((m) =>
- m.id === user.id ? { ...m, access: option.access } : m
+ m.id === user.id ? { ...m, access: option.access } : m,
),
expected: infoPanelMembers.expected?.map((m) =>
- m.id === user.id ? { ...m, access: option.access } : m
+ m.id === user.id ? { ...m, access: option.access } : m,
),
});
}
@@ -182,6 +181,8 @@ const User = ({
const onToggle = (e, isOpen) => {
// setIsScrollLocked(isOpen);
};
+ const role = getUserRole(user);
+ const typeLabel = getUserTypeLabel(role, t);
const getTooltipContent = () => (
@@ -197,15 +198,13 @@ const User = ({
color="#A3A9AE !important"
dir="auto"
>
- {`${capitalize(role)} | ${user.email}`}
+ {`${typeLabel} | ${user.email}`}
);
const userAvatar = user.hasAvatar ? user.avatar : DefaultUserPhotoUrl;
- const role = getUserRole(user);
-
const withTooltip = user.isOwner || user.isAdmin;
const uniqueTooltipId = `userTooltip_${Math.random()}`;
@@ -269,7 +268,7 @@ const User = ({
color="#A3A9AE"
dir="auto"
>
- {`${capitalize(role)} | ${user.email}`}
+ {`${typeLabel} | ${user.email}`}
diff --git a/packages/client/src/pages/Home/InfoPanel/Body/views/Plugin/index.js b/packages/client/src/pages/Home/InfoPanel/Body/views/Plugin/index.js
index 845b403b6b..8436b1e0a3 100644
--- a/packages/client/src/pages/Home/InfoPanel/Body/views/Plugin/index.js
+++ b/packages/client/src/pages/Home/InfoPanel/Body/views/Plugin/index.js
@@ -2,7 +2,7 @@ import React from "react";
import { inject, observer } from "mobx-react";
import WrappedComponent from "SRC_DIR/helpers/plugins/WrappedComponent";
-import { PluginComponents } from "SRC_DIR/helpers/plugins/constants";
+import { PluginComponents } from "SRC_DIR/helpers/plugins/enums";
const Plugin = ({ boxProps, pluginName }) => {
return (
diff --git a/packages/client/src/pages/Home/InfoPanel/Header/index.js b/packages/client/src/pages/Home/InfoPanel/Header/index.js
index c92dc4ef6f..26211372cf 100644
--- a/packages/client/src/pages/Home/InfoPanel/Header/index.js
+++ b/packages/client/src/pages/Home/InfoPanel/Header/index.js
@@ -15,7 +15,7 @@ import {
import { StyledInfoPanelHeader } from "./styles/common";
-import { PluginFileType } from "SRC_DIR/helpers/plugins/constants";
+import { PluginFileType } from "SRC_DIR/helpers/plugins/enums";
const InfoPanelHeaderContent = (props) => {
const {
@@ -245,12 +245,12 @@ export default inject(
enablePlugins,
};
- }
+ },
)(
withTranslation(["Common", "InfoPanel"])(
- InfoPanelHeaderContent
+ InfoPanelHeaderContent,
// withLoader(observer(InfoPanelHeaderContent))(
//
// )
- )
+ ),
);
diff --git a/packages/client/src/pages/Home/MediaViewer/index.js b/packages/client/src/pages/Home/MediaViewer/index.js
index 33ef18e672..87d0870ec5 100644
--- a/packages/client/src/pages/Home/MediaViewer/index.js
+++ b/packages/client/src/pages/Home/MediaViewer/index.js
@@ -4,7 +4,7 @@ import { withTranslation } from "react-i18next";
import { useNavigate, useLocation } from "react-router-dom";
import queryString from "query-string";
-import { PluginFileType } from "SRC_DIR/helpers/plugins/constants";
+import { PluginFileType } from "SRC_DIR/helpers/plugins/enums";
import { MEDIA_VIEW_URL } from "@docspace/shared/constants";
import { combineUrl } from "@docspace/shared/utils/combineUrl";
@@ -118,7 +118,7 @@ const FilesMediaViewer = (props) => {
setCurrentId(id);
navigate(url);
},
- [setCurrentId, navigate]
+ [setCurrentId, navigate],
);
const resetSelection = () => {
@@ -159,7 +159,7 @@ const FilesMediaViewer = (props) => {
// try to fix with one check later (see deleteAction)
const isActiveFile = activeFiles.find((elem) => elem.id === file.id);
const isActiveFolder = activeFolders.find(
- (elem) => elem.id === file.id
+ (elem) => elem.id === file.id,
);
if (isActiveFile || isActiveFolder) return;
@@ -169,7 +169,14 @@ const FilesMediaViewer = (props) => {
}
}
},
- [files, t, activeFiles, activeFolders, setRemoveMediaItem, deleteItemAction]
+ [
+ files,
+ t,
+ activeFiles,
+ activeFolders,
+ setRemoveMediaItem,
+ deleteItemAction,
+ ],
);
const onDownloadMediaFile = useCallback(
@@ -179,7 +186,7 @@ const FilesMediaViewer = (props) => {
return window.open(viewUrlFile, "_self");
}
},
- [playlist]
+ [playlist],
);
const onMediaViewerClose = useCallback(
@@ -227,7 +234,7 @@ const FilesMediaViewer = (props) => {
setToPreviewFile,
setMediaViewerData,
setBufferSelection,
- ]
+ ],
);
useEffect(() => {
if (playlist.length === 0 && isOpenMediaViewer) onMediaViewerClose();
@@ -422,5 +429,5 @@ export default inject(
pluginContextMenuItems,
currentDeviceType,
};
- }
+ },
)(withTranslation(["Files", "Translations"])(observer(FilesMediaViewer)));
diff --git a/packages/client/src/pages/Home/Section/AccountsBody/TableView/TableRow.js b/packages/client/src/pages/Home/Section/AccountsBody/TableView/TableRow.js
index 92573e80bf..a1e80d1cf3 100644
--- a/packages/client/src/pages/Home/Section/AccountsBody/TableView/TableRow.js
+++ b/packages/client/src/pages/Home/Section/AccountsBody/TableView/TableRow.js
@@ -14,6 +14,7 @@ import withContent from "SRC_DIR/HOCs/withPeopleContent";
import Badges from "../Badges";
import { Base } from "@docspace/shared/themes";
+import { getUserTypeLabel } from "@docspace/shared/utils/common";
const StyledWrapper = styled.div`
display: contents;
@@ -308,7 +309,7 @@ const PeopleTableRow = (props) => {
setIsLoading(false);
}
},
- [item, changeUserType]
+ [item, changeUserType],
);
// const getRoomsOptions = React.useCallback(() => {
@@ -328,22 +329,7 @@ const PeopleTableRow = (props) => {
// return <>{options.map((option) => option)}>;
// }, []);
- const getUserTypeLabel = React.useCallback((role) => {
- switch (role) {
- case "owner":
- return t("Common:Owner");
- case "admin":
- return t("Common:DocSpaceAdmin");
- case "manager":
- return t("Common:RoomAdmin");
- case "collaborator":
- return t("Common:PowerUser");
- case "user":
- return t("Common:User");
- }
- }, []);
-
- const typeLabel = getUserTypeLabel(role);
+ const typeLabel = React.useCallback(() => getUserTypeLabel(role, t), [])();
const isChecked = checkedProps.checked;
@@ -532,5 +518,5 @@ const PeopleTableRow = (props) => {
};
export default withTranslation(["People", "Common", "Settings"])(
- withContent(PeopleTableRow)
+ withContent(PeopleTableRow),
);
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Branding/additionalResources.js b/packages/client/src/pages/PortalSettings/categories/common/Branding/additionalResources.js
index 9d0a35ad66..5a47fe3107 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Branding/additionalResources.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Branding/additionalResources.js
@@ -283,7 +283,7 @@ const AdditionalResources = (props) => {
);
};
-export default inject(({ filesSettingsStore, common, currentQuotaStore }) => {
+export default inject(({ settingsStore, common, currentQuotaStore }) => {
const { setIsLoadedAdditionalResources, isLoadedAdditionalResources } =
common;
@@ -292,7 +292,7 @@ export default inject(({ filesSettingsStore, common, currentQuotaStore }) => {
additionalResourcesData,
additionalResourcesIsDefault,
- } = filesSettingsStore;
+ } = settingsStore;
const { isBrandingAndCustomizationAvailable } = currentQuotaStore;
diff --git a/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js b/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js
index 2a3c5f72ab..7a63f96a66 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js
@@ -148,7 +148,7 @@ const WhiteLabel = (props) => {
const onRestoreDefault = async () => {
try {
- await restoreWhiteLabelSettings(true);
+ await restoreWhiteLabelSettings();
await onResetCompanyName();
toastr.success(t("Settings:SuccessfullySaveSettingsMessage"));
} catch (error) {
diff --git a/packages/client/src/pages/PortalSettings/categories/common/index.js b/packages/client/src/pages/PortalSettings/categories/common/index.js
index 029231ed0b..27021883a4 100644
--- a/packages/client/src/pages/PortalSettings/categories/common/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/common/index.js
@@ -23,6 +23,7 @@ const SubmenuCommon = (props) => {
isLoadedSubmenu,
getWhiteLabelLogoUrls,
currentDeviceType,
+ isMobileView,
} = props;
const navigate = useNavigate();
@@ -41,7 +42,10 @@ const SubmenuCommon = (props) => {
}, [tReady, isLoadedSubmenu]);
const load = async () => {
- await loadBaseInfo();
+ const currentTab = getCurrentTab();
+ await loadBaseInfo(
+ !isMobileView ? (currentTab === 0 ? "general" : "branding") : ""
+ );
};
const data = [
@@ -111,13 +115,14 @@ export default inject(({ settingsStore, common }) => {
const isMobileView = currentDeviceType === DeviceType.mobile;
return {
- loadBaseInfo: async () => {
- await initSettings(!isMobileView ? "general" : "");
+ loadBaseInfo: async (page) => {
+ await initSettings(page);
},
isLoaded,
setIsLoadedSubmenu,
isLoadedSubmenu,
getWhiteLabelLogoUrls,
currentDeviceType,
+ isMobileView,
};
})(withLoading(withTranslation("Settings")(observer(SubmenuCommon))));
diff --git a/packages/client/src/pages/PortalSettings/categories/integration/Plugins/sub-components/plugin.js b/packages/client/src/pages/PortalSettings/categories/integration/Plugins/sub-components/plugin.js
index 663b391c5c..01af364755 100644
--- a/packages/client/src/pages/PortalSettings/categories/integration/Plugins/sub-components/plugin.js
+++ b/packages/client/src/pages/PortalSettings/categories/integration/Plugins/sub-components/plugin.js
@@ -8,7 +8,7 @@ import PluginSettingsIconUrl from "PUBLIC_DIR/images/plugin.settings.react.svg?u
import PluginDefaultLogoUrl from "PUBLIC_DIR/images/plugin.default-logo.png";
import { getPluginUrl } from "SRC_DIR/helpers/plugins/utils";
-import { PluginScopes } from "SRC_DIR/helpers/plugins/constants";
+import { PluginScopes } from "SRC_DIR/helpers/plugins/enums";
import { StyledPluginItem, StyledPluginHeader } from "../StyledPlugins";
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/pages/PortalSettings/categories/payments/SaaS/ContactContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/ContactContainer.js
index ba5a09b2fb..3ef2513d7d 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/ContactContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/ContactContainer.js
@@ -41,8 +41,8 @@ const ContactContainer = ({ t, salesEmail }) => {
);
};
-export default inject(({ payments, settingsStore }) => {
- const { salesEmail } = payments;
+export default inject(({ paymentStore, settingsStore }) => {
+ const { salesEmail } = paymentStore;
return {
salesEmail,
theme: settingsStore.theme,
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PayerInformationContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PayerInformationContainer.js
index e984f65305..b4000996ea 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PayerInformationContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PayerInformationContainer.js
@@ -233,8 +233,8 @@ const PayerInformationContainer = ({
};
export default inject(
- ({ settingsStore, payments, userStore, currentTariffStatusStore }) => {
- const { accountLink, isStripePortalAvailable } = payments;
+ ({ settingsStore, paymentStore, userStore, currentTariffStatusStore }) => {
+ const { accountLink, isStripePortalAvailable } = paymentStore;
const { theme } = settingsStore;
const { customerId, isGracePeriod, isNotPaidPeriod, payerInfo } =
currentTariffStatusStore;
@@ -250,5 +250,5 @@ export default inject(
isGracePeriod,
isNotPaidPeriod,
};
- }
+ },
)(observer(PayerInformationContainer));
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PaymentContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PaymentContainer.js
index 09198c1bea..342348f987 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PaymentContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PaymentContainer.js
@@ -339,7 +339,7 @@ export default inject(
({
settingsStore,
currentQuotaStore,
- payments,
+ paymentStore,
paymentQuotasStore,
currentTariffStatusStore,
}) => {
@@ -363,7 +363,7 @@ export default inject(
const { planCost, tariffPlanTitle, portalPaymentQuotas } =
paymentQuotasStore;
- const { isAlreadyPaid } = payments;
+ const { isAlreadyPaid } = paymentStore;
return {
paymentDate,
@@ -390,5 +390,5 @@ export default inject(
isNonProfit,
isPaymentDateValid,
};
- }
+ },
)(observer(PaymentContainer));
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PriceCalculation.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PriceCalculation.js
index 6fb05408de..35dc218138 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PriceCalculation.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/PriceCalculation.js
@@ -179,7 +179,7 @@ const PriceCalculation = ({
export default inject(
({
settingsStore,
- payments,
+ paymentStore,
paymentQuotasStore,
currentTariffStatusStore,
}) => {
@@ -193,7 +193,7 @@ export default inject(
isAlreadyPaid,
getPaymentLink,
canUpdateTariff,
- } = payments;
+ } = paymentStore;
const { theme } = settingsStore;
const { planCost } = paymentQuotasStore;
@@ -217,5 +217,5 @@ export default inject(
currencySymbol: planCost.currencySymbol,
getPaymentLink,
};
- }
+ },
)(observer(PriceCalculation));
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/index.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/index.js
index f478674c91..6469a7c437 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/index.js
@@ -42,7 +42,7 @@ const SaaSPage = ({
setEncryptionKeys,
false,
null,
- t
+ t,
);
}
return () => resetTariffContainerToBasic();
@@ -72,7 +72,7 @@ export default inject(
({
authStore,
settingsStore,
- payments,
+ paymentStore,
userStore,
currentQuotaStore,
currentTariffStatusStore,
@@ -90,7 +90,7 @@ export default inject(
init,
isUpdatingBasicSettings,
resetTariffContainerToBasic,
- } = payments;
+ } = paymentStore;
const {
isEncryptionSupport,
setEncryptionKeys,
@@ -116,5 +116,5 @@ export default inject(
isLoadedCurrentQuota,
isUpdatingBasicSettings,
};
- }
+ },
)(observer(SaaSPage));
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/ButtonContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/ButtonContainer.js
index ca7cac44b0..c904faa6a4 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/ButtonContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/ButtonContainer.js
@@ -49,8 +49,8 @@ const ButtonContainer = ({
);
};
-export default inject(({ currentTariffStatusStore, payments }) => {
- const { isNeedRequest, isLoading, accountLink } = payments;
+export default inject(({ currentTariffStatusStore, paymentStore }) => {
+ const { isNeedRequest, isLoading, accountLink } = paymentStore;
const { isNotPaidPeriod, isGracePeriod } = currentTariffStatusStore;
return {
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/DowngradePlanButtonContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/DowngradePlanButtonContainer.js
index 617ad6c052..18cb51fff4 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/DowngradePlanButtonContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/DowngradePlanButtonContainer.js
@@ -59,7 +59,7 @@ const DowngradePlanButtonContainer = ({
);
};
-export default inject(({ payments }) => {
+export default inject(({ paymentStore }) => {
const {
isLoading,
isLessCountThanAcceptable,
@@ -67,7 +67,7 @@ export default inject(({ payments }) => {
canPayTariff,
isAlreadyPaid,
- } = payments;
+ } = paymentStore;
return {
isLoading,
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/RequestButtonContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/RequestButtonContainer.js
index 894f3c827a..e8ed193ddc 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/RequestButtonContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/RequestButtonContainer.js
@@ -44,8 +44,8 @@ const RequestButtonContainer = ({ isDisabled, isLoading }) => {
);
};
-export default inject(({ payments }) => {
- const { isLoading } = payments;
+export default inject(({ paymentStore }) => {
+ const { isLoading } = paymentStore;
return {
isLoading,
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/SelectTotalSizeContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/SelectTotalSizeContainer.js
index 77df1fa7d0..1e3278bece 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/SelectTotalSizeContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/SelectTotalSizeContainer.js
@@ -43,10 +43,10 @@ const SelectTotalSizeContainer = ({
);
};
-export default inject(({ settingsStore, paymentQuotasStore, payments }) => {
+export default inject(({ settingsStore, paymentQuotasStore, paymentStore }) => {
const { usedTotalStorageSizeTitle } = paymentQuotasStore;
const { theme } = settingsStore;
- const { allowedStorageSizeByQuota } = payments;
+ const { allowedStorageSizeByQuota } = paymentStore;
return {
theme,
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/SelectUsersCountContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/SelectUsersCountContainer.js
index dbbb3abf90..371efa770d 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/SelectUsersCountContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/SelectUsersCountContainer.js
@@ -313,7 +313,7 @@ const SelectUsersCountContainer = ({
);
};
-export default inject(({ paymentQuotasStore, payments }) => {
+export default inject(({ paymentQuotasStore, paymentStore }) => {
const {
isLoading,
minAvailableManagersValue,
@@ -324,7 +324,7 @@ export default inject(({ paymentQuotasStore, payments }) => {
isLessCountThanAcceptable,
stepByQuotaForManager,
isAlreadyPaid,
- } = payments;
+ } = paymentStore;
const { addedManagersCountTitle } = paymentQuotasStore;
const step = stepByQuotaForManager;
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/TotalTariffContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/TotalTariffContainer.js
index b0642b52b1..2da023ebfc 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/TotalTariffContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/TotalTariffContainer.js
@@ -123,10 +123,10 @@ const TotalTariffContainer = ({
);
};
-export default inject(({ settingsStore, payments, paymentQuotasStore }) => {
+export default inject(({ settingsStore, paymentStore, paymentQuotasStore }) => {
const { theme } = settingsStore;
const { isLoading, totalPrice, isNeedRequest, maxAvailableManagersCount } =
- payments;
+ paymentStore;
const { planCost } = paymentQuotasStore;
return {
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/UpdatePlanButtonContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/UpdatePlanButtonContainer.js
index 094ff7fc92..0e4a6757b6 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/UpdatePlanButtonContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/SaaS/sub-components/UpdatePlanButtonContainer.js
@@ -63,7 +63,7 @@ const UpdatePlanButtonContainer = ({
const resetIntervalSuccess = () => {
intervalId &&
toastr.success(
- t("BusinessUpdated", { planName: currentTariffPlanTitle })
+ t("BusinessUpdated", { planName: currentTariffPlanTitle }),
);
clearInterval(intervalId);
intervalId = null;
@@ -187,7 +187,7 @@ const UpdatePlanButtonContainer = ({
};
export default inject(
- ({ currentQuotaStore, payments, currentTariffStatusStore }) => {
+ ({ currentQuotaStore, paymentStore, currentTariffStatusStore }) => {
const {
maxCountManagersByQuota,
setPortalQuotaValue,
@@ -206,7 +206,7 @@ export default inject(
accountLink,
isAlreadyPaid,
canPayTariff,
- } = payments;
+ } = paymentStore;
return {
canPayTariff,
@@ -224,5 +224,5 @@ export default inject(
setPortalQuotaValue,
currentTariffPlanTitle,
};
- }
+ },
)(observer(UpdatePlanButtonContainer));
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/EnterpriseContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/EnterpriseContainer.js
index 49ac31da6a..68f1d2d6b1 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/EnterpriseContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/EnterpriseContainer.js
@@ -51,8 +51,8 @@ const EnterpriseContainer = (props) => {
);
};
-export default inject(({ payments, currentTariffStatusStore }) => {
- const { buyUrl, salesEmail } = payments;
+export default inject(({ paymentStore, currentTariffStatusStore }) => {
+ const { buyUrl, salesEmail } = paymentStore;
const { isLicenseDateExpired } = currentTariffStatusStore;
return { buyUrl, salesEmail, isLicenseDateExpired };
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/LicenseContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/LicenseContainer.js
index 9dbf96e8bb..d39b1f1ba7 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/LicenseContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/LicenseContainer.js
@@ -89,14 +89,14 @@ const LicenseContainer = (props) => {
);
};
-export default inject(({ payments }) => {
+export default inject(({ paymentStore }) => {
const {
setPaymentsLicense,
acceptPaymentsLicense,
isLicenseCorrect,
setIsLoading,
isLoading,
- } = payments;
+ } = paymentStore;
return {
setPaymentsLicense,
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/index.js b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/index.js
index b2e5d222be..97845dd48e 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/index.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/index.js
@@ -51,9 +51,10 @@ const StandalonePage = (props) => {
};
export default inject(
- ({ currentQuotaStore, payments, currentTariffStatusStore }) => {
+ ({ currentQuotaStore, paymentStore, currentTariffStatusStore }) => {
+
const { standaloneInit, isInitPaymentPage, isUpdatingBasicSettings } =
- payments;
+ paymentStore;
const { isLoaded: isLoadedCurrentQuota, isTrial } = currentQuotaStore;
const { isLoaded: isLoadedTariffStatus } = currentTariffStatusStore;
@@ -65,5 +66,5 @@ export default inject(
isLoadedCurrentQuota,
isUpdatingBasicSettings,
};
- }
+ },
)(observer(StandalonePage));
diff --git a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/sub-components/ButtonContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/sub-components/ButtonContainer.js
index 78d490e150..50826c0c5a 100644
--- a/packages/client/src/pages/PortalSettings/categories/payments/Standalone/sub-components/ButtonContainer.js
+++ b/packages/client/src/pages/PortalSettings/categories/payments/Standalone/sub-components/ButtonContainer.js
@@ -21,8 +21,8 @@ const ButtonContainer = ({ t, buyUrl }) => {
);
};
-export default inject(({ payments }) => {
- const { buyUrl } = payments;
+export default inject(({ paymentStore }) => {
+ const { buyUrl } = paymentStore;
return {
buyUrl,
diff --git a/packages/client/src/pages/PreparationPortal/index.js b/packages/client/src/pages/PreparationPortal/index.js
index 7ff172ffd9..bae5aa6328 100644
--- a/packages/client/src/pages/PreparationPortal/index.js
+++ b/packages/client/src/pages/PreparationPortal/index.js
@@ -145,6 +145,13 @@ const PreparationPortal = (props) => {
returnToPortal();
}
} catch (error) {
+ const status = err?.response?.status;
+ const needCreationTableTime = status === 404;
+
+ if (needCreationTableTime) {
+ return;
+ }
+
clearAllIntervals();
setErrorMessage(error);
}
@@ -249,7 +256,7 @@ const PreparationPortalWrapper = inject(({ backup }) => {
multiplicationFactor,
};
})(
- withTranslation(["PreparationPortal", "Common"])(observer(PreparationPortal))
+ withTranslation(["PreparationPortal", "Common"])(observer(PreparationPortal)),
);
PreparationPortal.propTypes = {
diff --git a/packages/client/src/pages/Wizard/index.js b/packages/client/src/pages/Wizard/index.js
index d6adbc3882..6f93a2c995 100644
--- a/packages/client/src/pages/Wizard/index.js
+++ b/packages/client/src/pages/Wizard/index.js
@@ -3,7 +3,7 @@ import axios from "axios";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
import { inject, observer } from "mobx-react";
-
+import api from "@docspace/shared/api";
import { Text } from "@docspace/shared/components/text";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { EmailInput } from "@docspace/shared/components/email-input";
@@ -70,7 +70,7 @@ const Wizard = (props) => {
cultureNames,
culture,
hashSettings,
- setPortalOwner,
+
setWizardComplete,
isLicenseRequired,
setLicense,
@@ -133,7 +133,7 @@ const Wizard = (props) => {
])
.then(() => {
const select = cultureNames.filter(
- (lang) => lang.key === convertedCulture
+ (lang) => lang.key === convertedCulture,
);
if (select.length === 0) {
@@ -255,13 +255,13 @@ const Wizard = (props) => {
const hash = createPasswordHash(password, hashSettings);
try {
- await setPortalOwner(
+ await api.settings.setPortalOwner(
emailTrim,
hash,
selectedLanguage.key,
selectedTimezone.key,
wizardToken,
- analytics
+ analytics,
);
setCookie(LANGUAGE, selectedLanguage.key, {
@@ -500,7 +500,7 @@ const Wizard = (props) => {
);
};
-export default inject(({ authStore, settingsStore, wizard }) => {
+export default inject(({ authStore, settingsStore, wizardStore }) => {
const {
passwordSettings,
wizardToken,
@@ -522,10 +522,10 @@ export default inject(({ authStore, settingsStore, wizard }) => {
setIsWizardLoaded,
getMachineName,
getIsRequiredLicense,
- setPortalOwner,
+
setLicense,
resetLicenseUploaded,
- } = wizard;
+ } = wizardStore;
return {
theme,
@@ -546,7 +546,7 @@ export default inject(({ authStore, settingsStore, wizard }) => {
setIsWizardLoaded,
getMachineName,
getIsRequiredLicense,
- setPortalOwner,
+
setLicense,
resetLicenseUploaded,
};
diff --git a/packages/client/src/store/AvatarEditorStore.js b/packages/client/src/store/AvatarEditorStore.js
deleted file mode 100644
index 0df7892bea..0000000000
--- a/packages/client/src/store/AvatarEditorStore.js
+++ /dev/null
@@ -1,48 +0,0 @@
-import { action, makeObservable, observable } from "mobx";
-
-class AvatarEditorStore {
- visible = false;
- avatarMax = null;
- createdAvatar = {
- tmpFile: "",
- image: null,
- defaultWidth: 0,
- defaultHeight: 0,
- x: 0,
- y: 0,
- width: 0,
- height: 0,
- };
- croppedAvatar = null;
-
- constructor() {
- makeObservable(this, {
- visible: observable,
- avatarMax: observable,
- createdAvatar: observable,
- croppedAvatar: observable,
- toggleAvatarEditor: action,
- setAvatarMax: action,
- setCreatedAvatar: action,
- setCroppedAvatar: action,
- });
- }
-
- toggleAvatarEditor = (isVisible) => {
- return (this.visible = isVisible);
- };
-
- setAvatarMax = (avatarMax) => {
- return (this.avatarMax = avatarMax);
- };
-
- setCreatedAvatar = (avatar) => {
- return (this.createdAvatar = avatar);
- };
-
- setCroppedAvatar = (croppedAvatar) => {
- return (this.croppedAvatar = croppedAvatar);
- };
-}
-
-export default AvatarEditorStore;
diff --git a/packages/client/src/store/CommonStore.js b/packages/client/src/store/CommonStore.js
index abbe8c0e72..6dadd623c8 100644
--- a/packages/client/src/store/CommonStore.js
+++ b/packages/client/src/store/CommonStore.js
@@ -156,10 +156,10 @@ class CommonStore {
this.enableRestoreButton = enableRestoreButton;
};
- restoreWhiteLabelSettings = async (isDefault) => {
+ restoreWhiteLabelSettings = async () => {
const { getWhiteLabelLogoUrls } = this.settingsStore;
- await api.settings.restoreWhiteLabelSettings(isDefault, isManagement());
+ await api.settings.restoreWhiteLabelSettings(isManagement());
await getWhiteLabelLogoUrls();
this.getWhiteLabelLogoUrls();
this.getIsDefaultWhiteLabel();
diff --git a/packages/client/src/store/FilesStore.js b/packages/client/src/store/FilesStore.js
index 37249f6abb..94ce8eed6f 100644
--- a/packages/client/src/store/FilesStore.js
+++ b/packages/client/src/store/FilesStore.js
@@ -30,7 +30,7 @@ import {
} from "SRC_DIR/helpers/utils";
import { isDesktop, isMobile } from "@docspace/shared/utils";
-import { PluginFileType } from "SRC_DIR/helpers/plugins/constants";
+import { PluginFileType } from "SRC_DIR/helpers/plugins/enums";
import { CategoryType } from "SRC_DIR/helpers/constants";
import debounce from "lodash.debounce";
@@ -161,7 +161,7 @@ class FilesStore {
infoPanelStore,
userStore,
currentTariffStatusStore,
- settingsStore
+ settingsStore,
) {
const pathname = window.location.pathname.toLowerCase();
this.isEditor = pathname.indexOf("doceditor") !== -1;
@@ -292,7 +292,7 @@ class FilesStore {
foundIndex,
count > 0
? this.files[foundIndex].fileStatus | FileStatus.IsNew
- : this.files[foundIndex].fileStatus & ~FileStatus.IsNew
+ : this.files[foundIndex].fileStatus & ~FileStatus.IsNew,
);
});
@@ -311,12 +311,12 @@ class FilesStore {
this.updateSelectionStatus(
id,
this.files[foundIndex].fileStatus | FileStatus.IsEditing,
- true
+ true,
);
this.updateFileStatus(
foundIndex,
- this.files[foundIndex].fileStatus | FileStatus.IsEditing
+ this.files[foundIndex].fileStatus | FileStatus.IsEditing,
);
});
@@ -334,12 +334,12 @@ class FilesStore {
this.updateSelectionStatus(
id,
this.files[foundIndex].fileStatus & ~FileStatus.IsEditing,
- false
+ false,
);
this.updateFileStatus(
foundIndex,
- this.files[foundIndex].fileStatus & ~FileStatus.IsEditing
+ this.files[foundIndex].fileStatus & ~FileStatus.IsEditing,
);
this.getFileInfo(id);
@@ -512,7 +512,7 @@ class FilesStore {
if (this.bufferSelection) {
const foundIndex = [this.bufferSelection].findIndex(
- (x) => x.id === folder.id
+ (x) => x.id === folder.id,
);
if (foundIndex > -1) {
runInAction(() => {
@@ -535,7 +535,7 @@ class FilesStore {
console.log(
"[WS] delete file",
this.files[foundIndex].id,
- this.files[foundIndex].title
+ this.files[foundIndex].title,
);
// this.setFiles(
@@ -549,7 +549,7 @@ class FilesStore {
// this.setFilter(newFilter);
const tempActionFilesIds = JSON.parse(
- JSON.stringify(this.tempActionFilesIds)
+ JSON.stringify(this.tempActionFilesIds),
);
tempActionFilesIds.push(this.files[foundIndex].id);
@@ -578,11 +578,11 @@ class FilesStore {
console.log(
"[WS] delete folder",
this.folders[foundIndex].id,
- this.folders[foundIndex].title
+ this.folders[foundIndex].title,
);
const tempActionFoldersIds = JSON.parse(
- JSON.stringify(this.tempActionFoldersIds)
+ JSON.stringify(this.tempActionFoldersIds),
);
tempActionFoldersIds.push(this.folders[foundIndex].id);
@@ -669,7 +669,7 @@ class FilesStore {
if (this.bufferSelection) {
const foundIndex = [this.bufferSelection].findIndex(
- (x) => x.id === file.id
+ (x) => x.id === file.id,
);
if (foundIndex > -1) {
runInAction(() => {
@@ -694,7 +694,7 @@ class FilesStore {
this.setActiveFolders(folders, destFolderId);
} else {
folders.map((item) =>
- this.activeFolders.push({ id: item, destFolderId })
+ this.activeFolders.push({ id: item, destFolderId }),
);
}
}
@@ -726,7 +726,7 @@ class FilesStore {
: {
id: item,
destFolderId,
- }
+ },
);
return arrayFormation;
};
@@ -763,7 +763,7 @@ class FilesStore {
setStartDrag = (startDrag) => {
this.selection = this.selection.filter(
- (x) => !x.providerKey || x.id !== x.rootFolderId
+ (x) => !x.providerKey || x.id !== x.rootFolderId,
); // removed root thirdparty folders
this.startDrag = startDrag;
};
@@ -837,7 +837,7 @@ class FilesStore {
if (!treeFolders || !treeFolders.length) return;
const trashFolder = treeFolders.find(
- (f) => f.rootFolderType == FolderType.TRASH
+ (f) => f.rootFolderType == FolderType.TRASH,
);
if (!trashFolder) return;
@@ -845,7 +845,7 @@ class FilesStore {
const isEmpty = !trashFolder.foldersCount && !trashFolder.filesCount;
this.setTrashIsEmpty(isEmpty);
- })
+ }),
);
if (isDesktopClient) {
@@ -971,10 +971,10 @@ class FilesStore {
updateSelection = (id) => {
const indexFileList = this.filesList.findIndex(
- (filelist) => filelist.id === id
+ (filelist) => filelist.id === id,
);
const indexSelectedRoom = this.selection.findIndex(
- (room) => room.id === id
+ (room) => room.id === id,
);
if (~indexFileList && ~indexSelectedRoom) {
@@ -982,7 +982,7 @@ class FilesStore {
}
if (this.bufferSelection) {
this.bufferSelection = this.filesList.find(
- (file) => file.id === this.bufferSelection.id
+ (file) => file.id === this.bufferSelection.id,
);
}
};
@@ -1117,12 +1117,12 @@ class FilesStore {
if (fileType === "file") {
if (this.activeFiles.findIndex((f) => f.id == id) === -1) {
newSelections.push(
- this.filesList.find((f) => f.id == id && !f.isFolder)
+ this.filesList.find((f) => f.id == id && !f.isFolder),
);
}
} else if (this.activeFolders.findIndex((f) => f.id == id) === -1) {
const selectableFolder = this.filesList.find(
- (f) => f.id == id && f.isFolder
+ (f) => f.id == id && f.isFolder,
);
if (selectableFolder) {
@@ -1153,12 +1153,12 @@ class FilesStore {
if (fileType === "file") {
if (this.activeFiles.findIndex((f) => f.id == id) === -1) {
newSelections = newSelections.filter(
- (f) => !(f.id == id && !f.isFolder)
+ (f) => !(f.id == id && !f.isFolder),
);
}
} else if (this.activeFolders.findIndex((f) => f.id == id) === -1) {
newSelections = newSelections.filter(
- (f) => !(f.id == id && f.isFolder)
+ (f) => !(f.id == id && f.isFolder),
);
}
}
@@ -1167,7 +1167,7 @@ class FilesStore {
return items.filter(
(x, index, self) =>
index ===
- self.findIndex((i) => i.id === x.id && i.isFolder === x.isFolder)
+ self.findIndex((i) => i.id === x.id && i.isFolder === x.isFolder),
);
};
@@ -1258,7 +1258,7 @@ class FilesStore {
const newUrl = combineUrl(
window.DocSpaceConfig?.proxy?.url,
config.homepage,
- pathname
+ pathname,
);
if (newUrl === currentUrl) return;
@@ -1315,7 +1315,7 @@ class FilesStore {
filter,
clearFilter = true,
withSubfolders = false,
- clearSelection = true
+ clearSelection = true,
) => {
const { setSelectedNode } = this.treeFoldersStore;
if (this.clientLoadingStore.isLoading) {
@@ -1329,7 +1329,7 @@ class FilesStore {
if (folderId === "@my" && this.userStore.user.isVisitor) {
const url = getCategoryUrl(CategoryType.Shared);
return window.DocSpace.navigate(
- `${url}?${RoomsFilter.getDefault().toUrlParams()}`
+ `${url}?${RoomsFilter.getDefault().toUrlParams()}`,
);
}
@@ -1389,7 +1389,7 @@ class FilesStore {
folderId,
filterData,
clearFilter,
- withSubfolders
+ withSubfolders,
);
}
}
@@ -1398,7 +1398,7 @@ class FilesStore {
if (!this.publicRoomStore.isPublicRoom) {
this.categoryType = getCategoryTypeByFolderType(
data.current.rootFolderType,
- data.current.parentId
+ data.current.parentId,
);
}
});
@@ -1449,12 +1449,12 @@ class FilesStore {
if (clearSelection) {
// Find not processed
const tempSelection = this.selection.filter(
- (f) => !this.activeFiles.find((elem) => elem.id === f.id)
+ (f) => !this.activeFiles.find((elem) => elem.id === f.id),
);
const tempBuffer =
this.bufferSelection &&
this.activeFiles.find(
- (elem) => elem.id === this.bufferSelection.id
+ (elem) => elem.id === this.bufferSelection.id,
) == null
? this.bufferSelection
: null;
@@ -1531,7 +1531,7 @@ class FilesStore {
shared,
canCopyPublicLink,
};
- })
+ }),
).then((res) => {
return res
.filter((item, index) => {
@@ -1558,7 +1558,7 @@ class FilesStore {
if (this.createdItem) {
const newItem = this.filesList.find(
- (item) => item.id === this.createdItem.id
+ (item) => item.id === this.createdItem.id,
);
if (newItem) {
@@ -1622,7 +1622,7 @@ class FilesStore {
clearFilter = true,
withSubfolders = false,
clearSelection = true,
- withFilterLocalStorage = false
+ withFilterLocalStorage = false,
) => {
const { setSelectedNode, roomsFolderId } = this.treeFoldersStore;
@@ -1634,7 +1634,7 @@ class FilesStore {
const filterData = !!filter ? filter.clone() : RoomsFilter.getDefault();
const filterStorageItem = localStorage.getItem(
- `UserRoomsFilter=${this.userStore.user?.id}`
+ `UserRoomsFilter=${this.userStore.user?.id}`,
);
if (filterStorageItem && (!filter || withFilterLocalStorage)) {
@@ -1672,7 +1672,7 @@ class FilesStore {
undefined,
undefined,
undefined,
- true
+ true,
);
}
}
@@ -1680,7 +1680,7 @@ class FilesStore {
runInAction(() => {
this.categoryType = getCategoryTypeByFolderType(
data.current.rootFolderType,
- data.current.parentId
+ data.current.parentId,
);
});
@@ -1744,7 +1744,7 @@ class FilesStore {
if (this.createdItem) {
const newItem = this.filesList.find(
- (item) => item.id === this.createdItem.id
+ (item) => item.id === this.createdItem.id,
);
if (newItem) {
@@ -1780,7 +1780,7 @@ class FilesStore {
isFileSelected = (fileId, parentId) => {
const item = this.selection.find(
- (x) => x.id === fileId && x.parentId === parentId
+ (x) => x.id === fileId && x.parentId === parentId,
);
return item !== undefined;
@@ -1797,12 +1797,12 @@ class FilesStore {
const isFileSelected = this.isFileSelected(id, parentId);
if (isFileSelected) {
let selectionIndex = this.selection.findIndex(
- (x) => x.parentId === parentId && x.id === id
+ (x) => x.parentId === parentId && x.id === id,
);
if (selectionIndex !== -1) {
this.selection = this.selection.filter(
- (x, index) => index !== selectionIndex
+ (x, index) => index !== selectionIndex,
);
}
}
@@ -2090,7 +2090,7 @@ class FilesStore {
const pluginFilesKeys = this.pluginStore.getContextMenuKeysByType(
PluginFileType.Files,
item.fileExst,
- security
+ security,
);
pluginAllKeys &&
@@ -2106,7 +2106,7 @@ class FilesStore {
const pluginFilesKeys = this.pluginStore.getContextMenuKeysByType(
PluginFileType.Image,
item.fileExst,
- security
+ security,
);
pluginAllKeys &&
@@ -2122,7 +2122,7 @@ class FilesStore {
const pluginFilesKeys = this.pluginStore.getContextMenuKeysByType(
PluginFileType.Video,
item.fileExst,
- security
+ security,
);
pluginAllKeys &&
@@ -2284,7 +2284,7 @@ class FilesStore {
const pluginRoomsKeys = this.pluginStore.getContextMenuKeysByType(
PluginFileType.Rooms,
null,
- security
+ security,
);
pluginAllKeys &&
@@ -2384,7 +2384,7 @@ class FilesStore {
const pluginFoldersKeys = this.pluginStore.getContextMenuKeysByType(
PluginFileType.Folders,
null,
- security
+ security,
);
pluginAllKeys &&
@@ -2697,10 +2697,10 @@ class FilesStore {
const hotkeysClipboard = fileIds
? this.hotkeysClipboard.filter(
- (f) => !fileIds.includes(f.id) && !f.isFolder
+ (f) => !fileIds.includes(f.id) && !f.isFolder,
)
: this.hotkeysClipboard.filter(
- (f) => !folderIds.includes(f.id) && f.isFolder
+ (f) => !folderIds.includes(f.id) && f.isFolder,
);
newFilter.total -= deleteCount;
@@ -2867,7 +2867,7 @@ class FilesStore {
return getIcon(
24,
this.selection[0].fileExst,
- this.selection[0].providerKey
+ this.selection[0].providerKey,
);
}
return null;
@@ -2978,7 +2978,7 @@ class FilesStore {
const url = combineUrl(
proxyURL,
config.homepage,
- `/doceditor?fileId=${id}${needConvert ? "&action=view" : ""}`
+ `/doceditor?fileId=${id}${needConvert ? "&action=view" : ""}`,
);
return url;
@@ -3063,7 +3063,7 @@ class FilesStore {
const thirdPartyIcon = this.thirdPartyStore.getThirdPartyIcon(
item.providerKey,
- "small"
+ "small",
);
const providerType =
@@ -3119,7 +3119,7 @@ class FilesStore {
contentLength,
roomType,
isArchive,
- type
+ type,
);
const defaultRoomIcon = isRoom
@@ -3130,7 +3130,7 @@ class FilesStore {
contentLength,
roomType,
isArchive,
- type
+ type,
)
: undefined;
@@ -3271,7 +3271,7 @@ class FilesStore {
elem !== `room-${RoomsType.ReviewRoom}` &&
elem !== `room-${RoomsType.FormRoom}` &&
elem !== `room-${RoomsType.ReadOnlyRoom}` &&
- elem !== `room-${RoomsType.PublicRoom}`
+ elem !== `room-${RoomsType.PublicRoom}`,
);
if (hasFiles) cbMenu.push(FilterType.FilesOnly);
@@ -3498,14 +3498,14 @@ class FilesStore {
get hasNew() {
const newFiles = [...this.files, ...this.folders].filter(
- (item) => (item.fileStatus & FileStatus.IsNew) === FileStatus.IsNew
+ (item) => (item.fileStatus & FileStatus.IsNew) === FileStatus.IsNew,
);
return newFiles.length > 0;
}
get allFilesIsEditing() {
const hasFolders = this.selection.find(
- (x) => !x.fileExst || !x.contentLength
+ (x) => !x.fileExst || !x.contentLength,
);
if (!hasFolders) {
return this.selection.every((x) => x.isEditing);
@@ -3529,15 +3529,15 @@ class FilesStore {
const webReview = selection.find((x) => x.viewAccessibility?.WebReview);
const formFillingDocs = selection.find(
- (x) => x.viewAccessibility?.WebRestrictedEditing
+ (x) => x.viewAccessibility?.WebRestrictedEditing,
);
const webFilter = selection.find(
- (x) => x.viewAccessibility?.WebCustomFilterEditing
+ (x) => x.viewAccessibility?.WebCustomFilterEditing,
);
const webNeedConvert = selection.find(
- (x) => x.viewAccessibility?.MustConvert
+ (x) => x.viewAccessibility?.MustConvert,
);
if ((webEdit && !webNeedConvert) || !externalAccess)
@@ -3642,7 +3642,7 @@ class FilesStore {
tab = null,
url = null,
preview = false,
- shareKey = null
+ shareKey = null,
) => {
const foundIndex = this.files.findIndex((x) => x.id === id);
const file = foundIndex !== -1 ? this.files[foundIndex] : undefined;
@@ -3854,7 +3854,7 @@ class FilesStore {
this.setHotkeyCaretStart(item);
const fileIndex = this.selection.findIndex(
- (f) => f.id === item.id && f.isFolder === item.isFolder
+ (f) => f.id === item.id && f.isFolder === item.isFolder,
);
if (fileIndex === -1) {
this.setSelection([...this.selection, item]);
@@ -3872,15 +3872,15 @@ class FilesStore {
if (!caret || !caretStart) return;
const startCaretIndex = this.filesList.findIndex(
- (f) => f.id === caretStart.id && f.isFolder === caretStart.isFolder
+ (f) => f.id === caretStart.id && f.isFolder === caretStart.isFolder,
);
const caretIndex = this.filesList.findIndex(
- (f) => f.id === caret.id && f.isFolder === caret.isFolder
+ (f) => f.id === caret.id && f.isFolder === caret.isFolder,
);
const itemIndex = this.filesList.findIndex(
- (f) => f.id === item.id && f.isFolder === item.isFolder
+ (f) => f.id === item.id && f.isFolder === item.isFolder,
);
const isMoveDown = caretIndex < itemIndex;
@@ -3893,13 +3893,13 @@ class FilesStore {
const filesItem = this.filesList[index];
const selectionIndex = newSelection.findIndex(
- (f) => f.id === filesItem.id && f.isFolder === filesItem.isFolder
+ (f) => f.id === filesItem.id && f.isFolder === filesItem.isFolder,
);
if (selectionIndex === -1) {
newSelection.push(filesItem);
} else {
newSelection = newSelection.filter(
- (_, fIndex) => selectionIndex !== fIndex
+ (_, fIndex) => selectionIndex !== fIndex,
);
newSelection.push(filesItem);
}
@@ -3914,12 +3914,12 @@ class FilesStore {
const lastSelection = this.selection[this.selection.length - 1];
const indexOfLast = this.filesList.findIndex(
(f) =>
- f.id === lastSelection?.id && f.isFolder === lastSelection?.isFolder
+ f.id === lastSelection?.id && f.isFolder === lastSelection?.isFolder,
);
newSelection = newSelection.filter((f) => {
const listIndex = this.filesList.findIndex(
- (x) => x.id === f.id && x.isFolder === f.isFolder
+ (x) => x.id === f.id && x.isFolder === f.isFolder,
);
if (isMoveDown) {
diff --git a/packages/client/src/store/HotkeyStore.js b/packages/client/src/store/HotkeyStore.js
index a2e7479d01..3cdbef378b 100644
--- a/packages/client/src/store/HotkeyStore.js
+++ b/packages/client/src/store/HotkeyStore.js
@@ -6,7 +6,7 @@ import { checkDialogsOpen } from "@docspace/shared/utils/checkDialogsOpen";
import { toastr } from "@docspace/shared/components/toast";
import { isDesktop, isMobile } from "@docspace/shared/utils";
-import { getFilesFromEvent } from "@docspace/shared/components/drag-and-drop";
+import getFilesFromEvent from "@docspace/shared/components/drag-and-drop/get-files-from-event";
import config from "PACKAGE_FILE";
import { getCategoryUrl } from "SRC_DIR/helpers/utils";
diff --git a/packages/client/src/store/PaymentStore.js b/packages/client/src/store/PaymentStore.ts
similarity index 69%
rename from packages/client/src/store/PaymentStore.js
rename to packages/client/src/store/PaymentStore.ts
index 87285c05cf..c15955df06 100644
--- a/packages/client/src/store/PaymentStore.js
+++ b/packages/client/src/store/PaymentStore.ts
@@ -1,52 +1,79 @@
+/* eslint-disable class-methods-use-this */
+/* eslint-disable no-console */
+import axios from "axios";
+import { makeAutoObservable } from "mobx";
+
import {
getPaymentSettings,
setLicense,
acceptLicense,
} from "@docspace/shared/api/settings";
-import { makeAutoObservable } from "mobx";
+import { getPaymentLink } from "@docspace/shared/api/portal";
import api from "@docspace/shared/api";
import { toastr } from "@docspace/shared/components/toast";
import { authStore } from "@docspace/shared/store";
-import { getPaymentLink } from "@docspace/shared/api/portal";
-import axios from "axios";
import { combineUrl } from "@docspace/shared/utils/combineUrl";
+import { UserStore } from "@docspace/shared/store/UserStore";
+import { CurrentTariffStatusStore } from "@docspace/shared/store/CurrentTariffStatusStore";
+import { CurrentQuotasStore } from "@docspace/shared/store/CurrentQuotaStore";
+import { PaymentQuotasStore } from "@docspace/shared/store/PaymentQuotasStore";
+import { TTranslation } from "@docspace/shared/types";
+import { TData } from "@docspace/shared/components/toast/Toast.type";
class PaymentStore {
- userStore = null;
- currentTariffStatusStore = null;
- currentQuotaStore = null;
- paymentQuotasStore = null;
+ userStore: UserStore | null = null;
+
+ currentTariffStatusStore: CurrentTariffStatusStore | null = null;
+
+ currentQuotaStore: CurrentQuotasStore | null = null;
+
+ paymentQuotasStore: PaymentQuotasStore | null = null;
salesEmail = "";
+
helpUrl = "https://helpdesk.onlyoffice.com";
+
buyUrl =
"https://www.onlyoffice.com/enterprise-edition.aspx?type=buyenterprise";
+
standaloneMode = true;
+
currentLicense = {
expiresDate: new Date(),
trialMode: true,
};
- paymentLink = null;
- accountLink = null;
+ paymentLink = "";
+
+ accountLink = "";
+
isLoading = false;
+
isUpdatingBasicSettings = false;
+
totalPrice = 30;
+
managersCount = 1;
+
maxAvailableManagersCount = 999;
+
stepByQuotaForManager = 1;
+
minAvailableManagersValue = 1;
+
stepByQuotaForTotalSize = 107374182400;
+
minAvailableTotalSizeValue = 107374182400;
isInitPaymentPage = false;
+
isLicenseCorrect = false;
constructor(
- userStore,
- currentTariffStatusStore,
- currentQuotaStore,
- paymentQuotasStore
+ userStore: UserStore,
+ currentTariffStatusStore: CurrentTariffStatusStore,
+ currentQuotaStore: CurrentQuotasStore,
+ paymentQuotasStore: PaymentQuotasStore,
) {
this.userStore = userStore;
this.currentTariffStatusStore = currentTariffStatusStore;
@@ -57,20 +84,23 @@ class PaymentStore {
}
get isAlreadyPaid() {
- const { customerId } = this.currentTariffStatusStore;
- const { isFreeTariff } = this.currentQuotaStore;
+ const customerId = this.currentTariffStatusStore?.customerId;
+ const isFreeTariff = this.currentQuotaStore?.isFreeTariff;
return customerId?.length !== 0 || !isFreeTariff;
}
- setIsInitPaymentPage = (value) => {
+ setIsInitPaymentPage = (value: boolean) => {
this.isInitPaymentPage = value;
};
- setIsUpdatingBasicSettings = (isUpdatingBasicSettings) => {
+ setIsUpdatingBasicSettings = (isUpdatingBasicSettings: boolean) => {
this.isUpdatingBasicSettings = isUpdatingBasicSettings;
};
+
basicSettings = async () => {
+ if (!this.currentTariffStatusStore || !this.currentQuotaStore) return;
+
const { setPortalTariff, setPayerInfo } = this.currentTariffStatusStore;
const { addedManagersCount } = this.currentQuotaStore;
@@ -78,15 +108,14 @@ class PaymentStore {
const requests = [setPortalTariff()];
- this.isAlreadyPaid
- ? requests.push(this.setPaymentAccount())
- : requests.push(this.getBasicPaymentLink(addedManagersCount));
+ if (this.isAlreadyPaid) requests.push(this.setPaymentAccount());
+ else requests.push(this.getBasicPaymentLink(addedManagersCount));
try {
await Promise.all(requests);
this.setBasicTariffContainer();
} catch (error) {
- toastr.error(t("Common:UnexpectedError"));
+ // toastr.error(t("Common:UnexpectedError"));
console.error(error);
}
@@ -95,22 +124,28 @@ class PaymentStore {
this.setIsUpdatingBasicSettings(false);
};
- init = async (t) => {
+ init = async (t: TTranslation) => {
if (this.isInitPaymentPage) {
this.basicSettings();
return;
}
+ if (
+ !this.currentTariffStatusStore ||
+ !this.currentQuotaStore ||
+ !this.paymentQuotasStore
+ )
+ return;
+
const { setPayerInfo } = this.currentTariffStatusStore;
const { addedManagersCount } = this.currentQuotaStore;
const { setPortalPaymentQuotas } = this.paymentQuotasStore;
const requests = [this.getSettingsPayment(), setPortalPaymentQuotas()];
- this.isAlreadyPaid
- ? requests.push(this.setPaymentAccount())
- : requests.push(this.getBasicPaymentLink(addedManagersCount));
+ if (this.isAlreadyPaid) requests.push(this.setPaymentAccount());
+ else requests.push(this.getBasicPaymentLink(addedManagersCount));
try {
await Promise.all(requests);
@@ -129,10 +164,10 @@ class PaymentStore {
this.setIsInitPaymentPage(true);
};
- getBasicPaymentLink = async (managersCount) => {
+ getBasicPaymentLink = async (managersCount: number) => {
const backUrl = combineUrl(
window.location.origin,
- "/portal-settings/payments/portal-payments?complete=true"
+ "/portal-settings/payments/portal-payments?complete=true",
);
try {
@@ -144,14 +179,15 @@ class PaymentStore {
console.error(err);
}
};
+
getPaymentLink = async (token = undefined) => {
const backUrl = combineUrl(
window.location.origin,
- "/portal-settings/payments/portal-payments?complete=true"
+ "/portal-settings/payments/portal-payments?complete=true",
);
await getPaymentLink(this.managersCount, backUrl, token)
- .then((link) => {
+ ?.then((link) => {
if (!link) return;
this.setPaymentLink(link);
})
@@ -163,12 +199,12 @@ class PaymentStore {
if (err?.response?.status === 402) {
return;
}
- this.isInitPaymentPage && toastr.error(err);
+ if (this.isInitPaymentPage) toastr.error(err);
}
});
};
- standaloneBasicSettings = async (t) => {
+ standaloneBasicSettings = async (t: TTranslation) => {
const { getTenantExtra } = authStore;
this.setIsUpdatingBasicSettings(true);
@@ -184,7 +220,7 @@ class PaymentStore {
this.setIsUpdatingBasicSettings(false);
};
- standaloneInit = async (t) => {
+ standaloneInit = async (t: TTranslation) => {
const { getTenantExtra } = authStore;
if (this.isInitPaymentPage) {
@@ -203,6 +239,7 @@ class PaymentStore {
this.isInitPaymentPage = true;
};
+
getSettingsPayment = async () => {
try {
const newSettings = await getPaymentSettings();
@@ -236,22 +273,23 @@ class PaymentStore {
}
};
- setIsLicenseCorrect = (isLicenseCorrect) => {
+ setIsLicenseCorrect = (isLicenseCorrect: boolean) => {
this.isLicenseCorrect = isLicenseCorrect;
};
- setPaymentsLicense = async (confirmKey, data) => {
+
+ setPaymentsLicense = async (confirmKey: string, data: FormData) => {
try {
const message = await setLicense(confirmKey, data);
this.setIsLicenseCorrect(true);
toastr.success(message);
} catch (e) {
- toastr.error(e);
+ toastr.error(e as TData);
this.setIsLicenseCorrect(false);
}
};
- acceptPaymentsLicense = async (t) => {
+ acceptPaymentsLicense = async (t: TTranslation) => {
try {
const { getTenantExtra } = authStore;
@@ -262,7 +300,7 @@ class PaymentStore {
await getTenantExtra();
} catch (e) {
- toastr.error(e);
+ toastr.error(e as TData);
}
};
@@ -278,17 +316,17 @@ class PaymentStore {
}
};
- setPaymentLink = async (link) => {
+ setPaymentLink = async (link: string) => {
this.paymentLink = link;
};
- setIsLoading = (isLoading) => {
+ setIsLoading = (isLoading: boolean) => {
this.isLoading = isLoading;
};
- getTotalCostByFormula = (value) => {
- const costValuePerManager = this.paymentQuotasStore.planCost.value;
- return value * costValuePerManager;
+ getTotalCostByFormula = (value: number) => {
+ const costValuePerManager = this.paymentQuotasStore?.planCost.value;
+ if (costValuePerManager) return value * +costValuePerManager;
};
get allowedStorageSizeByQuota() {
@@ -301,7 +339,10 @@ class PaymentStore {
resetTariffContainerToBasic = () => {
this.setBasicTariffContainer();
};
+
setBasicTariffContainer = () => {
+ if (!this.currentQuotaStore) return;
+
const { currentPlanCost, maxCountManagersByQuota, addedManagersCount } =
this.currentQuotaStore;
const currentTotalPrice = currentPlanCost.value;
@@ -314,21 +355,23 @@ class PaymentStore {
? this.maxAvailableManagersCount + 1
: maxCountManagersByQuota;
- this.totalPrice = currentTotalPrice;
+ this.totalPrice = +currentTotalPrice;
return;
}
this.managersCount = addedManagersCount;
- this.totalPrice = this.getTotalCostByFormula(addedManagersCount);
+ const totalPrice = this.getTotalCostByFormula(addedManagersCount);
+
+ if (totalPrice) this.totalPrice = totalPrice;
};
- setTotalPrice = (value) => {
+ setTotalPrice = (value: number) => {
const price = this.getTotalCostByFormula(value);
- if (price !== this.totalPrice) this.totalPrice = price;
+ if (price !== this.totalPrice && price) this.totalPrice = price;
};
- setManagersCount = (managers) => {
+ setManagersCount = (managers: number) => {
if (managers > this.maxAvailableManagersCount)
this.managersCount = this.maxAvailableManagersCount + 1;
else this.managersCount = managers;
@@ -343,6 +386,7 @@ class PaymentStore {
}
get isPayer() {
+ if (!this.userStore || !this.currentTariffStatusStore) return;
const { user } = this.userStore;
const { payerInfo } = this.currentTariffStatusStore;
@@ -353,6 +397,7 @@ class PaymentStore {
}
get isStripePortalAvailable() {
+ if (!this.userStore) return;
const { user } = this.userStore;
if (!user) return false;
@@ -361,6 +406,7 @@ class PaymentStore {
}
get canUpdateTariff() {
+ if (!this.userStore || !this.currentQuotaStore) return;
const { user } = this.userStore;
const { isFreeTariff } = this.currentQuotaStore;
@@ -372,6 +418,7 @@ class PaymentStore {
}
get canPayTariff() {
+ if (!this.currentQuotaStore) return;
const { addedManagersCount } = this.currentQuotaStore;
if (this.managersCount >= addedManagersCount) return true;
@@ -380,6 +427,7 @@ class PaymentStore {
}
get canDowngradeTariff() {
+ if (!this.currentQuotaStore) return;
const { addedManagersCount, usedTotalStorageSizeCount } =
this.currentQuotaStore;
@@ -391,22 +439,30 @@ class PaymentStore {
}
setRangeStepByQuota = () => {
+ if (!this.paymentQuotasStore) return;
+
const { stepAddingQuotaManagers, stepAddingQuotaTotalSize } =
this.paymentQuotasStore;
- this.stepByQuotaForManager = stepAddingQuotaManagers;
+ if (stepAddingQuotaManagers)
+ this.stepByQuotaForManager = stepAddingQuotaManagers;
this.minAvailableManagersValue = this.stepByQuotaForManager;
- this.stepByQuotaForTotalSize = stepAddingQuotaTotalSize;
+ if (stepAddingQuotaTotalSize)
+ this.stepByQuotaForTotalSize = stepAddingQuotaTotalSize;
this.minAvailableTotalSizeValue = this.stepByQuotaForManager;
};
- sendPaymentRequest = async (email, userName, message) => {
+ sendPaymentRequest = async (
+ email: string,
+ userName: string,
+ message: string,
+ ) => {
try {
await api.portal.sendPaymentRequest(email, userName, message);
- toastr.success(t("SuccessfullySentMessage"));
+ // toastr.success(t("SuccessfullySentMessage"));
} catch (e) {
- toastr.error(e);
+ toastr.error(e as TData);
}
};
}
diff --git a/packages/client/src/store/PeopleStore.js b/packages/client/src/store/PeopleStore.js
index f791e855ee..2149f920f8 100644
--- a/packages/client/src/store/PeopleStore.js
+++ b/packages/client/src/store/PeopleStore.js
@@ -13,7 +13,7 @@ import EditingFormStore from "./EditingFormStore";
import FilterStore from "./FilterStore";
import SelectionStore from "./SelectionPeopleStore";
import HeaderMenuStore from "./HeaderMenuStore";
-import AvatarEditorStore from "./AvatarEditorStore";
+
import InviteLinksStore from "./InviteLinksStore";
import DialogStore from "./DialogStore";
@@ -36,7 +36,7 @@ class PeopleStore {
filterStore = null;
selectionStore = null;
headerMenuStore = null;
- avatarEditorStore = null;
+
inviteLinksStore = null;
dialogStore = null;
setupStore = null;
@@ -74,7 +74,6 @@ class PeopleStore {
this.filterStore = new FilterStore();
this.selectionStore = new SelectionStore(this);
this.headerMenuStore = new HeaderMenuStore(this);
- this.avatarEditorStore = new AvatarEditorStore(this);
this.inviteLinksStore = new InviteLinksStore(this);
this.dialogStore = new DialogStore();
this.userStore = userStore;
diff --git a/packages/client/src/store/PluginStore.js b/packages/client/src/store/PluginStore.ts
similarity index 67%
rename from packages/client/src/store/PluginStore.js
rename to packages/client/src/store/PluginStore.ts
index aa43928ba0..8c91c3d614 100644
--- a/packages/client/src/store/PluginStore.js
+++ b/packages/client/src/store/PluginStore.ts
@@ -1,23 +1,47 @@
+/* eslint-disable no-console */
import { makeAutoObservable, runInAction } from "mobx";
import { cloneDeep } from "lodash";
import api from "@docspace/shared/api";
-
+import { SettingsStore } from "@docspace/shared/store/SettingsStore";
+import { UserStore } from "@docspace/shared/store/UserStore";
import { toastr } from "@docspace/shared/components/toast";
import defaultConfig from "PUBLIC_DIR/scripts/config.json";
+import {
+ IContextMenuItem,
+ IEventListenerItem,
+ IFileItem,
+ IInfoPanelItem,
+ IMainButtonItem,
+ IProfileMenuItem,
+ IframeWindow,
+ TPlugin,
+} from "SRC_DIR/helpers/plugins/types";
+import { TRoomSecurity } from "@docspace/shared/api/rooms/types";
+import {
+ TFile,
+ TFileSecurity,
+ TFolderSecurity,
+} from "@docspace/shared/api/files/types";
+import { TAPIPlugin } from "@docspace/shared/api/plugins/types";
+import { ModalDialogProps } from "@docspace/shared/components/modal-dialog/ModalDialog.types";
+
+import { getPluginUrl, messageActions } from "../helpers/plugins/utils";
import {
PluginFileType,
PluginScopes,
PluginUsersType,
PluginStatus,
-} from "SRC_DIR/helpers/plugins/constants";
-import { getPluginUrl, messageActions } from "SRC_DIR/helpers/plugins/utils";
+ PluginDevices,
+} from "../helpers/plugins/enums";
-let { api: apiConf, proxy: proxyConf } = defaultConfig;
-let { orign: apiOrigin, prefix: apiPrefix } = apiConf;
-let { url: proxyURL } = proxyConf;
+import SelectedFolderStore from "./SelectedFolderStore";
+
+const { api: apiConf, proxy: proxyConf } = defaultConfig;
+const { origin: apiOrigin, prefix: apiPrefix } = apiConf;
+const { url: proxyURL } = proxyConf;
const origin =
window.DocSpaceConfig?.api?.origin || apiOrigin || window.location.origin;
@@ -25,95 +49,101 @@ const proxy = window.DocSpaceConfig?.proxy?.url || proxyURL;
const prefix = window.DocSpaceConfig?.api?.prefix || apiPrefix;
class PluginStore {
- settingsStore = null;
- selectedFolderStore = null;
- userStore = null;
+ private settingsStore: SettingsStore = {} as SettingsStore;
- plugins = null;
+ private selectedFolderStore: SelectedFolderStore = {} as SelectedFolderStore;
- contextMenuItems = null;
- infoPanelItems = null;
- mainButtonItems = null;
- profileMenuItems = null;
- eventListenerItems = null;
- fileItems = null;
+ private userStore: UserStore = {} as UserStore;
- pluginFrame = null;
+ plugins: TPlugin[] = [];
+
+ contextMenuItems: Map = new Map();
+
+ infoPanelItems: Map = new Map();
+
+ mainButtonItems: Map = new Map();
+
+ profileMenuItems: Map = new Map();
+
+ eventListenerItems: Map = new Map();
+
+ fileItems: Map = new Map();
+
+ pluginFrame: HTMLIFrameElement | null = null;
isInit = false;
settingsPluginDialogVisible = false;
- currentSettingsDialogPlugin = null;
+
+ currentSettingsDialogPlugin: null | { pluginName: string } = null;
pluginDialogVisible = false;
- pluginDialogProps = null;
+
+ pluginDialogProps: null | ModalDialogProps = null;
deletePluginDialogVisible = false;
- deletePluginDialogProps = null;
+
+ deletePluginDialogProps: null | { pluginName: string } = null;
isLoading = true;
+
isEmptyList = false;
- constructor(settingsStore, selectedFolderStore, userStore) {
+ constructor(
+ settingsStore: SettingsStore,
+ selectedFolderStore: SelectedFolderStore,
+ userStore: UserStore,
+ ) {
this.settingsStore = settingsStore;
this.selectedFolderStore = selectedFolderStore;
this.userStore = userStore;
- this.plugins = [];
-
- this.contextMenuItems = new Map();
- this.infoPanelItems = new Map();
- this.mainButtonItems = new Map();
- this.profileMenuItems = new Map();
- this.eventListenerItems = new Map();
- this.fileItems = new Map();
-
makeAutoObservable(this);
}
- setIsLoading = (value) => {
+ setIsLoading = (value: boolean) => {
this.isLoading = value;
};
- setIsEmptyList = (value) => {
+ setIsEmptyList = (value: boolean) => {
this.isEmptyList = value;
};
- setCurrentSettingsDialogPlugin = (value) => {
+ setCurrentSettingsDialogPlugin = (value: null | { pluginName: string }) => {
this.currentSettingsDialogPlugin = value;
};
- setSettingsPluginDialogVisible = (value) => {
+ setSettingsPluginDialogVisible = (value: boolean) => {
this.settingsPluginDialogVisible = value;
};
- setPluginDialogVisible = (value) => {
+ setPluginDialogVisible = (value: boolean) => {
this.pluginDialogVisible = value;
};
- setPluginDialogProps = (value) => {
+ setPluginDialogProps = (value: null | ModalDialogProps) => {
this.pluginDialogProps = value;
};
- setDeletePluginDialogVisible = (value) => {
+ setDeletePluginDialogVisible = (value: boolean) => {
this.deletePluginDialogVisible = value;
};
- setDeletePluginDialogProps = (value) => {
+ setDeletePluginDialogProps = (value: null | { pluginName: string }) => {
this.deletePluginDialogProps = value;
};
- updatePluginStatus = (name) => {
+ updatePluginStatus = (name: string) => {
const plugin = this.plugins.find((p) => p.name === name);
- const newStatus = plugin.getStatus();
+ const newStatus = plugin?.getStatus();
const pluginIdx = this.plugins.findIndex((p) => p.name === name);
if (pluginIdx !== -1) {
if (this.plugins[pluginIdx].status === newStatus) return;
- this.plugins[pluginIdx].status = newStatus;
+ this.plugins[pluginIdx].status = newStatus || PluginStatus.active;
if (
newStatus === PluginStatus.active &&
@@ -148,23 +178,25 @@ class PluginStore {
}
};
- setPluginFrame = (frame) => {
+ setPluginFrame = (frame: HTMLIFrameElement) => {
this.pluginFrame = frame;
- this.pluginFrame.contentWindow.Plugins = {};
+ const iWindow = this.pluginFrame?.contentWindow as IframeWindow;
+
+ if (this.pluginFrame && iWindow) iWindow.Plugins = {};
};
- setIsInit = (isInit) => {
+ setIsInit = (isInit: boolean) => {
this.isInit = isInit;
};
initPlugins = async () => {
const frame = document.createElement("iframe");
frame.id = "plugin-iframe";
- frame.width = 0;
- frame.height = 0;
+ frame.width = "0px";
+ frame.height = "0px";
frame.style.display = "none";
- frame.sandbox = "allow-same-origin allow-scripts";
+ // frame.sandbox = "allow-same-origin allow-scripts";
document.body.appendChild(frame);
@@ -176,14 +208,17 @@ class PluginStore {
};
updatePlugins = async () => {
+ if (!this.userStore || !this.userStore.user) return;
+
const { isAdmin, isOwner } = this.userStore.user;
+
this.setIsLoading(true);
try {
this.plugins = [];
const plugins = await api.plugins.getPlugins(
- !isAdmin && !isOwner ? true : null
+ !isAdmin && !isOwner ? true : null,
);
this.setIsEmptyList(plugins.length === 0);
@@ -197,19 +232,19 @@ class PluginStore {
}
};
- addPlugin = async (data) => {
+ addPlugin = async (data: FormData) => {
try {
const plugin = await api.plugins.addPlugin(data);
this.initPlugin(plugin);
} catch (e) {
- console.log(e);
+ const err = e as { response: { data: { error: { message: string } } } };
- toastr.error(e.response.data.error.message);
+ toastr.error(err.response.data.error.message as string);
}
};
- uninstallPlugin = async (name) => {
+ uninstallPlugin = async (name: string) => {
const pluginIdx = this.plugins.findIndex((p) => p.name === name);
try {
@@ -229,44 +264,52 @@ class PluginStore {
}
};
- initPlugin = (plugin, callback) => {
+ initPlugin = (plugin: TAPIPlugin, callback?: (plugin: TPlugin) => void) => {
const onLoad = async () => {
+ const iWindow = this.pluginFrame?.contentWindow as IframeWindow;
+
const newPlugin = cloneDeep({
...plugin,
- ...this.pluginFrame.contentWindow.Plugins[plugin.pluginName],
+ ...iWindow?.Plugins?.[plugin.pluginName],
});
- newPlugin.createBy = newPlugin.createBy.displayName;
- newPlugin.scopes = newPlugin.scopes.split(",");
+ newPlugin.scopes =
+ typeof newPlugin.scopes === "string"
+ ? newPlugin.scopes.split(",")
+ : newPlugin.scopes;
+
newPlugin.iconUrl = getPluginUrl(newPlugin.url, "");
this.installPlugin(newPlugin);
if (newPlugin.scopes.includes(PluginScopes.Settings)) {
- newPlugin.setAdminPluginSettingsValue(plugin.settings || null);
+ newPlugin.setAdminPluginSettingsValue?.(plugin.settings || null);
}
- callback && callback(newPlugin);
+ callback?.(newPlugin);
};
const onError = () => {};
- const frameDoc = this.pluginFrame.contentDocument;
+ const frameDoc = this.pluginFrame?.contentDocument;
- const script = frameDoc.createElement("script");
- script.setAttribute("type", "text/javascript");
- script.setAttribute("id", `${plugin.name}`);
+ const script = frameDoc?.createElement("script");
- if (onLoad) script.onload = onLoad.bind(this);
- if (onError) script.onerror = onError.bind(this);
+ if (script) {
+ script.setAttribute("type", "text/javascript");
+ script.setAttribute("id", `${plugin.name}`);
- script.src = plugin.url;
- script.async = true;
+ if (onLoad) script.onload = onLoad.bind(this);
+ if (onError) script.onerror = onError.bind(this);
- frameDoc.body.appendChild(script);
+ script.src = plugin.url;
+ script.async = true;
+
+ frameDoc?.body.appendChild(script);
+ }
};
- installPlugin = async (plugin, addToList = true) => {
+ installPlugin = async (plugin: TPlugin, addToList = true) => {
if (addToList) {
const idx = this.plugins.findIndex((p) => p.name === plugin.name);
@@ -284,7 +327,7 @@ class PluginStore {
if (!plugin || !plugin.enabled) return;
if (plugin.scopes.includes(PluginScopes.API)) {
- plugin.setAPI && plugin.setAPI(origin, proxy, prefix);
+ plugin.setAPI?.(origin, proxy, prefix);
}
const { name } = plugin;
@@ -322,21 +365,22 @@ class PluginStore {
}
};
- updatePlugin = async (name, status, settings) => {
+ updatePlugin = async (name: string, status: boolean, settings: string) => {
try {
let currentSettings = settings;
let currentStatus = status;
const oldPlugin = this.pluginList.find((p) => p.name === name);
- if (!currentSettings) currentSettings = oldPlugin.settings || "";
+ if (!currentSettings) currentSettings = oldPlugin?.settings || "";
- if (typeof status !== "boolean") currentStatus = oldPlugin.enabled;
+ if (typeof status !== "boolean")
+ currentStatus = oldPlugin?.enabled || false;
const plugin = await api.plugins.updatePlugin(
name,
currentStatus,
- currentSettings
+ currentSettings,
);
if (typeof status !== "boolean") return plugin;
@@ -353,7 +397,7 @@ class PluginStore {
}
};
- activatePlugin = async (name) => {
+ activatePlugin = async (name: string) => {
const plugin = this.plugins.find((p) => p.name === name);
if (!plugin) return;
@@ -363,7 +407,7 @@ class PluginStore {
this.installPlugin(plugin, false);
};
- deactivatePlugin = async (name) => {
+ deactivatePlugin = async (name: string) => {
const plugin = this.plugins.find((p) => p.name === name);
if (!plugin) return;
@@ -416,23 +460,29 @@ class PluginStore {
};
getCurrentDevice = () => {
- const { currentDeviceType } = this.settingsStore;
+ const currentDeviceType = this.settingsStore.currentDeviceType as unknown;
- return currentDeviceType;
+ return currentDeviceType as PluginDevices;
};
- getContextMenuKeysByType = (type, fileExst, security) => {
+ getContextMenuKeysByType = (
+ type: PluginFileType,
+ fileExst: string,
+ security: TRoomSecurity | TFileSecurity | TFolderSecurity,
+ ) => {
if (!this.contextMenuItems) return;
const userRole = this.getUserRole();
const device = this.getCurrentDevice();
const itemsMap = Array.from(this.contextMenuItems);
- const keys = [];
+ const keys: string[] = [];
switch (type) {
case PluginFileType.Files:
- itemsMap.forEach(([key, item]) => {
+ itemsMap.forEach((val) => {
+ const item = val[1];
+
if (!item.fileType) return;
if (item.fileType.includes(PluginFileType.Files)) {
@@ -440,8 +490,8 @@ class PluginStore {
? item.fileExt.includes(fileExst)
: true;
- const correctUserType = item.usersType
- ? item.usersType.includes(userRole)
+ const correctUserType = item.usersTypes
+ ? item.usersTypes.includes(userRole)
: true;
const correctDevice = item.devices
@@ -449,7 +499,8 @@ class PluginStore {
: true;
const correctSecurity = item.security
- ? item.security.every((key) => security?.[key])
+ ? // @ts-expect-error its valid key
+ item.security.every((key) => security?.[key])
: true;
if (
@@ -463,12 +514,12 @@ class PluginStore {
});
break;
case PluginFileType.Folders:
- itemsMap.forEach(([key, item]) => {
- if (!item.fileType) return;
+ itemsMap.forEach((val) => {
+ const item = val[1];
- if (item.fileType.includes(PluginFileType.Folders)) {
- const correctUserType = item.usersType
- ? item.usersType.includes(userRole)
+ if (item.fileType?.includes(PluginFileType.Folders)) {
+ const correctUserType = item.usersTypes
+ ? item.usersTypes.includes(userRole)
: true;
const correctDevice = item.devices
@@ -476,7 +527,8 @@ class PluginStore {
: true;
const correctSecurity = item.security
- ? item?.security?.every((key) => security?.[key])
+ ? // @ts-expect-error its valid key
+ item.security.every((key) => security?.[key])
: true;
if (correctUserType && correctDevice && correctSecurity)
@@ -485,12 +537,12 @@ class PluginStore {
});
break;
case PluginFileType.Rooms:
- itemsMap.forEach(([key, item]) => {
- if (!item.fileType) return;
+ itemsMap.forEach((val) => {
+ const item = val[1];
- if (item.fileType.includes(PluginFileType.Rooms)) {
- const correctUserType = item.usersType
- ? item.usersType.includes(userRole)
+ if (item.fileType?.includes(PluginFileType.Rooms)) {
+ const correctUserType = item.usersTypes
+ ? item.usersTypes.includes(userRole)
: true;
const correctDevice = item.devices
@@ -498,7 +550,8 @@ class PluginStore {
: true;
const correctSecurity = item.security
- ? item.security.every((key) => security?.[key])
+ ? // @ts-expect-error its valid key
+ item.security.every((key) => security?.[key])
: true;
if (correctUserType && correctDevice && correctSecurity)
@@ -507,16 +560,16 @@ class PluginStore {
});
break;
case PluginFileType.Image:
- itemsMap.forEach(([key, item]) => {
- if (!item.fileType) return;
+ itemsMap.forEach((val) => {
+ const item = val[1];
- if (item.fileType.includes(PluginFileType.Image)) {
+ if (item.fileType?.includes(PluginFileType.Image)) {
const correctFileExt = item.fileExt
? item.fileExt.includes(fileExst)
: true;
- const correctUserType = item.usersType
- ? item.usersType.includes(userRole)
+ const correctUserType = item.usersTypes
+ ? item.usersTypes.includes(userRole)
: true;
const correctDevice = item.devices
@@ -524,7 +577,8 @@ class PluginStore {
: true;
const correctSecurity = item.security
- ? item.security.every((key) => security?.[key])
+ ? // @ts-expect-error its valid key
+ item.security.every((key) => security?.[key])
: true;
if (
@@ -538,12 +592,12 @@ class PluginStore {
});
break;
case PluginFileType.Video:
- itemsMap.forEach(([key, item]) => {
- if (!item.fileType) return;
+ itemsMap.forEach((val) => {
+ const item = val[1];
- if (item.fileType.includes(PluginFileType.Video)) {
- const correctUserType = item.usersType
- ? item.usersType.includes(userRole)
+ if (item.fileType?.includes(PluginFileType.Video)) {
+ const correctUserType = item.usersTypes
+ ? item.usersTypes.includes(userRole)
: true;
const correctDevice = item.devices
@@ -551,7 +605,8 @@ class PluginStore {
: true;
const correctSecurity = item.security
- ? item.security.every((key) => security?.[key])
+ ? // @ts-expect-error its valid key
+ item.security.every((key) => security?.[key])
: true;
if (correctUserType && correctDevice && correctSecurity)
@@ -560,11 +615,12 @@ class PluginStore {
});
break;
default:
- itemsMap.forEach(([key, item]) => {
+ itemsMap.forEach((val) => {
+ const item = val[1];
if (item.fileType) return;
- const correctUserType = item.usersType
- ? item.usersType.includes(userRole)
+ const correctUserType = item.usersTypes
+ ? item.usersTypes.includes(userRole)
: true;
const correctDevice = item.devices
@@ -572,7 +628,8 @@ class PluginStore {
: true;
const correctSecurity = item.security
- ? item.security.every((key) => security?.[key])
+ ? // @ts-expect-error its valid key
+ item.security.every((key) => security?.[key])
: true;
if (correctUserType && correctDevice && correctSecurity)
@@ -585,7 +642,7 @@ class PluginStore {
return keys;
};
- updateContextMenuItems = (name) => {
+ updateContextMenuItems = (name: string) => {
const plugin = this.plugins.find((p) => p.name === name);
if (!plugin || !plugin.enabled) return;
@@ -594,8 +651,8 @@ class PluginStore {
if (!items) return;
- Array.from(items).map(([key, value]) => {
- const onClick = async (fileId) => {
+ Array.from(items).forEach(([key, value]) => {
+ const onClick = async (fileId: number) => {
if (!value.onClick) return;
const message = await value.onClick(fileId);
@@ -618,7 +675,7 @@ class PluginStore {
this.updateMainButtonItems,
this.updateProfileMenuItems,
this.updateEventListenerItems,
- this.updateFileItems
+ this.updateFileItems,
);
};
@@ -633,19 +690,19 @@ class PluginStore {
});
};
- deactivateContextMenuItems = (plugin) => {
+ deactivateContextMenuItems = (plugin: TPlugin) => {
if (!plugin) return;
- const items = plugin.getContextMenuItems && plugin.getContextMenuItems();
+ const items = plugin.getContextMenuItems?.();
if (!items) return;
- Array.from(items).map(([key, value]) => {
+ Array.from(items).forEach(([key]) => {
this.contextMenuItems.delete(key);
});
};
- updateInfoPanelItems = (name) => {
+ updateInfoPanelItems = (name: string) => {
const plugin = this.plugins.find((p) => p.name === name);
if (!plugin || !plugin.enabled) return;
@@ -657,9 +714,9 @@ class PluginStore {
const userRole = this.getUserRole();
const device = this.getCurrentDevice();
- Array.from(items).map(([key, value]) => {
- const correctUserType = value.usersType
- ? value.usersType.includes(userRole)
+ Array.from(items).forEach(([key, value]) => {
+ const correctUserType = value.usersTypes
+ ? value.usersTypes.includes(userRole)
: true;
const correctDevice = value.devices
@@ -671,8 +728,8 @@ class PluginStore {
const submenu = { ...value.subMenu };
if (value.subMenu.onClick) {
- const onClick = async () => {
- const message = await value.subMenu.onClick();
+ const onClick = async (id: number) => {
+ const message = await value?.subMenu?.onClick?.(id);
messageActions(
message,
@@ -692,7 +749,7 @@ class PluginStore {
this.updateMainButtonItems,
this.updateProfileMenuItems,
this.updateEventListenerItems,
- this.updateFileItems
+ this.updateFileItems,
);
};
@@ -708,31 +765,31 @@ class PluginStore {
});
};
- deactivateInfoPanelItems = (plugin) => {
+ deactivateInfoPanelItems = (plugin: TPlugin) => {
if (!plugin) return;
const items = plugin.getInfoPanelItems && plugin.getInfoPanelItems();
if (!items) return;
- Array.from(items).map(([key, value]) => {
+ Array.from(items).forEach(([key]) => {
this.infoPanelItems.delete(key);
});
};
- updateMainButtonItems = (name) => {
+ updateMainButtonItems = (name: string) => {
const plugin = this.plugins.find((p) => p.name === name);
if (!plugin || !plugin.enabled) return;
- const items = plugin.getMainButtonItems && plugin.getMainButtonItems();
+ const items = plugin.getMainButtonItems?.();
if (!items) return;
const userRole = this.getUserRole();
const device = this.getCurrentDevice();
- Array.from(items).map(([key, value]) => {
+ Array.from(items).forEach(([key, value]) => {
const correctUserType = value.usersType
? value.usersType.includes(userRole)
: true;
@@ -743,11 +800,12 @@ class PluginStore {
if (!correctUserType || !correctDevice) return;
- const newItems = [];
- if (value.items) {
+ const newItems: IMainButtonItem[] = [];
+ const storeId = this.selectedFolderStore.id;
+ if (value.items && storeId) {
value.items.forEach((i) => {
const onClick = async () => {
- const message = await i.onClick(this.selectedFolderStore.id);
+ const message = await i?.onClick?.(storeId);
messageActions(
message,
@@ -767,7 +825,7 @@ class PluginStore {
this.updateMainButtonItems,
this.updateProfileMenuItems,
this.updateEventListenerItems,
- this.updateFileItems
+ this.updateFileItems,
);
};
@@ -781,8 +839,9 @@ class PluginStore {
const onClick = async () => {
if (!value.onClick) return;
+ if (!storeId) return;
- const message = await value.onClick(this.selectedFolderStore.id);
+ const message = await value.onClick(storeId);
messageActions(
message,
@@ -802,7 +861,7 @@ class PluginStore {
this.updateMainButtonItems,
this.updateProfileMenuItems,
this.updateEventListenerItems,
- this.updateFileItems
+ this.updateFileItems,
);
};
@@ -818,19 +877,19 @@ class PluginStore {
});
};
- deactivateMainButtonItems = (plugin) => {
+ deactivateMainButtonItems = (plugin: TPlugin) => {
if (!plugin) return;
const items = plugin.getMainButtonItems && plugin.getMainButtonItems();
if (!items) return;
- Array.from(items).map(([key, value]) => {
+ Array.from(items).forEach(([key]) => {
this.mainButtonItems.delete(key);
});
};
- updateProfileMenuItems = (name) => {
+ updateProfileMenuItems = (name: string) => {
const plugin = this.plugins.find((p) => p.name === name);
if (!plugin || !plugin.enabled) return;
@@ -842,7 +901,7 @@ class PluginStore {
const userRole = this.getUserRole();
const device = this.getCurrentDevice();
- Array.from(items).map(([key, value]) => {
+ Array.from(items).forEach(([key, value]) => {
const correctUserType = value.usersType
? value.usersType.includes(userRole)
: true;
@@ -876,7 +935,7 @@ class PluginStore {
this.updateMainButtonItems,
this.updateProfileMenuItems,
this.updateEventListenerItems,
- this.updateFileItems
+ this.updateFileItems,
);
};
@@ -891,19 +950,19 @@ class PluginStore {
});
};
- deactivateProfileMenuItems = (plugin) => {
+ deactivateProfileMenuItems = (plugin: TPlugin) => {
if (!plugin) return;
const items = plugin.getProfileMenuItems && plugin.getProfileMenuItems();
if (!items) return;
- Array.from(items).map(([key, value]) => {
+ Array.from(items).forEach(([key]) => {
this.profileMenuItems.delete(key);
});
};
- updateEventListenerItems = (name) => {
+ updateEventListenerItems = (name: string) => {
const plugin = this.plugins.find((p) => p.name === name);
if (!plugin || !plugin.enabled) return;
@@ -916,9 +975,9 @@ class PluginStore {
const userRole = this.getUserRole();
const device = this.getCurrentDevice();
- Array.from(items).map(([key, value]) => {
- const correctUserType = value.usersType
- ? value.usersType.includes(userRole)
+ Array.from(items).forEach(([key, value]) => {
+ const correctUserType = value.usersTypes
+ ? value.usersTypes.includes(userRole)
: true;
const correctDevice = value.devices
@@ -926,10 +985,10 @@ class PluginStore {
: true;
if (!correctUserType || !correctDevice) return;
- const eventHandler = async (e) => {
+ const eventHandler = async () => {
if (!value.eventHandler) return;
- const message = await value.eventHandler(e);
+ const message = await value.eventHandler();
messageActions(
message,
@@ -949,7 +1008,7 @@ class PluginStore {
this.updateMainButtonItems,
this.updateProfileMenuItems,
this.updateEventListenerItems,
- this.updateFileItems
+ this.updateFileItems,
);
};
@@ -962,7 +1021,7 @@ class PluginStore {
});
};
- deactivateEventListenerItems = (plugin) => {
+ deactivateEventListenerItems = (plugin: TPlugin) => {
if (!plugin) return;
const items =
@@ -970,12 +1029,12 @@ class PluginStore {
if (!items) return;
- Array.from(items).map(([key, value]) => {
+ Array.from(items).forEach(([key]) => {
this.eventListenerItems.delete(key);
});
};
- updateFileItems = (name) => {
+ updateFileItems = (name: string) => {
const plugin = this.plugins.find((p) => p.name === name);
if (!plugin || !plugin.enabled) return;
@@ -986,7 +1045,7 @@ class PluginStore {
const userRole = this.getUserRole();
- Array.from(items).map(([key, value]) => {
+ Array.from(items).forEach(([key, value]) => {
const correctUserType = value.usersType
? value.usersType.includes(userRole)
: true;
@@ -996,7 +1055,7 @@ class PluginStore {
const fileIcon = `${plugin.iconUrl}/assets/${value.fileRowIcon}`;
const fileIconTile = `${plugin.iconUrl}/assets/${value.fileTileIcon}`;
- const onClick = async (item) => {
+ const onClick = async (item: TFile) => {
const device = this.getCurrentDevice();
const correctDevice = value.devices
? value.devices.includes(device)
@@ -1023,7 +1082,7 @@ class PluginStore {
this.updateMainButtonItems,
this.updateProfileMenuItems,
this.updateEventListenerItems,
- this.updateFileItems
+ this.updateFileItems,
);
};
@@ -1038,14 +1097,14 @@ class PluginStore {
});
};
- deactivateFileItems = (plugin) => {
+ deactivateFileItems = (plugin: TPlugin) => {
if (!plugin) return;
const items = plugin.getFileItems && plugin.getFileItems();
if (!items) return;
- Array.from(items).map(([key, value]) => {
+ Array.from(items).forEach(([key]) => {
this.fileItems.delete(key);
});
};
@@ -1063,14 +1122,15 @@ class PluginStore {
}
get contextMenuItemsList() {
- const items = [];
-
- Array.from(this.contextMenuItems, ([key, value]) => {
- items.push({ key, value: { ...value } });
- });
+ const items: { key: string; value: IContextMenuItem }[] = Array.from(
+ this.contextMenuItems,
+ ([key, value]) => {
+ return { key, value: { ...value } };
+ },
+ );
if (items.length > 0) {
- items.sort((a, b) => a.value.position < b.value.position);
+ // items.sort((a, b) => a.value.position < b.value.position);
return items;
}
@@ -1079,29 +1139,25 @@ class PluginStore {
}
get infoPanelItemsList() {
- const items = [];
-
- Array.from(this.infoPanelItems, ([key, value]) => {
- items.push({ key, value: { ...value } });
+ const items = Array.from(this.infoPanelItems, ([key, value]) => {
+ return { key, value: { ...value } };
});
return items;
}
get profileMenuItemsList() {
- const items = [];
-
- Array.from(this.profileMenuItems, ([key, value]) => {
- items.push({
+ const items = Array.from(this.profileMenuItems, ([key, value]) => {
+ return {
key,
value: {
...value,
},
- });
+ };
});
if (items.length > 0) {
- items.sort((a, b) => a.value.position < b.value.position);
+ // items.sort((a, b) => a.value.position < b.value.position);
return items;
}
@@ -1110,19 +1166,17 @@ class PluginStore {
}
get mainButtonItemsList() {
- const items = [];
-
- Array.from(this.mainButtonItems, ([key, value]) => {
- items.push({
+ const items = Array.from(this.mainButtonItems, ([key, value]) => {
+ return {
key,
value: {
...value,
},
- });
+ };
});
if (items.length > 0) {
- items.sort((a, b) => a.value.position < b.value.position);
+ // items.sort((a, b) => a.value.position < b.value.position);
return items;
}
@@ -1131,15 +1185,13 @@ class PluginStore {
}
get eventListenerItemsList() {
- const items = [];
-
- Array.from(this.eventListenerItems, ([key, value]) => {
- items.push({
+ const items = Array.from(this.eventListenerItems, ([key, value]) => {
+ return {
key,
value: {
...value,
},
- });
+ };
});
if (items.length > 0) {
@@ -1150,15 +1202,13 @@ class PluginStore {
}
get fileItemsList() {
- const items = [];
-
- Array.from(this.fileItems, ([key, value]) => {
- items.push({
+ const items = Array.from(this.fileItems, ([key, value]) => {
+ return {
key,
value: {
...value,
},
- });
+ };
});
if (items.length > 0) {
diff --git a/packages/client/src/store/SelectedFolderStore.js b/packages/client/src/store/SelectedFolderStore.js
deleted file mode 100644
index 496baad267..0000000000
--- a/packages/client/src/store/SelectedFolderStore.js
+++ /dev/null
@@ -1,219 +0,0 @@
-import { ShareAccessRights } from "@docspace/shared/enums";
-import { makeAutoObservable } from "mobx";
-import { setDocumentTitle } from "SRC_DIR/helpers/utils";
-
-class SelectedFolderStore {
- folders = null;
- parentId = null;
- filesCount = null;
- foldersCount = null;
- isShareable = null;
- new = null;
- id = null;
- title = null;
- access = null;
- shared = null;
- created = null;
- createdBy = null;
- updated = null;
- updatedBy = null;
- rootFolderType = null;
- pathParts = null;
- navigationPath = null;
- providerItem = null;
- providerKey = null;
- providerId = null;
- roomType = null;
- pinned = null;
- isRoom = null;
- isArchive = null;
- logo = null;
- tags = null;
- rootFolderId = null;
- settingsStore = null;
- security = null;
- type = null;
- inRoom = false;
- isFolder = true;
-
- constructor(settingsStore) {
- makeAutoObservable(this);
- this.settingsStore = settingsStore;
- }
-
- getSelectedFolder = () => {
- return {
- folders: this.folders,
- parentId: this.parentId,
- filesCount: this.filesCount,
- foldersCount: this.foldersCount,
- isShareable: this.isShareable,
- new: this.new,
- id: this.id,
- title: this.title,
- access: this.access,
- shared: this.shared,
- created: this.created,
- createdBy: this.createdBy,
- updated: this.updated,
- updatedBy: this.updatedBy,
- rootFolderType: this.rootFolderType,
- pathParts: this.pathParts,
- navigationPath: this.navigationPath,
- providerItem: this.providerItem,
- providerKey: this.providerKey,
- providerId: this.providerId,
- roomType: this.roomType,
- pinned: this.pinned,
- isRoom: this.isRoom,
- logo: this.logo,
- tags: this.tags,
- rootFolderId: this.rootFolderId,
- security: this.security,
- inRoom: this.inRoom,
- isFolder: this.isFolder,
- };
- };
-
- get isRootFolder() {
- return this.pathParts && this.pathParts.length <= 1;
- }
-
- get canCopyPublicLink() {
- return (
- this.access === ShareAccessRights.RoomManager ||
- this.access === ShareAccessRights.None
- );
- }
-
- toDefault = () => {
- this.folders = null;
- this.parentId = null;
- this.filesCount = null;
- this.foldersCount = null;
- this.isShareable = null;
- this.new = null;
- this.id = null;
- this.title = null;
- this.access = null;
- this.shared = null;
- this.created = null;
- this.createdBy = null;
- this.updated = null;
- this.updatedBy = null;
- this.rootFolderType = null;
- this.pathParts = null;
- this.navigationPath = null;
- this.providerItem = null;
- this.providerKey = null;
- this.providerId = null;
- this.roomType = null;
- this.pinned = null;
- this.isRoom = null;
- this.logo = null;
- this.tags = null;
- this.rootFolderId = null;
- this.security = null;
- this.type = null;
- this.inRoom = false;
- };
-
- setParentId = (parentId) => {
- this.parentId = parentId;
- };
-
- setRoomType = (roomType) => {
- this.roomType = roomType;
- };
-
- setCreatedBy = (createdBy) => {
- this.createdBy = createdBy;
- };
-
- setNavigationPath = (navigationPath) => {
- this.navigationPath = navigationPath;
- };
-
- setShared = (shared) => {
- this.shared = shared;
- };
-
- updateEditedSelectedRoom = (title = this.title, tags = this.tags) => {
- this.title = title;
- this.tags = tags;
- };
-
- setInRoom = (inRoom) => {
- this.inRoom = inRoom;
- };
-
- addDefaultLogoPaths = () => {
- const cachebreaker = new Date().getTime();
- this.logo = {
- small: `/storage/room_logos/root/${this.id}_small.png?` + cachebreaker,
- medium: `/storage/room_logos/root/${this.id}_medium.png?` + cachebreaker,
- large: `/storage/room_logos/root/${this.id}_large.png?` + cachebreaker,
- original:
- `/storage/room_logos/root/${this.id}_original.png?` + cachebreaker,
- };
- };
-
- removeLogoPaths = () => {
- this.logo = {
- small: "",
- medium: "",
- large: "",
- original: "",
- };
- };
-
- updateLogoPathsCacheBreaker = () => {
- if (!this.logo.original) return;
-
- const cachebreaker = new Date().getTime();
- this.logo = {
- small: this.logo.small.split("?")[0] + "?" + cachebreaker,
- medium: this.logo.medium.split("?")[0] + "?" + cachebreaker,
- large: this.logo.large.split("?")[0] + "?" + cachebreaker,
- original: this.logo.original.split("?")[0] + "?" + cachebreaker,
- };
- };
-
- setSelectedFolder = (selectedFolder) => {
- const { socketHelper } = this.settingsStore;
-
- if (this.id !== null) {
- socketHelper.emit({
- command: "unsubscribe",
- data: { roomParts: `DIR-${this.id}`, individual: true },
- });
- }
-
- if (selectedFolder) {
- socketHelper.emit({
- command: "subscribe",
- data: { roomParts: `DIR-${selectedFolder.id}`, individual: true },
- });
- }
-
- if (!selectedFolder) {
- this.toDefault();
- } else {
- const selectedFolderItems = Object.keys(selectedFolder);
-
- if (!selectedFolderItems.includes("roomType")) this.roomType = null;
-
- setDocumentTitle(selectedFolder.title);
-
- if (!selectedFolder.hasOwnProperty("type")) this.type = null;
-
- for (let key of selectedFolderItems) {
- if (key in this) {
- this[key] = selectedFolder[key];
- }
- }
- }
- };
-}
-
-export default SelectedFolderStore;
diff --git a/packages/client/src/store/SelectedFolderStore.ts b/packages/client/src/store/SelectedFolderStore.ts
new file mode 100644
index 0000000000..16715c560f
--- /dev/null
+++ b/packages/client/src/store/SelectedFolderStore.ts
@@ -0,0 +1,304 @@
+import { makeAutoObservable } from "mobx";
+
+import { SettingsStore } from "@docspace/shared/store/SettingsStore";
+import {
+ FolderType,
+ RoomsType,
+ ShareAccessRights,
+} from "@docspace/shared/enums";
+import {
+ NonFunctionProperties,
+ NonFunctionPropertyNames,
+ TCreatedBy,
+ TPathParts,
+} from "@docspace/shared/types";
+import { TFolder, TFolderSecurity } from "@docspace/shared/api/files/types";
+import { TLogo, TRoomSecurity } from "@docspace/shared/api/rooms/types";
+
+import { setDocumentTitle } from "../helpers/utils";
+
+export type TNavigationPath = {
+ id: number;
+ title: string;
+ isRoom: boolean;
+ roomType: RoomsType;
+ isRootRoom: boolean;
+ shared: boolean;
+ canCopyPublicLink: boolean;
+};
+
+type ExcludeTypes = SettingsStore | Function;
+
+export type TSelectedFolder = NonFunctionProperties<
+ SelectedFolderStore,
+ ExcludeTypes
+>;
+
+export type TSetSelectedFolder = {
+ [key in NonFunctionPropertyNames<
+ SelectedFolderStore,
+ ExcludeTypes
+ >]?: TSelectedFolder[key];
+};
+
+class SelectedFolderStore {
+ folders: TFolder[] | null = null;
+
+ parentId = 0;
+
+ filesCount = 0;
+
+ foldersCount = 0;
+
+ isShareable = false;
+
+ new = 0;
+
+ id: number | string | null = null;
+
+ title: string = "";
+
+ access: ShareAccessRights | null = null;
+
+ shared = false;
+
+ created: Date | null = null;
+
+ createdBy: TCreatedBy | null = null;
+
+ updated: Date | null = null;
+
+ updatedBy: TCreatedBy | null = null;
+
+ rootFolderType: FolderType | null = null;
+
+ pathParts: TPathParts[] = [];
+
+ navigationPath: TNavigationPath[] = [];
+
+ providerItem = null;
+
+ providerKey = null;
+
+ providerId = null;
+
+ roomType: RoomsType | null = null;
+
+ pinned = false;
+
+ isRoom = false;
+
+ isArchive = false;
+
+ logo: TLogo | null = null;
+
+ tags: string[] = [];
+
+ rootFolderId: number = 0;
+
+ private settingsStore: SettingsStore = {} as SettingsStore;
+
+ security: TFolderSecurity | TRoomSecurity | null = null;
+
+ type = null;
+
+ inRoom = false;
+
+ isFolder = true;
+
+ mute = false;
+
+ private = false;
+
+ canShare = false;
+
+ constructor(settingsStore: SettingsStore) {
+ makeAutoObservable(this);
+ this.settingsStore = settingsStore;
+ }
+
+ getSelectedFolder: () => TSelectedFolder = () => {
+ return {
+ folders: this.folders,
+ parentId: this.parentId,
+ filesCount: this.filesCount,
+ foldersCount: this.foldersCount,
+ isShareable: this.isShareable,
+ new: this.new,
+ id: this.id,
+ title: this.title,
+ access: this.access,
+ shared: this.shared,
+ created: this.created,
+ createdBy: this.createdBy,
+ updated: this.updated,
+ updatedBy: this.updatedBy,
+ rootFolderType: this.rootFolderType,
+ pathParts: this.pathParts,
+ navigationPath: this.navigationPath,
+ providerItem: this.providerItem,
+ providerKey: this.providerKey,
+ providerId: this.providerId,
+ roomType: this.roomType,
+ pinned: this.pinned,
+ isRoom: this.isRoom,
+ logo: this.logo,
+ tags: this.tags,
+ rootFolderId: this.rootFolderId,
+ security: this.security,
+ inRoom: this.inRoom,
+ isFolder: this.isFolder,
+ mute: this.mute,
+ private: this.private,
+ canShare: this.canShare,
+ isArchive: this.isArchive,
+ canCopyPublicLink: this.canCopyPublicLink,
+ type: this.type,
+ isRootFolder: this.isRootFolder,
+ };
+ };
+
+ get isRootFolder() {
+ return this.pathParts && this.pathParts.length <= 1;
+ }
+
+ get canCopyPublicLink() {
+ return (
+ this.access === ShareAccessRights.RoomManager ||
+ this.access === ShareAccessRights.None
+ );
+ }
+
+ toDefault = () => {
+ this.folders = null;
+ this.parentId = 0;
+ this.filesCount = 0;
+ this.foldersCount = 0;
+ this.isShareable = false;
+ this.new = 0;
+ this.id = 0;
+ this.title = "";
+ this.access = null;
+ this.shared = false;
+ this.created = null;
+ this.createdBy = null;
+ this.updated = null;
+ this.updatedBy = null;
+ this.rootFolderType = null;
+ this.pathParts = [];
+ this.navigationPath = [];
+ this.providerItem = null;
+ this.providerKey = null;
+ this.providerId = null;
+ this.roomType = null;
+ this.pinned = false;
+ this.isRoom = false;
+ this.logo = null;
+ this.tags = [];
+ this.rootFolderId = 0;
+ this.security = null;
+ this.type = null;
+ this.inRoom = false;
+ };
+
+ setParentId = (parentId: number) => {
+ this.parentId = parentId;
+ };
+
+ setRoomType = (roomType: RoomsType) => {
+ this.roomType = roomType;
+ };
+
+ setCreatedBy = (createdBy: TCreatedBy) => {
+ this.createdBy = createdBy;
+ };
+
+ setNavigationPath = (navigationPath: TNavigationPath[]) => {
+ this.navigationPath = navigationPath;
+ };
+
+ setShared = (shared: boolean) => {
+ this.shared = shared;
+ };
+
+ updateEditedSelectedRoom = (title = this.title, tags = this.tags) => {
+ this.title = title;
+ this.tags = tags;
+ };
+
+ setInRoom = (inRoom: boolean) => {
+ this.inRoom = inRoom;
+ };
+
+ addDefaultLogoPaths = () => {
+ const cachebreaker = new Date().getTime();
+ this.logo = {
+ small: `/storage/room_logos/root/${this.id}_small.png?${cachebreaker}`,
+ medium: `/storage/room_logos/root/${this.id}_medium.png?${cachebreaker}`,
+ large: `/storage/room_logos/root/${this.id}_large.png?${cachebreaker}`,
+ original: `/storage/room_logos/root/${this.id}_original.png?${cachebreaker}`,
+ };
+ };
+
+ removeLogoPaths = () => {
+ this.logo = {
+ small: "",
+ medium: "",
+ large: "",
+ original: "",
+ };
+ };
+
+ updateLogoPathsCacheBreaker = () => {
+ if (!this.logo?.original) return;
+
+ const cachebreaker = new Date().getTime();
+ this.logo = {
+ small: `${this.logo.small.split("?")[0]}?${cachebreaker}`,
+ medium: `${this.logo.medium.split("?")[0]}?${cachebreaker}`,
+ large: `${this.logo.large.split("?")[0]}?${cachebreaker}`,
+ original: `${this.logo.original.split("?")[0]}?${cachebreaker}`,
+ };
+ };
+
+ setSelectedFolder: (selectedFolder: TSetSelectedFolder | null) => void = (
+ selectedFolder,
+ ) => {
+ const socketHelper = this.settingsStore?.socketHelper;
+
+ if (this.id !== null && socketHelper) {
+ socketHelper.emit({
+ command: "unsubscribe",
+ data: { roomParts: `DIR-${this.id}`, individual: true },
+ });
+ }
+
+ if (selectedFolder && socketHelper) {
+ socketHelper.emit({
+ command: "subscribe",
+ data: { roomParts: `DIR-${selectedFolder.id}`, individual: true },
+ });
+ }
+
+ if (!selectedFolder) {
+ this.toDefault();
+ } else {
+ const selectedFolderItems = Object.keys(selectedFolder);
+
+ if (!selectedFolderItems.includes("roomType")) this.roomType = null;
+
+ setDocumentTitle(selectedFolder.title);
+
+ if (!("type" in selectedFolder)) this.type = null;
+
+ Object.entries(selectedFolder).forEach(([key, item]) => {
+ if (key in this) {
+ // @ts-expect-error its always be good
+ this[key] = item;
+ }
+ });
+ }
+ };
+}
+
+export default SelectedFolderStore;
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/client/src/store/WizardStore.js b/packages/client/src/store/WizardStore.ts
similarity index 59%
rename from packages/client/src/store/WizardStore.js
rename to packages/client/src/store/WizardStore.ts
index 2c7d8082b4..b0fbae5a3c 100644
--- a/packages/client/src/store/WizardStore.js
+++ b/packages/client/src/store/WizardStore.ts
@@ -1,34 +1,37 @@
+import { makeAutoObservable } from "mobx";
+
import {
getMachineName,
- setPortalOwner,
getIsLicenseRequired,
setLicense,
} from "@docspace/shared/api/settings";
-import { makeAutoObservable } from "mobx";
class WizardStore {
isWizardLoaded = false;
+
isLicenseRequired = false;
+
machineName = "unknown";
- licenseUpload = null;
+
+ licenseUpload: null | string = null;
constructor() {
makeAutoObservable(this);
}
- setIsWizardLoaded = (isWizardLoaded) => {
+ setIsWizardLoaded = (isWizardLoaded: boolean) => {
this.isWizardLoaded = isWizardLoaded;
};
- setMachineName = (machineName) => {
+ setMachineName = (machineName: string) => {
this.machineName = machineName;
};
- setIsRequiredLicense = (isRequired) => {
+ setIsRequiredLicense = (isRequired: boolean) => {
this.isLicenseRequired = isRequired;
};
- setLicenseUpload = (message) => {
+ setLicenseUpload = (message: null | string) => {
this.licenseUpload = message;
};
@@ -36,40 +39,18 @@ class WizardStore {
this.setLicenseUpload(null);
};
- getMachineName = async (token) => {
+ getMachineName = async (token: string) => {
const machineName = await getMachineName(token);
this.machineName = machineName;
};
- setPortalOwner = async (
- email,
- hash,
- lng,
- timeZone,
- confirmKey,
- analytics
- ) => {
- const response = await setPortalOwner(
- email,
- hash,
- lng,
- timeZone,
- confirmKey,
- analytics
- );
-
- console.log("setPortalOwner", response);
-
- return Promise.resolve(response);
- };
-
getIsRequiredLicense = async () => {
const isRequired = await getIsLicenseRequired();
this.setIsRequiredLicense(isRequired);
};
- setLicense = async (confirmKey, data) => {
+ setLicense = async (confirmKey: string, data: FormData) => {
const message = await setLicense(confirmKey, data);
this.setLicenseUpload(message);
diff --git a/packages/client/src/store/index.js b/packages/client/src/store/index.js
index d27975221a..9b4308360b 100644
--- a/packages/client/src/store/index.js
+++ b/packages/client/src/store/index.js
@@ -57,14 +57,14 @@ const selectedFolderStore = new SelectedFolderStore(settingsStore);
const pluginStore = new PluginStore(
settingsStore,
selectedFolderStore,
- userStore
+ userStore,
);
const paymentStore = new PaymentStore(
userStore,
currentTariffStatusStore,
currentQuotaStore,
- paymentQuotasStore
+ paymentQuotasStore,
);
const wizardStore = new WizardStore();
const setupStore = new SettingsSetupStore(tfaStore, authStore, settingsStore);
@@ -83,7 +83,7 @@ const infoPanelStore = new InfoPanelStore(userStore);
const treeFoldersStore = new TreeFoldersStore(
selectedFolderStore,
settingsStore,
- publicRoomStore
+ publicRoomStore,
);
const clientLoadingStore = new ClientLoadingStore();
@@ -94,13 +94,13 @@ const filesSettingsStore = new FilesSettingsStore(
publicRoomStore,
pluginStore,
authStore,
- settingsStore
+ settingsStore,
);
const accessRightsStore = new AccessRightsStore(
authStore,
selectedFolderStore,
- userStore
+ userStore,
);
const filesStore = new FilesStore(
@@ -116,12 +116,12 @@ const filesStore = new FilesStore(
infoPanelStore,
userStore,
currentTariffStatusStore,
- settingsStore
+ settingsStore,
);
const mediaViewerDataStore = new MediaViewerDataStore(
filesStore,
- publicRoomStore
+ publicRoomStore,
);
const oformsStore = new OformsStore(settingsStore, infoPanelStore, userStore);
@@ -136,7 +136,7 @@ const dialogsStore = new DialogsStore(
filesStore,
selectedFolderStore,
versionHistoryStore,
- infoPanelStore
+ infoPanelStore,
);
const peopleStore = new PeopleStore(
@@ -147,7 +147,7 @@ const peopleStore = new PeopleStore(
infoPanelStore,
userStore,
tfaStore,
- settingsStore
+ settingsStore,
);
const uploadDataStore = new UploadDataStore(
@@ -158,7 +158,7 @@ const uploadDataStore = new UploadDataStore(
secondaryProgressDataStore,
primaryProgressDataStore,
dialogsStore,
- filesSettingsStore
+ filesSettingsStore,
);
const filesActionsStore = new FilesActionsStore(
@@ -176,7 +176,7 @@ const filesActionsStore = new FilesActionsStore(
pluginStore,
infoPanelStore,
userStore,
- currentTariffStatusStore
+ currentTariffStatusStore,
);
const contextOptionsStore = new ContextOptionsStore(
@@ -195,7 +195,7 @@ const contextOptionsStore = new ContextOptionsStore(
pluginStore,
infoPanelStore,
currentTariffStatusStore,
- userStore
+ userStore,
);
const hotkeyStore = new HotkeyStore(
@@ -205,7 +205,7 @@ const hotkeyStore = new HotkeyStore(
filesActionsStore,
treeFoldersStore,
uploadDataStore,
- selectedFolderStore
+ selectedFolderStore,
);
const profileActionsStore = new ProfileActionsStore(
@@ -216,7 +216,7 @@ const profileActionsStore = new ProfileActionsStore(
selectedFolderStore,
pluginStore,
userStore,
- settingsStore
+ settingsStore,
);
peopleStore.profileActionsStore = profileActionsStore;
@@ -244,7 +244,7 @@ const createEditRoomStore = new CreateEditRoomStore(
settingsStore,
infoPanelStore,
currentQuotaStore,
- clientLoadingStore
+ clientLoadingStore,
);
const webhooksStore = new WebhooksStore(settingsStore);
@@ -259,8 +259,8 @@ const store = {
paymentQuotasStore,
settingsStore,
- payments: paymentStore,
- wizard: wizardStore,
+ paymentStore,
+ wizardStore,
setup: setupStore,
confirm: confirmStore,
backup: backupStore,
diff --git a/packages/client/tsconfig.eslint.json b/packages/client/tsconfig.eslint.json
new file mode 100644
index 0000000000..037ebb9ba7
--- /dev/null
+++ b/packages/client/tsconfig.eslint.json
@@ -0,0 +1,17 @@
+{
+ "extends": "./tsconfig.json",
+ "include": [
+ // 👇️ add all the directories and files
+ // that you want to lint here
+ "src",
+ // add all files in which you see
+ // the "parserOptions.project" error
+ ".eslintrc.cjs",
+ "__mocks__",
+ "jest.config.ts",
+ ".storybook",
+ "babel.config.ts",
+ "index.d.ts",
+ "tsconfig.eslint.json"
+ ]
+}
diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json
index b3a4c00f28..8abf0c2b02 100644
--- a/packages/client/tsconfig.json
+++ b/packages/client/tsconfig.json
@@ -1,21 +1,11 @@
{
+ "extends": "../shared/tsconfig.json",
"compilerOptions": {
- "outDir": "./dist/",
- "target": "es2016",
- "jsx": "react-jsx",
- "module": "ESNext",
+ "rootDir": "./",
"baseUrl": "./",
- "moduleResolution": "node",
-
- "strict": true,
- "resolveJsonModule": true,
- "esModuleInterop": true,
- "skipLibCheck": true,
- "allowJs": true,
"paths": {
- "PUBLIC_DIR": ["../../public"],
- "COMMON_DIR": ["../common"],
- "SRC_DIR": ["./src"]
- }
- }
+ "PUBLIC_DIR/*": ["../../public/*"],
+ "SRC_DIR/*": ["./src/*"],
+ },
+ },
}
diff --git a/packages/common/package.json b/packages/common/package.json
index 05aff3c492..9957ad3895 100644
--- a/packages/common/package.json
+++ b/packages/common/package.json
@@ -1,6 +1,6 @@
{
"name": "@docspace/common",
- "version": "2.0.2",
+ "version": "2.0.3",
"private": true,
"scripts": {
"build": "echo 'skip it'",
diff --git a/packages/editor/package.json b/packages/editor/package.json
index 998f8f287f..ef18eed6a2 100644
--- a/packages/editor/package.json
+++ b/packages/editor/package.json
@@ -1,6 +1,6 @@
{
"name": "@docspace/editor",
- "version": "2.0.2",
+ "version": "2.0.3",
"private": true,
"homepage": "/doceditor",
"scripts": {
diff --git a/packages/login/package.json b/packages/login/package.json
index ccdff71e92..5156cadc86 100644
--- a/packages/login/package.json
+++ b/packages/login/package.json
@@ -1,6 +1,6 @@
{
"name": "@docspace/login",
- "version": "2.0.2",
+ "version": "2.0.3",
"private": true,
"homepage": "/login",
"scripts": {
diff --git a/packages/shared/api/people/types.ts b/packages/shared/api/people/types.ts
index 3ad25f7bcc..daf2fcc55d 100644
--- a/packages/shared/api/people/types.ts
+++ b/packages/shared/api/people/types.ts
@@ -5,6 +5,7 @@ import {
} from "../../enums";
export type TUser = {
+ access: number;
firstName: string;
lastName: string;
userName: string;
@@ -15,6 +16,7 @@ export type TUser = {
workFrom: string;
avatarMax: string;
avatarMedium: string;
+ avatarOriginal: string;
avatar: string;
isAdmin: boolean;
isRoomAdmin: boolean;
diff --git a/packages/shared/api/plugins/index.js b/packages/shared/api/plugins/index.ts
similarity index 51%
rename from packages/shared/api/plugins/index.js
rename to packages/shared/api/plugins/index.ts
index a7f2fc3c9b..6665af2298 100644
--- a/packages/shared/api/plugins/index.js
+++ b/packages/shared/api/plugins/index.ts
@@ -1,32 +1,41 @@
import { request } from "../client";
+import { TAPIPlugin } from "./types";
-export const getPlugins = async (enabled) => {
+export const getPlugins = async (enabled: null | boolean) => {
const url = enabled
? `/settings/webplugins?enabled=${enabled}`
: `/settings/webplugins`;
- return request({
+ const res = (await request({
method: "GET",
url,
- });
+ })) as TAPIPlugin[];
+
+ return res;
};
-export const addPlugin = async (data) => {
- return request({
+export const addPlugin = async (data: FormData) => {
+ const res = (await request({
method: "POST",
url: `/settings/webplugins`,
data,
- });
+ })) as TAPIPlugin;
+
+ return res;
};
-export const getPlugin = async (name) => {
+export const getPlugin = async (name: string) => {
return request({
method: "GET",
url: `/settings/webplugins/${name}`,
});
};
-export const updatePlugin = async (name, enabled, settings = "") => {
+export const updatePlugin = async (
+ name: string,
+ enabled: boolean,
+ settings: unknown = "",
+) => {
return request({
method: "PUT",
url: `/settings/webplugins/${name}`,
@@ -34,7 +43,7 @@ export const updatePlugin = async (name, enabled, settings = "") => {
});
};
-export const deletePlugin = async (name) => {
+export const deletePlugin = async (name: string) => {
request({
method: "DELETE",
url: `/settings/webplugins/${name}`,
diff --git a/packages/shared/api/plugins/types.ts b/packages/shared/api/plugins/types.ts
new file mode 100644
index 0000000000..6cebcc7f9b
--- /dev/null
+++ b/packages/shared/api/plugins/types.ts
@@ -0,0 +1,19 @@
+import { TCreatedBy } from "../../types";
+
+export type TAPIPlugin = {
+ name: string;
+ version: string;
+ description: string;
+ license: string;
+ author: string;
+ homePage: string;
+ pluginName: string;
+ scopes: string;
+ image: string;
+ createBy: TCreatedBy;
+ createOn: Date;
+ enabled: boolean;
+ system: boolean;
+ url: string;
+ settings: string;
+};
diff --git a/packages/shared/api/portal/index.ts b/packages/shared/api/portal/index.ts
index d44c87995f..69b19a419f 100644
--- a/packages/shared/api/portal/index.ts
+++ b/packages/shared/api/portal/index.ts
@@ -253,12 +253,21 @@ export async function getPortalTariff(refresh = false) {
return res;
}
-export function getPaymentAccount() {
- return request({ method: "get", url: "/portal/payment/account" });
+export async function getPaymentAccount() {
+ const res = (await request({
+ method: "get",
+ url: "/portal/payment/account",
+ })) as string;
+
+ return res;
}
-export function getPaymentLink(adminCount, backUrl, signal) {
- return request({
+export async function getPaymentLink(
+ adminCount: number,
+ backUrl: string,
+ signal?: AbortSignal,
+) {
+ const res = (await request({
method: "put",
url: `/portal/payment/url`,
data: {
@@ -266,7 +275,9 @@ export function getPaymentLink(adminCount, backUrl, signal) {
backUrl,
},
signal,
- });
+ })) as string;
+
+ return res;
}
export function updatePayment(adminCount) {
diff --git a/packages/shared/api/settings/index.ts b/packages/shared/api/settings/index.ts
index 6f01ce4724..1f271a0ff6 100644
--- a/packages/shared/api/settings/index.ts
+++ b/packages/shared/api/settings/index.ts
@@ -18,6 +18,7 @@ import {
TLoginSettings,
TCapabilities,
TThirdPartyProvider,
+ TPaymentSettings,
} from "./types";
export async function getSettings(withPassword = false, headers = null) {
@@ -316,13 +317,12 @@ export function getIsDefaultWhiteLabel() {
});
}
-export function restoreWhiteLabelSettings(isDefault, isManagement) {
+export function restoreWhiteLabelSettings(isManagement) {
const url = "/settings/whitelabel/restore";
return request({
method: "put",
url: isManagement ? `${url}?isDefault=true` : url,
- data: { isDefault },
});
}
@@ -514,15 +514,17 @@ export function ownerChange(ownerId, confirmKey = null) {
return request(options);
}
-export function getMachineName(confirmKey = null) {
- const options = {
+export async function getMachineName(confirmKey: string = "") {
+ const options: AxiosRequestConfig = {
method: "get",
url: "/settings/machine",
};
if (confirmKey) options.headers = { confirm: confirmKey };
- return request(options);
+ const res = (await request(options)) as string;
+
+ return res;
}
export function setPortalOwner(
@@ -551,15 +553,17 @@ export function setPortalOwner(
return request(options);
}
-export function getIsLicenseRequired() {
- return request({
+export async function getIsLicenseRequired() {
+ const res = (await request({
method: "get",
url: "/settings/license/required",
- });
+ })) as boolean;
+
+ return res;
}
-export function setLicense(confirmKey, data) {
- const options = {
+export async function setLicense(confirmKey: string, data: FormData) {
+ const options: AxiosRequestConfig = {
method: "post",
url: `/settings/license`,
data,
@@ -569,14 +573,18 @@ export function setLicense(confirmKey, data) {
options.headers = { confirm: confirmKey };
}
- return request(options);
+ const res = (await request(options)) as string;
+
+ return res;
}
-export function getPaymentSettings() {
- return request({
+export async function getPaymentSettings() {
+ const res = (await request({
method: "get",
url: `/settings/payment`,
- });
+ })) as TPaymentSettings;
+
+ return res;
}
export function acceptLicense() {
return request({
diff --git a/packages/shared/api/settings/types.ts b/packages/shared/api/settings/types.ts
index 37ed83bb18..152de4c2ef 100644
--- a/packages/shared/api/settings/types.ts
+++ b/packages/shared/api/settings/types.ts
@@ -195,3 +195,15 @@ export type TThirdPartyProvider = {
url: string;
linked: boolean;
};
+
+export type TPaymentSettings = {
+ salesEmail: string;
+ feedbackAndSupportUrl: string;
+ buyUrl: string;
+ standalone: boolean;
+ currentLicense: {
+ trial: boolean;
+ date: Date;
+ };
+ max: number;
+};
diff --git a/packages/shared/components/access-right-select/AccessRightSelect.tsx b/packages/shared/components/access-right-select/AccessRightSelect.tsx
index dc87d3d574..d2873d38ac 100644
--- a/packages/shared/components/access-right-select/AccessRightSelect.tsx
+++ b/packages/shared/components/access-right-select/AccessRightSelect.tsx
@@ -70,11 +70,11 @@ export const AccessRightSelectPure = ({
);
});
- return items;
+ return {items}
;
};
const formattedOptions =
- advancedOptions || formatToAccessRightItem(accessOptions);
+ advancedOptions ?? formatToAccessRightItem(accessOptions);
// console.log(formattedOptions);
diff --git a/packages/shared/components/calendar/Calendar.tsx b/packages/shared/components/calendar/Calendar.tsx
index 01b6f15788..68910df902 100644
--- a/packages/shared/components/calendar/Calendar.tsx
+++ b/packages/shared/components/calendar/Calendar.tsx
@@ -13,8 +13,8 @@ const Calendar = ({
locale = "en",
selectedDate,
setSelectedDate,
- minDate = new Date("1970/01/01"),
- maxDate = new Date("2040/01/01"),
+ minDate,
+ maxDate,
id,
className,
style,
@@ -41,8 +41,6 @@ const Calendar = ({
const [resultMinDate, setResultMinDate] = useState(moment());
const [resultMaxDate, setResultMaxDate] = useState(moment());
- const initialDateRef = React.useRef(moment(initialDate));
-
useEffect(() => {
const [min, max] = getValidDates(minDate, maxDate);
@@ -51,34 +49,34 @@ const Calendar = ({
}, [minDate, maxDate]);
useEffect(() => {
- const today = moment();
+ let date = moment(initialDate);
+ const [min, max] = getValidDates(minDate, maxDate);
+
if (!initialDate) {
- initialDateRef.current =
- today <= resultMaxDate && initialDateRef.current >= resultMinDate
+ const today = moment();
+ date =
+ today <= max && today >= min
? today
- : today.diff(resultMinDate, "day") > today.diff(resultMaxDate, "day")
- ? resultMinDate.clone()
- : resultMaxDate.clone();
+ : Math.abs(today.diff(min, "day")) > Math.abs(today.diff(max, "day"))
+ ? max.clone()
+ : min.clone();
- initialDateRef.current.startOf("day");
- } else if (
- initialDateRef.current > resultMaxDate ||
- initialDateRef.current < resultMinDate
- ) {
- initialDateRef.current =
- today <= resultMaxDate && today >= resultMinDate
- ? today
- : today.diff(resultMinDate, "day") > today.diff(resultMaxDate, "day")
- ? resultMinDate.clone()
- : resultMaxDate.clone();
- initialDate.startOf("day");
+ date.startOf("day");
+ date = moment();
+ } else if (date > max || date < min) {
+ date =
+ Math.abs(date.diff(min, "day")) > Math.abs(date.diff(max, "day"))
+ ? max.clone()
+ : min.clone();
- console.error(
+ date.startOf("day");
+
+ console.warn(
"Initial date is out of min/max dates boundaries. Initial date will be set as closest boundary value",
);
}
- setObservedDate(initialDateRef.current);
- }, [initialDate, resultMaxDate, resultMinDate]);
+ setObservedDate(date);
+ }, [initialDate, maxDate, minDate]);
return (
void;
/** Specifies the minimum selectable date */
- minDate: moment.Moment | Date;
+ minDate?: moment.Moment | Date;
/** Specifies the maximum selectable date */
- maxDate: moment.Moment | Date;
+ maxDate?: moment.Moment | Date;
/** Accepts css style */
style?: React.CSSProperties;
/** First shown date */
- initialDate?: moment.Moment;
+ initialDate?: moment.Moment | Date;
isMobile?: boolean;
forwardedRef?: React.RefObject;
}
diff --git a/packages/shared/components/calendar/calendar.stories.tsx b/packages/shared/components/calendar/calendar.stories.tsx
index 96ba20b865..23b3dcb67c 100644
--- a/packages/shared/components/calendar/calendar.stories.tsx
+++ b/packages/shared/components/calendar/calendar.stories.tsx
@@ -81,6 +81,6 @@ export const Default: Story = {
locale: "en",
maxDate: new Date(`${new Date().getFullYear() + 10}/01/01`),
minDate: new Date("1970/01/01"),
- initialDate: moment(),
+ initialDate: new Date(),
},
};
diff --git a/packages/shared/components/calendar/utils/getValidDates.ts b/packages/shared/components/calendar/utils/getValidDates.ts
index a013a58cdd..aaad15ee77 100644
--- a/packages/shared/components/calendar/utils/getValidDates.ts
+++ b/packages/shared/components/calendar/utils/getValidDates.ts
@@ -2,36 +2,45 @@
import moment from "moment";
export const getValidDates = (
- currentMinDate: moment.Moment | Date,
- currentMaxDate: moment.Moment | Date,
- minDate = new Date("01/01/1970"),
- maxDate = new Date().setFullYear(new Date().getFullYear() + 10),
+ currentMinDate?: moment.Moment | Date,
+ currentMaxDate?: moment.Moment | Date,
+ minDate?: moment.Moment | Date,
+ maxDate?: moment.Moment | Date,
) => {
- // @ts-expect-error TS(2365): Operator '>=' cannot be applied to types 'Date' an... Remove this comment to see the full error message
+ if (!minDate) {
+ minDate = moment("01/01/1970", "DD/MM/YYYY");
+ }
+ if (!maxDate) {
+ maxDate = moment();
+ maxDate.add(10, "years");
+ }
+
if (minDate >= maxDate) {
- minDate = new Date("01/01/1970");
- maxDate = new Date().setFullYear(new Date().getFullYear() + 10);
+ minDate = moment("01/01/1970", "DD/MM/YYYY");
+ maxDate = moment();
+ maxDate.add(10, "years");
console.error(
"The minimum date is farther than or same as the maximum date. minDate and maxDate are set to default",
);
}
- // @ts-expect-error TS(2740): Type 'Moment' is missing the following properties ... Remove this comment to see the full error message
minDate = moment(minDate);
- // @ts-expect-error TS(2322): Type 'Moment' is not assignable to type 'number'.
maxDate = moment(maxDate);
+ if (!currentMinDate) {
+ currentMinDate = minDate;
+ }
+ if (!currentMaxDate) {
+ currentMaxDate = maxDate;
+ }
+
let resultMinDate = moment(currentMinDate);
let resultMaxDate = moment(currentMaxDate);
- // @ts-expect-error TS(2322): Type 'Date | Moment' is not assignable to type 'Mo... Remove this comment to see the full error message
resultMinDate = resultMinDate < minDate ? minDate : resultMinDate;
- // @ts-expect-error TS(2322): Type 'number | Moment' is not assignable to type '... Remove this comment to see the full error message
resultMaxDate = resultMaxDate > maxDate ? maxDate : resultMaxDate;
if (resultMinDate >= resultMaxDate) {
- // @ts-expect-error TS(2322): Type 'Date' is not assignable to type 'Moment'.
resultMinDate = minDate;
- // @ts-expect-error TS(2322): Type 'number' is not assignable to type 'Moment'.
resultMaxDate = maxDate;
}
diff --git a/packages/shared/components/combobox/ComboBox.tsx b/packages/shared/components/combobox/ComboBox.tsx
index 36024a0cae..347001235f 100644
--- a/packages/shared/components/combobox/ComboBox.tsx
+++ b/packages/shared/components/combobox/ComboBox.tsx
@@ -103,7 +103,7 @@ const ComboBoxPure = (props: ComboboxProps) => {
children,
noBorder,
scaledOptions,
- displayType,
+ displayType = "default",
textOverflow,
showDisabledItems,
diff --git a/packages/shared/components/date-picker/DatePicker.stories.tsx b/packages/shared/components/date-picker/DatePicker.stories.tsx
index 2ad9ad763b..d6c005d31e 100644
--- a/packages/shared/components/date-picker/DatePicker.stories.tsx
+++ b/packages/shared/components/date-picker/DatePicker.stories.tsx
@@ -82,7 +82,6 @@ export const Default: Story = {
minDate: new Date("1970/01/01"),
openDate: moment(),
initialDate: moment(),
- onChange: () => {},
locale: "en",
},
};
diff --git a/packages/shared/components/date-picker/DatePicker.tsx b/packages/shared/components/date-picker/DatePicker.tsx
index 5e4e3c0d19..1376ab6226 100644
--- a/packages/shared/components/date-picker/DatePicker.tsx
+++ b/packages/shared/components/date-picker/DatePicker.tsx
@@ -35,9 +35,7 @@ const DatePicker = (props: DatePickerProps) => {
const selectorRef = useRef(null);
const selectedItemRef = useRef(null);
- const [date, setDate] = useState(
- initialDate ? moment(initialDate) : moment(),
- );
+ const [date, setDate] = useState(initialDate ? moment(initialDate) : null);
const [isCalendarOpen, setIsCalendarOpen] = useState(false);
@@ -135,12 +133,12 @@ const DatePicker = (props: DatePickerProps) => {
{isCalendarOpen && (
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/components/room-icon/index.tsx b/packages/shared/components/room-icon/index.tsx
index d2b268875c..d4f5b17df1 100644
--- a/packages/shared/components/room-icon/index.tsx
+++ b/packages/shared/components/room-icon/index.tsx
@@ -1,3 +1,5 @@
+import React from "react";
+
import styled, { css } from "styled-components";
import { Base } from "../../themes";
import { Text } from "../text";
@@ -9,6 +11,7 @@ const StyledIcon = styled.div<{
radius: string;
isArchive?: boolean;
color: string;
+ wrongImage: boolean;
}>`
display: flex;
justify-content: center;
@@ -37,7 +40,8 @@ const StyledIcon = styled.div<{
font-size: ${(props) => props.theme.getCorrectFontSize("14px")};
font-weight: 700;
line-height: 16px;
- color: #ffffff;
+ color: ${(props) =>
+ props.wrongImage && props.theme.isBase ? "#333333" : "#ffffff"};
position: relative;
${(props) =>
!props.theme.isBase &&
@@ -96,6 +100,8 @@ const RoomIcon = ({
badgeUrl,
onBadgeClick,
}: RoomIconProps) => {
+ const [correctImage, setCorrectImage] = React.useState(true);
+
const titleWithoutSpaces = title.replace(/\s+/g, " ").trim();
const indexAfterLastSpace = titleWithoutSpaces.lastIndexOf(" ");
const secondCharacter =
@@ -105,12 +111,28 @@ const RoomIcon = ({
const roomTitle = (title[0] + secondCharacter).toUpperCase();
- return showDefault ? (
+ const prefetchImage = React.useCallback(() => {
+ if (!imgSrc) return;
+ const img = new Image();
+
+ img.src = imgSrc;
+
+ img.onerror = () => {
+ setCorrectImage(false);
+ };
+ }, [imgSrc]);
+
+ React.useEffect(() => {
+ prefetchImage();
+ }, [prefetchImage]);
+
+ return showDefault || !correctImage ? (
diff --git a/packages/shared/components/selector/sub-components/Item.tsx b/packages/shared/components/selector/sub-components/Item.tsx
index 3168a40ea9..1bf8ecd862 100644
--- a/packages/shared/components/selector/sub-components/Item.tsx
+++ b/packages/shared/components/selector/sub-components/Item.tsx
@@ -1,5 +1,6 @@
import React from "react";
-
+import { useTranslation } from "react-i18next";
+import { getUserTypeLabel } from "../../../utils/common";
import { Avatar, AvatarRole, AvatarSize } from "../../avatar";
import { Text } from "../../text";
import { Checkbox } from "../../checkbox";
@@ -36,6 +37,7 @@ const Item = React.memo(({ index, style, data }: ItemProps) => {
rowLoader,
renderCustomItem,
}: Data = data;
+ const { t } = useTranslation(["Common"]);
const isLoaded = isItemLoaded(index);
@@ -50,6 +52,8 @@ const Item = React.memo(({ index, style, data }: ItemProps) => {
const currentRole = role || AvatarRole.user;
+ const typeLabel = getUserTypeLabel(role, t);
+
const defaultIcon = !!color;
const isLogo = !!icon || defaultIcon;
@@ -94,7 +98,7 @@ const Item = React.memo(({ index, style, data }: ItemProps) => {
/>
)}
{renderCustomItem ? (
- renderCustomItem(label, role, email)
+ renderCustomItem(label, typeLabel, email)
) : (
{
- if (index === 0) {
+ if (index === 0 && enabledColumnsCount > 0) {
gridTemplateColumns.push(item);
} else {
const column = document.getElementById(`column_${index}`);
diff --git a/packages/shared/package.json b/packages/shared/package.json
index 8f6fbd4178..cacc866386 100644
--- a/packages/shared/package.json
+++ b/packages/shared/package.json
@@ -1,6 +1,6 @@
{
"name": "@docspace/shared",
- "version": "2.0.2",
+ "version": "2.0.3",
"private": true,
"scripts": {
"build": "echo 'skip it'",
diff --git a/packages/shared/selectors/People/index.tsx b/packages/shared/selectors/People/index.tsx
index dfa17f6060..367bd955bb 100644
--- a/packages/shared/selectors/People/index.tsx
+++ b/packages/shared/selectors/People/index.tsx
@@ -170,9 +170,11 @@ const PeopleSelector = ({
const data = response.items
.filter((item) => {
const excludeUser =
- withAbilityCreateRoomUsers &&
- ((!item.isAdmin && !item.isOwner && !item.isRoomAdmin) ||
- item.status === EmployeeStatus.Disabled);
+ (!!withAbilityCreateRoomUsers &&
+ !item.isAdmin &&
+ !item.isOwner &&
+ !item.isRoomAdmin) ||
+ item.status === EmployeeStatus.Disabled;
if (excludeItems.includes(item.id) || excludeUser) {
totalDifferent += 1;
diff --git a/packages/shared/selectors/Room/RoomSelector.types.ts b/packages/shared/selectors/Room/RoomSelector.types.ts
index 6c6ea1de7d..1698d11287 100644
--- a/packages/shared/selectors/Room/RoomSelector.types.ts
+++ b/packages/shared/selectors/Room/RoomSelector.types.ts
@@ -4,7 +4,7 @@ import { RoomsType } from "../../enums";
export interface RoomSelectorProps extends SelectorProps {
excludeItems?: number[];
- setIsDataReady: (value: boolean) => void;
+ setIsDataReady?: (value: boolean) => void;
}
export type TItem = {
@@ -15,4 +15,3 @@ export type TItem = {
logo: TLogo;
roomType: RoomsType;
};
-
diff --git a/packages/shared/selectors/Room/index.tsx b/packages/shared/selectors/Room/index.tsx
index 40bf30c942..e5e9f8621e 100644
--- a/packages/shared/selectors/Room/index.tsx
+++ b/packages/shared/selectors/Room/index.tsx
@@ -70,7 +70,7 @@ const RoomSelector = ({
const [items, setItems] = React.useState([]);
useEffect(() => {
- setIsDataReady(!isFirstLoad);
+ setIsDataReady?.(!isFirstLoad);
}, [isFirstLoad, setIsDataReady]);
const onSearchAction = React.useCallback(
@@ -120,22 +120,19 @@ const RoomSelector = ({
const rooms = convertToItems(folders);
- const itemList = rooms.filter((x) => !excludeItems.includes(x.id));
-
setHasNextPage(count === PAGE_COUNT);
- if (isFirstLoad) {
- setTotal(totalCount);
- setItems(itemList);
- } else {
- setItems((value) => [...value, ...itemList]);
- }
+ setItems((prevItems) => {
+ const newItems = rooms.filter((x) => !excludeItems.includes(x.id));
- if (isFirstLoad) {
- setTimeout(() => {
+ if (isFirstLoad) {
+ setTotal(totalCount);
setIsFirstLoad(false);
- }, 500);
- }
+ return newItems;
+ }
+
+ return [...prevItems, ...newItems];
+ });
setIsNextPageLoading(false);
},
@@ -144,7 +141,7 @@ const RoomSelector = ({
React.useEffect(() => {
onLoadNextPage(0);
- }, [onLoadNextPage]);
+ }, []);
return (
{
if (this.user) {
this.user = {
@@ -134,6 +135,7 @@ class UserStore {
avatarSmall,
avatarMedium,
avatarMax,
+ avatarOriginal,
};
}
};
diff --git a/packages/shared/themes/base.ts b/packages/shared/themes/base.ts
index 2b34ddfb63..ca7d2c0822 100644
--- a/packages/shared/themes/base.ts
+++ b/packages/shared/themes/base.ts
@@ -331,7 +331,7 @@ export const getBaseTheme = () => {
border: "none",
text: {
width: "100%",
- height: "16px",
+ height: "18px",
margin: "0 11px",
fontWeight: "500",
fontSize: "14px",
diff --git a/packages/shared/themes/dark.ts b/packages/shared/themes/dark.ts
index c4dabc73d1..11ee68946a 100644
--- a/packages/shared/themes/dark.ts
+++ b/packages/shared/themes/dark.ts
@@ -303,7 +303,7 @@ const Dark: TTheme = {
border: "1px solid #474747",
text: {
width: "100%",
- height: "16px",
+ height: "18px",
margin: "0 11px",
fontWeight: "500",
fontSize: "14px",
diff --git a/packages/shared/types/index.ts b/packages/shared/types/index.ts
index 844faffddc..dcac843337 100644
--- a/packages/shared/types/index.ts
+++ b/packages/shared/types/index.ts
@@ -15,6 +15,15 @@ export type TViewAs = "tile" | "table" | "row" | "settings" | "profile";
export type TTranslation = (key: string) => string;
+export type NonFunctionPropertyNames = {
+ [K in keyof T]: T[K] extends ExcludeTypes ? never : K;
+}[keyof T];
+
+export type NonFunctionProperties = Pick<
+ T,
+ NonFunctionPropertyNames
+>;
+
export type TPathParts = {
id: number;
title: string;
diff --git a/packages/shared/utils/common.ts b/packages/shared/utils/common.ts
index 31157d63c8..76051e595e 100644
--- a/packages/shared/utils/common.ts
+++ b/packages/shared/utils/common.ts
@@ -24,7 +24,7 @@ import BackgroundPatternPurpleReactSvgUrl from "PUBLIC_DIR/images/background.pat
import BackgroundPatternLightBlueReactSvgUrl from "PUBLIC_DIR/images/background.pattern.lightBlue.react.svg?url";
import BackgroundPatternBlackReactSvgUrl from "PUBLIC_DIR/images/background.pattern.black.react.svg?url";
-import { FolderType, RoomsType, ThemeKeys } from "../enums";
+import { FolderType, RoomsType, ShareAccessRights, ThemeKeys } from "../enums";
import { LANGUAGE, RTL_LANGUAGES } from "../constants";
import { TI18n } from "../types";
@@ -37,6 +37,7 @@ import { Encoder } from "./encoder";
import { combineUrl } from "./combineUrl";
import { getCookie } from "./cookie";
import { checkIsSSR } from "./device";
+import { AvatarRole } from "../components/avatar/Avatar.enums";
export const desktopConstants = Object.freeze({
domain: !checkIsSSR() && window.location.origin,
@@ -85,6 +86,26 @@ export const isPublicRoom = () => {
return window.location.pathname === "/rooms/share";
};
+export const getUserTypeLabel = (
+ role: AvatarRole | undefined,
+ t: (key: string) => string,
+) => {
+ switch (role) {
+ case "owner":
+ return t("Common:Owner");
+ case "admin":
+ return t("Common:DocSpaceAdmin");
+ case "manager":
+ return t("Common:RoomAdmin");
+ case "collaborator":
+ return t("Common:PowerUser");
+ case "user":
+ return t("Common:User");
+ default:
+ return t("Common:User");
+ }
+};
+
export const getShowText = () => {
const showArticle = localStorage.getItem("showArticle");
@@ -156,13 +177,18 @@ export function isAdmin(currentUser: TUser) {
export const getUserRole = (user: TUser) => {
if (user.isOwner) return "owner";
- if (isAdmin(user))
+ if (
+ isAdmin(user) ||
+ user.access === ShareAccessRights.RoomManager ||
+ user.access === ShareAccessRights.Collaborator
+ )
// TODO: Change to People Product Id const
return "admin";
// TODO: Need refactoring
if (user.isVisitor) return "user";
if (user.isCollaborator) return "collaborator";
- return "manager";
+
+ return "user";
};
export function clickBackdrop() {
diff --git a/packages/shared/utils/email/email.ts b/packages/shared/utils/email/email.ts
index bb30df8862..96f0084f6f 100644
--- a/packages/shared/utils/email/email.ts
+++ b/packages/shared/utils/email/email.ts
@@ -90,7 +90,7 @@ export class Email {
}
}
-const getParts = (str: string) => {
+export const getParts = (str: string) => {
const parts = [];
const newStr = str.replace(/[\s,;]*$/, ",");
const n = newStr.length;
diff --git a/packages/shared/utils/email/index.ts b/packages/shared/utils/email/index.ts
index 4319b80eec..51f081069b 100644
--- a/packages/shared/utils/email/index.ts
+++ b/packages/shared/utils/email/index.ts
@@ -4,5 +4,6 @@ export {
isEqualEmail,
isValidDomainName,
parseAddresses,
+ getParts,
} from "./email";
export { EmailSettings } from "./emailSettings";
diff --git a/packages/shared/utils/index.ts b/packages/shared/utils/index.ts
index b99be903bf..4a69b95c91 100644
--- a/packages/shared/utils/index.ts
+++ b/packages/shared/utils/index.ts
@@ -2,7 +2,7 @@ import moment from "moment-timezone";
import { isArrayEqual } from "./array";
import * as email from "./email";
-import { EmailSettings, parseAddress, parseAddresses } from "./email";
+import { EmailSettings, parseAddress, parseAddresses, getParts } from "./email";
import useId from "./useId";
import {
getCorrectTextAlign,
@@ -57,6 +57,7 @@ export {
RoomsTypeValues,
RoomsTypes,
parseAddresses,
+ getParts,
NoUserSelect,
commonInputStyles,
commonTextStyles,
diff --git a/packages/shared/utils/socket.ts b/packages/shared/utils/socket.ts
index e335d9aa6f..d839325542 100644
--- a/packages/shared/utils/socket.ts
+++ b/packages/shared/utils/socket.ts
@@ -15,7 +15,7 @@ const subscribers = new Set();
export type TEmit = {
command: string;
- data: { roomParts: string | [] };
+ data: { roomParts: string | []; individual?: boolean };
room?: null | boolean;
};
diff --git a/yarn.lock b/yarn.lock
index 46c61be76a..d10aa6a3f0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -118,14 +118,14 @@ __metadata:
linkType: hard
"@aws-sdk/client-cloudwatch-logs@npm:^3.297.0":
- version: 3.504.0
- resolution: "@aws-sdk/client-cloudwatch-logs@npm:3.504.0"
+ version: 3.508.0
+ resolution: "@aws-sdk/client-cloudwatch-logs@npm:3.508.0"
dependencies:
"@aws-crypto/sha256-browser": "npm:3.0.0"
"@aws-crypto/sha256-js": "npm:3.0.0"
- "@aws-sdk/client-sts": "npm:3.504.0"
+ "@aws-sdk/client-sts": "npm:3.507.0"
"@aws-sdk/core": "npm:3.496.0"
- "@aws-sdk/credential-provider-node": "npm:3.504.0"
+ "@aws-sdk/credential-provider-node": "npm:3.507.0"
"@aws-sdk/middleware-host-header": "npm:3.502.0"
"@aws-sdk/middleware-logger": "npm:3.502.0"
"@aws-sdk/middleware-recursion-detection": "npm:3.502.0"
@@ -165,17 +165,17 @@ __metadata:
"@smithy/util-utf8": "npm:^2.1.1"
tslib: "npm:^2.5.0"
uuid: "npm:^8.3.2"
- checksum: 725d934f740b0c81e8fa5fe0de82d1e42a998ba2f73882d079576d114f7669835d8dd59cd6b3b6f6db647f869090631f22bdf2f54ae3dd5434645bf3026834fa
+ checksum: dcfb1c56fedd6515f12a5c50330abd2a711f597e50368bd61a4948600043b28108ade0b36bc15243a80adc0676abb0f67e4c9cb700061bca183fd5e067fbb8d3
languageName: node
linkType: hard
-"@aws-sdk/client-sso-oidc@npm:3.504.0":
- version: 3.504.0
- resolution: "@aws-sdk/client-sso-oidc@npm:3.504.0"
+"@aws-sdk/client-sso-oidc@npm:3.507.0":
+ version: 3.507.0
+ resolution: "@aws-sdk/client-sso-oidc@npm:3.507.0"
dependencies:
"@aws-crypto/sha256-browser": "npm:3.0.0"
"@aws-crypto/sha256-js": "npm:3.0.0"
- "@aws-sdk/client-sts": "npm:3.504.0"
+ "@aws-sdk/client-sts": "npm:3.507.0"
"@aws-sdk/core": "npm:3.496.0"
"@aws-sdk/middleware-host-header": "npm:3.502.0"
"@aws-sdk/middleware-logger": "npm:3.502.0"
@@ -213,14 +213,14 @@ __metadata:
"@smithy/util-utf8": "npm:^2.1.1"
tslib: "npm:^2.5.0"
peerDependencies:
- "@aws-sdk/credential-provider-node": ^3.504.0
- checksum: d8b09bd18cf78d888df1b7529eb60e87ea5f28f96153b0ba6b45a2882fd866bab427f655668f23bfdf79fbba81a02df7a344d82b07bb45b97e4ba5cb1cb3e860
+ "@aws-sdk/credential-provider-node": ^3.507.0
+ checksum: b38055c1233f5d30bf07091a7d8983be07d13734e666760fdbe8a3b31340786ed14f5407cfbfeb9ae3a41233857368f1d439d7a8f92247523e99d9acb5a2a84f
languageName: node
linkType: hard
-"@aws-sdk/client-sso@npm:3.502.0":
- version: 3.502.0
- resolution: "@aws-sdk/client-sso@npm:3.502.0"
+"@aws-sdk/client-sso@npm:3.507.0":
+ version: 3.507.0
+ resolution: "@aws-sdk/client-sso@npm:3.507.0"
dependencies:
"@aws-crypto/sha256-browser": "npm:3.0.0"
"@aws-crypto/sha256-js": "npm:3.0.0"
@@ -259,13 +259,13 @@ __metadata:
"@smithy/util-retry": "npm:^2.1.1"
"@smithy/util-utf8": "npm:^2.1.1"
tslib: "npm:^2.5.0"
- checksum: 5cd4e48c344295d130fcebb2ddfa2e3fbdc5ce9740b7729777f11e783f44f80d2932bea4ba3959a78ec057fc76018046dc0bb391a3fdecd2d696e2fcb7c0844d
+ checksum: 9953c6617798a3964238d8ce9297ecd54030e1a61fd1e05a27bb2890e5e8d04ffd8de8ab4d6512253c09659ca5298299a5a093cf8137e5a989d2f178e4cade5a
languageName: node
linkType: hard
-"@aws-sdk/client-sts@npm:3.504.0":
- version: 3.504.0
- resolution: "@aws-sdk/client-sts@npm:3.504.0"
+"@aws-sdk/client-sts@npm:3.507.0":
+ version: 3.507.0
+ resolution: "@aws-sdk/client-sts@npm:3.507.0"
dependencies:
"@aws-crypto/sha256-browser": "npm:3.0.0"
"@aws-crypto/sha256-js": "npm:3.0.0"
@@ -307,8 +307,8 @@ __metadata:
fast-xml-parser: "npm:4.2.5"
tslib: "npm:^2.5.0"
peerDependencies:
- "@aws-sdk/credential-provider-node": ^3.504.0
- checksum: 2c04185c8f8fe4dac3b20947c35f6383b18de89ab8b2c7effe59b4c11a460152c151a39aa8afbdef29c6abde0f12e5879ce6112436849088919a084f1b0055f3
+ "@aws-sdk/credential-provider-node": ^3.507.0
+ checksum: c52931a3f846c5dfe1797c2cec47b09bafe52b9dd055643a3ecdcb34c8cd974afae1238e4b4aca9620b8153eb020641b9af13919c78e4983983036e13246e788
languageName: node
linkType: hard
@@ -355,42 +355,42 @@ __metadata:
languageName: node
linkType: hard
-"@aws-sdk/credential-provider-ini@npm:3.504.0":
- version: 3.504.0
- resolution: "@aws-sdk/credential-provider-ini@npm:3.504.0"
+"@aws-sdk/credential-provider-ini@npm:3.507.0":
+ version: 3.507.0
+ resolution: "@aws-sdk/credential-provider-ini@npm:3.507.0"
dependencies:
- "@aws-sdk/client-sts": "npm:3.504.0"
+ "@aws-sdk/client-sts": "npm:3.507.0"
"@aws-sdk/credential-provider-env": "npm:3.502.0"
"@aws-sdk/credential-provider-process": "npm:3.502.0"
- "@aws-sdk/credential-provider-sso": "npm:3.504.0"
- "@aws-sdk/credential-provider-web-identity": "npm:3.504.0"
+ "@aws-sdk/credential-provider-sso": "npm:3.507.0"
+ "@aws-sdk/credential-provider-web-identity": "npm:3.507.0"
"@aws-sdk/types": "npm:3.502.0"
"@smithy/credential-provider-imds": "npm:^2.2.1"
"@smithy/property-provider": "npm:^2.1.1"
"@smithy/shared-ini-file-loader": "npm:^2.3.1"
"@smithy/types": "npm:^2.9.1"
tslib: "npm:^2.5.0"
- checksum: 33ecc5fdfddb2b26d99a78af7970718dee5d7b2a0c4e40c28ef1af92a8ecca9a7f09771f19651265c15689965248c7bac1fc981b3aa2358d905f42a2ed267cf9
+ checksum: 554c0f2706b54787668491ca0b0e171b6270d8f359971d19e9823dbda322b59c45faaace7d5eca9716293d6abecd0dbc14361b6ad202f67e699cc58682d246e7
languageName: node
linkType: hard
-"@aws-sdk/credential-provider-node@npm:3.504.0":
- version: 3.504.0
- resolution: "@aws-sdk/credential-provider-node@npm:3.504.0"
+"@aws-sdk/credential-provider-node@npm:3.507.0":
+ version: 3.507.0
+ resolution: "@aws-sdk/credential-provider-node@npm:3.507.0"
dependencies:
"@aws-sdk/credential-provider-env": "npm:3.502.0"
"@aws-sdk/credential-provider-http": "npm:3.503.1"
- "@aws-sdk/credential-provider-ini": "npm:3.504.0"
+ "@aws-sdk/credential-provider-ini": "npm:3.507.0"
"@aws-sdk/credential-provider-process": "npm:3.502.0"
- "@aws-sdk/credential-provider-sso": "npm:3.504.0"
- "@aws-sdk/credential-provider-web-identity": "npm:3.504.0"
+ "@aws-sdk/credential-provider-sso": "npm:3.507.0"
+ "@aws-sdk/credential-provider-web-identity": "npm:3.507.0"
"@aws-sdk/types": "npm:3.502.0"
"@smithy/credential-provider-imds": "npm:^2.2.1"
"@smithy/property-provider": "npm:^2.1.1"
"@smithy/shared-ini-file-loader": "npm:^2.3.1"
"@smithy/types": "npm:^2.9.1"
tslib: "npm:^2.5.0"
- checksum: f833b3033f05b9c8298baa619dd7e81c4703d66639465ef39c2ebfadedde08b8517ec43b24f054800e575bb5bf35172267518d4816642f3a8863ad0a575bd827
+ checksum: d45e0f44342230aab0db837f33fb365e43eac44b83e79a7e33c5da0073e96b6fa5d9640cfd1346b753dc9f41bc9e8d711e22b0b25658247fc2c0843fdd96925c
languageName: node
linkType: hard
@@ -407,31 +407,31 @@ __metadata:
languageName: node
linkType: hard
-"@aws-sdk/credential-provider-sso@npm:3.504.0":
- version: 3.504.0
- resolution: "@aws-sdk/credential-provider-sso@npm:3.504.0"
+"@aws-sdk/credential-provider-sso@npm:3.507.0":
+ version: 3.507.0
+ resolution: "@aws-sdk/credential-provider-sso@npm:3.507.0"
dependencies:
- "@aws-sdk/client-sso": "npm:3.502.0"
- "@aws-sdk/token-providers": "npm:3.504.0"
+ "@aws-sdk/client-sso": "npm:3.507.0"
+ "@aws-sdk/token-providers": "npm:3.507.0"
"@aws-sdk/types": "npm:3.502.0"
"@smithy/property-provider": "npm:^2.1.1"
"@smithy/shared-ini-file-loader": "npm:^2.3.1"
"@smithy/types": "npm:^2.9.1"
tslib: "npm:^2.5.0"
- checksum: d84a0eddb6e4614d6fffe8ef0b360415b5fccfb1a0d22d2fb668dc72d575d0c289c5a2af50366402f1c428affa16d1ae37f498b5fe6067a4ba9fc8e373da9aa7
+ checksum: 9467f381254e55c23713b67d3897e7102da89ccaf138efc5ac728fea08477d82a6c114fcb13d08d3ca2d09c5a3a0a3ba5b088490d97ccf1a202dc22474077d5c
languageName: node
linkType: hard
-"@aws-sdk/credential-provider-web-identity@npm:3.504.0":
- version: 3.504.0
- resolution: "@aws-sdk/credential-provider-web-identity@npm:3.504.0"
+"@aws-sdk/credential-provider-web-identity@npm:3.507.0":
+ version: 3.507.0
+ resolution: "@aws-sdk/credential-provider-web-identity@npm:3.507.0"
dependencies:
- "@aws-sdk/client-sts": "npm:3.504.0"
+ "@aws-sdk/client-sts": "npm:3.507.0"
"@aws-sdk/types": "npm:3.502.0"
"@smithy/property-provider": "npm:^2.1.1"
"@smithy/types": "npm:^2.9.1"
tslib: "npm:^2.5.0"
- checksum: 5542b66e9e7a6c30a1db7c5cd896cafa127f2701be92ab1303b3022fe4609d91940801ab7b73925511a5d40ab43d80d9ae31ec8d870b56a33e0b288e1c32a7df
+ checksum: c61f7eec0e9b1122ee31b84f4d498790d5de806cc168289ebc267b6a3c8a2c02f8d868bc791d8a60928e0c38396a4bc9722bb12ad0bc752840cfd8bc94e781ad
languageName: node
linkType: hard
@@ -512,17 +512,17 @@ __metadata:
languageName: node
linkType: hard
-"@aws-sdk/token-providers@npm:3.504.0":
- version: 3.504.0
- resolution: "@aws-sdk/token-providers@npm:3.504.0"
+"@aws-sdk/token-providers@npm:3.507.0":
+ version: 3.507.0
+ resolution: "@aws-sdk/token-providers@npm:3.507.0"
dependencies:
- "@aws-sdk/client-sso-oidc": "npm:3.504.0"
+ "@aws-sdk/client-sso-oidc": "npm:3.507.0"
"@aws-sdk/types": "npm:3.502.0"
"@smithy/property-provider": "npm:^2.1.1"
"@smithy/shared-ini-file-loader": "npm:^2.3.1"
"@smithy/types": "npm:^2.9.1"
tslib: "npm:^2.5.0"
- checksum: 793a62ff89f26b5f72161aea7aea1d5e1b7f0b6278ececf2753b9e9c60ac5ae7a220f5ea0d749b6d45a16c37e4f1d6dde99aecb283d4396e6dcf6f453a9f58d1
+ checksum: 3f02fbfe206a03c66600e7acdf6fc90a92e591c6bfa74579995356ad03ca828425493962c88b72b030232f4219243e10b94e563d289b15ae993d3e9f5056a31c
languageName: node
linkType: hard
@@ -2982,6 +2982,7 @@ __metadata:
resolution: "@docspace/client@workspace:packages/client"
dependencies:
"@babel/core": "npm:^7.21.3"
+ "@babel/eslint-parser": "npm:^7.21.8"
"@babel/plugin-proposal-class-properties": "npm:^7.18.6"
"@babel/plugin-proposal-export-default-from": "npm:^7.18.10"
"@babel/plugin-transform-runtime": "npm:^7.21.0"
@@ -2989,12 +2990,25 @@ __metadata:
"@babel/preset-react": "npm:^7.18.6"
"@babel/preset-typescript": "npm:^7.21.0"
"@svgr/webpack": "npm:^5.5.0"
+ "@types/eslint": "npm:^8.44.7"
+ "@typescript-eslint/eslint-plugin": "npm:^6.12.0"
+ "@typescript-eslint/parser": "npm:^6.12.0"
babel-loader: "npm:^8.3.0"
clean-webpack-plugin: "npm:^4.0.0"
copy-to-clipboard: "npm:^3.3.3"
copy-webpack-plugin: "npm:^9.1.0"
css-loader: "npm:^6.7.3"
element-resize-detector: "npm:^1.2.4"
+ eslint: "npm:^8.54.0"
+ eslint-config-airbnb: "npm:^19.0.4"
+ eslint-config-airbnb-typescript: "npm:^17.1.0"
+ eslint-config-prettier: "npm:^9.0.0"
+ eslint-plugin-import: "npm:^2.29.0"
+ eslint-plugin-jsx-a11y: "npm:^6.8.0"
+ eslint-plugin-prettier: "npm:^5.0.1"
+ eslint-plugin-react: "npm:^7.33.2"
+ eslint-plugin-react-hooks: "npm:^4.6.0"
+ eslint-plugin-storybook: "npm:^0.6.15"
external-remotes-plugin: "npm:^1.0.0"
file-loader: "npm:^6.2.0"
file-saver: "npm:^2.0.5"
@@ -3004,6 +3018,7 @@ __metadata:
html-webpack-plugin: "npm:5.5.0"
json-loader: "npm:^0.5.7"
playwright: "npm:^1.32.0"
+ prettier: "npm:^3.1.0"
queue-promise: "npm:2.2.1"
react-avatar-editor: "npm:^13.0.0"
react-colorful: "npm:^5.6.1"
@@ -4274,12 +4289,12 @@ __metadata:
linkType: hard
"@grpc/grpc-js@npm:^1.3.2":
- version: 1.9.14
- resolution: "@grpc/grpc-js@npm:1.9.14"
+ version: 1.10.0
+ resolution: "@grpc/grpc-js@npm:1.10.0"
dependencies:
"@grpc/proto-loader": "npm:^0.7.8"
"@types/node": "npm:>=12.12.47"
- checksum: 417f8ce1b0a529b05f18f1432ccbe257ad4b305ad04b548dcc502adcffde48dfaa4f392e71cb782bfebc1fa23c1f32baed83da368d8c05296da0a243020a60d2
+ checksum: 9810df33d2378e9d00d4e6e2e7cef48a093bfffce87f51303aad0eb6b3cea60881fcfe4e5fb2de6a078ad637bacb527820d4510397ee2eb2222ebe72377b9c6c
languageName: node
linkType: hard
@@ -4904,15 +4919,15 @@ __metadata:
linkType: hard
"@npmcli/agent@npm:^2.0.0":
- version: 2.2.0
- resolution: "@npmcli/agent@npm:2.2.0"
+ version: 2.2.1
+ resolution: "@npmcli/agent@npm:2.2.1"
dependencies:
agent-base: "npm:^7.1.0"
http-proxy-agent: "npm:^7.0.0"
https-proxy-agent: "npm:^7.0.1"
lru-cache: "npm:^10.0.1"
socks-proxy-agent: "npm:^8.0.1"
- checksum: 822ea077553cd9cfc5cbd6d92380b0950fcb054a7027cd1b63a33bd0cbb16b0c6626ea75d95ec0e804643c8904472d3361d2da8c2444b1fb02a9b525d9c07c41
+ checksum: d4a48128f61e47f2f5c89315a5350e265dc619987e635bd62b52b29c7ed93536e724e721418c0ce352ceece86c13043c67aba1b70c3f5cc72fce6bb746706162
languageName: node
linkType: hard
@@ -6260,8 +6275,8 @@ __metadata:
linkType: hard
"@smithy/util-defaults-mode-node@npm:^2.1.1":
- version: 2.1.1
- resolution: "@smithy/util-defaults-mode-node@npm:2.1.1"
+ version: 2.2.0
+ resolution: "@smithy/util-defaults-mode-node@npm:2.2.0"
dependencies:
"@smithy/config-resolver": "npm:^2.1.1"
"@smithy/credential-provider-imds": "npm:^2.2.1"
@@ -6270,7 +6285,7 @@ __metadata:
"@smithy/smithy-client": "npm:^2.3.1"
"@smithy/types": "npm:^2.9.1"
tslib: "npm:^2.5.0"
- checksum: f51ca2872b338eadcf685ca818372abe2ccd6d1d0599b302c46fc9700ef667b34290da1dc67f3f32442dcc7234b2f3729e91de20f3a5741a5af7aacac87d3d22
+ checksum: 3ef04b6b54fcc8ac9d235ca90a3a35602dfda04ce6c978e8ad5b0a6ee378281e2da21d27af2d11720a6136e616abddea35c1ec0644d0868127cace4e614d798a
languageName: node
linkType: hard
@@ -8762,13 +8777,13 @@ __metadata:
linkType: hard
"@types/react@npm:*, @types/react@npm:>=16, @types/react@npm:^18.0.15, @types/react@npm:^18.0.28, @types/react@npm:^18.2.53":
- version: 18.2.53
- resolution: "@types/react@npm:18.2.53"
+ version: 18.2.55
+ resolution: "@types/react@npm:18.2.55"
dependencies:
"@types/prop-types": "npm:*"
"@types/scheduler": "npm:*"
csstype: "npm:^3.0.2"
- checksum: 9a518aef07c6bb743aa18a2aea7f618d4e7c9e44e14d25119d2e255c48e68ecd901ede8b4eaf22ffe4f52c1ff85e11634ec75e73dcfc0719cc52269629f13d69
+ checksum: bf8fe19e73575489e63c0726355f164157cd69e75f2a862436ad2c0586e732cb953a7255a6bc73145e8f9506ee7a723f9a569ca9a39c53984e5b12b84e1c718a
languageName: node
linkType: hard
@@ -8957,14 +8972,14 @@ __metadata:
linkType: hard
"@typescript-eslint/eslint-plugin@npm:^6.12.0":
- version: 6.20.0
- resolution: "@typescript-eslint/eslint-plugin@npm:6.20.0"
+ version: 6.21.0
+ resolution: "@typescript-eslint/eslint-plugin@npm:6.21.0"
dependencies:
"@eslint-community/regexpp": "npm:^4.5.1"
- "@typescript-eslint/scope-manager": "npm:6.20.0"
- "@typescript-eslint/type-utils": "npm:6.20.0"
- "@typescript-eslint/utils": "npm:6.20.0"
- "@typescript-eslint/visitor-keys": "npm:6.20.0"
+ "@typescript-eslint/scope-manager": "npm:6.21.0"
+ "@typescript-eslint/type-utils": "npm:6.21.0"
+ "@typescript-eslint/utils": "npm:6.21.0"
+ "@typescript-eslint/visitor-keys": "npm:6.21.0"
debug: "npm:^4.3.4"
graphemer: "npm:^1.4.0"
ignore: "npm:^5.2.4"
@@ -8977,25 +8992,25 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
- checksum: dee6a2392c831e6ae69611ecc4de06e66a7b16f6bf6d8e3bfd25091eb14d88c9d0bb9c9cd634efcfa318902341f7a459cf48f713d55cb1d610145ca1f52af4d3
+ checksum: a57de0f630789330204cc1531f86cfc68b391cafb1ba67c8992133f1baa2a09d629df66e71260b040de4c9a3ff1252952037093c4128b0d56c4dbb37720b4c1d
languageName: node
linkType: hard
"@typescript-eslint/parser@npm:^6.12.0":
- version: 6.20.0
- resolution: "@typescript-eslint/parser@npm:6.20.0"
+ version: 6.21.0
+ resolution: "@typescript-eslint/parser@npm:6.21.0"
dependencies:
- "@typescript-eslint/scope-manager": "npm:6.20.0"
- "@typescript-eslint/types": "npm:6.20.0"
- "@typescript-eslint/typescript-estree": "npm:6.20.0"
- "@typescript-eslint/visitor-keys": "npm:6.20.0"
+ "@typescript-eslint/scope-manager": "npm:6.21.0"
+ "@typescript-eslint/types": "npm:6.21.0"
+ "@typescript-eslint/typescript-estree": "npm:6.21.0"
+ "@typescript-eslint/visitor-keys": "npm:6.21.0"
debug: "npm:^4.3.4"
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
peerDependenciesMeta:
typescript:
optional: true
- checksum: 691062d47cae7977604ede848ffff3689162428a53577f298989f585954aa3a3450e7fd5c2b363d024cd5f16022c163cecf0f1f1d138234bbd78048050b4b8bf
+ checksum: 4d51cdbc170e72275efc5ef5fce48a81ec431e4edde8374f4d0213d8d370a06823e1a61ae31d502a5f1b0d1f48fc4d29a1b1b5c2dcf809d66d3872ccf6e46ac7
languageName: node
linkType: hard
@@ -9009,22 +9024,22 @@ __metadata:
languageName: node
linkType: hard
-"@typescript-eslint/scope-manager@npm:6.20.0":
- version: 6.20.0
- resolution: "@typescript-eslint/scope-manager@npm:6.20.0"
+"@typescript-eslint/scope-manager@npm:6.21.0":
+ version: 6.21.0
+ resolution: "@typescript-eslint/scope-manager@npm:6.21.0"
dependencies:
- "@typescript-eslint/types": "npm:6.20.0"
- "@typescript-eslint/visitor-keys": "npm:6.20.0"
- checksum: 2c1a644f2931454b34875f2e6dffad52a1fc7b6ac508d7d1ad3cd9da028a7dff9c6191feeea2c9ca691deba199ac9e83cbd0036914be4cd45b6954437f03c09a
+ "@typescript-eslint/types": "npm:6.21.0"
+ "@typescript-eslint/visitor-keys": "npm:6.21.0"
+ checksum: fe91ac52ca8e09356a71dc1a2f2c326480f3cccfec6b2b6d9154c1a90651ab8ea270b07c67df5678956c3bbf0bbe7113ab68f68f21b20912ea528b1214197395
languageName: node
linkType: hard
-"@typescript-eslint/type-utils@npm:6.20.0":
- version: 6.20.0
- resolution: "@typescript-eslint/type-utils@npm:6.20.0"
+"@typescript-eslint/type-utils@npm:6.21.0":
+ version: 6.21.0
+ resolution: "@typescript-eslint/type-utils@npm:6.21.0"
dependencies:
- "@typescript-eslint/typescript-estree": "npm:6.20.0"
- "@typescript-eslint/utils": "npm:6.20.0"
+ "@typescript-eslint/typescript-estree": "npm:6.21.0"
+ "@typescript-eslint/utils": "npm:6.21.0"
debug: "npm:^4.3.4"
ts-api-utils: "npm:^1.0.1"
peerDependencies:
@@ -9032,7 +9047,7 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
- checksum: bc2f2793cfec3463164b5f5ded31b4e169e21c3a1990c1ce4effe70a359c486d92fbbc4cd92758bbf1c30a468ad0839e0fa890bd452c707d0c294cb3a7b14021
+ checksum: d03fb3ee1caa71f3ce053505f1866268d7ed79ffb7fed18623f4a1253f5b8f2ffc92636d6fd08fcbaf5bd265a6de77bf192c53105131e4724643dfc910d705fc
languageName: node
linkType: hard
@@ -9050,10 +9065,10 @@ __metadata:
languageName: node
linkType: hard
-"@typescript-eslint/types@npm:6.20.0":
- version: 6.20.0
- resolution: "@typescript-eslint/types@npm:6.20.0"
- checksum: 74ed1761e27c3c1a29fd260fe51096f42cfb1472b20390d6df6ec41de0420208f379e809de416e81cd7c00fdc3d5550b2391872be56bf4a1b0c595f71db0b1ea
+"@typescript-eslint/types@npm:6.21.0":
+ version: 6.21.0
+ resolution: "@typescript-eslint/types@npm:6.21.0"
+ checksum: e26da86d6f36ca5b6ef6322619f8ec55aabcd7d43c840c977ae13ae2c964c3091fc92eb33730d8be08927c9de38466c5323e78bfb270a9ff1d3611fe821046c5
languageName: node
linkType: hard
@@ -9075,12 +9090,12 @@ __metadata:
languageName: node
linkType: hard
-"@typescript-eslint/typescript-estree@npm:6.20.0":
- version: 6.20.0
- resolution: "@typescript-eslint/typescript-estree@npm:6.20.0"
+"@typescript-eslint/typescript-estree@npm:6.21.0":
+ version: 6.21.0
+ resolution: "@typescript-eslint/typescript-estree@npm:6.21.0"
dependencies:
- "@typescript-eslint/types": "npm:6.20.0"
- "@typescript-eslint/visitor-keys": "npm:6.20.0"
+ "@typescript-eslint/types": "npm:6.21.0"
+ "@typescript-eslint/visitor-keys": "npm:6.21.0"
debug: "npm:^4.3.4"
globby: "npm:^11.1.0"
is-glob: "npm:^4.0.3"
@@ -9090,7 +9105,7 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
- checksum: 55b280c6e71c79cb009ac80189a7f0e1aa9011bc7206c810bbb52d9703a894aa2817dfd44d947edf64d62f3aa0962e01f3423fcb21d2f39964a4840287d9e196
+ checksum: b32fa35fca2a229e0f5f06793e5359ff9269f63e9705e858df95d55ca2cd7fdb5b3e75b284095a992c48c5fc46a1431a1a4b6747ede2dd08929dc1cbacc589b8
languageName: node
linkType: hard
@@ -9112,20 +9127,20 @@ __metadata:
languageName: node
linkType: hard
-"@typescript-eslint/utils@npm:6.20.0":
- version: 6.20.0
- resolution: "@typescript-eslint/utils@npm:6.20.0"
+"@typescript-eslint/utils@npm:6.21.0":
+ version: 6.21.0
+ resolution: "@typescript-eslint/utils@npm:6.21.0"
dependencies:
"@eslint-community/eslint-utils": "npm:^4.4.0"
"@types/json-schema": "npm:^7.0.12"
"@types/semver": "npm:^7.5.0"
- "@typescript-eslint/scope-manager": "npm:6.20.0"
- "@typescript-eslint/types": "npm:6.20.0"
- "@typescript-eslint/typescript-estree": "npm:6.20.0"
+ "@typescript-eslint/scope-manager": "npm:6.21.0"
+ "@typescript-eslint/types": "npm:6.21.0"
+ "@typescript-eslint/typescript-estree": "npm:6.21.0"
semver: "npm:^7.5.4"
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
- checksum: 6d4604be6123e0073dd5e7dd357c95b370c678572d2e982478d0d6937d4d65f0cad0ac207b8b724f3bce239e64ba1ddd6bece11e1592734d8bf691177e6971e6
+ checksum: b404a2c55a425a79d054346ae123087d30c7ecf7ed7abcf680c47bf70c1de4fabadc63434f3f460b2fa63df76bc9e4a0b9fa2383bb8a9fcd62733fb5c4e4f3e3
languageName: node
linkType: hard
@@ -9167,13 +9182,13 @@ __metadata:
languageName: node
linkType: hard
-"@typescript-eslint/visitor-keys@npm:6.20.0":
- version: 6.20.0
- resolution: "@typescript-eslint/visitor-keys@npm:6.20.0"
+"@typescript-eslint/visitor-keys@npm:6.21.0":
+ version: 6.21.0
+ resolution: "@typescript-eslint/visitor-keys@npm:6.21.0"
dependencies:
- "@typescript-eslint/types": "npm:6.20.0"
+ "@typescript-eslint/types": "npm:6.21.0"
eslint-visitor-keys: "npm:^3.4.1"
- checksum: df066c73f3880ad78880c442f307e58f026e6047d9caab9d7c356d13276f4fe466fab3e8d19cdb1e6749e87639cb7c4babcfe118f554fcd2d3929ce9f4983216
+ checksum: 30422cdc1e2ffad203df40351a031254b272f9c6f2b7e02e9bfa39e3fc2c7b1c6130333b0057412968deda17a3a68a578a78929a8139c6acef44d9d841dc72e1
languageName: node
linkType: hard
@@ -9738,7 +9753,7 @@ __metadata:
languageName: node
linkType: hard
-"acorn@npm:^8.0.4, acorn@npm:^8.1.0, acorn@npm:^8.11.2, acorn@npm:^8.4.1, acorn@npm:^8.5.0, acorn@npm:^8.7.1, acorn@npm:^8.8.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0":
+"acorn@npm:^8.0.4, acorn@npm:^8.1.0, acorn@npm:^8.11.3, acorn@npm:^8.4.1, acorn@npm:^8.5.0, acorn@npm:^8.7.1, acorn@npm:^8.8.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0":
version: 8.11.3
resolution: "acorn@npm:8.11.3"
bin:
@@ -10241,15 +10256,15 @@ __metadata:
linkType: hard
"array.prototype.findlastindex@npm:^1.2.3":
- version: 1.2.3
- resolution: "array.prototype.findlastindex@npm:1.2.3"
+ version: 1.2.4
+ resolution: "array.prototype.findlastindex@npm:1.2.4"
dependencies:
- call-bind: "npm:^1.0.2"
- define-properties: "npm:^1.2.0"
- es-abstract: "npm:^1.22.1"
- es-shim-unscopables: "npm:^1.0.0"
- get-intrinsic: "npm:^1.2.1"
- checksum: 063cbab8eeac3aa01f3e980eecb9a8c5d87723032b49f7f814ecc6d75c33c03c17e3f43a458127a62e16303cab412f95d6ad9dc7e0ae6d9dc27a9bb76c24df7a
+ call-bind: "npm:^1.0.5"
+ define-properties: "npm:^1.2.1"
+ es-abstract: "npm:^1.22.3"
+ es-errors: "npm:^1.3.0"
+ es-shim-unscopables: "npm:^1.0.2"
+ checksum: 12d7de8da619065b9d4c40550d11c13f2fbbc863c4270ef01d022f49ef16fbe9022441ee9d60b1e952853c661dd4b3e05c21e4348d4631c6d93ddf802a252296
languageName: node
linkType: hard
@@ -11258,14 +11273,15 @@ __metadata:
languageName: node
linkType: hard
-"call-bind@npm:^1.0.0, call-bind@npm:^1.0.2, call-bind@npm:^1.0.5":
- version: 1.0.5
- resolution: "call-bind@npm:1.0.5"
+"call-bind@npm:^1.0.0, call-bind@npm:^1.0.2, call-bind@npm:^1.0.5, call-bind@npm:^1.0.6":
+ version: 1.0.6
+ resolution: "call-bind@npm:1.0.6"
dependencies:
+ es-errors: "npm:^1.3.0"
function-bind: "npm:^1.1.2"
- get-intrinsic: "npm:^1.2.1"
- set-function-length: "npm:^1.1.1"
- checksum: 246d44db6ef9bbd418828dbd5337f80b46be4398d522eded015f31554cbb2ea33025b0203b75c7ab05a1a255b56ef218880cca1743e4121e306729f9e414da39
+ get-intrinsic: "npm:^1.2.3"
+ set-function-length: "npm:^1.2.0"
+ checksum: d99d92dc414d13a03b8b6f2307fc2f0d16a135b523a14d804a2ba7aaa8aae8223cb40d058703c1e66eed11acaff2dc1bcd6358395fa0eb151d84a42c21dedb19
languageName: node
linkType: hard
@@ -11322,9 +11338,9 @@ __metadata:
linkType: hard
"caniuse-lite@npm:^1.0.30001580":
- version: 1.0.30001584
- resolution: "caniuse-lite@npm:1.0.30001584"
- checksum: 908e4fcafa1e8d52d6c5d79e8c614c4d0cf62af544935f7a78fb5a434157505571ce4c2eacfb549e5d4a6e6e38525350c7a9bf696068ad86eb74e890df1d688f
+ version: 1.0.30001585
+ resolution: "caniuse-lite@npm:1.0.30001585"
+ checksum: 877e234c13f8db9bde20265f8c0702d1a5d3d0f0b0f726f431c951cf92d4c2b73db6e7b2c8bdf964e49e817037f27691564f56c5e2d557b001097bc8d526d2a1
languageName: node
linkType: hard
@@ -11501,7 +11517,7 @@ __metadata:
languageName: node
linkType: hard
-"chokidar@npm:3.5.3, chokidar@npm:>=3.0.0 <4.0.0, chokidar@npm:^3.4.0, chokidar@npm:^3.5.1, chokidar@npm:^3.5.2, chokidar@npm:^3.5.3":
+"chokidar@npm:3.5.3":
version: 3.5.3
resolution: "chokidar@npm:3.5.3"
dependencies:
@@ -11520,6 +11536,25 @@ __metadata:
languageName: node
linkType: hard
+"chokidar@npm:>=3.0.0 <4.0.0, chokidar@npm:^3.4.0, chokidar@npm:^3.5.1, chokidar@npm:^3.5.2, chokidar@npm:^3.5.3":
+ version: 3.6.0
+ resolution: "chokidar@npm:3.6.0"
+ dependencies:
+ anymatch: "npm:~3.1.2"
+ braces: "npm:~3.0.2"
+ fsevents: "npm:~2.3.2"
+ glob-parent: "npm:~5.1.2"
+ is-binary-path: "npm:~2.1.0"
+ is-glob: "npm:~4.0.1"
+ normalize-path: "npm:~3.0.0"
+ readdirp: "npm:~3.6.0"
+ dependenciesMeta:
+ fsevents:
+ optional: true
+ checksum: c327fb07704443f8d15f7b4a7ce93b2f0bc0e6cea07ec28a7570aa22cd51fcf0379df589403976ea956c369f25aa82d84561947e227cd925902e1751371658df
+ languageName: node
+ linkType: hard
+
"chownr@npm:^1.1.1":
version: 1.1.4
resolution: "chownr@npm:1.1.4"
@@ -13033,14 +13068,15 @@ __metadata:
languageName: node
linkType: hard
-"define-data-property@npm:^1.0.1, define-data-property@npm:^1.1.1":
- version: 1.1.1
- resolution: "define-data-property@npm:1.1.1"
+"define-data-property@npm:^1.0.1, define-data-property@npm:^1.1.2":
+ version: 1.1.2
+ resolution: "define-data-property@npm:1.1.2"
dependencies:
- get-intrinsic: "npm:^1.2.1"
+ es-errors: "npm:^1.3.0"
+ get-intrinsic: "npm:^1.2.2"
gopd: "npm:^1.0.1"
- has-property-descriptors: "npm:^1.0.0"
- checksum: 5573c8df96b5857408cad64d9b91b69152e305ce4b06218e5f49b59c6cafdbb90a8bd8a0bb83c7bc67a8d479c04aa697063c9bc28d849b7282f9327586d6bc7b
+ has-property-descriptors: "npm:^1.0.1"
+ checksum: 19336750149644b2eb53d281ba685c3561abf98d2b0d2a173ee065bb388b977350df2a08c2597b3401bf0e89f313fc69d7582f0373931cc74df0777fb5202cd0
languageName: node
linkType: hard
@@ -13778,9 +13814,9 @@ __metadata:
linkType: hard
"electron-to-chromium@npm:^1.4.648":
- version: 1.4.656
- resolution: "electron-to-chromium@npm:1.4.656"
- checksum: 7e7dc661fb7b7d367e302df93900bba270f72f4c8a5ee683e3739a7e29bed5e63d3e1a5eeb21ce13c2baece6e2ee37d8d34e25d5b5967859c334031bf1c347a5
+ version: 1.4.659
+ resolution: "electron-to-chromium@npm:1.4.659"
+ checksum: 784ffe2852e2d87b6afc814d62641b4da74264e7c07362675e074e746bd6183b1fa4f40de26b1a9b75afb23561fb48b70904418c4ac45c5b1120b88f4bf0b3cc
languageName: node
linkType: hard
@@ -13906,9 +13942,9 @@ __metadata:
linkType: hard
"engine.io-parser@npm:~5.2.1":
- version: 5.2.1
- resolution: "engine.io-parser@npm:5.2.1"
- checksum: 31f16fd1d64d6c3997f910606a0a8b143a86da98b06346ba7970e9bdf25cc8485caf69b4939dc5a829b312c7db5dbbdcc1fe3787b105bcc175e61b9d37a7e687
+ version: 5.2.2
+ resolution: "engine.io-parser@npm:5.2.2"
+ checksum: 135b1278547bde501412ac462e93b3b4f6a2fecc30a2b843bb9408b96301e8068bb2496c32d124a3d2544eb0aec8b8eddcb4ef0d0d0b84b7d642b1ffde1b2dcf
languageName: node
linkType: hard
@@ -14098,7 +14134,7 @@ __metadata:
languageName: node
linkType: hard
-"es-errors@npm:^1.0.0, es-errors@npm:^1.1.0, es-errors@npm:^1.2.1":
+"es-errors@npm:^1.0.0, es-errors@npm:^1.1.0, es-errors@npm:^1.2.1, es-errors@npm:^1.3.0":
version: 1.3.0
resolution: "es-errors@npm:1.3.0"
checksum: 96e65d640156f91b707517e8cdc454dd7d47c32833aa3e85d79f24f9eb7ea85f39b63e36216ef0114996581969b59fe609a94e30316b08f5f4df1d44134cf8d5
@@ -14292,9 +14328,9 @@ __metadata:
linkType: hard
"escalade@npm:^3.1.1":
- version: 3.1.1
- resolution: "escalade@npm:3.1.1"
- checksum: afa618e73362576b63f6ca83c975456621095a1ed42ff068174e3f5cea48afc422814dda548c96e6ebb5333e7265140c7292abcc81bbd6ccb1757d50d3a4e182
+ version: 3.1.2
+ resolution: "escalade@npm:3.1.2"
+ checksum: a1e07fea2f15663c30e40b9193d658397846ffe28ce0a3e4da0d8e485fedfeca228ab846aee101a05015829adf39f9934ff45b2a3fca47bed37a29646bd05cd3
languageName: node
linkType: hard
@@ -15835,16 +15871,16 @@ __metadata:
languageName: node
linkType: hard
-"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2, get-intrinsic@npm:^1.2.3":
- version: 1.2.3
- resolution: "get-intrinsic@npm:1.2.3"
+"get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2, get-intrinsic@npm:^1.2.3, get-intrinsic@npm:^1.2.4":
+ version: 1.2.4
+ resolution: "get-intrinsic@npm:1.2.4"
dependencies:
- es-errors: "npm:^1.0.0"
+ es-errors: "npm:^1.3.0"
function-bind: "npm:^1.1.2"
has-proto: "npm:^1.0.1"
has-symbols: "npm:^1.0.3"
hasown: "npm:^2.0.0"
- checksum: 9d61232dcc5ea5a72fcc3c72666d0a095370e844e9140dcdd2c99a1baed247b763e2bb76bf4e4b1b72bc5f503a37f27d7c79e664e3483f73669522147ed95fb7
+ checksum: 85bbf4b234c3940edf8a41f4ecbd4e25ce78e5e6ad4e24ca2f77037d983b9ef943fd72f00f3ee97a49ec622a506b67db49c36246150377efcda1c9eb03e5f06d
languageName: node
linkType: hard
@@ -15898,12 +15934,12 @@ __metadata:
linkType: hard
"get-symbol-description@npm:^1.0.0":
- version: 1.0.0
- resolution: "get-symbol-description@npm:1.0.0"
+ version: 1.0.1
+ resolution: "get-symbol-description@npm:1.0.1"
dependencies:
- call-bind: "npm:^1.0.2"
- get-intrinsic: "npm:^1.1.1"
- checksum: 7e5f298afe0f0872747dce4a949ce490ebc5d6dd6aefbbe5044543711c9b19a4dfaebdbc627aee99e1299d58a435b2fbfa083458c1d58be6dc03a3bada24d359
+ call-bind: "npm:^1.0.5"
+ es-errors: "npm:^1.3.0"
+ checksum: 3feb5130efcade947cbad0304eb2163bab7b80e2c5ce24adcdc242cbdbbbaebbbe0f536807822f333b5d1088288ee19534cb75cd92f18aa76e050ea16e766915
languageName: node
linkType: hard
@@ -17087,13 +17123,13 @@ __metadata:
linkType: hard
"internal-slot@npm:^1.0.4, internal-slot@npm:^1.0.5":
- version: 1.0.6
- resolution: "internal-slot@npm:1.0.6"
+ version: 1.0.7
+ resolution: "internal-slot@npm:1.0.7"
dependencies:
- get-intrinsic: "npm:^1.2.2"
+ es-errors: "npm:^1.3.0"
hasown: "npm:^2.0.0"
side-channel: "npm:^1.0.4"
- checksum: bc2022eb1f277f2fcb2a60e7ced451c7ffc7a769b12e63c7a3fb247af8b5a1bed06428ce724046a8bca39ed6eb5b6832501a42f2e9a5ec4a9a7dc4e634431616
+ checksum: 3e66720508831153ecf37d13def9f6856f9f2960989ec8a0a0476c98f887fca9eff0163127466485cb825c900c2d6fc601aa9117b7783b90ffce23a71ea5d053
languageName: node
linkType: hard
@@ -17728,7 +17764,7 @@ __metadata:
languageName: node
linkType: hard
-"is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.12, is-typed-array@npm:^1.1.3, is-typed-array@npm:^1.1.9":
+"is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.12, is-typed-array@npm:^1.1.13, is-typed-array@npm:^1.1.3, is-typed-array@npm:^1.1.9":
version: 1.1.13
resolution: "is-typed-array@npm:1.1.13"
dependencies:
@@ -19758,11 +19794,11 @@ __metadata:
linkType: hard
"magic-string@npm:^0.30.5":
- version: 0.30.6
- resolution: "magic-string@npm:0.30.6"
+ version: 0.30.7
+ resolution: "magic-string@npm:0.30.7"
dependencies:
"@jridgewell/sourcemap-codec": "npm:^1.4.15"
- checksum: 046fbf11614a271e7214d32ca02a2af8d18b268403db9d50580f421ff2222261f1cd8bb02a938206130e3c43deefa6423ee4622c4f161212298570f22b4059bb
+ checksum: 883eaaf6792a3263e44f4bcdcd35ace272268e4b98ed5a770ad711947958d2f9fc683e474945e306e2bdc152b7e44d369ee312690d87025b9879fc63fbe1409c
languageName: node
linkType: hard
@@ -22058,7 +22094,7 @@ __metadata:
languageName: node
linkType: hard
-"object-inspect@npm:^1.13.1, object-inspect@npm:^1.7.0, object-inspect@npm:^1.9.0":
+"object-inspect@npm:^1.13.1, object-inspect@npm:^1.7.0":
version: 1.13.1
resolution: "object-inspect@npm:1.13.1"
checksum: 92f4989ed83422d56431bc39656d4c780348eb15d397ce352ade6b7fec08f973b53744bd41b94af021901e61acaf78fcc19e65bf464ecc0df958586a672700f0
@@ -23043,13 +23079,13 @@ __metadata:
linkType: hard
"postcss@npm:^8.1.7, postcss@npm:^8.3.11, postcss@npm:^8.4.23, postcss@npm:^8.4.33":
- version: 8.4.33
- resolution: "postcss@npm:8.4.33"
+ version: 8.4.34
+ resolution: "postcss@npm:8.4.34"
dependencies:
nanoid: "npm:^3.3.7"
picocolors: "npm:^1.0.0"
source-map-js: "npm:^1.0.2"
- checksum: e22a4594c255f26117f38419fb494d7ecab0f596cd409f7aadc8a6173abf180ed7ea970cd13fd366ab12b5840be901d2a09b25197700c2ebcb5a8077326bf519
+ checksum: ff4769ff6910f688b0672e0a8f83d1d0a9fee3f61aa33b61b6ade0d5dc2ef53ce1a80d78e2eab03f2d40a15e04bc028682857a4f15d31501d63c80473dee2981
languageName: node
linkType: hard
@@ -25297,13 +25333,13 @@ __metadata:
linkType: hard
"safe-regex-test@npm:^1.0.0":
- version: 1.0.2
- resolution: "safe-regex-test@npm:1.0.2"
+ version: 1.0.3
+ resolution: "safe-regex-test@npm:1.0.3"
dependencies:
- call-bind: "npm:^1.0.5"
- get-intrinsic: "npm:^1.2.2"
+ call-bind: "npm:^1.0.6"
+ es-errors: "npm:^1.3.0"
is-regex: "npm:^1.1.4"
- checksum: 0e6a472caa8f44a502c7842ea19749de42c2eb1b41cb00456061dc3746cf3468e907522f56e97a15f3b41d88f660bd3d4f9bdec064a39895f7babae0f7aafc6a
+ checksum: b04de61114b10274d92e25b6de7ccb5de07f11ea15637ff636de4b5190c0f5cd8823fe586dde718504cf78055437d70fd8804976894df502fcf5a210c970afb3
languageName: node
linkType: hard
@@ -25562,13 +25598,13 @@ __metadata:
linkType: hard
"semver@npm:^7.2.1, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4":
- version: 7.5.4
- resolution: "semver@npm:7.5.4"
+ version: 7.6.0
+ resolution: "semver@npm:7.6.0"
dependencies:
lru-cache: "npm:^6.0.0"
bin:
semver: bin/semver.js
- checksum: 985dec0d372370229a262c737063860fabd4a1c730662c1ea3200a2f649117761a42184c96df62a0e885e76fbd5dace41087d6c1ac0351b13c0df5d6bcb1b5ac
+ checksum: 1b41018df2d8aca5a1db4729985e8e20428c650daea60fcd16e926e9383217d00f574fab92d79612771884a98d2ee2a1973f49d630829a8d54d6570defe62535
languageName: node
linkType: hard
@@ -25736,16 +25772,17 @@ __metadata:
languageName: node
linkType: hard
-"set-function-length@npm:^1.1.1":
- version: 1.2.0
- resolution: "set-function-length@npm:1.2.0"
+"set-function-length@npm:^1.2.0":
+ version: 1.2.1
+ resolution: "set-function-length@npm:1.2.1"
dependencies:
- define-data-property: "npm:^1.1.1"
+ define-data-property: "npm:^1.1.2"
+ es-errors: "npm:^1.3.0"
function-bind: "npm:^1.1.2"
- get-intrinsic: "npm:^1.2.2"
+ get-intrinsic: "npm:^1.2.3"
gopd: "npm:^1.0.1"
has-property-descriptors: "npm:^1.0.1"
- checksum: 6d609cd060c488d7d2178a5d4c3689f8a6afa26fa4c48ff4a0516664ff9b84c1c0898915777f5628092dab55c4fcead205525e2edd15c659423bf86f790fdcae
+ checksum: 9ab1d200149574ab27c1a7acae56d6235e02568fc68655fe8afe63e4e02ccad3c27665f55c32408bd1ff40705939dbb7539abfb9c3a07fda27ecad1ab9e449f5
languageName: node
linkType: hard
@@ -25881,13 +25918,14 @@ __metadata:
linkType: hard
"side-channel@npm:^1.0.4":
- version: 1.0.4
- resolution: "side-channel@npm:1.0.4"
+ version: 1.0.5
+ resolution: "side-channel@npm:1.0.5"
dependencies:
- call-bind: "npm:^1.0.0"
- get-intrinsic: "npm:^1.0.2"
- object-inspect: "npm:^1.9.0"
- checksum: c4998d9fc530b0e75a7fd791ad868fdc42846f072734f9080ff55cc8dc7d3899abcda24fd896aa6648c3ab7021b4bb478073eb4f44dfd55bce9714bc1a7c5d45
+ call-bind: "npm:^1.0.6"
+ es-errors: "npm:^1.3.0"
+ get-intrinsic: "npm:^1.2.4"
+ object-inspect: "npm:^1.13.1"
+ checksum: 27708b70b5d81bf18dc8cc23f38f1b6c9511691a64abc4aaf17956e67d132c855cf8b46f931e2fc5a6262b29371eb60da7755c1b9f4f862eccea8562b469f8f6
languageName: node
linkType: hard
@@ -27459,18 +27497,18 @@ __metadata:
linkType: hard
"trough@npm:^2.0.0":
- version: 2.1.0
- resolution: "trough@npm:2.1.0"
- checksum: 6ca8a545d0080ce40c3d0e1e44cf9aa0484a272a91f3a5a02ac433bf1e3ed16983d39da0a77a96467237f7f983cfbf19abc5ab1994c27cde9417e21a2aec76cc
+ version: 2.2.0
+ resolution: "trough@npm:2.2.0"
+ checksum: 999c1cb3db6ec63e1663f911146a90125065da37f66ba342b031d53edb22a62f56c1f934bbc61a55b2b29dd74207544cfd78875b414665c1ffadcd9a9a009eeb
languageName: node
linkType: hard
"ts-api-utils@npm:^1.0.1":
- version: 1.0.3
- resolution: "ts-api-utils@npm:1.0.3"
+ version: 1.2.1
+ resolution: "ts-api-utils@npm:1.2.1"
peerDependencies:
typescript: ">=4.2.0"
- checksum: 1350a5110eb1e534e9a6178f4081fb8a4fcc439749e19f4ad699baec9090fcb90fe532d5e191d91a062dc6e454a14a8d7eb2ad202f57135a30c4a44a3024f039
+ checksum: 6d7f60fd01e3885bb334607f22b9cb1002e72da81dad2e672fef1b0d1a2f640b0f0ff5310369401488fac90c7a7f5d39c89fd18789af59c672c9b5aef4cade3e
languageName: node
linkType: hard
@@ -27693,13 +27731,13 @@ __metadata:
linkType: hard
"typed-array-buffer@npm:^1.0.0":
- version: 1.0.0
- resolution: "typed-array-buffer@npm:1.0.0"
+ version: 1.0.1
+ resolution: "typed-array-buffer@npm:1.0.1"
dependencies:
- call-bind: "npm:^1.0.2"
- get-intrinsic: "npm:^1.2.1"
- is-typed-array: "npm:^1.1.10"
- checksum: 3e0281c79b2a40cd97fe715db803884301993f4e8c18e8d79d75fd18f796e8cd203310fec8c7fdb5e6c09bedf0af4f6ab8b75eb3d3a85da69328f28a80456bd3
+ call-bind: "npm:^1.0.6"
+ es-errors: "npm:^1.3.0"
+ is-typed-array: "npm:^1.1.13"
+ checksum: 1d65e46b2b9b7ec2a30df39b9ddf32e55ad08d6119aec33975506a3dba56057796bdc3c64dbeb7fdb61bf340a75e279dfd55b48ce8f3b874f01731e1da6833d2
languageName: node
linkType: hard
@@ -27829,9 +27867,9 @@ __metadata:
linkType: hard
"ufo@npm:^1.3.2":
- version: 1.3.2
- resolution: "ufo@npm:1.3.2"
- checksum: 7133290d495e2b3f9416de69982019e81cff40d28cfd3a07accff1122ee52f23d9165e495a140a1b34b183244e88fc4001cb649591385ecbad1d3d0d2264fa6e
+ version: 1.4.0
+ resolution: "ufo@npm:1.4.0"
+ checksum: b7aea8503878dc5ad797d8fc6fe39fec64d9cc7e89fb147ef86ec676e37bb462d99d67c6aad20b15f7d3e6d275d66666b29214422e268f1d98f6eaf707a207a6
languageName: node
linkType: hard
@@ -28142,14 +28180,14 @@ __metadata:
linkType: hard
"unplugin@npm:^1.3.1":
- version: 1.6.0
- resolution: "unplugin@npm:1.6.0"
+ version: 1.7.1
+ resolution: "unplugin@npm:1.7.1"
dependencies:
- acorn: "npm:^8.11.2"
+ acorn: "npm:^8.11.3"
chokidar: "npm:^3.5.3"
webpack-sources: "npm:^3.2.3"
webpack-virtual-modules: "npm:^0.6.1"
- checksum: 07ab8da12b03dbc71335ca925afcdb357a78f2c089e9af032a6a9f6112e1c69644ea8264c8ddf70d60067872f715ba2e03253f036cf1801e30b8b45c53756eb2
+ checksum: cadee8d57d574b4b017c82e696c2ed03b9e90a13f8a3baad14261b6888b989f852ef91e401b6488c03886a4231250e61168f15ef89714d5760d729712c2d4064
languageName: node
linkType: hard