[arvados-workbench2] updated: 2.7.0-197-ge5a42b59
git repository hosting
git at public.arvados.org
Tue Nov 14 16:25:08 UTC 2023
Summary of changes:
src/components/multiselect-toolbar/MultiselectToolbar.tsx | 11 +++++------
.../multiselect-toolbar/ms-kind-action-differentiator.ts | 6 +++---
.../multiselect-toolbar/ms-toolbar-action-filters.ts | 4 ++--
.../context-menu/context-menu-action-set.ts | 4 ++--
.../multiselect-toolbar/ms-project-action-set.ts | 15 ++++++---------
5 files changed, 18 insertions(+), 22 deletions(-)
via e5a42b5917f815fa09b8e271ebc04c0c42b2d891 (commit)
from 1d5fd6f8997bb6f06c8ed62dc01905566cbe135e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit e5a42b5917f815fa09b8e271ebc04c0c42b2d891
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Tue Nov 14 11:25:04 2023 -0500
21128: cleanup, renamed some types Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/components/multiselect-toolbar/MultiselectToolbar.tsx b/src/components/multiselect-toolbar/MultiselectToolbar.tsx
index a8a3f7a8..4ba9e25d 100644
--- a/src/components/multiselect-toolbar/MultiselectToolbar.tsx
+++ b/src/components/multiselect-toolbar/MultiselectToolbar.tsx
@@ -13,8 +13,7 @@ import { ContextMenuResource } from "store/context-menu/context-menu-actions";
import { Resource, extractUuidKind } from "models/resource";
import { getResource } from "store/resources/resources";
import { ResourcesState } from "store/resources/resources";
-import { ContextMenuAction, ContextMenuActionSet, DynamicContextMenuAction } from "views-components/context-menu/context-menu-action-set";
-import { RestoreFromTrashIcon, TrashIcon } from "components/icon/icon";
+import { ContextMenuAction, ContextMenuActionSet, MultiSelectMenuAction } from "views-components/context-menu/context-menu-action-set";
import { multiselectActionsFilters, TMultiselectActionsFilters, contextMenuActionConsts } from "./ms-toolbar-action-filters";
import { kindToActionSet, findActionByName } from "./ms-kind-action-differentiator";
import { msToggleTrashAction } from "views-components/multiselect-toolbar/ms-project-action-set";
@@ -70,12 +69,12 @@ export const MultiselectToolbar = connect(
btn.defaultText ? (
<Tooltip
className={classes.button}
- title={!currentPathIsTrash ? btn.defaultText: btn.altText}
+ title={!currentPathIsTrash ? btn.defaultText : btn.altText}
key={i}
disableFocusListener
>
<IconButton onClick={() => props.executeMulti(btn, checkedList, props.resources)}>
- {currentPathIsTrash ? <RestoreFromTrashIcon /> : <TrashIcon />}
+ {!currentPathIsTrash ? btn.defaultIcon && btn.defaultIcon({}) : btn.altIcon && btn.altIcon({})}
</IconButton>
</Tooltip>
) : (
@@ -133,9 +132,9 @@ function filterActions(actionArray: ContextMenuActionSet, filters: Set<string>):
}
function selectActionsByKind(currentResourceKinds: Array<string>, filterSet: TMultiselectActionsFilters) {
- const rawResult: Set<DynamicContextMenuAction> = new Set();
+ const rawResult: Set<MultiSelectMenuAction> = new Set();
const resultNames = new Set();
- const allFiltersArray: DynamicContextMenuAction[][] = []
+ const allFiltersArray: MultiSelectMenuAction[][] = []
currentResourceKinds.forEach(kind => {
if (filterSet[kind]) {
const actions = filterActions(...filterSet[kind]);
diff --git a/src/components/multiselect-toolbar/ms-kind-action-differentiator.ts b/src/components/multiselect-toolbar/ms-kind-action-differentiator.ts
index 48c3af3c..2c617fdb 100644
--- a/src/components/multiselect-toolbar/ms-kind-action-differentiator.ts
+++ b/src/components/multiselect-toolbar/ms-kind-action-differentiator.ts
@@ -3,18 +3,18 @@
// SPDX-License-Identifier: AGPL-3.0
import { ResourceKind } from "models/resource";
-import { DynamicContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
+import { MultiSelectMenuActionSet } from "views-components/context-menu/context-menu-action-set";
import { msCollectionActionSet } from "views-components/multiselect-toolbar/ms-collection-action-set";
import { msProjectActionSet } from "views-components/multiselect-toolbar/ms-project-action-set";
import { msProcessActionSet } from "views-components/multiselect-toolbar/ms-process-action-set";
-export function findActionByName(name: string, actionSet: DynamicContextMenuActionSet) {
+export function findActionByName(name: string, actionSet: MultiSelectMenuActionSet) {
return actionSet[0].find(action => action.name === name);
}
const { COLLECTION, PROJECT, PROCESS } = ResourceKind;
-export const kindToActionSet: Record<string, DynamicContextMenuActionSet> = {
+export const kindToActionSet: Record<string, MultiSelectMenuActionSet> = {
[COLLECTION]: msCollectionActionSet,
[PROJECT]: msProjectActionSet,
[PROCESS]: msProcessActionSet,
diff --git a/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts b/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts
index 5ef29370..eb968e0f 100644
--- a/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts
+++ b/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts
@@ -3,12 +3,12 @@
// SPDX-License-Identifier: AGPL-3.0
import { ResourceKind } from "models/resource";
-import { DynamicContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
+import { MultiSelectMenuActionSet } from "views-components/context-menu/context-menu-action-set";
import { msCollectionActionSet } from "views-components/multiselect-toolbar/ms-collection-action-set";
import { msProjectActionSet } from "views-components/multiselect-toolbar/ms-project-action-set";
import { msProcessActionSet } from "views-components/multiselect-toolbar/ms-process-action-set";
-export type TMultiselectActionsFilters = Record<string, [DynamicContextMenuActionSet, Set<string>]>;
+export type TMultiselectActionsFilters = Record<string, [MultiSelectMenuActionSet, Set<string>]>;
export const contextMenuActionConsts = {
MAKE_A_COPY: "Make a copy",
diff --git a/src/views-components/context-menu/context-menu-action-set.ts b/src/views-components/context-menu/context-menu-action-set.ts
index db59b5f0..ba3eac1b 100644
--- a/src/views-components/context-menu/context-menu-action-set.ts
+++ b/src/views-components/context-menu/context-menu-action-set.ts
@@ -11,7 +11,7 @@ export interface ContextMenuAction extends ContextMenuItem {
execute(dispatch: Dispatch, resources: ContextMenuResource[], state?: any): void;
}
-export interface DynamicContextMenuAction extends ContextMenuAction {
+export interface MultiSelectMenuAction extends ContextMenuAction {
defaultText?: string
defaultIcon?: IconType
altText?: string
@@ -19,4 +19,4 @@ export interface DynamicContextMenuAction extends ContextMenuAction {
}
export type ContextMenuActionSet = Array<Array<ContextMenuAction>>;
-export type DynamicContextMenuActionSet = Array<Array<DynamicContextMenuAction>>;
+export type MultiSelectMenuActionSet = Array<Array<MultiSelectMenuAction>>;
diff --git a/src/views-components/multiselect-toolbar/ms-project-action-set.ts b/src/views-components/multiselect-toolbar/ms-project-action-set.ts
index 8d58f413..4e8c6f14 100644
--- a/src/views-components/multiselect-toolbar/ms-project-action-set.ts
+++ b/src/views-components/multiselect-toolbar/ms-project-action-set.ts
@@ -2,28 +2,25 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import { DynamicContextMenuActionSet, DynamicContextMenuAction } from "views-components/context-menu/context-menu-action-set";
+import { MultiSelectMenuAction } from "views-components/context-menu/context-menu-action-set";
import { MoveToIcon, Link } from "components/icon/icon";
import { openMoveProjectDialog } from "store/projects/project-move-actions";
-import { ToggleTrashAction } from "views-components/context-menu/actions/trash-action";
import { toggleProjectTrashed } from "store/trash/trash-actions";
import { copyToClipboardAction } from "store/open-in-new-tab/open-in-new-tab.actions";
-import { ToggleFavoriteAction } from "views-components/context-menu/actions/favorite-action";
import { toggleFavorite } from "store/favorites/favorites-actions";
import { favoritePanelActions } from "store/favorite-panel/favorite-panel-action";
import { AddFavoriteIcon, RemoveFavoriteIcon } from "components/icon/icon";
import { RestoreFromTrashIcon, TrashIcon } from "components/icon/icon";
-export const msToggleFavoriteAction: DynamicContextMenuAction = {
+export const msToggleFavoriteAction = {
name: "ToggleFavoriteAction",
defaultText: 'Add to Favorites',
altText: 'Remove from Favorites',
defaultIcon: AddFavoriteIcon,
altIcon: RemoveFavoriteIcon,
-
execute: (dispatch, resources) => {
- dispatch<any>(toggleFavorite(resources[0])).then(() => {
+ dispatch(toggleFavorite(resources[0])).then(() => {
dispatch(favoritePanelActions.REQUEST_ITEMS());
});
},
@@ -45,7 +42,7 @@ export const msMoveToAction = {
},
};
-export const msToggleTrashAction: DynamicContextMenuAction = {
+export const msToggleTrashAction = {
name: "ToggleTrashAction",
defaultText: 'Add to Trash',
altText: 'Restore from Trash',
@@ -53,9 +50,9 @@ export const msToggleTrashAction: DynamicContextMenuAction = {
altIcon: RestoreFromTrashIcon,
execute: (dispatch, resources) => {
for (const resource of [...resources]) {
- dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!, resources.length > 1));
+ dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!, resources.length > 1));
}
},
};
-export const msProjectActionSet: DynamicContextMenuAction[][] = [[msCopyToClipboardMenuAction, msMoveToAction, msToggleTrashAction, msToggleFavoriteAction]];
+export const msProjectActionSet: MultiSelectMenuAction[][] = [[msCopyToClipboardMenuAction, msMoveToAction, msToggleTrashAction, msToggleFavoriteAction]];
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list