[ARVADOS-WORKBENCH2] created: 1.4.1-178-g680b1ffd

Git user git at public.arvados.org
Mon Dec 16 22:11:22 UTC 2019


        at  680b1ffd3369fb60134ce84c4de5aaa35fb77411 (commit)


commit 680b1ffd3369fb60134ce84c4de5aaa35fb77411
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Dec 16 19:10:10 2019 -0300

    15672: More filter usage fixes.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/store/process-logs-panel/process-logs-panel-actions.ts b/src/store/process-logs-panel/process-logs-panel-actions.ts
index fcb1b0ea..4eed9a96 100644
--- a/src/store/process-logs-panel/process-logs-panel-actions.ts
+++ b/src/store/process-logs-panel/process-logs-panel-actions.ts
@@ -68,8 +68,8 @@ export const addProcessLogsPanelItem = (message: ResourceEventMessage<{ text: st
 
 const loadContainerLogs = async (containerUuid: string, logService: LogService) => {
     const requestFilters = new FilterBuilder()
-        .addEqual('objectUuid', containerUuid)
-        .addIn('eventType', PROCESS_PANEL_LOG_EVENT_TYPES)
+        .addEqual('object_uuid', containerUuid)
+        .addIn('event_type', PROCESS_PANEL_LOG_EVENT_TYPES)
         .getFilters();
     const requestOrder = new OrderBuilder<LogResource>()
         .addAsc('eventAt')
diff --git a/src/store/processes/processes-actions.ts b/src/store/processes/processes-actions.ts
index 47d6824a..a94e56d6 100644
--- a/src/store/processes/processes-actions.ts
+++ b/src/store/processes/processes-actions.ts
@@ -39,7 +39,7 @@ export const loadProcess = (containerRequestUuid: string) =>
 export const loadSubprocesses = (containerUuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         const containerRequests = await dispatch<any>(loadContainerRequests(
-            new FilterBuilder().addEqual('requestingContainerUuid', containerUuid).getFilters()
+            new FilterBuilder().addEqual('requesting_container_uuid', containerUuid).getFilters()
         )) as ContainerRequestResource[];
 
         const containerUuids: string[] = containerRequests.reduce((uuids, { containerUuid }) =>
diff --git a/src/store/resource-type-filters/resource-type-filters.ts b/src/store/resource-type-filters/resource-type-filters.ts
index a6abf44b..e1a1b835 100644
--- a/src/store/resource-type-filters/resource-type-filters.ts
+++ b/src/store/resource-type-filters/resource-type-filters.ts
@@ -113,7 +113,7 @@ const serializeCollectionTypeFilters = ({ fb, selectedFilters }: ReturnType<type
     () => getMatchingFilters(values(CollectionTypeFilter), selectedFilters),
     filters => filters.map(collectionTypeToPropertyValue),
     mappedFilters => ({
-        fb: buildCollectiomTypeFilters({ fb, filters: mappedFilters }),
+        fb: buildCollectionTypeFilters({ fb, filters: mappedFilters }),
         selectedFilters
     })
 )();
@@ -124,7 +124,7 @@ const NON_GENERAL_COLLECTION_TYPES = difference(COLLECTION_TYPES, [CollectionTyp
 
 const COLLECTION_PROPERTIES_PREFIX = `${GroupContentsResourcePrefix.COLLECTION}.properties`;
 
-const buildCollectiomTypeFilters = ({ fb, filters }: { fb: FilterBuilder, filters: CollectionType[] }) => {
+const buildCollectionTypeFilters = ({ fb, filters }: { fb: FilterBuilder, filters: CollectionType[] }) => {
     switch (true) {
         case filters.length === 0 || filters.length === COLLECTION_TYPES.length:
             return fb;
diff --git a/src/store/side-panel-tree/side-panel-tree-actions.ts b/src/store/side-panel-tree/side-panel-tree-actions.ts
index 1bb1624d..9bdf2053 100644
--- a/src/store/side-panel-tree/side-panel-tree-actions.ts
+++ b/src/store/side-panel-tree/side-panel-tree-actions.ts
@@ -89,7 +89,7 @@ const loadProject = (projectUuid: string) =>
         dispatch(treePickerActions.LOAD_TREE_PICKER_NODE({ id: projectUuid, pickerId: SIDE_PANEL_TREE }));
         const params = {
             filters: new FilterBuilder()
-                .addEqual('ownerUuid', projectUuid)
+                .addEqual('owner_uuid', projectUuid)
                 .getFilters(),
             order: new OrderBuilder<ProjectResource>()
                 .addAsc('name')
@@ -110,7 +110,7 @@ const loadSharedRoot = async (dispatch: Dispatch, _: () => RootState, services:
     const params = {
         filters: `[${new FilterBuilder()
             .addIsA('uuid', ResourceKind.PROJECT)
-            .addEqual('groupClass', GroupClass.PROJECT)
+            .addEqual('group_class', GroupClass.PROJECT)
             .getFilters()}]`,
         order: new OrderBuilder<ProjectResource>()
             .addAsc('name', GroupContentsResourcePrefix.PROJECT)
diff --git a/src/store/tree-picker/tree-picker-actions.ts b/src/store/tree-picker/tree-picker-actions.ts
index ff36e3e6..6b9be539 100644
--- a/src/store/tree-picker/tree-picker-actions.ts
+++ b/src/store/tree-picker/tree-picker-actions.ts
@@ -243,8 +243,8 @@ export const loadFavoritesProject = (params: LoadFavoritesProjectParams) =>
         if (uuid) {
             const filters = pipe(
                 (fb: FilterBuilder) => includeCollections
-                    ? fb.addIsA('headUuid', [ResourceKind.PROJECT, ResourceKind.COLLECTION])
-                    : fb.addIsA('headUuid', [ResourceKind.PROJECT]),
+                    ? fb.addIsA('head_uuid', [ResourceKind.PROJECT, ResourceKind.COLLECTION])
+                    : fb.addIsA('head_uuid', [ResourceKind.PROJECT]),
                 fb => fb.getFilters(),
             )(new FilterBuilder());
 
@@ -276,11 +276,11 @@ export const loadPublicFavoritesProject = (params: LoadFavoritesProjectParams) =
 
             const filters = pipe(
                 (fb: FilterBuilder) => includeCollections
-                    ? fb.addIsA('headUuid', [ResourceKind.PROJECT, ResourceKind.COLLECTION])
-                    : fb.addIsA('headUuid', [ResourceKind.PROJECT]),
+                    ? fb.addIsA('head_uuid', [ResourceKind.PROJECT, ResourceKind.COLLECTION])
+                    : fb.addIsA('head_uuid', [ResourceKind.PROJECT]),
                 fb => fb
-                    .addEqual('linkClass', LinkClass.STAR)
-                    .addEqual('ownerUuid', uuid)
+                    .addEqual('link_class', LinkClass.STAR)
+                    .addEqual('owner_uuid', uuid)
                     .addLike('name', '')
                     .getFilters(),
             )(new FilterBuilder());
@@ -361,7 +361,7 @@ export const loadPublicFavoriteTreePickerProjects = (id: string) =>
 const buildParams = (ownerUuid: string) => {
     return {
         filters: new FilterBuilder()
-            .addEqual('ownerUuid', ownerUuid)
+            .addEqual('owner_uuid', ownerUuid)
             .getFilters(),
         order: new OrderBuilder<ProjectResource>()
             .addAsc('name')
diff --git a/src/store/users/user-panel-middleware-service.ts b/src/store/users/user-panel-middleware-service.ts
index cffcce4d..c253f40a 100644
--- a/src/store/users/user-panel-middleware-service.ts
+++ b/src/store/users/user-panel-middleware-service.ts
@@ -56,14 +56,14 @@ const getParamsLastName = (dataExplorer: DataExplorer) => ({
 
 const getFiltersFirstName = (dataExplorer: DataExplorer) => {
     const filters = new FilterBuilder()
-        .addILike("firstName", dataExplorer.searchValue)
+        .addILike("first_name", dataExplorer.searchValue)
         .getFilters();
     return filters;
 };
 
 const getFiltersLastName = (dataExplorer: DataExplorer) => {
     const filters = new FilterBuilder()
-        .addILike("lastName", dataExplorer.searchValue)
+        .addILike("last_name", dataExplorer.searchValue)
         .getFilters();
     return filters;
 };
diff --git a/src/store/virtual-machines/virtual-machines-actions.ts b/src/store/virtual-machines/virtual-machines-actions.ts
index 62564959..8e8a56e6 100644
--- a/src/store/virtual-machines/virtual-machines-actions.ts
+++ b/src/store/virtual-machines/virtual-machines-actions.ts
@@ -72,7 +72,7 @@ export const loadVirtualMachinesUserData = () =>
         const virtualMachinesUuids = virtualMachines.items.map(it => it.uuid);
         const links = await services.linkService.list({
             filters: new FilterBuilder()
-                .addIn("headUuid", virtualMachinesUuids)
+                .addIn("head_uuid", virtualMachinesUuids)
                 .getFilters()
         });
         dispatch(virtualMachinesActions.SET_VIRTUAL_MACHINES(virtualMachines));
diff --git a/src/views-components/sharing-dialog/people-select.tsx b/src/views-components/sharing-dialog/people-select.tsx
index f6f6c092..90235cd5 100644
--- a/src/views-components/sharing-dialog/people-select.tsx
+++ b/src/views-components/sharing-dialog/people-select.tsx
@@ -117,7 +117,7 @@ export const PeopleSelect = connect()(
         requestSuggestions = async (_: void, __: void, { userService, groupsService }: ServiceRepository) => {
             const { value } = this.state;
             const filterGroups = new FilterBuilder()
-                .addNotIn('groupClass', [GroupClass.PROJECT])
+                .addNotIn('group_class', [GroupClass.PROJECT])
                 .addILike('name', value)
                 .getFilters();
             const groupItems = await groupsService.list({ filters: filterGroups, limit: 5 });

commit 325867b8ed5f5f521e01e40c8746d9b89b78d1b7
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Dec 16 19:08:36 2019 -0300

    15672: Fixes filter usage on search bar actions.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/store/search-bar/search-bar-actions.ts b/src/store/search-bar/search-bar-actions.ts
index ddaf8f31..b91dc9d1 100644
--- a/src/store/search-bar/search-bar-actions.ts
+++ b/src/store/search-bar/search-bar-actions.ts
@@ -339,7 +339,7 @@ export const queryToFilters = (query: string) => {
     }
 
     if (data.projectUuid) {
-        filter.addEqual('ownerUuid', data.projectUuid);
+        filter.addEqual('owner_uuid', data.projectUuid);
     }
 
     if (data.dateFrom) {
diff --git a/src/store/search-bar/search-bar-tree-actions.ts b/src/store/search-bar/search-bar-tree-actions.ts
index c97d77b3..76e1b68f 100644
--- a/src/store/search-bar/search-bar-tree-actions.ts
+++ b/src/store/search-bar/search-bar-tree-actions.ts
@@ -87,7 +87,7 @@ const loadSearchBarProject = (projectUuid: string) =>
         dispatch(treePickerActions.LOAD_TREE_PICKER_NODE({ id: projectUuid, pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID }));
         const params = {
             filters: new FilterBuilder()
-                .addEqual('ownerUuid', projectUuid)
+                .addEqual('owner_uuid', projectUuid)
                 .getFilters(),
             order: new OrderBuilder<ProjectResource>()
                 .addAsc('name')

commit f7768c34ffe19a7d52ee23593070f7009ab79a43
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Dec 16 18:42:43 2019 -0300

    15672: Fixes filter usage on collections and favorite store middlewares.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/store/advanced-tab/advanced-tab.tsx b/src/store/advanced-tab/advanced-tab.tsx
index be82547b..f11e54ff 100644
--- a/src/store/advanced-tab/advanced-tab.tsx
+++ b/src/store/advanced-tab/advanced-tab.tsx
@@ -225,7 +225,7 @@ export const openAdvancedTabDialog = (uuid: string) =>
                 const data = getResource<UserResource>(uuid)(resources);
                 const metadata = await services.linkService.list({
                     filters: new FilterBuilder()
-                        .addEqual('headUuid', uuid)
+                        .addEqual('head_uuid', uuid)
                         .getFilters()
                 });
                 const advanceDataUser = advancedTabData({
@@ -300,7 +300,7 @@ const getDataForAdvancedTab = (uuid: string) =>
         const data = getResource<any>(uuid)(resources);
         const metadata = await services.linkService.list({
             filters: new FilterBuilder()
-                .addEqual('headUuid', uuid)
+                .addEqual('head_uuid', uuid)
                 .getFilters()
         });
         const user = metadata.itemsAvailable && await services.userService.get(metadata.items[0].tailUuid || '');
diff --git a/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts b/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
index 57d09bf4..dc0f2c52 100644
--- a/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
+++ b/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts
@@ -56,7 +56,7 @@ export class CollectionsWithSameContentAddressMiddlewareService extends DataExpl
                     limit: dataExplorer.rowsPerPage,
                     offset: dataExplorer.page * dataExplorer.rowsPerPage,
                     filters: new FilterBuilder()
-                        .addEqual('portableDataHash', contentAddress)
+                        .addEqual('portable_data_hash', contentAddress)
                         .addILike("name", dataExplorer.searchValue)
                         .getFilters()
                 });
diff --git a/src/store/favorite-panel/favorite-panel-middleware-service.ts b/src/store/favorite-panel/favorite-panel-middleware-service.ts
index b242366d..f45a62f8 100644
--- a/src/store/favorite-panel/favorite-panel-middleware-service.ts
+++ b/src/store/favorite-panel/favorite-panel-middleware-service.ts
@@ -59,9 +59,9 @@ export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareServic
                 api.dispatch(progressIndicatorActions.START_WORKING(this.getId()));
                 const responseLinks = await this.services.linkService.list({
                     filters: new FilterBuilder()
-                        .addEqual("linkClass", 'star')
-                        .addEqual('tailUuid', getUserUuid(api.getState()))
-                        .addEqual('tailKind', ResourceKind.USER)
+                        .addEqual("link_class", 'star')
+                        .addEqual('tail_uuid', getUserUuid(api.getState()))
+                        .addEqual('tail_kind', ResourceKind.USER)
                         .getFilters()
                 }).then(results => results);
                 const uuids = responseLinks.items.map(it => it.headUuid);
diff --git a/src/store/public-favorites-panel/public-favorites-middleware-service.ts b/src/store/public-favorites-panel/public-favorites-middleware-service.ts
index a15fe975..072cf4e4 100644
--- a/src/store/public-favorites-panel/public-favorites-middleware-service.ts
+++ b/src/store/public-favorites-panel/public-favorites-middleware-service.ts
@@ -59,10 +59,10 @@ export class PublicFavoritesMiddlewareService extends DataExplorerMiddlewareServ
                     limit: dataExplorer.rowsPerPage,
                     offset: dataExplorer.page * dataExplorer.rowsPerPage,
                     filters: new FilterBuilder()
-                        .addEqual('linkClass', LinkClass.STAR)
+                        .addEqual('link_class', LinkClass.STAR)
                         .addILike("name", dataExplorer.searchValue)
-                        .addEqual('ownerUuid', uuid)
-                        .addIsA("headUuid", typeFilters)
+                        .addEqual('owner_uuid', uuid)
+                        .addIsA("head_uuid", typeFilters)
                         .getFilters()
                 });
                 const uuids = responseLinks.items.map(it => it.headUuid);

commit a528db83706291c24d946f7375f4312bad438603
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Dec 16 18:38:52 2019 -0300

    15672: Fixes filter usage on group related store code.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/store/group-details-panel/group-details-panel-middleware-service.ts b/src/store/group-details-panel/group-details-panel-middleware-service.ts
index d1a94299..7e4d6c51 100644
--- a/src/store/group-details-panel/group-details-panel-middleware-service.ts
+++ b/src/store/group-details-panel/group-details-panel-middleware-service.ts
@@ -35,8 +35,8 @@ export class GroupDetailsPanelMiddlewareService extends DataExplorerMiddlewareSe
                 const permissions = await this.services.permissionService.list({
 
                     filters: new FilterBuilder()
-                        .addEqual('tailUuid', groupUuid)
-                        .addEqual('linkClass', LinkClass.PERMISSION)
+                        .addEqual('tail_uuid', groupUuid)
+                        .addEqual('link_class', LinkClass.PERMISSION)
                         .getFilters()
 
                 });
diff --git a/src/store/groups-panel/groups-panel-actions.ts b/src/store/groups-panel/groups-panel-actions.ts
index cfd8438c..cbeecbd7 100644
--- a/src/store/groups-panel/groups-panel-actions.ts
+++ b/src/store/groups-panel/groups-panel-actions.ts
@@ -194,8 +194,8 @@ export const deletePermission = async ({ head, tail, dispatch, permissionService
         const permissionsResponse = await permissionService.list({
 
             filters: new FilterBuilder()
-                .addEqual('tailUuid', tail.uuid)
-                .addEqual('headUuid', head.uuid)
+                .addEqual('tail_uuid', tail.uuid)
+                .addEqual('head_uuid', head.uuid)
                 .getFilters()
 
         });
diff --git a/src/store/groups-panel/groups-panel-middleware-service.ts b/src/store/groups-panel/groups-panel-middleware-service.ts
index b5ef51b7..3c707eed 100644
--- a/src/store/groups-panel/groups-panel-middleware-service.ts
+++ b/src/store/groups-panel/groups-panel-middleware-service.ts
@@ -46,7 +46,7 @@ export class GroupsPanelMiddlewareService extends DataExplorerMiddlewareService
                 }
 
                 const filters = new FilterBuilder()
-                    .addNotIn('groupClass', [GroupClass.PROJECT])
+                    .addNotIn('group_class', [GroupClass.PROJECT])
                     .addILike('name', dataExplorer.searchValue)
                     .getFilters();
 
@@ -67,7 +67,7 @@ export class GroupsPanelMiddlewareService extends DataExplorerMiddlewareService
                 const permissions = await this.services.permissionService.list({
 
                     filters: new FilterBuilder()
-                        .addIn('tailUuid', response.items.map(item => item.uuid))
+                        .addIn('tail_uuid', response.items.map(item => item.uuid))
                         .getFilters()
 
                 });

commit d714e4787834d3440f9d73aca940cc2544e8f174
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Dec 16 18:27:52 2019 -0300

    15672: Fixes filter usage on workflow service.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/services/workflow-service/workflow-service.ts b/src/services/workflow-service/workflow-service.ts
index de9a1186..e72599ef 100644
--- a/src/services/workflow-service/workflow-service.ts
+++ b/src/services/workflow-service/workflow-service.ts
@@ -22,26 +22,21 @@ export class WorkflowService extends CommonResourceService<WorkflowResource> {
     async presets(workflowUuid: string) {
 
         const { items: presetLinks } = await this.linksService.list({
-
             filters: new FilterBuilder()
-                .addEqual('tailUuid', workflowUuid)
-                .addEqual('linkClass', LinkClass.PRESET)
+                .addEqual('tail_uuid', workflowUuid)
+                .addEqual('link_class', LinkClass.PRESET)
                 .getFilters()
-
         });
 
         const presetUuids = presetLinks.map(link => link.headUuid);
 
         return this.list({
-
             filters: new FilterBuilder()
                 .addIn('uuid', presetUuids)
                 .getFilters(),
-
             order: new OrderBuilder<WorkflowResource>()
                 .addAsc('name')
                 .getOrder(),
-
         });
 
     }

commit 169f05f7c42e7d3a3a3347200472df81f26464b2
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Dec 16 18:24:46 2019 -0300

    15672: Fixes filter usage on tag service.
    
    Noticed that OrderBuilder does the same kind of translation, but it
    isn't trivial to fix as it does type checking on the properties used
    to do the ordering.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/services/tag-service/tag-service.ts b/src/services/tag-service/tag-service.ts
index 9f5b34fd..bb1eed46 100644
--- a/src/services/tag-service/tag-service.ts
+++ b/src/services/tag-service/tag-service.ts
@@ -26,9 +26,9 @@ export class TagService {
 
     list(uuid: string) {
         const filters = new FilterBuilder()
-            .addEqual("headUuid", uuid)
-            .addEqual("tailUuid", TagTailType.COLLECTION)
-            .addEqual("linkClass", LinkClass.TAG)
+            .addEqual("head_uuid", uuid)
+            .addEqual("tail_uuid", TagTailType.COLLECTION)
+            .addEqual("link_class", LinkClass.TAG)
             .getFilters();
 
         const order = new OrderBuilder<TagResource>()

commit a689d772ae091e5cda709313d44c27c71d2ba5de
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Dec 16 18:14:11 2019 -0300

    15672: Fixes filter usage on project service.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/services/project-service/project-service.test.ts b/src/services/project-service/project-service.test.ts
index aac04d96..12eae0fe 100644
--- a/src/services/project-service/project-service.test.ts
+++ b/src/services/project-service/project-service.test.ts
@@ -31,7 +31,7 @@ describe("CommonResourceService", () => {
         expect(axiosInstance.get).toHaveBeenCalledWith("/groups", {
             params: {
                 filters: "[" + new FilterBuilder()
-                    .addEqual("groupClass", "project")
+                    .addEqual("group_class", "project")
                     .getFilters() + "]",
                 order: undefined
             }
diff --git a/src/services/project-service/project-service.ts b/src/services/project-service/project-service.ts
index 0665fa66..eec5a940 100644
--- a/src/services/project-service/project-service.ts
+++ b/src/services/project-service/project-service.ts
@@ -20,7 +20,7 @@ export class ProjectService extends GroupsService<ProjectResource> {
             filters: joinFilters(
                 args.filters,
                 new FilterBuilder()
-                    .addEqual("groupClass", GroupClass.PROJECT)
+                    .addEqual("group_class", GroupClass.PROJECT)
                     .getFilters()
             )
         });

commit 5bb8d38ca504259c17c10b3363eea37090e4d4a5
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Dec 16 18:11:26 2019 -0300

    15672: Fixes filter usage on favorite service.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/services/favorite-service/favorite-service.test.ts b/src/services/favorite-service/favorite-service.test.ts
index beaf869e..566b4cbc 100644
--- a/src/services/favorite-service/favorite-service.test.ts
+++ b/src/services/favorite-service/favorite-service.test.ts
@@ -39,9 +39,9 @@ describe("FavoriteService", () => {
     it("unmarks resource as favorite", async () => {
         const list = jest.fn().mockReturnValue(Promise.resolve({ items: [{ uuid: "linkUuid" }] }));
         const filters = new FilterBuilder()
-            .addEqual('tailUuid', "userUuid")
-            .addEqual('headUuid', "resourceUuid")
-            .addEqual('linkClass', LinkClass.STAR);
+            .addEqual('tail_uuid', "userUuid")
+            .addEqual('head_uuid', "resourceUuid")
+            .addEqual('link_class', LinkClass.STAR);
         linkService.list = list;
         linkService.delete = jest.fn().mockReturnValue(Promise.resolve({ uuid: "linkUuid" }));
         const favoriteService = new FavoriteService(linkService, groupService);
@@ -56,8 +56,8 @@ describe("FavoriteService", () => {
     it("lists favorite resources", async () => {
         const list = jest.fn().mockReturnValue(Promise.resolve({ items: [{ headUuid: "headUuid" }] }));
         const listFilters = new FilterBuilder()
-            .addEqual('tailUuid', "userUuid")
-            .addEqual('linkClass', LinkClass.STAR);
+            .addEqual('tail_uuid', "userUuid")
+            .addEqual('link_class', LinkClass.STAR);
         const contents = jest.fn().mockReturnValue(Promise.resolve({ items: [{ uuid: "resourceUuid" }] }));
         const contentFilters = new FilterBuilder().addIn('uuid', ["headUuid"]);
         linkService.list = list;
@@ -75,9 +75,9 @@ describe("FavoriteService", () => {
     it("checks if resources are present in favorites", async () => {
         const list = jest.fn().mockReturnValue(Promise.resolve({ items: [{ headUuid: "foo" }] }));
         const listFilters = new FilterBuilder()
-            .addIn("headUuid", ["foo", "oof"])
-            .addEqual("tailUuid", "userUuid")
-            .addEqual("linkClass", LinkClass.STAR);
+            .addIn("head_uuid", ["foo", "oof"])
+            .addEqual("tail_uuid", "userUuid")
+            .addEqual("link_class", LinkClass.STAR);
         linkService.list = list;
         const favoriteService = new FavoriteService(linkService, groupService);
 
diff --git a/src/services/favorite-service/favorite-service.ts b/src/services/favorite-service/favorite-service.ts
index c41b2b99..8b504c86 100644
--- a/src/services/favorite-service/favorite-service.ts
+++ b/src/services/favorite-service/favorite-service.ts
@@ -36,9 +36,9 @@ export class FavoriteService {
         return this.linkService
             .list({
                 filters: new FilterBuilder()
-                    .addEqual('tailUuid', data.userUuid)
-                    .addEqual('headUuid', data.resourceUuid)
-                    .addEqual('linkClass', LinkClass.STAR)
+                    .addEqual('tail_uuid', data.userUuid)
+                    .addEqual('head_uuid', data.resourceUuid)
+                    .addEqual('link_class', LinkClass.STAR)
                     .getFilters()
             })
             .then(results => Promise.all(
@@ -47,8 +47,8 @@ export class FavoriteService {
 
     list(userUuid: string, { filters, limit, offset, linkOrder, contentOrder }: FavoriteListArguments = {}): Promise<ListResults<GroupContentsResource>> {
         const listFilters = new FilterBuilder()
-            .addEqual('tailUuid', userUuid)
-            .addEqual('linkClass', LinkClass.STAR)
+            .addEqual('tail_uuid', userUuid)
+            .addEqual('link_class', LinkClass.STAR)
             .getFilters();
 
         return this.linkService
@@ -74,9 +74,9 @@ export class FavoriteService {
         return this.linkService
             .list({
                 filters: new FilterBuilder()
-                    .addIn("headUuid", resourceUuids)
-                    .addEqual("tailUuid", userUuid)
-                    .addEqual("linkClass", LinkClass.STAR)
+                    .addIn("head_uuid", resourceUuids)
+                    .addEqual("tail_uuid", userUuid)
+                    .addEqual("link_class", LinkClass.STAR)
                     .getFilters()
             })
             .then(({ items }) => resourceUuids.reduce((results, uuid) => {

commit b74ff3e417527c5378188c981a4241ac2ce561a2
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Dec 16 18:09:39 2019 -0300

    15672: Fixes filter translations to snake case.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/services/api/filter-builder.ts b/src/services/api/filter-builder.ts
index 77fcef6f..d5903c56 100644
--- a/src/services/api/filter-builder.ts
+++ b/src/services/api/filter-builder.ts
@@ -2,8 +2,6 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as _ from "lodash";
-
 export function joinFilters(filters0?: string, filters1?: string) {
     return [filters0, filters1].filter(s => s).join(",");
 }
@@ -83,9 +81,7 @@ export class FilterBuilder {
                 ? resourcePrefix + "."
                 : "";
 
-            const fld = field.indexOf('properties.') < 0 ? _.snakeCase(field) : field;
-
-            this.filters += `${this.filters ? "," : ""}["${resPrefix}${fld}","${cond}",${value}]`;
+            this.filters += `${this.filters ? "," : ""}["${resPrefix}${field}","${cond}",${value}]`;
         }
         return this;
     }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list