10000 feat(ui): all shared module component on push (#4425) · ovh/cds@6db0101 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 6db0101

Browse files
authored
feat(ui): all shared module component on push (#4425)
1 parent 5febad4 commit 6db0101

File tree

63 files changed

+464
-701
lines changed
  • list
  • favorite-cards
  • keys
  • labels/edit
  • modal
  • permission
  • prerequisites
  • project-breadcrumb
  • repomanager/from
  • scrollview
  • tabs
  • token/list
  • usage
  • vcs
  • vulnerability
  • warning
  • workflow-template
  • zone
  • store
  • views/project/show/workflow
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    63 files changed

    +464
    -701
    lines changed

    engine/api/feature/flipping.go

    Lines changed: 1 addition & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -12,9 +12,6 @@ const (
    1212
    // FeatEnableTracing is the opencensus tracing feature id
    1313
    FeatEnableTracing = "cds:tracing"
    1414

    15-
    // FeatWNode wnode workflow representation
    16-
    FeatWNode = "cds:wnode"
    17-
    1815
    cacheFeatureKey = "feature:"
    1916
    )
    2017

    @@ -33,7 +30,7 @@ type ProjectFeatures struct {
    3330

    3431
    // List all features
    3532
    func List() []string {
    36-
    return []string{FeatWNode, FeatEnableTracing}
    33+
    return []string{FeatEnableTracing}
    3734
    }
    3835

    3936
    // Init initialize Izanami client

    engine/api/workflow/dao_audit.go

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -19,7 +19,7 @@ func InsertAudit(db gorp.SqlExecutor, a *sdk.AuditWorkflow) error {
    1919
    // LoadAudits Load audits for the given workflow
    2020
    func LoadAudits(db gorp.SqlExecutor, workflowID int64) ([]sdk.AuditWorkflow, error) {
    2121
    query := `
    22-
    SELECT * FROM workflow_audit WHERE workflow_id = $1
    22+
    SELECT * FROM workflow_audit WHERE workflow_id = $1 ORDER BY created DESC
    2323
    `
    2424
    var audits []auditWorkflow
    2525
    if _, err := db.Select(&audits, query, workflowID); err != nil {

    sdk/workflow.go

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -244,7 +244,7 @@ func (label *Label) Validate() error {
    244244
    return WrapError(fmt.Errorf("Label must have a name"), "IsValid>")
    245245
    }
    246246
    if label.Color == "" {
    247-
    bytes := make([]byte, 4)
    247+
    bytes := make([]byte, 3)
    248248
    if _, err := rand.Read(bytes); err != nil {
    249249
    return WrapError(err, "IsValid> Cannot create random color")
    250250
    }

    ui/src/app/shared/audit/list/audit.list.component.ts

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,12 +1,13 @@
    1-
    import { Component, EventEmitter, Input, Output } from '@angular/core';
    1+
    import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
    22
    import { AuditWorkflow } from 'app/model/audit.model';
    33
    import { Item } from 'app/shared/diff/list/diff.list.component';
    44
    import { Column, ColumnType } from 'app/shared/table/data-table.component';
    55

    66
    @Component({
    77
    selector: 'app-audit-list',
    88
    templateUrl: './audit.list.html',
    9-
    styleUrls: ['./audit.list.scss']
    9+
    styleUrls: ['./audit.list.scss'],
    10+
    changeDetection: ChangeDetectionStrategy.OnPush
    1011
    })
    1112
    export class AuditListComponent {
    1213
    @Input() audits: Array<AuditWorkflow>;

    ui/src/app/shared/breadcrumb/breadcrumb.component.ts

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,4 +1,4 @@
    1-
    import { Component, Input } from '@angular/core';
    1+
    import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
    22

    33
    export class PathItem {
    44
    icon: string;
    @@ -12,7 +12,8 @@ export class PathItem {
    1212
    @Component({
    1313
    selector: 'app-breadcrumb',
    1414
    templateUrl: './breadcrumb.html',
    15-
    styleUrls: ['./breadcrumb.scss']
    15+
    styleUrls: ['./breadcrumb.scss'],
    16+
    changeDetection: ChangeDetectionStrategy.OnPush
    1617
    })
    1718
    export class BreadcrumbComponent {
    1819
    @Input() path: Array<PathItem>;

    ui/src/app/shared/button/confirm/confirm.button.ts

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,9 +1,10 @@
    1-
    import {Component, EventEmitter, Input, Output} from '@angular/core';
    1+
    import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
    22

    33
    @Component({
    44
    selector: 'app-confirm-button',
    55
    templateUrl: './confirm.button.html',
    6-
    styleUrls: ['./confirm.button.scss']
    6+
    styleUrls: ['./confirm.button.scss'],
    7+
    changeDetection: ChangeDetectionStrategy.OnPush
    78
    })
    89
    export class ConfirmButtonComponent {
    910
    @Input() loading = false;

    ui/src/app/shared/button/upload/upload.button.component.ts

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,9 +1,10 @@
    1-
    import {Component, EventEmitter, Input, Output} from '@angular/core';
    1+
    import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
    22

    33
    @Component({
    44
    selector: 'app-upload-button',
    55
    templateUrl: './upload.button.html',
    6-
    styleUrls: ['./upload.button.scss']
    6+
    styleUrls: ['./upload.button.scss'],
    7+
    changeDetection: ChangeDetectionStrategy.OnPush
    78
    })
    89
    export class UploadButtonComponent {
    910

    ui/src/app/shared/chart/chart.component.ts

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,10 +1,11 @@
    1-
    import {Component, Input} from '@angular/core';
    1+
    import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
    22
    import { GraphConfiguration } from 'app/model/graph.model';
    33

    44
    @Component({
    55
    selector: 'app-chart',
    66
    templateUrl: './chart.html',
    7-
    styleUrls: ['./chart.scss']
    7+
    styleUrls: ['./chart.scss'],
    8+
    changeDetection: ChangeDetectionStrategy.OnPush
    89
    })
    910
    export class ChartComponentComponent {
    1011

    ui/src/app/shared/commit/commit.list.component.ts

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,11 +1,12 @@
    1-
    import { Component, Input } from '@angular/core';
    1+
    import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
    22
    import { Commit } from 'app/model/repositories.model';
    33
    import { Table } from 'app/shared/table/table';
    44

    55
    @Component({
    66
    selector: 'app-commit-list',
    77
    templateUrl: './commit.list.html',
    8-
    styleUrls: ['./commit.list.scss']
    8+
    styleUrls: ['./commit.list.scss'],
    9+
    changeDetection: ChangeDetectionStrategy.OnPush
    910
    })
    1011
    export class CommitListComponent extends Table<Commit> {
    1112
    @Input() commits: Array<Commit>;

    ui/src/app/shared/diff/item/diff.item.component.ts

    Lines changed: 16 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,8 +1,17 @@
    1-
    import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
    1+
    import {
    2+
    ChangeDetectionStrategy,
    3+
    ChangeDetectorRef,
    4+
    Component,
    5+
    Input,
    6+
    OnChanges,
    7+
    OnInit,
    8+
    ViewChild
    9+
    } from '@angular/core';
    210
    import { ThemeStore } from 'app/service/theme/theme.store';
    311
    import { AutoUnsubscribe } from 'app/shared/decorator/autoUnsubscribe';
    412
    import * as JsDiff from 'diff';
    513
    import { Subscription } from 'rxjs';
    14+
    import { finalize } from 'rxjs/operators';
    615

    716
    export class Mode {
    817
    static UNIFIED = 'unified';
    @@ -12,7 +21,8 @@ export class Mode {
    1221
    @Component({
    1322
    selector: 'app-diff-item',
    1423
    templateUrl: './diff.item.html',
    15-
    styleUrls: ['./diff.item.scss']
    24+
    styleUrls: ['./diff.item.scss'],
    25+
    changeDetection: ChangeDetectionStrategy.OnPush
    1626
    })
    1727
    @AutoUnsubscribe()
    1828
    export class DiffItemComponent implements OnInit, OnChanges {
    @@ -31,7 +41,7 @@ export class DiffItemComponent implements OnInit, OnChanges {
    3141
    themeSubscription: Subscription;
    3242

    3343
    constructor(
    34-
    private _theme: ThemeStore
    44+
    private _theme: ThemeStore, private _cd: ChangeDetectorRef
    3545
    ) { }
    3646

    3747
    ngOnInit() {
    @@ -45,7 +55,9 @@ export class DiffItemComponent implements OnInit, OnChanges {
    4555
    lineNumbers: true
    4656
    };
    4757

    48-
    this.themeSubscription = this._theme.get().subscribe(t => {
    58+
    this.themeSubscription = this._theme.get()
    59+
    .pipe(finalize(() => this._cd.markForCheck()))
    60+
    .subscribe(t => {
    4961
    this.codeMirrorConfig.theme = t === 'night' ? 'darcula' : 'default';
    5062
    if (this.codeLeft && this.codeLeft.instance) {
    5163
    this.codeLeft.instance.setOption('theme', this.codeMirrorConfig.theme);

    0 commit comments

    Comments
     (0)
    0