import { Dispatch } from "redux";
import { FilterBuilder } from "~/common/api/filter-builder";
import { RootState } from "../store";
-import { checkPresenceInFavorites } from "../favorites/favorites-actions";
+import { updateFavorites } from "../favorites/favorites-actions";
import { ServiceRepository } from "~/services/services";
- import { projectPanelActions } from "~/store/project-panel/project-panel-action";
- import { resourcesActions } from "~/store/resources/resources-actions";
- import { reset } from 'redux-form';
++import { resourcesActions } from '~/store/resources/resources-actions';
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<string>(),
TOGGLE_PROJECT_TREE_ITEM_ACTIVE: ofType<string>(),
RESET_PROJECT_TREE_ACTIVITY: ofType<string>()
-}, {
- tag: 'type',
- value: 'payload'
});
- export const PROJECT_FORM_NAME = 'projectEditDialog';
-
- export const getProjectList = (parentUuid: string = '') =>
+ export const getProjectList = (parentUuid: string = '') =>
(dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
dispatch(projectActions.PROJECTS_REQUEST(parentUuid));
return services.projectService.list({
.getFilters()
}).then(({ items: projects }) => {
dispatch(projectActions.PROJECTS_SUCCESS({ projects, parentItemId: parentUuid }));
- dispatch<any>(checkPresenceInFavorites(projects.map(project => project.uuid)));
+ dispatch<any>(updateFavorites(projects.map(project => project.uuid)));
++ dispatch<any>(resourcesActions.SET_RESOURCES(projects));
return projects;
});
};
//
// SPDX-License-Identifier: AGPL-3.0
- import { initialize } from "redux-form";
-import { reset, initialize } from "redux-form";
-
import { ContextMenuActionSet } from "../context-menu-action-set";
- import { projectActions, PROJECT_FORM_NAME, openProjectCreator } from '~/store/project/project-action';
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 { openMoveProjectDialog } from '~/store/move-project-dialog/move-project-dialog';
- import { openProjectCopyDialog } from "~/views-components/project-copy-dialog/project-copy-dialog";
+ import { openMoveProjectDialog } from '~/store/projects/project-move-actions';
-import { PROJECT_CREATE_FORM_NAME, openProjectCreateDialog } from '~/store/projects/project-create-actions';
++import { openProjectCreateDialog } from '~/store/projects/project-create-actions';
+ import { openProjectUpdateDialog } from '~/store/projects/project-update-actions';
export const projectActionSet: ContextMenuActionSet = [[
{
icon: NewProjectIcon,
name: "New project",
- execute: (dispatch, resource) => dispatch<any>(openProjectCreator(resource.uuid))
+ execute: (dispatch, resource) => {
- dispatch(reset(PROJECT_CREATE_FORM_NAME));
+ dispatch<any>(openProjectCreateDialog(resource.uuid));
+ }
},
{
icon: RenameIcon,
//
// SPDX-License-Identifier: AGPL-3.0
--import { reset } from "redux-form";
--
import { ContextMenuActionSet } from "../context-menu-action-set";
- import { openProjectCreator } from "~/store/project/project-action";
- import { collectionCreateActions } from "~/store/collections/creator/collection-creator-action";
- import { COLLECTION_CREATE_DIALOG } from "../../dialog-create/dialog-collection-create";
-import { projectActions } from "~/store/project/project-action";
-import { COLLECTION_CREATE_FORM_NAME, openCollectionCreateDialog } from '~/store/collections/collection-create-actions';
++import { openCollectionCreateDialog } from '~/store/collections/collection-create-actions';
import { NewProjectIcon, CollectionIcon } from "~/components/icon/icon";
-import { PROJECT_CREATE_FORM_NAME, openProjectCreateDialog } from '~/store/projects/project-create-actions';
++import { openProjectCreateDialog } from '~/store/projects/project-create-actions';
export const rootProjectActionSet: ContextMenuActionSet = [[
{
icon: NewProjectIcon,
name: "New project",
- execute: (dispatch, resource) => dispatch<any>(openProjectCreator(resource.uuid))
+ execute: (dispatch, resource) => {
- dispatch(reset(PROJECT_CREATE_FORM_NAME));
+ dispatch<any>(openProjectCreateDialog(resource.uuid));
+ }
},
{
icon: CollectionIcon,
name: "New Collection",
execute: (dispatch, resource) => {
- dispatch(reset(COLLECTION_CREATE_DIALOG));
- dispatch(collectionCreateActions.OPEN_COLLECTION_CREATOR({ ownerUuid: resource.uuid }));
- dispatch(reset(COLLECTION_CREATE_FORM_NAME));
+ dispatch<any>(openCollectionCreateDialog(resource.uuid));
}
}
]];
import { RootState } from "~/store/store";
import { ServiceRepository } from "~/services/services";
import { FilterBuilder } from "~/common/api/filter-builder";
+ import { WrappedFieldProps } from 'redux-form';
-type ProjectTreePickerProps = Pick<TreePickerProps, 'toggleItemActive' | 'toggleItemOpen'>;
+type ProjectTreePickerProps = Pick<TreePickerProps, 'onContextMenu' | 'toggleItemActive' | 'toggleItemOpen'>;
const mapDispatchToProps = (dispatch: Dispatch, props: { onChange: (projectUuid: string) => void }): ProjectTreePickerProps => ({
+ onContextMenu: () => { return; },
toggleItemActive: (nodeId, status, pickerId) => {
getNotSelectedTreePickerKind(pickerId)
.forEach(pickerId => dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_SELECT({ nodeId: '', pickerId })));
import { User } from "~/models/user";
import { RootState } from "~/store/store";
import { MainAppBar, MainAppBarActionProps, MainAppBarMenuItem } from '~/views-components/main-app-bar/main-app-bar';
-import { Breadcrumb } from '~/components/breadcrumbs/breadcrumbs';
import { push } from 'react-router-redux';
-import { reset } from 'redux-form';
-import { ProjectTree } from '~/views-components/project-tree/project-tree';
import { TreeItem } from "~/components/tree/tree";
-import { getTreePath } from '~/store/project/project-reducer';
-import { sidePanelActions } from '~/store/side-panel/side-panel-action';
-import { SidePanel, SidePanelItem } from '~/components/side-panel/side-panel';
-import { ItemMode, setProjectItem } from "~/store/navigation/navigation-action";
-import { projectActions } from "~/store/project/project-action";
+import { ProjectPanel } from "~/views/project-panel/project-panel";
import { DetailsPanel } from '~/views-components/details-panel/details-panel';
import { ArvadosTheme } from '~/common/custom-theme';
- import { CreateProjectDialog } from "~/views-components/create-project-dialog/create-project-dialog";
-
-import { detailsPanelActions, loadDetails } from "~/store/details-panel/details-panel-action";
-import { contextMenuActions } from "~/store/context-menu/context-menu-actions";
+import { detailsPanelActions } from "~/store/details-panel/details-panel-action";
import { ProjectResource } from '~/models/project';
-import { ResourceKind } from '~/models/resource';
-import { ContextMenu, ContextMenuKind } from "~/views-components/context-menu/context-menu";
+import { ContextMenu } from "~/views-components/context-menu/context-menu";
import { FavoritePanel } from "../favorite-panel/favorite-panel";
import { CurrentTokenDialog } from '~/views-components/current-token-dialog/current-token-dialog';
import { Snackbar } from '~/views-components/snackbar/snackbar';
- import { CreateCollectionDialog } from '~/views-components/create-collection-dialog/create-collection-dialog';
-import { favoritePanelActions } from '~/store/favorite-panel/favorite-panel-action';
import { CollectionPanel } from '../collection-panel/collection-panel';
- import { UpdateCollectionDialog } from '~/views-components/update-collection-dialog/update-collection-dialog.';
- import { UpdateProjectDialog } from '~/views-components/update-project-dialog/update-project-dialog';
-import { loadCollection, loadCollectionTags } from '~/store/collection-panel/collection-panel-action';
-import { getCollectionUrl } from '~/models/collection';
-
-import { PROJECT_CREATE_FORM_NAME, openProjectCreateDialog } from '~/store/projects/project-create-actions';
-import { COLLECTION_CREATE_FORM_NAME, openCollectionCreateDialog } from '~/store/collections/collection-create-actions';
-import { CreateCollectionDialog } from '~/views-components/dialog-forms/create-collection-dialog';
-import { UpdateCollectionDialog } from '~/views-components/dialog-forms/update-collection-dialog';
-import { CreateProjectDialog } from '~/views-components/dialog-forms/create-project-dialog';
-import { UpdateProjectDialog } from '~/views-components/dialog-forms/update-project-dialog';
-
-import { ProjectPanel } from "~/views/project-panel/project-panel";
import { AuthService } from "~/services/auth-service/auth-service";
import { RenameFileDialog } from '~/views-components/rename-file-dialog/rename-file-dialog';
import { FileRemoveDialog } from '~/views-components/file-remove-dialog/file-remove-dialog';
import { MultipleFilesRemoveDialog } from '~/views-components/file-remove-dialog/multiple-files-remove-dialog';
import { DialogCollectionCreateWithSelectedFile } from '~/views-components/create-collection-dialog-with-selected/create-collection-dialog-with-selected';
import { UploadCollectionFilesDialog } from '~/views-components/upload-collection-files-dialog/upload-collection-files-dialog';
- import { ProjectCopyDialog } from '~/views-components/project-copy-dialog/project-copy-dialog';
import { CollectionPartialCopyDialog } from '~/views-components/collection-partial-copy-dialog/collection-partial-copy-dialog';
- import { MoveProjectDialog } from '~/views-components/move-project-dialog/move-project-dialog';
- import { MoveCollectionDialog } from '~/views-components/move-collection-dialog/move-collection-dialog';
+import { SidePanel } from '~/views-components/side-panel/side-panel';
+import { Routes } from '~/routes/routes';
+import { Breadcrumbs } from '~/views-components/breadcrumbs/breadcrumbs';
++import { CreateProjectDialog } from '~/views-components/dialog-forms/create-project-dialog';
++import { CreateCollectionDialog } from '~/views-components/dialog-forms/create-collection-dialog';
++import { CopyCollectionDialog } from '~/views-components/dialog-forms/copy-collection-dialog';
++import { UpdateCollectionDialog } from '~/views-components/dialog-forms/update-collection-dialog';
++import { UpdateProjectDialog } from '~/views-components/dialog-forms/update-project-dialog';
+ import { MoveProjectDialog } from '~/views-components/dialog-forms/move-project-dialog';
+ import { MoveCollectionDialog } from '~/views-components/dialog-forms/move-collection-dialog';
-import { CopyCollectionDialog } from '~/views-components/dialog-forms/copy-collection-dialog';
-const DRAWER_WITDH = 240;
+
const APP_BAR_HEIGHT = 100;
-type CssRules = 'root' | 'appBar' | 'drawerPaper' | 'content' | 'contentWrapper' | 'toolbar';
+type CssRules = 'root' | 'appBar' | 'content' | 'contentWrapper';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
root: {