[ARVADOS-WORKBENCH2] updated: 1.1.4-179-gbb60147
Git user
git at public.curoverse.com
Wed Jul 4 03:55:21 EDT 2018
Summary of changes:
.gitignore | 7 +
package.json | 1 +
src/common/api/common-resource-service.test.ts | 62 +++++
src/common/api/common-resource-service.ts | 108 +++++++++
src/common/api/order-builder.test.ts | 16 ++
src/common/api/order-builder.ts | 22 ++
src/common/formatters.ts | 3 +-
.../column-selector/column-selector.test.tsx | 8 +-
src/components/column-selector/column-selector.tsx | 3 +-
.../data-explorer/data-explorer.test.tsx | 3 +-
src/components/data-explorer/data-explorer.tsx | 23 +-
src/components/data-table/data-table.test.tsx | 17 +-
src/index.tsx | 16 +-
src/models/resource.ts | 11 +-
src/services/groups-service/groups-service.test.ts | 42 ++++
src/services/groups-service/groups-service.ts | 49 ++++
src/services/project-service/project-service.ts | 51 -----
src/services/services.ts | 5 +-
src/store/data-explorer/data-explorer-action.ts | 22 ++
.../data-explorer/data-explorer-reducer.test.tsx | 73 ++++++
src/store/data-explorer/data-explorer-reducer.ts | 85 +++++++
src/store/navigation/navigation-action.ts | 77 ++++---
src/store/project/project-action.ts | 17 +-
src/store/project/project-reducer.test.ts | 50 +++--
src/store/project/project-reducer.ts | 1 +
src/store/side-panel/side-panel-action.ts | 2 +-
src/store/store.ts | 7 +-
.../data-explorer/data-explorer.tsx | 12 +
.../project-explorer/project-explorer.tsx | 235 -------------------
.../project-tree/project-tree.test.tsx | 16 +-
.../project-panel/project-panel-item.ts} | 4 +-
src/views/project-panel/project-panel-selectors.ts | 19 +-
src/views/project-panel/project-panel.tsx | 250 ++++++++++++++++++---
src/views/workbench/workbench.test.tsx | 11 +-
src/views/workbench/workbench.tsx | 34 +--
yarn.lock | 6 +
36 files changed, 901 insertions(+), 467 deletions(-)
create mode 100644 src/common/api/common-resource-service.test.ts
create mode 100644 src/common/api/common-resource-service.ts
create mode 100644 src/common/api/order-builder.test.ts
create mode 100644 src/common/api/order-builder.ts
create mode 100644 src/services/groups-service/groups-service.test.ts
create mode 100644 src/services/groups-service/groups-service.ts
delete mode 100644 src/services/project-service/project-service.ts
create mode 100644 src/store/data-explorer/data-explorer-action.ts
create mode 100644 src/store/data-explorer/data-explorer-reducer.test.tsx
create mode 100644 src/store/data-explorer/data-explorer-reducer.ts
create mode 100644 src/views-components/data-explorer/data-explorer.tsx
delete mode 100644 src/views-components/project-explorer/project-explorer.tsx
rename src/{views-components/project-explorer/project-explorer-item.ts => views/project-panel/project-panel-item.ts} (81%)
via bb6014754664dd6365a2b6592e97e23fc36b1f21 (commit)
via c0b733ed434c3a89ea3fdfb840dc1d8d6c302d8c (commit)
via c63ba4011d124c9efee4e4f1cd6568d4eb8a8d23 (commit)
via 306f9c9aeaaed5178a934be3265bd65b52d9e841 (commit)
via 8b103324455d58bfdfa5a1108fa69acde627427e (commit)
via 73699c70c40d2e82f1871ba042ea5d8a79cd5fd1 (commit)
via d3f17ba544b22ae76f47401041362bbcefe95aaa (commit)
via 77af50a44c54ef12a1d7abb59a0e4cba4284e77e (commit)
via e00f9cc69e8e98679c4cb310ff1399c4f1abff71 (commit)
via d42292e596bd6fa2185e15a09790521a93e26a64 (commit)
via 789dabb5b8554237e5caa62a41a61f1793e8353e (commit)
via 81db818eb5a3404d0b98e6afbbbccc1ae064fd48 (commit)
via 2d37867eccb0a76df1a285e7b7e32bbb13db99a1 (commit)
via 52cc3b912c703c24bc90e67aaf24e8ad912d3ebf (commit)
via 57357cac58b568e2ba1445af6a44eb089026b34e (commit)
via 37eb0fb5a3f6c36b484fce5c2f6dacb3ce95eef5 (commit)
via 95bc64c72fa9e7ede2cc235ee668ee2e8aa6a1f0 (commit)
via c3efa27ba09323568c2b7d2cd27911fe4937ccbc (commit)
via c3945a12b21445b157cfe3ea77f88134c670d88c (commit)
via 2d06516661e4df961a586e3fd66c8e782332d18f (commit)
via afa829ac853b470517757951c51c6a8b1316f0f1 (commit)
via 2d31e440b94eca0f22b2968f30a48cfc825514f1 (commit)
via a6bda2a572824ffe2daf89b42dd1bb9321bfb6d9 (commit)
via a49f8eb5ac38cbd405ef8465387faa71c07f7f45 (commit)
via c918b794f369e2d38f85e2c2ca7bb11fc69555fe (commit)
via 616395646c46f90c46ad97bd9a335ab326e5a040 (commit)
via 8e3d8f9868858913d1885110a07d4e4d1266926a (commit)
via 75b209b2cbd37e3510fd726e737fa5457a6a8d77 (commit)
via ade15546a44f9930095b1047318967e9a74dbc68 (commit)
via 055c1f7ec3450e6e36abfc34d7515e57d9481bdc (commit)
from 278f75bd896ee35887282f61e10bbeaf6471011d (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 bb6014754664dd6365a2b6592e97e23fc36b1f21
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Wed Jul 4 09:43:29 2018 +0200
added-functionality-for-creating-projects
Feature #13684
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Feature #13684
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/.gitignore b/.gitignore
index 280ad3f..c18f27f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,15 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
+# vscode
+/.vs
+
# testing
/coverage
diff --git a/src/common/api/common-resource-service.test.ts b/src/common/api/common-resource-service.test.ts
index a07655e..d28abc4 100644
--- a/src/common/api/common-resource-service.test.ts
+++ b/src/common/api/common-resource-service.test.ts
@@ -36,7 +36,7 @@ describe("CommonResourceService", () => {
it("#list", async () => {
axiosMock
- .onGet("/resource")
+ .onGet("/resource/")
.reply(200, {
kind: "kind",
offset: 2,
diff --git a/src/common/api/common-resource-service.ts b/src/common/api/common-resource-service.ts
index 93fc000..3e147b2 100644
--- a/src/common/api/common-resource-service.ts
+++ b/src/common/api/common-resource-service.ts
@@ -20,8 +20,8 @@ export interface Resource {
}
export interface ListArguments {
- limit: number;
- offset: number;
+ limit?: number;
+ offset?: number;
filters?: FilterBuilder;
order?: OrderBuilder;
select?: string[];
@@ -68,8 +68,10 @@ export default class CommonResourceService<T extends Resource> {
this.resourceType = '/' + resourceType + '/';
}
- create() {
- throw new Error("Not implemented");
+ create(data: Partial<T>) {
+ return this.serverApi
+ .post<T>(this.resourceType, data)
+ .then(CommonResourceService.mapResponseKeys);
}
delete(uuid: string): Promise<T> {
@@ -84,7 +86,7 @@ export default class CommonResourceService<T extends Resource> {
.then(CommonResourceService.mapResponseKeys);
}
- list(args: ListArguments): Promise<ListResults<T>> {
+ list(args: ListArguments = {}): Promise<ListResults<T>> {
const { filters, order, ...other } = args;
const params = {
...other,
diff --git a/src/services/groups-service/groups-service.test.ts b/src/services/groups-service/groups-service.test.ts
index 2ace2f5..2562a59 100644
--- a/src/services/groups-service/groups-service.test.ts
+++ b/src/services/groups-service/groups-service.test.ts
@@ -16,7 +16,7 @@ describe("GroupsService", () => {
it("#contents", async () => {
axiosMock
- .onGet("/groups/1/contents")
+ .onGet("/groups/1/contents/")
.reply(200, {
kind: "kind",
offset: 2,
diff --git a/src/services/project-service/project-service.ts b/src/services/project-service/project-service.ts
deleted file mode 100644
index 5bfa544..0000000
--- a/src/services/project-service/project-service.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import { serverApi } from "../../common/api/server-api";
-import { Dispatch } from "redux";
-import { Project } from "../../models/project";
-import FilterBuilder, { FilterField } from "../../common/api/filter-builder";
-import { ArvadosResource } from "../response";
-import { getResourceKind } from "../../models/resource";
-
-interface GroupResource extends ArvadosResource {
- name: string;
- group_class: string;
- description: string;
- writable_by: string[];
- delete_at: string;
- trash_at: string;
- is_trashed: boolean;
-}
-
-interface GroupsResponse {
- offset: number;
- limit: number;
- items: GroupResource[];
-}
-
-export default class ProjectService {
- public getProjectList = (parentUuid?: string): Promise<Project[]> => {
- if (parentUuid) {
- const fb = new FilterBuilder();
- fb.addLike(FilterField.OWNER_UUID, parentUuid);
- return serverApi.get<GroupsResponse>('/groups', { params: {
- filters: fb.get()
- }}).then(resp => {
- const projects = resp.data.items.map(g => ({
- name: g.name,
- createdAt: g.created_at,
- modifiedAt: g.modified_at,
- href: g.href,
- uuid: g.uuid,
- ownerUuid: g.owner_uuid,
- kind: getResourceKind(g.kind)
- } as Project));
- return projects;
- });
- } else {
- return Promise.resolve([]);
- }
- }
-}
diff --git a/src/services/services.ts b/src/services/services.ts
index 7ad2ff7..51d2b76 100644
--- a/src/services/services.ts
+++ b/src/services/services.ts
@@ -3,12 +3,10 @@
// SPDX-License-Identifier: AGPL-3.0
import AuthService from "./auth-service/auth-service";
-import ProjectService from "./project-service/project-service";
import CollectionService from "./collection-service/collection-service";
import GroupsService from "./groups-service/groups-service";
import { serverApi } from "../common/api/server-api";
export const authService = new AuthService();
-export const projectService = new ProjectService();
export const collectionService = new CollectionService();
export const groupsService = new GroupsService(serverApi);
diff --git a/src/store/project/project-action.ts b/src/store/project/project-action.ts
index 35ff445..4cc2197 100644
--- a/src/store/project/project-action.ts
+++ b/src/store/project/project-action.ts
@@ -4,8 +4,9 @@
import { default as unionize, ofType, UnionOf } from "unionize";
import { Project } from "../../models/project";
-import { projectService } from "../../services/services";
+import { groupsService } from "../../services/services";
import { Dispatch } from "redux";
+import { getResourceKind } from "../../models/resource";
const actions = unionize({
CREATE_PROJECT: ofType<Project>(),
@@ -19,15 +20,17 @@ const actions = unionize({
tag: 'type',
value: 'payload'
});
-
-export const getProjectList = (parentUuid?: string) => (dispatch: Dispatch): Promise<Project[]> => {
- if (parentUuid) {
+
+export const getProjectList = (parentUuid: string = '') => (dispatch: Dispatch) => {
dispatch(actions.PROJECTS_REQUEST(parentUuid));
- return projectService.getProjectList(parentUuid).then(projects => {
+ return groupsService.list().then(listResults => {
+ const projects = listResults.items.map(item => ({
+ ...item,
+ kind: getResourceKind(item.kind)
+ }));
dispatch(actions.PROJECTS_SUCCESS({ projects, parentItemId: parentUuid }));
return projects;
});
- } return Promise.resolve([]);
};
export type ProjectAction = UnionOf<typeof actions>;
diff --git a/src/store/project/project-reducer.test.ts b/src/store/project/project-reducer.test.ts
index f430104..c80f18c 100644
--- a/src/store/project/project-reducer.test.ts
+++ b/src/store/project/project-reducer.test.ts
@@ -129,12 +129,13 @@ describe('project-reducer', () => {
modifiedAt: '2018-01-01',
ownerUuid: 'owner-test123',
uuid: 'test123',
- kind: ResourceKind.PROJECT
+ kind: ResourceKind.PROJECT,
},
id: "1",
open: true,
active: true,
- status: 1
+ status: 1,
+ toggled: true
}],
currentItemId: "1"
};
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list