feat: Enable 'new document' action
This commit is contained in:
@@ -33,6 +33,7 @@ export const createCollection = createAction({
|
|||||||
name: ({ t }) => t("New collection"),
|
name: ({ t }) => t("New collection"),
|
||||||
section: CollectionSection,
|
section: CollectionSection,
|
||||||
icon: <PlusIcon />,
|
icon: <PlusIcon />,
|
||||||
|
keywords: "create",
|
||||||
visible: ({ stores }) =>
|
visible: ({ stores }) =>
|
||||||
stores.policies.abilities(stores.auth.team?.id || "").createCollection,
|
stores.policies.abilities(stores.auth.team?.id || "").createCollection,
|
||||||
perform: ({ t, event }) => {
|
perform: ({ t, event }) => {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export const openDocument = createAction({
|
|||||||
name: ({ t }) => t("Open document"),
|
name: ({ t }) => t("Open document"),
|
||||||
section: DocumentSection,
|
section: DocumentSection,
|
||||||
shortcut: ["o", "d"],
|
shortcut: ["o", "d"],
|
||||||
|
keywords: "go to",
|
||||||
icon: <DocumentIcon />,
|
icon: <DocumentIcon />,
|
||||||
children: ({ stores }) => {
|
children: ({ stores }) => {
|
||||||
const paths = stores.collections.pathsToDocuments;
|
const paths = stores.collections.pathsToDocuments;
|
||||||
@@ -41,6 +42,7 @@ export const createDocument = createAction({
|
|||||||
name: ({ t }) => t("New document"),
|
name: ({ t }) => t("New document"),
|
||||||
section: DocumentSection,
|
section: DocumentSection,
|
||||||
icon: <NewDocumentIcon />,
|
icon: <NewDocumentIcon />,
|
||||||
|
keywords: "create",
|
||||||
visible: ({ activeCollectionId, stores }) =>
|
visible: ({ activeCollectionId, stores }) =>
|
||||||
!!activeCollectionId &&
|
!!activeCollectionId &&
|
||||||
stores.policies.abilities(activeCollectionId).update,
|
stores.policies.abilities(activeCollectionId).update,
|
||||||
@@ -52,6 +54,7 @@ export const importDocument = createAction({
|
|||||||
name: ({ t }) => t("Import document"),
|
name: ({ t }) => t("Import document"),
|
||||||
section: DocumentSection,
|
section: DocumentSection,
|
||||||
icon: <ImportIcon />,
|
icon: <ImportIcon />,
|
||||||
|
keywords: "upload",
|
||||||
visible: ({ activeCollectionId, stores }) =>
|
visible: ({ activeCollectionId, stores }) =>
|
||||||
!!activeCollectionId &&
|
!!activeCollectionId &&
|
||||||
stores.policies.abilities(activeCollectionId).update,
|
stores.policies.abilities(activeCollectionId).update,
|
||||||
@@ -87,4 +90,8 @@ export const importDocument = createAction({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const rootDocumentActions = [openDocument, importDocument];
|
export const rootDocumentActions = [
|
||||||
|
openDocument,
|
||||||
|
createDocument,
|
||||||
|
importDocument,
|
||||||
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user