- {decode(initiator.displayName)}
+
+ {initiator?.isAnonim
+ ? t("Common:Anonymous")
+ : decode(initiator.displayName)}
+
{initiator.isOwner && (
{t("Common:Owner").toLowerCase()}
diff --git a/packages/client/src/pages/Home/Section/Header/index.js b/packages/client/src/pages/Home/Section/Header/index.js
index 924a69e3e3..f833fd8c15 100644
--- a/packages/client/src/pages/Home/Section/Header/index.js
+++ b/packages/client/src/pages/Home/Section/Header/index.js
@@ -1225,14 +1225,15 @@ export default inject(
const sharedItem = navigationPath.find((r) => r.shared);
- const showNavigationButton = isLoading
- ? false
- : (!isPublicRoom &&
- !isArchive &&
- canCopyPublicLink &&
- (isPublicRoomType || isCustomRoomType || isFormRoomType) &&
- shared) ||
- (sharedItem && sharedItem.canCopyPublicLink);
+ const showNavigationButton =
+ isLoading || !security?.CopyLink
+ ? false
+ : (!isPublicRoom &&
+ !isArchive &&
+ canCopyPublicLink &&
+ (isPublicRoomType || isCustomRoomType || isFormRoomType) &&
+ shared) ||
+ (sharedItem && sharedItem.canCopyPublicLink);
return {
isGracePeriod,
diff --git a/packages/client/src/pages/Home/index.js b/packages/client/src/pages/Home/index.js
index 5e916b582c..ffea1f5615 100644
--- a/packages/client/src/pages/Home/index.js
+++ b/packages/client/src/pages/Home/index.js
@@ -201,6 +201,7 @@ const PureHome = (props) => {
userId,
scrollToTop,
+ selectedFolderStore,
});
const { showUploadPanel } = useOperations({
diff --git a/packages/client/src/store/ContextOptionsStore.js b/packages/client/src/store/ContextOptionsStore.js
index f96646755e..5ab84d03f8 100644
--- a/packages/client/src/store/ContextOptionsStore.js
+++ b/packages/client/src/store/ContextOptionsStore.js
@@ -1400,7 +1400,8 @@ class ContextOptionsStore {
onClick: () => this.onCopyLink(item, t),
disabled:
(isPublicRoomType && item.canCopyPublicLink && !isArchive) ||
- this.publicRoomStore.isPublicRoom,
+ this.publicRoomStore.isPublicRoom ||
+ !item.security.CopyLink,
},
{
id: "option_copy-external-link",
diff --git a/packages/client/src/store/DialogsStore.js b/packages/client/src/store/DialogsStore.js
index fb6e002b29..38bfa201dc 100644
--- a/packages/client/src/store/DialogsStore.js
+++ b/packages/client/src/store/DialogsStore.js
@@ -380,13 +380,6 @@ class DialogsStore {
this.selectFileFormRoomOpenRoot = openRoot;
};
- createFromTemplateForm = (fileInfo) => {
- this.createMasterForm(fileInfo, {
- extension: "pdf",
- withoutDialog: true,
- });
- };
-
createMasterForm = async (fileInfo, options) => {
const { extension = "pdf", withoutDialog, preview } = options;
diff --git a/packages/client/src/store/FilesActionsStore.js b/packages/client/src/store/FilesActionsStore.js
index e4f057ea89..48116dcb1c 100644
--- a/packages/client/src/store/FilesActionsStore.js
+++ b/packages/client/src/store/FilesActionsStore.js
@@ -2714,6 +2714,37 @@ class FilesActionStore {
await deleteFilesFromRecent(fileIds);
await refreshFiles();
};
+
+ copyFromTemplateForm = async (fileInfo, t) => {
+ const selectedItemId = this.selectedFolderStore.id;
+ const fileIds = [fileInfo.id];
+
+ const operationData = {
+ destFolderId: selectedItemId,
+ folderIds: [],
+ fileIds,
+ deleteAfter: false,
+ isCopy: true,
+ folderTitle: this.selectedFolderStore.title,
+ translations: {
+ copy: t("Common:CopyOperation"),
+ },
+ };
+
+ this.uploadDataStore.secondaryProgressDataStore.setItemsSelectionTitle(
+ fileInfo.title,
+ );
+
+ const conflicts = await checkFileConflicts(selectedItemId, [], fileIds);
+
+ if (conflicts.length) {
+ return this.setConflictDialogData(conflicts, operationData);
+ }
+
+ this.uploadDataStore
+ .itemOperationToFolder(operationData)
+ .catch((error) => toastr.error(error));
+ };
}
export default FilesActionStore;
diff --git a/packages/client/src/store/FilesStore.js b/packages/client/src/store/FilesStore.js
index 37514bb38e..ba9908197a 100644
--- a/packages/client/src/store/FilesStore.js
+++ b/packages/client/src/store/FilesStore.js
@@ -2600,12 +2600,13 @@ class FilesStore {
}
};
- createFile = (folderId, title, templateId, formId) => {
+ createFile = async (folderId, title, templateId, formId) => {
return api.files
.createFile(folderId, title, templateId, formId)
.then((file) => {
return Promise.resolve(file);
- });
+ })
+ .then(() => this.fetchFiles(folderId, this.filter, true, true, false));
};
createFolder(parentFolderId, title) {
diff --git a/packages/doceditor/src/components/Editor.tsx b/packages/doceditor/src/components/Editor.tsx
index 44334ca832..86ab9d5a64 100644
--- a/packages/doceditor/src/components/Editor.tsx
+++ b/packages/doceditor/src/components/Editor.tsx
@@ -296,7 +296,8 @@ const Editor = ({
}
if (config?.startFilling) {
- newConfig.events.onRequestStartFilling = onSDKRequestStartFilling;
+ newConfig.events.onRequestStartFilling = () =>
+ onSDKRequestStartFilling?.(t("Common:StartFilling"));
}
newConfig.events.onSubmit = () => {
diff --git a/packages/doceditor/src/components/Root.tsx b/packages/doceditor/src/components/Root.tsx
index 5e6eae69fe..3e7e1c994a 100644
--- a/packages/doceditor/src/components/Root.tsx
+++ b/packages/doceditor/src/components/Root.tsx
@@ -125,12 +125,6 @@ const Root = ({
selectFileDialogFileTypeDetection,
selectFileDialogVisible,
} = useSelectFileDialog({ instanceId: instanceId ?? "" });
- const {
- isSharingDialogVisible,
-
- onCloseSharingDialog,
- onSDKRequestSharingSettings,
- } = useShareDialog();
const {
getIsDisabledStartFillingSelectDialog,
@@ -139,8 +133,16 @@ const Root = ({
onSubmitStartFillingSelectDialog,
onSDKRequestStartFilling,
conflictDataDialog,
+ headerLabelSFSDialog,
} = useStartFillingSelectDialog(fileInfo);
+ const {
+ isSharingDialogVisible,
+
+ onCloseSharingDialog,
+ onSDKRequestSharingSettings,
+ } = useShareDialog(config, onSDKRequestStartFilling);
+
useUpdateSearchParamId(fileId, hash);
React.useEffect(() => {
@@ -254,11 +256,12 @@ const Root = ({
)}
{conflictDataDialog.visible && (
diff --git a/packages/doceditor/src/components/StartFillingSelectDialog.tsx b/packages/doceditor/src/components/StartFillingSelectDialog.tsx
index 03283f29c5..d94715a83a 100644
--- a/packages/doceditor/src/components/StartFillingSelectDialog.tsx
+++ b/packages/doceditor/src/components/StartFillingSelectDialog.tsx
@@ -40,6 +40,7 @@ function StartFillingSelectorDialog({
onClose,
onSubmit,
filesSettings,
+ headerLabel,
}: StartFillingSelectorDialogPprops) {
const { t } = useTranslation(["Common", "Editor"]);
@@ -67,7 +68,7 @@ function StartFillingSelectorDialog({
filesSettings={filesSettings}
currentDeviceType={DeviceType.desktop}
socketSubscribers={socketHelper.socketSubscribers}
- headerLabel={t("Common:StartFilling")}
+ headerLabel={headerLabel}
submitButtonLabel={t("Common:CopyHere")}
onSubmit={onSubmit}
getIsDisabled={getIsDisabled}
diff --git a/packages/doceditor/src/hooks/useShareDialog.ts b/packages/doceditor/src/hooks/useShareDialog.ts
index de13b29105..899a71e33a 100644
--- a/packages/doceditor/src/hooks/useShareDialog.ts
+++ b/packages/doceditor/src/hooks/useShareDialog.ts
@@ -25,13 +25,23 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import React from "react";
+import { useTranslation } from "react-i18next";
-const useShareDialog = () => {
+import type { IInitialConfig } from "@/types";
+
+const useShareDialog = (
+ config: IInitialConfig | undefined,
+ onSDKRequestStartFilling: (headerLabel: string) => void,
+) => {
+ const { t } = useTranslation(["Common"]);
const [isVisible, setIsVisible] = React.useState(false);
const onSDKRequestSharingSettings = React.useCallback(() => {
+ if (config?.startFilling)
+ return onSDKRequestStartFilling(t("Common:ShareToFillOut"));
+
setIsVisible(true);
- }, []);
+ }, [config?.startFilling, onSDKRequestStartFilling, t]);
const onClose = React.useCallback(() => {
setIsVisible(false);
@@ -45,4 +55,3 @@ const useShareDialog = () => {
};
export default useShareDialog;
-
diff --git a/packages/doceditor/src/hooks/useStartFillingSelectDialog.ts b/packages/doceditor/src/hooks/useStartFillingSelectDialog.ts
index b5c401e1ef..fbdcd43897 100644
--- a/packages/doceditor/src/hooks/useStartFillingSelectDialog.ts
+++ b/packages/doceditor/src/hooks/useStartFillingSelectDialog.ts
@@ -41,7 +41,7 @@ import type { TRoomSecurity } from "@docspace/shared/api/rooms/types";
import type { TBreadCrumb } from "@docspace/shared/components/selector/Selector.types";
import type { TSelectedFileInfo } from "@docspace/shared/selectors/Files/FilesSelector.types";
import type { ConflictStateType } from "@/types";
-import { useTranslation } from "react-i18next";
+// import { useTranslation } from "react-i18next";
const DefaultConflictDataDialogState: ConflictStateType = {
visible: false,
@@ -52,7 +52,8 @@ const DefaultConflictDataDialogState: ConflictStateType = {
};
const useStartFillingSelectDialog = (fileInfo: TFile | undefined) => {
- const { t } = useTranslation(["Common"]);
+ // const { t } = useTranslation(["Common"]);
+ const [headerLabelSFSDialog, setHeaderLabelSFSDialog] = useState("");
const [isVisible, setIsVisible] = useState(false);
const [conflictDataDialog, setConflictDataDialog] = useState(
@@ -61,7 +62,8 @@ const useStartFillingSelectDialog = (fileInfo: TFile | undefined) => {
const requestRunning = useRef(false);
- const onSDKRequestStartFilling = useCallback((_: object) => {
+ const onSDKRequestStartFilling = useCallback((headerLabel: string) => {
+ setHeaderLabelSFSDialog(headerLabel);
setIsVisible(true);
}, []);
@@ -180,6 +182,7 @@ const useStartFillingSelectDialog = (fileInfo: TFile | undefined) => {
getIsDisabledStartFillingSelectDialog: getIsDisabled,
isVisibleStartFillingSelectDialog: isVisible,
conflictDataDialog,
+ headerLabelSFSDialog,
};
};
diff --git a/packages/doceditor/src/types/index.ts b/packages/doceditor/src/types/index.ts
index fa5d3206ca..846085d4bf 100644
--- a/packages/doceditor/src/types/index.ts
+++ b/packages/doceditor/src/types/index.ts
@@ -233,7 +233,7 @@ export type EditorProps = {
onSDKRequestSelectSpreadsheet?: (event: object) => void;
onSDKRequestSelectDocument?: (event: object) => void;
onSDKRequestReferenceSource?: (event: object) => void;
- onSDKRequestStartFilling?: (event: object) => void;
+ onSDKRequestStartFilling?: (haederLabel: string) => void;
};
export type TEventData = {
@@ -405,6 +405,7 @@ export type StartFillingSelectorDialogPprops = {
fileInfo: TFile;
isVisible: boolean;
onClose: VoidFunction;
+ headerLabel: string;
getIsDisabled: (
isFirstLoad: boolean,
diff --git a/packages/doceditor/src/utils/actions.ts b/packages/doceditor/src/utils/actions.ts
index 84842668c2..c162958520 100644
--- a/packages/doceditor/src/utils/actions.ts
+++ b/packages/doceditor/src/utils/actions.ts
@@ -77,7 +77,6 @@ export async function fileCopyAs(
enableExternalExt,
password,
}),
- false,
);
const file = await (await fetch(createFile)).json();
@@ -139,7 +138,6 @@ export async function createFile(
[["Content-Type", "application/json;charset=utf-8"]],
"POST",
JSON.stringify({ title, templateId, formId }),
- false,
);
const file = await (await fetch(createFile)).json();
@@ -311,7 +309,6 @@ export async function getUser(share?: string) {
[share ? ["Request-Token", share] : ["", ""]],
"GET",
undefined,
- false,
);
if (!cookie?.includes("asc_auth_key")) return undefined;
@@ -337,7 +334,6 @@ export async function getSettings(share?: string) {
[share ? ["Request-Token", share] : ["", ""]],
"GET",
undefined,
- false,
);
const settingsRes = await fetch(getSettings);
@@ -363,7 +359,6 @@ export async function checkFillFromDraft(
],
"POST",
JSON.stringify({ fileId: templateFileId }),
- false,
);
const response = await fetch(checkFillFormDraft);
@@ -389,7 +384,6 @@ export async function openEdit(
[share ? ["Request-Token", share] : ["", ""]],
"GET",
undefined,
- false,
);
const res = await fetch(getConfig);
@@ -452,7 +446,6 @@ export async function getEditorUrl(
[share ? ["Request-Token", share] : ["", ""]],
"GET",
undefined,
- false,
);
const res = await fetch(request);
diff --git a/packages/shared/enums/index.ts b/packages/shared/enums/index.ts
index 093b96b4d5..d2e60e618e 100644
--- a/packages/shared/enums/index.ts
+++ b/packages/shared/enums/index.ts
@@ -474,12 +474,12 @@ export const enum ErrorKeys {
}
export enum RoomsType {
+ PublicRoom = 6,
FormRoom = 1,
// FillingFormsRoom= 1, //TODO: Restore when certs will be done
EditingRoom = 2,
// ReviewRoom: 3, //TODO: Restore when certs will be done
// ReadOnlyRoom: 4, //TODO: Restore when certs will be done
- PublicRoom = 6,
CustomRoom = 5,
}
diff --git a/packages/shared/utils/next-ssr-helper.ts b/packages/shared/utils/next-ssr-helper.ts
index 1a2a1a2e47..c26e64c6d2 100644
--- a/packages/shared/utils/next-ssr-helper.ts
+++ b/packages/shared/utils/next-ssr-helper.ts
@@ -24,7 +24,7 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
-import { headers } from "next/headers";
+import { headers, cookies } from "next/headers";
const API_PREFIX = "api/2.0";
@@ -39,12 +39,8 @@ export const getBaseUrl = () => {
return baseURL;
};
-export const getAPIUrl = (internalRequest: boolean) => {
- const baseUrl = internalRequest
- ? process.env.API_HOST?.trim() ?? getBaseUrl()
- : getBaseUrl();
-
- // const baseUrl = getBaseUrl();
+export const getAPIUrl = () => {
+ const baseUrl = process.env.API_HOST?.trim() ?? getBaseUrl();
const baseAPIUrl = `${baseUrl}/${API_PREFIX}`;
@@ -56,11 +52,11 @@ export const createRequest = (
newHeaders: [string, string][],
method: string,
body?: string,
- internalRequest: boolean = true,
) => {
const hdrs = new Headers(headers());
+ const cookieStore = cookies();
- const apiURL = getAPIUrl(internalRequest);
+ const apiURL = getAPIUrl();
newHeaders.forEach((hdr) => {
if (hdr[0]) hdrs.set(hdr[0], hdr[1]);
@@ -70,6 +66,10 @@ export const createRequest = (
if (baseURL && process.env.API_HOST?.trim()) hdrs.set("origin", baseURL);
+ const authToken = cookieStore.get("asc_auth_key")?.value;
+
+ if (authToken) hdrs.set("Authorization", authToken);
+
const urls = paths.map((path) => `${apiURL}${path}`);
const requests = urls.map(
diff --git a/public/locales/en/Common.json b/public/locales/en/Common.json
index b4f7f3b5e9..3d6d2d49b7 100644
--- a/public/locales/en/Common.json
+++ b/public/locales/en/Common.json
@@ -14,6 +14,7 @@
"AddUsers": "Add users",
"AdvancedFilter": "Search options",
"Alert": "Alert",
+ "Anonymous": "Anonymous",
"AnyoneWithLink": "Anyone with the link",
"ApplyButton": "Apply",
"Archive": "Archive",
@@ -52,6 +53,10 @@
"CommonFiles": "Common files",
"CompanyName": "Company name",
"Confirmation": "Confirmation",
+ "ConflictResolveDescription": "The file with the name <1>{{file}}1> already exists in the folder <1>{{folder}}1>.",
+ "ConflictResolveDescriptionFiles": "{{filesCount}} documents with the same name already exist in the folder <1>{{folder}}1>.",
+ "ConflictResolveSelectAction": "Please select the action:",
+ "ConflictResolveTitle": "Overwrite confirmation",
"Connect": "Connect",
"Content": "Content",
"Context": "Context",
@@ -65,6 +70,7 @@
"Create": "Create",
"CreateAndCopy": "Create and copy",
"CreateCopy": "Create copy",
+ "CreateDescription": "There will be two different files in the folder.",
"CreateFileCopy": "Create file copy",
"CreateMasterFormFromFile": "Create Form Template from file",
"CreatePDFForm": "Create PDF Form",
@@ -176,13 +182,13 @@
"ExpiredLink": "Expired link",
"FeedbackAndSupport": "Feedback & Support",
"Fill": "Fill out",
- "FillFormButton": "Fill in the form",
+ "FillFormButton": "Fill",
"FillingFormRooms": "Filling form",
"FillingFormsRoomDescription": "Build, share and fill document templates or work with the ready presets to quickly create documents of any type.",
"FillingFormsRoomTitle": "Filling forms room",
"Finish": "Finish",
"FirstName": "First name",
- "FormFilingRoomDescription": "Invite users to fill out a ready PDF form. Check the complete forms and analyze data automatically collected in a spreadsheet.",
+ "FormFilingRoomDescription": "Upload PDF forms into the room. Invite users to fill out a PDF form. Review completed forms and analyze data automatically collected in a spreadsheet.",
"FormFilingRoomTitle": "Form Filling Room",
"FormRoom": "Form room",
"Free": "Free",
@@ -270,8 +276,8 @@
"Name": "Name",
"NeedPassword": "You need a password to access the room",
"NewDocument": "New document",
- "NewFolder": "New folder",
"NewFillingFormRoom": "New Filling form room",
+ "NewFolder": "New folder",
"NewMasterForm": "New form template",
"NewPresentation": "New presentation",
"NewRoom": "New room",
@@ -293,6 +299,8 @@
"orContinueWith": "or continue with",
"OtherLabel": "Other",
"OtherOperations": "Other operations",
+ "OverwriteDescription": "The new file will replace the existing one as a new version.",
+ "OverwriteTitle": "Overwrite with version update",
"Owner": "Owner",
"PageOfTotalPage": "{{page}} of {{totalPage}}",
"Pages": "Pages",
@@ -328,8 +336,6 @@
"ProviderSsoSetting": "Single sign-on",
"ProviderTwitter": "Twitter",
"ProviderZoom": "Zoom",
- "PublicRoom": "Public room",
- "PublicRoomDescription": "Invite users via external links to view documents without registration. You can also embed this room into any web interface.",
"PublicLink": "Public link",
"PublicRoom": "Public room",
"PublicRoomDescription": "Invite users via external links to view documents without registration. You can also embed this room into any web interface.",
@@ -399,6 +405,7 @@
"ShareDocument": "Share this document",
"ShareDocumentDescription": "Provide access to the document and set the permission levels.",
"SharedWithMe": "Shared with me",
+ "ShareToFillOut": "Share to fill out",
"ShareVia": "Share via",
"ShowMore": "Show more",
"SignInWithApple": "Sign in with Apple",
@@ -419,6 +426,8 @@
"SignUpWithZoom": "Sign up with Zoom",
"Size": "Size",
"SizeImageLarge": "The image size is too large, please select another image.",
+ "SkipDescription": "No file will be copied. The original file will be retained in the destination folder.",
+ "SkipTitle": "Skip",
"SomethingWentWrong": "Something went wrong.",
"SortBy": "Sort by",
"SpaceManagement": "Space Management",
@@ -477,14 +486,5 @@
"Website": "Website",
"Yes": "Yes",
"Yesterday": "Yesterday",
- "You": "You",
- "ConflictResolveDescription": "The file with the name <1>{{file}}1> already exists in the folder <1>{{folder}}1>.",
- "ConflictResolveDescriptionFiles": "{{filesCount}} documents with the same name already exist in the folder <1>{{folder}}1>.",
- "ConflictResolveSelectAction": "Please select the action:",
- "ConflictResolveTitle": "Overwrite confirmation",
- "CreateDescription": "There will be two different files in the folder.",
- "OverwriteDescription": "The new file will replace the existing one as a new version.",
- "OverwriteTitle": "Overwrite with version update",
- "SkipDescription": "No file will be copied. The original file will be retained in the destination folder.",
- "SkipTitle": "Skip"
+ "You": "You"
}