-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui): load project deps+ fix loading application and pipeline afte…
…r creation (#5258)
- Loading branch information
Showing
15 changed files
with
172 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 43 additions & 28 deletions
71
ui/src/app/views/project/show/pipeline/pipeline.list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,58 @@ | ||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; | ||
import { IdName, Project } from 'app/model/project.model'; | ||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; | ||
import { Store } from '@ngxs/store'; | ||
import { IdName, LoadOpts, Project } from 'app/model/project.model'; | ||
import { ResyncProject } from 'app/store/project.action'; | ||
import { finalize } from 'rxjs/operators'; | ||
|
||
@Component({ | ||
selector: 'app-project-pipelines', | ||
templateUrl: './pipeline.list.html', | ||
styleUrls: ['./pipeline.list.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class ProjectPipelinesComponent { | ||
|
||
@Input() | ||
set project(project: Project) { | ||
this._project = project; | ||
if (project.pipeline_names) { | ||
let filter = this.filter.toLowerCase(); | ||
this.filteredPipelines = project.pipeline_names.filter((pip) => pip.name.toLowerCase().indexOf(filter) !== -1); | ||
export class ProjectPipelinesComponent implements OnInit { | ||
|
||
@Input() | ||
set project(project: Project) { | ||
this._project = project; | ||
if (project.pipeline_names) { | ||
let filter = this.filter.toLowerCase(); | ||
this.filteredPipelines = project.pipeline_names.filter((pip) => pip.name.toLowerCase().indexOf(filter) !== -1); | ||
} | ||
} | ||
} | ||
get project(): Project { | ||
return this._project; | ||
} | ||
|
||
set filter(filter: string) { | ||
this._filter = filter; | ||
if (this.project.pipeline_names) { | ||
let filterLower = filter.toLowerCase(); | ||
this.filteredPipelines = this.project.pipeline_names.filter((pip) => pip.name.toLowerCase().indexOf(filterLower) !== -1); | ||
|
||
get project(): Project { | ||
return this._project; | ||
} | ||
} | ||
get filter(): string { | ||
return this._filter; | ||
} | ||
|
||
_project: Project; | ||
_filter = ''; | ||
set filter(filter: string) { | ||
this._filter = filter; | ||
if (this.project.pipeline_names) { | ||
let filterLower = filter.toLowerCase(); | ||
this.filteredPipelines = this.project.pipeline_names.filter((pip) => pip.name.toLowerCase().indexOf(filterLower) !== -1); | ||
} | ||
} | ||
|
||
filteredPipelines: Array<IdName> = []; | ||
get filter(): string { | ||
return this._filter; | ||
} | ||
|
||
constructor() { | ||
_project: Project; | ||
_filter = ''; | ||
|
||
filteredPipelines: Array<IdName> = []; | ||
loading = true; | ||
|
||
constructor(private store: Store, private _cd: ChangeDetectorRef) { | ||
} | ||
|
||
ngOnInit(): void { | ||
let opts: Array<LoadOpts> = [new LoadOpts('withPipelineNames', 'pipeline_names')]; | ||
this.store.dispatch(new ResyncProject({projectKey: this.project.key, opts: opts})) | ||
.pipe(finalize(() => { | ||
this.loading = false; | ||
this._cd.markForCheck(); | ||
})) | ||
.subscribe(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.