fix: Include notice on where collection exports end up
This commit is contained in:
@@ -36,6 +36,24 @@ export const createTestUsers = createAction({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const createToast = createAction({
|
||||||
|
name: "Create toast",
|
||||||
|
section: DeveloperSection,
|
||||||
|
visible: () => env.ENVIRONMENT === "development",
|
||||||
|
perform: async () => {
|
||||||
|
stores.toasts.showToast("Hello world", {
|
||||||
|
type: "info",
|
||||||
|
timeout: 30000,
|
||||||
|
action: {
|
||||||
|
text: "Click me",
|
||||||
|
onClick: () => {
|
||||||
|
stores.toasts.showToast("Clicked!");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const toggleDebugLogging = createAction({
|
export const toggleDebugLogging = createAction({
|
||||||
name: ({ t }) => t("Toggle debug logging"),
|
name: ({ t }) => t("Toggle debug logging"),
|
||||||
icon: <ToolsIcon />,
|
icon: <ToolsIcon />,
|
||||||
@@ -56,7 +74,7 @@ export const developer = createAction({
|
|||||||
icon: <ToolsIcon />,
|
icon: <ToolsIcon />,
|
||||||
iconInContextMenu: false,
|
iconInContextMenu: false,
|
||||||
section: DeveloperSection,
|
section: DeveloperSection,
|
||||||
children: [clearIndexedDB, toggleDebugLogging, createTestUsers],
|
children: [clearIndexedDB, toggleDebugLogging, createToast, createTestUsers],
|
||||||
});
|
});
|
||||||
|
|
||||||
export const rootDeveloperActions = [developer];
|
export const rootDeveloperActions = [developer];
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import env from "~/env";
|
|||||||
import useCurrentUser from "~/hooks/useCurrentUser";
|
import useCurrentUser from "~/hooks/useCurrentUser";
|
||||||
import useStores from "~/hooks/useStores";
|
import useStores from "~/hooks/useStores";
|
||||||
import useToasts from "~/hooks/useToasts";
|
import useToasts from "~/hooks/useToasts";
|
||||||
|
import history from "~/utils/history";
|
||||||
|
import { settingsPath } from "~/utils/routeHelpers";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
collection?: Collection;
|
collection?: Collection;
|
||||||
@@ -46,11 +48,25 @@ function ExportDialog({ collection, onSubmit }: Props) {
|
|||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
if (collection) {
|
if (collection) {
|
||||||
await collection.export(format, includeAttachments);
|
await collection.export(format, includeAttachments);
|
||||||
|
showToast(
|
||||||
|
t(`Your file will be available in {{ location }} soon`, {
|
||||||
|
location: `"${t("Settings")} > ${t("Export")}"`,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
type: "success",
|
||||||
|
action: {
|
||||||
|
text: t("Go to exports"),
|
||||||
|
onClick: () => {
|
||||||
|
history.push(settingsPath("export"));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
await collections.export(format, includeAttachments);
|
await collections.export(format, includeAttachments);
|
||||||
|
showToast(t("Export started"), { type: "success" });
|
||||||
}
|
}
|
||||||
onSubmit();
|
onSubmit();
|
||||||
showToast(t("Export started"), { type: "success" });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
|
|||||||
@@ -191,6 +191,8 @@
|
|||||||
"{{userName}} published": "{{userName}} published",
|
"{{userName}} published": "{{userName}} published",
|
||||||
"{{userName}} unpublished": "{{userName}} unpublished",
|
"{{userName}} unpublished": "{{userName}} unpublished",
|
||||||
"{{userName}} moved": "{{userName}} moved",
|
"{{userName}} moved": "{{userName}} moved",
|
||||||
|
"Your file will be available in {{ location }} soon": "Your file will be available in {{ location }} soon",
|
||||||
|
"Go to exports": "Go to exports",
|
||||||
"Export started": "Export started",
|
"Export started": "Export started",
|
||||||
"A ZIP file containing the images, and documents in the Markdown format.": "A ZIP file containing the images, and documents in the Markdown format.",
|
"A ZIP file containing the images, and documents in the Markdown format.": "A ZIP file containing the images, and documents in the Markdown format.",
|
||||||
"A ZIP file containing the images, and documents as HTML files.": "A ZIP file containing the images, and documents as HTML files.",
|
"A ZIP file containing the images, and documents as HTML files.": "A ZIP file containing the images, and documents as HTML files.",
|
||||||
|
|||||||
Reference in New Issue
Block a user