From fd1ab46223cb4705dd498cd76d55dc397fb5e38a Mon Sep 17 00:00:00 2001 From: Guiheux Steven Date: Fri, 10 Jun 2022 11:06:15 +0200 Subject: [PATCH] refactor(ui): remove ng-semantic (#6200) * feat: remove last sm-select * feat(ui): refact node wizard * feat(ui): remove ng-semantic * fix(ui): adjust css on application create view * fix(ui): unit test * fix(ui): translate * fix(ui): removing debugging true --- ui/package-lock.json | 33 - ui/package.json | 1 - ui/src/app/model/workflow.model.ts | 7 + .../repomanager/from/repomanager.form.html | 29 +- .../repomanager/from/repomanager.form.scss | 18 +- .../repomanager/from/repomanager.form.spec.ts | 113 --- .../form/requirements.form.component.ts | 1 + .../requirements/form/requirements.form.html | 2 +- .../value/requirements.value.component.ts | 11 +- ui/src/app/shared/shared.module.ts | 9 +- .../shared/variable/form/variable.form.html | 61 +- .../shared/variable/form/variable.form.scss | 15 +- .../variable/form/variable.form.spec.ts | 10 +- .../shared/variable/value/variable.value.html | 21 +- .../node-add/workflow.trigger.component.ts | 7 +- .../modal/node-add/workflow.trigger.html | 1 - .../modal/node-add/workflow.trigger.scss | 3 + .../wizard/node-add/node.wizard.component.ts | 118 +-- .../workflow/wizard/node-add/node.wizard.html | 481 +++++------ .../workflow/wizard/node-add/node.wizard.scss | 32 +- .../shared/workflow/wnode/wnode.component.ts | 2 +- ui/src/app/store/environment.state.ts | 5 +- ui/src/app/store/project.action.ts | 7 + ui/src/app/store/project.state.ts | 18 + .../add/application.add.component.ts | 4 + .../application/add/application.add.html | 112 ++- .../application/add/application.add.scss | 17 +- .../admin/repository/application.repo.html | 2 +- .../workflow/pipeline.workflow.component.ts | 1 - .../list/project.integration.list.html | 2 +- .../action/form/action.form.component.ts | 1 - .../settings/action/form/action.form.html | 2 +- .../group/edit/group.edit.component.ts | 21 +- .../views/settings/group/edit/group.edit.html | 257 +++--- .../views/settings/group/edit/group.edit.scss | 43 +- .../views/settings/user/edit/user.edit.html | 12 +- .../views/settings/user/edit/user.edit.scss | 4 +- .../form/worker-model.form.component.ts | 21 +- .../worker-model/form/worker-model.form.html | 770 ++++++++++-------- .../worker-model/form/worker-model.form.scss | 41 + .../form/workflow-template.form.html | 16 +- .../form/workflow-template.form.scss | 4 + .../app/views/workflow/add/workflow.add.html | 2 +- .../workflow/run/node/pipeline/pipeline.html | 3 +- ui/src/assets/i18n/en.json | 36 - ui/src/styles.scss | 7 + 46 files changed, 1212 insertions(+), 1171 deletions(-) delete mode 100644 ui/src/app/shared/repomanager/from/repomanager.form.spec.ts create mode 100644 ui/src/app/shared/workflow/modal/node-add/workflow.trigger.scss diff --git a/ui/package-lock.json b/ui/package-lock.json index 4e63ee2c4a..9078339fa1 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -27,7 +27,6 @@ "@ngxs/store": "3.7.3", "@richardlt/ng2-semantic-ui": "0.10.0-alpha.6-fork-6", "@sgu/auto-complete": "13.0.0-rc", - "@sgu/ng-semantic": "13.0.0-rc2", "@swimlane/ngx-charts": "16.0.0", "@types/dagre-d3": "0.6.2", "@types/js-yaml": "3.12.2", @@ -5382,23 +5381,6 @@ "@angular/core": "^13.0.0" } }, - "node_modules/@sgu/ng-semantic": { - "version": "13.0.0-rc2", - "resolved": "https://registry.npmjs.org/@sgu/ng-semantic/-/ng-semantic-13.0.0-rc2.tgz", - "integrity": "sha512-zI8CEOzzrLR0zZKn2Pu97U6CZ0OmbMblqSsBhF8OBzD4QIfmblhdESRjhsst46spt3do3j7xPv+p/8S1uNt0VQ==", - "dependencies": { - "tslib": "^2.3.0" - }, - "peerDependencies": { - "@angular/common": ">= 13.3.0", - "@angular/core": ">= 13.3.0" - } - }, - "node_modules/@sgu/ng-semantic/node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - }, "node_modules/@socket.io/base64-arraybuffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", @@ -31359,21 +31341,6 @@ "tslib": "^2.0.0" } }, - "@sgu/ng-semantic": { - "version": "13.0.0-rc2", - "resolved": "https://registry.npmjs.org/@sgu/ng-semantic/-/ng-semantic-13.0.0-rc2.tgz", - "integrity": "sha512-zI8CEOzzrLR0zZKn2Pu97U6CZ0OmbMblqSsBhF8OBzD4QIfmblhdESRjhsst46spt3do3j7xPv+p/8S1uNt0VQ==", - "requires": { - "tslib": "^2.3.0" - }, - "dependencies": { - "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - } - } - }, "@socket.io/base64-arraybuffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", diff --git a/ui/package.json b/ui/package.json index 69a6a3eb96..53e77dfd52 100644 --- a/ui/package.json +++ b/ui/package.json @@ -45,7 +45,6 @@ "@ngxs/store": "3.7.3", "@richardlt/ng2-semantic-ui": "0.10.0-alpha.6-fork-6", "@sgu/auto-complete": "13.0.0-rc", - "@sgu/ng-semantic": "13.0.0-rc2", "@swimlane/ngx-charts": "16.0.0", "@types/dagre-d3": "0.6.2", "@types/js-yaml": "3.12.2", diff --git a/ui/src/app/model/workflow.model.ts b/ui/src/app/model/workflow.model.ts index acdfeb4ba6..383951577d 100644 --- a/ui/src/app/model/workflow.model.ts +++ b/ui/src/app/model/workflow.model.ts @@ -647,6 +647,13 @@ export class WNodeContext { default_pipeline_parameters: Array; conditions: WorkflowNodeConditions; mutex: boolean; + + constructor() { + this.pipeline_id = 0; + this.application_id = 0; + this.project_integration_id = 0; + this.environment_id = 0; + } } export class WNodeOutgoingHook { diff --git a/ui/src/app/shared/repomanager/from/repomanager.form.html b/ui/src/app/shared/repomanager/from/repomanager.form.html index c80516144a..589894379b 100644 --- a/ui/src/app/shared/repomanager/from/repomanager.form.html +++ b/ui/src/app/shared/repomanager/from/repomanager.form.html @@ -1,16 +1,21 @@ -
-
-
- - - -
-
- -
-
+ +
diff --git a/ui/src/app/shared/repomanager/from/repomanager.form.scss b/ui/src/app/shared/repomanager/from/repomanager.form.scss index 667fa12d01..c191ea0377 100644 --- a/ui/src/app/shared/repomanager/from/repomanager.form.scss +++ b/ui/src/app/shared/repomanager/from/repomanager.form.scss @@ -1,12 +1,10 @@ -modal-content { - .ui.input { - margin-top: 20px; - } - input[type=text] { - margin-right: 30px; - } +nz-select { + width: 100%; +} + +nz-col { + button { + float: right; + } } -.ui.form .fields { - margin-bottom: 0px; -} \ No newline at end of file diff --git a/ui/src/app/shared/repomanager/from/repomanager.form.spec.ts b/ui/src/app/shared/repomanager/from/repomanager.form.spec.ts deleted file mode 100644 index 27e1210c3c..0000000000 --- a/ui/src/app/shared/repomanager/from/repomanager.form.spec.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { HttpRequest } from '@angular/common/http'; -import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; -import { CUSTOM_ELEMENTS_SCHEMA, Injector } from '@angular/core'; -import { fakeAsync, getTestBed, TestBed, tick } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader, TranslateModule, TranslateParser, TranslateService } from '@ngx-translate/core'; -import { ApplicationService } from 'app/service/application/application.service'; -import { AuthenticationService } from 'app/service/authentication/authentication.service'; -import { HelpService } from 'app/service/help/help.service'; -import { MonitoringService, RouterService } from 'app/service/services.module'; -import { UserService } from 'app/service/user/user.service'; -import { WorkflowRunService } from 'app/service/workflow/run/workflow.run.service'; -import { WorkflowService } from 'app/service/workflow/workflow.service'; -import { NgxsStoreModule } from 'app/store/store.module'; -import { Project } from 'app/model/project.model'; -import { RepositoriesManager } from 'app/model/repositories.model'; -import { EnvironmentService } from 'app/service/environment/environment.service'; -import { NavbarService } from 'app/service/navbar/navbar.service'; -import { PipelineService } from 'app/service/pipeline/pipeline.service'; -import { ProjectService } from 'app/service/project/project.service'; -import { ProjectStore } from 'app/service/project/project.store'; -import { RepoManagerService } from 'app/service/repomanager/project.repomanager.service'; -import { VariableService } from 'app/service/variable/variable.service'; -import { SharedModule } from 'app/shared/shared.module'; -import { RepoManagerFormComponent } from './repomanager.form.component'; -import { NzNotificationModule } from 'ng-zorro-antd/notification'; - - -describe('CDS: Project RepoManager Form Component', () => { - - let injector: Injector; - let projectStore: ProjectStore; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - providers: [ - ApplicationService, - TranslateLoader, - RepoManagerService, - ProjectStore, - ProjectService, - PipelineService, - EnvironmentService, - VariableService, - NzNotificationModule, - HelpService, - TranslateService, - TranslateParser, - NavbarService, - WorkflowService, - WorkflowRunService, - UserService, - AuthenticationService, - MonitoringService, - RouterService - ], - imports: [ - SharedModule, - NgxsStoreModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - HttpClientTestingModule - ], - schemas: [ - CUSTOM_ELEMENTS_SCHEMA - ] - }).compileComponents(); - injector = getTestBed(); - projectStore = injector.get(ProjectStore); - - }); - - afterEach(() => { - injector = undefined; - projectStore = undefined; - }); - - - it('Add new repo manager', fakeAsync(() => { - const http = TestBed.get(HttpTestingController); - - let repoManMock = new Array(); - let stash = new RepositoriesManager(); - stash.name = 'stash.com'; - let github = new RepositoriesManager(); - github.name = 'github.com'; - repoManMock.push(stash, github); - - let projectMock = new Project(); - projectMock.name = 'prj1'; - projectMock.key = 'key1'; - projectMock.last_modified = '0'; - projectMock.vcs_servers = []; - - // Create Project RepoManager Form Component - let fixture = TestBed.createComponent(RepoManagerFormComponent); - let component = fixture.debugElement.componentInstance; - http.expectOne(((req: HttpRequest) => req.url === '/repositories_manager')).flush(repoManMock); - expect(component).toBeTruthy(); - - fixture.detectChanges(); - tick(50); - - expect(fixture.debugElement.nativeElement.querySelector('.ui.button.disabled')).toBeTruthy(); - - fixture.detectChanges(); - tick(50); - - // Load project - projectStore.getProjects('key1').subscribe(() => { }); - http.expectOne(((req: HttpRequest) => req.url === '/project/key1')).flush(repoManMock); - })); -}); diff --git a/ui/src/app/shared/requirements/form/requirements.form.component.ts b/ui/src/app/shared/requirements/form/requirements.form.component.ts index c7b073f050..8c52e5d351 100644 --- a/ui/src/app/shared/requirements/form/requirements.form.component.ts +++ b/ui/src/app/shared/requirements/form/requirements.form.component.ts @@ -55,6 +55,7 @@ export class RequirementsFormComponent implements OnInit { @Output() event = new EventEmitter(); newRequirement: Requirement = new Requirement('binary'); + requirementType: string = 'binary'; availableRequirements: Array; _suggest: Array = []; suggestWithWorkerModel: Array = []; diff --git a/ui/src/app/shared/requirements/form/requirements.form.html b/ui/src/app/shared/requirements/form/requirements.form.html index 45d0a47d44..905a5df5a6 100644 --- a/ui/src/app/shared/requirements/form/requirements.form.html +++ b/ui/src/app/shared/requirements/form/requirements.form.html @@ -2,7 +2,7 @@
- diff --git a/ui/src/app/shared/requirements/value/requirements.value.component.ts b/ui/src/app/shared/requirements/value/requirements.value.component.ts index 159623c951..a58d5d4922 100644 --- a/ui/src/app/shared/requirements/value/requirements.value.component.ts +++ b/ui/src/app/shared/requirements/value/requirements.value.component.ts @@ -3,9 +3,9 @@ import { ChangeDetectorRef, Component, EventEmitter, - Input, + Input, OnChanges, OnInit, - Output + Output, SimpleChanges } from '@angular/core'; import { Requirement } from 'app/model/requirement.model'; import { WorkerModel } from 'app/model/worker-model.model'; @@ -16,7 +16,7 @@ import { WorkerModel } from 'app/model/worker-model.model'; styleUrls: ['./requirements.value.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) -export class RequirementsValueComponent implements OnInit { +export class RequirementsValueComponent implements OnInit, OnChanges { @Input() requirement: Requirement @Output() requirementChange = new EventEmitter(); @@ -39,6 +39,11 @@ export class RequirementsValueComponent implements OnInit { this._cd.markForCheck(); } + ngOnChanges(changes: SimpleChanges) { + this.initFilter(this.requirement); + this._cd.markForCheck(); + } + initFilter(r: Requirement): void { this.requirement = r; this.aggregatedSuggestions = new Array(); diff --git a/ui/src/app/shared/shared.module.ts b/ui/src/app/shared/shared.module.ts index 53f2c48ccb..4380c47d42 100644 --- a/ui/src/app/shared/shared.module.ts +++ b/ui/src/app/shared/shared.module.ts @@ -5,7 +5,6 @@ import { RouterModule } from '@angular/router'; import { NguiAutoCompleteModule } from '@sgu/auto-complete'; import { TranslateModule } from '@ngx-translate/core'; import { SuiModule } from '@richardlt/ng2-semantic-ui'; -import { NgxSemanticModule } from '@sgu/ng-semantic'; import { NgxChartsModule } from '@swimlane/ngx-charts'; import { AuthenticationGuard } from 'app/guard/authentication.guard'; import { FeatureGuard } from 'app/guard/feature.guard'; @@ -145,6 +144,8 @@ import { NzSpinModule } from 'ng-zorro-antd/spin'; import { NzCollapseModule } from 'ng-zorro-antd/collapse'; import { RequirementsValueComponent } from 'app/shared/requirements/value/requirements.value.component'; import { NzDividerModule } from 'ng-zorro-antd/divider'; +import { NzRadioModule } from 'ng-zorro-antd/radio'; +import { NzStepsModule } from 'ng-zorro-antd/steps'; const ngZorroConfig: NzConfig = { notification: {nzPauseOnHover: true, nzPlacement: "topRight"}, @@ -175,8 +176,10 @@ const icons: IconDefinition[] = [ BellFill, BookOutline, CaretDownFill, CaretRig NzMenuModule, NzPopconfirmModule, NzPopoverModule, + NzRadioModule, NzSelectModule, NzSpinModule, + NzStepsModule, NzSwitchModule, NzTabsModule, NzTableModule, @@ -185,7 +188,6 @@ const icons: IconDefinition[] = [ BellFill, BookOutline, CaretDownFill, CaretRig NzUploadModule, CommonModule, ClipboardModule, - NgxSemanticModule, FormsModule, TranslateModule, DragulaModule.forRoot(), @@ -351,7 +353,6 @@ const icons: IconDefinition[] = [ BellFill, BookOutline, CaretDownFill, CaretRig MomentModule, NzAutocompleteModule, NgForNumber, - NgxSemanticModule, NgxAutoScrollDirective, NzAlertModule, NzBadgeModule, @@ -372,8 +373,10 @@ const icons: IconDefinition[] = [ BellFill, BookOutline, CaretDownFill, CaretRig NzNotificationModule, NzPopconfirmModule, NzPopoverModule, + NzRadioModule, NzSelectModule, NzSpinModule, + NzStepsModule, NzSwitchModule, NzTabsModule, NzTagModule, diff --git a/ui/src/app/shared/variable/form/variable.form.html b/ui/src/app/shared/variable/form/variable.form.html index ff89561c6f..b0912a5adf 100644 --- a/ui/src/app/shared/variable/form/variable.form.html +++ b/ui/src/app/shared/variable/form/variable.form.html @@ -1,27 +1,36 @@ -
-
-
- - -
-
- - - - -
-
- - -
-
- -
-
+ + + + + Name + + + + + + + + Type + + + + + + + + + + Value + + + + + + + + +
diff --git a/ui/src/app/shared/variable/form/variable.form.scss b/ui/src/app/shared/variable/form/variable.form.scss index 90c61a691e..5019b31849 100644 --- a/ui/src/app/shared/variable/form/variable.form.scss +++ b/ui/src/app/shared/variable/form/variable.form.scss @@ -1,15 +1,8 @@ -.ui.form { +nz-col { + padding: 0 10px; - .field > label { - color: grey; + button { + float: right; } - - .field { - .ui.button { - margin-top: 1.75em; - } - } - } - diff --git a/ui/src/app/shared/variable/form/variable.form.spec.ts b/ui/src/app/shared/variable/form/variable.form.spec.ts index 3b799cc314..9a102d535f 100644 --- a/ui/src/app/shared/variable/form/variable.form.spec.ts +++ b/ui/src/app/shared/variable/form/variable.form.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import {TestBed, tick, fakeAsync} from '@angular/core/testing'; +import {TestBed, tick, fakeAsync, flush} from '@angular/core/testing'; import {TranslateService, TranslateLoader, TranslateParser, TranslateModule} from '@ngx-translate/core'; import {RouterTestingModule} from '@angular/router/testing'; import {HttpClientTestingModule} from '@angular/common/http/testing'; @@ -12,6 +12,7 @@ import {SharedModule} from '../../shared.module'; import {SharedService} from '../../shared.service'; import {VariableService} from '../../../service/variable/variable.service'; import {VariableFormComponent} from './variable.form'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('CDS: Variable From Component', () => { @@ -28,6 +29,7 @@ describe('CDS: Variable From Component', () => { TranslateParser ], imports : [ + BrowserAnimationsModule, SharedModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), @@ -47,7 +49,7 @@ describe('CDS: Variable From Component', () => { fixture.detectChanges(); tick(50); - expect(fixture.debugElement.nativeElement.querySelector('.ui.button.disabled')).toBeTruthy(); + expect(fixture.debugElement.nativeElement.querySelector('button[name="saveBtn"][disabled="true"]')).toBeTruthy(); let compiled = fixture.debugElement.nativeElement; @@ -75,9 +77,11 @@ describe('CDS: Variable From Component', () => { inputValue.dispatchEvent(new Event('change')); spyOn(fixture.componentInstance.createVariableEvent, 'emit'); - compiled.querySelector('.ui.green.button').click(); + compiled.querySelector('button[name="saveBtn"]').click(); expect(fixture.componentInstance.createVariableEvent.emit).toHaveBeenCalledWith(new VariableEvent('add', variable)); + + flush() })); }); diff --git a/ui/src/app/shared/variable/value/variable.value.html b/ui/src/app/shared/variable/value/variable.value.html index c41aeaf52f..358bf8a471 100644 --- a/ui/src/app/shared/variable/value/variable.value.html +++ b/ui/src/app/shared/variable/value/variable.value.html @@ -1,7 +1,7 @@ -
- +
+
@@ -11,23 +11,18 @@
-
- +
+
-
- -
- - -
- +
+
-
- +
+
diff --git a/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.component.ts b/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.component.ts index 95bd32de98..135490a2c4 100644 --- a/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.component.ts +++ b/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.component.ts @@ -29,6 +29,7 @@ import { NzModalRef } from 'ng-zorro-antd/modal'; @Component({ selector: 'app-workflow-trigger', templateUrl: './workflow.trigger.html', + styleUrls: ['workflow.trigger.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) export class WorkflowTriggerComponent { @@ -44,7 +45,7 @@ export class WorkflowTriggerComponent { @Input() destination: string; destNode: WNode; - currentSection = 'pipeline'; + currentSection: number; selectedType: string; isParent: boolean; @@ -59,7 +60,7 @@ export class WorkflowTriggerComponent { this.destNode = node; } - pipelineSectionChanged(pipSection: string) { + pipelineSectionChanged(pipSection: number) { this.currentSection = pipSection; } @@ -162,7 +163,7 @@ export class WorkflowTriggerComponent { nextStep() { this.nodeWizard.goToNextSection().subscribe((section) => { - if (section === 'done') { + if (section === 4) { this.saveTrigger(); } else { this.currentSection = section; diff --git a/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.html b/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.html index f00aa2514f..3344aabe4b 100644 --- a/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.html +++ b/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.html @@ -1,6 +1,5 @@
-

{{ 'workflow_node_form_title' | translate }}

diff --git a/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.scss b/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.scss new file mode 100644 index 0000000000..b4a7957942 --- /dev/null +++ b/ui/src/app/shared/workflow/modal/node-add/workflow.trigger.scss @@ -0,0 +1,3 @@ +h3 { + margin-bottom: 20px; +} diff --git a/ui/src/app/shared/workflow/wizard/node-add/node.wizard.component.ts b/ui/src/app/shared/workflow/wizard/node-add/node.wizard.component.ts index 72619d6b20..33a25b7d44 100644 --- a/ui/src/app/shared/workflow/wizard/node-add/node.wizard.component.ts +++ b/ui/src/app/shared/workflow/wizard/node-add/node.wizard.component.ts @@ -45,9 +45,8 @@ export class WorkflowNodeAddWizardComponent implements OnInit { @Input() hideCancel: boolean; @Input() hideNext: boolean; @Input() loading: boolean; - @Input() canCreateFork: boolean; @Output() nodeCreated: EventEmitter = new EventEmitter(); - @Output() pipelineSectionChanged: EventEmitter = new EventEmitter(); + @Output() pipelineSectionChanged: EventEmitter = new EventEmitter(); _project: Project; node: WNode = new WNode(); @@ -55,60 +54,29 @@ export class WorkflowNodeAddWizardComponent implements OnInit { applicationsName: IdName[] = []; environmentsName: IdName[] = []; - // Pipeline section - set createNewPipeline(data: boolean) { - this._createNewPipeline = data; - if (data) { - this.newPipeline = new Pipeline(); - this.node.context.pipeline_id = null; - } - } - get createNewPipeline() { - return this._createNewPipeline; - } + pipIndexTab: number; + appIndexTab: number; + envIndexTab: number; + errorPipelineNamePattern = false; loadingCreatePipeline = false; newPipeline: Pipeline = new Pipeline(); - set pipelineSection(data: 'pipeline' | 'application' | 'environment' | 'integration') { + set pipelineSection(data: number) { this._pipelineSection = data; this.pipelineSectionChanged.emit(data); } get pipelineSection() { return this._pipelineSection; } - _pipelineSection: 'pipeline' | 'application' | 'environment' | 'integration' = 'pipeline'; - _createNewPipeline = false; + _pipelineSection: number = 0; + - // Application details - set createNewApplication(data: boolean) { - this._createNewApplication = data; - if (data) { - this.newApplication = new Application(); - this.node.context.application_id = null; - } - } - get createNewApplication() { - return this._createNewApplication; - } errorApplicationNamePattern = false; loadingCreateApplication = false; newApplication: Application = new Application(); - _createNewApplication = false; - // Environment details - set createNewEnvironment(data: boolean) { - this._createNewEnvironment = data; - if (data) { - this.newEnvironment = new Environment(); - this.node.context.environment_id = null; - } - } - get createNewEnvironment() { - return this._createNewEnvironment; - } loadingCreateEnvironment = false; newEnvironment: Environment = new Environment(); - _createNewEnvironment = false; integrations: IdName[] = []; loadingIntegrations = false; createFork = false; @@ -125,16 +93,6 @@ export class WorkflowNodeAddWizardComponent implements OnInit { } ngOnInit() { - if (!this.project.pipeline_names || !this.project.pipeline_names.length) { - this.createNewPipeline = true; - } - if (!this.project.application_names || !this.project.application_names.length) { - this.createNewApplication = true; - } - if (!this.project.environments || !this.project.environments.length) { - this.createNewEnvironment = true; - } - if (Array.isArray(this.project.application_names)) { let voidApp = new IdName(); voidApp.id = 0; @@ -194,18 +152,19 @@ export class WorkflowNodeAddWizardComponent implements OnInit { map((pip: PipelinesStateModel) => { this._toast.success('', this._translate.instant('pipeline_added')); this.node.context.pipeline_id = pip.pipeline.id; - this.pipelineSection = 'application'; + this.pipelineSection = 1; return pip.pipeline; })); } - selectOrCreatePipeline(): Observable { - if (this.createNewPipeline) { + selectOrCreatePipeline(): Observable { + if (this.pipIndexTab === 1) { return this.createPipeline().pipe( - map(() => 'application')); + map(() => 1)); } - this.pipelineSection = 'application'; - return observableOf('application'); + this.pipelineSection = 1; + this._cd.markForCheck(); + return observableOf(1); } createApplication(): Observable { @@ -229,20 +188,21 @@ export class WorkflowNodeAddWizardComponent implements OnInit { map((s: ApplicationStateModel) => { this._toast.success('', this._translate.instant('application_created')); this.node.context.application_id = s.application.id; - this.pipelineSection = 'environment'; + this.pipelineSection = 2; return s.application; }) ); } - selectOrCreateApplication(): Observable { - if (this.createNewApplication && this.newApplication.name) { + selectOrCreateApplication(): Observable { + if (this.appIndexTab && this.newApplication.name) { return this.createApplication().pipe( - map(() => 'environment')); + map(() => 2)); } this.getIntegrations(); - this.pipelineSection = 'environment'; - return observableOf('environment'); + this.pipelineSection = 2; + this._cd.markForCheck(); + return observableOf(2); } getIntegrations() { @@ -277,9 +237,6 @@ export class WorkflowNodeAddWizardComponent implements OnInit { this.integrations.push(idName); } }); - if (this.integrations.length) { - this.integrations.unshift(new IdName()); - } } ); } @@ -302,7 +259,7 @@ export class WorkflowNodeAddWizardComponent implements OnInit { if (!this.node.context.application_id) { this.createNode(); } else { - this.pipelineSection = 'integration'; + this.pipelineSection = 3; } return proj; }) @@ -310,33 +267,40 @@ export class WorkflowNodeAddWizardComponent implements OnInit { } selectOrCreateEnvironment() { - if (this.createNewEnvironment && this.newEnvironment.name) { + if (this.envIndexTab === 1 && this.newEnvironment.name) { return this.createEnvironment().pipe( - map(() => 'integration')); + map(() => 3)); } let noIntegrationsAvailable = !this.loadingIntegrations && (!this.integrations || !this.integrations.length); if (!this.node.context.application_id || noIntegrationsAvailable) { this.createNode(); - return observableOf('done'); + return observableOf(4); } - this.pipelineSection = 'integration'; - return observableOf('integration'); + this.pipelineSection = 3; + this._cd.markForCheck(); + return observableOf(3); } selectOrCreateIntegration() { this.createNode(); - return observableOf('done'); + return observableOf(4); + } + + public goToPreviousSection() { + this.pipelineSection--; + this._cd.markForCheck(); + } - public goToNextSection(): Observable { + public goToNextSection(): Observable { switch (this.pipelineSection) { - case 'pipeline': + case 0: return this.selectOrCreatePipeline(); - case 'application': + case 1: return this.selectOrCreateApplication(); - case 'environment': + case 2: return this.selectOrCreateEnvironment(); - case 'integration': + case 3: return this.selectOrCreateIntegration(); } } diff --git a/ui/src/app/shared/workflow/wizard/node-add/node.wizard.html b/ui/src/app/shared/workflow/wizard/node-add/node.wizard.html index 4748e205d2..6878020509 100644 --- a/ui/src/app/shared/workflow/wizard/node-add/node.wizard.html +++ b/ui/src/app/shared/workflow/wizard/node-add/node.wizard.html @@ -1,275 +1,206 @@ -
-
-
-
-
-
- -
-
{{'common_pipeline' | translate}}
-
-
-
- -
-
{{'common_application' | translate}}
-
{{'action_optional' | translate}}
-
-
-
- -
-
{{'common_environment' | translate}}
-
{{'common_optional' | translate}}
-
-
-
- -
-
{{'common_integration' | translate}}
-
{{'common_optional' | translate}}
-
-
-
-
-
- - -
-
-
-
- - - -
-
-
-
-
- -
-
- - - - - - - - - -
- {{ 'pipeline_name_error' | translate }} -
-
- - - -
- -
-
-
-
-
-
- - -
-
-
- -
-
-
-
- - -
-
-
-
-
- -
-
- - - - - - - - - -
- {{ 'application_name_error' | translate }} -
-
-
-
-
-
-
-
-
- - -
-
-
- -
-
-
-
- - -
-
-
-
-
- -
-
- - - - - - - - - - -
-
-
-
-
-
-
- - -
-
-
- -
-
-
-
-
-
- - - - - -
-
-
-
-
-
- - -
-
-
-
-
-
-
-
+
+ + + + + + + + + + + + +
+ + + + + + Select pipeline + + + + + + + + + + + + + {{ 'workflow_root_context_mutex' | translate }} + + + + + + + + + + + + + New pipeline name + + + + + + + + + {{ 'workflow_root_context_mutex' | translate }} + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + Select an application + + + + + + + + + + + New application name + + + + + + + + + + + + + + + + +
+ +
+ + + + + + Select an environment + + + + + + + + + + + New environment name + + + + + + + + + + + + + + + +
+ +
+ + + + Integration + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/ui/src/app/shared/workflow/wizard/node-add/node.wizard.scss b/ui/src/app/shared/workflow/wizard/node-add/node.wizard.scss index e00ae7e6d1..40a1fd288d 100644 --- a/ui/src/app/shared/workflow/wizard/node-add/node.wizard.scss +++ b/ui/src/app/shared/workflow/wizard/node-add/node.wizard.scss @@ -1,3 +1,31 @@ -.mb20 { - margin-bottom: 20px; +nz-row { + width: 100%; + margin-bottom: 15px; + + nz-col { + padding: 0 10px; + + form { + margin-top: 10px; + } + + button { + float: right; + margin-left: 15px; + } + } } +nz-tabset { + width: 100%; +} +nz-select { + width: 100%; +} +nz-form-item { + padding-bottom: 15px; + padding-top: 15px; +} +form { + width: 100%; +} + diff --git a/ui/src/app/shared/workflow/wnode/wnode.component.ts b/ui/src/app/shared/workflow/wnode/wnode.component.ts index 8bca08db00..32ee6d173e 100644 --- a/ui/src/app/shared/workflow/wnode/wnode.component.ts +++ b/ui/src/app/shared/workflow/wnode/wnode.component.ts @@ -237,7 +237,7 @@ export class WorkflowWNodeComponent implements OnInit, OnDestroy { } this._modalService.create({ nzTitle: title, - nzWidth: '900px', + nzWidth: '1300px', nzContent: WorkflowTriggerComponent, nzComponentParams: { project: this.project, diff --git a/ui/src/app/store/environment.state.ts b/ui/src/app/store/environment.state.ts index 3e4f7df2a6..de4442e3f7 100644 --- a/ui/src/app/store/environment.state.ts +++ b/ui/src/app/store/environment.state.ts @@ -9,6 +9,7 @@ import { EnvironmentService } from 'app/service/environment/environment.service' import { cloneDeep } from 'lodash-es'; import { tap } from 'rxjs/operators'; import * as ActionEnvironment from './environment.action'; +import * as ActionProject from 'app/store/project.action'; export class EnvironmentStateModel { public environment: Environment; @@ -49,14 +50,16 @@ export class EnvironmentState { return this._http.post('/project/' + action.payload.projectKey + '/environment', action.payload.environment) .pipe(tap((project: Project) => { const state = ctx.getState(); + let env = project.environments.find(e => e.name === action.payload.environment.name); ctx.setState({ ...state, currentProjectKey: action.payload.projectKey, - environment: project.environments.find(e => e.name === action.payload.environment.name), + environment: env, loading: false, editEnvironment: null, editMode: false }); + ctx.dispatch(new ActionProject.AddEnvironmentInProject(env)); })); } diff --git a/ui/src/app/store/project.action.ts b/ui/src/app/store/project.action.ts index 1a35ed1c83..b15f04065f 100644 --- a/ui/src/app/store/project.action.ts +++ b/ui/src/app/store/project.action.ts @@ -7,6 +7,7 @@ import { Pipeline } from 'app/model/pipeline.model'; import { Label, LoadOpts, Project } from 'app/model/project.model'; import { Variable } from 'app/model/variable.model'; import { Workflow } from 'app/model/workflow.model'; +import { Environment } from 'app/model/environment.model'; // Use to load fetched Project in our app export class LoadProject { @@ -83,6 +84,12 @@ export class DeleteVariableInProject { constructor(public payload: Variable) { } } +// ---------Environment --------- // +export class AddEnvironmentInProject { + static readonly type = '[Project] Add environment in Project'; + constructor(public payload: Environment) { } +} + // ------- Application --------- // export class AddApplicationInProject { static readonly type = '[Project] Add application in Project'; diff --git a/ui/src/app/store/project.state.ts b/ui/src/app/store/project.state.ts index f22a41ba15..2bad81d269 100644 --- a/ui/src/app/store/project.state.ts +++ b/ui/src/app/store/project.state.ts @@ -424,6 +424,24 @@ export class ProjectState { })); } + // ------- Environment --------- // + @Action(ProjectAction.AddEnvironmentInProject) + addEnvironment(ctx: StateContext, action: ProjectAction.AddEnvironmentInProject) { + const state = ctx.getState(); + let environments = state.project.environments ? state.project.environments.concat([action.payload]) : [action.payload]; + let environment_names = state.project.environment_names ? state.project.environment_names.concat([]) : []; + + let idName = new IdName(); + idName.id = action.payload.id; + idName.name = action.payload.name; + environment_names.push(idName); + + return ctx.setState({ + ...state, + project: Object.assign({}, state.project, { environments, environment_names }), + }); + } + // ------- Application --------- // @Action(ProjectAction.AddApplicationInProject) addApplication(ctx: StateContext, action: ProjectAction.AddApplicationInProject) { diff --git a/ui/src/app/views/application/add/application.add.component.ts b/ui/src/app/views/application/add/application.add.component.ts index 463c6e10d7..b7abe761f5 100644 --- a/ui/src/app/views/application/add/application.add.component.ts +++ b/ui/src/app/views/application/add/application.add.component.ts @@ -149,6 +149,10 @@ export class ApplicationAddComponent implements OnInit, OnDestroy { } } + goToProject(): void { + this._router.navigate(['/project', this.project.key], {queryParams: {tab: 'applications'}}); + } + fileEvent(event: { content: string, file: File }) { this.fileTooLarge = event.file.size > 100000; if (this.fileTooLarge) { diff --git a/ui/src/app/views/application/add/application.add.html b/ui/src/app/views/application/add/application.add.html index c5a56e1b4b..0e59092cab 100644 --- a/ui/src/app/views/application/add/application.add.html +++ b/ui/src/app/views/application/add/application.add.html @@ -1,76 +1,68 @@
-
-

{{ 'application_create' | translate }}

-
-
+ +

Create new application

+ + + + Application name * + + + + + -
-
-
- - -
- {{ 'application_name_error' | translate }} -
-
+ + Description + + + + -
- - -
- -
- -
+ + Icon (Optional) +
icon
-
-
-
- -
- -
- - {{ 'wizard_app_empty' | translate }} -
-
- - {{ 'wizard_app_clone' | translate }} -
-
- -
-
+ + + -
- - - -
+ + New Application + + + + + + + -
- -
-
- {{ - 'btn_cancel' | translate }} - -
-
-
-
-
+ + Application to clone + + + + + + + + Variables + + + + + + + +
diff --git a/ui/src/app/views/application/add/application.add.scss b/ui/src/app/views/application/add/application.add.scss index 14b8cc1379..734d98e9bd 100644 --- a/ui/src/app/views/application/add/application.add.scss +++ b/ui/src/app/views/application/add/application.add.scss @@ -6,21 +6,28 @@ align-content: stretch; height: 100%; + form { + padding-top: 20px; + } + h2 { text-align: center; } - .ui.radio.checkbox { - border: 1px solid $darkGreyColor; - padding: 10px 30px; + nz-select { width: 100%; } - .ui.radio.checkbox.active { - border-color: #202f3c; + nz-form-item { + margin-top: 24px; } + .app-icon { height: 5em; width: 5em; } + + button { + margin-left: 15px; + } } diff --git a/ui/src/app/views/application/show/admin/repository/application.repo.html b/ui/src/app/views/application/show/admin/repository/application.repo.html index 263ed670fa..be789c8fc6 100644 --- a/ui/src/app/views/application/show/admin/repository/application.repo.html +++ b/ui/src/app/views/application/show/admin/repository/application.repo.html @@ -54,7 +54,7 @@
- +
diff --git a/ui/src/app/views/pipeline/show/workflow/pipeline.workflow.component.ts b/ui/src/app/views/pipeline/show/workflow/pipeline.workflow.component.ts index 9a29f71491..076a591abe 100644 --- a/ui/src/app/views/pipeline/show/workflow/pipeline.workflow.component.ts +++ b/ui/src/app/views/pipeline/show/workflow/pipeline.workflow.component.ts @@ -15,7 +15,6 @@ import { ToastService } from 'app/shared/toast/ToastService'; import * as pipelineActions from 'app/store/pipelines.action'; import { PipelinesStateModel } from 'app/store/pipelines.state'; import cloneDeep from 'lodash-es/cloneDeep'; -import { SemanticModalComponent } from '@sgu/ng-semantic'; import { DragulaService } from 'ng2-dragula-sgu'; import { Subscription } from 'rxjs'; import { finalize, first } from 'rxjs/operators'; diff --git a/ui/src/app/views/project/show/integrations/list/project.integration.list.html b/ui/src/app/views/project/show/integrations/list/project.integration.list.html index 3245677189..ab92001703 100644 --- a/ui/src/app/views/project/show/integrations/list/project.integration.list.html +++ b/ui/src/app/views/project/show/integrations/list/project.integration.list.html @@ -12,7 +12,7 @@ {{ p.name }} - + {{ p.model.name}} diff --git a/ui/src/app/views/settings/action/form/action.form.component.ts b/ui/src/app/views/settings/action/form/action.form.component.ts index 0b0df5bd0a..cd657881c0 100644 --- a/ui/src/app/views/settings/action/form/action.form.component.ts +++ b/ui/src/app/views/settings/action/form/action.form.component.ts @@ -38,7 +38,6 @@ export class ActionFormComponent implements OnDestroy { _action: Action; @Input() set action(a: Action) { this._action = { ...a }; - if (!this._action) { this._action = { editable: true }; } diff --git a/ui/src/app/views/settings/action/form/action.form.html b/ui/src/app/views/settings/action/form/action.form.html index 4c998a6145..f5e441bdd5 100644 --- a/ui/src/app/views/settings/action/form/action.form.html +++ b/ui/src/app/views/settings/action/form/action.form.html @@ -22,7 +22,7 @@ - diff --git a/ui/src/app/views/settings/group/edit/group.edit.component.ts b/ui/src/app/views/settings/group/edit/group.edit.component.ts index 19d65eb3e7..f17b8f558c 100644 --- a/ui/src/app/views/settings/group/edit/group.edit.component.ts +++ b/ui/src/app/views/settings/group/edit/group.edit.component.ts @@ -6,7 +6,7 @@ import { AuthenticationState } from 'app/store/authentication.state'; import { finalize } from 'rxjs/operators'; import { Project } from 'app/model/project.model'; import { Group, GroupMember } from '../../../../model/group.model'; -import { AuthentifiedUser, AuthSummary } from '../../../../model/user.model'; +import { AuthentifiedUser, AuthSummary, User } from '../../../../model/user.model'; import { GroupService } from '../../../../service/group/group.service'; import { UserService } from '../../../../service/user/user.service'; import { PathItem } from '../../../../shared/breadcrumb/breadcrumb.component'; @@ -32,6 +32,10 @@ export class GroupEditComponent implements OnInit { path: Array; projects: Array; + displayedMembers: User[] = []; + usernameFilterVisible: boolean; + usernameFilter: string = ''; + constructor( private _userService: UserService, private _groupService: GroupService, @@ -73,6 +77,7 @@ export class GroupEditComponent implements OnInit { this.group = grp; this.updateDataFromGroup(); this.updatePath(); + this.searchUsername() this._cd.markForCheck(); }); this._groupService.getProjectsInGroup(this.groupName).subscribe(projs => { @@ -166,6 +171,7 @@ export class GroupEditComponent implements OnInit { this._toast.success('', this._translate.instant('group_add_user_saved')); this.group = g; this.updateDataFromGroup(); + this.searchUsername(); this._cd.markForCheck(); }); } @@ -188,6 +194,7 @@ export class GroupEditComponent implements OnInit { } this.group = g; this.updateDataFromGroup(); + this.searchUsername(); this._cd.markForCheck(); }); } @@ -208,6 +215,7 @@ export class GroupEditComponent implements OnInit { .subscribe(g => { this.group = g; this.updateDataFromGroup(); + this.searchUsername(); this._cd.markForCheck(); this._toast.success('', this._translate.instant('group_add_admin_saved')); }); @@ -227,6 +235,7 @@ export class GroupEditComponent implements OnInit { ).subscribe(g => { this.group = g; this.updateDataFromGroup(); + this.searchUsername(); this._cd.markForCheck(); this._toast.success('', this._translate.instant('group_remove_admin_saved')); }); @@ -253,4 +262,14 @@ export class GroupEditComponent implements OnInit { } } } + + searchUsername(): void { + this.usernameFilterVisible = false; + if (this.usernameFilter.length === 0) { + this.displayedMembers = this.group.members; + } else { + this.displayedMembers = this.group.members.filter((mu: User) => mu.username.indexOf(this.usernameFilter) !== -1); + } + this._cd.markForCheck(); + } } diff --git a/ui/src/app/views/settings/group/edit/group.edit.html b/ui/src/app/views/settings/group/edit/group.edit.html index ad85d20e4a..e56db98ac4 100644 --- a/ui/src/app/views/settings/group/edit/group.edit.html +++ b/ui/src/app/views/settings/group/edit/group.edit.html @@ -4,137 +4,138 @@
-
-
-
-
-
- - -
-
- - -
-
-
-
-
- - - - - + + + + + + +
+ + Members + + + + + + -
-
-
-
-
-
- - - - -
-
- -
-
- -
- {{ 'group_no_member' | translate }} -
- - - - - - - - - - - - - - - - -
{{ 'user_label_username' | translate }}{{ 'user_label_fullname' | translate }}
- - {{v?.username}} - - {{v?.fullname}} - - - - - - -
-
-
-
- - -
This group is not used in any project
-
- - - - - - - - - - - - - - -
Project keyProject name
- - {{p.key}} - - {{p.name}}
-
+ + + + + + + + Username + + + + + Fullname + Actions + + + + + + + {{m?.username}} + + + {{m?.fullname}} + + + + + + + + + + + + +
+
-
-
- + + + +

Usage in projects

+ + + + + + Project key + Project name + + + + + + + {{p.key}} + + + {{p.name}} + + + + +
+
diff --git a/ui/src/app/views/settings/group/edit/group.edit.scss b/ui/src/app/views/settings/group/edit/group.edit.scss index cab2b1471c..22d5b6b57a 100644 --- a/ui/src/app/views/settings/group/edit/group.edit.scss +++ b/ui/src/app/views/settings/group/edit/group.edit.scss @@ -4,13 +4,40 @@ flex-direction: column; align-content: stretch; height: 100%; - .buttons { - margin-top: 23px; - } - h2 { - text-align: center; - } - h4.ui.header { - text-align: center; + + nz-row { + nz-col { + padding: 10px; + + button { + float: right; + margin-left: 10px; + } + } + nz-col.projectList { + h3 { + margin-top: 5px; + margin-bottom: 28px; + } + } + } } + +.search-box { + padding: 8px; +} + +.search-box input { + width: 188px; + margin-bottom: 8px; + display: block; +} + +.search-box button { + width: 90px; +} + +.search-button { + margin-right: 8px; +} diff --git a/ui/src/app/views/settings/user/edit/user.edit.html b/ui/src/app/views/settings/user/edit/user.edit.html index 03d2af1c34..761edcd7b8 100644 --- a/ui/src/app/views/settings/user/edit/user.edit.html +++ b/ui/src/app/views/settings/user/edit/user.edit.html @@ -29,12 +29,12 @@
- - - - - + + + + +
diff --git a/ui/src/app/views/settings/user/edit/user.edit.scss b/ui/src/app/views/settings/user/edit/user.edit.scss index 12a9061ba3..ec63347610 100644 --- a/ui/src/app/views/settings/user/edit/user.edit.scss +++ b/ui/src/app/views/settings/user/edit/user.edit.scss @@ -1,5 +1,7 @@ @import '../../../../../common'; - +nz-select { + width: 100%; +} .wrapper { display: flex; flex-direction: column; diff --git a/ui/src/app/views/settings/worker-model/form/worker-model.form.component.ts b/ui/src/app/views/settings/worker-model/form/worker-model.form.component.ts index 0c2d56873d..34031cf4fe 100644 --- a/ui/src/app/views/settings/worker-model/form/worker-model.form.component.ts +++ b/ui/src/app/views/settings/worker-model/form/worker-model.form.component.ts @@ -27,6 +27,13 @@ export class WorkerModelFormComponent implements OnInit, OnDestroy { if (this._workerModel && this._workerModel.model_docker && this._workerModel.model_docker.envs) { this.envNames = Object.keys(this._workerModel.model_docker.envs); } + if (this.patterns) { + this.typeChange(); + } + + if (!this.workerModelAsCode) { + this.loadAsCode(); + } } } get workerModel(): WorkerModel { @@ -36,7 +43,18 @@ export class WorkerModelFormComponent implements OnInit, OnDestroy { @Input() loading: boolean; @Input() types: Array; @Input() groups: Array; - @Input() patterns: Array; + + _patterns: Array + @Input() set patterns(data: Array) { + this._patterns = data; + if (this.workerModel?.type) { + this.typeChange(); + } + }; + get patterns() { + return this._patterns; + } + @Output() save = new EventEmitter(); @Output() saveAsCode = new EventEmitter(); @Output() delete = new EventEmitter(); @@ -149,6 +167,7 @@ pattern_name: basic_unix`; typeChange(): void { this.patternsFiltered = this.patterns.filter((pattern) => pattern.type === this.workerModel.type); + this._cd.markForCheck(); } patternChange(): void { diff --git a/ui/src/app/views/settings/worker-model/form/worker-model.form.html b/ui/src/app/views/settings/worker-model/form/worker-model.form.html index 13a1cffd5d..7632f9a785 100644 --- a/ui/src/app/views/settings/worker-model/form/worker-model.form.html +++ b/ui/src/app/views/settings/worker-model/form/worker-model.form.html @@ -1,339 +1,473 @@
-
-
-
-
- {{'common_help_no_group' | translate}} -
- -
-
- - -
-
- - -
-
- - -
-
- - - - - -
-
- -
- - -
-
-
- -
- - -
-
-
-
- - -
-
-
- - -
-
- - -
-
-
- -
- -
-

{{ 'worker_model_enabled' | translate }}

-
- -
+ + + + + + + + + + + + + Name + + + + + + + + Group + + + + + + + + + + + + + + + + -
- -
-

{{ 'worker_model_disabled' | translate }}

-
- -
-
- -
-

{{ 'worker_model_error' | translate }}

-

{{workerModel.last_spawn_err}}

-
-

{{'worker_model_help_error' | translate}}

-
-
{{'worker_model_help_error_docker_1' | - translate}}
-
{{'worker_model_help_error_docker_2' | - translate}}
-
{{'worker_model_help_error_host_1' | - translate}}
-
{{'worker_model_help_error_host_2' | - translate}}
-
{{'worker_model_help_error_openstack_1' - | translate}}
-
{{'worker_model_help_error_openstack_2' - | translate}}
-
-
-

{{ 'worker_model_error_log' | translate }} -

-
-
{{workerModel.last_spawn_err_log}}
-
-
-
-
-
-
- - - - - -
-
- -
-
- - -
-
- - - -
-
- -
- - -
-
- - -
-
- - -
-
-
- - - - - -
-
- - -
-
-
-
-
+ +
- -
- - -
-
- - -
-
- - - - - -
- -
- - -
-
- - -
-
-
- - -
-
- - -
-
- - -
-
-
- - -
+ + + +
+ + + + - -
+ + + + + + + name="asCodeCodeMirror" #codeMirror> -
-
-
- - -
-
-
-
+ + + + +
-
{{ 'common_loading' | translate }}
+
diff --git a/ui/src/app/views/settings/worker-model/form/worker-model.form.scss b/ui/src/app/views/settings/worker-model/form/worker-model.form.scss index 976691e064..0d1bb667c1 100644 --- a/ui/src/app/views/settings/worker-model/form/worker-model.form.scss +++ b/ui/src/app/views/settings/worker-model/form/worker-model.form.scss @@ -3,3 +3,44 @@ .content.error { overflow: auto; } + +nz-tabset { + padding: 0 5px; +} + +form { + padding: 30px 10px; +} + +nz-row { + margin-bottom: 20px; + nz-col { + + padding: 0 20px; + + button { + float: right; + margin-left: 20px; + } + } +} + +nz-alert { + width: 100%; + + i { + font-size: 1.5em; + } + + nz-row { + margin-bottom: 0; + } +} + +i.success { + color: $cds_color_green; +} +i.fail { + color: $cds_color_red +} + diff --git a/ui/src/app/views/settings/workflow-template/form/workflow-template.form.html b/ui/src/app/views/settings/workflow-template/form/workflow-template.form.html index abf1fc24f9..1ee55be5a9 100644 --- a/ui/src/app/views/settings/workflow-template/form/workflow-template.form.html +++ b/ui/src/app/views/settings/workflow-template/form/workflow-template.form.html @@ -6,9 +6,6 @@
{{'common_help_no_group' | translate}}
-
- {{'workflow_template_help_edit_from' | translate}} -
@@ -22,11 +19,11 @@
- - - + + +
@@ -43,9 +40,6 @@ [readonly]="!workflowTemplate.editable">
-
- {{'common_or' | translate}} -
diff --git a/ui/src/app/views/settings/workflow-template/form/workflow-template.form.scss b/ui/src/app/views/settings/workflow-template/form/workflow-template.form.scss index c288ceabf7..e717bb4dbd 100644 --- a/ui/src/app/views/settings/workflow-template/form/workflow-template.form.scss +++ b/ui/src/app/views/settings/workflow-template/form/workflow-template.form.scss @@ -3,6 +3,10 @@ position: relative; } +nz-select { + width: 100%; +} + h2 { text-align: center; } diff --git a/ui/src/app/views/workflow/add/workflow.add.html b/ui/src/app/views/workflow/add/workflow.add.html index 95c936bf06..ae2e434cb3 100644 --- a/ui/src/app/views/workflow/add/workflow.add.html +++ b/ui/src/app/views/workflow/add/workflow.add.html @@ -315,7 +315,7 @@

{{ 'workflow_create' | translate }}

-
diff --git a/ui/src/app/views/workflow/run/node/pipeline/pipeline.html b/ui/src/app/views/workflow/run/node/pipeline/pipeline.html index 4093620e22..29e7bff4a7 100644 --- a/ui/src/app/views/workflow/run/node/pipeline/pipeline.html +++ b/ui/src/app/views/workflow/run/node/pipeline/pipeline.html @@ -33,7 +33,8 @@ (click)="selectedJobManual(j.pipeline_action_id)">
+ nz-tooltip nzTooltipTitle="The build is in success state but there are/is {{mapJobStatus?.get(j.pipeline_action_id)?.warnings}} optional step(s) in error" + nzTooltipPlacement="top">
diff --git a/ui/src/assets/i18n/en.json b/ui/src/assets/i18n/en.json index f65bc72da1..d8402b6791 100644 --- a/ui/src/assets/i18n/en.json +++ b/ui/src/assets/i18n/en.json @@ -41,7 +41,6 @@ "action_delete": "Delete action", "action_name": "Action name", "action_saved": "Action saved", - "action_optional": "Optional", "action_always_executed": "Always executed", "action_always_executed_details": "If checked, this step will be executed even if previous steps fail", "action_help_line_1": "What's an action?", @@ -74,7 +73,6 @@ "application_icon": "Application icon", "application_description": "Application description", "application_from_repository": "Application imported from {{repo}}", - "application_name_error": "Invalid application name. Allowed pattern is: a-zA-Z0-9._-", "application_no_usage": "The application is not used", "application_rename_title": "Rename the application", "application_repo_attach_ok": "The repository is linked to the application", @@ -84,7 +82,6 @@ "application_repo_no": "The application is not linked to a Git repository", "application_repo_title": "Link application to a repository: ", "application_deployment_title": "Link application to a deployment integration: ", - "application_new_title": "New application", "application_update_name_error": "Application name is mandatory and must respect the alphanumeric pattern + the following characters: .-_ ([a-zA-Z0-9._-]*)", "application_update_ok": "Application has been updated", "application_variable_list_title": "List of application variables: ", @@ -105,11 +102,9 @@ "btn_create": "Create", "btn_create_workflow": "Create workflow", "btn_dry_run": "Dry Run", - "btn_finish": "Finish", "btn_delete": "Delete", "btn_goto_workflow": "See workflow", "btn_inspect_repo": "Inspect repository", - "btn_link": "Connect", "btn_logs": "Display logs", "btn_rename": "Rename", "btn_resync_repo": "Resynchronize", @@ -267,8 +262,6 @@ "common_split": "Split", "common_unified": "Unified", "common_rollback": "Rollback", - "common_edit_as_code": "Edit as code", - "common_edit_ui": "Edit with UI", "common_migrate": "Migrate", "common_help_no_group": "No group can be found, you will not be able to save current resource.", "common_find_help": "Maybe you could find some help", @@ -340,15 +333,11 @@ "group_list_title": "Groups", "group_load_group": "Loading group...", "group_saved": "Group saved", - "group_members": "Members", - "group_no_member": "No member in the group", "group_add_user_saved": "Member added", "group_add_admin_saved": "Admin added", "group_remove_user_saved": "Member removed", "group_remove_admin_saved": "Admin removed", "group_user_is_admin": "User is administrator on group", - "group_btn_set_admin": "Admin", - "group_btn_unset_admin": "Admin", "key_copy_public": "Copy public key", "key_or_create": "(Create)", "key_warning_add_repo_title": "Don't forget to add your ssh key on your repository", @@ -426,7 +415,6 @@ "pipeline_name": "Pipeline name", "pipeline_description": "Pipeline description", "pipeline_from_repository": "Imported from {{repo}}", - "pipeline_name_new": "New pipeline name", "pipeline_name_error": "Invalid pipeline name. Allowed pattern is: a-zA-Z0-9._-", "pipeline_parameters_list_title": "List of pipeline parameters: ", "pipeline_parameters_form_title": "Add a parameter: ", @@ -487,7 +475,6 @@ "integration_no": "There is no linked integration", "integration_model": "Model", "integration_configuration": "Configuration", - "integration_official_tooltip": "Public integration", "integration_hook": "hook", "integration_event": "event", "integration_deployment": "deployment", @@ -614,8 +601,6 @@ "warning_pipeline": "{{username}} has just updated the pipeline.", "warning_workflow": "{{username}} has just updated the workflow.", "warning_build_title": "The build is in success state but there are/is {{nb}} optional step(s) in error", - "wizard_app_clone": "Clone an application", - "wizard_app_empty": "Empty application", "worker_model": "Worker Model", "worker_model_type": "Type", "worker_model_env": "Environment variables", @@ -629,14 +614,10 @@ "worker_model_state": "State of worker model", "worker_model_disable": "Disable it", "worker_model_disabled": "This worker model is disabled", - "worker_model_enable": "Enable it", "worker_model_deleted": "Worker model deleted", - "worker_model_is_deprecated": "Worker model deprecated", - "worker_model_deprecated_help": "Set the worker model as deprecated", "worker_model_deprecated_tooltip": "This worker model is deprecated", "worker_model_official_tooltip": "Official worker model maintained by CDS Administrators", "worker_model_spawn_error_tooltip": "Model in error", - "worker_model_enabled": "This worker model is enabled", "worker_model_error": "This worker model is in error. You can reset error by saving it.", "worker_model_error_log": "Console output", "worker_model_group": "Group", @@ -648,13 +629,6 @@ "worker_model_help_howto_link_2": "Create a worker model with your own image", "worker_model_help_howto_link_3": "Create a worker model based on a Openstack image", "worker_model_image": "Image", - "worker_model_help_error": "Checklist:", - "worker_model_help_error_docker_1": "Check that you have the right to write on $TMPDIR in your image", - "worker_model_help_error_docker_2": "Check that curl is in $PATH in your image", - "worker_model_help_error_host_1": "Check worker binary, it must be in your $PATH, on host, where you launched Local Hatchery", - "worker_model_help_error_host_2": "Check that you have the right to write on $TMPDIR or update 'basedir' parameter on your Local hatchery", - "worker_model_help_error_openstack_1": "Check that curl is in $PATH in your Openstack image", - "worker_model_help_error_openstack_2": "Check that you have the right to write on $TMPDIR or update 'basedir' parameter on your Openstack Hatchery", "worker_model_last_registration": "Last Registration", "worker_model_list_title": "Worker Models", "worker_model_name": "Name", @@ -665,21 +639,14 @@ "worker_model_pattern_deleted": "Pattern deleted", "worker_model_status": "Status", "worker_model_warning": "This worker model is in error. Please check it", - "worker_model_os": "Operating System", - "worker_model_arch": "Architecture", "worker_model_pattern_help_line_1": "See Worker Model Pattern documentation:", "worker_model_pattern_title": "Patterns of configuration scripts", "worker_model_pre_cmd": "Pre worker command", - "worker_model_cmd_docker": "Command", "worker_model_shell_docker": "Shell command", - "worker_model_private": "Private registry", - "worker_model_private_tooltip": "If your image comes from a private registry requiring some credentials", "worker_model_cmd": "Main worker command", "worker_model_cmd_tooltip": "The command must end with ./worker", "worker_model_post_cmd": "Post worker command", "worker_model_no_usage": "This worker model is not explicitly used in a pipeline", - "worker_model_username": "Username", - "worker_model_password": "Password", "workflow_modal_change_view_confirm": "Are you sure you want to discard your unsaved changes?", "workflow_as_code_pr_success": "A pull-request has just been created:", "workflow_node_condition_empty": "There are empty run conditions", @@ -727,7 +694,6 @@ "workflow_node_delete_alert": "BE CAREFUL, this will remove the pipeline and all his children", "workflow_node_delete_title": "Remove '{{node}}'", "workflow_node_delete_alert_soft": "Remove only this one", - "workflow_node_form_title": "Triggered pipeline", "workflow_node_fork_add": "Add a fork", "workflow_node_hook_add": "Add a hook", "workflow_node_hook_details_modal_title": "Hook's details", @@ -787,7 +753,6 @@ "workflow_no_event_integration": "You haven't any event integration on your project.", "workflow_event_form": "Events integrations", "workflow_notification_conditions": "Conditions", - "workflow_start_with_fork": "Start with a fork", "workflow_wizard_select_repo_man": "Select a repository manager", "workflow_wizard_select_repo": "Select a repository", "workflow_wizard_select_repo_loading": "Loading repositories...", @@ -825,7 +790,6 @@ "workflow_template_apply_detach": "Detach the generated workflow from the template.", "workflow_template_init_from_workflow": "Init a template", "workflow_template_help_add_from": "Current workflow template was initialized with data from \"{{workflowName}}\" workflow in \"{{projectKey}}\" project. The data will not be stored until you save the template.", - "workflow_template_help_edit_from": "Current workflow template is synchronized from URL. You can't edit it.", "workflow_template_param_select_key": "Select a key", "workflow_warning_deprecated_yaml": "Yaml workflow configuration is deprecated", "application_repository_help_line_1": "Your application was not imported from your code.", diff --git a/ui/src/styles.scss b/ui/src/styles.scss index 5d892fb8ce..8ce5c53e51 100644 --- a/ui/src/styles.scss +++ b/ui/src/styles.scss @@ -26,6 +26,13 @@ body { border-radius: 2px; } +input[type=radio]:read-only { + opacity: 0; +} +input[type=checkbox]:read-only { + opacity: 0; +} + a.disabled { color: gray; cursor: not-allowed;