diff --git a/browser/data-browser/src/components/ResourceContextMenu/index.tsx b/browser/data-browser/src/components/ResourceContextMenu/index.tsx index 127cd38f8..c4edd1502 100644 --- a/browser/data-browser/src/components/ResourceContextMenu/index.tsx +++ b/browser/data-browser/src/components/ResourceContextMenu/index.tsx @@ -1,6 +1,6 @@ import React, { useCallback } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; -import { Client, properties, useResource, useStore } from '@tomic/react'; +import { Client, core, useResource, useStore } from '@tomic/react'; import { editURL, dataURL, @@ -57,6 +57,7 @@ export interface ResourceContextMenuProps { bindActive?: (active: boolean) => void; /** Callback that is called after the resource was deleted */ onAfterDelete?: () => void; + title?: string; } /** Dropdown menu that opens a bunch of actions for some resource */ @@ -66,6 +67,7 @@ function ResourceContextMenu({ trigger, simple, isMainMenu, + title, bindActive, onAfterDelete, }: ResourceContextMenuProps) { @@ -80,7 +82,7 @@ function ResourceContextMenu({ // Try to not have a useResource hook in here, as that will lead to many costly fetches when the user enters a new subject const handleDestroy = useCallback(async () => { - const parent = resource.get(properties.parent); + const parent = resource.get(core.properties.parent); try { await resource.destroy(store); @@ -187,7 +189,12 @@ function ResourceContextMenu({ ) : items; - const triggerComp = trigger ?? buildDefaultTrigger(); + const triggerComp = + trigger ?? + buildDefaultTrigger( + , + title ?? `Open ${resource.title} menu`, + ); return ( <> diff --git a/browser/data-browser/src/components/forms/NewForm/NewFormDialog.tsx b/browser/data-browser/src/components/forms/NewForm/NewFormDialog.tsx index 6b620f3dd..1f05548f0 100644 --- a/browser/data-browser/src/components/forms/NewForm/NewFormDialog.tsx +++ b/browser/data-browser/src/components/forms/NewForm/NewFormDialog.tsx @@ -14,7 +14,7 @@ import { useNewForm } from './useNewForm'; import { getNamePartFromProps } from '../../../helpers/getNamePartFromProps'; export interface NewFormDialogProps extends NewFormProps { - closeDialog: () => void; + closeDialog: (success?: boolean) => void; initialProps?: Record; onSave: (subject: string) => void; parent: string; @@ -43,7 +43,7 @@ export const NewFormDialog = ({ const onResourceSave = useCallback(() => { onSave(resource.getSubject()); - closeDialog(); + closeDialog(true); }, [onSave, closeDialog, resource]); // Onmount we generate a new subject based on the classtype and the user input. @@ -95,7 +95,7 @@ export const NewFormDialog = ({ {error && {error.message}} -