Skip to content

Commit

Permalink
Merge branch 'master' into cico-planner
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavgore09 authored Mar 13, 2018
2 parents b0f5cd1 + c3337d2 commit 8218571
Show file tree
Hide file tree
Showing 16 changed files with 203 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/planner-list/planner-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app/models/common.model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface modelUI {
id: string;
name: string;
name?: string;
}

export class modelService {
Expand Down
1 change: 1 addition & 0 deletions src/app/models/work-item-type.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('WorkItemTypeMapper', () => {
}
}
}
type: 'workitemtypes'
} as WorkItemTypeUI;

workItemTypeService = {
Expand Down
9 changes: 6 additions & 3 deletions src/app/models/work-item-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface WorkItemTypeUI extends modelUI {
type: string;
description: string;
childTypes: any;
fields: any;
fields: Map<string, WorkItemTypeField>;
}

export class WorkItemTypeMapper implements Mapper<WorkItemTypeService, WorkItemTypeUI> {
Expand All @@ -67,12 +67,15 @@ export class WorkItemTypeMapper implements Mapper<WorkItemTypeService, WorkItemT
}, {
fromPath: ['relationships', 'guidedChildTypes', 'data'],
toPath: ['childTypes'],
toFunction: (item: WorkItemService) => {
toFunction: (item: WorkItemTypeService) => {
return !!item ? item : [];
}
}, {
fromPath: ['attributes', 'fields'],
toPath: ['fields']
}, {
toPath: ['type'],
toValue: 'workitemtypes'
}
];

Expand All @@ -97,7 +100,7 @@ export class WorkItemTypeMapper implements Mapper<WorkItemTypeService, WorkItemT
}, {
fromPath: ['childTypes'],
toPath: ['relationships', 'guidedChildTypes', 'data'],
toFunction: (item: WorkItemService) => {
toFunction: (item: WorkItemTypeUI) => {
return !!item ? item : [];
}
}, {
Expand Down
Loading

0 comments on commit 8218571

Please sign in to comment.