From 54e4baf2cfa12f36cd6fee23b2872d4eee2c728b Mon Sep 17 00:00:00 2001 From: Stefan Hauke Date: Thu, 9 Dec 2021 14:20:05 +0100 Subject: [PATCH 01/79] refactor: rename standard PWA themes - (b2b + b2c) (#923) BREAKING CHANGES: The B2C theme `default` is renamed to `b2c` and the B2B theme `blue` is renamed to `b2b` and `b2b` is now used as the default theme (see [Migrations / 1.4 to 2.0](https://github.com/intershop/intershop-pwa/blob/develop/docs/guides/migrations.md#14-to-20) for more details. Co-authored-by: Marcus Schmidt <42213508+marschmidt89@users.noreply.github.com> Co-authored-by: Danilo Hoffmann --- .github/workflows/demo-server.yml | 4 +- .github/workflows/integration.yml | 8 +-- .github/workflows/windows.yml | 2 +- angular.json | 38 +++++----- docker-compose.yml | 8 +-- docs/guides/migrations.md | 10 +++ docs/guides/multi-site-configurations.md | 9 ++- docs/guides/multiple-themes.md | 4 +- e2e/test-schematics-customization.sh | 1 + nginx/README.md | 4 +- schematics/customization/add/index.js | 6 +- .../src/helpers/override/factory_spec.ts | 66 +++++++++--------- schematics/src/helpers/override/schema.json | 2 +- .../themes/{blue => b2b}/img/favicon.ico | Bin src/assets/themes/{blue => b2b}/img/logo.png | Bin .../themes/{blue => b2b}/img/logo_192x192.png | Bin .../themes/{blue => b2b}/img/logo_256x256.png | Bin .../themes/{blue => b2b}/img/logo_384x384.png | Bin .../themes/{blue => b2b}/img/logo_512x512.png | Bin .../{blue => b2b}/img/logo_apple_120x120.png | Bin .../{blue => b2b}/img/logo_apple_152x152.png | Bin .../{blue => b2b}/img/logo_apple_167x167.png | Bin .../{blue => b2b}/img/logo_apple_180x180.png | Bin .../themes/{blue => b2b}/img/logo_mobile.png | Bin .../themes/{blue => b2b}/manifest.webmanifest | 0 .../themes/{default => b2c}/img/favicon.ico | Bin .../themes/{default => b2c}/img/logo.png | Bin .../{default => b2c}/img/logo_192x192.png | Bin .../{default => b2c}/img/logo_256x256.png | Bin .../{default => b2c}/img/logo_384x384.png | Bin .../{default => b2c}/img/logo_512x512.png | Bin .../img/logo_apple_120x120.png | Bin .../img/logo_apple_152x152.png | Bin .../img/logo_apple_167x167.png | Bin .../img/logo_apple_180x180.png | Bin .../{default => b2c}/img/logo_mobile.png | Bin .../{default => b2c}/manifest.webmanifest | 0 ...environment.blue.ts => environment.b2b.ts} | 0 ...ironment.default.ts => environment.b2c.ts} | 2 + src/index.html | 14 ++-- src/styles/themes/{blue => b2b}/style.scss | 0 .../themes/{blue => b2b}/variables.scss | 4 +- src/styles/themes/{default => b2c}/style.scss | 0 .../themes/{default => b2c}/variables.scss | 4 +- src/styles/themes/placeholder/style.scss | 1 + templates/webpack/webpack.custom.ts | 22 +++--- tslint.json | 4 +- 47 files changed, 112 insertions(+), 101 deletions(-) rename src/assets/themes/{blue => b2b}/img/favicon.ico (100%) rename src/assets/themes/{blue => b2b}/img/logo.png (100%) rename src/assets/themes/{blue => b2b}/img/logo_192x192.png (100%) rename src/assets/themes/{blue => b2b}/img/logo_256x256.png (100%) rename src/assets/themes/{blue => b2b}/img/logo_384x384.png (100%) rename src/assets/themes/{blue => b2b}/img/logo_512x512.png (100%) rename src/assets/themes/{blue => b2b}/img/logo_apple_120x120.png (100%) rename src/assets/themes/{blue => b2b}/img/logo_apple_152x152.png (100%) rename src/assets/themes/{blue => b2b}/img/logo_apple_167x167.png (100%) rename src/assets/themes/{blue => b2b}/img/logo_apple_180x180.png (100%) rename src/assets/themes/{blue => b2b}/img/logo_mobile.png (100%) rename src/assets/themes/{blue => b2b}/manifest.webmanifest (100%) rename src/assets/themes/{default => b2c}/img/favicon.ico (100%) rename src/assets/themes/{default => b2c}/img/logo.png (100%) rename src/assets/themes/{default => b2c}/img/logo_192x192.png (100%) rename src/assets/themes/{default => b2c}/img/logo_256x256.png (100%) rename src/assets/themes/{default => b2c}/img/logo_384x384.png (100%) rename src/assets/themes/{default => b2c}/img/logo_512x512.png (100%) rename src/assets/themes/{default => b2c}/img/logo_apple_120x120.png (100%) rename src/assets/themes/{default => b2c}/img/logo_apple_152x152.png (100%) rename src/assets/themes/{default => b2c}/img/logo_apple_167x167.png (100%) rename src/assets/themes/{default => b2c}/img/logo_apple_180x180.png (100%) rename src/assets/themes/{default => b2c}/img/logo_mobile.png (100%) rename src/assets/themes/{default => b2c}/manifest.webmanifest (100%) rename src/environments/{environment.blue.ts => environment.b2b.ts} (100%) rename src/environments/{environment.default.ts => environment.b2c.ts} (92%) rename src/styles/themes/{blue => b2b}/style.scss (100%) rename src/styles/themes/{blue => b2b}/variables.scss (98%) rename src/styles/themes/{default => b2c}/style.scss (100%) rename src/styles/themes/{default => b2c}/variables.scss (98%) create mode 100644 src/styles/themes/placeholder/style.scss diff --git a/.github/workflows/demo-server.yml b/.github/workflows/demo-server.yml index 97b55a909f5..362596a2672 100644 --- a/.github/workflows/demo-server.yml +++ b/.github/workflows/demo-server.yml @@ -67,5 +67,5 @@ jobs: with: body: | Azure Demo Servers are available: - - [Universal B2C](http://${{ env.AZURE_WEBAPP_NAME }}.azurewebsites.net/home) - - [Universal B2B](http://${{ env.AZURE_WEBAPP_NAME }}.azurewebsites.net/home;theme=blue) + - [Universal B2B](http://${{ env.AZURE_WEBAPP_NAME }}.azurewebsites.net/home) + - [Universal B2C](http://${{ env.AZURE_WEBAPP_NAME }}.azurewebsites.net/home;theme=b2c) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index aa69fdb9f1e..dedfd142398 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -85,12 +85,12 @@ jobs: - name: Set B2C Environment if: matrix.test == 'b2c' run: | - echo "THEME=default" >> $GITHUB_ENV + echo "THEME=b2c" >> $GITHUB_ENV - name: Set B2B Environment if: matrix.test == 'b2b' run: | - echo "THEME=blue" >> $GITHUB_ENV + echo "THEME=b2b" >> $GITHUB_ENV - name: Test Universal run: | @@ -130,12 +130,12 @@ jobs: - name: Set B2C Environment if: matrix.test == 'b2c' run: | - echo "THEME=default" >> $GITHUB_ENV + echo "THEME=b2c" >> $GITHUB_ENV - name: Set B2B Environment if: matrix.test == 'b2b' run: | - echo "THEME=blue" >> $GITHUB_ENV + echo "THEME=b2b" >> $GITHUB_ENV - name: Start SSR run: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 03a6fec3170..9af8868add6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -58,4 +58,4 @@ jobs: run: npm run clean - name: Build with development environment - run: npm run build --configuration=default,development + run: npm run build --configuration=b2b,development diff --git a/angular.json b/angular.json index 7243cec8a22..415b0696122 100644 --- a/angular.json +++ b/angular.json @@ -32,9 +32,9 @@ "aot": true, "assets": ["src/assets"], "scripts": [], - "styles": ["src/styles/themes/default/style.scss"], + "styles": ["src/styles/themes/placeholder/style.scss"], "stylePreprocessorOptions": { - "includePaths": ["src/styles/themes/default"] + "includePaths": ["src/styles/themes/placeholder"] } }, "defaultConfiguration": "sales,production", @@ -92,8 +92,8 @@ } ] }, - "default": {}, - "blue": {}, + "b2b": {}, + "b2c": {}, "sales": {} } }, @@ -112,11 +112,11 @@ "development": { "browserTarget": "intershop-pwa:build:development" }, - "default": { - "browserTarget": "intershop-pwa:build:default" + "b2b": { + "browserTarget": "intershop-pwa:build:b2b" }, - "blue": { - "browserTarget": "intershop-pwa:build:blue" + "b2c": { + "browserTarget": "intershop-pwa:build:b2c" }, "sales": { "browserTarget": "intershop-pwa:build:sales" @@ -149,7 +149,7 @@ "optimization": true, "tsConfig": "tsconfig.server.json", "stylePreprocessorOptions": { - "includePaths": ["src/styles/themes/default"] + "includePaths": ["src/styles/themes/placeholder"] } }, "defaultConfiguration": "sales,production", @@ -161,8 +161,8 @@ "development": { "sourceMap": true }, - "default": {}, - "blue": {}, + "b2b": {}, + "b2c": {}, "sales": {} } }, @@ -174,13 +174,13 @@ }, "defaultConfiguration": "sales", "configurations": { - "default": { - "browserTarget": "intershop-pwa:build:default,development", - "serverTarget": "intershop-pwa:server:default,development" + "b2b": { + "browserTarget": "intershop-pwa:build:b2b,development", + "serverTarget": "intershop-pwa:server:b2b,development" }, - "blue": { - "browserTarget": "intershop-pwa:build:blue,development", - "serverTarget": "intershop-pwa:server:blue,development" + "b2c": { + "browserTarget": "intershop-pwa:build:b2c,development", + "serverTarget": "intershop-pwa:server:b2c,development" }, "sales": { "browserTarget": "intershop-pwa:build:sales,development", @@ -212,7 +212,7 @@ "polyfills": "src/polyfills.ts", "tsConfig": "projects/organization-management/tsconfig.app.json", "aot": false, - "styles": ["src/styles/themes/default/style.scss"], + "styles": ["src/styles/themes/placeholder/style.scss"], "assets": [ { "glob": "**/*", @@ -261,7 +261,7 @@ "polyfills": "src/polyfills.ts", "tsConfig": "projects/requisition-management/tsconfig.app.json", "aot": false, - "styles": ["src/styles/themes/default/style.scss"], + "styles": ["src/styles/themes/placeholder/style.scss"], "assets": [ { "glob": "**/*", diff --git a/docker-compose.yml b/docker-compose.yml index 6dde39ef9cf..8257817161a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,8 +9,8 @@ services: # dockerfile: Dockerfile_noSSR args: serviceWorker: 'false' - # activeThemes: default - # activeThemes: blue + # activeThemes: b2b + # activeThemes: b2c environment: - LOGGING=on - ICM_BASE_URL @@ -71,6 +71,6 @@ services: - baseHref: /fr channel: default lang: fr_FR - - baseHref: /b2b + - baseHref: /b2c channel: default - theme: blue + theme: b2c diff --git a/docs/guides/migrations.md b/docs/guides/migrations.md index 43d3ed36069..672db34c22a 100644 --- a/docs/guides/migrations.md +++ b/docs/guides/migrations.md @@ -7,6 +7,16 @@ kb_sync_latest_only # Migrations +## 1.4 to 2.0 + +With version 2.0 we introduce a renaming of the two standard PWA themes and change the default theme: + +- The previous B2B theme `blue` is now called `b2b` and is used as default theme from now on. +- The previous B2C theme `default` is now called `b2c`. + +With this change the according folders and references had to be renamed/moved and need to be adapted in customer projects as well. +In projects where the recommended procedure for using a custom theme has been followed (see [Customization Guide - Start Customization](./customizations.md#start-customization)), minimal migration effort should be required. + ## 1.1 to 1.2 The `dist` folder now only contains results of the build process (except for `healthcheck.js`). diff --git a/docs/guides/multi-site-configurations.md b/docs/guides/multi-site-configurations.md index 0513c43e006..66579176ae5 100644 --- a/docs/guides/multi-site-configurations.md +++ b/docs/guides/multi-site-configurations.md @@ -180,24 +180,23 @@ To see what is possible through multi-site handling, have a look at this extende - baseHref: /de lang: de_DE channel: inSPIRED-inTRONICS-Site + theme: b2c - baseHref: /us lang: en_US channel: inSPIRED-inTRONICS_Business-Site features: quoting,businessCustomerRegistration,advancedVariationHandling - theme: blue .+\.de: channel: inSPIRED-inTRONICS-Site lang: de_DE + theme: b2c .+\.com: channel: inSPIRED-inTRONICS_Business-Site features: quoting,businessCustomerRegistration,advancedVariationHandling - theme: blue .+\.fr: - channel: inSPIRED-inTRONICS-Site + channel: inSPIRED-inTRONICS_Business-Site lang: fr_FR - application: smb-responsive + application: rest features: quoting - theme: blue ``` ### Extended Example with two domains, one with basic auth (except /fr), the other without diff --git a/docs/guides/multiple-themes.md b/docs/guides/multiple-themes.md index 9f5383222cd..c8a74509635 100644 --- a/docs/guides/multiple-themes.md +++ b/docs/guides/multiple-themes.md @@ -10,8 +10,8 @@ kb_sync_latest_only It is possible to create multiple themes for the PWA. This mechanism uses Angular configurations to replace files for each configuration. -The Intershop Progressive Web App currently uses multi-theming to provide different styles for the B2C an the B2B application. -The styles for B2C are defined in `src/styles/themes/default/style.scss`, for B2B in `src/styles/themes/blue/style.scss`. +The Intershop Progressive Web App currently uses multi-theming to provide different styles for the B2B an the B2C application. +The styles for B2B are defined in `src/styles/themes/b2b/style.scss`, for B2C in `src/styles/themes/b2c/style.scss`. Using schematics to start customizing Intershop Progressive Web App prepares a theme for your own custom styling. (See [Customizations - Start Customization](../guides/customizations.md#start-customization)) diff --git a/e2e/test-schematics-customization.sh b/e2e/test-schematics-customization.sh index 9d1253f5fa9..d2b3a0257b9 100644 --- a/e2e/test-schematics-customization.sh +++ b/e2e/test-schematics-customization.sh @@ -36,6 +36,7 @@ stat src/app/pages/home/home-page.component.scss grep './home-page.component.scss' src/app/pages/home/home-page.component.brand.ts grep './home-page.component.scss' src/app/pages/home/home-page.component.ts echo '

COMPONENT_OVERRIDES

' > src/app/pages/home/home-page.component.brand.html +echo "@import 'variables';" > src/app/pages/home/home-page.component.brand.scss npx ng g override --theme brand --html --ts src/app/shared/components/product/product-image/product-image.component.ts stat src/app/shared/components/product/product-image/product-image.component.brand.ts diff --git a/nginx/README.md b/nginx/README.md index 21eb66af7a3..44feeb895df 100644 --- a/nginx/README.md +++ b/nginx/README.md @@ -9,19 +9,19 @@ Please refer to the [documentation](../docs/guides/nginx-startup.md) for configu .+\.net: channel: inSPIRED-inTRONICS-Site lang: en_US + theme: 'b2c' .+\.de: channel: inSPIRED-inTRONICS-Site lang: de_DE + theme: 'b2c' .+\.com: channel: inSPIRED-inTRONICS_Business-Site features: quoting,businessCustomerRegistration,advancedVariationHandling - theme: 'blue|688dc3' .+\.fr: channel: inSPIRED-inTRONICS-Site lang: fr_FR application: smb-responsive features: quoting - theme: 'blue|688dc3' ``` 2. Run the following from the project root: diff --git a/schematics/customization/add/index.js b/schematics/customization/add/index.js index 9cfc3799db5..2c37e9458d2 100644 --- a/schematics/customization/add/index.js +++ b/schematics/customization/add/index.js @@ -16,7 +16,7 @@ if (fs.existsSync(`src/styles/themes/${theme}/style.scss`)) { } // add style definition files -execSync(`npx ncp src/styles/themes/default src/styles/themes/${theme} --stopOnErr`); +execSync(`npx ncp src/styles/themes/b2b src/styles/themes/${theme} --stopOnErr`); // replace in angular.json const angularJson = parse(fs.readFileSync('./angular.json', { encoding: 'UTF-8' })); @@ -70,14 +70,14 @@ addPrefix(tslintJson.rules['directive-selector']); addPrefix(tslintJson.rules['component-selector']); const reusePatterns = tslintJson.rules['project-structure'].options.reusePatterns; -reusePatterns.theme = reusePatterns.theme.replace('default|blue', `default|blue|${theme}`); +reusePatterns.theme = reusePatterns.theme.replace('b2b|b2c', `b2b|b2c|${theme}`); fs.writeFileSync('./tslint.json', stringify(tslintJson, null, 2)); execSync('npx prettier --write tslint.json'); // add environment copy if (!fs.existsSync(`src/environments/environment.${theme}.ts`)) { - execSync(`npx ncp src/environments/environment.default.ts src/environments/environment.${theme}.ts --stopOnErr`); + execSync(`npx ncp src/environments/environment.b2b.ts src/environments/environment.${theme}.ts --stopOnErr`); } // add theme to schematics diff --git a/schematics/src/helpers/override/factory_spec.ts b/schematics/src/helpers/override/factory_spec.ts index 09899cbb359..e48ae3ba981 100644 --- a/schematics/src/helpers/override/factory_spec.ts +++ b/schematics/src/helpers/override/factory_spec.ts @@ -100,7 +100,7 @@ describe('override Schematic', () => { }); it('should do nothing when no override was specified', async () => { - const tree = await runOverride({ from: 'src/app/foo/dummy/dummy.component.ts', theme: 'default' }); + const tree = await runOverride({ from: 'src/app/foo/dummy/dummy.component.ts', theme: 'b2b' }); expect(tree.files.filter(x => x.includes('dummy.component'))).toMatchInlineSnapshot(` Array [ @@ -116,36 +116,36 @@ describe('override Schematic', () => { }); it('should throw if html override is specified on a non-component', async done => { - await runOverride({ from: 'core/services/dummy/dummy.service.ts', theme: 'blue', html: true }).catch(err => { + await runOverride({ from: 'core/services/dummy/dummy.service.ts', theme: 'b2b', html: true }).catch(err => { expect(err).toMatchInlineSnapshot(`[Error: Template and Style overrides only work on components.]`); done(); }); }); it('should throw if scss override is specified on a non-component', async done => { - await runOverride({ from: 'core/services/dummy/dummy.service.ts', theme: 'blue', scss: true }).catch(err => { + await runOverride({ from: 'core/services/dummy/dummy.service.ts', theme: 'b2b', scss: true }).catch(err => { expect(err).toMatchInlineSnapshot(`[Error: Template and Style overrides only work on components.]`); done(); }); }); it('should override component html if specified', async () => { - const tree = await runOverride({ from: 'foo/dummy/dummy.component.ts', theme: 'blue', html: true }); + const tree = await runOverride({ from: 'foo/dummy/dummy.component.ts', theme: 'b2b', html: true }); expect(tree.files.filter(x => x.includes('dummy.component'))).toMatchInlineSnapshot(` Array [ "/src/app/foo/dummy/dummy.component.html", "/src/app/foo/dummy/dummy.component.spec.ts", "/src/app/foo/dummy/dummy.component.ts", - "/src/app/foo/dummy/dummy.component.blue.html", + "/src/app/foo/dummy/dummy.component.b2b.html", ] `); - expect(appTree.readContent('/src/app/foo/dummy/dummy.component.blue.html')).toMatchInlineSnapshot(`"OVERRIDE"`); + expect(appTree.readContent('/src/app/foo/dummy/dummy.component.b2b.html')).toMatchInlineSnapshot(`"OVERRIDE"`); }); it('should override component scss for components with css if specified', async () => { - const tree = await runOverride({ from: 'src/app/foo/foobar/foobar.component.ts', theme: 'blue', scss: true }); + const tree = await runOverride({ from: 'src/app/foo/foobar/foobar.component.ts', theme: 'b2b', scss: true }); expect(tree.files.filter(x => x.includes('foobar.component'))).toMatchInlineSnapshot(` Array [ @@ -153,15 +153,15 @@ describe('override Schematic', () => { "/src/app/foo/foobar/foobar.component.scss", "/src/app/foo/foobar/foobar.component.spec.ts", "/src/app/foo/foobar/foobar.component.ts", - "/src/app/foo/foobar/foobar.component.blue.scss", + "/src/app/foo/foobar/foobar.component.b2b.scss", ] `); - expect(appTree.exists('/src/app/foo/foobar/foobar.component.blue.scss')).toBeTrue(); + expect(appTree.exists('/src/app/foo/foobar/foobar.component.b2b.scss')).toBeTrue(); }); it('should override component scss for components without it', async () => { - const tree = await runOverride({ from: 'foo/dummy/dummy.component.ts', theme: 'blue', scss: true }); + const tree = await runOverride({ from: 'foo/dummy/dummy.component.ts', theme: 'b2b', scss: true }); expect(tree.files.filter(x => x.includes('dummy.component'))).toMatchInlineSnapshot(` Array [ @@ -169,11 +169,11 @@ describe('override Schematic', () => { "/src/app/foo/dummy/dummy.component.spec.ts", "/src/app/foo/dummy/dummy.component.ts", "/src/app/foo/dummy/dummy.component.scss", - "/src/app/foo/dummy/dummy.component.blue.scss", + "/src/app/foo/dummy/dummy.component.b2b.scss", ] `); - expect(appTree.exists('/src/app/foo/dummy/dummy.component.blue.scss')).toBeTrue(); + expect(appTree.exists('/src/app/foo/dummy/dummy.component.b2b.scss')).toBeTrue(); expect(appTree.exists('/src/app/foo/dummy/dummy.component.scss')).toBeTrue(); const dummyComponent = appTree.readContent('/src/app/foo/dummy/dummy.component.ts'); expect(componentDecorator(dummyComponent)).toMatchInlineSnapshot( @@ -182,18 +182,18 @@ describe('override Schematic', () => { }); it('should override component ts if specified', async () => { - const tree = await runOverride({ from: 'foo/dummy/dummy.component.ts', theme: 'blue', ts: true }); + const tree = await runOverride({ from: 'foo/dummy/dummy.component.ts', theme: 'b2b', ts: true }); expect(tree.files.filter(x => x.includes('dummy.component'))).toMatchInlineSnapshot(` Array [ "/src/app/foo/dummy/dummy.component.html", "/src/app/foo/dummy/dummy.component.spec.ts", "/src/app/foo/dummy/dummy.component.ts", - "/src/app/foo/dummy/dummy.component.blue.ts", + "/src/app/foo/dummy/dummy.component.b2b.ts", ] `); - expect(appTree.readContent('/src/app/foo/dummy/dummy.component.blue.ts')).toEqual( + expect(appTree.readContent('/src/app/foo/dummy/dummy.component.b2b.ts')).toEqual( appTree.readContent('/src/app/foo/dummy/dummy.component.ts') ); }); @@ -201,7 +201,7 @@ describe('override Schematic', () => { it('should override everything on components with css if specified', async () => { const tree = await runOverride({ from: 'src/app/foo/foobar/foobar.component.ts', - theme: 'blue', + theme: 'b2b', scss: true, html: true, ts: true, @@ -213,15 +213,15 @@ describe('override Schematic', () => { "/src/app/foo/foobar/foobar.component.scss", "/src/app/foo/foobar/foobar.component.spec.ts", "/src/app/foo/foobar/foobar.component.ts", - "/src/app/foo/foobar/foobar.component.blue.html", - "/src/app/foo/foobar/foobar.component.blue.scss", - "/src/app/foo/foobar/foobar.component.blue.ts", + "/src/app/foo/foobar/foobar.component.b2b.html", + "/src/app/foo/foobar/foobar.component.b2b.scss", + "/src/app/foo/foobar/foobar.component.b2b.ts", ] `); - expect(appTree.exists('/src/app/foo/foobar/foobar.component.blue.scss')).toBeTrue(); - expect(appTree.readContent('/src/app/foo/foobar/foobar.component.blue.html')).toMatchInlineSnapshot(`"OVERRIDE"`); - expect(appTree.readContent('/src/app/foo/foobar/foobar.component.blue.ts')).toEqual( + expect(appTree.exists('/src/app/foo/foobar/foobar.component.b2b.scss')).toBeTrue(); + expect(appTree.readContent('/src/app/foo/foobar/foobar.component.b2b.html')).toMatchInlineSnapshot(`"OVERRIDE"`); + expect(appTree.readContent('/src/app/foo/foobar/foobar.component.b2b.ts')).toEqual( appTree.readContent('/src/app/foo/foobar/foobar.component.ts') ); }); @@ -229,7 +229,7 @@ describe('override Schematic', () => { it('should override everything on components without css if specified', async () => { const tree = await runOverride({ from: 'foo/dummy/dummy.component.ts', - theme: 'blue', + theme: 'b2b', scss: true, html: true, ts: true, @@ -240,16 +240,16 @@ describe('override Schematic', () => { "/src/app/foo/dummy/dummy.component.html", "/src/app/foo/dummy/dummy.component.spec.ts", "/src/app/foo/dummy/dummy.component.ts", - "/src/app/foo/dummy/dummy.component.blue.html", + "/src/app/foo/dummy/dummy.component.b2b.html", "/src/app/foo/dummy/dummy.component.scss", - "/src/app/foo/dummy/dummy.component.blue.scss", - "/src/app/foo/dummy/dummy.component.blue.ts", + "/src/app/foo/dummy/dummy.component.b2b.scss", + "/src/app/foo/dummy/dummy.component.b2b.ts", ] `); - expect(appTree.exists('/src/app/foo/dummy/dummy.component.blue.scss')).toBeTrue(); - expect(appTree.readContent('/src/app/foo/dummy/dummy.component.blue.html')).toMatchInlineSnapshot(`"OVERRIDE"`); - expect(appTree.readContent('/src/app/foo/dummy/dummy.component.blue.ts')).toEqual( + expect(appTree.exists('/src/app/foo/dummy/dummy.component.b2b.scss')).toBeTrue(); + expect(appTree.readContent('/src/app/foo/dummy/dummy.component.b2b.html')).toMatchInlineSnapshot(`"OVERRIDE"`); + expect(appTree.readContent('/src/app/foo/dummy/dummy.component.b2b.ts')).toEqual( appTree.readContent('/src/app/foo/dummy/dummy.component.ts') ); }); @@ -257,7 +257,7 @@ describe('override Schematic', () => { it('should override service ts if requested', async () => { const tree = await runOverride({ from: 'src/app/core/services/dummy/dummy.service.ts', - theme: 'blue', + theme: 'b2b', ts: true, }); @@ -265,7 +265,7 @@ describe('override Schematic', () => { Array [ "/src/app/core/services/dummy/dummy.service.spec.ts", "/src/app/core/services/dummy/dummy.service.ts", - "/src/app/core/services/dummy/dummy.service.blue.ts", + "/src/app/core/services/dummy/dummy.service.b2b.ts", ] `); }); @@ -273,14 +273,14 @@ describe('override Schematic', () => { it('should override any ts if requested', async () => { const tree = await runOverride({ from: 'core/routing/product.route.ts', - theme: 'blue', + theme: 'b2b', ts: true, }); expect(tree.files.filter(x => x.includes('product.route'))).toMatchInlineSnapshot(` Array [ "/src/app/core/routing/product.route.ts", - "/src/app/core/routing/product.route.blue.ts", + "/src/app/core/routing/product.route.b2b.ts", ] `); }); diff --git a/schematics/src/helpers/override/schema.json b/schematics/src/helpers/override/schema.json index 79a2279b182..0033cdfd515 100644 --- a/schematics/src/helpers/override/schema.json +++ b/schematics/src/helpers/override/schema.json @@ -27,7 +27,7 @@ }, "theme": { "type": "string", - "enum": ["sales", "default", "blue", "all"], + "enum": ["sales", "b2b", "b2c", "all"], "x-prompt": "For which theme?" }, "ts": { diff --git a/src/assets/themes/blue/img/favicon.ico b/src/assets/themes/b2b/img/favicon.ico similarity index 100% rename from src/assets/themes/blue/img/favicon.ico rename to src/assets/themes/b2b/img/favicon.ico diff --git a/src/assets/themes/blue/img/logo.png b/src/assets/themes/b2b/img/logo.png similarity index 100% rename from src/assets/themes/blue/img/logo.png rename to src/assets/themes/b2b/img/logo.png diff --git a/src/assets/themes/blue/img/logo_192x192.png b/src/assets/themes/b2b/img/logo_192x192.png similarity index 100% rename from src/assets/themes/blue/img/logo_192x192.png rename to src/assets/themes/b2b/img/logo_192x192.png diff --git a/src/assets/themes/blue/img/logo_256x256.png b/src/assets/themes/b2b/img/logo_256x256.png similarity index 100% rename from src/assets/themes/blue/img/logo_256x256.png rename to src/assets/themes/b2b/img/logo_256x256.png diff --git a/src/assets/themes/blue/img/logo_384x384.png b/src/assets/themes/b2b/img/logo_384x384.png similarity index 100% rename from src/assets/themes/blue/img/logo_384x384.png rename to src/assets/themes/b2b/img/logo_384x384.png diff --git a/src/assets/themes/blue/img/logo_512x512.png b/src/assets/themes/b2b/img/logo_512x512.png similarity index 100% rename from src/assets/themes/blue/img/logo_512x512.png rename to src/assets/themes/b2b/img/logo_512x512.png diff --git a/src/assets/themes/blue/img/logo_apple_120x120.png b/src/assets/themes/b2b/img/logo_apple_120x120.png similarity index 100% rename from src/assets/themes/blue/img/logo_apple_120x120.png rename to src/assets/themes/b2b/img/logo_apple_120x120.png diff --git a/src/assets/themes/blue/img/logo_apple_152x152.png b/src/assets/themes/b2b/img/logo_apple_152x152.png similarity index 100% rename from src/assets/themes/blue/img/logo_apple_152x152.png rename to src/assets/themes/b2b/img/logo_apple_152x152.png diff --git a/src/assets/themes/blue/img/logo_apple_167x167.png b/src/assets/themes/b2b/img/logo_apple_167x167.png similarity index 100% rename from src/assets/themes/blue/img/logo_apple_167x167.png rename to src/assets/themes/b2b/img/logo_apple_167x167.png diff --git a/src/assets/themes/blue/img/logo_apple_180x180.png b/src/assets/themes/b2b/img/logo_apple_180x180.png similarity index 100% rename from src/assets/themes/blue/img/logo_apple_180x180.png rename to src/assets/themes/b2b/img/logo_apple_180x180.png diff --git a/src/assets/themes/blue/img/logo_mobile.png b/src/assets/themes/b2b/img/logo_mobile.png similarity index 100% rename from src/assets/themes/blue/img/logo_mobile.png rename to src/assets/themes/b2b/img/logo_mobile.png diff --git a/src/assets/themes/blue/manifest.webmanifest b/src/assets/themes/b2b/manifest.webmanifest similarity index 100% rename from src/assets/themes/blue/manifest.webmanifest rename to src/assets/themes/b2b/manifest.webmanifest diff --git a/src/assets/themes/default/img/favicon.ico b/src/assets/themes/b2c/img/favicon.ico similarity index 100% rename from src/assets/themes/default/img/favicon.ico rename to src/assets/themes/b2c/img/favicon.ico diff --git a/src/assets/themes/default/img/logo.png b/src/assets/themes/b2c/img/logo.png similarity index 100% rename from src/assets/themes/default/img/logo.png rename to src/assets/themes/b2c/img/logo.png diff --git a/src/assets/themes/default/img/logo_192x192.png b/src/assets/themes/b2c/img/logo_192x192.png similarity index 100% rename from src/assets/themes/default/img/logo_192x192.png rename to src/assets/themes/b2c/img/logo_192x192.png diff --git a/src/assets/themes/default/img/logo_256x256.png b/src/assets/themes/b2c/img/logo_256x256.png similarity index 100% rename from src/assets/themes/default/img/logo_256x256.png rename to src/assets/themes/b2c/img/logo_256x256.png diff --git a/src/assets/themes/default/img/logo_384x384.png b/src/assets/themes/b2c/img/logo_384x384.png similarity index 100% rename from src/assets/themes/default/img/logo_384x384.png rename to src/assets/themes/b2c/img/logo_384x384.png diff --git a/src/assets/themes/default/img/logo_512x512.png b/src/assets/themes/b2c/img/logo_512x512.png similarity index 100% rename from src/assets/themes/default/img/logo_512x512.png rename to src/assets/themes/b2c/img/logo_512x512.png diff --git a/src/assets/themes/default/img/logo_apple_120x120.png b/src/assets/themes/b2c/img/logo_apple_120x120.png similarity index 100% rename from src/assets/themes/default/img/logo_apple_120x120.png rename to src/assets/themes/b2c/img/logo_apple_120x120.png diff --git a/src/assets/themes/default/img/logo_apple_152x152.png b/src/assets/themes/b2c/img/logo_apple_152x152.png similarity index 100% rename from src/assets/themes/default/img/logo_apple_152x152.png rename to src/assets/themes/b2c/img/logo_apple_152x152.png diff --git a/src/assets/themes/default/img/logo_apple_167x167.png b/src/assets/themes/b2c/img/logo_apple_167x167.png similarity index 100% rename from src/assets/themes/default/img/logo_apple_167x167.png rename to src/assets/themes/b2c/img/logo_apple_167x167.png diff --git a/src/assets/themes/default/img/logo_apple_180x180.png b/src/assets/themes/b2c/img/logo_apple_180x180.png similarity index 100% rename from src/assets/themes/default/img/logo_apple_180x180.png rename to src/assets/themes/b2c/img/logo_apple_180x180.png diff --git a/src/assets/themes/default/img/logo_mobile.png b/src/assets/themes/b2c/img/logo_mobile.png similarity index 100% rename from src/assets/themes/default/img/logo_mobile.png rename to src/assets/themes/b2c/img/logo_mobile.png diff --git a/src/assets/themes/default/manifest.webmanifest b/src/assets/themes/b2c/manifest.webmanifest similarity index 100% rename from src/assets/themes/default/manifest.webmanifest rename to src/assets/themes/b2c/manifest.webmanifest diff --git a/src/environments/environment.blue.ts b/src/environments/environment.b2b.ts similarity index 100% rename from src/environments/environment.blue.ts rename to src/environments/environment.b2b.ts diff --git a/src/environments/environment.default.ts b/src/environments/environment.b2c.ts similarity index 92% rename from src/environments/environment.default.ts rename to src/environments/environment.b2c.ts index ed9831b9c4c..9be6170227d 100644 --- a/src/environments/environment.default.ts +++ b/src/environments/environment.b2c.ts @@ -6,6 +6,8 @@ export const environment: Environment = { icmChannel: 'inSPIRED-inTRONICS-Site', + themeColor: '#ff6d00', + features: ['compare', 'recently', 'rating', 'guestCheckout', 'wishlists'], ...overrides, diff --git a/src/index.html b/src/index.html index 614c8b69c47..44f52cb82c9 100644 --- a/src/index.html +++ b/src/index.html @@ -4,13 +4,13 @@ - - - - - - - + + + + + + +