From b1d8453ea3ef06867c1342b72205e2059d1850d3 Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Thu, 30 Apr 2020 13:26:45 +0100 Subject: [PATCH 001/149] WIP --- .gitignore | 17 +- angular.json | 85 ++--- build/customize-build.js | 316 ------------------ deploy/cloud-foundry/build.sh | 1 - .../packages/backend/pre_packaging | 1 - .../packages/frontend/pre_packaging | 1 - .../app-action-extension.component.spec.ts | 6 +- package-lock.json | 14 + package.json | 20 +- .../autoscaler-base.component.spec.ts | 2 +- .../autoscaler-metric-page.component.spec.ts | 2 +- ...caler-scale-history-page.component.spec.ts | 2 +- ...autoscaler-tab-extension.component.spec.ts | 2 +- .../edit-autoscaler-policy-service.spec.ts | 2 +- ...-autoscaler-policy-step1.component.spec.ts | 2 +- ...-autoscaler-policy-step2.component.spec.ts | 2 +- ...-autoscaler-policy-step3.component.spec.ts | 2 +- ...-autoscaler-policy-step4.component.spec.ts | 2 +- .../edit-autoscaler-policy.component.spec.ts | 2 +- .../card-autoscaler-default.component.spec.ts | 8 +- ...p-autoscaler-events-config.service.spec.ts | 4 +- ...scaler-metric-chart-card.component.spec.ts | 6 +- .../combo-series-vertical.component.spec.ts | 2 +- ...r-metric-chart-list-config.service.spec.ts | 10 +- .../entity-relations-from-parent.spec.ts | 2 +- .../entity-relations-validate.spec.ts | 2 +- .../instances-tab.component.spec.ts | 2 +- .../cloud-foundry-tabs-base.component.spec.ts | 2 +- .../cloud-foundry.component.spec.ts | 4 +- .../quota-definition.component.spec.ts | 2 +- .../space-quota-definition.component.spec.ts | 4 +- .../cf-app-instances-config.service.spec.ts | 2 +- .../cf-org-card/cf-org-card.component.spec.ts | 8 +- .../cf-space-card.component.spec.ts | 8 +- .../cloud-foundry-endpoint-service.helper.ts | 2 +- src/frontend/packages/core/favicon.ico | 1 + .../misc/custom/custom-src-routing.module.ts_ | 21 -- .../core/misc/custom/custom-src.module.ts_ | 16 - .../packages/core/misc/custom/custom.scss | 5 - .../packages/core/misc/custom/custom.yaml | 14 - .../packages/core/misc/custom/eula.html | 7 - .../packages/core/sass/_all-theme.scss | 51 +-- src/frontend/packages/core/sass/colors.scss | 7 - src/frontend/packages/core/sass/custom.scss | 1 + src/frontend/packages/core/sass/theme.scss | 57 ++-- .../packages/core/src/app.component.spec.ts | 2 +- .../current-user-permissions.service.spec.ts | 2 +- .../core/src/core/endpoints.service.spec.ts | 4 +- .../log-out-dialog.component.spec.ts | 4 +- .../core/src/core/logger.service.spec.ts | 2 +- .../core/src/core/user.service.spec.ts | 2 +- .../custom-import.module.ts} | 3 +- .../about-page/about-page.component.spec.ts | 2 +- .../core/src/features/about/about.module.ts | 4 +- .../diagnostics-page.component.spec.ts | 2 +- .../about/eula-page/eula-page.component.html | 2 +- .../eula-page/eula-page.component.spec.ts | 10 +- .../about/eula-page/eula-page.component.ts | 21 +- .../dashboard-base.component.scss | 1 - .../side-nav/side-nav.component.spec.ts | 2 +- .../connect-endpoint-dialog.component.spec.ts | 2 +- .../connect-endpoint.component.spec.ts | 2 +- ...reate-endpoint-base-step.component.spec.ts | 2 +- ...reate-endpoint-cf-step-1.component.spec.ts | 2 +- .../create-endpoint-connect.component.spec.ts | 2 +- .../create-endpoint.component.spec.ts | 4 +- .../endpoints-page.component.spec.ts | 4 +- .../error-page/error-page.component.spec.ts | 2 +- .../events-page/events-page.component.spec.ts | 2 +- .../home/home/home-page.component.spec.ts | 2 +- .../metrics/metrics/metrics.component.spec.ts | 2 +- .../no-endpoints-non-admin.component.spec.ts | 2 +- .../local-account-wizard.component.spec.ts | 2 +- .../edit-profile-info.component.spec.ts | 4 +- .../profile-info.component.spec.ts | 4 +- .../core/{misc/custom => src}/index.html | 2 +- .../core/src/logged-in.service.spec.ts | 2 +- .../app-name-unique.directive.spec.ts | 2 +- .../cf-auth/cf-auth.service.spec.ts | 2 +- .../code-block/code-block.component.spec.ts | 2 +- .../copy-to-clipboard.component.spec.ts | 2 +- .../endpoints-missing.component.spec.ts | 2 +- .../meta-card.component.spec.ts | 4 +- .../table-cell-actions.component.spec.ts | 2 +- .../list/list-table/table.component.spec.ts | 2 +- .../table-cell-quota.component.spec.ts | 2 +- .../endpoints-list-config.service.spec.ts | 2 +- ...b-commits-list-config-base.service.spec.ts | 2 +- .../components/list/list.component.spec.ts | 6 +- .../loading-page.component.spec.ts | 4 +- .../markdown-preview.component.spec.ts | 2 +- .../metrics-chart.component.spec.ts | 4 +- ...cs-parent-range-selector.component.spec.ts | 4 +- .../metrics-range-selector.component.spec.ts | 4 +- .../recent-entities.component.spec.ts | 2 +- .../sidepanel-preview.component.spec.ts | 2 +- .../steppers/steppers.component.spec.ts | 2 +- .../src/shared/global-events.service.spec.ts | 2 +- src/frontend/packages/core/src/styles.scss | 1 - .../core/test-framework/core-test.helper.ts | 2 +- src/frontend/packages/core/tsconfig.app.json | 3 +- src/frontend/packages/shared/karma.conf.js | 8 + src/frontend/packages/shared/ng-package.json | 7 + src/frontend/packages/shared/package.json | 11 + .../packages/shared/sass/_all-theme.scss | 9 + .../packages/shared/src/components.module.ts | 17 + .../stratos-title.component.html | 4 + .../stratos-title.component.scss | 20 ++ .../stratos-title.component.spec.ts | 25 ++ .../stratos-title.component.theme.scss | 6 + .../stratos-title/stratos-title.component.ts | 12 + .../packages/shared/src/public-api.ts | 5 + .../packages/shared/tsconfig.lib.json | 10 + .../packages/shared/tsconfig.spec.json | 17 + src/frontend/packages/shared/tslint.json | 17 + src/frontend/packages/store/package.json | 2 +- .../store/src/entity-catalog.actions.ts | 2 +- .../entity-catalog/entity-catalog-entity.ts | 2 +- src/frontend/packages/theme/_helper.scss | 76 +++++ src/frontend/packages/theme/_index.scss | 7 + .../custom => theme/assets/core}/login-bg.jpg | Bin .../custom => theme/assets/core}/logo.png | Bin .../assets/core}/nav-logo-icon.png | Bin .../custom => theme/assets/core}/nav-logo.png | Bin .../misc/custom => theme/assets}/favicon.ico | Bin .../misc/custom => theme/loader}/loading.css | 0 .../misc/custom => theme/loader}/loading.html | 0 .../{core/sass => theme}/mat-colors.scss | 0 .../{core/sass => theme}/mat-themes.scss | 0 src/frontend/packages/theme/package.json | 19 ++ src/frontend/packages/tools/package-lock.json | 14 + src/frontend/packages/tools/package.json | 12 + .../packages/tools/src/build/assets.ts | 21 ++ .../packages/tools/src/build/extensions.ts | 63 ++++ .../tools/src/build/index.transform.ts | 61 ++++ src/frontend/packages/tools/src/build/main.ts | 36 ++ src/frontend/packages/tools/src/build/sass.ts | 91 +++++ src/frontend/packages/tools/tsconfig.json | 11 + src/tsconfig.json | 4 +- 139 files changed, 820 insertions(+), 665 deletions(-) delete mode 100644 build/customize-build.js create mode 120000 src/frontend/packages/core/favicon.ico delete mode 100644 src/frontend/packages/core/misc/custom/custom-src-routing.module.ts_ delete mode 100644 src/frontend/packages/core/misc/custom/custom-src.module.ts_ delete mode 100644 src/frontend/packages/core/misc/custom/custom.scss delete mode 100644 src/frontend/packages/core/misc/custom/custom.yaml delete mode 100644 src/frontend/packages/core/misc/custom/eula.html delete mode 100644 src/frontend/packages/core/sass/colors.scss create mode 120000 src/frontend/packages/core/sass/custom.scss rename src/frontend/packages/core/{misc/custom/custom.module.ts_ => src/custom-import.module.ts} (57%) rename src/frontend/packages/core/{misc/custom => src}/index.html (95%) create mode 100644 src/frontend/packages/shared/karma.conf.js create mode 100644 src/frontend/packages/shared/ng-package.json create mode 100644 src/frontend/packages/shared/package.json create mode 100644 src/frontend/packages/shared/sass/_all-theme.scss create mode 100644 src/frontend/packages/shared/src/components.module.ts create mode 100644 src/frontend/packages/shared/src/components/stratos-title/stratos-title.component.html create mode 100644 src/frontend/packages/shared/src/components/stratos-title/stratos-title.component.scss create mode 100644 src/frontend/packages/shared/src/components/stratos-title/stratos-title.component.spec.ts create mode 100644 src/frontend/packages/shared/src/components/stratos-title/stratos-title.component.theme.scss create mode 100644 src/frontend/packages/shared/src/components/stratos-title/stratos-title.component.ts create mode 100644 src/frontend/packages/shared/src/public-api.ts create mode 100644 src/frontend/packages/shared/tsconfig.lib.json create mode 100644 src/frontend/packages/shared/tsconfig.spec.json create mode 100644 src/frontend/packages/shared/tslint.json create mode 100644 src/frontend/packages/theme/_helper.scss create mode 100644 src/frontend/packages/theme/_index.scss rename src/frontend/packages/{core/misc/custom => theme/assets/core}/login-bg.jpg (100%) rename src/frontend/packages/{core/misc/custom => theme/assets/core}/logo.png (100%) rename src/frontend/packages/{core/misc/custom => theme/assets/core}/nav-logo-icon.png (100%) rename src/frontend/packages/{core/misc/custom => theme/assets/core}/nav-logo.png (100%) rename src/frontend/packages/{core/misc/custom => theme/assets}/favicon.ico (100%) rename src/frontend/packages/{core/misc/custom => theme/loader}/loading.css (100%) rename src/frontend/packages/{core/misc/custom => theme/loader}/loading.html (100%) rename src/frontend/packages/{core/sass => theme}/mat-colors.scss (100%) rename src/frontend/packages/{core/sass => theme}/mat-themes.scss (100%) create mode 100644 src/frontend/packages/theme/package.json create mode 100644 src/frontend/packages/tools/package-lock.json create mode 100644 src/frontend/packages/tools/package.json create mode 100644 src/frontend/packages/tools/src/build/assets.ts create mode 100644 src/frontend/packages/tools/src/build/extensions.ts create mode 100644 src/frontend/packages/tools/src/build/index.transform.ts create mode 100644 src/frontend/packages/tools/src/build/main.ts create mode 100644 src/frontend/packages/tools/src/build/sass.ts create mode 100644 src/frontend/packages/tools/tsconfig.json diff --git a/.gitignore b/.gitignore index fc81bdc82b..3dfff74334 100644 --- a/.gitignore +++ b/.gitignore @@ -95,19 +95,8 @@ src/jetstream/console-database.db src/jetstream/config.properties src/jetstream/db/dbconf.yml -# Customisations - -src/frontend/packages/core/favicon.ico -src/frontend/packages/core/sass/custom.scss -src/frontend/packages/core/assets/eula.html -src/frontend/packages/core/assets/logo.png -src/frontend/packages/core/assets/nav-logo.png -src/frontend/packages/core/assets/login-bg.jpg -src/frontend/packages/core/src/custom-import.module.ts -src/frontend/packages/core/src/custom -src/frontend/packages/core/assets/custom -src/frontend/packages/core/sass/custom -src/frontend/packages/core/src/index.html +# Customisation - generated import module +src/frontend/packages/core/src/_custom-import.module.ts # Prebuild package @@ -116,3 +105,5 @@ stratos-frontend-prebuild.zip src/frontend/assets src/frontend/sass go-vendor-*.tgz + +/dist-tools \ No newline at end of file diff --git a/angular.json b/angular.json index 12d5d6f658..1f98a8baf1 100644 --- a/angular.json +++ b/angular.json @@ -4,14 +4,17 @@ "newProjectRoot": "src/frontend/packages", "projects": { "stratos": { - "root": "", + "root": "src/frontend/packages", "sourceRoot": "src/frontend/packages", "projectType": "application", "architect": { "build": { - "builder": "@angular-devkit/build-angular:browser", + "builder": "@angular-builders/custom-webpack:browser", "options": { - "aot": true, + "customWebpackConfig": { + "path": "./dist-tools/build/main.js" + }, + "indexTransform": "./dist-tools/build/index.transform.js", "preserveSymlinks": true, "outputPath": "dist", "index": "src/frontend/packages/core/src/index.html", @@ -36,12 +39,6 @@ }, "configurations": { "production": { - "budgets": [ - { - "type": "anyComponentStyle", - "maximumWarning": "6kb" - } - ], "optimization": true, "outputHashing": "all", "sourceMap": false, @@ -61,7 +58,7 @@ } }, "serve": { - "builder": "@angular-devkit/build-angular:dev-server", + "builder": "@angular-builders/custom-webpack:dev-server", "options": { "aot": true, "sslCert": "dev-ssl/server.crt", @@ -84,20 +81,6 @@ } } }, - "stratos-e2e": { - "root": "e2e", - "sourceRoot": "", - "projectType": "application", - "architect": { - "e2e": { - "builder": "@angular-devkit/build-angular:protractor", - "options": { - "protractorConfig": "./protractor.conf.js", - "devServerTarget": "stratos:serve" - } - } - } - }, "core": { "root": "src/frontend/packages/core/", "sourceRoot": "src/frontend/packages/core/src", @@ -106,7 +89,7 @@ "schematics": {}, "architect": { "build": { - "builder": "@angular-devkit/build-angular:browser", + "builder": "@angular-builders/custom-webpack:browser", "options": { "aot": true, "preserveSymlinks": true, @@ -116,13 +99,7 @@ "polyfills": "src/frontend/packages/core/src/polyfills.ts", "tsConfig": "src/frontend/packages/core/tsconfig.app.json", "assets": [ - "src/frontend/packages/core/favicon.ico", - "src/frontend/packages/core/assets", - { - "glob": "**/*", - "input": "custom-src/frontend/assets/custom", - "output": "/core/assets/custom" - } + "src/frontend/packages/core/assets" ], "styles": [ "src/frontend/packages/core/src/styles.css", @@ -229,13 +206,13 @@ "options": { "tsConfig": "src/frontend/packages/store/tsconfig.lib.json", "project": "src/frontend/packages/store/ng-package.json" - } - , "configurations": { + }, + "configurations": { "production": { "tsConfig": "src/frontend/packages/store/tsconfig.lib.prod.json" } } -}, + }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { @@ -261,6 +238,37 @@ } } }, + "shared": { + "root": "src/frontend/packages/shared", + "sourceRoot": "src/frontend/packages/shared/src", + "projectType": "library", + "prefix": "lib", + "architect": { + "build": { + "builder": "@angular-devkit/build-ng-packagr:build", + "options": { + "tsConfig": "src/frontend/packages/shared/tsconfig.lib.json", + "project": "src/frontend/packages/shared/ng-package.json" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/frontend/packages/shared/src/test.ts", + "tsConfig": "src/frontend/packages/shared/tsconfig.spec.json", + "karmaConfig": "src/frontend/packages/shared/karma.conf.js" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": ["src/tsconfig.json"], + "tslintConfig": "src/frontend/packages/shared/tslint.json", + "files": ["src/frontend/packages/shared/src/**/*.ts"] + } + } + } + }, "cloud-foundry": { "root": "src/frontend/packages/cloud-foundry", "sourceRoot": "src/frontend/packages/cloud-foundry/src", @@ -278,7 +286,7 @@ "tsConfig": "src/frontend/packages/cloud-foundry/tsconfig.lib.prod.json" } } -}, + }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { @@ -321,7 +329,7 @@ "tsConfig": "src/frontend/packages/cf-autoscaler/tsconfig.lib.prod.json" } } -}, + }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { @@ -357,8 +365,5 @@ "@schematics/angular:directive": { "prefix": "app" } - }, - "cli": { - "_defaultCollection": "@nrwl/angular" } } \ No newline at end of file diff --git a/build/customize-build.js b/build/customize-build.js deleted file mode 100644 index fb98297c18..0000000000 --- a/build/customize-build.js +++ /dev/null @@ -1,316 +0,0 @@ -/** - * Gulp build file for applying cutomizations - */ - -/* eslint-disable angular/log,no-console,no-process-env,angular/json-functions,no-sync */ -(function () { - 'use strict'; - - var gulp = require('gulp'); - var path = require('path'); - var fs = require('fs-extra'); - var yaml = require('js-yaml'); - var replace = require('replace-in-file'); - var execSync = require('child_process').execSync; - - const CUSTOM_YAML_MANIFEST = path.resolve(__dirname, '../src/frontend/packages/core/misc/custom/custom.yaml'); - const INDEX_TEMPLATE = path.resolve(__dirname, '../src/frontend/packages/core/misc/custom/index.html'); - const INDEX_HTML = path.resolve(__dirname, '../src/frontend/packages/core/src/index.html'); - const CUSTOM_METADATA = path.resolve(__dirname, '../custom-src/stratos.yaml'); - const GIT_FOLDER = path.resolve(__dirname, '../.git'); - const GIT_METADATA = path.resolve(__dirname, '../.stratos-git-metadata.json'); - const INDEX_LOADING_HTML_CUSTOM = path.resolve(__dirname, '../custom-src/frontend/loading.html'); - const INDEX_LOADING_HTML_DEFAULT = path.resolve(__dirname, '../src/frontend/packages/core/misc/custom/loading.html'); - const INDEX_LOADING_CSS_CUSTOM = path.resolve(__dirname, '../custom-src/frontend/loading.css'); - const INDEX_LOADING_CSS_DEFAULT = path.resolve(__dirname, '../src/frontend/packages/core/misc/custom/loading.css'); - - // Apply any customizations - // Symlink customizations of the default resources for Stratos - gulp.task('customize', function (cb) { - doShowVersions() - doCustomize(false); - doGenerateIndexHtml(true); - console.log('Finished applying customizations') - cb(); - }); - - // Apply defaults instead of any customizations that are available in custom-src - gulp.task('customize-default', function (cb) { - doCustomize(true); - doGenerateIndexHtml(false); - console.log('Finished applying default customizations') - cb(); - }); - - // Remove all customizations (removes all symlinks as if customize had not been run) - gulp.task('customize-reset', function (cb) { - doCustomize(true, true); - doGenerateIndexHtml(false); - console.log('Finished resetting customizations') - cb(); - }); - - // Store git metadata so we have it when we are running the the non-git world (Docker) - gulp.task('store-git-metadata', function (cb) { - storeGitRepositoryMetadata(); - cb(); - }); - - function doShowVersions() { - console.log('Node Version: ' + process.versions.node || 'N/A'); - try { - var response = execSync('npm --v'); - var npmVersion = response.toString().trim(); - console.log('NPM Version : ' + npmVersion || 'N/A'); - } catch (e) { - console.log('NPM Version : N/A'); - } - } - - function doCustomize(forceDefaults, reset) { - var msg = !forceDefaults ? 'Checking for and applying customizations' : 'Removing customizations and applying defaults'; - var msg = !reset ? msg : 'Removing all customizations'; - console.log(msg); - var customConfig; - - try { - customConfig = yaml.safeLoad(fs.readFileSync(CUSTOM_YAML_MANIFEST, 'utf8')); - } catch (e) { - console.log('Could not read custom.yaml file'); - console.log(e); - process.exit(1); - } - - const baseFolder = path.resolve(__dirname, '../src/frontend/packages/core'); - const customBaseFolder = path.resolve(__dirname, '../custom-src/frontend'); - doCustomizeFiles(forceDefaults, reset, customConfig, baseFolder, customBaseFolder); - doCustomizeFolders(forceDefaults, reset, customConfig, baseFolder, customBaseFolder); - doCustomizeCreateModule(forceDefaults, reset, customConfig, baseFolder, customBaseFolder); - - const backendBaseFolder = path.resolve(__dirname, '../src/jetstream/plugins'); - const backendCustomBaseFolder = path.resolve(__dirname, '../custom-src/jetstream'); - - // There are no defaults for the backend - its the same as removing all of the custom plugins that are there - doCustomizeBackend(forceDefaults || reset, backendBaseFolder, backendCustomBaseFolder); - }; - - function doCustomizeFiles(forceDefaults, reset, customConfig, baseFolder, customBaseFolder) { - // This is where we find the default files, if there are no customizations - const defaultSrcFolder = path.resolve(__dirname, '../src/frontend/packages/core/misc/custom'); - // Symlink custom files - Object.keys(customConfig.files).forEach(file => { - const dest = customConfig.files[file]; - - var srcFile = path.join(defaultSrcFolder, file); - const destFile = path.join(baseFolder, dest); - const customSrcFile = path.join(customBaseFolder, dest); - - // Use the custom file if there is one - if (!forceDefaults && fs.existsSync(customSrcFile)) { - srcFile = customSrcFile; - } - - // Doing an exists check on a symlink will tell if the link dest exists, not the link itself - // So try and delete anyway and catch any exception - try { - const existingLink = fs.readlinkSync(destFile); - fs.unlinkSync(destFile); - } catch (e) { } - - if (!reset) { - fs.symlinkSync(srcFile, destFile); - console.log(' + Linking file : ' + srcFile + ' ==> ' + destFile); - } - }) - - } - - function doCustomizeFolders(forceDefaults, reset, customConfig, baseFolder, customBaseFolder) { - // Symlink custom app folders if they are present - customConfig.folders.forEach(folder => { - var parts = folder.split(':') - var src = parts[0]; - var dest = src; - if (parts.length > 1) { - dest = parts[1]; - } - var destFolder = path.join(baseFolder, dest); - var srcFolder = path.join(customBaseFolder, src); - if (fs.existsSync(destFolder)) { - fs.unlinkSync(destFolder); - } - if (!reset && fs.existsSync(srcFolder)) { - fs.symlinkSync(srcFolder, destFolder); - console.log(' + Linking folder : ' + srcFolder + ' ==> ' + destFolder); - } - }); - } - - // Copy the correct custom module to either import the supplied custom module or provide an empty module - function doCustomizeCreateModule(forceDefaults, reset, customConfig, baseFolder, customBaseFolder) { - const defaultSrcFolder = path.resolve(__dirname, '../src/frontend/packages/core/misc/custom'); - const destFile = path.join(baseFolder, 'src/custom-import.module.ts'); - const customModuleFile = path.join(baseFolder, 'src/custom/custom.module.ts'); - const customRoutingModuleFile = path.join(baseFolder, 'src/custom/custom-routing.module.ts'); - - // Delete the existing file if it exists - if (fs.existsSync(destFile)) { - fs.unlinkSync(destFile) - } - - if (!reset) { - let srcFile = 'custom.module.ts_'; - if (fs.existsSync(customModuleFile)) { - srcFile = 'custom-src.module.ts_'; - if (fs.existsSync(customRoutingModuleFile)) { - srcFile = 'custom-src-routing.module.ts_'; - console.log(' + Found custom module with routing'); - } else { - console.log(' + Found custom module without routing'); - } - } else { - console.log(' + No custom module found - linking empty custom module'); - } - fs.copySync(path.join(defaultSrcFolder, srcFile), destFile); - console.log(' + Copying file : ' + path.join(defaultSrcFolder, srcFile) + ' ==> ' + destFile); - } - } - - function doCustomizeBackend(reset, baseFolder, customBaseFolder) { - // Symlink custom backend plugin folders if they are present - // Get all of the sub-folders in the custom-src/backend folder and symlink - - // Update the git metadata if we can - storeGitRepositoryMetadata(); - - // Remove all existing symlinks first - var existing = fs.readdirSync(baseFolder); - existing.forEach(file => { - var pluginPath = path.join(baseFolder, file); - var stats = fs.lstatSync(pluginPath); - if (stats.isSymbolicLink()) { - fs.unlinkSync(pluginPath); - } - }) - - if (reset) { - // If we are reseting then we are done, just return now - return; - } - - // Check if we have a customization folder - if (!fs.existsSync(customBaseFolder)) { - return; - } - - // Symlink any custom plugins - var plugins = fs.readdirSync(customBaseFolder); - plugins.forEach(file => { - var srcFolder = path.join(customBaseFolder, file); - var stats = fs.statSync(srcFolder); - var destFolder = path.join(baseFolder, file); - if (stats.isDirectory()) { - if (fs.existsSync(destFolder)) { - fs.unlinkSync(destFolder); - } - fs.symlinkSync(srcFolder, destFolder); - } - }) - } - - // Generate index.html from template - function doGenerateIndexHtml(customize) { - - console.log(' + Generating index.html'); - // Copy the default - fs.copySync(INDEX_TEMPLATE, INDEX_HTML); - - // Read custom metadata if we are customizing and the file is present - var metadata = {}; - if (customize && fs.existsSync(CUSTOM_METADATA)) { - try { - metadata = yaml.safeLoad(fs.readFileSync(CUSTOM_METADATA, 'utf8')); - } catch (e) { - console.log('Could not read stratos.yaml file'); - console.log(e); - process.exit(1); - } - } - - if (metadata.title) { - console.log(' + Overridding title to: "' + metadata.title + '"'); - } - - // Patch different page title if there is one - var title = metadata.title || 'Stratos'; - replace.sync({ files: INDEX_HTML, from: /@@TITLE@@/g, to: title }); - - // Read in the stored Git metadata if it is there, default to empty metadata - var gitMetadata = { - project: process.env.project || process.env.STRATOS_PROJECT || '', - branch: process.env.branch || process.env.STRATOS_BRANCH || '', - commit: process.env.commit || process.env.STRATOS_COMMIT || '' - }; - - if (fs.existsSync(GIT_METADATA)) { - gitMetadata = JSON.parse(fs.readFileSync(GIT_METADATA)); - console.log(' + Project Metadata file read OK'); - } else { - console.log(' + Project Metadata file does not exist'); - } - - console.log(" + Project Metadata: " + JSON.stringify(gitMetadata)); - - // Git Information - replace.sync({ files: INDEX_HTML, from: '@@stratos_git_project@@', to: gitMetadata.project }); - replace.sync({ files: INDEX_HTML, from: '@@stratos_git_branch@@', to: gitMetadata.branch }); - replace.sync({ files: INDEX_HTML, from: '@@stratos_git_commit@@', to: gitMetadata.commit }); - - // Date and Time that the build was made (approximately => it is when this script is run) - replace.sync({ files: INDEX_HTML, from: '@@stratos_build_date@@', to: new Date() }); - - // Replace loading indicator - HTML - let loadingHtmlFile = INDEX_LOADING_HTML_DEFAULT; - if (fs.existsSync(INDEX_LOADING_HTML_CUSTOM)) { - loadingHtmlFile = INDEX_LOADING_HTML_CUSTOM - } - const loadingHtml = fs.readFileSync(loadingHtmlFile, 'utf8'); - replace.sync({ files: INDEX_HTML, from: '', to: loadingHtml }); - - // Replace loading indicator - CSS - let loadingCssFile = INDEX_LOADING_CSS_DEFAULT; - if (fs.existsSync(INDEX_LOADING_CSS_CUSTOM)) { - loadingCssFile = INDEX_LOADING_CSS_CUSTOM - } - const loadingCss = fs.readFileSync(loadingCssFile, 'utf8'); - replace.sync({ files: INDEX_HTML, from: '/** @@LOADING_CSS@@ **/', to: loadingCss }); - } - - // We can only do this if we have a git repository checkout - // We'll store this in a file which we will then use - when in environments like Docker, we will run this - // in the host environment so that we can pick it up when we're running in the Docker world - function storeGitRepositoryMetadata() { - // Do we have a git folder? - if (!fs.existsSync(GIT_FOLDER)) { - console.log(' + Unable to store git repository metadata - .git folder not found'); - return; - } - var gitMetadata = { - project: execGit('git config --get remote.origin.url'), - branch: execGit('git rev-parse --abbrev-ref HEAD'), - commit: execGit('git rev-parse HEAD') - }; - - fs.writeFileSync(GIT_METADATA, JSON.stringify(gitMetadata, null, 2)); - } - - function execGit(cmd) { - try { - var response = execSync(cmd + ' 2> /dev/null'); - return response.toString().trim(); - } catch (e) { - return ''; - } - } - -})(); \ No newline at end of file diff --git a/deploy/cloud-foundry/build.sh b/deploy/cloud-foundry/build.sh index 0d3f2eb8d3..3d89979b33 100755 --- a/deploy/cloud-foundry/build.sh +++ b/deploy/cloud-foundry/build.sh @@ -39,7 +39,6 @@ else # Build front-end log "Fetching front-end dependencies" $CYAN npm install - npm run customize log "Building front-end" $CYAN npm run build-cf diff --git a/deploy/stratos-ui-release/packages/backend/pre_packaging b/deploy/stratos-ui-release/packages/backend/pre_packaging index 99faea2123..ba252553a7 100644 --- a/deploy/stratos-ui-release/packages/backend/pre_packaging +++ b/deploy/stratos-ui-release/packages/backend/pre_packaging @@ -10,7 +10,6 @@ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh # Build backend npm install -npm run customize export PATH=$PATH:$PWD/node_modules/.bin npm run bosh-build-backend diff --git a/deploy/stratos-ui-release/packages/frontend/pre_packaging b/deploy/stratos-ui-release/packages/frontend/pre_packaging index c2c28d2215..440e323fa2 100644 --- a/deploy/stratos-ui-release/packages/frontend/pre_packaging +++ b/deploy/stratos-ui-release/packages/frontend/pre_packaging @@ -4,7 +4,6 @@ set -e -x cd ${BUILD_DIR}/stratos npm install -npm run customize export PATH=$PATH:$PWD/node_modules/.bin npm run build diff --git a/examples/custom-src/frontend/app/custom/app-action-extension/app-action-extension.component.spec.ts b/examples/custom-src/frontend/app/custom/app-action-extension/app-action-extension.component.spec.ts index 4efb359c3f..d63c3f0a38 100644 --- a/examples/custom-src/frontend/app/custom/app-action-extension/app-action-extension.component.spec.ts +++ b/examples/custom-src/frontend/app/custom/app-action-extension/app-action-extension.component.spec.ts @@ -1,10 +1,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; -import { AppActionExtensionComponent } from './app-action-extension.component'; import { CoreModule } from '../../core/core.module'; -import { RouterTestingModule } from '@angular/router/testing'; import { SharedModule } from '../../shared/shared.module'; -import { createBasicStoreModule } from '@stratos/store/testing'; +import { AppActionExtensionComponent } from './app-action-extension.component'; describe('AppActionExtensionComponent', () => { let component: AppActionExtensionComponent; diff --git a/package-lock.json b/package-lock.json index e611c6e04e..5c5c623341 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,20 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@angular-builders/custom-webpack": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@angular-builders/custom-webpack/-/custom-webpack-9.1.0.tgz", + "integrity": "sha512-Dek6KxNUFBELKqNRO4Im5JIP0/rZF4HmvgA8X+RyqOd9cyDxk16A441WlqTqy3UKX8lcbf6C9RcR5D2dI1ZATQ==", + "dev": true, + "requires": { + "@angular-devkit/architect": ">=0.900.0 < 0.1000.0", + "@angular-devkit/build-angular": ">=0.900.0 < 0.1000.0", + "@angular-devkit/core": "^9.0.0", + "lodash": "^4.17.10", + "ts-node": "^8.5.2", + "webpack-merge": "^4.2.1" + } + }, "@angular-devkit/architect": { "version": "0.901.1", "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.901.1.tgz", diff --git a/package.json b/package.json index dd48317e89..c502036a21 100644 --- a/package.json +++ b/package.json @@ -11,14 +11,14 @@ "test-backend": "./build/bk-build.sh test", "update-webdriver": "webdriver-manager update", "build": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod", - "build-cf": "node --max_old_space_size=2692 --gc_interval=100 node_modules/@angular/cli/bin/ng build --prod", + "build-cf": "node --max_old_space_size=1128 --optimize_for_size --gc_interval=100 node_modules/@angular/cli/bin/ng build --prod --aot=false --build-optimizer=false", "build-dev": "ng build --dev", - "prebuild-ui": "npm run customize && npm run build && gulp package-prebuild", + "prebuild-ui": "npm run build && gulp package-prebuild", "ng": "ng", - "start": "npm run customize && ng serve", - "start-high-mem": "npm run customize && node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng serve", - "start-dev-high-mem": "npm run customize && node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng serve --aot=false", - "start-prod-high-mem": "npm run customize && node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng serve --prod", + "start": "ng serve", + "start-high-mem": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng serve", + "start-dev-high-mem": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng serve --aot=false", + "start-prod-high-mem": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng serve --prod", "start-dev": "ng serve --aot=false", "test-clean": "./build/clean-test-reports.sh", "test-reports": "./build/show-test-reports.sh", @@ -37,11 +37,9 @@ "headless-e2e": "xvfb-run --server-args='-screen 0 1920x1080x24' protractor ./protractor.conf.js", "climate": "codeclimate analyze $(git diff --name-only master)", "gate-check": "npm run lint && npm run test-headless", - "customize": "gulp customize", - "customize-default": "gulp customize-default", - "customize-reset": "gulp customize-reset", "store-git-metadata": "gulp store-git-metadata", - "postinstall": "npm run customize && gulp dev-setup" + "postinstall": "gulp dev-setup && npm run build-tools", + "build-tools": "cd src/frontend/packages/tools && npm run build" }, "author": "", "license": "Apache-2.0", @@ -94,6 +92,7 @@ "node": "12.13.0" }, "devDependencies": { + "@angular-builders/custom-webpack": "^9.1.0", "@angular-devkit/build-angular": "~0.901.1", "@angular-devkit/build-ng-packagr": "~0.901.1", "@angular-devkit/schematics": "^9.1.1", @@ -109,6 +108,7 @@ "browserstack-local": "^1.4.5", "codecov": "^3.6.5", "codelyzer": "^5.1.2", + "copy-webpack-plugin": "5.1.1", "delete": "^1.1.0", "fs-extra": "^9.0.0", "globby": "^11.0.0", diff --git a/src/frontend/packages/cf-autoscaler/src/features/autoscaler-base.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/autoscaler-base.component.spec.ts index 83cb58eb35..4b139b4e4f 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/autoscaler-base.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/autoscaler-base.component.spec.ts @@ -8,7 +8,7 @@ import { CoreModule } from '../../../core/src/core/core.module'; import { SharedModule } from '../../../core/src/shared/shared.module'; import { TabNavService } from '../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { CfAutoscalerTestingModule } from '../cf-autoscaler-testing.module'; import { AutoscalerBaseComponent } from './autoscaler-base.component'; diff --git a/src/frontend/packages/cf-autoscaler/src/features/autoscaler-metric-page/autoscaler-metric-page.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/autoscaler-metric-page/autoscaler-metric-page.component.spec.ts index 0c897ce7f2..5bd6aab83a 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/autoscaler-metric-page/autoscaler-metric-page.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/autoscaler-metric-page/autoscaler-metric-page.component.spec.ts @@ -2,13 +2,13 @@ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationService } from '../../../../cloud-foundry/src/features/applications/application.service'; import { CoreModule } from '../../../../core/src/core/core.module'; import { SharedModule } from '../../../../core/src/shared/shared.module'; import { TabNavService } from '../../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { CfAutoscalerTestingModule } from '../../cf-autoscaler-testing.module'; import { AutoscalerMetricPageComponent } from './autoscaler-metric-page.component'; diff --git a/src/frontend/packages/cf-autoscaler/src/features/autoscaler-scale-history-page/autoscaler-scale-history-page.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/autoscaler-scale-history-page/autoscaler-scale-history-page.component.spec.ts index 55eead24ce..1d0ebf6953 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/autoscaler-scale-history-page/autoscaler-scale-history-page.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/autoscaler-scale-history-page/autoscaler-scale-history-page.component.spec.ts @@ -2,13 +2,13 @@ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationService } from '../../../../cloud-foundry/src/features/applications/application.service'; import { CoreModule } from '../../../../core/src/core/core.module'; import { SharedModule } from '../../../../core/src/shared/shared.module'; import { TabNavService } from '../../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { CfAutoscalerTestingModule } from '../../cf-autoscaler-testing.module'; import { AutoscalerScaleHistoryPageComponent } from './autoscaler-scale-history-page.component'; diff --git a/src/frontend/packages/cf-autoscaler/src/features/autoscaler-tab-extension/autoscaler-tab-extension.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/autoscaler-tab-extension/autoscaler-tab-extension.component.spec.ts index 6b77f493a5..6bd0ae4684 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/autoscaler-tab-extension/autoscaler-tab-extension.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/autoscaler-tab-extension/autoscaler-tab-extension.component.spec.ts @@ -2,6 +2,7 @@ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { NgxChartsModule } from '@swimlane/ngx-charts'; import { ApplicationService } from '../../../../cloud-foundry/src/features/applications/application.service'; @@ -18,7 +19,6 @@ import { CoreModule } from '../../../../core/src/core/core.module'; import { SharedModule } from '../../../../core/src/shared/shared.module'; import { TabNavService } from '../../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { CfAutoscalerTestingModule } from '../../cf-autoscaler-testing.module'; import { CardAutoscalerDefaultComponent } from '../../shared/card-autoscaler-default/card-autoscaler-default.component'; import { AutoscalerTabExtensionComponent } from './autoscaler-tab-extension.component'; diff --git a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-service.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-service.spec.ts index e927ff0fc9..dfa5ff7ec8 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-service.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-service.spec.ts @@ -1,8 +1,8 @@ import { inject, TestBed } from '@angular/core/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationsModule } from '../../../../cloud-foundry/src/features/applications/applications.module'; import { EntityServiceFactory } from '../../../../store/src/entity-service-factory.service'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { EditAutoscalerPolicyService } from './edit-autoscaler-policy-service'; describe('EditAutoscalerPolicyService', () => { diff --git a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step1/edit-autoscaler-policy-step1.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step1/edit-autoscaler-policy-step1.component.spec.ts index 978d5b751a..451208b92e 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step1/edit-autoscaler-policy-step1.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step1/edit-autoscaler-policy-step1.component.spec.ts @@ -2,13 +2,13 @@ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationService } from '../../../../../cloud-foundry/src/features/applications/application.service'; import { CoreModule } from '../../../../../core/src/core/core.module'; import { SharedModule } from '../../../../../core/src/shared/shared.module'; import { TabNavService } from '../../../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { CfAutoscalerTestingModule } from '../../../cf-autoscaler-testing.module'; import { EditAutoscalerPolicyService } from '../edit-autoscaler-policy-service'; import { EditAutoscalerPolicyStep1Component } from './edit-autoscaler-policy-step1.component'; diff --git a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step2/edit-autoscaler-policy-step2.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step2/edit-autoscaler-policy-step2.component.spec.ts index 039bf8b918..80d7fcba44 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step2/edit-autoscaler-policy-step2.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step2/edit-autoscaler-policy-step2.component.spec.ts @@ -2,13 +2,13 @@ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationService } from '../../../../../cloud-foundry/src/features/applications/application.service'; import { CoreModule } from '../../../../../core/src/core/core.module'; import { SharedModule } from '../../../../../core/src/shared/shared.module'; import { TabNavService } from '../../../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { EditAutoscalerPolicyService } from '../edit-autoscaler-policy-service'; import { EditAutoscalerPolicyStep2Component } from './edit-autoscaler-policy-step2.component'; diff --git a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step3/edit-autoscaler-policy-step3.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step3/edit-autoscaler-policy-step3.component.spec.ts index 5a8379443c..5b399b6b9c 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step3/edit-autoscaler-policy-step3.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step3/edit-autoscaler-policy-step3.component.spec.ts @@ -2,13 +2,13 @@ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationService } from '../../../../../cloud-foundry/src/features/applications/application.service'; import { CoreModule } from '../../../../../core/src/core/core.module'; import { SharedModule } from '../../../../../core/src/shared/shared.module'; import { TabNavService } from '../../../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { EditAutoscalerPolicyService } from '../edit-autoscaler-policy-service'; import { EditAutoscalerPolicyStep3Component } from './edit-autoscaler-policy-step3.component'; diff --git a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step4/edit-autoscaler-policy-step4.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step4/edit-autoscaler-policy-step4.component.spec.ts index 20d3a17bfe..b559a3f52f 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step4/edit-autoscaler-policy-step4.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step4/edit-autoscaler-policy-step4.component.spec.ts @@ -2,13 +2,13 @@ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationService } from '../../../../../cloud-foundry/src/features/applications/application.service'; import { CoreModule } from '../../../../../core/src/core/core.module'; import { SharedModule } from '../../../../../core/src/shared/shared.module'; import { TabNavService } from '../../../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { CfAutoscalerTestingModule } from '../../../cf-autoscaler-testing.module'; import { EditAutoscalerPolicyService } from '../edit-autoscaler-policy-service'; import { EditAutoscalerPolicyStep4Component } from './edit-autoscaler-policy-step4.component'; diff --git a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy.component.spec.ts index b10ff34509..76a8b81320 100644 --- a/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy.component.spec.ts @@ -2,13 +2,13 @@ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationService } from '../../../../cloud-foundry/src/features/applications/application.service'; import { CoreModule } from '../../../../core/src/core/core.module'; import { SharedModule } from '../../../../core/src/shared/shared.module'; import { TabNavService } from '../../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { CfAutoscalerTestingModule } from '../../cf-autoscaler-testing.module'; import { EditAutoscalerPolicyService } from './edit-autoscaler-policy-service'; import { EditAutoscalerPolicyStep1Component } from './edit-autoscaler-policy-step1/edit-autoscaler-policy-step1.component'; diff --git a/src/frontend/packages/cf-autoscaler/src/shared/card-autoscaler-default/card-autoscaler-default.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/shared/card-autoscaler-default/card-autoscaler-default.component.spec.ts index bd5c68c372..ec08b62486 100644 --- a/src/frontend/packages/cf-autoscaler/src/shared/card-autoscaler-default/card-autoscaler-default.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/shared/card-autoscaler-default/card-autoscaler-default.component.spec.ts @@ -1,6 +1,7 @@ import { CommonModule } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationService } from '../../../../cloud-foundry/src/features/applications/application.service'; import { @@ -8,14 +9,15 @@ import { } from '../../../../cloud-foundry/src/shared/components/running-instances/running-instances.component'; import { CoreModule } from '../../../../core/src/core/core.module'; import { ApplicationStateService } from '../../../../core/src/shared/components/application-state/application-state.service'; +import { + CopyToClipboardComponent, +} from '../../../../core/src/shared/components/copy-to-clipboard/copy-to-clipboard.component'; import { MetadataItemComponent } from '../../../../core/src/shared/components/metadata-item/metadata-item.component'; +import { ApplicationServiceMock } from '../../../../core/test-framework/application-service-helper'; import { EntityMonitorFactory } from '../../../../store/src/monitors/entity-monitor.factory.service'; import { PaginationMonitorFactory } from '../../../../store/src/monitors/pagination-monitor.factory'; -import { ApplicationServiceMock } from '../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { CfAutoscalerTestingModule } from '../../cf-autoscaler-testing.module'; import { CardAutoscalerDefaultComponent } from './card-autoscaler-default.component'; -import { CopyToClipboardComponent } from '../../../../core/src/shared/components/copy-to-clipboard/copy-to-clipboard.component'; describe('CardAutoscalerDefaultComponent', () => { let component: CardAutoscalerDefaultComponent; diff --git a/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-event/cf-app-autoscaler-events-config.service.spec.ts b/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-event/cf-app-autoscaler-events-config.service.spec.ts index 9865e668e1..479d22d761 100644 --- a/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-event/cf-app-autoscaler-events-config.service.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-event/cf-app-autoscaler-events-config.service.spec.ts @@ -3,17 +3,17 @@ import { HttpBackend, HttpClient, HttpClientModule } from '@angular/common/http' import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { GetApplication } from '../../../../../cloud-foundry/src/actions/application.actions'; import { cfEntityFactory } from '../../../../../cloud-foundry/src/cf-entity-factory'; import { applicationEntityType } from '../../../../../cloud-foundry/src/cf-entity-types'; import { ApplicationsModule } from '../../../../../cloud-foundry/src/features/applications/applications.module'; import { CoreModule } from '../../../../../core/src/core/core.module'; -import { EntityServiceFactory } from '../../../../../store/src/entity-service-factory.service'; import { SharedModule } from '../../../../../core/src/shared/shared.module'; import { generateTestApplicationServiceProvider } from '../../../../../core/test-framework/application-service-helper'; import { generateTestEntityServiceProvider } from '../../../../../core/test-framework/entity-service.helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; +import { EntityServiceFactory } from '../../../../../store/src/entity-service-factory.service'; import { CfAutoscalerTestingModule } from '../../../cf-autoscaler-testing.module'; import { CfAppAutoscalerEventsConfigService } from './cf-app-autoscaler-events-config.service'; diff --git a/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-card/app-autoscaler-metric-chart-card.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-card/app-autoscaler-metric-chart-card.component.spec.ts index 1e1f333790..89dbb637d5 100644 --- a/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-card/app-autoscaler-metric-chart-card.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-card/app-autoscaler-metric-chart-card.component.spec.ts @@ -1,6 +1,6 @@ -/* tslint:disable:max-line-length */ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { NgxChartsModule } from '@swimlane/ngx-charts'; import { @@ -14,15 +14,15 @@ import { ApplicationStateService, } from '../../../../../../core/src/shared/components/application-state/application-state.service'; import { ConfirmationDialogService } from '../../../../../../core/src/shared/components/confirmation-dialog.service'; +import { generateTestApplicationServiceProvider } from '../../../../../../core/test-framework/application-service-helper'; import { EntityMonitorFactory } from '../../../../../../store/src/monitors/entity-monitor.factory.service'; import { PaginationMonitorFactory } from '../../../../../../store/src/monitors/pagination-monitor.factory'; -import { generateTestApplicationServiceProvider } from '../../../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { CfAutoscalerTestingModule } from '../../../../cf-autoscaler-testing.module'; import { AppAutoscalerMetricChartCardComponent } from './app-autoscaler-metric-chart-card.component'; import { AppAutoscalerComboChartComponent } from './combo-chart/combo-chart.component'; import { AppAutoscalerComboSeriesVerticalComponent } from './combo-chart/combo-series-vertical.component'; +/* tslint:disable:max-line-length */ /* tslint:enable:max-line-length */ describe('AppAutoscalerMetricChartCardComponent', () => { diff --git a/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-card/combo-chart/combo-series-vertical.component.spec.ts b/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-card/combo-chart/combo-series-vertical.component.spec.ts index 31df0d2711..883cffa7e2 100644 --- a/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-card/combo-chart/combo-series-vertical.component.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-card/combo-chart/combo-series-vertical.component.spec.ts @@ -2,6 +2,7 @@ import { DatePipe } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { NgxChartsModule } from '@swimlane/ngx-charts'; import { ApplicationService } from '../../../../../../../cloud-foundry/src/features/applications/application.service'; @@ -9,7 +10,6 @@ import { CoreModule } from '../../../../../../../core/src/core/core.module'; import { SharedModule } from '../../../../../../../core/src/shared/shared.module'; import { TabNavService } from '../../../../../../../core/tab-nav.service'; import { ApplicationServiceMock } from '../../../../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; import { AppAutoscalerComboSeriesVerticalComponent } from './combo-series-vertical.component'; describe('AppAutoscalerComboSeriesVerticalComponent', () => { diff --git a/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-list-config.service.spec.ts b/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-list-config.service.spec.ts index b105b4b8a9..5e9e3d7d5d 100644 --- a/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-list-config.service.spec.ts +++ b/src/frontend/packages/cf-autoscaler/src/shared/list-types/app-autoscaler-metric-chart/app-autoscaler-metric-chart-list-config.service.spec.ts @@ -1,22 +1,22 @@ -/* tslint:disable:max-line-length */ import { DatePipe } from '@angular/common'; import { inject, TestBed } from '@angular/core/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { ApplicationEnvVarsHelper, } from '../../../../../cloud-foundry/src/features/applications/application/application-tabs-base/tabs/build-tab/application-env-vars.service'; -import { EntityServiceFactory } from '../../../../../store/src/entity-service-factory.service'; import { ApplicationStateService, } from '../../../../../core/src/shared/components/application-state/application-state.service'; -import { EntityMonitorFactory } from '../../../../../store/src/monitors/entity-monitor.factory.service'; -import { PaginationMonitorFactory } from '../../../../../store/src/monitors/pagination-monitor.factory'; import { MetricsRangeSelectorService } from '../../../../../core/src/shared/services/metrics-range-selector.service'; import { generateTestApplicationServiceProvider } from '../../../../../core/test-framework/application-service-helper'; -import { createEmptyStoreModule } from '@stratos/store/testing'; +import { EntityServiceFactory } from '../../../../../store/src/entity-service-factory.service'; +import { EntityMonitorFactory } from '../../../../../store/src/monitors/entity-monitor.factory.service'; +import { PaginationMonitorFactory } from '../../../../../store/src/monitors/pagination-monitor.factory'; import { CfAutoscalerTestingModule } from '../../../cf-autoscaler-testing.module'; import { AppAutoscalerMetricChartListConfigService } from './app-autoscaler-metric-chart-list-config.service'; +/* tslint:disable:max-line-length */ /* tslint:enable:max-line-length */ diff --git a/src/frontend/packages/cloud-foundry/src/entity-relations/entity-relations-from-parent.spec.ts b/src/frontend/packages/cloud-foundry/src/entity-relations/entity-relations-from-parent.spec.ts index 7ddbb0378b..6f040596f4 100644 --- a/src/frontend/packages/cloud-foundry/src/entity-relations/entity-relations-from-parent.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/entity-relations/entity-relations-from-parent.spec.ts @@ -13,7 +13,7 @@ import { createBasicStoreModule, createEntityStoreState, TestStoreEntity, -} from '@stratos/store/testing'; +} from '@stratosui/store/testing'; import { RequestTypes } from '../../../store/src/actions/request.actions'; import { AppState } from '../../../store/src/app-state'; import { EntityRelationSpecHelper } from '../../../store/src/helpers/entity-relations/entity-relations-spec-helper'; diff --git a/src/frontend/packages/cloud-foundry/src/entity-relations/entity-relations-validate.spec.ts b/src/frontend/packages/cloud-foundry/src/entity-relations/entity-relations-validate.spec.ts index dee44881df..10267f8102 100644 --- a/src/frontend/packages/cloud-foundry/src/entity-relations/entity-relations-validate.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/entity-relations/entity-relations-validate.spec.ts @@ -12,7 +12,7 @@ import { createBasicStoreModule, createEntityStoreState, TestStoreEntity, -} from '@stratos/store/testing'; +} from '@stratosui/store/testing'; import { SetInitialParams } from '../../../store/src/actions/pagination.actions'; import { APIResponse } from '../../../store/src/actions/request.actions'; import { InternalAppState, IRequestTypeState } from '../../../store/src/app-state'; diff --git a/src/frontend/packages/cloud-foundry/src/features/applications/application/application-tabs-base/tabs/instances-tab/instances-tab.component.spec.ts b/src/frontend/packages/cloud-foundry/src/features/applications/application/application-tabs-base/tabs/instances-tab/instances-tab.component.spec.ts index ac8cd5ea4a..8269ae4ea7 100644 --- a/src/frontend/packages/cloud-foundry/src/features/applications/application/application-tabs-base/tabs/instances-tab/instances-tab.component.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/features/applications/application/application-tabs-base/tabs/instances-tab/instances-tab.component.spec.ts @@ -1,6 +1,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { testSCFEndpointGuid } from '@stratosui/store/testing'; import { CoreModule } from '../../../../../../../../core/src/core/core.module'; import { @@ -9,7 +10,6 @@ import { import { CF_GUID } from '../../../../../../../../core/src/shared/entity.tokens'; import { SharedModule } from '../../../../../../../../core/src/shared/shared.module'; import { ApplicationServiceMock } from '../../../../../../../../core/test-framework/application-service-helper'; -import { testSCFEndpointGuid } from '@stratos/store/testing'; import { AppStoreModule } from '../../../../../../../../store/src/store.module'; import { generateCfStoreModules, diff --git a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/cloud-foundry-tabs-base/cloud-foundry-tabs-base.component.spec.ts b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/cloud-foundry-tabs-base/cloud-foundry-tabs-base.component.spec.ts index 7cec150ad2..726f61014c 100644 --- a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/cloud-foundry-tabs-base/cloud-foundry-tabs-base.component.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/cloud-foundry-tabs-base/cloud-foundry-tabs-base.component.spec.ts @@ -1,7 +1,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { populateStoreWithTestEndpoint, testSCFEndpointGuid } from '@stratosui/store/testing'; import { TabNavService } from '../../../../../core/tab-nav.service'; -import { populateStoreWithTestEndpoint, testSCFEndpointGuid } from '@stratos/store/testing'; import { generateCfBaseTestModules, generateTestCfEndpointServiceProvider, diff --git a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/cloud-foundry/cloud-foundry.component.spec.ts b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/cloud-foundry/cloud-foundry.component.spec.ts index 76f124d947..4b8d81f2a0 100644 --- a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/cloud-foundry/cloud-foundry.component.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/cloud-foundry/cloud-foundry.component.spec.ts @@ -1,12 +1,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { populateStoreWithTestEndpoint } from '@stratosui/store/testing'; -import { PaginationMonitorFactory } from '../../../../../store/src/monitors/pagination-monitor.factory'; import { TabNavService } from '../../../../../core/tab-nav.service'; +import { PaginationMonitorFactory } from '../../../../../store/src/monitors/pagination-monitor.factory'; import { generateCfBaseTestModules, generateTestCfServiceProvider, } from '../../../../test-framework/cloud-foundry-endpoint-service.helper'; -import { populateStoreWithTestEndpoint } from '@stratos/store/testing'; import { CfEndpointsMissingComponent } from '../../../shared/components/cf-endpoints-missing/cf-endpoints-missing.component'; import { CloudFoundryComponent } from './cloud-foundry.component'; diff --git a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/quota-definition/quota-definition.component.spec.ts b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/quota-definition/quota-definition.component.spec.ts index fb330862e3..4fb96c3435 100644 --- a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/quota-definition/quota-definition.component.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/quota-definition/quota-definition.component.spec.ts @@ -1,8 +1,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; +import { populateStoreWithTestEndpoint, testSCFEndpointGuid } from '@stratosui/store/testing'; import { TabNavService } from '../../../../../core/tab-nav.service'; -import { populateStoreWithTestEndpoint, testSCFEndpointGuid } from '@stratos/store/testing'; import { generateCfBaseTestModules, generateTestCfEndpointServiceProvider, diff --git a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.spec.ts b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.spec.ts index 12c5447846..d1716985ab 100644 --- a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.spec.ts @@ -1,12 +1,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; +import { testSCFEndpoint, testSCFEndpointGuid } from '@stratosui/store/testing'; import { endpointEntitySchema } from '../../../../../core/src/base-entity-schemas'; +import { TabNavService } from '../../../../../core/tab-nav.service'; import { EntityCatalogHelpers } from '../../../../../store/src/entity-catalog/entity-catalog.helper'; import { EntityCatalogEntityConfig } from '../../../../../store/src/entity-catalog/entity-catalog.types'; -import { TabNavService } from '../../../../../core/tab-nav.service'; -import { testSCFEndpoint, testSCFEndpointGuid } from '@stratos/store/testing'; import { EntityRelationSpecHelper } from '../../../../../store/src/helpers/entity-relations/entity-relations-spec-helper'; import { NormalizedResponse } from '../../../../../store/src/types/api.types'; import { WrapperRequestActionSuccess } from '../../../../../store/src/types/request.types'; diff --git a/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/app-instance/cf-app-instances-config.service.spec.ts b/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/app-instance/cf-app-instances-config.service.spec.ts index 55ce1e5919..8773868369 100644 --- a/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/app-instance/cf-app-instances-config.service.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/app-instance/cf-app-instances-config.service.spec.ts @@ -1,13 +1,13 @@ import { CommonModule } from '@angular/common'; import { inject, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { testSCFEndpointGuid } from '@stratosui/store/testing'; import { CoreModule } from '../../../../../../../core/src/core/core.module'; import { CF_GUID } from '../../../../../../../core/src/shared/entity.tokens'; import { SharedModule } from '../../../../../../../core/src/shared/shared.module'; import { generateTestApplicationServiceProvider } from '../../../../../../../core/test-framework/application-service-helper'; import { generateTestEntityServiceProvider } from '../../../../../../../core/test-framework/entity-service.helper'; -import { testSCFEndpointGuid } from '@stratos/store/testing'; import { generateCfStoreModules, generateTestCfEndpointServiceProvider, diff --git a/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/cf-orgs/cf-org-card/cf-org-card.component.spec.ts b/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/cf-orgs/cf-org-card/cf-org-card.component.spec.ts index a13fb94379..62c65327fb 100644 --- a/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/cf-orgs/cf-org-card/cf-org-card.component.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/cf-orgs/cf-org-card/cf-org-card.component.spec.ts @@ -1,13 +1,13 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { Store } from '@ngrx/store'; +import { testSessionData } from '@stratosui/store/testing'; -import { EntityServiceFactory } from '../../../../../../../../store/src/entity-service-factory.service'; import { ConfirmationDialogService } from '../../../../../../../../core/src/shared/components/confirmation-dialog.service'; -import { EntityMonitorFactory } from '../../../../../../../../store/src/monitors/entity-monitor.factory.service'; -import { PaginationMonitorFactory } from '../../../../../../../../store/src/monitors/pagination-monitor.factory'; import { MetadataCardTestComponents } from '../../../../../../../../core/test-framework/core-test.helper'; -import { testSessionData } from '@stratos/store/testing'; import { VerifiedSession } from '../../../../../../../../store/src/actions/auth.actions'; +import { EntityServiceFactory } from '../../../../../../../../store/src/entity-service-factory.service'; +import { EntityMonitorFactory } from '../../../../../../../../store/src/monitors/entity-monitor.factory.service'; +import { PaginationMonitorFactory } from '../../../../../../../../store/src/monitors/pagination-monitor.factory'; import { generateCfBaseTestModulesNoShared, generateTestCfEndpointServiceProvider, diff --git a/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/cf-spaces/cf-space-card/cf-space-card.component.spec.ts b/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/cf-spaces/cf-space-card/cf-space-card.component.spec.ts index 8ed58476df..fe0a214d25 100644 --- a/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/cf-spaces/cf-space-card/cf-space-card.component.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/cf-spaces/cf-space-card/cf-space-card.component.spec.ts @@ -1,16 +1,16 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { Store } from '@ngrx/store'; +import { testSessionData } from '@stratosui/store/testing'; -import { EntityServiceFactory } from '../../../../../../../../store/src/entity-service-factory.service'; import { ConfirmationDialogService } from '../../../../../../../../core/src/shared/components/confirmation-dialog.service'; -import { EntityMonitorFactory } from '../../../../../../../../store/src/monitors/entity-monitor.factory.service'; -import { PaginationMonitorFactory } from '../../../../../../../../store/src/monitors/pagination-monitor.factory'; import { CloudFoundryUserProvidedServicesService, } from '../../../../../../../../core/src/shared/services/cloud-foundry-user-provided-services.service'; import { MetadataCardTestComponents } from '../../../../../../../../core/test-framework/core-test.helper'; -import { testSessionData } from '@stratos/store/testing'; import { VerifiedSession } from '../../../../../../../../store/src/actions/auth.actions'; +import { EntityServiceFactory } from '../../../../../../../../store/src/entity-service-factory.service'; +import { EntityMonitorFactory } from '../../../../../../../../store/src/monitors/entity-monitor.factory.service'; +import { PaginationMonitorFactory } from '../../../../../../../../store/src/monitors/pagination-monitor.factory'; import { generateCfBaseTestModulesNoShared, generateTestCfEndpointServiceProvider, diff --git a/src/frontend/packages/cloud-foundry/test-framework/cloud-foundry-endpoint-service.helper.ts b/src/frontend/packages/cloud-foundry/test-framework/cloud-foundry-endpoint-service.helper.ts index 7a72e4072a..a530eebe6b 100644 --- a/src/frontend/packages/cloud-foundry/test-framework/cloud-foundry-endpoint-service.helper.ts +++ b/src/frontend/packages/cloud-foundry/test-framework/cloud-foundry-endpoint-service.helper.ts @@ -3,7 +3,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { Store, StoreModule } from '@ngrx/store'; -import { testSCFEndpointGuid } from '@stratos/store/testing'; +import { testSCFEndpointGuid } from '@stratosui/store/testing'; import { CoreModule } from '../../core/src/core/core.module'; import { SharedModule } from '../../core/src/shared/shared.module'; diff --git a/src/frontend/packages/core/favicon.ico b/src/frontend/packages/core/favicon.ico new file mode 120000 index 0000000000..8b9c25e05e --- /dev/null +++ b/src/frontend/packages/core/favicon.ico @@ -0,0 +1 @@ +/Users/nwm/dev/pr-angular9/src/frontend/packages/core/misc/custom/favicon.ico \ No newline at end of file diff --git a/src/frontend/packages/core/misc/custom/custom-src-routing.module.ts_ b/src/frontend/packages/core/misc/custom/custom-src-routing.module.ts_ deleted file mode 100644 index a1f9fa4457..0000000000 --- a/src/frontend/packages/core/misc/custom/custom-src-routing.module.ts_ +++ /dev/null @@ -1,21 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CustomModule } from './custom/custom.module'; -import { CustomRoutingModule } from './custom/custom-routing.module'; - -// Default import customization module - DO NOT EDIT - -// This file is in the .gitignore - changes will not be flagged - -@NgModule({ - imports: [ - CustomModule, - ] -}) -export class CustomImportModule { } - -@NgModule({ - imports: [ - CustomRoutingModule, - ] -}) -export class CustomRoutingImportModule { } diff --git a/src/frontend/packages/core/misc/custom/custom-src.module.ts_ b/src/frontend/packages/core/misc/custom/custom-src.module.ts_ deleted file mode 100644 index 3e536cc582..0000000000 --- a/src/frontend/packages/core/misc/custom/custom-src.module.ts_ +++ /dev/null @@ -1,16 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CustomModule } from './custom/custom.module'; - -// Default import customization module - DO NOT EDIT - -// This file is in the .gitignore - changes will not be flagged - -@NgModule({ - imports: [ - CustomModule, - ] -}) -export class CustomImportModule { } - -@NgModule() -export class CustomRoutingImportModule { } diff --git a/src/frontend/packages/core/misc/custom/custom.scss b/src/frontend/packages/core/misc/custom/custom.scss deleted file mode 100644 index f6d83b743c..0000000000 --- a/src/frontend/packages/core/misc/custom/custom.scss +++ /dev/null @@ -1,5 +0,0 @@ -// Empty customization file - DO NOT EDIT - -// This file is in the .gitignore - changes will not be flagged - -// The customization build step will replace this file with the custom one if provided diff --git a/src/frontend/packages/core/misc/custom/custom.yaml b/src/frontend/packages/core/misc/custom/custom.yaml deleted file mode 100644 index db58c36ad7..0000000000 --- a/src/frontend/packages/core/misc/custom/custom.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# Customization manifest - -files: - custom.scss: "sass/custom.scss" - favicon.ico: "favicon.ico" - login-bg.jpg: "assets/login-bg.jpg" - logo.png: "assets/logo.png" - nav-logo.png: "assets/nav-logo.png" - eula.html: "assets/eula.html" - -folders: - - "app/custom:src/custom" - - "assets/custom" - - "sass/custom" diff --git a/src/frontend/packages/core/misc/custom/eula.html b/src/frontend/packages/core/misc/custom/eula.html deleted file mode 100644 index dfd92e3d98..0000000000 --- a/src/frontend/packages/core/misc/custom/eula.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/frontend/packages/core/sass/_all-theme.scss b/src/frontend/packages/core/sass/_all-theme.scss index 3daaa41180..1b6d41c664 100644 --- a/src/frontend/packages/core/sass/_all-theme.scss +++ b/src/frontend/packages/core/sass/_all-theme.scss @@ -48,7 +48,6 @@ @import '../src/shared/components/user-avatar/user-avatar.component.theme'; @import './components/text-status.theme'; @import './components/hyperlinks.theme'; -@import './mat-themes'; @import './mat-desktop'; @import './fonts'; @import './ansi-colors'; @@ -67,41 +66,19 @@ @import '../../cloud-foundry/src/features/applications/application-wall/application-wall.component.theme'; @import '../../core/src/features/error-page/error-page/error-page.component.theme.scss'; -// Defaults -$side-nav-light-text: #fff; -$side-nav-light-bg: #333; -$side-nav-light-hover: #555; -$side-nav-light-active: #484848; - // Creates the app theme and applies it to the application // $theme = Angular Material Theme // $nav-theme - Colors for the Side Nav (optional) // $status-theme - Colors for status (optional) -@mixin app-theme($theme, $nav-theme: null, $status-theme: null) { - $background-colors: map-get($theme, background); - $foreground-colors: map-get($theme, foreground); - $is-dark: map-get($theme, is-dark); - $app-background-color: white; - $app-background-text-color: rgba(mat-color($foreground-colors, base), .65); - $primary: map-get($theme, primary); - $accent: map-get($theme, accent); - $warn: map-get($theme, warn); - $subdued: mat-contrast($primary, 50); - - @if $is-dark == true { - $app-background-color: lighten(mat-color($background-colors, background), 10%); - $subdued: lighten($subdued, 90); - } @else { - $app-background-color: darken(mat-color($background-colors, background), 2%); - $subdued: lighten($subdued, 50); - } +@mixin app-theme($stratos-theme, $nav-theme: null, $status-theme: null) { + $theme: map-get($stratos-theme, theme); + $app-theme: map-get($stratos-theme, app-theme); + $app-background-color: map-get($app-theme, app-background-color); html { background-color: $app-background-color; } - // App Theme defines a set of colors used by stratos components - $app-theme: (app-background-color: $app-background-color, app-background-text-color: rgba(mat-color($foreground-colors, base), .65), side-nav: app-generate-nav-theme($theme, $nav-theme), status: app-generate-status-theme($theme, $status-theme), subdued-color: $subdued, ansi-colors: $ansi-color-palette); // Pass the Material theme and the App Theme to components that need to be themed @include dialog-error-theme($theme, $app-theme); @include login-page-theme($theme, $app-theme); @include side-nav-theme($theme, $app-theme); @@ -160,23 +137,3 @@ $side-nav-light-active: #484848; @include copy-to-clipboard-theme($theme, $app-theme); @include app-user-avatar-theme($theme, $app-theme); } - -@function app-generate-nav-theme($theme, $nav-theme: null) { - @if ($nav-theme) { - @return $nav-theme; - } @else { - // Use default palette for side navigation - @return (background: $side-nav-light-bg, background-top: $side-nav-light-bg, text: darken($side-nav-light-text, 10%), active: $side-nav-light-active, active-text: $side-nav-light-text, hover: $side-nav-light-hover, hover-text: $side-nav-light-text); - } -} - -@function app-generate-status-theme($theme, $status-theme: null) { - @if ($status-theme) { - @return $status-theme; - } @else { - $warn: map-get($theme, warn); - $primary: map-get($theme, primary); - $white: #fff; // Use default palette for status - @return (success: map-get($mat-green, 500), warning: map-get($mat-orange, 500), danger: mat-color($warn), tentative: map-get($mat-grey, 500), busy: mat-color($primary), text: $white, ); - } -} diff --git a/src/frontend/packages/core/sass/colors.scss b/src/frontend/packages/core/sass/colors.scss deleted file mode 100644 index 75071fe6ba..0000000000 --- a/src/frontend/packages/core/sass/colors.scss +++ /dev/null @@ -1,7 +0,0 @@ -// @import './suse-theme'; -$dark-grey: rgb(95, 95, 95); -$middle-grey: rgb(167, 169, 172); -$light-grey: rgb(220, 221, 222); -// $blue: map-get($suse-blue, 500); - -// See here for palette info: https://github.com/angular/material2/blob/master/src/lib/core/theming/_palette.scss diff --git a/src/frontend/packages/core/sass/custom.scss b/src/frontend/packages/core/sass/custom.scss new file mode 120000 index 0000000000..e29b1e84b3 --- /dev/null +++ b/src/frontend/packages/core/sass/custom.scss @@ -0,0 +1 @@ +/Users/nwm/dev/pr-angular9/src/frontend/packages/core/misc/custom/custom.scss \ No newline at end of file diff --git a/src/frontend/packages/core/sass/theme.scss b/src/frontend/packages/core/sass/theme.scss index 365cd4750e..69de004032 100644 --- a/src/frontend/packages/core/sass/theme.scss +++ b/src/frontend/packages/core/sass/theme.scss @@ -1,45 +1,38 @@ @import '~@angular/material/theming'; -@import './mat-themes'; @import './all-theme'; -@import './mat-colors'; -// Custom theme support -@import './custom'; +// Import the theme +@import '~@stratosui/theme'; -body.stratos { - .dark-theme { - // Dark Theme defaults - $dark-primary: mat-palette($mat-blue); - $dark-accent: mat-palette($mat-amber, A400, A100, A700); - $dark-warn: mat-palette($mat-red); - $dark-theme: mat-dark-theme($dark-primary, $dark-accent, $dark-warn); +$stratos-dark-theme-supported: false !default; - $stratos-dark-theme: $dark-theme !default; - $stratos-dark-nav-theme: null !default; - $stratos-dark-status-theme: null !default; +// Themes - stratos-theme() function must be supplied by the theme +$stratos-themes: stratos-theme(); - @include angular-material-theme($stratos-dark-theme); - @include app-theme($stratos-dark-theme, $stratos-dark-nav-theme, $stratos-dark-status-theme); +// Import any custom scss that the theme defines +@import '~@stratosui/theme/extensions'; + +// Default theme ( = light theme) +$stratos-theme: map-get($stratos-themes, default); +$theme: map-get($stratos-theme, theme); + +@if map-has-key($stratos-themes, 'dark') { + $stratos-dark-theme-supported: true; + $dark-stratos-theme: map-get($stratos-themes, dark); + $dark-theme: map-get($dark-stratos-theme, theme); + + body.stratos { + .dark-theme { + @include angular-material-theme($dark-theme); + @include app-theme($stratos-dark-theme); + } } } .default { - // Themes palettes and colors - $oss-theme-primary: mat-palette($mat-blue); - $oss-theme-accent: mat-palette($mat-blue); - $oss-theme-warn: mat-palette($mat-red); - $oss-theme: mat-light-theme($oss-theme-primary, $oss-theme-accent, $oss-theme-warn); - - // Default to using the open source theme - $stratos-theme: $oss-theme !default; - $stratos-nav-theme: null !default; - $stratos-status-theme: null !default; - - @include angular-material-theme($stratos-theme); - @include app-theme($stratos-theme, $stratos-nav-theme, $stratos-status-theme); + @include angular-material-theme($theme); + @include app-theme($stratos-theme); } -$stratos-dark-theme-supported: true !default; - -// Create the theme +// Import mat-core @include mat-core; diff --git a/src/frontend/packages/core/src/app.component.spec.ts b/src/frontend/packages/core/src/app.component.spec.ts index ef7f9b6321..7751596966 100644 --- a/src/frontend/packages/core/src/app.component.spec.ts +++ b/src/frontend/packages/core/src/app.component.spec.ts @@ -2,7 +2,7 @@ import { async, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { CoreTestingModule } from '../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { AppComponent } from './app.component'; import { LoggedInService } from './logged-in.service'; import { SharedModule } from './shared/shared.module'; diff --git a/src/frontend/packages/core/src/core/current-user-permissions.service.spec.ts b/src/frontend/packages/core/src/core/current-user-permissions.service.spec.ts index a9b23771ca..134fee8e62 100644 --- a/src/frontend/packages/core/src/core/current-user-permissions.service.spec.ts +++ b/src/frontend/packages/core/src/core/current-user-permissions.service.spec.ts @@ -1,5 +1,5 @@ import { TestBed } from '@angular/core/testing'; -import { createBasicStoreModule, createEntityStoreState, TestStoreEntity } from '@stratos/store/testing'; +import { createBasicStoreModule, createEntityStoreState, TestStoreEntity } from '@stratosui/store/testing'; import { first, tap } from 'rxjs/operators'; import { cfEntityFactory } from '../../../cloud-foundry/src/cf-entity-factory'; diff --git a/src/frontend/packages/core/src/core/endpoints.service.spec.ts b/src/frontend/packages/core/src/core/endpoints.service.spec.ts index 89025b6c3e..3ac576abcd 100644 --- a/src/frontend/packages/core/src/core/endpoints.service.spec.ts +++ b/src/frontend/packages/core/src/core/endpoints.service.spec.ts @@ -1,8 +1,8 @@ import { inject, TestBed } from '@angular/core/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; -import { CoreTestingModule } from '../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { PaginationMonitorFactory } from '../../../store/src/monitors/pagination-monitor.factory'; +import { CoreTestingModule } from '../../test-framework/core-test.modules'; import { CoreModule } from './core.module'; import { EndpointsService } from './endpoints.service'; import { UtilsService } from './utils.service'; diff --git a/src/frontend/packages/core/src/core/log-out-dialog/log-out-dialog.component.spec.ts b/src/frontend/packages/core/src/core/log-out-dialog/log-out-dialog.component.spec.ts index caa7036c91..b497e9540e 100644 --- a/src/frontend/packages/core/src/core/log-out-dialog/log-out-dialog.component.spec.ts +++ b/src/frontend/packages/core/src/core/log-out-dialog/log-out-dialog.component.spec.ts @@ -1,10 +1,10 @@ -import { async, ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing'; +import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Store } from '@ngrx/store'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { CoreTestingModule } from '../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { SharedModule } from '../../shared/shared.module'; import { CoreModule } from '../core.module'; import { LogOutDialogComponent } from './log-out-dialog.component'; diff --git a/src/frontend/packages/core/src/core/logger.service.spec.ts b/src/frontend/packages/core/src/core/logger.service.spec.ts index 86c39de468..1720fe0b84 100644 --- a/src/frontend/packages/core/src/core/logger.service.spec.ts +++ b/src/frontend/packages/core/src/core/logger.service.spec.ts @@ -1,7 +1,7 @@ import { inject, TestBed } from '@angular/core/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { CoreTestingModule } from '../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { LoggerService } from './logger.service'; describe('LoggerService', () => { diff --git a/src/frontend/packages/core/src/core/user.service.spec.ts b/src/frontend/packages/core/src/core/user.service.spec.ts index 33ba397021..f831c61b18 100644 --- a/src/frontend/packages/core/src/core/user.service.spec.ts +++ b/src/frontend/packages/core/src/core/user.service.spec.ts @@ -1,7 +1,7 @@ import { inject, TestBed } from '@angular/core/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { CoreTestingModule } from '../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { SharedModule } from '../shared/shared.module'; import { CoreModule } from './core.module'; import { UserService } from './user.service'; diff --git a/src/frontend/packages/core/misc/custom/custom.module.ts_ b/src/frontend/packages/core/src/custom-import.module.ts similarity index 57% rename from src/frontend/packages/core/misc/custom/custom.module.ts_ rename to src/frontend/packages/core/src/custom-import.module.ts index b4118c293d..3d84d8fdec 100644 --- a/src/frontend/packages/core/misc/custom/custom.module.ts_ +++ b/src/frontend/packages/core/src/custom-import.module.ts @@ -2,7 +2,8 @@ import { NgModule } from '@angular/core'; // Default empty customization module - DO NOT EDIT -// This file is in the .gitignore - changes will not be flagged +// These modules will be intercepted by the custom webpack configuration +// They are only here so that on a fresh checkout, both modules are defined @NgModule() export class CustomImportModule { } diff --git a/src/frontend/packages/core/src/features/about/about-page/about-page.component.spec.ts b/src/frontend/packages/core/src/features/about/about-page/about-page.component.spec.ts index f2f29ab301..3aea3c6790 100644 --- a/src/frontend/packages/core/src/features/about/about-page/about-page.component.spec.ts +++ b/src/frontend/packages/core/src/features/about/about-page/about-page.component.spec.ts @@ -1,9 +1,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; import { AboutPageComponent } from './about-page.component'; diff --git a/src/frontend/packages/core/src/features/about/about.module.ts b/src/frontend/packages/core/src/features/about/about.module.ts index c71cd11f55..9fe18f06af 100644 --- a/src/frontend/packages/core/src/features/about/about.module.ts +++ b/src/frontend/packages/core/src/features/about/about.module.ts @@ -5,8 +5,7 @@ import { SharedModule } from '../../shared/shared.module'; import { AboutPageComponent } from './about-page/about-page.component'; import { AboutRoutingModule } from './about.routing'; import { DiagnosticsPageComponent } from './diagnostics-page/diagnostics-page.component'; -import { EulaPageComponent, EulaPageContentComponent } from './eula-page/eula-page.component'; - +import { EulaPageComponent } from './eula-page/eula-page.component'; @NgModule({ @@ -17,7 +16,6 @@ import { EulaPageComponent, EulaPageContentComponent } from './eula-page/eula-pa ], declarations: [ AboutPageComponent, - EulaPageContentComponent, EulaPageComponent, DiagnosticsPageComponent ] diff --git a/src/frontend/packages/core/src/features/about/diagnostics-page/diagnostics-page.component.spec.ts b/src/frontend/packages/core/src/features/about/diagnostics-page/diagnostics-page.component.spec.ts index 8ab9411e15..c65bac7fc7 100644 --- a/src/frontend/packages/core/src/features/about/diagnostics-page/diagnostics-page.component.spec.ts +++ b/src/frontend/packages/core/src/features/about/diagnostics-page/diagnostics-page.component.spec.ts @@ -1,9 +1,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; import { DiagnosticsPageComponent } from './diagnostics-page.component'; diff --git a/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.html b/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.html index 27791db6f3..3a40946d0b 100644 --- a/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.html +++ b/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.html @@ -8,4 +8,4 @@

