From 4c83c9558f66db81e7e27194b9bea893b6a8b26c Mon Sep 17 00:00:00 2001 From: Divyanshi Gupta Date: Fri, 9 Mar 2018 19:38:11 +0530 Subject: [PATCH 1/2] fix(ngrx): fixed all unit tests (#2486) * fixed conflicts * fixed all tests --- src/app/models/common.model.ts | 2 +- src/app/models/work-item-type.spec.ts | 1 + src/app/models/work-item-type.ts | 9 +- src/app/models/work-item.spec.ts | 188 ++++++++++++++++++++++++-- 4 files changed, 184 insertions(+), 16 deletions(-) diff --git a/src/app/models/common.model.ts b/src/app/models/common.model.ts index 5bb19b1e3..262b522ff 100644 --- a/src/app/models/common.model.ts +++ b/src/app/models/common.model.ts @@ -1,6 +1,6 @@ export interface modelUI { id: string; - name: string; + name?: string; } export class modelService { diff --git a/src/app/models/work-item-type.spec.ts b/src/app/models/work-item-type.spec.ts index 39ab823b5..e43f80745 100644 --- a/src/app/models/work-item-type.spec.ts +++ b/src/app/models/work-item-type.spec.ts @@ -29,6 +29,7 @@ describe('WorkItemTypeMapper', () => { } } } + type: 'workitemtypes' } as WorkItemTypeUI; workItemTypeService = { diff --git a/src/app/models/work-item-type.ts b/src/app/models/work-item-type.ts index c694d77c3..77db9fcc4 100644 --- a/src/app/models/work-item-type.ts +++ b/src/app/models/work-item-type.ts @@ -44,7 +44,7 @@ export interface WorkItemTypeUI extends modelUI { type: string; description: string; childTypes: any; - fields: any; + fields: Map; } export class WorkItemTypeMapper implements Mapper { @@ -67,12 +67,15 @@ export class WorkItemTypeMapper implements Mapper { + toFunction: (item: WorkItemTypeService) => { return !!item ? item : []; } }, { fromPath: ['attributes', 'fields'], toPath: ['fields'] + }, { + toPath: ['type'], + toValue: 'workitemtypes' } ]; @@ -97,7 +100,7 @@ export class WorkItemTypeMapper implements Mapper { + toFunction: (item: WorkItemTypeUI) => { return !!item ? item : []; } }, { diff --git a/src/app/models/work-item.spec.ts b/src/app/models/work-item.spec.ts index 842b56e28..656c25101 100644 --- a/src/app/models/work-item.spec.ts +++ b/src/app/models/work-item.spec.ts @@ -6,16 +6,96 @@ import { describe('WorkItemMapper', () => { const workItemMapper: WorkItemMapper = new WorkItemMapper(); - const wiService = {"attributes":{"system.created_at":"2017-06-28T07:44:36.640764Z","system.description":"Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add","system.description.markup":"PlainText","system.description.rendered":"Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add","system.number":1343,"system.order":1045750,"system.remote_item_id":null,"system.state":"closed","system.title":"DELETEME","system.updated_at":"2018-02-01T09:46:20.885811Z","version":14},"id":"8bccc228-bba7-43ad-b077-15fbb9148f7f","links":{"related":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f","self":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f"},"relationships":{"area":{"data":{"id":"e5fc1d21-5c56-4aef-a58a-068865621881","links":{"related":"https://api.openshift.io/api/areas/e5fc1d21-5c56-4aef-a58a-068865621881","self":"https://api.openshift.io/api/areas/e5fc1d21-5c56-4aef-a58a-068865621881"},"type":"areas"}},"assignees":{"data":[{"id":"330b19d2-28d3-4b29-9abf-a324c94b437d","links":{"related":"https://api.openshift.io/api/users/330b19d2-28d3-4b29-9abf-a324c94b437d","self":"https://api.openshift.io/api/users/330b19d2-28d3-4b29-9abf-a324c94b437d"},"type":"users"},{"id":"543d5193-d519-4126-9e9c-2d608f67639b","links":{"related":"https://api.openshift.io/api/users/543d5193-d519-4126-9e9c-2d608f67639b","self":"https://api.openshift.io/api/users/543d5193-d519-4126-9e9c-2d608f67639b"},"type":"users"}]},"baseType":{"data":{"id":"71171e90-6d35-498f-a6a7-2083b5267c18","type":"workitemtypes"},"links":{"self":"https://api.openshift.io/api/spaces/020f756e-b51a-4b43-b113-45cec16b9ce9/workitemtypes/71171e90-6d35-498f-a6a7-2083b5267c18"},"relationships":{"guidedChildTypes":{"data":[]}}},"children":{"links":{"related":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/children"},"meta":{"hasChildren":false}},"comments":{"links":{"related":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/comments","self":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/relationships/comments"}},"creator":{"data":{"id":"29f698d6-5c65-4129-9e97-5286cdb18a1c","links":{"related":"https://api.openshift.io/api/users/29f698d6-5c65-4129-9e97-5286cdb18a1c","self":"https://api.openshift.io/api/users/29f698d6-5c65-4129-9e97-5286cdb18a1c"},"type":"users"}},"iteration":{"data":{"id":"2561c0c9-6d36-46de-89f4-41cbe5b02cd3","links":{"related":"https://api.openshift.io/api/iterations/2561c0c9-6d36-46de-89f4-41cbe5b02cd3","self":"https://api.openshift.io/api/iterations/2561c0c9-6d36-46de-89f4-41cbe5b02cd3"},"type":"iterations"}},"labels":{"links":{"related":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/labels"}},"parent":{},"space":{"data":{"id":"020f756e-b51a-4b43-b113-45cec16b9ce9","type":"spaces"},"links":{"related":"https://api.openshift.io/api/spaces/020f756e-b51a-4b43-b113-45cec16b9ce9","self":"https://api.openshift.io/api/spaces/020f756e-b51a-4b43-b113-45cec16b9ce9"}},"workItemLinks":{"links":{"related":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/links"}}},"type":"workitems"}; + const wiService = { + "attributes": { + "system.created_at": "2017-06-28T07:44:36.640764Z", + "system.description": "Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add", + "system.description.markup": "Markdown", + "system.description.rendered": "Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add", + "system.number": 1343, + "system.order": 1045750, + "system.state": "closed", + "system.title": "DELETEME", + "system.updated_at": "2018-02-01T09:46:20.885811Z", + "version": 14 + }, + "id": "020f756e-b51a-4b43-b113-45cec16b9ce9", + "links": { + "self": "https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f" + }, + "relationships": { + "area": { + "data": { + "id": "e5fc1d21-5c56-4aef-a58a-068865621881", + "type": "areas" + } + }, + "assignees": { + "data": [ + { + "id": "330b19d2-28d3-4b29-9abf-a324c94b437d", + "type": "identities" + }, + { + "id": "543d5193-d519-4126-9e9c-2d608f67639b", + "type": "identities" + } + ] + }, + "baseType": { + "data": { + "id": "71171e90-6d35-498f-a6a7-2083b5267c18", + "type": "workitemtypes" + } + }, + "children": { + "links": { + "related": "https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/children" + }, + "meta": { + "hasChildren": false + } + }, + "comments": { + "links": { + "related": "https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/comments" + } + }, + "creator": { + "data": { + "id": "29f698d6-5c65-4129-9e97-5286cdb18a1c", + "type": "identities" + } + }, + "iteration": { + "data": { + "id": "2561c0c9-6d36-46de-89f4-41cbe5b02cd3", + "type": "iterations", + "links": { + "self": "https://api.openshift.io/api/iterations/2561c0c9-6d36-46de-89f4-41cbe5b02cd3" + } + } + }, + "labels": { + "data": [] + }, + "workItemLinks": { + "links": { + "related": "https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/links" + } + } + }, + "type": "workitems" + }; const wiUI: WorkItemUI = { - id: '8bccc228-bba7-43ad-b077-15fbb9148f7f', + id: '020f756e-b51a-4b43-b113-45cec16b9ce9', title: 'DELETEME', number: 1343, order: 1045750, createdAt: '2017-06-28T07:44:36.640764Z', updatedAt: '2018-02-01T09:46:20.885811Z', state: 'closed', - descriptionMarkup: 'PlainText', + descriptionMarkup: 'Markdown', descriptionRendered: 'Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add', description: 'Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add', version: 14, @@ -27,8 +107,7 @@ describe('WorkItemMapper', () => { }, creator: { id: '29f698d6-5c65-4129-9e97-5286cdb18a1c', - name: null, avatar: null, username: null, - currentUser: false + name: null, avatar: null, username: null, currentUser: false }, iteration: { id: '2561c0c9-6d36-46de-89f4-41cbe5b02cd3', @@ -41,12 +120,12 @@ describe('WorkItemMapper', () => { }, type: { id: '71171e90-6d35-498f-a6a7-2083b5267c18', name: null, icon: null, - version: null, description: null, childTypes: [], fields: null + version: null, description: null, childTypes: [], type: "workitemtypes", fields: null }, commentLink: 'https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/comments', assignees: [ - { id: '330b19d2-28d3-4b29-9abf-a324c94b437d', name: null, avatar: null, username: null, currentUser: false }, - { id: '543d5193-d519-4126-9e9c-2d608f67639b', name: null, avatar: null, username: null, currentUser: false } + { id: '330b19d2-28d3-4b29-9abf-a324c94b437d', name: null, avatar: null, username: null,currentUser: false}, + { id: '543d5193-d519-4126-9e9c-2d608f67639b', name: null, avatar: null, username: null,currentUser: false} ], labels: [ ], children: [ ], @@ -63,12 +142,97 @@ describe('WorkItemMapper', () => { }); it('should correctly convert to service model - 1', () => { - expect(workItemMapper.toUIModel(wiService)).toEqual(wiUI); + expect(workItemMapper.toServiceModel(wiUI)).toEqual(wiService); }); it('should correctly convert to UI model - 2', () => { - const expWIService = {"attributes":{"system.created_at":"2017-06-28T07:44:36.640764Z","system.description":"Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add","system.description.markup":"Markdown","system.description.rendered":"Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add","system.number":1343,"system.order":1045750,"system.state":"closed","system.title":"DELETEME","system.updated_at":"2018-02-01T09:46:20.885811Z","version":14},"id":"8bccc228-bba7-43ad-b077-15fbb9148f7f","links":{"self":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f"},"relationships":{"area":{"data":{"id":"e5fc1d21-5c56-4aef-a58a-068865621881","type":"areas"}},"assignees":{"data":[{"id":"330b19d2-28d3-4b29-9abf-a324c94b437d","type":"identities"},{"id":"543d5193-d519-4126-9e9c-2d608f67639b","type":"identities"}]},"baseType":{"data":{"id":"71171e90-6d35-498f-a6a7-2083b5267c18","type":"workitemtypes"}},"children":{"links":{"related":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/children"},"meta":{"hasChildren":false}},"comments":{"links":{"related":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/comments"}},"creator":{"data":{"id":"29f698d6-5c65-4129-9e97-5286cdb18a1c","type":"identities"}},"iteration":{"data":{"id":"2561c0c9-6d36-46de-89f4-41cbe5b02cd3","links":{"self":"https://api.openshift.io/api/iterations/2561c0c9-6d36-46de-89f4-41cbe5b02cd3"},"type":"iterations"}},"labels":{"data":[]},"workItemLinks":{"links":{"related":"https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/links"}}},"type":"workitems"}; - const output = workItemMapper.toServiceModel(wiUI); - expect(output).toEqual(expWIService); + const expWIService = { + "attributes": { + "system.created_at": "2017-06-28T07:44:36.640764Z", + "system.description": "Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add", + "system.description.markup": "Markdown", + "system.description.rendered": "Cannot resolve Area/Iteration info for new WI created in in-memory mode under Backlog > Quick Add", + "system.number": 1343, + "system.order": 1045750, + "system.state": "closed", + "system.title": "DELETEME", + "system.updated_at": "2018-02-01T09:46:20.885811Z", + "version": 14 + }, + "id": "020f756e-b51a-4b43-b113-45cec16b9ce9", + "links": { + "self": "https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f" + }, + "relationships": { + "area": { + "data": { + "id": "e5fc1d21-5c56-4aef-a58a-068865621881", + "type": "areas" + } + }, + "assignees": { + "data": [ + { + "id": "330b19d2-28d3-4b29-9abf-a324c94b437d", + "type": "identities" + }, + { + "id": "543d5193-d519-4126-9e9c-2d608f67639b", + "type": "identities" + } + ] + }, + "baseType": { + "data": { + "id": "71171e90-6d35-498f-a6a7-2083b5267c18", + "type": "workitemtypes" + }, + "relationships": { + "guidedChildTypes": { + "data": [] + } + } + }, + "children": { + "links": { + "related": "https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/children" + }, + "meta": { + "hasChildren": false + } + }, + "comments": { + "links": { + "related": "https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/comments" + } + }, + "creator": { + "data": { + "id": "29f698d6-5c65-4129-9e97-5286cdb18a1c", + "type": "identities" + } + }, + "iteration": { + "data": { + "id": "2561c0c9-6d36-46de-89f4-41cbe5b02cd3", + "links": { + "self": "https://api.openshift.io/api/iterations/2561c0c9-6d36-46de-89f4-41cbe5b02cd3" + }, + "type": "iterations" + } + }, + "labels": { + "data": [] + }, + "workItemLinks": { + "links": { + "related": "https://api.openshift.io/api/workitems/8bccc228-bba7-43ad-b077-15fbb9148f7f/links" + } + } + }, + "type": "workitems" + }; + const output = workItemMapper.toUIModel(expWIService); + expect(output).toEqual(wiUI); }); }); From c3337d2fe431897035148504c06a54dabad0a523 Mon Sep 17 00:00:00 2001 From: Konrad Kleine Date: Mon, 12 Mar 2018 18:54:36 +0100 Subject: [PATCH 2/2] fix(search): replace with typegroup.name (#2483) Once the backend merges this PR: https://github.com/fabric8-services/fabric8-wit/pull/1929, the correct field to ask for when searching for type groups is `typegroup.name` and not `$WITGROUP`. --- .../work-item-list/workItemTypeGroup.spec.js | 12 ++++++------ .../group-types-panel/group-types-panel.component.ts | 2 +- .../iteration-list-entry.component.ts | 2 +- .../iterations-panel/iterations-panel.component.ts | 2 +- .../planner-list/planner-list.component.ts | 4 ++-- .../toolbar-panel/toolbar-panel.component.ts | 2 +- .../group-types-panel/group-types-panel.component.ts | 4 ++-- .../iteration-list-entry.component.ts | 2 +- .../iterations-panel/iterations-panel.component.ts | 2 +- .../planner-list/planner-list.component.ts | 2 +- src/app/services/filter.service.ts | 2 +- src/app/services/work-item.service.ts | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/runtime/src/tests/work-item/work-item-list/workItemTypeGroup.spec.js b/runtime/src/tests/work-item/work-item-list/workItemTypeGroup.spec.js index e64ccb50a..985f58329 100644 --- a/runtime/src/tests/work-item/work-item-list/workItemTypeGroup.spec.js +++ b/runtime/src/tests/work-item/work-item-list/workItemTypeGroup.spec.js @@ -115,18 +115,18 @@ describe('Type group tests', function () { }); */ - it("Url should contain query WITGROUP:Scenario on clicking Scenario", function() { + it("Url should contain query typegroup.name:Scenarios on clicking Scenarios", function() { page.clickScenario(); - expect(browser.getCurrentUrl()).toContain('WITGROUP:Scenarios'); + expect(browser.getCurrentUrl()).toContain('typegroup.name:Scenarios'); }); - it("Url should contain query WITGROUP:Experiences on clicking Experience", function() { + it("Url should contain query typegroup.name:Experiences on clicking Experiences", function() { page.clickExperience(); - expect(browser.getCurrentUrl()).toContain('WITGROUP:Experiences'); + expect(browser.getCurrentUrl()).toContain('typegroup.name:Experiences'); }); - it("Url should contain query WITGROUP:Requirements on clicking Requirements", function() { + it("Url should contain query typegroup.name:Requirements on clicking Requirements", function() { page.clickRequirements(); - expect(browser.getCurrentUrl()).toContain('WITGROUP:Requirements'); + expect(browser.getCurrentUrl()).toContain('typegroup.name:Requirements'); }); }); diff --git a/src/app/components/group-types-panel/group-types-panel.component.ts b/src/app/components/group-types-panel/group-types-panel.component.ts index 55cd2387e..5812300e9 100644 --- a/src/app/components/group-types-panel/group-types-panel.component.ts +++ b/src/app/components/group-types-panel/group-types-panel.component.ts @@ -68,7 +68,7 @@ export class GroupTypesComponent implements OnInit, OnDestroy { fnBuildQueryParam(witGroup) { //Query for work item type group - const type_query = this.filterService.queryBuilder('$WITGROUP', this.filterService.equal_notation, witGroup.attributes.name); + const type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, witGroup.attributes.name); //Query for space const space_query = this.filterService.queryBuilder('space',this.filterService.equal_notation, this.spaceId); //Join type and space query diff --git a/src/app/components/iteration-list-entry/iteration-list-entry.component.ts b/src/app/components/iteration-list-entry/iteration-list-entry.component.ts index bea65557a..a044516d0 100644 --- a/src/app/components/iteration-list-entry/iteration-list-entry.component.ts +++ b/src/app/components/iteration-list-entry/iteration-list-entry.component.ts @@ -85,7 +85,7 @@ export class IterationListEntryComponent implements OnInit, OnDestroy { constructURL(iterationId: string) { //Query for work item type group - const type_query = this.filterService.queryBuilder('$WITGROUP', this.filterService.equal_notation, this.witGroup); + const type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, this.witGroup); //Query for space const space_query = this.filterService.queryBuilder('space',this.filterService.equal_notation, this.spaceId); //Query for iteration diff --git a/src/app/components/iterations-panel/iterations-panel.component.ts b/src/app/components/iterations-panel/iterations-panel.component.ts index 3c7e124a7..0418193f9 100644 --- a/src/app/components/iterations-panel/iterations-panel.component.ts +++ b/src/app/components/iterations-panel/iterations-panel.component.ts @@ -112,7 +112,7 @@ export class IterationComponent implements OnInit, OnDestroy, OnChanges { constructURL(iterationId: string) { //Query for work item type group - const type_query = this.filterService.queryBuilder('$WITGROUP', this.filterService.equal_notation, this.witGroup); + const type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, this.witGroup); //Query for space const space_query = this.filterService.queryBuilder('space',this.filterService.equal_notation, this.spaceId); //Query for iteration diff --git a/src/app/components/planner-list/planner-list.component.ts b/src/app/components/planner-list/planner-list.component.ts index db5e4a6b2..d5723165b 100644 --- a/src/app/components/planner-list/planner-list.component.ts +++ b/src/app/components/planner-list/planner-list.component.ts @@ -295,7 +295,7 @@ export class PlannerListComponent implements OnInit, AfterViewChecked, OnDestroy const defaultGroupName = groupTypes[0].attributes.name; this.groupTypesService.setCurrentGroupType(groupTypes[0].relationships.typeList, groupTypes[0].attributes.bucket); //Query for work item type group - const type_query = this.filterService.queryBuilder('$WITGROUP', this.filterService.equal_notation, defaultGroupName); + const type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, defaultGroupName); //Query for space const space_query = this.filterService.queryBuilder('space',this.filterService.equal_notation, spaceId); //Join type and space query @@ -373,7 +373,7 @@ export class PlannerListComponent implements OnInit, AfterViewChecked, OnDestroy getCurrentGroupType() { //if initialGroup is undefined, the page has been refreshed - find group context based on URL if ( this.route.snapshot.queryParams['q'] ) { - let urlArray = this.route.snapshot.queryParams['q'].split('WITGROUP:'); + let urlArray = this.route.snapshot.queryParams['q'].split('typegroup.name:'); if (urlArray.length > 1 ) { //If wit group is one of the parameters let ind = urlArray[1].indexOf(' $AND '); diff --git a/src/app/components/toolbar-panel/toolbar-panel.component.ts b/src/app/components/toolbar-panel/toolbar-panel.component.ts index 6cfe227c8..6fb648579 100644 --- a/src/app/components/toolbar-panel/toolbar-panel.component.ts +++ b/src/app/components/toolbar-panel/toolbar-panel.component.ts @@ -586,7 +586,7 @@ export class ToolbarPanelComponent implements OnInit, AfterViewInit, OnDestroy { if(arr[1] !== undefined) { if (ref_arr.indexOf(arr[0]) >= 0) this.transientFilters[arr[0]] = arr[1]; - else if (arr[0] === '$WITGROUP' || arr[0] === 'space' || arr[0] === 'iteration') + else if (arr[0] === 'typegroup.name' || arr[0] === 'space' || arr[0] === 'iteration') this.permanentFilters[arr[0]] = arr[1]; } } diff --git a/src/app/components_ngrx/group-types-panel/group-types-panel.component.ts b/src/app/components_ngrx/group-types-panel/group-types-panel.component.ts index 1c37b7fba..7834f7d88 100644 --- a/src/app/components_ngrx/group-types-panel/group-types-panel.component.ts +++ b/src/app/components_ngrx/group-types-panel/group-types-panel.component.ts @@ -76,7 +76,7 @@ export class GroupTypesComponent implements OnInit, OnDestroy { fnBuildQueryParam(witGroup) { //Query for work item type group const type_query = this.filterService.queryBuilder( - '$WITGROUP', this.filterService.equal_notation, witGroup.name + 'typegroup.name', this.filterService.equal_notation, witGroup.name ); //Query for space const space_query = this.filterService.queryBuilder( @@ -100,7 +100,7 @@ export class GroupTypesComponent implements OnInit, OnDestroy { this.route.queryParams.subscribe(val => { if (val.hasOwnProperty('q')) { const selectedTypeGroupName = - this.filterService.getConditionFromQuery(val.q, '$WITGROUP'); + this.filterService.getConditionFromQuery(val.q, 'typegroup.name'); const selectedTypeGroup = this.groupTypes.find(g => g.name === selectedTypeGroupName); if (!selectedTypeGroup.selected) { diff --git a/src/app/components_ngrx/iteration-list-entry/iteration-list-entry.component.ts b/src/app/components_ngrx/iteration-list-entry/iteration-list-entry.component.ts index 4fc568eae..f77a7e27f 100644 --- a/src/app/components_ngrx/iteration-list-entry/iteration-list-entry.component.ts +++ b/src/app/components_ngrx/iteration-list-entry/iteration-list-entry.component.ts @@ -84,7 +84,7 @@ export class IterationListEntryComponent implements OnInit, OnDestroy { constructURL(iterationId: string) { //Query for work item type group - const type_query = this.filterService.queryBuilder('$WITGROUP', this.filterService.equal_notation, this.witGroup); + const type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, this.witGroup); //Query for space const space_query = this.filterService.queryBuilder('space',this.filterService.equal_notation, this.spaceId); //Query for iteration diff --git a/src/app/components_ngrx/iterations-panel/iterations-panel.component.ts b/src/app/components_ngrx/iterations-panel/iterations-panel.component.ts index e83fd1c16..34c19f21b 100644 --- a/src/app/components_ngrx/iterations-panel/iterations-panel.component.ts +++ b/src/app/components_ngrx/iterations-panel/iterations-panel.component.ts @@ -121,7 +121,7 @@ export class IterationComponent implements OnInit, OnDestroy, OnChanges { constructURL(iterationId: string) { //Query for work item type group - const type_query = this.filterService.queryBuilder('$WITGROUP', this.filterService.equal_notation, this.witGroup); + const type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, this.witGroup); //Query for space const space_query = this.filterService.queryBuilder('space',this.filterService.equal_notation, this.spaceId); //Query for iteration diff --git a/src/app/components_ngrx/planner-list/planner-list.component.ts b/src/app/components_ngrx/planner-list/planner-list.component.ts index 38b164a6c..3f2deef52 100644 --- a/src/app/components_ngrx/planner-list/planner-list.component.ts +++ b/src/app/components_ngrx/planner-list/planner-list.component.ts @@ -339,7 +339,7 @@ export class PlannerListComponent implements OnInit, OnDestroy, AfterViewChecked .subscribe(groupTypes => { const defaultGroupName = groupTypes[0].name; //Query for work item type group - const type_query = this.filterService.queryBuilder('$WITGROUP', this.filterService.equal_notation, defaultGroupName); + const type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, defaultGroupName); //Query for space const space_query = this.filterService.queryBuilder('space',this.filterService.equal_notation, spaceId); //Join type and space query diff --git a/src/app/services/filter.service.ts b/src/app/services/filter.service.ts index 47c39b953..db5e57275 100644 --- a/src/app/services/filter.service.ts +++ b/src/app/services/filter.service.ts @@ -126,7 +126,7 @@ export class FilterService { } //active filter will have the transient filters //witgroup and space are permanent filters - return refCurrentFilter.filter(f => f.id === '$WITGROUP' || f.id === 'space' || f.id === 'iteration'); + return refCurrentFilter.filter(f => f.id === 'typegroup.name' || f.id === 'space' || f.id === 'iteration'); } clearFilters(keys: string[] = []): void { diff --git a/src/app/services/work-item.service.ts b/src/app/services/work-item.service.ts index 18f84ddc9..093f3b514 100644 --- a/src/app/services/work-item.service.ts +++ b/src/app/services/work-item.service.ts @@ -183,7 +183,7 @@ export class WorkItemService { if (this._currentSpace) { let url = ''; if (process.env.ENV === 'inmemory') { - url = 'http://mock.service/api/spaces/space-id0/workitems?page[limit]=42&filter[space]=space-id0&filter[$WITGROUP]=Scenarios'; + url = 'http://mock.service/api/spaces/space-id0/workitems?page[limit]=42&filter[space]=space-id0&filter[typegroup.name]=Scenarios'; } else { this.workItemUrl = this._currentSpace.links.self.split('spaces')[0] + 'search'; url = this.workItemUrl + '?page[limit]=' + pageSize + '&' + Object.keys(filters).map(k => 'filter['+k+']='+JSON.stringify(filters[k])).join('&');