[ARVADOS-WORKBENCH2] created: 1.4.0-31-g49f27bee
Git user
git at public.curoverse.com
Thu Aug 22 19:34:04 UTC 2019
at 49f27beea17ab1ef448f3c485dcdf9bea0a740b9 (commit)
commit 49f27beea17ab1ef448f3c485dcdf9bea0a740b9
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Thu Aug 22 16:05:59 2019 -0300
15027: Fixes user admin toggles to only send is_admin or is_active on updates.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/src/store/users/users-actions.ts b/src/store/users/users-actions.ts
index 1a567e9d..44b2bad6 100644
--- a/src/store/users/users-actions.ts
+++ b/src/store/users/users-actions.ts
@@ -109,7 +109,7 @@ export const toggleIsActive = (uuid: string) =>
const { resources } = getState();
const data = getResource<UserResource>(uuid)(resources);
const isActive = data!.isActive;
- const newActivity = await services.userService.update(uuid, { ...data, isActive: !isActive });
+ const newActivity = await services.userService.update(uuid, { isActive: !isActive });
dispatch<any>(loadUsersPanel());
return newActivity;
};
@@ -119,7 +119,7 @@ export const toggleIsAdmin = (uuid: string) =>
const { resources } = getState();
const data = getResource<UserResource>(uuid)(resources);
const isAdmin = data!.isAdmin;
- const newActivity = await services.userService.update(uuid, { ...data, isAdmin: !isAdmin });
+ const newActivity = await services.userService.update(uuid, { isAdmin: !isAdmin });
dispatch<any>(loadUsersPanel());
return newActivity;
};
commit 16cbef8029fc1da14c30d154a1388272b3f8e272
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Thu Aug 22 15:59:31 2019 -0300
15027: Fixes projects update requests to only send what's being updated.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/src/store/details-panel/details-panel-action.ts b/src/store/details-panel/details-panel-action.ts
index 52ea0e78..8083716e 100644
--- a/src/store/details-panel/details-panel-action.ts
+++ b/src/store/details-panel/details-panel-action.ts
@@ -43,7 +43,7 @@ export const deleteProjectProperty = (key: string) =>
try {
if (project) {
delete project.properties[key];
- const updatedProject = await services.projectService.update(project.uuid, project);
+ const updatedProject = await services.projectService.update(project.uuid, { properties: project.properties });
dispatch(resourcesActions.SET_RESOURCES([updatedProject]));
dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Property has been successfully deleted.", hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
}
@@ -61,7 +61,7 @@ export const createProjectProperty = (data: TagProperty) =>
try {
if (project) {
project.properties[data.key] = data.value;
- const updatedProject = await services.projectService.update(project.uuid, project);
+ const updatedProject = await services.projectService.update(project.uuid, { properties: project.properties });
dispatch(resourcesActions.SET_RESOURCES([updatedProject]));
dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Property has been successfully added.", hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
dispatch(stopSubmit(PROJECT_PROPERTIES_FORM_NAME));
diff --git a/src/store/projects/project-move-actions.ts b/src/store/projects/project-move-actions.ts
index 8876be0f..441b8a6c 100644
--- a/src/store/projects/project-move-actions.ts
+++ b/src/store/projects/project-move-actions.ts
@@ -29,8 +29,7 @@ export const moveProject = (resource: MoveToFormDialogData) =>
const userUuid = getState().auth.user!.uuid;
dispatch(startSubmit(PROJECT_MOVE_FORM_NAME));
try {
- const project = await services.projectService.get(resource.uuid);
- const newProject = await services.projectService.update(resource.uuid, { ...project, ownerUuid: resource.ownerUuid });
+ const newProject = await services.projectService.update(resource.uuid, { ownerUuid: resource.ownerUuid });
dispatch(projectPanelActions.REQUEST_ITEMS());
dispatch(dialogActions.CLOSE_DIALOG({ id: PROJECT_MOVE_FORM_NAME }));
await dispatch<any>(loadSidePanelTreeProjects(userUuid));
commit c3cb884f7875aebfece64a7338af34e2f088f8f2
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Thu Aug 22 15:56:34 2019 -0300
15027: Fixes typo on group's writable_by api response key.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/src/models/group.ts b/src/models/group.ts
index f34ede0a..e18c8ecb 100644
--- a/src/models/group.ts
+++ b/src/models/group.ts
@@ -10,7 +10,7 @@ export interface GroupResource extends TrashableResource {
groupClass: GroupClass | null;
description: string;
properties: any;
- writeableBy: string[];
+ writableBy: string[];
ensure_unique_name: boolean;
}
diff --git a/src/models/test-utils.ts b/src/models/test-utils.ts
index 22a94f16..1e1041a1 100644
--- a/src/models/test-utils.ts
+++ b/src/models/test-utils.ts
@@ -23,7 +23,7 @@ export const mockGroupResource = (data: Partial<GroupResource> = {}): GroupResou
properties: "",
trashAt: "",
uuid: "",
- writeableBy: [],
+ writableBy: [],
ensure_unique_name: true,
...data
});
diff --git a/src/store/advanced-tab/advanced-tab.tsx b/src/store/advanced-tab/advanced-tab.tsx
index fc24ace0..c7bb677a 100644
--- a/src/store/advanced-tab/advanced-tab.tsx
+++ b/src/store/advanced-tab/advanced-tab.tsx
@@ -465,7 +465,7 @@ const collectionApiResponse = (apiResponse: CollectionResource) => {
};
const groupRequestApiResponse = (apiResponse: ProjectResource) => {
- const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, description, groupClass, trashAt, isTrashed, deleteAt, properties, writeableBy } = apiResponse;
+ const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, description, groupClass, trashAt, isTrashed, deleteAt, properties, writableBy } = apiResponse;
const response = `
"uuid": "${uuid}",
"owner_uuid": "${ownerUuid}",
@@ -480,7 +480,7 @@ const groupRequestApiResponse = (apiResponse: ProjectResource) => {
"is_trashed": ${stringify(isTrashed)},
"delete_at": ${stringify(deleteAt)},
"properties": ${stringifyObject(properties)},
-"witable_by": ${stringifyObject(writeableBy)}`;
+"writable_by": ${stringifyObject(writableBy)}`;
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
commit 637d66ee33190a45690bfdef74bc46f3f480e5c4
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Thu Aug 22 15:33:10 2019 -0300
15027: Fixes collection update requests to only send what's being updated.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/src/services/collection-files-service/collection-files-service.ts b/src/services/collection-files-service/collection-files-service.ts
index 9cda22b2..3a209406 100644
--- a/src/services/collection-files-service/collection-files-service.ts
+++ b/src/services/collection-files-service/collection-files-service.ts
@@ -40,8 +40,7 @@ export class CollectionFilesService {
: stream
);
const manifestText = stringifyKeepManifest(updatedManifest);
- const data = { ...collection, manifestText };
- return this.collectionService.update(collectionUuid, CommonResourceService.mapKeys(_.snakeCase)(data));
+ return this.collectionService.update(collectionUuid, { manifestText });
}
async deleteFile(collectionUuid: string, file: { name: string, path: string }) {
diff --git a/src/store/collection-panel/collection-panel-action.ts b/src/store/collection-panel/collection-panel-action.ts
index cb28fcea..159fb27d 100644
--- a/src/store/collection-panel/collection-panel-action.ts
+++ b/src/store/collection-panel/collection-panel-action.ts
@@ -45,11 +45,14 @@ export const createCollectionTag = (data: TagProperty) =>
const uuid = item ? item.uuid : '';
try {
if (item) {
- const d: Partial<CollectionResource> = {
- properties: JSON.parse(JSON.stringify(item.properties))
- };
- d.properties[data.key] = data.value;
- const updatedCollection = await services.collectionService.update(uuid, d);
+ const updatedCollection = await services.collectionService.update(
+ uuid, {
+ properties: {
+ ...JSON.parse(JSON.stringify(item.properties)),
+ [data.key]: data.value
+ }
+ }
+ );
item.properties[data.key] = data.value;
dispatch(resourcesActions.SET_RESOURCES([updatedCollection]));
dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Tag has been successfully added.", hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
@@ -78,12 +81,12 @@ export const deleteCollectionTag = (key: string) =>
const uuid = item ? item.uuid : '';
try {
if (item) {
- const data: Partial<CollectionResource> = {
- properties: JSON.parse(JSON.stringify(item.properties))
- };
- delete data.properties[key];
- const updatedCollection = await services.collectionService.update(uuid, data);
delete item.properties[key];
+ const updatedCollection = await services.collectionService.update(
+ uuid, {
+ properties: {...item.properties}
+ }
+ );
dispatch(resourcesActions.SET_RESOURCES([updatedCollection]));
dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Tag has been successfully deleted.", hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
return updatedCollection;
diff --git a/src/store/collections/collection-move-actions.ts b/src/store/collections/collection-move-actions.ts
index dc73e5a5..0351e746 100644
--- a/src/store/collections/collection-move-actions.ts
+++ b/src/store/collections/collection-move-actions.ts
@@ -30,8 +30,8 @@ export const moveCollection = (resource: MoveToFormDialogData) =>
dispatch(startSubmit(COLLECTION_MOVE_FORM_NAME));
try {
dispatch(progressIndicatorActions.START_WORKING(COLLECTION_MOVE_FORM_NAME));
+ await services.collectionService.update(resource.uuid, { ownerUuid: resource.ownerUuid });
const collection = await services.collectionService.get(resource.uuid);
- await services.collectionService.update(resource.uuid, { ...collection, ownerUuid: resource.ownerUuid });
dispatch(projectPanelActions.REQUEST_ITEMS());
dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_MOVE_FORM_NAME }));
dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_MOVE_FORM_NAME));
commit 50c7935cf1152cb9061f4c4bcbcb7086261a1204
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Wed Aug 21 09:09:59 2019 -0300
15027: Removes code to avoid camel_case translation back to the api server.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/src/services/collection-service/collection-service.ts b/src/services/collection-service/collection-service.ts
index 86b1aded..9390777f 100644
--- a/src/services/collection-service/collection-service.ts
+++ b/src/services/collection-service/collection-service.ts
@@ -82,27 +82,4 @@ export class CollectionService extends TrashableResourceService<CollectionResour
};
return this.webdavClient.upload(fileURL, [file], requestConfig);
}
-
- update(uuid: string, data: Partial<CollectionResource>) {
- if (uuid && data && data.properties) {
- const { properties } = data;
- const mappedData = {
- ...TrashableResourceService.mapKeys(snakeCase)(data),
- properties,
- };
- return TrashableResourceService
- .defaultResponse(
- this.serverApi
- .put<CollectionResource>(this.resourceType + uuid, mappedData),
- this.actions,
- false
- );
- }
- return TrashableResourceService
- .defaultResponse(
- this.serverApi
- .put<CollectionResource>(this.resourceType + uuid, data && TrashableResourceService.mapKeys(snakeCase)(data)),
- this.actions
- );
- }
}
diff --git a/src/services/container-request-service/container-request-service.ts b/src/services/container-request-service/container-request-service.ts
index 2e2ccd1c..1e59560a 100644
--- a/src/services/container-request-service/container-request-service.ts
+++ b/src/services/container-request-service/container-request-service.ts
@@ -12,25 +12,4 @@ export class ContainerRequestService extends CommonResourceService<ContainerRequ
constructor(serverApi: AxiosInstance, actions: ApiActions) {
super(serverApi, "container_requests", actions);
}
-
- create(data?: Partial<ContainerRequestResource>) {
- if (data) {
- const { mounts } = data;
- if (mounts) {
- const mappedData = {
- ...CommonResourceService.mapKeys(snakeCase)(data),
- mounts,
- };
- return CommonResourceService
- .defaultResponse(
- this.serverApi.post<ContainerRequestResource>(this.resourceType, mappedData),
- this.actions);
- }
- }
- return CommonResourceService
- .defaultResponse(
- this.serverApi
- .post<ContainerRequestResource>(this.resourceType, data && CommonResourceService.mapKeys(snakeCase)(data)),
- this.actions);
- }
}
diff --git a/src/services/groups-service/groups-service.ts b/src/services/groups-service/groups-service.ts
index a676557a..ac6ffb94 100644
--- a/src/services/groups-service/groups-service.ts
+++ b/src/services/groups-service/groups-service.ts
@@ -59,18 +59,7 @@ export class GroupsService<T extends GroupResource = GroupResource> extends Tras
this.serverApi.get(this.resourceType + pathUrl, cfg), this.actions, false
);
- const { items, ...res } = response;
- const mappedItems = (items || []).map((item: GroupContentsResource) => {
- const mappedItem = TrashableResourceService.mapKeys(_.camelCase)(item);
- if (item.kind === ResourceKind.COLLECTION || item.kind === ResourceKind.PROJECT) {
- const { properties } = item;
- return { ...mappedItem, properties };
- } else {
- return mappedItem;
- }
- });
- const mappedResponse = { ...TrashableResourceService.mapKeys(_.camelCase)(res) };
- return { ...mappedResponse, items: mappedItems, clusterId: session && session.clusterId };
+ return { ...TrashableResourceService.mapKeys(_.camelCase)(response), clusterId: session && session.clusterId };
}
shared(params: SharedArguments = {}): Promise<ListResults<GroupContentsResource>> {
diff --git a/src/services/project-service/project-service.ts b/src/services/project-service/project-service.ts
index 5c686aae..ac16564a 100644
--- a/src/services/project-service/project-service.ts
+++ b/src/services/project-service/project-service.ts
@@ -16,29 +16,6 @@ export class ProjectService extends GroupsService<ProjectResource> {
return super.create(projectData);
}
- update(uuid: string, data: Partial<ProjectResource>) {
- if (uuid && data && data.properties) {
- const { properties } = data;
- const mappedData = {
- ...TrashableResourceService.mapKeys(snakeCase)(data),
- properties,
- };
- return TrashableResourceService
- .defaultResponse(
- this.serverApi
- .put<ProjectResource>(this.resourceType + uuid, mappedData),
- this.actions,
- false
- );
- }
- return TrashableResourceService
- .defaultResponse(
- this.serverApi
- .put<ProjectResource>(this.resourceType + uuid, data && TrashableResourceService.mapKeys(snakeCase)(data)),
- this.actions
- );
- }
-
list(args: ListArguments = {}) {
return super.list({
...args,
commit 646e1d88d8aac461e0a13b6c0f1aa1b198e3659c
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Wed Aug 21 07:50:59 2019 -0300
15027: Removes unnecessary test method.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/src/services/collection-files-service/collection-files-service.ts b/src/services/collection-files-service/collection-files-service.ts
index 6f88a729..9cda22b2 100644
--- a/src/services/collection-files-service/collection-files-service.ts
+++ b/src/services/collection-files-service/collection-files-service.ts
@@ -58,11 +58,4 @@ export class CollectionFilesService {
const manifestText = stringifyKeepManifest(updatedManifest);
return this.collectionService.update(collectionUuid, { manifestText });
}
-
- renameTest() {
- const u = this.renameFile('qr1hi-4zz18-n0sx074erl4p0ph', {
- name: 'extracted2.txt.png',
- path: ''
- }, 'extracted-new.txt.png');
- }
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list