+export const openCollectionFilesContextMenu = (event: React.MouseEvent<HTMLElement>) =>
+ (dispatch: Dispatch, getState: () => RootState) => {
+ const isCollectionFileSelected = JSON.stringify(getState().collectionPanelFiles).includes('"selected":true');
+ dispatch<any>(openContextMenu(event, {
+ name: '',
+ uuid: '',
+ ownerUuid: '',
+ kind: ResourceKind.COLLECTION,
+ menuKind: isCollectionFileSelected ? ContextMenuKind.COLLECTION_FILES : ContextMenuKind.COLLECTION_FILES_NOT_SELECTED
+ }));
+ };
+
+export const openRepositoryContextMenu = (event: React.MouseEvent<HTMLElement>, index: number, repository: RepositoryResource) =>
+ (dispatch: Dispatch, getState: () => RootState) => {
+ dispatch<any>(openContextMenu(event, {
+ name: '',
+ uuid: repository.uuid,
+ ownerUuid: repository.ownerUuid,
+ kind: ResourceKind.REPOSITORY,
+ menuKind: ContextMenuKind.REPOSITORY,
+ index
+ }));
+ };
+