Skip to content

Commit

Permalink
argoproj#75: Filter dropdown at Timeline page (argoproj#76)
Browse files Browse the repository at this point in the history
* Changing the filter value without re-assignment

* Issue argoproj#40: Added fallback values for form in multiple-service-launch-panel

* Issue argoproj#40: Added the template index for fallback val and changed the prop name to 'revision'

* Issue argoproj#40: Passed in the template itself to provide the fallback val

* axinternal/prod argoproj#444: Content of the filter is changed instead of reassigned upon tab-change

* Removed comments

* Removed white space

* Issue argoproj#75: Changed the name of function and cleared the data array by changing the length to 0
  • Loading branch information
felixApplatix authored and wokeGit committed Nov 22, 2017
1 parent 05f1e59 commit c205146
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export class TimelineComponent implements HasLayoutSettings, LayoutSettings, OnI
this.jobFilter = new JobFilter();
this.layoutDateRange.isAllDates = this.currentView !== 'overview';

this.toolbarFilters.data = this.getFiltersByView(this.currentView);

this.updateFiltersByView(this.currentView);
this.toolbarFilters.model = [];

if (this.showMyOnly ) {
Expand Down Expand Up @@ -143,7 +143,7 @@ export class TimelineComponent implements HasLayoutSettings, LayoutSettings, OnI
};

public toolbarFilters = {
data: undefined,
data: [],
model: [],
onChange: (data) => {
for (let status of Object.keys(this.jobFilter)) {
Expand All @@ -155,7 +155,7 @@ export class TimelineComponent implements HasLayoutSettings, LayoutSettings, OnI
};

public changeView(view: string) {
this.toolbarFilters.data = this.getFiltersByView(view);
this.toolbarFilters.data = [];
this.router.navigate(['/app/timeline', this.getRouteParams({ view })]);
}

Expand Down Expand Up @@ -193,12 +193,12 @@ export class TimelineComponent implements HasLayoutSettings, LayoutSettings, OnI
return ViewUtils.sanitizeRouteParams(params, updatedParams);
}

private getFiltersByView(view) {
private updateFiltersByView(view) {
this.currentView = view;
let filters = [];
this.toolbarFilters.data.length = 0;

if (view !== 'overview') {
filters.push({
this.toolbarFilters.data.push({
value: 'showMyOnly',
name: 'My ' + this.currentViewTitle,
hasSeparator: true,
Expand All @@ -207,7 +207,7 @@ export class TimelineComponent implements HasLayoutSettings, LayoutSettings, OnI
}

if (view === 'job' || view === 'overview') {
filters.push({
this.toolbarFilters.data.push({
value: 'failed',
name: 'Failed',
icon: { color: 'fail' },
Expand All @@ -218,7 +218,7 @@ export class TimelineComponent implements HasLayoutSettings, LayoutSettings, OnI
});
}
if (view === 'job') {
filters.push({
this.toolbarFilters.data.push({
value: 'running',
name: 'In-Progress',
icon: { color: 'running' },
Expand All @@ -228,8 +228,6 @@ export class TimelineComponent implements HasLayoutSettings, LayoutSettings, OnI
icon: { color: 'queued' },
});
}

return filters;
}

private getCategoryByView(view): string {
Expand Down

0 comments on commit c205146

Please sign in to comment.