Refactor actions (#8761)
Closes #8737 - Refactored actions by creating hooks to add the possibility to register actions programatically. - Small fixes from #8610 review - Fixed shortcuts display inside the command menu - Removed `actionMenuEntriesComponentState` and introduced `actionMenuEntriesComponentSelector`
This commit is contained in:
@ -4,15 +4,14 @@ import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/
|
||||
export const useContextStoreCurrentObjectMetadataIdOrThrow = (
|
||||
instanceId?: string,
|
||||
) => {
|
||||
const contextStoreCurrentObjectMetadataIdComponent =
|
||||
useRecoilComponentValueV2(
|
||||
contextStoreCurrentObjectMetadataIdComponentState,
|
||||
instanceId,
|
||||
);
|
||||
const contextStoreCurrentObjectMetadataId = useRecoilComponentValueV2(
|
||||
contextStoreCurrentObjectMetadataIdComponentState,
|
||||
instanceId,
|
||||
);
|
||||
|
||||
if (!contextStoreCurrentObjectMetadataIdComponent) {
|
||||
if (!contextStoreCurrentObjectMetadataId) {
|
||||
throw new Error('contextStoreCurrentObjectMetadataIdComponent is not set');
|
||||
}
|
||||
|
||||
return contextStoreCurrentObjectMetadataIdComponent;
|
||||
return contextStoreCurrentObjectMetadataId;
|
||||
};
|
||||
|
||||
@ -6,7 +6,7 @@ import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMeta
|
||||
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
|
||||
export const useContextStoreSelectedRecords = ({
|
||||
export const useFindManyRecordsSelectedInContextStore = ({
|
||||
instanceId,
|
||||
limit = 3,
|
||||
}: {
|
||||
Reference in New Issue
Block a user