EULA

- \ No newline at end of file +
diff --git a/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.spec.ts b/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.spec.ts index 36c9370e92..113aac37d3 100644 --- a/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.spec.ts +++ b/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.spec.ts @@ -1,11 +1,13 @@ +import { HttpClientModule } from '@angular/common/http'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; -import { EulaPageComponent, EulaPageContentComponent } from './eula-page.component'; +import { EulaPageComponent } from './eula-page.component'; describe('EulaPageComponent', () => { let component: EulaPageComponent; @@ -13,11 +15,13 @@ describe('EulaPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [EulaPageComponent, EulaPageContentComponent], + declarations: [EulaPageComponent], imports: [ CoreModule, RouterTestingModule, SharedModule, + HttpClientModule, + HttpClientTestingModule, createBasicStoreModule(), ], providers: [TabNavService] diff --git a/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.ts b/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.ts index 8271e24c66..a93e345bf3 100644 --- a/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.ts +++ b/src/frontend/packages/core/src/features/about/eula-page/eula-page.component.ts @@ -1,17 +1,12 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-eula-content', - templateUrl: '../../../../assets/eula.html' -}) -export class EulaPageContentComponent { } +import { Component } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; @Component({ selector: 'app-eula-page', templateUrl: './eula-page.component.html', styleUrls: ['./eula-page.component.scss'] }) -export class EulaPageComponent implements OnInit { +export class EulaPageComponent { public breadcrumbs = [ { @@ -19,10 +14,14 @@ export class EulaPageComponent implements OnInit { } ]; - constructor() { } - - ngOnInit() { + public eulaHtml = ''; + // Load the EULA + constructor(http: HttpClient) { + http.get('/core/assets/eula.html', {responseType: 'text'}).subscribe( + html => this.eulaHtml = html, + () => this.eulaHtml = 'An error occurred retrieving the EULA' + ); } } diff --git a/src/frontend/packages/core/src/features/dashboard/dashboard-base/dashboard-base.component.scss b/src/frontend/packages/core/src/features/dashboard/dashboard-base/dashboard-base.component.scss index d212cac3c2..26a2d129ce 100644 --- a/src/frontend/packages/core/src/features/dashboard/dashboard-base/dashboard-base.component.scss +++ b/src/frontend/packages/core/src/features/dashboard/dashboard-base/dashboard-base.component.scss @@ -1,4 +1,3 @@ -@import '../../../../sass/colors'; @import '../../../../sass/mixins'; $app-sub-header-height: 48px; diff --git a/src/frontend/packages/core/src/features/dashboard/side-nav/side-nav.component.spec.ts b/src/frontend/packages/core/src/features/dashboard/side-nav/side-nav.component.spec.ts index 3099287848..99b1bc3fc1 100644 --- a/src/frontend/packages/core/src/features/dashboard/side-nav/side-nav.component.spec.ts +++ b/src/frontend/packages/core/src/features/dashboard/side-nav/side-nav.component.spec.ts @@ -1,8 +1,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CustomizationService } from '../../../core/customizations.types'; import { MDAppModule } from '../../../core/md.module'; import { SideNavComponent } from './side-nav.component'; diff --git a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component.spec.ts b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component.spec.ts index 5f93a9992b..c1e1915694 100644 --- a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component.spec.ts +++ b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component.spec.ts @@ -4,9 +4,9 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; import { ConnectEndpointComponent } from '../connect-endpoint/connect-endpoint.component'; diff --git a/src/frontend/packages/core/src/features/endpoints/connect-endpoint/connect-endpoint.component.spec.ts b/src/frontend/packages/core/src/features/endpoints/connect-endpoint/connect-endpoint.component.spec.ts index 3097c898b3..8ba78e8f7b 100644 --- a/src/frontend/packages/core/src/features/endpoints/connect-endpoint/connect-endpoint.component.spec.ts +++ b/src/frontend/packages/core/src/features/endpoints/connect-endpoint/connect-endpoint.component.spec.ts @@ -1,8 +1,8 @@ import { CommonModule } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; import { ConnectEndpointComponent } from './connect-endpoint.component'; diff --git a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-base-step/create-endpoint-base-step.component.spec.ts b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-base-step/create-endpoint-base-step.component.spec.ts index 8be52f97f8..c0108afa2d 100644 --- a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-base-step/create-endpoint-base-step.component.spec.ts +++ b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-base-step/create-endpoint-base-step.component.spec.ts @@ -2,10 +2,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../../core/core.module'; import { SharedModule } from '../../../../shared/shared.module'; import { CreateEndpointBaseStepComponent } from './create-endpoint-base-step.component'; diff --git a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.spec.ts b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.spec.ts index 0c9396218b..d3f1121f3d 100644 --- a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.spec.ts +++ b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.spec.ts @@ -1,9 +1,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { CoreTestingModule } from '../../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../../core/core.module'; import { SharedModule } from '../../../../shared/shared.module'; import { CreateEndpointCfStep1Component } from './create-endpoint-cf-step-1.component'; diff --git a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-connect/create-endpoint-connect.component.spec.ts b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-connect/create-endpoint-connect.component.spec.ts index 02e8eb1026..4413a91ef7 100644 --- a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-connect/create-endpoint-connect.component.spec.ts +++ b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-connect/create-endpoint-connect.component.spec.ts @@ -1,6 +1,6 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { createBasicStoreModule } from '@stratos/store/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { CoreTestingModule } from '../../../../../test-framework/core-test.modules'; import { CoreModule } from '../../../../core/core.module'; diff --git a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint.component.spec.ts b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint.component.spec.ts index 36294cefcf..695f926c40 100644 --- a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint.component.spec.ts +++ b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint.component.spec.ts @@ -1,18 +1,18 @@ +import { HttpClientModule } from '@angular/common/http'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; import { ConnectEndpointComponent } from '../connect-endpoint/connect-endpoint.component'; import { CreateEndpointCfStep1Component } from './create-endpoint-cf-step-1/create-endpoint-cf-step-1.component'; import { CreateEndpointConnectComponent } from './create-endpoint-connect/create-endpoint-connect.component'; import { CreateEndpointComponent } from './create-endpoint.component'; -import { HttpClientModule } from '@angular/common/http'; // TODO: Fix after metrics has been sorted - STRAT-152 xdescribe('CreateEndpointComponent', () => { diff --git a/src/frontend/packages/core/src/features/endpoints/endpoints-page/endpoints-page.component.spec.ts b/src/frontend/packages/core/src/features/endpoints/endpoints-page/endpoints-page.component.spec.ts index da645164b8..ce469196e9 100644 --- a/src/frontend/packages/core/src/features/endpoints/endpoints-page/endpoints-page.component.spec.ts +++ b/src/frontend/packages/core/src/features/endpoints/endpoints-page/endpoints-page.component.spec.ts @@ -3,15 +3,15 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { StoreModule } from '@ngrx/store'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { appReducers } from '../../../../../store/src/reducers.module'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; -import { EndpointsPageComponent } from './endpoints-page.component'; import { SidePanelService } from './../../../shared/services/side-panel.service'; +import { EndpointsPageComponent } from './endpoints-page.component'; describe('EndpointsPageComponent', () => { let component: EndpointsPageComponent; diff --git a/src/frontend/packages/core/src/features/error-page/error-page/error-page.component.spec.ts b/src/frontend/packages/core/src/features/error-page/error-page/error-page.component.spec.ts index 5972631704..206f02d3d9 100644 --- a/src/frontend/packages/core/src/features/error-page/error-page/error-page.component.spec.ts +++ b/src/frontend/packages/core/src/features/error-page/error-page/error-page.component.spec.ts @@ -1,9 +1,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; import { ErrorPageComponent } from './error-page.component'; diff --git a/src/frontend/packages/core/src/features/event-page/events-page/events-page.component.spec.ts b/src/frontend/packages/core/src/features/event-page/events-page/events-page.component.spec.ts index 1bce50ae14..883569abca 100644 --- a/src/frontend/packages/core/src/features/event-page/events-page/events-page.component.spec.ts +++ b/src/frontend/packages/core/src/features/event-page/events-page/events-page.component.spec.ts @@ -1,9 +1,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; import { EventsPageComponent } from './events-page.component'; diff --git a/src/frontend/packages/core/src/features/home/home/home-page.component.spec.ts b/src/frontend/packages/core/src/features/home/home/home-page.component.spec.ts index 6da28f671d..a456ae097f 100644 --- a/src/frontend/packages/core/src/features/home/home/home-page.component.spec.ts +++ b/src/frontend/packages/core/src/features/home/home/home-page.component.spec.ts @@ -2,10 +2,10 @@ import { CommonModule } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; import { HomePageComponent } from './home-page.component'; diff --git a/src/frontend/packages/core/src/features/metrics/metrics/metrics.component.spec.ts b/src/frontend/packages/core/src/features/metrics/metrics/metrics.component.spec.ts index 34602f97ab..d4d47fac96 100644 --- a/src/frontend/packages/core/src/features/metrics/metrics/metrics.component.spec.ts +++ b/src/frontend/packages/core/src/features/metrics/metrics/metrics.component.spec.ts @@ -2,10 +2,10 @@ import { CommonModule } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; import { SharedModule } from '../../../shared/shared.module'; import { MetricsService } from '../services/metrics-service'; diff --git a/src/frontend/packages/core/src/features/no-endpoints-non-admin/no-endpoints-non-admin.component.spec.ts b/src/frontend/packages/core/src/features/no-endpoints-non-admin/no-endpoints-non-admin.component.spec.ts index 2e8db8edab..fb688116a9 100644 --- a/src/frontend/packages/core/src/features/no-endpoints-non-admin/no-endpoints-non-admin.component.spec.ts +++ b/src/frontend/packages/core/src/features/no-endpoints-non-admin/no-endpoints-non-admin.component.spec.ts @@ -1,9 +1,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../tab-nav.service'; import { CoreTestingModule } from '../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../core/core.module'; import { SharedModule } from '../../shared/shared.module'; import { NoEndpointsNonAdminComponent } from './no-endpoints-non-admin.component'; diff --git a/src/frontend/packages/core/src/features/setup/local-account-wizard/local-account-wizard.component.spec.ts b/src/frontend/packages/core/src/features/setup/local-account-wizard/local-account-wizard.component.spec.ts index c2eee31eeb..d76be87a52 100644 --- a/src/frontend/packages/core/src/features/setup/local-account-wizard/local-account-wizard.component.spec.ts +++ b/src/frontend/packages/core/src/features/setup/local-account-wizard/local-account-wizard.component.spec.ts @@ -2,7 +2,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { createEmptyStoreModule } from '@stratos/store/testing'; +import { createEmptyStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreModule } from '../../../core/core.module'; diff --git a/src/frontend/packages/core/src/features/user-profile/edit-profile-info/edit-profile-info.component.spec.ts b/src/frontend/packages/core/src/features/user-profile/edit-profile-info/edit-profile-info.component.spec.ts index 1b22dc0366..13c1bae7e3 100644 --- a/src/frontend/packages/core/src/features/user-profile/edit-profile-info/edit-profile-info.component.spec.ts +++ b/src/frontend/packages/core/src/features/user-profile/edit-profile-info/edit-profile-info.component.spec.ts @@ -2,13 +2,13 @@ import { CommonModule } from '@angular/common'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; -import { SharedModule } from '../../../shared/shared.module'; import { UserProfileService } from '../../../core/user-profile.service'; +import { SharedModule } from '../../../shared/shared.module'; import { EditProfileInfoComponent } from './edit-profile-info.component'; describe('EditProfileInfoComponent', () => { diff --git a/src/frontend/packages/core/src/features/user-profile/profile-info/profile-info.component.spec.ts b/src/frontend/packages/core/src/features/user-profile/profile-info/profile-info.component.spec.ts index 849f04870e..2c855307de 100644 --- a/src/frontend/packages/core/src/features/user-profile/profile-info/profile-info.component.spec.ts +++ b/src/frontend/packages/core/src/features/user-profile/profile-info/profile-info.component.spec.ts @@ -2,13 +2,13 @@ import { CommonModule } from '@angular/common'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { createBasicStoreModule } from '@stratosui/store/testing'; import { TabNavService } from '../../../../tab-nav.service'; import { CoreTestingModule } from '../../../../test-framework/core-test.modules'; -import { createBasicStoreModule } from '@stratos/store/testing'; import { CoreModule } from '../../../core/core.module'; -import { SharedModule } from '../../../shared/shared.module'; import { UserProfileService } from '../../../core/user-profile.service'; +import { SharedModule } from '../../../shared/shared.module'; import { ProfileInfoComponent } from './profile-info.component'; describe('ProfileInfoComponent', () => { diff --git a/src/frontend/packages/core/misc/custom/index.html b/src/frontend/packages/core/src/index.html similarity index 95% rename from src/frontend/packages/core/misc/custom/index.html rename to src/frontend/packages/core/src/index.html index b6c415d27c..5756ba3e60 100644 --- a/src/frontend/packages/core/misc/custom/index.html +++ b/src/frontend/packages/core/src/index.html @@ -11,7 +11,7 @@ - +