Skip to content

Commit

Permalink
feat: add options management in generic action
Browse files Browse the repository at this point in the history
  • Loading branch information
vhu-axelor committed Dec 16, 2024
1 parent 3721569 commit 00af2a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/apps/dms/src/hooks/use-dms-header-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ const useAttachedFilesGenericAction = () => {
useEffect(() => {
headerActionsProvider.registerGenericAction(
'attached_files_generic_action',
async ({model, modelId}) =>
async ({model, modelId, options}) =>
await getAction({
model,
modelId,
options,
isFolderCreationAllowed: mobileSettings?.isFolderCreationAllowed,
navigation,
translator: I18n.t,
Expand Down
3 changes: 3 additions & 0 deletions packages/apps/dms/src/utils/attachedFilesGenericAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {countAttachedFiles, fetchDirectory} from '../api/document-api';
interface getActionProps {
model: string;
modelId: number;
options: any;
isFolderCreationAllowed: boolean;
navigation: any;
translator: (key: string) => string;
Expand All @@ -30,6 +31,7 @@ interface getActionProps {
export const getAction = async ({
model,
modelId,
options,
isFolderCreationAllowed,
navigation,
translator,
Expand Down Expand Up @@ -64,5 +66,6 @@ export const getAction = async ({
}),
showInHeader: true,
hideIf: !directory && !isFolderCreationAllowed,
...options,
};
};

0 comments on commit 00af2a1

Please sign in to comment.