From 7f396904ce62dd140155bb9f2cc4d033dcccb691 Mon Sep 17 00:00:00 2001 From: Philipp Zehnder Date: Wed, 31 Jul 2024 08:29:11 +0200 Subject: [PATCH] fix(#3080): Remove ng5 prefix in ui prebuild script (#3081) --- ui/.gitignore | 2 +- ui/.prettierignore | 2 +- ui/deployment/app-routing.module.mst | 6 +-- .../{appng5.module.mst => app.module.mst} | 2 +- ui/deployment/modules.yml | 48 +++++++++---------- ui/deployment/prebuild.js | 29 ++++++----- ui/src/bootstrap.ts | 2 +- 7 files changed, 45 insertions(+), 46 deletions(-) rename ui/deployment/{appng5.module.mst => app.module.mst} (98%) diff --git a/ui/.gitignore b/ui/.gitignore index 92cc25256b..d29658330e 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -22,7 +22,7 @@ src/assets/lib/apps/* # prebuild src/app/app-routing.module.ts src/app/app-overview/apps.ts -src/app/appng5.module.ts +src/app/app.module.ts src/app/home/home.service.ts src/app/services/version/version.service.ts src/app/services/app.constants.ts diff --git a/ui/.prettierignore b/ui/.prettierignore index c87dccd84e..2518fa3397 100644 --- a/ui/.prettierignore +++ b/ui/.prettierignore @@ -21,6 +21,6 @@ cypress/fixtures/**/*.csv # Ignore files that are overriden from the prebuild script src/app/app-routing.module.ts -src/app/appng5.module.ts +src/app/app.module.ts src/app/core/components/base-navigation.component.ts src/app/home/home.service.ts diff --git a/ui/deployment/app-routing.module.mst b/ui/deployment/app-routing.module.mst index 8b02986f2e..a09b0076f7 100644 --- a/ui/deployment/app-routing.module.mst +++ b/ui/deployment/app-routing.module.mst @@ -42,7 +42,7 @@ import { ActivateAccountComponent } from './login/components/activate-account/ac {{#modulesActive}} {{#componentImport}} -import { {{{ng5_component}}} } from '{{{ng5_componentPath}}}'; +import { {{{component}}} } from '{{{componentPath}}}'; {{/componentImport}} {{/modulesActive}} @@ -60,10 +60,10 @@ const routes: Routes = [ { path: '', component: HomeComponent, canActivate: [ConfiguredCanActivateGuard] }, {{#modulesActive}} {{#componentImport}} - { path: '{{{link}}}', component: {{{ng5_component}}}, data: { authPageNames: [{{{pageNames}}}]}}, + { path: '{{{link}}}', component: {{{component}}}, data: { authPageNames: [{{{pageNames}}}]}}, {{/componentImport}} {{^componentImport}} - { path: '{{{link}}}', data: { authPageNames: [{{{pageNames}}}]}, loadChildren: () => import('{{{path}}}').then(m => m.{{{ng5_moduleName}}})}, + { path: '{{{link}}}', data: { authPageNames: [{{{pageNames}}}]}, loadChildren: () => import('{{{path}}}').then(m => m.{{{moduleName}}})}, {{/componentImport}} {{/modulesActive}} diff --git a/ui/deployment/appng5.module.mst b/ui/deployment/app.module.mst similarity index 98% rename from ui/deployment/appng5.module.mst rename to ui/deployment/app.module.mst index a0d8fc02e7..5f8e6f4ee7 100644 --- a/ui/deployment/appng5.module.mst +++ b/ui/deployment/app.module.mst @@ -38,7 +38,7 @@ import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'; import { LOADING_BAR_CONFIG } from '@ngx-loading-bar/core'; {{#modulesActive}} -import { {{{ng5_moduleName}}} } from '{{{path}}}'; +import { {{{moduleName}}} } from '{{{path}}}'; {{/modulesActive}} import { NotificationModule } from './notifications/notifications.module'; diff --git a/ui/deployment/modules.yml b/ui/deployment/modules.yml index 364d8aa77d..e9e37891f3 100644 --- a/ui/deployment/modules.yml +++ b/ui/deployment/modules.yml @@ -15,9 +15,9 @@ spAssets: componentImport: False - ng5_moduleName: 'AssetsModule' - ng5_component: 'EditorComponent' - ng5_componentPath: './editor/editor.component' + moduleName: 'AssetsModule' + component: 'EditorComponent' + componentPath: './editor/editor.component' path: './assets/assets.module' link: 'assets' url: '/editor/:pipeline' @@ -29,9 +29,9 @@ spAssets: showStatusBox: false spConnect: componentImport: False - ng5_moduleName: 'ConnectModule' - ng5_component: 'ConnectComponent' - ng5_componentPath: './connect/connect.component' + moduleName: 'ConnectModule' + component: 'ConnectComponent' + componentPath: './connect/connect.component' path: './connect/connect.module' link: 'connect' url: '/connect' @@ -51,9 +51,9 @@ spConnect: createRoles: '[UserRole.ROLE_CONNECT_ADMIN]' spPipelines: componentImport: False - ng5_moduleName: 'PipelinesModule' - ng5_component: 'PipelinesComponent' - ng5_componentPath: './pipelines/pipelines.component' + moduleName: 'PipelinesModule' + component: 'PipelinesComponent' + componentPath: './pipelines/pipelines.component' path: './pipelines/pipelines.module' link: 'pipelines' url: '/pipelines/:pipeline' @@ -73,9 +73,9 @@ spPipelines: createRoles: '[UserRole.ROLE_PIPELINE_ADMIN]' spConfiguration: componentImport: False - ng5_moduleName: 'ConfigurationModule' - ng5_component: 'GeneralConfigurationComponent' - ng5_componentPath: './configuration/general-configuration/general-configuration.component' + moduleName: 'ConfigurationModule' + component: 'GeneralConfigurationComponent' + componentPath: './configuration/general-configuration/general-configuration.component' path: './configuration/configuration.module' link: 'configuration' url: '/configuration' @@ -87,9 +87,9 @@ spConfiguration: showStatusBox: false spAppOverview: componentImport: False - ng5_moduleName: 'AppOverviewModule' - ng5_component: 'AppOverviewComponent' - ng5_componentPath: './app-overview/app-overview.component' + moduleName: 'AppOverviewModule' + component: 'AppOverviewComponent' + componentPath: './app-overview/app-overview.component' path: './app-overview/app-overview.module' link: 'apps' url: '/apps' @@ -101,9 +101,9 @@ spAppOverview: showStatusBox: false spDashboard: componentImport: False - ng5_moduleName: 'DashboardModule' - ng5_component: 'DashboardComponent' - ng5_componentPath: './dashboard/dashboard.component' + moduleName: 'DashboardModule' + component: 'DashboardComponent' + componentPath: './dashboard/dashboard.component' path: './dashboard/dashboard.module' link: 'dashboard' url: '/dashboard' @@ -123,9 +123,9 @@ spDashboard: createRoles: '[UserRole.ROLE_DASHBOARD_ADMIN]' spDataExplorer: componentImport: False - ng5_moduleName: 'DataExplorerModule' - ng5_component: 'DataExplorerComponent' - ng5_componentPath: './data-explorer/data-explorer.component' + moduleName: 'DataExplorerModule' + component: 'DataExplorerComponent' + componentPath: './data-explorer/data-explorer.component' path: './data-explorer/data-explorer.module' link: 'dataexplorer' url: '/dataexplorer' @@ -145,9 +145,9 @@ spDataExplorer: createRoles: '[UserRole.ROLE_DATA_EXPLORER_ADMIN]' spFiles: componentImport: False - ng5_moduleName: 'FilesModule' - ng5_component: 'FilesComponent' - ng5_componentPath: './files/files.component' + moduleName: 'FilesModule' + component: 'FilesComponent' + componentPath: './files/files.component' path: './files/files.module' link: 'files' url: '/files' diff --git a/ui/deployment/prebuild.js b/ui/deployment/prebuild.js index d4628ea5ba..01c6865a4b 100644 --- a/ui/deployment/prebuild.js +++ b/ui/deployment/prebuild.js @@ -33,10 +33,10 @@ if (programArgs.length <= 2) { console.log('Build config specified. Using config for ' + branchName); } -// Check if Confgit stig-File for current Branch exists, otherwise use "def" -if (!fs.existsSync('deployment/' + branchName + '/config.yml')) { +// Check if Config-File for current Branch exists, otherwise use "def" +if (!fs.existsSync(`deployment/${branchName}/config.yml`)) { console.log( - 'Could not find config for ' + branchName + '. Using config for dev.', + `Could not find config for ${branchName}. Using config for dev.`, ); branchName = 'dev'; } @@ -45,7 +45,7 @@ if (!fs.existsSync('deployment/' + branchName + '/config.yml')) { let config = {}; try { config = yaml.load( - fs.readFileSync('deployment/' + branchName + '/config.yml', 'utf8'), + fs.readFileSync(`deployment/${branchName}/config.yml`, 'utf8'), ); } catch (error) { console.log('Invalid Config-File. Pre-Build failed.'); @@ -67,10 +67,9 @@ for (let module of config.modules) { modulesActive['modulesActive'].push({ module: module, componentImport: modules[module]['componentImport'], - ng1_templateUrl: modules[module]['ng1_templateUrl'], - ng5_moduleName: modules[module]['ng5_moduleName'], - ng5_component: modules[module]['ng5_component'], - ng5_componentPath: modules[module]['ng5_componentPath'], + moduleName: modules[module]['moduleName'], + component: modules[module]['component'], + componentPath: modules[module]['componentPath'], path: modules[module]['path'], link: modules[module]['link'], pageNames: modules[module]['pageNames'], @@ -87,9 +86,9 @@ for (let module of config.modules) { // Create necessary JavaScript-Files from Template and move to respective Directory fs.writeFileSync( - 'src/app/appng5.module.ts', + 'src/app/app.module.ts', mustache.render( - fs.readFileSync('deployment/appng5.module.mst', 'utf8').toString(), + fs.readFileSync('deployment/app.module.mst', 'utf8').toString(), modulesActive, ), ); @@ -157,7 +156,7 @@ fs.writeFileSync( console.log('Moved: webpack dev config'); if (process.env.THEME_LOC !== undefined) { - console.log('Using custom-provided theme ' + process.env.THEME_LOC); + console.log(`Using custom-provided theme ${process.env.THEME_LOC}`); fs.writeFileSync( 'src/scss/_variables.scss', fs.readFileSync(process.env.THEME_LOC, 'utf8'), @@ -166,7 +165,7 @@ if (process.env.THEME_LOC !== undefined) { if (process.env.LOGO_HEADER_LOC !== undefined) { console.log( - 'Using custom-provided header logo ' + process.env.LOGO_HEADER_LOC, + `Using custom-provided header logo ${process.env.LOGO_HEADER_LOC}`, ); fs.writeFileSync( 'src/assets/img/sp/logo.png', @@ -176,7 +175,7 @@ if (process.env.LOGO_HEADER_LOC !== undefined) { if (process.env.LOGO_NAV_LOC !== undefined) { console.log( - 'Using custom-provided navbar logo ' + process.env.LOGO_NAV_LOC, + `Using custom-provided navbar logo ${process.env.LOGO_NAV_LOC}`, ); fs.writeFileSync( 'src/assets/img/sp/logo-navigation.png', @@ -185,7 +184,7 @@ if (process.env.LOGO_NAV_LOC !== undefined) { } if (process.env.FAVICON_LOC !== undefined) { - console.log('Using custom-provided favicon ' + process.env.FAVICON_LOC); + console.log(`Using custom-provided favicon ${process.env.FAVICON_LOC}`); fs.writeFileSync( 'src/assets/img/favicon/favicon-96x96.png', fs.readFileSync(process.env.FAVICON_LOC), @@ -194,7 +193,7 @@ if (process.env.FAVICON_LOC !== undefined) { if (process.env.CONSTANTS_FILE !== undefined) { console.log( - 'Using custom-provided constants file ' + process.env.CONSTANTS_FILE, + `Using custom-provided constants file ${process.env.CONSTANTS_FILE}`, ); fs.writeFileSync( 'src/app/services/app.constants.ts', diff --git a/ui/src/bootstrap.ts b/ui/src/bootstrap.ts index fd49fc5592..17ca71fdbe 100644 --- a/ui/src/bootstrap.ts +++ b/ui/src/bootstrap.ts @@ -18,7 +18,7 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { environment } from './environments/environment'; -import { AppModule } from './app/appng5.module'; +import { AppModule } from './app/app.module'; import { enableProdMode } from '@angular/core'; if (environment.production) {