[ARVADOS-WORKBENCH2] updated: 1.1.4-601-gd0bb82d
Git user
git at public.curoverse.com
Thu Aug 16 04:21:53 EDT 2018
Summary of changes:
src/store/collections/updater/collection-updater-action.ts | 2 ++
src/store/details-panel/details-panel-action.ts | 11 +++++++++++
src/store/details-panel/details-panel-reducer.ts | 1 -
src/store/project/project-action.ts | 3 ++-
src/store/project/project-reducer.test.ts | 1 +
.../update-project-dialog/update-project-dialog.tsx | 2 +-
src/views/collection-panel/collection-panel.tsx | 2 +-
7 files changed, 18 insertions(+), 4 deletions(-)
via d0bb82d15656ffe5240376de64b756496fce5639 (commit)
from eebf51242e597fd8430f1e92a5e9076b3d623ab5 (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 d0bb82d15656ffe5240376de64b756496fce5639
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date: Thu Aug 16 10:21:43 2018 +0200
store project - fix test, update panel details after edit resource, change label tag
Feature #13833
Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>
diff --git a/src/store/collections/updater/collection-updater-action.ts b/src/store/collections/updater/collection-updater-action.ts
index 25b2f37..2f520d4 100644
--- a/src/store/collections/updater/collection-updater-action.ts
+++ b/src/store/collections/updater/collection-updater-action.ts
@@ -11,6 +11,7 @@ import { CollectionResource } from '~/models/collection';
import { initialize } from 'redux-form';
import { collectionPanelActions } from "../../collection-panel/collection-panel-action";
import { ContextMenuResource } from "../../context-menu/context-menu-reducer";
+import { updateDetails } from "~/store/details-panel/details-panel-action";
export const collectionUpdaterActions = unionize({
OPEN_COLLECTION_UPDATER: ofType<{ uuid: string }>(),
@@ -40,6 +41,7 @@ export const updateCollection = (collection: Partial<CollectionResource>) =>
.then(collection => {
dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection as CollectionResource }));
dispatch(collectionUpdaterActions.UPDATE_COLLECTION_SUCCESS());
+ dispatch<any>(updateDetails(collection));
}
);
};
diff --git a/src/store/details-panel/details-panel-action.ts b/src/store/details-panel/details-panel-action.ts
index cadf517..b8021fb 100644
--- a/src/store/details-panel/details-panel-action.ts
+++ b/src/store/details-panel/details-panel-action.ts
@@ -12,6 +12,7 @@ export const detailsPanelActions = unionize({
TOGGLE_DETAILS_PANEL: ofType<{}>(),
LOAD_DETAILS: ofType<{ uuid: string, kind: ResourceKind }>(),
LOAD_DETAILS_SUCCESS: ofType<{ item: Resource }>(),
+ UPDATE_DETAILS: ofType<{ item: Resource }>()
}, { tag: 'type', value: 'payload' });
export type DetailsPanelAction = UnionOf<typeof detailsPanelActions>;
@@ -23,6 +24,16 @@ export const loadDetails = (uuid: string, kind: ResourceKind) =>
dispatch(detailsPanelActions.LOAD_DETAILS_SUCCESS({ item }));
};
+export const updateDetails = (item: Resource) =>
+ async (dispatch: Dispatch, getState: () => RootState) => {
+ const currentItem = getState().detailsPanel.item;
+ if (currentItem && (currentItem.uuid === item.uuid)) {
+ dispatch(detailsPanelActions.UPDATE_DETAILS({ item }));
+ dispatch(detailsPanelActions.LOAD_DETAILS_SUCCESS({ item }));
+ }
+ };
+
+
const getService = (services: ServiceRepository, kind: ResourceKind) => {
switch (kind) {
case ResourceKind.PROJECT:
diff --git a/src/store/details-panel/details-panel-reducer.ts b/src/store/details-panel/details-panel-reducer.ts
index adc31e4..f22add3 100644
--- a/src/store/details-panel/details-panel-reducer.ts
+++ b/src/store/details-panel/details-panel-reducer.ts
@@ -18,7 +18,6 @@ const initialState = {
export const detailsPanelReducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) =>
detailsPanelActions.match(action, {
default: () => state,
- LOAD_DETAILS: () => state,
LOAD_DETAILS_SUCCESS: ({ item }) => ({ ...state, item }),
TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened })
});
diff --git a/src/store/project/project-action.ts b/src/store/project/project-action.ts
index 7080090..96ad628 100644
--- a/src/store/project/project-action.ts
+++ b/src/store/project/project-action.ts
@@ -10,6 +10,7 @@ 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";
export const projectActions = unionize({
OPEN_PROJECT_CREATOR: ofType<{ ownerUuid: string }>(),
@@ -65,7 +66,7 @@ export const updateProject = (project: Partial<ProjectResource>) =>
dispatch(projectActions.UPDATE_PROJECT_SUCCESS(project));
dispatch(projectPanelActions.REQUEST_ITEMS());
dispatch<any>(getProjectList(project.ownerUuid));
- // ToDo: Update Panel Details
+ dispatch<any>(updateDetails(project));
});
};
diff --git a/src/store/project/project-reducer.test.ts b/src/store/project/project-reducer.test.ts
index d5963f3..bb60e39 100644
--- a/src/store/project/project-reducer.test.ts
+++ b/src/store/project/project-reducer.test.ts
@@ -127,6 +127,7 @@ describe('project-reducer', () => {
}],
currentItemId: "1",
creator: { opened: false, ownerUuid: "" },
+ updater: { opened: false, uuid: '' }
};
diff --git a/src/views-components/update-project-dialog/update-project-dialog.tsx b/src/views-components/update-project-dialog/update-project-dialog.tsx
index c455842..0ea23c8 100644
--- a/src/views-components/update-project-dialog/update-project-dialog.tsx
+++ b/src/views-components/update-project-dialog/update-project-dialog.tsx
@@ -22,7 +22,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
return dispatch<any>(editProject(data))
.catch((e: any) => {
if (e.errors) {
- throw new SubmissionError({ name: e.errors.join("").includes("UniqueViolation") ? "CProject with this name already exists." : "" });
+ throw new SubmissionError({ name: e.errors.join("").includes("UniqueViolation") ? "Project with this name already exists." : "" });
}
});
}
diff --git a/src/views/collection-panel/collection-panel.tsx b/src/views/collection-panel/collection-panel.tsx
index 5baa6d1..374cb95 100644
--- a/src/views/collection-panel/collection-panel.tsx
+++ b/src/views/collection-panel/collection-panel.tsx
@@ -100,7 +100,7 @@ export const CollectionPanel = withStyles(styles)(
</Card>
<Card className={classes.card}>
- <CardHeader title="Tags" />
+ <CardHeader title="Properties" />
<CardContent>
<Grid container direction="column">
<Grid item xs={12}><CollectionTagForm /></Grid>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list