Skip to content

Commit

Permalink
Merge branch 'bugfix/filter-in-url' into 'develop'
Browse files Browse the repository at this point in the history
Fixed filter to url for dates and equals

See merge request !127
  • Loading branch information
Thoma5 committed Jan 30, 2017
2 parents 21ebf14 + 2a87881 commit 7b627f5
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions frontend/src/app/ui/ticket-overview/ticket-filter/ticket-filter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as moment from 'moment';

export class TicketFilter {
readonly title: string = '';
readonly ticketNumbers: number[];
Expand Down Expand Up @@ -51,11 +53,13 @@ export class TicketFilter {
list.push('!progress:' + this.progressOne);
}
if (this.dueDateOne && this.dueDateTwo) {
list.push('!dueDate:' + this.dueDateOne + '-' + this.dueDateTwo);
list.push(
'!dueDate:' + moment(this.dueDateOne, 'x').format('YYYY-MM-DD') + '-' + moment(this.dueDateTwo, 'x').format('YYYY-MM-DD')
);
} else if (this.dueDateOne && this.dueDateGreater !== undefined) {
list.push('!dueDate:' + (this.dueDateGreater ? '>' : '<') + this.dueDateOne);
list.push('!dueDate:' + (this.dueDateGreater ? '>' : '<') + moment(this.dueDateOne, 'x').format('YYYY-MM-DD'));
} else if (this.dueDateOne && this.dueDateGreater === undefined) {
list.push('!dueDate:' + this.dueDateOne);
list.push('!dueDate:' + moment(this.dueDateOne, 'x').format('YYYY-MM-DD'));
}
if (this.storyPointsOne && this.storyPointsTwo) {
list.push('!sp:' + this.storyPointsOne + '-' + this.storyPointsTwo);
Expand Down Expand Up @@ -84,21 +88,28 @@ export class TicketFilter {
} else if (this.progressOne && this.progressGreater !== undefined) {
list.push('progressOne=' + this.progressOne);
list.push('progressGreater=' + this.progressGreater);
} else if (this.progressOne && this.progressGreater === undefined) {
list.push('progressOne=' + this.progressOne);
}
if (this.dueDateOne && this.dueDateTwo) {
list.push('dueDateOne=' + this.dueDateOne);
list.push('dueDateTwo=' + this.dueDateTwo);
list.push('dueDateOne=' + moment(this.dueDateOne, 'x').valueOf());
list.push('dueDateTwo=' + moment(this.dueDateTwo, 'x').valueOf());
} else if (this.dueDateOne && this.dueDateGreater !== undefined) {
list.push('dueDateOne=' + this.dueDateOne);
list.push('dueDateOne=' + moment(this.dueDateOne, 'x').valueOf());
list.push('dueDateGreater=' + this.dueDateGreater);
} else if (this.dueDateOne && this.dueDateGreater === undefined) {
list.push('dueDateOne=' + moment(this.dueDateOne, 'x').valueOf());
}
if (this.storyPointsOne && this.storyPointsTwo) {
list.push('spOne=' + this.storyPointsOne);
list.push('spTwo=' + this.storyPointsTwo);
} else if (this.storyPointsOne && this.storyPointsGreater !== undefined) {
list.push('spOne=' + this.storyPointsOne);
list.push('spGreater=' + this.storyPointsGreater);
} else if (this.storyPointsOne && this.storyPointsGreater === undefined) {
list.push('spOne=' + this.storyPointsOne);
}

if (this.open !== undefined) { list.push('open=' + this.open); }
if (this.parentNumber !== undefined) { list.push('parent=' + this.parentNumber); }
return list.join('&');
Expand Down

0 comments on commit 7b627f5

Please sign in to comment.