From 6e7c090a88c6a8b6248e2a54e8396329677c5df9 Mon Sep 17 00:00:00 2001 From: Damien Vitrac Date: Wed, 11 Dec 2024 08:44:19 +0100 Subject: [PATCH] Clean --- ui/src/app/about/info/info.component.html | 7 ------- .../apps/add/register/register.component.ts | 7 +------ ui/src/app/apps/app/app.component.html | 8 -------- ui/src/app/apps/app/app.component.ts | 2 +- ui/src/app/shared/api/app.service.spec.ts | 4 ++-- ui/src/app/shared/api/app.service.ts | 18 +++--------------- ui/src/app/shared/model/app.model.ts | 2 -- ui/src/app/shared/model/detailed-app.model.ts | 1 - ui/src/app/shared/store/about.reducer.ts | 1 - ui/src/app/shared/store/about.support.ts | 1 - ui/src/app/tests/api/app.service.mock.ts | 7 ------- ui/src/app/tests/data/about.ts | 2 -- 12 files changed, 7 insertions(+), 53 deletions(-) diff --git a/ui/src/app/about/info/info.component.html b/ui/src/app/about/info/info.component.html index 31b5ac72a..db6870ba6 100644 --- a/ui/src/app/about/info/info.component.html +++ b/ui/src/app/about/info/info.component.html @@ -136,10 +136,6 @@

{{ 'about.info.runtimeSkipperDeployer' | translate }}

