8000 feat(ui): upgrade to angular 15 by sguiheux · Pull Request #6691 · ovh/cds · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(ui): upgrade to angular 15 #6691

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

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25,392 changes: 3,697 additions & 21,695 deletions ui/package-lock.json

Large diffs are not rendered by default.

41 changes: 20 additions & 21 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
},
"private": true,
"dependencies": {
"@angular/animations": "14.3.0",
"@angular/cdk": "13.3.0",
"@angular/common": "14.3.0",
"@angular/compiler": "14.3.0",
"@angular/core": "14.3.0",
"@angular/forms": "14.3.0",
"@angular/platform-browser": "14.3.0",
"@angular/platform-browser-dynamic": "14.3.0",
"@angular/router": "14.3.0",
"@angular/animations": "15.2.10",
"@angular/cdk": "15.2.9",
"@angular/common": "15.2.10",
"@angular/compiler": "15.2.10",
"@angular/core": "15.2.10",
"@angular/forms": "15.2.10",
"@angular/platform-browser": "15.2.10",
"@angular/platform-browser-dynamic": "15.2.10",
"@angular/router": "15.2.10",
"@fontsource/lato": "4.5.0",
"@icholy/duration": "5.0.0",
"@ngx-translate/core": "14.0.0",
Expand All @@ -41,7 +41,6 @@
"@ngxs/logger-plugin": "3.8.0",
"@ngxs/storage-plugin": "3.8.0",
"@ngxs/store": "3.8.0",
"@sgu/auto-complete": "14.0.0",
"@swimlane/ngx-charts": "16.0.0",
"@types/dagre-d3": "0.6.2",
"@types/js-yaml": "3.12.2",
Expand Down Expand Up @@ -71,13 +70,13 @@
"monaco-editor": "0.44.0",
"monaco-editor-webpack-plugin": "7.1.0",
"ng-event-source": "1.0.14",
"ng-zorro-antd": "14.3.0",
"ng-zorro-antd": "15.1.1",
"ng2-codemirror-typescript": "3.13.1",
"ng2-completer": "2.0.8",
"ng2-dragula-sgu": "3.0.2",
"ngx-clipboard": "12.1.0",
"ngx-infinite-scroll": "7.2.0",
"ngx-markdown": "14.0.1",
"ngx-markdown": "15.1.2",
"ngx-moment": "5.0.0",
"postcss": "8.4.31",
"prismjs": "1.27.0",
Expand All @@ -94,15 +93,15 @@
"zxcvbn": "4.4.2"
},
"devDependencies": {
"@angular-builders/custom-webpack": "14.1.0",
"@angular-devkit/build-angular": "14.2.13",
"@angular-eslint/builder": "14.4.0",
"@angular-eslint/eslint-plugin": "14.4.0",
"@angular-eslint/eslint-plugin-template": "14.4.0",
"@angular-eslint/schematics": "14.4.0",
"@angular-eslint/template-parser": "14.4.0",
"@angular/cli": "14.2.13",
"@angular/compiler-cli": "14.3.0",
"@angular-builders/custom-webpack": "15.0.0",
"@angular-devkit/build-angular": "15.2.10",
"@angular-eslint/builder": "15.2.1",
"@angular-eslint/eslint-plugin": "15.2.1",
"@angular-eslint/eslint-plugin-template": "15.2.1",
"@angular-eslint/schematics": "15.2.1",
"@angular-eslint/template-parser": "15.2.1",
"@angular/cli": "15.2.10",
"@angular/compiler-cli": "15.2.10",
"@commitlint/cli": "13.2.1",
"@commitlint/config-conventional": "13.2.0",
"@compodoc/compodoc": "1.1.19",
Expand Down
3 changes: 1 addition & 2 deletions ui/src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@ const routes: Routes = [

export const routing: ModuleWithProviders<AppModule> = RouterModule.forRoot(routes, {
initialNavigation: 'enabledNonBlocking',
preloadingStrategy: PreloadAllModules,
relativeLinkResolution: 'legacy'
preloadingStrategy: PreloadAllModules
});
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class AsCodeSaveFormComponent implements OnInit, OnDestroy {
selectedBranch: string;
commitMessage: string;
branches: Array<string>;
branchesFiltered: string[];

constructor(
private _cd: ChangeDetectorRef,
Expand Down Expand Up @@ -54,6 +55,7 @@ export class AsCodeSaveFormComponent implements OnInit, OnDestroy {
.subscribe(vcsinfos => {
if (vcsinfos && vcsinfos.branches) {
this.branches = vcsinfos.branches.filter(b => !b.default).map(b => b.display_id);
this._cd.markForCheck();
}
});
}
Expand All @@ -64,4 +66,14 @@ export class AsCodeSaveFormComponent implements OnInit, OnDestroy {
commit_message: this.commitMessage
});
}

onInput(event: Event): void {
const value = (event.target as HTMLInputElement).value;
if (value.length < 3) {
this.branchesFiltered = [];
} else {
this.branchesFiltered = this.branches.filter(b => b.indexOf(value) === 0)
}
this._cd.markForCheck();
}
}
5 changes: 4 additions & 1 deletion ui/src/app/shared/ascode/save-form/ascode.save-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<nz-form-item>
<nz-form-label>{{ 'ascode_modal_label_branch' | translate }}</nz-form-label>
<nz-form-control>
<input nz-input type="text" [(ngModel)]="selectedBranch" (keyup)="changeParam()" auto-complete [source]="branches" [min-chars]="1" name="branch" />
<input nz-input type="text" [(ngModel)]="selectedBranch" (keyup)="changeParam()" [nzAutocomplete]="auto" name="branch" (input)="onInput($event)" />
<nz-autocomplete nzBackfill #auto>
<nz-auto-option *ngFor="let option of branchesFiltered" [nzValue]="option">{{ option }}</nz-auto-option>
</nz-autocomplete>
</nz-form-control>
</nz-form-item>
<nz-form-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export class ParameterValueComponent implements OnInit, AfterViewChecked, OnDest
themeSubscription: Subscription;
_keys: AllKeys;
allKeys: Key[];
suggestFiltered: string[];

constructor(
private _repoManagerService: RepoManagerService,
Expand Down Expand Up @@ -225,6 +226,14 @@ export class ParameterValueComponent implements OnInit, AfterViewChecked, OnDest
}
}

