Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui,api,cdsctl): Add filter to queue/workflows on status #3293

Merged
merged 5 commits into from
Sep 7, 2018
Merged

feat(ui,api,cdsctl): Add filter to queue/workflows on status #3293

merged 5 commits into from
Sep 7, 2018

Conversation

richardlt
Copy link
Member

  1. Description
  2. Related issues
  3. About tests
  4. Mentions

@ovh/cds

@@ -29,16 +29,20 @@ export class QueueComponent implements OnDestroy {
requirementsList: Array<string> = [];
loading = true;

statusOptions: Array<string> = ['Waiting', 'Building', 'All'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an enum in pipeline model I think something like PipelineStatus

@@ -47,6 +51,21 @@ export class QueueComponent implements OnDestroy {
}
}

getQueueWorkerParams() {
console.log(this.status)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to delete


<table class="ui definition table" *ngIf="status && !loading">
<tbody>
<tr *ngFor="let line of status.lines" [ngClass]="{'error': line.status=='AL', 'warning': line.status=='WARN', 'positive': line.status=='WARN'}">
<td>
<tr *ngFor="let line of getStatusLines()" [ngClass]="{'error': line.status=='AL', 'warning': line.status=='WARN', 'positive': line.status=='WARN'}">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strict equals ===

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid using function in ngIf/ngFor etc..

onmessage = function (e) {
loadWorkflowRuns(e.data.user, e.data.session, e.data.api);
status = e.data.status;
if (!started) { loadWorkflowRuns(e.data.user, e.data.session, e.data.api); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiline could be more readable

loop(5, function () {
var url = '/queue/workflows';

if (status && status.length > 0) {
url = url.concat('?', status.map(function (s) { return "status=" + s; }).join('&'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

single quote 'status='

@@ -17,12 +24,15 @@ <h3>{{'admin_queue_title' | translate }} <span *ngIf="!loading && nodeJobRuns &&
</tr>
</thead>
<tbody>
<tr *ngFor="let wNodeJobRun of nodeJobRuns; let index = index">
<tr *ngFor="let wNodeJobRun of getNodeJobRuns(); let index = index">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's possible please avoid use function in template (to avoid performance issues)

@@ -3,10 +3,17 @@ <h3>{{'admin_queue_title' | translate }} <span *ngIf="!loading && nodeJobRuns &&

<div *ngIf="loading" class="ui active text loader">{{ 'common_loading' | translate }}</div>

<sm-select class="search fluid"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use sm-select but sui-select


<table class="ui definition table" *ngIf="status && !loading">
<tbody>
<tr *ngFor="let line of status.lines" [ngClass]="{'error': line.status=='AL', 'warning': line.status=='WARN', 'positive': line.status=='WARN'}">
<td>
<tr *ngFor="let line of getStatusLines()" [ngClass]="{'error': line.status=='AL', 'warning': line.status=='WARN', 'positive': line.status=='WARN'}">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid using function in ngIf/ngFor etc..


status, err := QueryStrings(r, "status")
if err != nil {
return sdk.WrapError(err, "getWorkflowJobQueueHandler> Cannot parse request")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case the error is not a sdk.Error and will be returned as a 500
you should do sdk.NewError(sdk.ErrWrongRequest, err)

@yesnault yesnault changed the title Feat improve queue and status pages feat(ui,api,cdsctl): Add filter to queue/workflows on status Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants