Merge branch 'develop' into feature/js-sdk-presets
Conflicts: packages/shared/selectors/Room/RoomSelector.types.ts packages/shared/selectors/Room/index.tsx
This commit is contained in:
commit
137207b78b
5760
i18next/client.babel
5760
i18next/client.babel
File diff suppressed because it is too large
Load Diff
15
packages/client/.eslintrc.cjs
Normal file
15
packages/client/.eslintrc.cjs
Normal file
@ -0,0 +1,15 @@
|
||||
module.exports = {
|
||||
extends: "../shared/.eslintrc.cjs",
|
||||
parserOptions: {
|
||||
project: "tsconfig.eslint.json",
|
||||
tsconfigRootDir: __dirname,
|
||||
sourceType: "module",
|
||||
},
|
||||
|
||||
ignorePatterns: [
|
||||
"./tsconfig.json",
|
||||
"coverage/**",
|
||||
"storybook-static/**",
|
||||
"*.js",
|
||||
],
|
||||
};
|
3
packages/client/.prettierrc.json
Normal file
3
packages/client/.prettierrc.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "../shared/.prettierrc.json"
|
||||
}
|
2
packages/client/index.d.ts
vendored
2
packages/client/index.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
interface Window {
|
||||
zESettings?: any;
|
||||
zESettings?: unknown;
|
||||
zE?: {
|
||||
apply: Function;
|
||||
};
|
||||
|
@ -59,6 +59,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.21.3",
|
||||
"@babel/eslint-parser": "^7.21.8",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@babel/plugin-proposal-export-default-from": "^7.18.10",
|
||||
"@babel/plugin-transform-runtime": "^7.21.0",
|
||||
@ -66,16 +67,30 @@
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-typescript": "^7.21.0",
|
||||
"@svgr/webpack": "^5.5.0",
|
||||
"@types/eslint": "^8.44.7",
|
||||
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
||||
"@typescript-eslint/parser": "^6.12.0",
|
||||
"babel-loader": "^8.3.0",
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
"copy-webpack-plugin": "^9.1.0",
|
||||
"css-loader": "^6.7.3",
|
||||
"eslint": "^8.54.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-airbnb-typescript": "^17.1.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-storybook": "^0.6.15",
|
||||
"external-remotes-plugin": "^1.0.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-loader": "^4.2.0",
|
||||
"html-webpack-plugin": "5.5.0",
|
||||
"json-loader": "^0.5.7",
|
||||
"playwright": "^1.32.0",
|
||||
"prettier": "^3.1.0",
|
||||
"sass": "^1.59.3",
|
||||
"sass-loader": "^12.6.0",
|
||||
"serve": "14.2.0",
|
||||
|
@ -70,7 +70,6 @@
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
<script src="<%= htmlWebpackPlugin.options.browserDetectorUrl %>"></script>
|
||||
<script async src="<%= htmlWebpackPlugin.options.tiffUrl %>"></script>
|
||||
<script>
|
||||
console.log("It's WEB CLIENT INIT");
|
||||
fetch("<%= htmlWebpackPlugin.options.configUrl %>")
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "حمّل ONLYOFFICE Desktop Editors لنظام ويندوز",
|
||||
"MoveHere": "انقل إلى هنا",
|
||||
"MoveToOperation": "جارٍ النقل",
|
||||
"NewForm": "قوالب جاهزة",
|
||||
"NewForm": "نموذج PDF",
|
||||
"Other": "آخر",
|
||||
"OwnerChange": "تغيير المالك",
|
||||
"Presentations": "العروض التقديمية",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Windows üçün ONLYOFFICE Masaüstü Redaktorları endirin",
|
||||
"MoveHere": "Bura köçürün",
|
||||
"MoveToOperation": "Yer dəyişdirmə",
|
||||
"NewForm": "Forma şablonu",
|
||||
"NewForm": "PDF forma",
|
||||
"Other": "Digər",
|
||||
"OwnerChange": "Sahibi dəyiş",
|
||||
"Presentations": "Təqdimatlar",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Изтеглете ONLYOFFICE настолни редактори за Windows",
|
||||
"MoveHere": "Премести се тук",
|
||||
"MoveToOperation": "Преместване",
|
||||
"NewForm": "Шаблон на формуляр",
|
||||
"NewForm": "PDF формуляр",
|
||||
"Other": "Друг",
|
||||
"OwnerChange": "Смени собственик",
|
||||
"Presentations": "Презентации",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Stáhnout ONLYOFFICE Desktop Editors pro Windows",
|
||||
"MoveHere": "Přesunout zde",
|
||||
"MoveToOperation": "Přesouvám",
|
||||
"NewForm": "Šablona formuláře",
|
||||
"NewForm": "PDF formulář",
|
||||
"Other": "Jiný",
|
||||
"OwnerChange": "Změnit vlastníka",
|
||||
"Presentations": "Prezentace",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Download ONLYOFFICE Desktop Editors für Windows",
|
||||
"MoveHere": "Verschieben",
|
||||
"MoveToOperation": "Wird verschoben",
|
||||
"NewForm": "Formularvorlage",
|
||||
"NewForm": "PDF-Formular",
|
||||
"Other": "Sonstiges",
|
||||
"OwnerChange": "Besitzer ändern",
|
||||
"Presentations": "Präsentationen",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Λήψη ONLYOFFICE Desktop Editors για Windows",
|
||||
"MoveHere": "Μετακίνηση εδώ",
|
||||
"MoveToOperation": "Μετακίνηση",
|
||||
"NewForm": "Πρότυπο φόρμας",
|
||||
"NewForm": "Φόρμα PDF",
|
||||
"Other": "Άλλο",
|
||||
"OwnerChange": "Αλλαγή κατόχου",
|
||||
"Presentations": "Παρουσιάσεις",
|
||||
|
@ -14,9 +14,9 @@
|
||||
"ArchiveEmptyScreenUser": "Rooms that have been archived will appear here.",
|
||||
"Archives": "Archives",
|
||||
"AssignOwner": "Assign Owner",
|
||||
"BackToParentFolderButton": "Back to parent folder",
|
||||
"BadgeAlertDescription": "Several roles are specified in this form. Forms with multiple roles are not available for filling in this type of room",
|
||||
"BadgeMyDraftTitle": "My draft",
|
||||
"BackToParentFolderButton": "Back to parent folder",
|
||||
"ByAuthor": "Author",
|
||||
"ByCreation": "Created",
|
||||
"ByErasure": "Erasure",
|
||||
@ -27,20 +27,20 @@
|
||||
"CollaborationRooms": "Collaboration",
|
||||
"ContainsSpecCharacter": "The title can't contain any of the following characters: *+:\"<>?|/",
|
||||
"Convert": "Convert",
|
||||
"CopySharedLink": "Copy shared link",
|
||||
"CopyItem": "<strong>{{title}}</strong> copied",
|
||||
"CopyItems": "<strong>{{qty}}</strong> elements copied",
|
||||
"CopyLink": "Copy link",
|
||||
"CopyLinkPassword": "Copy link password",
|
||||
"CopyPassword": "Copy password",
|
||||
"CopySharedLink": "Copy shared link",
|
||||
"CreateAndCopy": "Create and copy",
|
||||
"CreateNewLink": "Create new link",
|
||||
"CreateRoom": "Create room",
|
||||
"CustomRooms": "Custom",
|
||||
"DaysRemaining": "Days remaining: {{daysRemaining}}",
|
||||
"DeleteSharedLink": "The previous link will become unavailable. A new shared link will be created.",
|
||||
"DeleteLink": "Delete link",
|
||||
"DeleteLinkNote": "The link will be deleted permanently. You will not be able to undo this action.",
|
||||
"DeleteSharedLink": "The previous link will become unavailable. A new shared link will be created.",
|
||||
"DisableDownload": "Restrict file content copy, file download and printing",
|
||||
"DisableLink": "Disable link",
|
||||
"DisableNotifications": "Disable notifications",
|
||||
@ -48,9 +48,9 @@
|
||||
"DocumentEdited": "Cannot perform the action because the document is being edited.",
|
||||
"DownloadAll": "Download all",
|
||||
"EditAdditionalLink": "Edit additional link",
|
||||
"EditSharedLink": "Edit shared link",
|
||||
"EditLink": "Edit link",
|
||||
"EditRoom": "Edit room",
|
||||
"EditSharedLink": "Edit shared link",
|
||||
"EmbeddingSettings": "Embedding settings",
|
||||
"EmptyFile": "Empty file",
|
||||
"EmptyFilterDescriptionText": "No files or folders match this filter. Try a different one or clear filter to view all files. ",
|
||||
@ -58,12 +58,12 @@
|
||||
"EmptyFolderDecription": "Drop files here or create new ones",
|
||||
"EmptyFolderDescriptionUser": "Files and folders uploaded by admins will appear here.",
|
||||
"EmptyFolderHeader": "No files in this folder",
|
||||
"EmptyFormFolderDoneHeaderText": "No finished forms yet",
|
||||
"EmptyFormFolderDoneDescriptionText": "This section will display all forms that are complete.",
|
||||
"EmptyFormFolderProgressHeaderText": "Nothing here yet",
|
||||
"EmptyFormFolderDoneHeaderText": "No finished forms yet",
|
||||
"EmptyFormFolderProgressDescriptionText": "This section will display the forms in progress.",
|
||||
"EmptyFormSubFolderHeaderText": "No files in this folder yet",
|
||||
"EmptyFormFolderProgressHeaderText": "Nothing here yet",
|
||||
"EmptyFormSubFolderDoneDescriptionText": "Here you will find forms which have been completely filled out by other users.",
|
||||
"EmptyFormSubFolderHeaderText": "No files in this folder yet",
|
||||
"EmptyFormSubFolderProgressDescriptionText": "Here you will find forms in progress, i.e. forms which users have started to fill out but haven't completed. ",
|
||||
"EmptyRecycleBin": "Empty Trash",
|
||||
"EmptyRootRoomHeader": "Welcome to DocSpace",
|
||||
@ -73,8 +73,10 @@
|
||||
"ExcludeSubfolders": "Exclude subfolders",
|
||||
"FavoritesEmptyContainerDescription": "To mark files as favorites or remove them from this list, use the context menu.",
|
||||
"FileContents": "File contents",
|
||||
"FileDownloadingIsRestricted": "File downloading is restricted in this room.",
|
||||
"FileRemoved": "File moved to Trash",
|
||||
"FileRenamed": "The document '{{oldTitle}}' is renamed to '{{newTitle}}'",
|
||||
"FilesWillAppearHere": "Files and folders added to the room will appear here.",
|
||||
"FillingFormRooms": "Filling form",
|
||||
"Filter": "Filter",
|
||||
"FinalizeVersion": "Finalize version",
|
||||
@ -84,7 +86,6 @@
|
||||
"FormRoom": "Form room",
|
||||
"Forms": "Forms",
|
||||
"FormsTemplates": "Forms templates",
|
||||
"SharedLinks": "Shared links",
|
||||
"GeneralLinkDeletedSuccessfully": "New general link created successfully",
|
||||
"GoToMyRooms": "Go to rooms",
|
||||
"GoToPersonal": "Go to My Documents",
|
||||
@ -99,6 +100,7 @@
|
||||
"LinkEditedSuccessfully": "Link successfully edited and copied",
|
||||
"LinkEnabledSuccessfully": "Link enabled successfully",
|
||||
"LinkForPortalUsers": "Link for DocSpace users",
|
||||
"LinkSettings": "Link settings",
|
||||
"LinkSuccessfullyCopied": "Link successfully copied to clipboard",
|
||||
"LinkSuccessfullyCreatedAndCopied": "Link successfully created and copied to clipboard",
|
||||
"LinkValidUntil": "This link will be valid until",
|
||||
@ -139,8 +141,8 @@
|
||||
"PrivateRoomHeader": "Welcome to ONLYOFFICE private room where every symbol you type is encrypted",
|
||||
"PrivateRoomSupport": "Work in Private Room is available via {{organizationName}} desktop app. <3>Instructions</3>",
|
||||
"PublicRoom": "Public room",
|
||||
"RecentlyAccessible": "Recently accessible via link",
|
||||
"RecentEmptyContainerDescription": "Your last viewed or edited docs will be displayed in this section.",
|
||||
"RecentlyAccessible": "Recently accessible via link",
|
||||
"RecentViaLinkEmptyContainerDescription": "Here you will find a list of the recently opened files shared with you via an external link.",
|
||||
"RecycleBinAction": "Empty trash",
|
||||
"RemovedFromFavorites": "Removed from favorites",
|
||||
@ -150,6 +152,7 @@
|
||||
"RevokeLink": "Revoke link",
|
||||
"RoomAvailableViaExternalLink": "Room available via external link",
|
||||
"RoomCreated": "Room created",
|
||||
"RoomEmptyAtTheMoment": "This room is empty at the moment.",
|
||||
"RoomEmptyContainerDescription": "Please create the first room.",
|
||||
"RoomEmptyContainerDescriptionUser": "Rooms shared with you will appear here.",
|
||||
"RoomNotificationsDisabled": "Room notifications disabled",
|
||||
@ -165,6 +168,7 @@
|
||||
"SelectorEmptyScreenHeader": "No files and folders here yet",
|
||||
"SendByEmail": "Send by email",
|
||||
"Share": "Share",
|
||||
"SharedLinks": "Shared links",
|
||||
"ShareFolder": "Share folder",
|
||||
"ShareFolderDescription": "A new room will be created and all the contents of the selected folder will be copied there. Afterwards, you can invite other users to collaborate on the files within a room.",
|
||||
"ShareRoom": "Share room",
|
||||
@ -190,9 +194,5 @@
|
||||
"WantToRestoreTheRoom": "All shared links in this room will become active, and its contents will be available to everyone with the link. Do you want to restore the room?",
|
||||
"WantToRestoreTheRooms": "All shared links in restored rooms will become active, and their contents will be available to everyone with the room links. Do you want to restore the rooms?",
|
||||
"WithSubfolders": "With subfolders",
|
||||
"YouLeftTheRoom": "You have left the room",
|
||||
"LinkSettings": "Link settings",
|
||||
"FileDownloadingIsRestricted": "File downloading is restricted in this room.",
|
||||
"RoomEmptyAtTheMoment": "This room is empty at the moment.",
|
||||
"FilesWillAppearHere": "Files and folders added to the room will appear here."
|
||||
"YouLeftTheRoom": "You have left the room"
|
||||
}
|
||||
|
@ -12,5 +12,6 @@
|
||||
"InviteViaLinkDescriptionRoom": "Create a universal link for self-authorization in the room",
|
||||
"LinkCopySuccess": "Link has been copied",
|
||||
"ResetChange": "Reset change",
|
||||
"SendInvitation": "Send invitation"
|
||||
"SendInvitation": "Send invitation",
|
||||
"UsersAlreadyAdded": "Some users have already been added"
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"AddGroupsForSharingButton": "Add groups",
|
||||
"AddShareMessage": "Add message",
|
||||
"AdditionalLinkRemove": "Additional link remove",
|
||||
"AddShareMessage": "Add message",
|
||||
"AnyoneWithLink": "Anyone with the link",
|
||||
"Comment": "Comment",
|
||||
"CopyExternalLink": "Copy external link",
|
||||
@ -19,16 +19,16 @@
|
||||
"GeneralAccessLinkRemove": "General access link remove",
|
||||
"InternalLink": "Internal link",
|
||||
"LinkAccessDenied": "Access to the link has been denied",
|
||||
"LinkName": "Link name",
|
||||
"LinkExpireAfter": "The link will expire after <1>{{date}}</1>",
|
||||
"LinkExpired": "The link has expired.",
|
||||
"LinkIsValid": "The link is valid for <1>{{date}}</1>",
|
||||
"LinkName": "Link name",
|
||||
"Notify users": "Notify users",
|
||||
"ReadOnly": "Read only",
|
||||
"ShareEmailBody": "You have been granted access to the {{itemName}} document. Click the link below to open the document right now: {{shareLink}}.",
|
||||
"ShareEmailSubject": "You have been granted access to the {{itemName}} document",
|
||||
"ShareDocument": "Share this document",
|
||||
"ShareDocumentDescription": "Provide access to the document and set the permission levels.",
|
||||
"ShareEmailBody": "You have been granted access to the {{itemName}} document. Click the link below to open the document right now: {{shareLink}}.",
|
||||
"ShareEmailSubject": "You have been granted access to the {{itemName}} document",
|
||||
"ShareVia": "Share via",
|
||||
"SharingSettingsTitle": "Sharing settings"
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Download ONLYOFFICE Desktop Editors for Windows",
|
||||
"MoveHere": "Move here",
|
||||
"MoveToOperation": "Moving",
|
||||
"NewForm": "Form template",
|
||||
"NewForm": "PDF Form",
|
||||
"Other": "Other",
|
||||
"OwnerChange": "Change owner",
|
||||
"Presentations": "Presentations",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Descargar los editores de escritorio ONLYOFFICE para Windows",
|
||||
"MoveHere": "Mover aquí",
|
||||
"MoveToOperation": "Moviendo",
|
||||
"NewForm": "Plantilla de formulario",
|
||||
"NewForm": "Formulario PDF",
|
||||
"Other": "Otro",
|
||||
"OwnerChange": "Cambiar propietario",
|
||||
"Presentations": "Presentaciones",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Lataa ONLYOFFICE Desktop Editors Windowsille",
|
||||
"MoveHere": "Siirrä tänne",
|
||||
"MoveToOperation": "Siirretään",
|
||||
"NewForm": "Lomakemalli",
|
||||
"NewForm": "PDF-lomake",
|
||||
"Other": "Muu",
|
||||
"OwnerChange": "Vaihda omistaja",
|
||||
"Presentations": "Esitykset",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Télécharger les applications de bureau ONLYOFFICE pour Windows",
|
||||
"MoveHere": "Déplacer ici",
|
||||
"MoveToOperation": "Déplacement",
|
||||
"NewForm": "Modèle de formulaire",
|
||||
"NewForm": "Formulaire PDF",
|
||||
"Other": "Autre",
|
||||
"OwnerChange": "Changer le propriétaire",
|
||||
"Presentations": "Présentations",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Ներբեռնել ONLYOFFICE Desktop Editors Windows-ի համար",
|
||||
"MoveHere": "Տեղափոխել այստեղ",
|
||||
"MoveToOperation": "Տեղափոխություն",
|
||||
"NewForm": "Ձևանմուշ",
|
||||
"NewForm": "PDF Ձև",
|
||||
"Other": "Այլ",
|
||||
"OwnerChange": "Փոխել տնօրինողին",
|
||||
"Presentations": "Ներկայացումներ",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Scarica ONLYOFFICE Desktop Editors per Windows",
|
||||
"MoveHere": "Sposta qui",
|
||||
"MoveToOperation": "Sta spostando",
|
||||
"NewForm": "Modello di modulo",
|
||||
"NewForm": "Modulo PDF",
|
||||
"Other": "Altro",
|
||||
"OwnerChange": "Cambiare proprietario",
|
||||
"Presentations": "Presentazioni",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Windows用のONLYOFFICEデスクトップエディタをダウンロードする",
|
||||
"MoveHere": "ここに移動",
|
||||
"MoveToOperation": "移動中",
|
||||
"NewForm": "フォーム テンプレート",
|
||||
"NewForm": "PDFフォーム",
|
||||
"Other": "その他",
|
||||
"OwnerChange": "オーナー変更",
|
||||
"Presentations": "プレゼンテーション",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Windows용 ONLYOFFICE Desktop Editors를 다운로드 받으세요",
|
||||
"MoveHere": "여기로 이동",
|
||||
"MoveToOperation": "이동 중",
|
||||
"NewForm": "양식 템플릿",
|
||||
"NewForm": "PDF 양식",
|
||||
"Other": "기타",
|
||||
"OwnerChange": "소유자 변경",
|
||||
"Presentations": "프레젠테이션",
|
||||
|
@ -34,7 +34,7 @@
|
||||
"MobileWin": "ດາວໂຫລດ ONLYOFFICE Desktop Editors ສໍາລັບ Windows",
|
||||
"MoveHere": "ຍ້າຍ ນີ້",
|
||||
"MoveToOperation": "ກຳລັງເຄື່ອນຍ້າຍ",
|
||||
"NewForm": "ແບບຟອມ",
|
||||
"NewForm": "ແບບຟອມ PDF",
|
||||
"Other": "ອື່ນໆ",
|
||||
"OwnerChange": "ປ່ຽນເຈົ້າຂອງ",
|
||||
"Presentations": "ບົດສະເຫນີ",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Lejupielādēt ONLYOFFICE darbvirsmas redaktorus operētājsistēmai Windows",
|
||||
"MoveHere": "Pārvietoties šeit",
|
||||
"MoveToOperation": "Pārvieto",
|
||||
"NewForm": "Veidlapas veidne",
|
||||
"NewForm": "PDF veidlapa",
|
||||
"Other": "Cits",
|
||||
"OwnerChange": "Mainīt īpašnieku",
|
||||
"Presentations": "Prezentācijas",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Download ONLYOFFICE Desktop Editors voor Windows",
|
||||
"MoveHere": "Hierheen verplaatsen",
|
||||
"MoveToOperation": "Verplaatsen",
|
||||
"NewForm": "Formulier sjabloon",
|
||||
"NewForm": "PDF-formulier",
|
||||
"Other": "Overige",
|
||||
"OwnerChange": "Wijzig eigenaar",
|
||||
"Presentations": "Presentaties",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Pobierz ONLYOFFICE Desktop Editors dla Windows",
|
||||
"MoveHere": "Przenieś tutaj",
|
||||
"MoveToOperation": "Przenoszenie",
|
||||
"NewForm": "Szablon formularza",
|
||||
"NewForm": "Formularz PDF",
|
||||
"Other": "Inny",
|
||||
"OwnerChange": "Zmień właściciela",
|
||||
"Presentations": "Prezentacje",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Baixar ONLYOFFICE Desktop Editors para Windows",
|
||||
"MoveHere": "Mover aqui",
|
||||
"MoveToOperation": "Movendo",
|
||||
"NewForm": "Modelo de formulário",
|
||||
"NewForm": "Formulário PDF",
|
||||
"Other": "Outro",
|
||||
"OwnerChange": "Alterar proprietário",
|
||||
"Presentations": "Apresentações ",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Faça o download do ONLYOFFICE Desktop Editors para Windows",
|
||||
"MoveHere": "Mover para aqui",
|
||||
"MoveToOperation": "A mover",
|
||||
"NewForm": "Modelo de Formulário",
|
||||
"NewForm": "Formulário PDF",
|
||||
"Other": "Outros",
|
||||
"OwnerChange": "Alterar dono",
|
||||
"Presentations": "Apresentações ",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Descarcă ONLYOFFICE Desktop Editors pentru Windows",
|
||||
"MoveHere": "Mutare în acest loc",
|
||||
"MoveToOperation": "Mutare",
|
||||
"NewForm": "Șablon formă,",
|
||||
"NewForm": "Formular PDF",
|
||||
"Other": "Altă",
|
||||
"OwnerChange": "Schimbare proprietar",
|
||||
"Presentations": "Prezentări",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Скачать десктопные редакторы ONLYOFFICE для Windows",
|
||||
"MoveHere": "Переместить сюда",
|
||||
"MoveToOperation": "Перемещение",
|
||||
"NewForm": "Шаблон формы",
|
||||
"NewForm": "PDF-форма",
|
||||
"Other": "Другой",
|
||||
"OwnerChange": "Сменить владельца",
|
||||
"Presentations": "Презентации",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Stiahnite si ONLYOFFICE Desktop Editors pre Windows",
|
||||
"MoveHere": "Posunúť sem",
|
||||
"MoveToOperation": "Presúva sa",
|
||||
"NewForm": "Šablóna formulára",
|
||||
"NewForm": "Formulár PDF",
|
||||
"Other": "Iný",
|
||||
"OwnerChange": "Zmeniť vlastníka",
|
||||
"Presentations": "Prezentácie",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Prenesi ONLYOFFICE namizne urejevalnike za Windows",
|
||||
"MoveHere": "Premakni sem",
|
||||
"MoveToOperation": "Premikanje",
|
||||
"NewForm": "Predloga obrazca",
|
||||
"NewForm": "PDF obrazec",
|
||||
"Other": "Drugo",
|
||||
"OwnerChange": "Spremeni lastnika",
|
||||
"Presentations": "Predstavitve",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Windows için ONLYOFFICE Masaüstü Düzenleyicilerini İndirin",
|
||||
"MoveHere": "Buraya taşı",
|
||||
"MoveToOperation": "Taşınıyor",
|
||||
"NewForm": "Form şablonu",
|
||||
"NewForm": "PDF formu",
|
||||
"Other": "Diğer",
|
||||
"OwnerChange": "Sahibi değiştir",
|
||||
"Presentations": "Sunumlar",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Завантажити настільні редактори ONLYOFFICE для Windows",
|
||||
"MoveHere": "Перемістити сюди",
|
||||
"MoveToOperation": "Переміщення",
|
||||
"NewForm": "Шаблон форми",
|
||||
"NewForm": "Форма PDF",
|
||||
"Other": "Інше",
|
||||
"OwnerChange": "Змінити власника",
|
||||
"Presentations": "Презентації",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "Tải xuống Trình chỉnh sửa ONLYOFFICE cho máy tính Windows",
|
||||
"MoveHere": "Chuyển vào đây",
|
||||
"MoveToOperation": "Đang di chuyển",
|
||||
"NewForm": "Mẫu biểu mẫu",
|
||||
"NewForm": "Mẫu PDF",
|
||||
"Other": "Khác",
|
||||
"OwnerChange": "Thay đổi chủ sở hữu",
|
||||
"Presentations": "Bản trình bày",
|
||||
|
@ -35,7 +35,7 @@
|
||||
"MobileWin": "下载适用于Windows的ONLYOFFICE桌面编辑器",
|
||||
"MoveHere": "移到这里",
|
||||
"MoveToOperation": "移动中",
|
||||
"NewForm": "表单模板",
|
||||
"NewForm": "PDF表格",
|
||||
"Other": "其他",
|
||||
"OwnerChange": "变更所有者",
|
||||
"Presentations": "演示文稿",
|
||||
|
@ -80,7 +80,7 @@ const FilesSelector = ({
|
||||
|
||||
onSelectFolder,
|
||||
onSetBaseFolderPath,
|
||||
//onSetNewFolderPath,
|
||||
// onSetNewFolderPath,
|
||||
setIsDataReady,
|
||||
onSelectTreeNode,
|
||||
onSave,
|
||||
@ -168,8 +168,8 @@ const FilesSelector = ({
|
||||
} = useLoadersHelper({ items });
|
||||
|
||||
useEffect(() => {
|
||||
setIsDataReady && setIsDataReady(!showLoader);
|
||||
}, [showLoader]);
|
||||
setIsDataReady?.(!showLoader);
|
||||
}, [showLoader, setIsDataReady]);
|
||||
|
||||
const { isRoot, setIsRoot, getRootData } = useRootHelper({
|
||||
setIsBreadCrumbsLoading,
|
||||
@ -325,7 +325,7 @@ const FilesSelector = ({
|
||||
setItems(null);
|
||||
|
||||
const idx = breadCrumbs.findIndex(
|
||||
(value) => value.id.toString() === item.id.toString()
|
||||
(value) => value.id.toString() === item.id.toString(),
|
||||
);
|
||||
|
||||
const maxLength = breadCrumbs.length - 1;
|
||||
@ -334,7 +334,7 @@ const FilesSelector = ({
|
||||
const newBreadCrumbs = breadCrumbs.map((item, index) => {
|
||||
if (!foundParentId) {
|
||||
currentFolderIndex = disabledItems.findIndex(
|
||||
(id) => id === item?.id
|
||||
(id) => id === item?.id,
|
||||
);
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ const FilesSelector = ({
|
||||
items: any,
|
||||
accessRights: any,
|
||||
fileName: string,
|
||||
isChecked: boolean
|
||||
isChecked: boolean,
|
||||
) => {
|
||||
const isPublic =
|
||||
breadCrumbs.findIndex((f: any) => f.roomType === RoomsType.PublicRoom) >
|
||||
@ -515,7 +515,7 @@ const FilesSelector = ({
|
||||
isMove,
|
||||
isSelect,
|
||||
filterParam,
|
||||
isRestore
|
||||
isRestore,
|
||||
);
|
||||
|
||||
const defaultAcceptButtonLabel = getAcceptButtonLabel(
|
||||
@ -526,7 +526,7 @@ const FilesSelector = ({
|
||||
isMove,
|
||||
isSelect,
|
||||
filterParam,
|
||||
isRestore
|
||||
isRestore,
|
||||
);
|
||||
|
||||
const isDisabled = getIsDisabled(
|
||||
@ -543,7 +543,7 @@ const FilesSelector = ({
|
||||
filterParam,
|
||||
!!selectedFileInfo,
|
||||
includeFolder,
|
||||
isRestore
|
||||
isRestore,
|
||||
);
|
||||
|
||||
const SelectorBody = (
|
||||
@ -657,7 +657,7 @@ export default inject(
|
||||
filesStore,
|
||||
infoPanelStore,
|
||||
}: any,
|
||||
{ isCopy, isRestoreAll, isMove, isRestore, isPanelVisible, id }: any
|
||||
{ isCopy, isRestoreAll, isMove, isRestore, isPanelVisible, id }: any,
|
||||
) => {
|
||||
const { id: selectedId, parentId, rootFolderType } = selectedFolderStore;
|
||||
|
||||
@ -776,5 +776,5 @@ export default inject(
|
||||
|
||||
roomsFolderId,
|
||||
};
|
||||
}
|
||||
},
|
||||
)(observer(FilesSelector));
|
||||
|
@ -123,9 +123,9 @@ const ContactContainer = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ authStore, settingsStore, payments }) => {
|
||||
export default inject(({ authStore, settingsStore, paymentStore }) => {
|
||||
const { isCommunity } = authStore;
|
||||
const { helpUrl, salesEmail } = payments;
|
||||
const { helpUrl, salesEmail } = paymentStore;
|
||||
const { theme } = settingsStore;
|
||||
return { helpUrl, salesEmail, theme, isCommunity };
|
||||
})(observer(ContactContainer));
|
||||
|
@ -43,7 +43,9 @@ const AvatarEditorDialog = (props) => {
|
||||
const { visible, onClose, profile, updateCreatedAvatar, setHasAvatar } =
|
||||
props;
|
||||
const [avatar, setAvatar] = useState({
|
||||
uploadedFile: profile.hasAvatar ? profile.avatarMax : DefaultUserAvatarMax,
|
||||
uploadedFile: profile.hasAvatar
|
||||
? profile.avatarOriginal
|
||||
: DefaultUserAvatarMax,
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
zoom: 1,
|
||||
@ -63,7 +65,6 @@ const AvatarEditorDialog = (props) => {
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
|
||||
const file = await dataUrlToFile(preview);
|
||||
|
||||
const avatarData = new FormData();
|
||||
|
@ -106,8 +106,8 @@ ChangePricingPlanDialog.propTypes = {
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default inject(({ payments, currentQuotaStore }) => {
|
||||
const { managersCount, allowedStorageSizeByQuota } = payments;
|
||||
export default inject(({ paymentStore, currentQuotaStore }) => {
|
||||
const { managersCount, allowedStorageSizeByQuota } = paymentStore;
|
||||
|
||||
const { addedManagersCount, usedTotalStorageSizeCount } = currentQuotaStore;
|
||||
return {
|
||||
|
@ -7,7 +7,7 @@ import { Portal } from "@docspace/shared/components/portal";
|
||||
import { Base } from "@docspace/shared/themes";
|
||||
|
||||
import WrappedComponent from "SRC_DIR/helpers/plugins/WrappedComponent";
|
||||
import { PluginComponents } from "SRC_DIR/helpers/plugins/constants";
|
||||
import { PluginComponents } from "SRC_DIR/helpers/plugins/enums";
|
||||
import { messageActions } from "SRC_DIR/helpers/plugins/utils";
|
||||
|
||||
const StyledFullScreen = styled.div`
|
||||
@ -83,7 +83,7 @@ const PluginDialog = ({
|
||||
updateMainButtonItems,
|
||||
updateProfileMenuItems,
|
||||
updateEventListenerItems,
|
||||
updateFileItems
|
||||
updateFileItems,
|
||||
);
|
||||
};
|
||||
|
||||
@ -111,7 +111,7 @@ const PluginDialog = ({
|
||||
updateMainButtonItems,
|
||||
updateProfileMenuItems,
|
||||
updateEventListenerItems,
|
||||
updateFileItems
|
||||
updateFileItems,
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -198,8 +198,8 @@ SalesDepartmentRequestDialog.propTypes = {
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default inject(({ payments }) => {
|
||||
const { sendPaymentRequest } = payments;
|
||||
export default inject(({ paymentStore }) => {
|
||||
const { sendPaymentRequest } = paymentStore;
|
||||
|
||||
return {
|
||||
sendPaymentRequest,
|
||||
|
@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Button } from "@docspace/shared/components/button";
|
||||
import { ModalDialog } from "@docspace/shared/components/modal-dialog";
|
||||
|
||||
import { PluginComponents } from "SRC_DIR/helpers/plugins/constants";
|
||||
import { PluginComponents } from "SRC_DIR/helpers/plugins/enums";
|
||||
import WrappedComponent from "SRC_DIR/helpers/plugins/WrappedComponent";
|
||||
|
||||
import Header from "./sub-components/Header";
|
||||
|
@ -7,7 +7,7 @@ import { Text } from "@docspace/shared/components/text";
|
||||
import { Link } from "@docspace/shared/components/link";
|
||||
import { getCorrectDate, getCookie } from "@docspace/shared/utils";
|
||||
|
||||
import { PluginStatus } from "SRC_DIR/helpers/plugins/constants";
|
||||
import { PluginStatus } from "SRC_DIR/helpers/plugins/enums";
|
||||
import { Base } from "@docspace/shared/themes";
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
@ -121,7 +121,7 @@ const Info = ({ t, plugin, withDelete, withSeparator }) => {
|
||||
lineHeight={"20px"}
|
||||
noSelect
|
||||
>
|
||||
{plugin.createBy}
|
||||
{plugin.createBy.displayName}
|
||||
</Text>
|
||||
</>
|
||||
)}
|
||||
|
@ -53,7 +53,7 @@ const AddUsersPanel = ({
|
||||
const onBackClick = () => onClose();
|
||||
const getFilterWithOutDisabledUser = useCallback(
|
||||
() => Filter.getFilterWithOutDisabledUser(),
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
const onKeyPress = (e) => {
|
||||
@ -88,6 +88,8 @@ const AddUsersPanel = ({
|
||||
avatar: item.avatar,
|
||||
isOwner: item.isOwner,
|
||||
isAdmin: item.isAdmin,
|
||||
isVisitor: item.isVisitor,
|
||||
isCollaborator: item.isCollaborator,
|
||||
};
|
||||
items.push(newItem);
|
||||
}
|
||||
@ -100,7 +102,7 @@ const AddUsersPanel = ({
|
||||
};
|
||||
|
||||
const selectedAccess = accessOptions.filter(
|
||||
(access) => access.access === accessRight
|
||||
(access) => access.access === accessRight,
|
||||
)[0];
|
||||
|
||||
const [itemsList, setItemsList] = useState(null);
|
||||
@ -110,11 +112,11 @@ const AddUsersPanel = ({
|
||||
const [total, setTotal] = useState(0);
|
||||
const [isLoading, setIsLoading] = useLoadingWithTimeout(
|
||||
LOADER_TIMEOUT,
|
||||
false
|
||||
false,
|
||||
);
|
||||
const [isLoadingSearch, setIsLoadingSearch] = useLoadingWithTimeout(
|
||||
LOADER_TIMEOUT,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@ -321,7 +323,7 @@ export default inject(({ settingsStore }) => {
|
||||
})(
|
||||
observer(
|
||||
withTranslation(["SharingPanel", "PeopleTranslations", "Common"])(
|
||||
withLoader(AddUsersPanel)(<Loaders.DialogAsideLoader isPanel />)
|
||||
)
|
||||
)
|
||||
withLoader(AddUsersPanel)(<Loaders.DialogAsideLoader isPanel />),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -292,6 +292,28 @@ const StyledDropDown = styled(DropDown)`
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.email-list_avatar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.email-list_add-button {
|
||||
display: flex;
|
||||
margin-left: auto;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
|
||||
p {
|
||||
color: #4781d1;
|
||||
}
|
||||
|
||||
svg path {
|
||||
fill: #4781d1;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
|
@ -8,7 +8,7 @@ import { Text } from "@docspace/shared/components/text";
|
||||
import { TextInput } from "@docspace/shared/components/text-input";
|
||||
import { DropDownItem } from "@docspace/shared/components/drop-down-item";
|
||||
import { toastr } from "@docspace/shared/components/toast";
|
||||
import { parseAddresses } from "@docspace/shared/utils";
|
||||
import { parseAddresses, getParts } from "@docspace/shared/utils";
|
||||
import { ComboBox } from "@docspace/shared/components/combobox";
|
||||
|
||||
import Filter from "@docspace/shared/api/people/filter";
|
||||
@ -34,6 +34,9 @@ import {
|
||||
ResetLink,
|
||||
} from "../StyledInvitePanel";
|
||||
|
||||
import AtReactSvgUrl from "PUBLIC_DIR/images/@.react.svg?url";
|
||||
import ArrowIcon from "PUBLIC_DIR/images/arrow.right.react.svg";
|
||||
|
||||
const minSearchValue = 2;
|
||||
|
||||
const InviteInput = ({
|
||||
@ -60,10 +63,10 @@ const InviteInput = ({
|
||||
const [inputValue, setInputValue] = useState("");
|
||||
const [usersList, setUsersList] = useState([]);
|
||||
const [isChangeLangMail, setIsChangeLangMail] = useState(false);
|
||||
const [searchPanelVisible, setSearchPanelVisible] = useState(false);
|
||||
const [isAddEmailPanelBlocked, setIsAddEmailPanelBlocked] = useState(true);
|
||||
|
||||
const [selectedAccess, setSelectedAccess] = useState(defaultAccess);
|
||||
const [dropDownWidth, setDropDownWidth] = useState(0);
|
||||
|
||||
const searchRef = useRef();
|
||||
|
||||
@ -74,6 +77,13 @@ const InviteInput = ({
|
||||
isBeta: isBetaLanguage(language),
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setTimeout(() => {
|
||||
const width = searchRef?.current?.offsetWidth ?? 0;
|
||||
if (width !== dropDownWidth) setDropDownWidth(width);
|
||||
}, 0);
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
!culture.key &&
|
||||
setInviteLanguage({
|
||||
@ -95,6 +105,7 @@ const InviteInput = ({
|
||||
access: selectedAccess,
|
||||
displayName: address.email,
|
||||
errors: address.parseErrors,
|
||||
isEmailInvite: true,
|
||||
};
|
||||
});
|
||||
}
|
||||
@ -105,32 +116,34 @@ const InviteInput = ({
|
||||
access: selectedAccess,
|
||||
displayName: addresses[0].email,
|
||||
errors: addresses[0].parseErrors,
|
||||
isEmailInvite: true,
|
||||
};
|
||||
};
|
||||
|
||||
const searchByQuery = async (value) => {
|
||||
const query = value.trim();
|
||||
|
||||
if (query.length >= minSearchValue) {
|
||||
if (query.length > minSearchValue) {
|
||||
const filter = Filter.getFilterWithOutDisabledUser();
|
||||
filter.search = query;
|
||||
|
||||
const users = await getMembersList(roomId, filter);
|
||||
|
||||
setUsersList(users.items);
|
||||
setIsAddEmailPanelBlocked(false);
|
||||
|
||||
if (users.total) setIsAddEmailPanelBlocked(false);
|
||||
}
|
||||
|
||||
if (!query) {
|
||||
closeInviteInputPanel();
|
||||
setInputValue("");
|
||||
setUsersList([]);
|
||||
setIsAddEmailPanelBlocked(true);
|
||||
}
|
||||
};
|
||||
|
||||
const debouncedSearch = useCallback(
|
||||
debounce((value) => searchByQuery(value), 300),
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
const onChange = (e) => {
|
||||
@ -145,20 +158,22 @@ const InviteInput = ({
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
(!!usersList.length || clearValue.length >= minSearchValue) &&
|
||||
!searchPanelVisible
|
||||
) {
|
||||
openInviteInputPanel();
|
||||
}
|
||||
|
||||
if (roomId !== -1) {
|
||||
debouncedSearch(clearValue);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
setIsAddEmailPanelBlocked(false);
|
||||
const regex =
|
||||
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{0,}))$/g;
|
||||
|
||||
const parts = getParts(value);
|
||||
for (let i = 0; i < parts.length; i += 1) {
|
||||
if (regex.test(parts[i])) {
|
||||
setIsAddEmailPanelBlocked(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
setIsAddEmailPanelBlocked(true);
|
||||
};
|
||||
|
||||
const removeExist = (items) => {
|
||||
@ -167,8 +182,7 @@ const InviteInput = ({
|
||||
return unique;
|
||||
}, []);
|
||||
|
||||
if (items.length > filtered.length)
|
||||
toastr.warning("Some users have already been added");
|
||||
if (items.length > filtered.length) toastr.warning(t("UsersAlreadyAdded"));
|
||||
|
||||
return filtered;
|
||||
};
|
||||
@ -179,22 +193,25 @@ const InviteInput = ({
|
||||
item.access = selectedAccess;
|
||||
|
||||
const addUser = () => {
|
||||
if (item.isOwner || item.isAdmin)
|
||||
item.access = ShareAccessRights.RoomManager;
|
||||
if (shared) {
|
||||
toastr.warning(t("UsersAlreadyAdded"));
|
||||
} else {
|
||||
if (item.isOwner || item.isAdmin)
|
||||
item.access = ShareAccessRights.RoomManager;
|
||||
|
||||
const items = removeExist([item, ...inviteItems]);
|
||||
const items = removeExist([item, ...inviteItems]);
|
||||
setInviteItems(items);
|
||||
}
|
||||
|
||||
setInviteItems(items);
|
||||
closeInviteInputPanel();
|
||||
setInputValue("");
|
||||
setUsersList([]);
|
||||
setIsAddEmailPanelBlocked(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<DropDownItem
|
||||
key={id}
|
||||
onClick={addUser}
|
||||
disabled={shared}
|
||||
height={48}
|
||||
heightTablet={48}
|
||||
className="list-item"
|
||||
@ -220,8 +237,8 @@ const InviteInput = ({
|
||||
const filtered = removeExist(newItems);
|
||||
|
||||
setInviteItems(filtered);
|
||||
closeInviteInputPanel();
|
||||
setInputValue("");
|
||||
setIsAddEmailPanelBlocked(true);
|
||||
setUsersList([]);
|
||||
};
|
||||
|
||||
@ -231,7 +248,6 @@ const InviteInput = ({
|
||||
const filtered = removeExist(items);
|
||||
|
||||
setInviteItems(filtered);
|
||||
closeInviteInputPanel();
|
||||
setInputValue("");
|
||||
setUsersList([]);
|
||||
};
|
||||
@ -241,33 +257,35 @@ const InviteInput = ({
|
||||
const openUsersPanel = () => {
|
||||
setInputValue("");
|
||||
setAddUsersPanelVisible(true);
|
||||
setIsAddEmailPanelBlocked(true);
|
||||
};
|
||||
|
||||
const closeUsersPanel = () => {
|
||||
setAddUsersPanelVisible(false);
|
||||
};
|
||||
|
||||
const openInviteInputPanel = (e) => {
|
||||
setSearchPanelVisible(true);
|
||||
};
|
||||
|
||||
const closeInviteInputPanel = (e) => {
|
||||
if (e?.target?.tagName?.toUpperCase() === "INPUT") return;
|
||||
|
||||
setSearchPanelVisible(false);
|
||||
};
|
||||
|
||||
const foundUsers = usersList.map((user) => getItemContent(user));
|
||||
|
||||
const addEmailPanel = (
|
||||
<DropDownItem
|
||||
className="add-item"
|
||||
className="list-item"
|
||||
style={{ width: "inherit" }}
|
||||
textOverflow
|
||||
onClick={addEmail}
|
||||
height={48}
|
||||
>
|
||||
{t("Common:AddButton")} «{inputValue}»
|
||||
<div className="email-list_avatar">
|
||||
<Avatar size="min" role="user" source={AtReactSvgUrl} />
|
||||
<Text truncate fontSize="14px" fontWeight={600}>
|
||||
{inputValue}
|
||||
</Text>
|
||||
</div>
|
||||
<div className="email-list_add-button">
|
||||
<Text fontSize="13px" fontWeight={600}>
|
||||
{t("Common:AddButton")}
|
||||
</Text>
|
||||
<ArrowIcon />
|
||||
</div>
|
||||
</DropDownItem>
|
||||
);
|
||||
|
||||
@ -278,7 +296,7 @@ const InviteInput = ({
|
||||
};
|
||||
|
||||
const onKeyPress = (e) => {
|
||||
if (e.key === "Enter" && !!!usersList.length && inputValue.length > 2) {
|
||||
if (e.key === "Enter") {
|
||||
addEmail();
|
||||
}
|
||||
};
|
||||
@ -401,28 +419,27 @@ const InviteInput = ({
|
||||
: t("InviteRoomSearchPlaceholder")
|
||||
}
|
||||
value={inputValue}
|
||||
onFocus={openInviteInputPanel}
|
||||
isAutoFocussed={true}
|
||||
onKeyDown={onKeyDown}
|
||||
/>
|
||||
</StyledInviteInput>
|
||||
{inputValue.length >= minSearchValue &&
|
||||
(isAddEmailPanelBlocked ? (
|
||||
<></>
|
||||
) : (
|
||||
<StyledDropDown
|
||||
width={searchRef?.current?.offsetWidth}
|
||||
isDefaultMode={false}
|
||||
open={searchPanelVisible}
|
||||
manualX="16px"
|
||||
showDisabledItems
|
||||
clickOutsideAction={closeInviteInputPanel}
|
||||
eventTypes="click"
|
||||
{...dropDownMaxHeight}
|
||||
>
|
||||
{!!usersList.length ? foundUsers : addEmailPanel}
|
||||
</StyledDropDown>
|
||||
))}
|
||||
{isAddEmailPanelBlocked ? (
|
||||
<></>
|
||||
) : (
|
||||
<StyledDropDown
|
||||
width={dropDownWidth}
|
||||
isDefaultMode={false}
|
||||
open
|
||||
manualX="16px"
|
||||
showDisabledItems
|
||||
eventTypes="click"
|
||||
withBackdrop={false}
|
||||
zIndex={399}
|
||||
{...dropDownMaxHeight}
|
||||
>
|
||||
{!!usersList.length ? foundUsers : addEmailPanel}
|
||||
</StyledDropDown>
|
||||
)}
|
||||
|
||||
<AccessSelector
|
||||
className="add-manually-access"
|
||||
|
@ -3,11 +3,10 @@ import AtReactSvgUrl from "PUBLIC_DIR/images/@.react.svg?url";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { Avatar } from "@docspace/shared/components/avatar";
|
||||
import { Text } from "@docspace/shared/components/text";
|
||||
import { capitalize } from "lodash";
|
||||
|
||||
import { parseAddresses } from "@docspace/shared/utils";
|
||||
import { getAccessOptions } from "../utils";
|
||||
import { getUserRole } from "@docspace/shared/utils/common";
|
||||
import { getUserRole, getUserTypeLabel } from "@docspace/shared/utils/common";
|
||||
|
||||
import {
|
||||
StyledEditInput,
|
||||
@ -33,25 +32,37 @@ const Item = ({
|
||||
inputsRef,
|
||||
setIsOpenItemAccess,
|
||||
isMobileView,
|
||||
standalone,
|
||||
}) => {
|
||||
const { avatar, displayName, email, id, errors, access } = item;
|
||||
|
||||
const name = !!avatar ? (displayName !== "" ? displayName : email) : email;
|
||||
const source = !!avatar ? avatar : AtReactSvgUrl;
|
||||
const role = getUserRole(item);
|
||||
|
||||
const [edit, setEdit] = useState(false);
|
||||
const [inputValue, setInputValue] = useState(name);
|
||||
const [parseErrors, setParseErrors] = useState(errors);
|
||||
|
||||
const accesses = getAccessOptions(t, roomType, true, true, isOwner);
|
||||
const accesses = getAccessOptions(
|
||||
t,
|
||||
roomType,
|
||||
true,
|
||||
true,
|
||||
isOwner,
|
||||
standalone,
|
||||
);
|
||||
|
||||
const filteredAccesses = filterUserRoleOptions(accesses, item, true);
|
||||
|
||||
const defaultAccess = filteredAccesses.find(
|
||||
(option) => option.access === +access
|
||||
(option) => option.access === +access,
|
||||
);
|
||||
|
||||
const role = getUserRole(item);
|
||||
const typeLabel = item?.isEmailInvite
|
||||
? getUserTypeLabel(defaultAccess.type, t)
|
||||
: getUserTypeLabel(role, t);
|
||||
|
||||
const errorsInList = () => {
|
||||
const hasErrors = inviteItems.some((item) => !!item.errors?.length);
|
||||
setHasErrors(hasErrors);
|
||||
@ -133,7 +144,7 @@ const Item = ({
|
||||
color="#A3A9AE"
|
||||
truncate
|
||||
>
|
||||
{`${capitalize(role)} | ${email}`}
|
||||
{item.userName ? `${typeLabel} | ${email}` : `${typeLabel}`}
|
||||
</Text>
|
||||
</StyledInviteUserBody>
|
||||
|
||||
@ -167,6 +178,7 @@ const Item = ({
|
||||
setIsOpenItemAccess={setIsOpenItemAccess}
|
||||
isMobileView={isMobileView}
|
||||
noBorder
|
||||
standalone={standalone}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
@ -22,6 +22,7 @@ const Row = memo(({ data, index, style }) => {
|
||||
inputsRef,
|
||||
setIsOpenItemAccess,
|
||||
isMobileView,
|
||||
standalone,
|
||||
} = data;
|
||||
|
||||
if (inviteItems === undefined) return;
|
||||
@ -42,6 +43,7 @@ const Row = memo(({ data, index, style }) => {
|
||||
inputsRef={inputsRef}
|
||||
setIsOpenItemAccess={setIsOpenItemAccess}
|
||||
isMobileView={isMobileView}
|
||||
standalone={standalone}
|
||||
/>
|
||||
</StyledRow>
|
||||
);
|
||||
@ -60,6 +62,7 @@ const ItemsList = ({
|
||||
inputsRef,
|
||||
invitePanelBodyRef,
|
||||
isMobileView,
|
||||
standalone,
|
||||
}) => {
|
||||
const [bodyHeight, setBodyHeight] = useState(0);
|
||||
const [offsetTop, setOffsetTop] = useState(0);
|
||||
@ -146,6 +149,7 @@ const ItemsList = ({
|
||||
setIsOpenItemAccess,
|
||||
isMobileView,
|
||||
t,
|
||||
standalone,
|
||||
}}
|
||||
outerElementType={!scrollAllPanelContent && CustomScrollbarsVirtualList}
|
||||
>
|
||||
@ -155,14 +159,16 @@ const ItemsList = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ userStore, dialogsStore }) => {
|
||||
export default inject(({ userStore, dialogsStore, settingsStore }) => {
|
||||
const { setInviteItems, inviteItems, changeInviteItem } = dialogsStore;
|
||||
const { isOwner } = userStore.user;
|
||||
const { standalone } = settingsStore;
|
||||
|
||||
return {
|
||||
setInviteItems,
|
||||
inviteItems,
|
||||
changeInviteItem,
|
||||
isOwner,
|
||||
standalone,
|
||||
};
|
||||
})(observer(ItemsList));
|
||||
|
@ -10,7 +10,7 @@ export const getAccessOptions = (
|
||||
withRemove = false,
|
||||
withSeparator = false,
|
||||
isOwner = false,
|
||||
standalone = false
|
||||
standalone = false,
|
||||
) => {
|
||||
let options = [];
|
||||
const accesses = {
|
||||
@ -22,6 +22,7 @@ export const getAccessOptions = (
|
||||
color: "#EDC409",
|
||||
access:
|
||||
roomType === -1 ? EmployeeType.Admin : ShareAccessRights.FullAccess,
|
||||
type: "admin",
|
||||
},
|
||||
roomAdmin: {
|
||||
key: "roomAdmin",
|
||||
@ -31,6 +32,7 @@ export const getAccessOptions = (
|
||||
color: "#EDC409",
|
||||
access:
|
||||
roomType === -1 ? EmployeeType.User : ShareAccessRights.RoomManager,
|
||||
type: "manager",
|
||||
},
|
||||
collaborator: {
|
||||
key: "collaborator",
|
||||
@ -42,42 +44,49 @@ export const getAccessOptions = (
|
||||
roomType === -1
|
||||
? EmployeeType.Collaborator
|
||||
: ShareAccessRights.Collaborator,
|
||||
type: "collaborator",
|
||||
},
|
||||
user: {
|
||||
key: "user",
|
||||
label: t("Common:User"),
|
||||
description: t("Translations:RoleUserDescription"),
|
||||
access: EmployeeType.Guest,
|
||||
type: "user",
|
||||
},
|
||||
editor: {
|
||||
key: "editor",
|
||||
label: t("Translations:RoleEditor"),
|
||||
description: t("Translations:RoleEditorDescription"),
|
||||
access: ShareAccessRights.Editing,
|
||||
type: "user",
|
||||
},
|
||||
formFiller: {
|
||||
key: "formFiller",
|
||||
label: t("Translations:RoleFormFiller"),
|
||||
description: t("Translations:RoleFormFillerDescription"),
|
||||
access: ShareAccessRights.FormFilling,
|
||||
type: "user",
|
||||
},
|
||||
reviewer: {
|
||||
key: "reviewer",
|
||||
label: t("Translations:RoleReviewer"),
|
||||
description: t("Translations:RoleReviewerDescription"),
|
||||
access: ShareAccessRights.Review,
|
||||
type: "user",
|
||||
},
|
||||
commentator: {
|
||||
key: "commentator",
|
||||
label: t("Translations:RoleCommentator"),
|
||||
description: t("Translations:RoleCommentatorDescription"),
|
||||
access: ShareAccessRights.Comment,
|
||||
type: "user",
|
||||
},
|
||||
viewer: {
|
||||
key: "viewer",
|
||||
label: t("Translations:RoleViewer"),
|
||||
description: t("Translations:RoleViewerDescription"),
|
||||
access: ShareAccessRights.ReadOnly,
|
||||
type: "user",
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -361,6 +361,7 @@ class FileRow extends Component {
|
||||
<ErrorFileUpload
|
||||
t={t}
|
||||
item={item}
|
||||
theme={theme}
|
||||
onTextClick={this.onTextClick}
|
||||
showPasswordInput={showPasswordInput}
|
||||
/>
|
||||
|
@ -9,7 +9,13 @@ const StyledLoadErrorIcon = styled(LoadErrorIcon)`
|
||||
outline: none !important;
|
||||
`;
|
||||
|
||||
const ErrorFileUpload = ({ t, item, onTextClick, showPasswordInput }) => {
|
||||
const ErrorFileUpload = ({
|
||||
t,
|
||||
item,
|
||||
theme,
|
||||
onTextClick,
|
||||
showPasswordInput,
|
||||
}) => {
|
||||
const { interfaceDirection } = useTheme();
|
||||
const placeTooltip = interfaceDirection === "rtl" ? "right" : "left";
|
||||
return (
|
||||
@ -29,7 +35,7 @@ const ErrorFileUpload = ({ t, item, onTextClick, showPasswordInput }) => {
|
||||
)}
|
||||
place={placeTooltip}
|
||||
maxWidth="320"
|
||||
color="#f8f7bf"
|
||||
color={theme.tooltip.backgroundColor}
|
||||
/>
|
||||
{item.needPassword && (
|
||||
<Text
|
||||
|
@ -93,7 +93,7 @@ const ConfirmRoute = ({
|
||||
window.location.href = combineUrl(
|
||||
window.DocSpaceConfig?.proxy?.url,
|
||||
path,
|
||||
"/error"
|
||||
"/error",
|
||||
);
|
||||
break;
|
||||
case ValidationResult.Expired:
|
||||
@ -104,7 +104,7 @@ const ConfirmRoute = ({
|
||||
window.location.href = combineUrl(
|
||||
window.DocSpaceConfig?.proxy?.url,
|
||||
path,
|
||||
"/error"
|
||||
"/error",
|
||||
);
|
||||
break;
|
||||
case ValidationResult.TariffLimit:
|
||||
@ -115,7 +115,7 @@ const ConfirmRoute = ({
|
||||
window.location.href = combineUrl(
|
||||
window.DocSpaceConfig?.proxy?.url,
|
||||
path,
|
||||
"/error?messageKey=20"
|
||||
"/error?messageKey=20",
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@ -126,7 +126,7 @@ const ConfirmRoute = ({
|
||||
window.location.href = combineUrl(
|
||||
window.DocSpaceConfig?.proxy?.url,
|
||||
path,
|
||||
"/error"
|
||||
"/error",
|
||||
);
|
||||
break;
|
||||
}
|
||||
@ -145,7 +145,7 @@ const ConfirmRoute = ({
|
||||
window.location.href = combineUrl(
|
||||
window.DocSpaceConfig?.proxy?.url,
|
||||
path,
|
||||
"/error"
|
||||
"/error",
|
||||
);
|
||||
});
|
||||
}, [getData, doAuthenticated, isAuthenticated, storeIsLoaded, logout]);
|
||||
|
@ -13,7 +13,7 @@ import { Button } from "@docspace/shared/components/button";
|
||||
import { ToggleButton } from "@docspace/shared/components/toggle-button";
|
||||
import { ComboBox } from "@docspace/shared/components/combobox";
|
||||
|
||||
import { PluginComponents } from "./constants";
|
||||
import { PluginComponents } from "./enums";
|
||||
|
||||
import { messageActions } from "./utils";
|
||||
|
||||
@ -74,7 +74,7 @@ const ComponentPure = ({
|
||||
component={item}
|
||||
pluginName={pluginName}
|
||||
/>
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
return <Box {...elementProps}>{childrenComponents}</Box>;
|
||||
@ -110,7 +110,7 @@ const ComponentPure = ({
|
||||
updateMainButtonItems,
|
||||
updateProfileMenuItems,
|
||||
updateEventListenerItems,
|
||||
updateFileItems
|
||||
updateFileItems,
|
||||
);
|
||||
};
|
||||
|
||||
@ -139,7 +139,7 @@ const ComponentPure = ({
|
||||
updateMainButtonItems,
|
||||
updateProfileMenuItems,
|
||||
updateEventListenerItems,
|
||||
updateFileItems
|
||||
updateFileItems,
|
||||
);
|
||||
};
|
||||
|
||||
@ -168,11 +168,11 @@ const ComponentPure = ({
|
||||
updateMainButtonItems,
|
||||
updateProfileMenuItems,
|
||||
updateEventListenerItems,
|
||||
updateFileItems
|
||||
updateFileItems,
|
||||
);
|
||||
};
|
||||
|
||||
return <TextArea {...elementProps} onChange={onChangeAction} />;
|
||||
return <Textarea {...elementProps} onChange={onChangeAction} />;
|
||||
}
|
||||
|
||||
case PluginComponents.input: {
|
||||
@ -197,7 +197,7 @@ const ComponentPure = ({
|
||||
updateMainButtonItems,
|
||||
updateProfileMenuItems,
|
||||
updateEventListenerItems,
|
||||
updateFileItems
|
||||
updateFileItems,
|
||||
);
|
||||
};
|
||||
|
||||
@ -247,7 +247,7 @@ const ComponentPure = ({
|
||||
updateEventListenerItems,
|
||||
updateFileItems,
|
||||
|
||||
updatePlugin
|
||||
updatePlugin,
|
||||
);
|
||||
|
||||
setIsRequestRunning && setIsRequestRunning(false);
|
||||
@ -306,7 +306,7 @@ const ComponentPure = ({
|
||||
updateMainButtonItems,
|
||||
updateProfileMenuItems,
|
||||
updateEventListenerItems,
|
||||
updateFileItems
|
||||
updateFileItems,
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -5,7 +5,7 @@ import PluginHeader from "./PluginHeader";
|
||||
import PluginInfo from "./PluginInfo";
|
||||
import PluginSettings from "./PluginSettings";
|
||||
|
||||
import { PluginScopes } from "../constants";
|
||||
import { PluginScopes } from "../enums";
|
||||
|
||||
const StyledPlugin = styled.div`
|
||||
display: flex;
|
||||
@ -79,7 +79,7 @@ const Plugin = ({
|
||||
author={author}
|
||||
status={status}
|
||||
description={description}
|
||||
createBy={createBy}
|
||||
createBy={createBy.displayName}
|
||||
createOn={createOn}
|
||||
homePage={homePage}
|
||||
url={url}
|
||||
|
@ -4,7 +4,7 @@ import styled from "styled-components";
|
||||
import { Text } from "@docspace/shared/components/text";
|
||||
import { getCorrectDate } from "@docspace/shared/utils";
|
||||
|
||||
import { PluginStatus } from "SRC_DIR/helpers/plugins/constants";
|
||||
import { PluginStatus } from "SRC_DIR/helpers/plugins/enums";
|
||||
import { Link } from "@docspace/shared/components/link";
|
||||
|
||||
import { getPluginUrl } from "../utils";
|
||||
|
@ -3,7 +3,7 @@ import styled from "styled-components";
|
||||
|
||||
import WrappedComponent from "../WrappedComponent";
|
||||
|
||||
import { PluginComponents } from "../constants";
|
||||
import { PluginComponents } from "../enums";
|
||||
|
||||
const StyledPluginSettings = styled.div`
|
||||
.settings-header {
|
||||
|
@ -1,87 +0,0 @@
|
||||
export const PluginFileType = Object.freeze({
|
||||
Files: "file",
|
||||
Folders: "folder",
|
||||
Rooms: "room",
|
||||
Image: "image",
|
||||
Video: "video",
|
||||
});
|
||||
|
||||
export const PluginScopes = Object.freeze({
|
||||
API: "API",
|
||||
Settings: "Settings",
|
||||
ContextMenu: "ContextMenu",
|
||||
InfoPanel: "InfoPanel",
|
||||
MainButton: "MainButton",
|
||||
ProfileMenu: "ProfileMenu",
|
||||
EventListener: "EventListener",
|
||||
File: "File",
|
||||
});
|
||||
|
||||
export const PluginStatus = Object.freeze({
|
||||
active: "active",
|
||||
hide: "hide",
|
||||
});
|
||||
|
||||
export const PluginActions = Object.freeze({
|
||||
updateProps: "update-props",
|
||||
updateContext: "update-context",
|
||||
|
||||
updateStatus: "update-status",
|
||||
|
||||
showToast: "show-toast",
|
||||
|
||||
// showSettingsModal: "show-settings-modal",
|
||||
// closeSettingsModal: "close-settings-modal",
|
||||
|
||||
showCreateDialogModal: "show-create-dialog-modal",
|
||||
|
||||
showModal: "show-modal",
|
||||
closeModal: "close-modal",
|
||||
|
||||
updateContextMenuItems: "update-context-menu-items",
|
||||
updateInfoPanelItems: "update-info-panel-items",
|
||||
updateMainButtonItems: "update-main-button-items",
|
||||
updateProfileMenuItems: "update-profile-menu-items",
|
||||
updateFileItems: "update-file-items",
|
||||
updateEventListenerItems: "update-event-listener-items",
|
||||
|
||||
sendPostMessage: "send-post-message",
|
||||
|
||||
saveSettings: "save-settings",
|
||||
});
|
||||
|
||||
export const PluginToastType = Object.freeze({
|
||||
success: "success",
|
||||
error: "error",
|
||||
warning: "warning",
|
||||
info: "info",
|
||||
});
|
||||
|
||||
export const PluginComponents = Object.freeze({
|
||||
box: "box",
|
||||
button: "button",
|
||||
checkbox: "checkbox",
|
||||
input: "input",
|
||||
label: "label",
|
||||
text: "text",
|
||||
textArea: "textArea",
|
||||
toggleButton: "toggleButton",
|
||||
img: "img",
|
||||
iFrame: "iFrame",
|
||||
comboBox: "comboBox",
|
||||
skeleton: "skeleton",
|
||||
});
|
||||
|
||||
export const PluginUsersType = Object.freeze({
|
||||
owner: "Owner",
|
||||
docSpaceAdmin: "DocSpaceAdmin",
|
||||
roomAdmin: "RoomAdmin",
|
||||
collaborator: "Collaborator",
|
||||
user: "User",
|
||||
});
|
||||
|
||||
export const PluginDevices = Object.freeze({
|
||||
mobile: "mobile",
|
||||
tablet: "tablet",
|
||||
desktop: "desktop",
|
||||
});
|
97
packages/client/src/helpers/plugins/enums.ts
Normal file
97
packages/client/src/helpers/plugins/enums.ts
Normal file
@ -0,0 +1,97 @@
|
||||
export const enum PluginFileType {
|
||||
Files = "file",
|
||||
Folders = "folder",
|
||||
Rooms = "room",
|
||||
Image = "image",
|
||||
Video = "video",
|
||||
}
|
||||
|
||||
export const enum PluginEvents {
|
||||
CREATE = "create",
|
||||
RENAME = "rename",
|
||||
ROOM_CREATE = "create_room",
|
||||
ROOM_EDIT = "edit_room",
|
||||
CHANGE_COLUMN = "change_column",
|
||||
CHANGE_USER_TYPE = "change_user_type",
|
||||
CREATE_PLUGIN_FILE = "create_plugin_file",
|
||||
}
|
||||
|
||||
export const enum PluginScopes {
|
||||
API = "API",
|
||||
Settings = "Settings",
|
||||
ContextMenu = "ContextMenu",
|
||||
InfoPanel = "InfoPanel",
|
||||
MainButton = "MainButton",
|
||||
ProfileMenu = "ProfileMenu",
|
||||
EventListener = "EventListener",
|
||||
File = "File",
|
||||
}
|
||||
|
||||
export const enum PluginStatus {
|
||||
active = "active",
|
||||
hide = "hide",
|
||||
}
|
||||
|
||||
export const enum PluginActions {
|
||||
updateProps = "update-props",
|
||||
updateContext = "update-context",
|
||||
|
||||
updateStatus = "update-status",
|
||||
|
||||
showToast = "show-toast",
|
||||
|
||||
// showSettingsModal= "show-settings-modal",
|
||||
// closeSettingsModal= "close-settings-modal",
|
||||
|
||||
showCreateDialogModal = "show-create-dialog-modal",
|
||||
|
||||
showModal = "show-modal",
|
||||
closeModal = "close-modal",
|
||||
|
||||
updateContextMenuItems = "update-context-menu-items",
|
||||
updateInfoPanelItems = "update-info-panel-items",
|
||||
updateMainButtonItems = "update-main-button-items",
|
||||
updateProfileMenuItems = "update-profile-menu-items",
|
||||
updateFileItems = "update-file-items",
|
||||
updateEventListenerItems = "update-event-listener-items",
|
||||
|
||||
sendPostMessage = "send-post-message",
|
||||
|
||||
saveSettings = "save-settings",
|
||||
}
|
||||
|
||||
export const enum PluginToastType {
|
||||
success = "success",
|
||||
error = "error",
|
||||
warning = "warning",
|
||||
info = "info",
|
||||
}
|
||||
|
||||
export const enum PluginComponents {
|
||||
box = "box",
|
||||
button = "button",
|
||||
checkbox = "checkbox",
|
||||
input = "input",
|
||||
label = "label",
|
||||
text = "text",
|
||||
textArea = "textArea",
|
||||
toggleButton = "toggleButton",
|
||||
img = "img",
|
||||
iFrame = "iFrame",
|
||||
comboBox = "comboBox",
|
||||
skeleton = "skeleton",
|
||||
}
|
||||
|
||||
export const enum PluginUsersType {
|
||||
owner = "Owner",
|
||||
docSpaceAdmin = "DocSpaceAdmin",
|
||||
roomAdmin = "RoomAdmin",
|
||||
collaborator = "Collaborator",
|
||||
user = "User",
|
||||
}
|
||||
|
||||
export const enum PluginDevices {
|
||||
mobile = "mobile",
|
||||
tablet = "tablet",
|
||||
desktop = "desktop",
|
||||
}
|
275
packages/client/src/helpers/plugins/types.ts
Normal file
275
packages/client/src/helpers/plugins/types.ts
Normal file
@ -0,0 +1,275 @@
|
||||
import { TCreatedBy } from "@docspace/shared/types";
|
||||
import { ButtonProps } from "@docspace/shared/components/button/Button.types";
|
||||
import { BoxProps } from "@docspace/shared/components/box/Box.types";
|
||||
import { TextInputProps } from "@docspace/shared/components/text-input";
|
||||
import { CheckboxProps } from "@docspace/shared/components/checkbox/Checkbox.types";
|
||||
import { ToggleButtonProps } from "@docspace/shared/components/toggle-button/ToggleButton.types";
|
||||
import { TextareaProps } from "@docspace/shared/components/textarea/Textarea.types";
|
||||
import {
|
||||
ComboboxProps,
|
||||
TOption,
|
||||
} from "@docspace/shared/components/combobox/Combobox.types";
|
||||
import { ToastProps } from "@docspace/shared/components/toast/Toast.type";
|
||||
import { ModalDialogProps } from "@docspace/shared/components/modal-dialog/ModalDialog.types";
|
||||
import { TextProps } from "@docspace/shared/components/text/Text.types";
|
||||
import { RectangleSkeletonProps } from "@docspace/shared/skeletons";
|
||||
import { LabelProps } from "@docspace/shared/components/label/Label.types";
|
||||
import {
|
||||
TFile,
|
||||
TFileSecurity,
|
||||
TFolderSecurity,
|
||||
} from "@docspace/shared/api/files/types";
|
||||
import { TRoomSecurity } from "@docspace/shared/api/rooms/types";
|
||||
|
||||
import {
|
||||
PluginActions,
|
||||
PluginComponents,
|
||||
PluginDevices,
|
||||
PluginEvents,
|
||||
PluginFileType,
|
||||
PluginStatus,
|
||||
PluginUsersType,
|
||||
} from "./enums";
|
||||
|
||||
export interface IPostMessage {
|
||||
frameId: string;
|
||||
message: { [key: string]: unknown };
|
||||
}
|
||||
|
||||
export interface IFrame {
|
||||
src: string;
|
||||
width?: string;
|
||||
height?: string;
|
||||
name?: string;
|
||||
sandbox?: string;
|
||||
id?: string;
|
||||
style?: { [key: string]: string };
|
||||
}
|
||||
|
||||
export interface ICreateDialog {
|
||||
title: string;
|
||||
startValue: string;
|
||||
visible: boolean;
|
||||
options?: TOption[];
|
||||
selectedOption?: TOption;
|
||||
onSelect?: (option: TOption) => IMessage | void;
|
||||
onSave?: (
|
||||
e: unknown,
|
||||
value: string,
|
||||
) => Promise<IMessage> | Promise<void> | IMessage | void;
|
||||
onCancel?: (e: unknown) => void;
|
||||
onClose?: (e: unknown) => void;
|
||||
isCreateDialog: boolean;
|
||||
extension?: string;
|
||||
}
|
||||
|
||||
export interface IImage {
|
||||
src: string;
|
||||
alt: string;
|
||||
width?: string;
|
||||
height?: string;
|
||||
name?: string;
|
||||
id?: string;
|
||||
style?: { [key: string]: string };
|
||||
}
|
||||
|
||||
export interface IMessage {
|
||||
actions?: PluginActions[];
|
||||
newProps?:
|
||||
| TextInputProps
|
||||
| CheckboxProps
|
||||
| ToggleButtonProps
|
||||
| ButtonProps
|
||||
| TextareaProps
|
||||
| ComboboxProps;
|
||||
toastProps?: ToastProps[];
|
||||
contextProps?: {
|
||||
name: string;
|
||||
props:
|
||||
| BoxProps
|
||||
| ButtonProps
|
||||
| CheckboxProps
|
||||
| ComboboxProps
|
||||
| IFrame
|
||||
| IImage
|
||||
| TextInputProps
|
||||
| LabelProps
|
||||
| RectangleSkeletonProps
|
||||
| TextProps
|
||||
| TextareaProps
|
||||
| ToggleButtonProps;
|
||||
}[];
|
||||
createDialogProps?: ICreateDialog;
|
||||
modalDialogProps?: ModalDialogProps;
|
||||
postMessage?: IPostMessage;
|
||||
settings?: string;
|
||||
}
|
||||
|
||||
type TButtonGroup = {
|
||||
component: PluginComponents.button;
|
||||
props: ButtonProps;
|
||||
contextName?: string;
|
||||
};
|
||||
|
||||
export interface ISettings {
|
||||
settings: BoxProps;
|
||||
saveButton: TButtonGroup;
|
||||
isLoading?: boolean;
|
||||
onLoad?: () => Promise<{ settings: BoxProps; saveButton?: TButtonGroup }>;
|
||||
}
|
||||
|
||||
export interface IContextMenuItem {
|
||||
key: string;
|
||||
label: string;
|
||||
icon: string;
|
||||
onClick: (id: number) => Promise<IMessage> | Promise<void> | IMessage | void;
|
||||
withActiveItem?: boolean;
|
||||
fileExt?: string[];
|
||||
fileType?: PluginFileType[];
|
||||
usersTypes?: PluginUsersType[];
|
||||
devices?: PluginDevices[];
|
||||
security?: (
|
||||
| keyof TRoomSecurity
|
||||
| keyof TFileSecurity
|
||||
| keyof TFolderSecurity
|
||||
)[];
|
||||
pluginName?: string;
|
||||
}
|
||||
|
||||
export interface IEventListenerItem {
|
||||
key: string;
|
||||
eventType: PluginEvents;
|
||||
eventHandler: () => Promise<IMessage> | Promise<void> | IMessage | void;
|
||||
usersTypes?: PluginUsersType[];
|
||||
devices?: PluginDevices[];
|
||||
pluginName?: string;
|
||||
}
|
||||
|
||||
export interface IFileItem {
|
||||
extension: string;
|
||||
onClick: (item: TFile) => Promise<IMessage> | Promise<void> | IMessage | void;
|
||||
usersType?: PluginUsersType[];
|
||||
devices?: PluginDevices[];
|
||||
fileTypeName?: string;
|
||||
fileRowIcon?: string;
|
||||
fileTileIcon?: string;
|
||||
fileIcon?: string;
|
||||
fileIconTile?: string;
|
||||
pluginName?: string;
|
||||
}
|
||||
|
||||
export interface IInfoPanelSubMenu {
|
||||
name: string;
|
||||
onClick?: (id: number) => Promise<IMessage> | Promise<void> | IMessage | void;
|
||||
}
|
||||
|
||||
export interface IInfoPanelItem {
|
||||
key: string;
|
||||
subMenu: IInfoPanelSubMenu;
|
||||
body: BoxProps;
|
||||
onLoad: () => Promise<{ body: BoxProps }>;
|
||||
filesType?: PluginFileType[];
|
||||
filesExsts?: string[];
|
||||
usersTypes?: PluginUsersType[];
|
||||
devices?: PluginDevices[];
|
||||
pluginName?: string;
|
||||
}
|
||||
|
||||
export interface IMainButtonItem {
|
||||
key: string;
|
||||
label: string;
|
||||
icon: string;
|
||||
onClick?: (
|
||||
id: number | string,
|
||||
) => Promise<IMessage> | Promise<void> | IMessage | void;
|
||||
usersType?: PluginUsersType[];
|
||||
items?: IMainButtonItem[] | null;
|
||||
devices?: PluginDevices[];
|
||||
pluginName?: string;
|
||||
}
|
||||
|
||||
export interface IProfileMenuItem {
|
||||
key: string;
|
||||
label: string;
|
||||
icon: string;
|
||||
onClick: () => Promise<IMessage> | Promise<void> | IMessage | void;
|
||||
usersType?: PluginUsersType[];
|
||||
devices?: PluginDevices[];
|
||||
pluginName?: string;
|
||||
}
|
||||
|
||||
export interface IframeWindow extends Window {
|
||||
Plugins: { [key: string]: TPlugin };
|
||||
}
|
||||
|
||||
export type TPlugin = {
|
||||
name: string;
|
||||
version: string;
|
||||
description: string;
|
||||
license: string;
|
||||
author: string;
|
||||
homePage: string;
|
||||
pluginName: string;
|
||||
scopes: string | string[];
|
||||
image: string;
|
||||
createBy: TCreatedBy;
|
||||
createOn: Date;
|
||||
enabled: boolean;
|
||||
system: boolean;
|
||||
url: string;
|
||||
settings: string;
|
||||
iconUrl: string;
|
||||
|
||||
status: PluginStatus;
|
||||
onLoadCallback: () => Promise<void>;
|
||||
updateStatus: (status: PluginStatus) => void;
|
||||
getStatus: () => PluginStatus;
|
||||
setOnLoadCallback: (callback: () => Promise<void>) => void;
|
||||
|
||||
adminPluginSettings?: ISettings | null;
|
||||
setAdminPluginSettings?: (settings: ISettings | null) => void;
|
||||
setAdminPluginSettingsValue?: (settings: string | null) => void;
|
||||
getAdminPluginSettings?: () => ISettings | null;
|
||||
|
||||
origin?: string;
|
||||
proxy?: string;
|
||||
prefix?: string;
|
||||
setOrigin?: (origin: string) => void;
|
||||
setProxy?: (proxy: string) => void;
|
||||
setPrefix?: (prefix: string) => void;
|
||||
getOrigin?: () => string;
|
||||
getProxy?: () => string;
|
||||
getPrefix?: () => string;
|
||||
setAPI?: (origin: string, proxy: string, prefix: string) => void;
|
||||
getAPI?: () => { origin: string; proxy: string; prefix: string };
|
||||
|
||||
contextMenuItems: Map<string, IContextMenuItem>;
|
||||
addContextMenuItem(item: IContextMenuItem): void;
|
||||
getContextMenuItems(): Map<string, IContextMenuItem>;
|
||||
getContextMenuItemsKeys(): string[];
|
||||
updateContextMenuItem(item: IContextMenuItem): void;
|
||||
|
||||
eventListenerItems?: Map<string, IEventListenerItem>;
|
||||
addEventListenerItem?: (item: IEventListenerItem) => void;
|
||||
getEventListenerItems?: () => Map<string, IEventListenerItem>;
|
||||
|
||||
fileItems?: Map<string, IFileItem>;
|
||||
addFileItem?: (item: IFileItem) => void;
|
||||
getFileItems?: () => Map<string, IFileItem>;
|
||||
updateFileItem?: (item: IFileItem) => void;
|
||||
|
||||
infoPanelItems?: Map<string, IInfoPanelItem>;
|
||||
addInfoPanelItem?: (item: IInfoPanelItem) => void;
|
||||
getInfoPanelItems?: () => Map<string, IInfoPanelItem>;
|
||||
updateInfoPanelItem?: (item: IInfoPanelItem) => void;
|
||||
|
||||
mainButtonItems?: Map<string, IMainButtonItem>;
|
||||
addMainButtonItem?: (item: IMainButtonItem) => void;
|
||||
getMainButtonItems?: () => Map<string, IMainButtonItem>;
|
||||
updateMainButtonItem?: (item: IMainButtonItem) => void;
|
||||
|
||||
profileMenuItems?: Map<string, IProfileMenuItem>;
|
||||
addProfileMenuItem?: (item: IProfileMenuItem) => void;
|
||||
getProfileMenuItems?: () => Map<string, IProfileMenuItem>;
|
||||
updateProfileMenuItem?: (item: IProfileMenuItem) => void;
|
||||
};
|
@ -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,
|
||||
);
|
||||
};
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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}`,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -42,7 +42,6 @@ const useFiles = ({
|
||||
setIsUpdatingRowItem,
|
||||
|
||||
gallerySelected,
|
||||
removeFirstUrl,
|
||||
folderSecurity,
|
||||
}) => {
|
||||
const navigate = useNavigate();
|
||||
@ -96,17 +95,20 @@ const useFiles = ({
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
if (location.state?.fromMediaViewer) {
|
||||
const { fromMediaViewer, ...state } = location.state;
|
||||
// remove fromMediaViewer from location state
|
||||
return navigate(location.pathname + location.search, {
|
||||
replace: true,
|
||||
state,
|
||||
});
|
||||
}
|
||||
|
||||
if (isAccountsPage || isSettingsPage) return;
|
||||
|
||||
if (location.pathname === "/") setIsLoading(true, true, true);
|
||||
else setIsLoading(true, false, false);
|
||||
|
||||
if (!window.location.href.includes(MEDIA_VIEW_URL)) {
|
||||
// localStorage.removeItem("isFirstUrl");
|
||||
// Media viewer
|
||||
removeFirstUrl();
|
||||
}
|
||||
|
||||
const categoryType = getCategoryType(location);
|
||||
|
||||
let filterObj = null;
|
||||
|
@ -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))(
|
||||
<Loaders.InfoPanelViewLoader view="accounts" />
|
||||
)
|
||||
)
|
||||
<Loaders.InfoPanelViewLoader view="accounts" />,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -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 = () => (
|
||||
<div>
|
||||
@ -197,15 +198,13 @@ const User = ({
|
||||
color="#A3A9AE !important"
|
||||
dir="auto"
|
||||
>
|
||||
{`${capitalize(role)} | ${user.email}`}
|
||||
{`${typeLabel} | ${user.email}`}
|
||||
</Text>
|
||||
</div>
|
||||
);
|
||||
|
||||
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}`}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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 (
|
||||
|
@ -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))(
|
||||
// <Loaders.InfoPanelHeaderLoader />
|
||||
// )
|
||||
)
|
||||
),
|
||||
);
|
||||
|
@ -1,13 +1,15 @@
|
||||
import React, { useEffect } from "react";
|
||||
import React, { useEffect, useCallback } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { withTranslation } from "react-i18next";
|
||||
import { useNavigate, useLocation } from "react-router-dom";
|
||||
import queryString from "query-string";
|
||||
import MediaViewer from "@docspace/common/components/MediaViewer";
|
||||
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";
|
||||
|
||||
import MediaViewer from "@docspace/shared/components/media-viewer/MediaViewer";
|
||||
|
||||
const FilesMediaViewer = (props) => {
|
||||
const {
|
||||
t,
|
||||
@ -61,7 +63,9 @@ const FilesMediaViewer = (props) => {
|
||||
onClickDownloadAs,
|
||||
setActiveFiles,
|
||||
pluginContextMenuItems,
|
||||
isOpenMediaViewer,
|
||||
someDialogIsOpen,
|
||||
currentDeviceType,
|
||||
} = props;
|
||||
|
||||
const navigate = useNavigate();
|
||||
@ -107,12 +111,15 @@ const FilesMediaViewer = (props) => {
|
||||
setMediaViewerData({ visible: true, id });
|
||||
};
|
||||
|
||||
const onChangeUrl = (id) => {
|
||||
const url = combineUrl(MEDIA_VIEW_URL, id);
|
||||
const onChangeUrl = useCallback(
|
||||
(id) => {
|
||||
const url = combineUrl(MEDIA_VIEW_URL, id);
|
||||
|
||||
setCurrentId(id);
|
||||
navigate(url);
|
||||
};
|
||||
setCurrentId(id);
|
||||
navigate(url);
|
||||
},
|
||||
[setCurrentId, navigate],
|
||||
);
|
||||
|
||||
const resetSelection = () => {
|
||||
setSelection([]);
|
||||
@ -138,100 +145,138 @@ const FilesMediaViewer = (props) => {
|
||||
}
|
||||
};
|
||||
|
||||
const onDeleteMediaFile = (id) => {
|
||||
const translations = {
|
||||
deleteOperation: t("Translations:DeleteOperation"),
|
||||
successRemoveFolder: t("Files:FolderRemoved"),
|
||||
successRemoveFile: t("Files:FileRemoved"),
|
||||
};
|
||||
const onDeleteMediaFile = useCallback(
|
||||
(id) => {
|
||||
const translations = {
|
||||
deleteOperation: t("Translations:DeleteOperation"),
|
||||
successRemoveFolder: t("Files:FolderRemoved"),
|
||||
successRemoveFile: t("Files:FileRemoved"),
|
||||
};
|
||||
|
||||
if (files.length > 0) {
|
||||
let file = files.find((file) => file.id === id);
|
||||
if (file) {
|
||||
// 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
|
||||
);
|
||||
if (files.length > 0) {
|
||||
let file = files.find((file) => file.id === id);
|
||||
if (file) {
|
||||
// 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,
|
||||
);
|
||||
|
||||
if (isActiveFile || isActiveFolder) return;
|
||||
if (isActiveFile || isActiveFolder) return;
|
||||
|
||||
setRemoveMediaItem(file);
|
||||
deleteItemAction(file.id, translations, true, file.providerKey);
|
||||
setRemoveMediaItem(file);
|
||||
deleteItemAction(file.id, translations, true, file.providerKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
[
|
||||
files,
|
||||
t,
|
||||
activeFiles,
|
||||
activeFolders,
|
||||
setRemoveMediaItem,
|
||||
deleteItemAction,
|
||||
],
|
||||
);
|
||||
|
||||
const onDownloadMediaFile = (id) => {
|
||||
if (playlist.length > 0) {
|
||||
let viewUrlFile = playlist.find((file) => file.fileId === id).src;
|
||||
return window.open(viewUrlFile, "_self");
|
||||
}
|
||||
};
|
||||
|
||||
const onMediaViewerClose = (e) => {
|
||||
if (isPreview) {
|
||||
setIsPreview(false);
|
||||
resetUrl();
|
||||
if (previewFile) {
|
||||
setScrollToItem({ id: previewFile.id, type: "file" });
|
||||
setBufferSelection(previewFile);
|
||||
const onDownloadMediaFile = useCallback(
|
||||
(id) => {
|
||||
if (playlist.length > 0) {
|
||||
let viewUrlFile = playlist.find((file) => file.fileId === id).src;
|
||||
return window.open(viewUrlFile, "_self");
|
||||
}
|
||||
setToPreviewFile(null);
|
||||
}
|
||||
},
|
||||
[playlist],
|
||||
);
|
||||
|
||||
setMediaViewerData({ visible: false, id: null });
|
||||
const onMediaViewerClose = useCallback(
|
||||
(e) => {
|
||||
if (isPreview) {
|
||||
setIsPreview(false);
|
||||
resetUrl();
|
||||
if (previewFile) {
|
||||
setScrollToItem({ id: previewFile.id, type: "file" });
|
||||
setBufferSelection(previewFile);
|
||||
}
|
||||
setToPreviewFile(null);
|
||||
}
|
||||
|
||||
// const url = localStorage.getItem("isFirstUrl");
|
||||
const url = getFirstUrl();
|
||||
setMediaViewerData({ visible: false, id: null });
|
||||
const url = getFirstUrl();
|
||||
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
|
||||
const targetFile = files.find((item) => item.id === currentMediaFileId);
|
||||
if (targetFile) setBufferSelection(targetFile);
|
||||
const targetFile = files.find((item) => item.id === currentMediaFileId);
|
||||
if (targetFile) {
|
||||
setBufferSelection(targetFile);
|
||||
setScrollToItem({ id: targetFile.id, type: "file" });
|
||||
}
|
||||
|
||||
navigate(url, { replace: true });
|
||||
};
|
||||
navigate(url, {
|
||||
state: {
|
||||
...location.state,
|
||||
fromMediaViewer: true,
|
||||
},
|
||||
});
|
||||
},
|
||||
[
|
||||
files,
|
||||
isPreview,
|
||||
previewFile,
|
||||
|
||||
resetUrl,
|
||||
navigate,
|
||||
getFirstUrl,
|
||||
setIsPreview,
|
||||
setScrollToItem,
|
||||
setToPreviewFile,
|
||||
setMediaViewerData,
|
||||
setBufferSelection,
|
||||
],
|
||||
);
|
||||
useEffect(() => {
|
||||
if (playlist.length === 0 && isOpenMediaViewer) onMediaViewerClose();
|
||||
}, [isOpenMediaViewer, onMediaViewerClose, playlist.length]);
|
||||
|
||||
return (
|
||||
visible && (
|
||||
<MediaViewer
|
||||
t={t}
|
||||
userAccess={userAccess}
|
||||
currentFileId={currentMediaFileId}
|
||||
files={files}
|
||||
getIcon={getIcon}
|
||||
visible={visible}
|
||||
playlist={playlist}
|
||||
playlistPos={currentPostionIndex}
|
||||
onDelete={onDeleteMediaFile}
|
||||
onDownload={onDownloadMediaFile}
|
||||
setBufferSelection={setBufferSelection}
|
||||
archiveRoomsId={archiveRoomsId}
|
||||
files={files}
|
||||
onClickDownload={onClickDownload}
|
||||
onShowInfoPanel={onShowInfoPanel}
|
||||
onClickDelete={onClickDelete}
|
||||
onClickRename={onClickRename}
|
||||
prevMedia={prevMedia}
|
||||
nextMedia={nextMedia}
|
||||
onCopyLink={onCopyLink}
|
||||
userAccess={userAccess}
|
||||
onChangeUrl={onChangeUrl}
|
||||
isPreviewFile={firstLoad}
|
||||
onDuplicate={onDuplicate}
|
||||
onMoveAction={onMoveAction}
|
||||
onCopyAction={onCopyAction}
|
||||
onDuplicate={onDuplicate}
|
||||
onClickLinkEdit={onClickLinkEdit}
|
||||
onPreviewClick={onPreviewClick}
|
||||
onCopyLink={onCopyLink}
|
||||
onClickDownloadAs={onClickDownloadAs}
|
||||
onClose={onMediaViewerClose}
|
||||
getIcon={getIcon}
|
||||
onDelete={onDeleteMediaFile}
|
||||
onClickRename={onClickRename}
|
||||
onClickDelete={onClickDelete}
|
||||
setActiveFiles={setActiveFiles}
|
||||
archiveRoomsId={archiveRoomsId}
|
||||
onPreviewClick={onPreviewClick}
|
||||
onDownload={onDownloadMediaFile}
|
||||
onClickLinkEdit={onClickLinkEdit}
|
||||
onClickDownload={onClickDownload}
|
||||
onShowInfoPanel={onShowInfoPanel}
|
||||
playlistPos={currentPostionIndex}
|
||||
currentFileId={currentMediaFileId}
|
||||
onClickDownloadAs={onClickDownloadAs}
|
||||
currentDeviceType={currentDeviceType}
|
||||
extsImagePreviewed={extsImagePreviewed}
|
||||
setBufferSelection={setBufferSelection}
|
||||
onEmptyPlaylistError={onMediaViewerClose}
|
||||
deleteDialogVisible={deleteDialogVisible}
|
||||
extsMediaPreviewed={extsMediaPreviewed}
|
||||
extsImagePreviewed={extsImagePreviewed}
|
||||
isPreviewFile={firstLoad}
|
||||
onChangeUrl={onChangeUrl}
|
||||
nextMedia={nextMedia}
|
||||
prevMedia={prevMedia}
|
||||
pluginContextMenuItems={pluginContextMenuItems}
|
||||
setActiveFiles={setActiveFiles}
|
||||
/>
|
||||
)
|
||||
);
|
||||
@ -248,7 +293,9 @@ export default inject(
|
||||
contextOptionsStore,
|
||||
clientLoadingStore,
|
||||
pluginStore,
|
||||
settingsStore,
|
||||
}) => {
|
||||
const { currentDeviceType } = settingsStore;
|
||||
const {
|
||||
firstLoad,
|
||||
|
||||
@ -337,6 +384,7 @@ export default inject(
|
||||
nextMedia,
|
||||
prevMedia,
|
||||
userAccess,
|
||||
isOpenMediaViewer: visible,
|
||||
visible: playlist.length > 0 && visible,
|
||||
currentMediaFileId,
|
||||
deleteItemAction,
|
||||
@ -379,6 +427,7 @@ export default inject(
|
||||
activeFolders,
|
||||
setActiveFiles,
|
||||
pluginContextMenuItems,
|
||||
currentDeviceType,
|
||||
};
|
||||
}
|
||||
},
|
||||
)(withTranslation(["Files", "Translations"])(observer(FilesMediaViewer)));
|
||||
|
@ -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),
|
||||
);
|
||||
|
@ -74,7 +74,6 @@ const PureHome = (props) => {
|
||||
files,
|
||||
selection,
|
||||
filesList,
|
||||
removeFirstUrl,
|
||||
|
||||
createFile,
|
||||
createFolder,
|
||||
@ -159,7 +158,6 @@ const PureHome = (props) => {
|
||||
setIsPreview,
|
||||
|
||||
setIsUpdatingRowItem,
|
||||
removeFirstUrl,
|
||||
|
||||
gallerySelected,
|
||||
folderSecurity,
|
||||
@ -460,7 +458,7 @@ export default inject(
|
||||
? filesStore.selectionTitle
|
||||
: null;
|
||||
|
||||
const { setToPreviewFile, playlist, removeFirstUrl } = mediaViewerDataStore;
|
||||
const { setToPreviewFile, playlist } = mediaViewerDataStore;
|
||||
|
||||
const { setPortalTariff } = currentTariffStatusStore;
|
||||
|
||||
@ -544,7 +542,6 @@ export default inject(
|
||||
setToPreviewFile,
|
||||
setIsPreview,
|
||||
playlist,
|
||||
removeFirstUrl,
|
||||
|
||||
getFileInfo,
|
||||
gallerySelected,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -164,7 +164,7 @@ const DNSSettings = (props) => {
|
||||
<TextInput
|
||||
{...textInputProps}
|
||||
isDisabled={isLoading || !enable}
|
||||
value={dnsName}
|
||||
value={dnsName?.trim()}
|
||||
onChange={onChangeTextInput}
|
||||
hasError={isError}
|
||||
/>
|
||||
@ -183,7 +183,7 @@ const DNSSettings = (props) => {
|
||||
<TextInput
|
||||
{...textInputProps}
|
||||
isDisabled={true}
|
||||
value={location.hostname}
|
||||
value={location.hostname?.trim()}
|
||||
/>
|
||||
</FieldContainer>
|
||||
</>
|
||||
|
@ -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))));
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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 (
|
||||
|
@ -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,
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -44,8 +44,8 @@ const RequestButtonContainer = ({ isDisabled, isLoading }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ payments }) => {
|
||||
const { isLoading } = payments;
|
||||
export default inject(({ paymentStore }) => {
|
||||
const { isLoading } = paymentStore;
|
||||
|
||||
return {
|
||||
isLoading,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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));
|
||||
|
@ -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 };
|
||||
|
@ -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,
|
||||
|
@ -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));
|
||||
|
@ -21,8 +21,8 @@ const ButtonContainer = ({ t, buyUrl }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ payments }) => {
|
||||
const { buyUrl } = payments;
|
||||
export default inject(({ paymentStore }) => {
|
||||
const { buyUrl } = paymentStore;
|
||||
|
||||
return {
|
||||
buyUrl,
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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;
|
@ -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();
|
||||
|
@ -498,10 +498,6 @@ class ContextOptionsStore {
|
||||
onMediaFileClick = (fileId, item) => {
|
||||
const itemId = typeof fileId !== "object" ? fileId : item.id;
|
||||
this.mediaViewerDataStore.setMediaViewerData({ visible: true, id: itemId });
|
||||
// localStorage.setItem("isFirstUrl", window.location.href);
|
||||
this.mediaViewerDataStore.saveFirstUrl(
|
||||
`${window.DocSpace.location.pathname}${window.DocSpace.location.search}`
|
||||
);
|
||||
this.mediaViewerDataStore.changeUrl(itemId);
|
||||
};
|
||||
|
||||
|
@ -2211,11 +2211,6 @@ class FilesActionStore {
|
||||
}
|
||||
|
||||
if (isMediaOrImage) {
|
||||
// localStorage.setItem("isFirstUrl", window.location.href);
|
||||
|
||||
this.mediaViewerDataStore.saveFirstUrl(
|
||||
`${window.DocSpace.location.pathname}${window.DocSpace.location.search}`
|
||||
);
|
||||
setMediaViewerData({ visible: true, id });
|
||||
|
||||
const url = combineUrl(MEDIA_VIEW_URL, id);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user