onInput(value: string): void {
if (value.indexOf("{{") === 0) {
this.suggestFiltered = this.suggest.filter(s => s.indexOf(value) === 0);
} else {
this.suggestFiltered = [];
}
}

keyExist(key: string): boolean {
return this.keys.ssh.find((k) => k.name === key) != null;
}
Expand Down
8 changes: 5 additions & 3 deletions ui/src/app/shared/parameter/value/parameter.value.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
placeholder="{{'parameter_git_url' | translate }}">
</ng-container>
<div *ngSwitchDefault>
<input nz-input auto-complete autocomplete="off" type="text" [(ngModel)]="editableValue" (change)="valueChanged()"
(keydown)="sendValueChanged()" name="value" [source]="suggest" [min-chars]="3"
[no-match-found-text]="false">
<input nz-input [nzAutocomplete]="auto" type="text" [(ngModel)]="editableValue" (change)="valueChanged()"
(keydown)="sendValueChanged()" name="value" (ngModelChange)="onInput($event)">
<nz-autocomplete nzBackfill #auto>
<nz-auto-option *ngFor="let option of suggestFiltered" [nzValue]="option">{{ option }}</nz-auto-option>
</nz-autocomplete>
</div>
</ng-container>
<ng-container [ngSwitch]="type" *ngIf="!edit">
Expand Down
2 changes: 0 additions & 2 deletions ui/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { NguiAutoCompleteModule } from '@sgu/auto-complete';
import { TranslateModule } from '@ngx-translate/core';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { AuthenticationGuard } from 'app/guard/authentication.guard';
Expand Down Expand Up @@ -213,7 +212,6 @@ const icons: IconDefinition[] = [AimOutline, ApartmentOutline, ApiOutline, Arrow
CodemirrorModule,
ReactiveFormsModule,
MarkdownModule.forRoot(),
NguiAutoCompleteModule,
RouterModule,
InfiniteScrollModule,
NgxChartsModule
Expand Down
2 changes: 1 addition & 1 deletion ui/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@import "common";

@import "~@fontsource/lato/scss/mixins";
@import "@fontsource/lato/scss/mixins";

@include fontFace($style: italic, $weight: 400);

Expand Down
4 changes: 0 additions & 4 deletions ui/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ getTestBed().initTestEnvironment(
teardown: { destroyAfterEach: false }
}
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
3 changes: 1 addition & 2 deletions ui/src/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
],
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableIvy": true
"strictInjectionParameters": true
}
}
12 changes: 7 additions & 5 deletions ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"paths": {
"@cds/*": [".src/app/*"]
"@cds/*": [
".src/app/*"
]
},
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2020",
"target": "ES2022",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom"
]
],
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableIvy": true
"strictInjectionParameters": true
}
}
0