{{ 'about.info.platformType' | translate }}: {{ about.runtimeEnvironment.appDeployer.platformType || 'N/A' }} -
  • - {{ 'about.info.springBootVersion' | translate }}: - {{ about.runtimeEnvironment.appDeployer.springBootVersion || 'N/A' }} -
  • {{ 'about.info.springVersion' | translate }}: {{ about.runtimeEnvironment.appDeployer.springVersion || 'N/A' }} @@ -203,9 +199,6 @@

    {{ 'about.info.runtimeTaskLauncher' | translate }}

  • {{ 'about.info.platformType' | translate }}: {{ item.platformType }}
  • -
  • - {{ 'about.info.springBootVersion' | translate }}: {{ item.springBootVersion }} -
  • {{ 'about.info.springVersion' | translate }}: {{ item.springVersion }}
  • diff --git a/ui/src/app/apps/add/register/register.component.ts b/ui/src/app/apps/add/register/register.component.ts index 9a4ba4f59..042b486b2 100644 --- a/ui/src/app/apps/add/register/register.component.ts +++ b/ui/src/app/apps/add/register/register.component.ts @@ -14,7 +14,6 @@ import {TranslateService} from '@ngx-translate/core'; export class RegisterComponent implements OnInit { forms: UntypedFormGroup[] = []; applicationTypes = ApplicationType; - bootVersions: Array; defaultBoot: string; submitted = false; isImporting = false; @@ -28,11 +27,7 @@ export class RegisterComponent implements OnInit { ) {} ngOnInit(): void { - this.appService.getBootVersions().subscribe((data: any) => { - this.bootVersions = data.versions; - this.defaultBoot = data.defaultSchemaVersion; - this.newForm(); - }); + this.newForm(); } register(): void { diff --git a/ui/src/app/apps/app/app.component.html b/ui/src/app/apps/app/app.component.html index 7a2f9c533..f7c223d18 100644 --- a/ui/src/app/apps/app/app.component.html +++ b/ui/src/app/apps/app/app.component.html @@ -68,14 +68,6 @@

    {{ detailedApp.version }} -
    -
    {{ 'applications.main.bootVersion' | translate }}
    -
    - {{ - 'applications.main.bootVersions.' + detailedApp.bootVersion | translate - }} -
    -
    {{ 'applications.main.uri' | translate }}
    {{ detailedApp.uri }}
    diff --git a/ui/src/app/apps/app/app.component.ts b/ui/src/app/apps/app/app.component.ts index b61b39310..d0ca60073 100644 --- a/ui/src/app/apps/app/app.component.ts +++ b/ui/src/app/apps/app/app.component.ts @@ -75,7 +75,7 @@ export class AppComponent implements OnInit { this.detailedApp.version = app.version; this.detailedApp.defaultVersion = app.defaultVersion; } - this.appsService.getApp(app.name, app.type, app.version, app.version).subscribe( + this.appsService.getApp(app.name, app.type, app.version).subscribe( (detailedApp: DetailedApp) => { this.tooManyProperties = detailedApp.options.length > 50; this.showAllProperties = !this.tooManyProperties; diff --git a/ui/src/app/shared/api/app.service.spec.ts b/ui/src/app/shared/api/app.service.spec.ts index 4c0b0c47d..acbedc9cd 100644 --- a/ui/src/app/shared/api/app.service.spec.ts +++ b/ui/src/app/shared/api/app.service.spec.ts @@ -39,10 +39,10 @@ describe('shared/api/app.service.ts', () => { it('getApp with spring boot version in parameter', () => { mockHttp.get.and.returnValue(of(jsonData)); - appService.getApp('foo', 'processor' as any as ApplicationType, '', '3'); + appService.getApp('foo', 'processor' as any as ApplicationType, ''); const httpUri = mockHttp.get.calls.mostRecent().args[0]; const headerArgs = mockHttp.get.calls.mostRecent().args[1].headers; - expect(httpUri).toEqual('/apps/processor/foo?bootVersion=3'); + expect(httpUri).toEqual('/apps/processor/foo'); expect(headerArgs.get('Content-Type')).toEqual('application/json'); expect(headerArgs.get('Accept')).toEqual('application/json'); }); diff --git a/ui/src/app/shared/api/app.service.ts b/ui/src/app/shared/api/app.service.ts index 114849898..79ba345a4 100644 --- a/ui/src/app/shared/api/app.service.ts +++ b/ui/src/app/shared/api/app.service.ts @@ -42,17 +42,11 @@ export class AppService { .pipe(map(AppPage.parse), catchError(ErrorUtils.catchError)); } - getApp( - name: string, - type: ApplicationType, - appVersion?: string, - bootVersion?: string - ): Observable { + getApp(name: string, type: ApplicationType, appVersion?: string): Observable { const headers = HttpUtils.getDefaultHttpHeaders(); - const bootVersionConfig = bootVersion ? `?bootVersion=${bootVersion}` : ``; - let url = UrlUtilities.calculateBaseApiUrl() + `apps/${type}/${name}${bootVersionConfig}`; + let url = UrlUtilities.calculateBaseApiUrl() + `apps/${type}/${name}`; if (appVersion) { - url = UrlUtilities.calculateBaseApiUrl() + `apps/${type}/${name}/${appVersion}${bootVersionConfig}`; + url = UrlUtilities.calculateBaseApiUrl() + `apps/${type}/${name}/${appVersion}`; } return this.httpClient.get(url, {headers}).pipe(map(DetailedApp.parse), catchError(ErrorUtils.catchError)); } @@ -65,12 +59,6 @@ export class AppService { ); } - getBootVersions(): Observable { - const headers = HttpUtils.getDefaultHttpHeaders(); - const url = UrlUtilities.calculateBaseApiUrl() + `schema/versions`; - return this.httpClient.get(url, {headers}).pipe(catchError(ErrorUtils.catchError)); - } - unregisterApp(app: App): Observable { const headers = HttpUtils.getDefaultHttpHeaders(); let url = UrlUtilities.calculateBaseApiUrl() + `apps/${app.type}/${app.name}`; diff --git a/ui/src/app/shared/model/app.model.ts b/ui/src/app/shared/model/app.model.ts index 8f2a110f3..7acc1834d 100644 --- a/ui/src/app/shared/model/app.model.ts +++ b/ui/src/app/shared/model/app.model.ts @@ -30,7 +30,6 @@ export class App { version: string; defaultVersion: boolean; versions: Array; - bootVersion?: string; public static parse(input: any): App { const app = new App(); @@ -40,7 +39,6 @@ export class App { app.version = input.version; app.defaultVersion = input.defaultVersion; app.versions = input.versions; - app.bootVersion = input.bootVersion; return app; } diff --git a/ui/src/app/shared/model/detailed-app.model.ts b/ui/src/app/shared/model/detailed-app.model.ts index 78f291658..29e67d29b 100644 --- a/ui/src/app/shared/model/detailed-app.model.ts +++ b/ui/src/app/shared/model/detailed-app.model.ts @@ -81,7 +81,6 @@ export class DetailedApp extends App { app.name = input.name; app.type = input.type as ApplicationType; app.uri = input.uri; - app.bootVersion = input.bootVersion; app.version = input.version; app.versions = input.versions; app.defaultVersion = input.defaultVersion; diff --git a/ui/src/app/shared/store/about.reducer.ts b/ui/src/app/shared/store/about.reducer.ts index 8fda14228..595245aa1 100644 --- a/ui/src/app/shared/store/about.reducer.ts +++ b/ui/src/app/shared/store/about.reducer.ts @@ -22,7 +22,6 @@ export interface RuntimeEnvironmentState { platformHostVersion: string; platformSpecificInfo: any; platformType: string; - springBootVersion: string; springVersion: string; } diff --git a/ui/src/app/shared/store/about.support.ts b/ui/src/app/shared/store/about.support.ts index 756c48e0d..69a6e6924 100644 --- a/ui/src/app/shared/store/about.support.ts +++ b/ui/src/app/shared/store/about.support.ts @@ -31,7 +31,6 @@ const parseRuntimeEnvironment = (input: any): RuntimeEnvironmentState => ({ platformHostVersion: input.platformHostVersion, platformSpecificInfo: parsePlatformSpecificInfo(input.platformSpecificInfo), platformType: input.platformType, - springBootVersion: input.springBootVersion, springVersion: input.springVersion }); diff --git a/ui/src/app/tests/api/app.service.mock.ts b/ui/src/app/tests/api/app.service.mock.ts index c1f64f9fd..464262243 100644 --- a/ui/src/app/tests/api/app.service.mock.ts +++ b/ui/src/app/tests/api/app.service.mock.ts @@ -26,13 +26,6 @@ export class AppServiceMock { return of(GET_APP).pipe(delay(1), map(DetailedApp.parse), catchError(ErrorUtils.catchError)); } - getBootVersions(): Observable { - return of({ - defaultSchemaVersion: '2', - versions: ['2', '3'] - }); - } - getAppVersions(name: string, type: ApplicationType): Observable { return of(GET_APP_VERSIONS).pipe( map(AppPage.parse), diff --git a/ui/src/app/tests/data/about.ts b/ui/src/app/tests/data/about.ts index b48ae0e62..49dab1d0e 100644 --- a/ui/src/app/tests/data/about.ts +++ b/ui/src/app/tests/data/about.ts @@ -28,7 +28,6 @@ export const LOAD = { platformHostVersion: '', platformSpecificInfo: {default: 'local'}, platformType: 'Skipper Managed', - springBootVersion: '2.3.2.RELEASE', springVersion: '5.2.8.RELEASE' }, taskLaunchers: [ @@ -42,7 +41,6 @@ export const LOAD = { platformHostVersion: '4.19.76-linuxkit', platformSpecificInfo: {}, platformType: 'Local', - springBootVersion: '2.3.2.RELEASE', springVersion: '5.2.8.RELEASE' } ]