[ARVADOS-WORKBENCH2] updated: 1.1.4-438-g83d2d86
Git user
git at public.curoverse.com
Mon Jul 30 07:12:56 EDT 2018
Summary of changes:
.../creator/collection-creator-reducer.test.ts | 44 +++++++++++++++++++++-
.../creator/collection-creator-reducer.ts | 8 ++--
src/store/project/project-reducer.test.ts | 13 +++----
src/store/project/project-reducer.ts | 4 +-
.../dialog-create/dialog-collection-create.tsx | 4 +-
.../dialog-create/dialog-project-create.tsx | 2 +-
6 files changed, 56 insertions(+), 19 deletions(-)
via 83d2d86a40a316eb332b9962f9fac2eae3259cc2 (commit)
from 46460de37ddbc61a296d3a393bce332d856664a6 (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 83d2d86a40a316eb332b9962f9fac2eae3259cc2
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Mon Jul 30 13:12:44 2018 +0200
collection-creation-test
Feature #13893
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/store/collections/creator/collection-creator-reducer.test.ts b/src/store/collections/creator/collection-creator-reducer.test.ts
index df2c362..0da18c8 100644
--- a/src/store/collections/creator/collection-creator-reducer.test.ts
+++ b/src/store/collections/creator/collection-creator-reducer.test.ts
@@ -1,3 +1,45 @@
// Copyright (C) The Arvados Authors. All rights reserved.
//
-// SPDX-License-Identifier: AGPL-3.0
\ No newline at end of file
+// SPDX-License-Identifier: AGPL-3.0
+
+import { collectionCreationReducer } from "./collection-creator-reducer";
+import { collectionCreateActions } from "./collection-creator-action";
+
+describe('collection-reducer', () => {
+
+ it('should open collection creator dialog', () => {
+ const initialState = {
+ creator: { opened: false, ownerUuid: "" }
+ };
+ const collection = {
+ creator: { opened: true, ownerUuid: "" },
+ };
+
+ const state = collectionCreationReducer(initialState, collectionCreateActions.OPEN_COLLECTION_CREATOR(initialState.creator));
+ expect(state).toEqual(collection);
+ });
+
+ it('should close collection creator dialog', () => {
+ const initialState = {
+ creator: { opened: true, ownerUuid: "" }
+ };
+ const collection = {
+ creator: { opened: false, ownerUuid: "" },
+ };
+
+ const state = collectionCreationReducer(initialState, collectionCreateActions.CLOSE_COLLECTION_CREATOR());
+ expect(state).toEqual(collection);
+ });
+
+ it('should reset collection creator dialog props', () => {
+ const initialState = {
+ creator: { opened: true, ownerUuid: "test" }
+ };
+ const collection = {
+ creator: { opened: false, ownerUuid: "" },
+ };
+
+ const state = collectionCreationReducer(initialState, collectionCreateActions.CREATE_COLLECTION_SUCCESS());
+ expect(state).toEqual(collection);
+ });
+});
\ No newline at end of file
diff --git a/src/store/collections/creator/collection-creator-reducer.ts b/src/store/collections/creator/collection-creator-reducer.ts
index c785480..769766e 100644
--- a/src/store/collections/creator/collection-creator-reducer.ts
+++ b/src/store/collections/creator/collection-creator-reducer.ts
@@ -10,11 +10,10 @@ export type CollectionCreatorState = {
interface CollectionCreator {
opened: boolean;
- pending: boolean;
ownerUuid: string;
}
-const updateCreator = (state: CollectionCreatorState, creator: Partial<CollectionCreator>) => ({
+const updateCreator = (state: CollectionCreatorState, creator?: Partial<CollectionCreator>) => ({
...state,
creator: {
...state.creator,
@@ -25,16 +24,15 @@ const updateCreator = (state: CollectionCreatorState, creator: Partial<Collectio
const initialState: CollectionCreatorState = {
creator: {
opened: false,
- pending: false,
ownerUuid: ""
}
};
export const collectionCreationReducer = (state: CollectionCreatorState = initialState, action: CollectionCreateAction) => {
return collectionCreateActions.match(action, {
- OPEN_COLLECTION_CREATOR: ({ ownerUuid }) => updateCreator(state, { ownerUuid, opened: true, pending: false }),
+ OPEN_COLLECTION_CREATOR: ({ ownerUuid }) => updateCreator(state, { ownerUuid, opened: true }),
CLOSE_COLLECTION_CREATOR: () => updateCreator(state, { opened: false }),
- CREATE_COLLECTION: () => updateCreator(state, { opened: true }),
+ CREATE_COLLECTION: () => updateCreator(state),
CREATE_COLLECTION_SUCCESS: () => updateCreator(state, { opened: false, ownerUuid: "" }),
default: () => state
});
diff --git a/src/store/project/project-reducer.test.ts b/src/store/project/project-reducer.test.ts
index 0fc2896..92274b3 100644
--- a/src/store/project/project-reducer.test.ts
+++ b/src/store/project/project-reducer.test.ts
@@ -35,7 +35,6 @@ describe('project-reducer', () => {
creator: {
opened: false,
ownerUuid: "",
- pending: false
}
});
});
@@ -50,7 +49,7 @@ describe('project-reducer', () => {
status: TreeItemStatus.PENDING
}],
currentItemId: "1",
- creator: { opened: false, pending: false, ownerUuid: "" },
+ creator: { opened: false, ownerUuid: "" },
};
const project = {
items: [{
@@ -61,7 +60,7 @@ describe('project-reducer', () => {
status: TreeItemStatus.PENDING
}],
currentItemId: "",
- creator: { opened: false, pending: false, ownerUuid: "" },
+ creator: { opened: false, ownerUuid: "" },
};
const state = projectsReducer(initialState, projectActions.RESET_PROJECT_TREE_ACTIVITY(initialState.items[0].id));
@@ -78,7 +77,7 @@ describe('project-reducer', () => {
status: TreeItemStatus.PENDING
}],
currentItemId: "1",
- creator: { opened: false, pending: false, ownerUuid: "" }
+ creator: { opened: false, ownerUuid: "" }
};
const project = {
items: [{
@@ -89,7 +88,7 @@ describe('project-reducer', () => {
status: TreeItemStatus.PENDING,
}],
currentItemId: "1",
- creator: { opened: false, pending: false, ownerUuid: "" },
+ creator: { opened: false, ownerUuid: "" },
};
const state = projectsReducer(initialState, projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(initialState.items[0].id));
@@ -107,7 +106,7 @@ describe('project-reducer', () => {
status: TreeItemStatus.PENDING,
}],
currentItemId: "1",
- creator: { opened: false, pending: false, ownerUuid: "" }
+ creator: { opened: false, ownerUuid: "" }
};
const project = {
items: [{
@@ -118,7 +117,7 @@ describe('project-reducer', () => {
status: TreeItemStatus.PENDING,
}],
currentItemId: "1",
- creator: { opened: false, pending: false, ownerUuid: "" },
+ creator: { opened: false, ownerUuid: "" },
};
const state = projectsReducer(initialState, projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN(initialState.items[0].id));
diff --git a/src/store/project/project-reducer.ts b/src/store/project/project-reducer.ts
index 45e0e19..f5af23a 100644
--- a/src/store/project/project-reducer.ts
+++ b/src/store/project/project-reducer.ts
@@ -16,7 +16,6 @@ export type ProjectState = {
interface ProjectCreator {
opened: boolean;
- pending: boolean;
ownerUuid: string;
error?: string;
}
@@ -106,7 +105,6 @@ const initialState: ProjectState = {
currentItemId: "",
creator: {
opened: false,
- pending: false,
ownerUuid: ""
}
};
@@ -114,7 +112,7 @@ const initialState: ProjectState = {
export const projectsReducer = (state: ProjectState = initialState, action: ProjectAction) => {
return projectActions.match(action, {
- OPEN_PROJECT_CREATOR: ({ ownerUuid }) => updateCreator(state, { ownerUuid, opened: true, pending: false }),
+ OPEN_PROJECT_CREATOR: ({ ownerUuid }) => updateCreator(state, { ownerUuid, opened: true }),
CLOSE_PROJECT_CREATOR: () => updateCreator(state, { opened: false }),
CREATE_PROJECT: () => updateCreator(state, { error: undefined }),
CREATE_PROJECT_SUCCESS: () => updateCreator(state, { opened: false, ownerUuid: "" }),
diff --git a/src/views-components/dialog-create/dialog-collection-create.tsx b/src/views-components/dialog-create/dialog-collection-create.tsx
index 8ce0c5d..d0f793b 100644
--- a/src/views-components/dialog-create/dialog-collection-create.tsx
+++ b/src/views-components/dialog-create/dialog-collection-create.tsx
@@ -42,7 +42,7 @@ const styles: StyleRulesCallback<CssRules> = theme => ({
createProgress: {
position: "absolute",
minWidth: "20px",
- right: "95px"
+ right: "110px"
},
dialogActions: {
marginBottom: "24px"
@@ -102,7 +102,7 @@ export const DialogCollectionCreate = compose(
<Button type="submit"
className={classes.lastButton}
color="primary"
- disabled={invalid|| submitting || pristine}
+ disabled={invalid || submitting || pristine}
variant="contained">
CREATE A COLLECTION
</Button>
diff --git a/src/views-components/dialog-create/dialog-project-create.tsx b/src/views-components/dialog-create/dialog-project-create.tsx
index e05a3bd..acfe397 100644
--- a/src/views-components/dialog-create/dialog-project-create.tsx
+++ b/src/views-components/dialog-create/dialog-project-create.tsx
@@ -103,7 +103,7 @@ export const DialogProjectCreate = compose(
<Button type="submit"
className={classes.lastButton}
color="primary"
- disabled={invalid|| submitting || pristine}
+ disabled={invalid || submitting || pristine}
variant="contained">
CREATE A PROJECT
</Button>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list