--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Resource, ResourceKind } from "./resource";
+import { MountType } from "~/models/mount-types";
+import { RuntimeConstraints } from './runtime-constraints';
+import { SchedulingParameters } from './scheduling-parameters';
+
+export enum ContainerRequestState {
+ UNCOMMITTED = "Uncommitted",
+ COMMITTED = "Committed",
+ FINAL = "Final"
+}
+
+export interface ContainerRequestResource extends Resource {
+ kind: ResourceKind.CONTAINER_REQUEST;
+ name: string;
+ description: string;
+ properties: any;
+ state: ContainerRequestState;
+ requestingContainerUuid: string | null;
+ containerUuid: string | null;
+ containerCountMax: number;
+ mounts: MountType[];
+ runtimeConstraints: RuntimeConstraints;
+ schedulingParameters: SchedulingParameters;
+ containerImage: string;
+ environment: any;
+ cwd: string;
+ command: string[];
+ outputPath: string;
+ outputName: string;
+ outputTtl: number;
+ priority: number | null;
+ expiresAt: string;
+ useExisting: boolean;
+ logUuid: string | null;
+ outputUuid: string | null;
+ filters: string;
+}
//
// SPDX-License-Identifier: AGPL-3.0
-import { Resource, ResourceKind } from "./resource";
+import { ContainerRequestResource } from "./container-request";
-export enum ProcessState {
- UNCOMMITTED = "Uncommitted",
- COMMITTED = "Committed",
- FINAL = "Final"
-}
-
-export interface ProcessResource extends Resource {
- kind: ResourceKind.PROCESS;
- name: string;
- description: string;
- properties: any;
- state: ProcessState;
- requestingContainerUuid: string;
- containerUuid: string;
- containerCountMax: number;
- mounts: any;
- runtimeConstraints: any;
- schedulingParameters: any;
- containerImage: string;
- environment: any;
- cwd: string;
- command: string[];
- outputPath: string;
- outputName: string;
- outputTtl: number;
- priority: number;
- expiresAt: string;
- useExisting: boolean;
- logUuid: string;
- outputUuid: string;
- filters: string;
-}
+export type ProcessResource = ContainerRequestResource;
import { RootStore } from '~/store/store';
import { matchPath } from 'react-router';
import { ResourceKind, RESOURCE_UUID_PATTERN, extractUuidKind } from '~/models/resource';
-import { getProjectUrl } from '../models/project';
+import { getProjectUrl } from '~/models/project';
import { getCollectionUrl } from '~/models/collection';
-import { loadProject, loadFavorites, loadCollection } from '~/store/workbench/workbench-actions';
+import { loadProject, loadFavorites, loadCollection, loadTrash } from '~/store/workbench/workbench-actions';
import { loadProcess } from '~/store/processes/processes-actions';
export const Routes = {
COLLECTIONS: `/collections/:id(${RESOURCE_UUID_PATTERN})`,
PROCESSES: `/processes/:id(${RESOURCE_UUID_PATTERN})`,
FAVORITES: '/favorites',
+ TRASH: '/trash'
};
export const getResourceUrl = (uuid: string) => {
history.listen(handler);
};
+export interface ResourceRouteParams {
+ id: string;
+}
+
export const matchRootRoute = (route: string) =>
matchPath(route, { path: Routes.ROOT, exact: true });
export const matchFavoritesRoute = (route: string) =>
matchPath(route, { path: Routes.FAVORITES });
-export interface ResourceRouteParams {
- id: string;
-}
+export const matchTrashRoute = (route: string) =>
+ matchPath(route, { path: Routes.TRASH });
export const matchProjectRoute = (route: string) =>
matchPath<ResourceRouteParams>(route, { path: Routes.PROJECTS });
const projectMatch = matchProjectRoute(pathname);
const collectionMatch = matchCollectionRoute(pathname);
const favoriteMatch = matchFavoritesRoute(pathname);
+ const trashMatch = matchTrashRoute(pathname);
const processMatch = matchProcessRoute(pathname);
if (projectMatch) {
store.dispatch(loadProject(projectMatch.params.id));
store.dispatch(loadCollection(collectionMatch.params.id));
} else if (favoriteMatch) {
store.dispatch(loadFavorites());
+ } else if (trashMatch) {
+ store.dispatch(loadTrash());
} else if (processMatch) {
store.dispatch(loadProcess(processMatch.params.id));
}
import { UserService } from '../user-service/user-service';
import { GroupResource } from '~/models/group';
import { UserResource } from '~/models/user';
-import { extractUuidObjectType, ResourceObjectType } from "~/models/resource";
+import { extractUuidObjectType, ResourceObjectType, TrashResource } from "~/models/resource";
export class AncestorService {
constructor(
private userService: UserService
) { }
- async ancestors(uuid: string, rootUuid: string): Promise<Array<UserResource | GroupResource>> {
+ async ancestors(uuid: string, rootUuid: string): Promise<Array<UserResource | GroupResource | TrashResource>> {
const service = this.getService(extractUuidObjectType(uuid));
if (service) {
const resource = await service.get(uuid);
return undefined;
}
}
-}
\ No newline at end of file
+}
import { mapTreeValues } from "~/models/tree";
import { parseFilesResponse } from "./collection-service-files-response";
import { fileToArrayBuffer } from "~/common/file";
+import * as _ from 'lodash';
export type UploadProgress = (fileId: number, loaded: number, total: number, currentTime: number) => void;
})
.then(CommonResourceService.mapResponseKeys);
}
-
+
}
+++ /dev/null
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import { Dispatch } from "redux";
-import { RootState } from "~/store/store";
-import { ServiceRepository } from "~/services/services";
-import { snackbarActions } from "~/store/snackbar/snackbar-actions";
-import { sidePanelActions } from "~/store/side-panel/side-panel-action";
-import { SidePanelId } from "~/store/side-panel/side-panel-reducer";
-import { trashPanelActions } from "~/store/trash-panel/trash-panel-action";
-import { getProjectList, projectActions } from "~/store/project/project-action";
-
-export const toggleCollectionTrashed = (resource: { uuid: string; name: string, isTrashed?: boolean, ownerUuid?: string }) =>
- async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<any> => {
- dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Working..." }));
- if (resource.isTrashed) {
- return services.collectionService.untrash(resource.uuid).then(() => {
- dispatch<any>(getProjectList(resource.ownerUuid)).then(() => {
- dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelId.PROJECTS));
- dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN({ itemId: resource.ownerUuid!!, open: true, recursive: true }));
- });
- dispatch(trashPanelActions.REQUEST_ITEMS());
- dispatch(snackbarActions.CLOSE_SNACKBAR());
- dispatch(snackbarActions.OPEN_SNACKBAR({
- message: "Restored from trash",
- hideDuration: 2000
- }));
- });
- } else {
- return services.collectionService.trash(resource.uuid).then(() => {
- dispatch(snackbarActions.CLOSE_SNACKBAR());
- dispatch(snackbarActions.OPEN_SNACKBAR({
- message: "Added to trash",
- hideDuration: 2000
- }));
- });
- }
- };
description?: string;
kind: ContextMenuKind;
isTrashed?: boolean;
-}
+};
export const openContextMenu = (event: React.MouseEvent<HTMLElement>, resource: ContextMenuResource) =>
(dispatch: Dispatch) => {
+++ /dev/null
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-import { default as unionize, ofType, UnionOf } from "unionize";
-
-import { ProjectResource } from "~/models/project";
-import { Dispatch } from "redux";
-import { FilterBuilder } from "~/common/api/filter-builder";
-import { RootState } from "../store";
-import { checkPresenceInFavorites } from "../favorites/favorites-actions";
-import { ServiceRepository } from "~/services/services";
-import { projectPanelActions } from "~/store/project-panel/project-panel-action";
-import { updateDetails } from "~/store/details-panel/details-panel-action";
-import { snackbarActions } from "~/store/snackbar/snackbar-actions";
-import { trashPanelActions } from "~/store/trash-panel/trash-panel-action";
-import { sidePanelActions } from "~/store/side-panel/side-panel-action";
-import { SidePanelId } from "~/store/side-panel/side-panel-reducer";
-
-export const projectActions = unionize({
- OPEN_PROJECT_CREATOR: ofType<{ ownerUuid: string }>(),
- CLOSE_PROJECT_CREATOR: ofType<{}>(),
- CREATE_PROJECT: ofType<Partial<ProjectResource>>(),
- CREATE_PROJECT_SUCCESS: ofType<ProjectResource>(),
- OPEN_PROJECT_UPDATER: ofType<{ uuid: string}>(),
- CLOSE_PROJECT_UPDATER: ofType<{}>(),
- UPDATE_PROJECT_SUCCESS: ofType<ProjectResource>(),
- REMOVE_PROJECT: ofType<string>(),
- PROJECTS_REQUEST: ofType<string>(),
- PROJECTS_SUCCESS: ofType<{ projects: ProjectResource[], parentItemId?: string }>(),
- TOGGLE_PROJECT_TREE_ITEM_OPEN: ofType<{ itemId: string, open?: boolean, recursive?: boolean }>(),
- TOGGLE_PROJECT_TREE_ITEM_ACTIVE: ofType<{ itemId: string, active?: boolean, recursive?: boolean }>(),
- RESET_PROJECT_TREE_ACTIVITY: ofType<string>()
-}, {
- tag: 'type',
- value: 'payload'
-});
-
-export const PROJECT_FORM_NAME = 'projectEditDialog';
-
-export const getProjectList = (parentUuid: string = '') =>
- (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
- dispatch(projectActions.PROJECTS_REQUEST(parentUuid));
- return services.projectService.list({
- filters: new FilterBuilder()
- .addEqual("ownerUuid", parentUuid)
- .getFilters()
- }).then(({ items: projects }) => {
- dispatch(projectActions.PROJECTS_SUCCESS({ projects, parentItemId: parentUuid }));
- dispatch<any>(checkPresenceInFavorites(projects.map(project => project.uuid)));
- return projects;
- });
- };
-
-export const createProject = (project: Partial<ProjectResource>) =>
- (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
- const { ownerUuid } = getState().projects.creator;
- const projectData = { ownerUuid, ...project };
- dispatch(projectActions.CREATE_PROJECT(projectData));
- return services.projectService
- .create(projectData)
- .then(project => dispatch(projectActions.CREATE_PROJECT_SUCCESS(project)));
- };
-
-export const updateProject = (project: Partial<ProjectResource>) =>
- (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
- const { uuid } = getState().projects.updater;
- return services.projectService
- .update(uuid, project)
- .then(project => {
- dispatch(projectActions.UPDATE_PROJECT_SUCCESS(project));
- dispatch(projectPanelActions.REQUEST_ITEMS());
- dispatch<any>(getProjectList(project.ownerUuid));
- dispatch<any>(updateDetails(project));
- });
- };
-
-export const toggleProjectTrashed = (resource: { uuid: string; name: string, isTrashed?: boolean, ownerUuid?: string }) =>
- async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<any> => {
- dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Working..." }));
- if (resource.isTrashed) {
- return services.groupsService.untrash(resource.uuid).then(() => {
- dispatch<any>(getProjectList(resource.ownerUuid)).then(() => {
- dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelId.PROJECTS));
- dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN({ itemId: resource.ownerUuid!!, open: true, recursive: true }));
- });
- dispatch(trashPanelActions.REQUEST_ITEMS());
- dispatch(snackbarActions.CLOSE_SNACKBAR());
- dispatch(snackbarActions.OPEN_SNACKBAR({
- message: "Restored from trash",
- hideDuration: 2000
- }));
- });
- } else {
- return services.groupsService.trash(resource.uuid).then(() => {
- dispatch<any>(getProjectList(resource.ownerUuid)).then(() => {
- dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN({ itemId: resource.ownerUuid!!, open: true, recursive: true }));
- });
- dispatch(snackbarActions.CLOSE_SNACKBAR());
- dispatch(snackbarActions.OPEN_SNACKBAR({
- message: "Added to trash",
- hideDuration: 2000
- }));
- });
- }
- };
-
-export type ProjectAction = UnionOf<typeof projectActions>;
import { propertiesReducer } from './properties/properties-reducer';
import { RootState } from './store';
import { fileUploaderReducer } from './file-uploader/file-uploader-reducer';
+import { TrashPanelMiddlewareService } from "~/store/trash-panel/trash-panel-middleware-service";
+import { TRASH_PANEL_ID } from "~/store/trash-panel/trash-panel-action";
const composeEnhancers =
(process.env.NODE_ENV === 'development' &&
// SPDX-License-Identifier: AGPL-3.0
import { bindDataExplorerActions } from "../data-explorer/data-explorer-action";
+import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
export const TRASH_PANEL_ID = "trashPanel";
export const trashPanelActions = bindDataExplorerActions(TRASH_PANEL_ID);
+
+export const loadTrashPanel = () => trashPanelActions.REQUEST_ITEMS();
import { ServiceRepository } from "~/services/services";
import { SortDirection } from "~/components/data-table/data-column";
import { FilterBuilder } from "~/common/api/filter-builder";
-import { checkPresenceInFavorites } from "../favorites/favorites-actions";
import { trashPanelActions } from "./trash-panel-action";
import { Dispatch, MiddlewareAPI } from "redux";
import { OrderBuilder, OrderDirection } from "~/common/api/order-builder";
import { TrashPanelColumnNames, TrashPanelFilter } from "~/views/trash-panel/trash-panel";
import { ProjectResource } from "~/models/project";
import { ProjectPanelColumnNames } from "~/views/project-panel/project-panel";
+import { updateFavorites } from "~/store/favorites/favorites-actions";
export class TrashPanelMiddlewareService extends DataExplorerMiddlewareService {
constructor(private services: ServiceRepository, id: string) {
page: Math.floor(response.offset / response.limit),
rowsPerPage: response.limit
}));
- api.dispatch<any>(checkPresenceInFavorites(response.items.map(item => item.uuid)));
+ api.dispatch<any>(updateFavorites(response.items.map(item => item.uuid)));
})
.catch(() => {
api.dispatch(trashPanelActions.SET_ITEMS({
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Dispatch } from "redux";
+import { RootState } from "~/store/store";
+import { ServiceRepository } from "~/services/services";
+import { snackbarActions } from "~/store/snackbar/snackbar-actions";
+import { trashPanelActions } from "~/store/trash-panel/trash-panel-action";
+
+export const toggleProjectTrashed = (resource: { uuid: string; name: string, isTrashed?: boolean, ownerUuid?: string }) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<any> => {
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Working..." }));
+ if (resource.isTrashed) {
+ return services.groupsService.untrash(resource.uuid).then(() => {
+ // dispatch<any>(getProjectList(resource.ownerUuid)).then(() => {
+ // dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelId.PROJECTS));
+ // dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN({ itemId: resource.ownerUuid!!, open: true, recursive: true }));
+ // });
+ dispatch(trashPanelActions.REQUEST_ITEMS());
+ dispatch(snackbarActions.CLOSE_SNACKBAR());
+ dispatch(snackbarActions.OPEN_SNACKBAR({
+ message: "Restored from trash",
+ hideDuration: 2000
+ }));
+ });
+ } else {
+ return services.groupsService.trash(resource.uuid).then(() => {
+ // dispatch<any>(getProjectList(resource.ownerUuid)).then(() => {
+ // dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN({ itemId: resource.ownerUuid!!, open: true, recursive: true }));
+ // });
+ dispatch(snackbarActions.CLOSE_SNACKBAR());
+ dispatch(snackbarActions.OPEN_SNACKBAR({
+ message: "Added to trash",
+ hideDuration: 2000
+ }));
+ });
+ }
+ };
+
+export const toggleCollectionTrashed = (resource: { uuid: string; name: string, isTrashed?: boolean, ownerUuid?: string }) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<any> => {
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Working..." }));
+ if (resource.isTrashed) {
+ return services.collectionService.untrash(resource.uuid).then(() => {
+ // dispatch<any>(getProjectList(resource.ownerUuid)).then(() => {
+ // dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(SidePanelId.PROJECTS));
+ // dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN({ itemId: resource.ownerUuid!!, open: true, recursive: true }));
+ // });
+ dispatch(trashPanelActions.REQUEST_ITEMS());
+ dispatch(snackbarActions.CLOSE_SNACKBAR());
+ dispatch(snackbarActions.OPEN_SNACKBAR({
+ message: "Restored from trash",
+ hideDuration: 2000
+ }));
+ });
+ } else {
+ return services.collectionService.trash(resource.uuid).then(() => {
+ dispatch(snackbarActions.CLOSE_SNACKBAR());
+ dispatch(snackbarActions.OPEN_SNACKBAR({
+ message: "Added to trash",
+ hideDuration: 2000
+ }));
+ });
+ }
+ };
import * as collectionMoveActions from '~/store/collections/collection-move-actions';
import * as processesActions from '../processes/processes-actions';
import { getProcess } from '../processes/process';
+import { trashPanelColumns } from "~/views/trash-panel/trash-panel";
+import { loadTrashPanel, trashPanelActions } from "~/store/trash-panel/trash-panel-action";
export const loadWorkbench = () =>
if (userResource) {
dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns }));
+ dispatch(trashPanelActions.SET_COLUMNS({ columns: trashPanelColumns }));
dispatch<any>(initSidePanelTree());
if (router.location) {
const match = matchRootRoute(router.location.pathname);
dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.FAVORITES));
};
+export const loadTrash = () =>
+ (dispatch: Dispatch) => {
+ dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
+ dispatch<any>(loadTrashPanel());
+ dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.TRASH));
+ };
export const loadProject = (uuid: string) =>
async (dispatch: Dispatch) => {
if (currentProjectPanelUuid && matchingUuids.some(uuid => uuid === currentProjectPanelUuid)) {
dispatch<any>(loadProject(currentProjectPanelUuid));
}
- };
\ No newline at end of file
+ };
import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions';
import { openCollectionCopyDialog } from "~/store/collections/collection-copy-actions";
import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
-import { toggleCollectionTrashed } from "~/store/collections/collection-trash-actions";
+import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
export const collectionActionSet: ContextMenuActionSet = [[
{
import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions';
import { openCollectionCopyDialog } from '~/store/collections/collection-copy-actions';
+import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
export const collectionResourceActionSet: ContextMenuActionSet = [[
{
//
// SPDX-License-Identifier: AGPL-3.0
-import { reset, initialize } from "redux-form";
-
import { ContextMenuActionSet } from "../context-menu-action-set";
-import { projectActions, PROJECT_FORM_NAME, toggleProjectTrashed } from "~/store/project/project-action";
-import { NewProjectIcon, RenameIcon } from "~/components/icon/icon";
+import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon } from "~/components/icon/icon";
import { ToggleFavoriteAction } from "../actions/favorite-action";
import { toggleFavorite } from "~/store/favorites/favorites-actions";
import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
-import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create";
+import { openMoveProjectDialog } from '~/store/projects/project-move-actions';
+import { openProjectCreateDialog } from '~/store/projects/project-create-actions';
+import { openProjectUpdateDialog } from '~/store/projects/project-update-actions';
import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
+import { toggleProjectTrashed } from "~/store/trash/trash-actions";
export const projectActionSet: ContextMenuActionSet = [[
{
icon: NewProjectIcon,
name: "New project",
execute: (dispatch, resource) => {
- dispatch(reset(PROJECT_CREATE_DIALOG));
- dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
+ dispatch<any>(openProjectCreateDialog(resource.uuid));
}
},
{
icon: RenameIcon,
name: "Edit project",
execute: (dispatch, resource) => {
- dispatch(projectActions.OPEN_PROJECT_UPDATER({ uuid: resource.uuid }));
- dispatch(initialize(PROJECT_FORM_NAME, { name: resource.name, description: resource.description }));
+ dispatch<any>(openProjectUpdateDialog(resource));
}
},
{
execute: (dispatch, resource) => {
dispatch<any>(toggleProjectTrashed(resource));
}
- }
+ },
+ {
+ icon: MoveToIcon,
+ name: "Move to",
+ execute: (dispatch, resource) => dispatch<any>(openMoveProjectDialog(resource))
+ },
+ {
+ icon: CopyIcon,
+ name: "Copy to project",
+ execute: (dispatch, resource) => {
+ // add code
+ }
+ },
]];
import { DataColumns } from '~/components/data-table/data-table';
import { RouteComponentProps } from 'react-router';
import { DataTableFilterItem } from '~/components/data-table-filters/data-table-filters';
-import { ProcessState } from '~/models/process';
import { SortDirection } from '~/components/data-table/data-column';
import { ResourceKind } from '~/models/resource';
import { resourceLabel } from '~/common/labels';
import { ResourceFileSize, ResourceLastModifiedDate, ProcessStatus, ResourceType, ResourceOwner, ResourceName } from '~/views-components/data-explorer/renderers';
import { FavoriteIcon } from '~/components/icon/icon';
import { Dispatch } from 'redux';
-import { contextMenuActions, openContextMenu, resourceKindToContextMenuKind } from '~/store/context-menu/context-menu-actions';
-import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
-import { loadDetailsPanel } from '../../store/details-panel/details-panel-action';
+import { openContextMenu, resourceKindToContextMenuKind } from '~/store/context-menu/context-menu-actions';
+import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
import { navigateTo } from '~/store/navigation/navigation-action';
+import { ContainerRequestState } from "~/models/container-request";
type CssRules = "toolbar" | "button";
}
export interface FavoritePanelFilter extends DataTableFilterItem {
- type: ResourceKind | ProcessState;
+ type: ResourceKind | ContainerRequestState;
}
export const favoritePanelColumns: DataColumns<string, FavoritePanelFilter> = [
sortDirection: SortDirection.NONE,
filters: [
{
- name: ProcessState.COMMITTED,
+ name: ContainerRequestState.COMMITTED,
selected: true,
- type: ProcessState.COMMITTED
+ type: ContainerRequestState.COMMITTED
},
{
- name: ProcessState.FINAL,
+ name: ContainerRequestState.FINAL,
selected: true,
- type: ProcessState.FINAL
+ type: ContainerRequestState.FINAL
},
{
- name: ProcessState.UNCOMMITTED,
+ name: ContainerRequestState.UNCOMMITTED,
selected: true,
- type: ProcessState.UNCOMMITTED
+ type: ContainerRequestState.UNCOMMITTED
}
],
render: uuid => <ProcessStatus uuid={uuid} />,
import { RouteComponentProps } from 'react-router';
import { RootState } from '~/store/store';
import { DataTableFilterItem } from '~/components/data-table-filters/data-table-filters';
-import { ProcessState } from '~/models/process';
import { SortDirection } from '~/components/data-table/data-column';
import { ResourceKind } from '~/models/resource';
import { resourceLabel } from '~/common/labels';
import { ResourceFileSize, ResourceLastModifiedDate, ProcessStatus, ResourceType, ResourceOwner } from '~/views-components/data-explorer/renderers';
import { ProjectIcon } from '~/components/icon/icon';
import { ResourceName } from '~/views-components/data-explorer/renderers';
-import { ResourcesState, getResource } from '~/store/resources/resources';
+import { ResourcesState } from '~/store/resources/resources';
import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
-import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
-import { contextMenuActions, resourceKindToContextMenuKind, openContextMenu } from '~/store/context-menu/context-menu-actions';
-import { CollectionResource } from '~/models/collection';
-import { ProjectResource } from '~/models/project';
+import { resourceKindToContextMenuKind, openContextMenu } from '~/store/context-menu/context-menu-actions';
import { navigateTo } from '~/store/navigation/navigation-action';
import { getProperty } from '~/store/properties/properties';
import { PROJECT_PANEL_CURRENT_UUID } from '~/store/project-panel/project-panel-action';
import { openCollectionCreateDialog } from '../../store/collections/collection-create-actions';
import { openProjectCreateDialog } from '~/store/projects/project-create-actions';
+import { ContainerRequestState } from "~/models/container-request";
type CssRules = 'root' | "toolbar" | "button";
}
export interface ProjectPanelFilter extends DataTableFilterItem {
- type: ResourceKind | ProcessState;
+ type: ResourceKind | ContainerRequestState;
}
export const projectPanelColumns: DataColumns<string, ProjectPanelFilter> = [
sortDirection: SortDirection.NONE,
filters: [
{
- name: ProcessState.COMMITTED,
+ name: ContainerRequestState.COMMITTED,
selected: true,
- type: ProcessState.COMMITTED
+ type: ContainerRequestState.COMMITTED
},
{
- name: ProcessState.FINAL,
+ name: ContainerRequestState.FINAL,
selected: true,
- type: ProcessState.FINAL
+ type: ContainerRequestState.FINAL
},
{
- name: ProcessState.UNCOMMITTED,
+ name: ContainerRequestState.UNCOMMITTED,
selected: true,
- type: ProcessState.UNCOMMITTED
+ type: ContainerRequestState.UNCOMMITTED
}
],
render: uuid => <ProcessStatus uuid={uuid} />,
import { renderName, renderType, renderFileSize, renderDate } from '~/views-components/data-explorer/renderers';
import { TrashIcon } from '~/components/icon/icon';
import { TRASH_PANEL_ID } from "~/store/trash-panel/trash-panel-action";
+import { getProperty } from "~/store/properties/properties";
+import { PROJECT_PANEL_CURRENT_UUID } from "~/store/project-panel/project-panel-action";
type CssRules = "toolbar" | "button";
type: ResourceKind;
}
-export const columns: DataColumns<TrashPanelItem, TrashPanelFilter> = [
+export const trashPanelColumns: DataColumns<TrashPanelItem, TrashPanelFilter> = [
{
name: TrashPanelColumnNames.NAME,
selected: true,
onItemRouteChange: (itemId: string) => void;
}
-type TrashPanelProps = TrashPanelDataProps & TrashPanelActionProps & DispatchProp
- & WithStyles<CssRules> & RouteComponentProps<{ id: string }>;
+type TrashPanelProps = TrashPanelDataProps & TrashPanelActionProps & DispatchProp & WithStyles<CssRules>;
export const TrashPanel = withStyles(styles)(
- connect((state: RootState) => ({ currentItemId: state.projects.currentItemId }))(
+ connect((state: RootState) => ({
+ currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties),
+ resources: state.resources
+ }))(
class extends React.Component<TrashPanelProps> {
render() {
return <DataExplorer
id={TRASH_PANEL_ID}
- columns={columns}
onRowClick={this.props.onItemClick}
onRowDoubleClick={this.props.onItemDoubleClick}
onContextMenu={this.props.onContextMenu}
defaultMessages={['Your trash list is empty.']}/>
;
}
-
- componentWillReceiveProps({ match, currentItemId, onItemRouteChange }: TrashPanelProps) {
- if (match.params.id !== currentItemId) {
- onItemRouteChange(match.params.id);
- }
- }
}
)
);
import { PartialCopyCollectionDialog } from '~/views-components/dialog-forms/partial-copy-collection-dialog';
import { TrashPanel } from "~/views/trash-panel/trash-panel";
-import { trashPanelActions } from "~/store/trash-panel/trash-panel-action";
const APP_BAR_HEIGHT = 100;
<Route path={Routes.COLLECTIONS} component={CollectionPanel} />
<Route path={Routes.FAVORITES} component={FavoritePanel} />
<Route path={Routes.PROCESSES} component={ProcessPanel} />
- <Route path="/trash" render={this.renderTrashPanel} />
+ <Route path={Routes.TRASH} component={TrashPanel} />
</Switch>
</div>
{user && <DetailsPanel />}