import { CategoriesListReducer } from 'common/plugintypes';
import { pluginConfig } from 'plugins';
import { LinkClass } from 'models/link';
+import { verifyAndUpdateLinkName } from 'common/link-update-name';
export enum SidePanelTreeCategory {
PROJECTS = 'Home Projects',
PUBLIC_FAVORITES = 'Public Favorites',
SHARED_WITH_ME = 'Shared with me',
ALL_PROCESSES = 'All Processes',
+ INSTANCE_TYPES = 'Instance Types',
SHELL_ACCESS = 'Shell Access',
GROUPS = 'Groups',
TRASH = 'Trash',
SidePanelTreeCategory.PUBLIC_FAVORITES,
SidePanelTreeCategory.SHARED_WITH_ME,
SidePanelTreeCategory.ALL_PROCESSES,
+ SidePanelTreeCategory.INSTANCE_TYPES,
SidePanelTreeCategory.SHELL_ACCESS,
SidePanelTreeCategory.GROUPS,
SidePanelTreeCategory.TRASH
};
const { items } = await services.projectService.list(params);
-
+
dispatch(treePickerActions.LOAD_TREE_PICKER_NODE_SUCCESS({
id: projectUuid,
pickerId: SIDE_PANEL_TREE,
limit: SIDEPANEL_TREE_NODE_LIMIT,
};
- const { items } = await services.linkService.list(params);
+ let items = (await services.linkService.list(params)).items;
+ for(let item of items) {
+ const verifiedName = await verifyAndUpdateLinkName(item, dispatch, getState, services);
+ item.name = verifiedName;
+ }
dispatch(
treePickerActions.LOAD_TREE_PICKER_NODE_SUCCESS({
limit: SIDEPANEL_TREE_NODE_LIMIT,
};
- const { items } = await services.linkService.list(params);
+ const items = (await services.linkService.list(params)).items;
+
+ const uuids = items.map(it => it.headUuid);
+ const groupItems: any = await services.groupsService.list({
+ filters: new FilterBuilder()
+ .addIn("uuid", uuids)
+ .addIsA("uuid", typeFilters)
+ .getFilters()
+ });
+ const collectionItems: any = await services.collectionService.list({
+ filters: new FilterBuilder()
+ .addIn("uuid", uuids)
+ .addIsA("uuid", typeFilters)
+ .getFilters()
+ });
+ const processItems: any = await services.containerRequestService.list({
+ filters: new FilterBuilder()
+ .addIn("uuid", uuids)
+ .addIsA("uuid", typeFilters)
+ .getFilters()
+ });
+
+ const filtereditems = groupItems.items.concat(collectionItems.items).concat(processItems.items);
+
+ for(const item of filtereditems) {
+ const verifiedName = await verifyAndUpdateLinkName(item, dispatch, getState, services);
+ item.name = verifiedName;
+ }
dispatch(
treePickerActions.LOAD_TREE_PICKER_NODE_SUCCESS({
id: SidePanelTreeCategory.PUBLIC_FAVORITES,
pickerId: SIDE_PANEL_TREE,
- nodes: items.map(item => initTreeNode({ id: item.headUuid, value: item })),
+ nodes: filtereditems.map(item => initTreeNode({ id: item.headUuid, value: item })),
})
);
- dispatch(resourcesActions.SET_RESOURCES(items));
+ dispatch(resourcesActions.SET_RESOURCES(filtereditems));
};
export const activateSidePanelTreeItem = (id: string) =>