diff --git a/apps/red-ui-app-e2e/cypress.json b/apps/red-ui-app-e2e/cypress.json deleted file mode 100644 index 82568f91d..000000000 --- a/apps/red-ui-app-e2e/cypress.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "fileServerFolder": ".", - "fixturesFolder": "./src/fixtures", - "integrationFolder": "./src/integration", - "modifyObstructiveCode": false, - "pluginsFile": "./src/plugins/index", - "supportFile": "./src/support/index.ts", - "video": true, - "videosFolder": "../../dist/cypress/apps/red-ui-app-e2e/videos", - "screenshotsFolder": "../../dist/cypress/apps/red-ui-app-e2e/screenshots", - "chromeWebSecurity": false -} diff --git a/apps/red-ui-app-e2e/src/fixtures/example.json b/apps/red-ui-app-e2e/src/fixtures/example.json deleted file mode 100644 index 294cbed6c..000000000 --- a/apps/red-ui-app-e2e/src/fixtures/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io" -} diff --git a/apps/red-ui-app-e2e/src/integration/app.spec.ts b/apps/red-ui-app-e2e/src/integration/app.spec.ts deleted file mode 100644 index 8e963d904..000000000 --- a/apps/red-ui-app-e2e/src/integration/app.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { getGreeting } from '../support/app.po'; - -describe('red-ui-app', () => { - beforeEach(() => cy.visit('/')); - - it('should display welcome message', () => { - // Custom command example, see `../support/commands.ts` file - cy.login('my-email@something.com', 'myPassword'); - - // Function helper example, see `../support/app.po.ts` file - getGreeting().contains('Welcome to red-ui-app!'); - }); -}); diff --git a/apps/red-ui-app-e2e/src/plugins/index.js b/apps/red-ui-app-e2e/src/plugins/index.js deleted file mode 100644 index 9067e75a2..000000000 --- a/apps/red-ui-app-e2e/src/plugins/index.js +++ /dev/null @@ -1,22 +0,0 @@ -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor'); - -module.exports = (on, config) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config - - // Preprocess Typescript file using Nx helper - on('file:preprocessor', preprocessTypescript(config)); -}; diff --git a/apps/red-ui-app-e2e/src/support/app.po.ts b/apps/red-ui-app-e2e/src/support/app.po.ts deleted file mode 100644 index 329342469..000000000 --- a/apps/red-ui-app-e2e/src/support/app.po.ts +++ /dev/null @@ -1 +0,0 @@ -export const getGreeting = () => cy.get('h1'); diff --git a/apps/red-ui-app-e2e/src/support/commands.ts b/apps/red-ui-app-e2e/src/support/commands.ts deleted file mode 100644 index 61b3a3e35..000000000 --- a/apps/red-ui-app-e2e/src/support/commands.ts +++ /dev/null @@ -1,31 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// eslint-disable-next-line @typescript-eslint/no-namespace -declare namespace Cypress { - interface Chainable { - login(email: string, password: string): void; - } -} -// -// -- This is a parent command -- -Cypress.Commands.add('login', (email, password) => { - console.log('Custom command example: Login', email, password); -}); -// -// -- This is a child command -- -// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/apps/red-ui-app-e2e/src/support/index.ts b/apps/red-ui-app-e2e/src/support/index.ts deleted file mode 100644 index 3d469a6b6..000000000 --- a/apps/red-ui-app-e2e/src/support/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands'; diff --git a/apps/red-ui-app-e2e/tsconfig.e2e.json b/apps/red-ui-app-e2e/tsconfig.e2e.json deleted file mode 100644 index 9dc3660a7..000000000 --- a/apps/red-ui-app-e2e/tsconfig.e2e.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "sourceMap": false, - "outDir": "../../dist/out-tsc", - "allowJs": true, - "types": ["cypress", "node"] - }, - "include": ["src/**/*.ts", "src/**/*.js"] -} diff --git a/apps/red-ui-app-e2e/tsconfig.json b/apps/red-ui-app-e2e/tsconfig.json deleted file mode 100644 index 08841a7f5..000000000 --- a/apps/red-ui-app-e2e/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.e2e.json" - } - ] -} diff --git a/apps/red-ui-app-e2e/tslint.json b/apps/red-ui-app-e2e/tslint.json deleted file mode 100644 index 905c5d5e0..000000000 --- a/apps/red-ui-app-e2e/tslint.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "../../tslint.json", - "linterOptions": { "exclude": ["!**/*"] }, - "rules": {} -} diff --git a/apps/red-ui-app/.browserslistrc b/apps/red-ui/.browserslistrc similarity index 100% rename from apps/red-ui-app/.browserslistrc rename to apps/red-ui/.browserslistrc diff --git a/apps/red-ui-app/jest.config.js b/apps/red-ui/jest.config.js similarity index 89% rename from apps/red-ui-app/jest.config.js rename to apps/red-ui/jest.config.js index 3d5cba90d..c48b0cb26 100644 --- a/apps/red-ui-app/jest.config.js +++ b/apps/red-ui/jest.config.js @@ -1,5 +1,5 @@ module.exports = { - name: 'red-ui-app', + name: 'red-ui', preset: '../../jest.config.js', setupFilesAfterEnv: ['/src/test-setup.ts'], globals: { @@ -12,7 +12,7 @@ module.exports = { ], }, }, - coverageDirectory: '../../coverage/apps/red-ui-app', + coverageDirectory: '../../coverage/apps/red-ui', snapshotSerializers: [ 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', 'jest-preset-angular/build/AngularSnapshotSerializer.js', diff --git a/apps/red-ui-app/src/app/app.component.html b/apps/red-ui/src/app/app.component.html similarity index 100% rename from apps/red-ui-app/src/app/app.component.html rename to apps/red-ui/src/app/app.component.html diff --git a/apps/red-ui-app/src/app/app.component.scss b/apps/red-ui/src/app/app.component.scss similarity index 100% rename from apps/red-ui-app/src/app/app.component.scss rename to apps/red-ui/src/app/app.component.scss diff --git a/apps/red-ui-app/src/app/app.component.spec.ts b/apps/red-ui/src/app/app.component.spec.ts similarity index 87% rename from apps/red-ui-app/src/app/app.component.spec.ts rename to apps/red-ui/src/app/app.component.spec.ts index f99beaa54..3d5eb42e6 100644 --- a/apps/red-ui-app/src/app/app.component.spec.ts +++ b/apps/red-ui/src/app/app.component.spec.ts @@ -16,10 +16,10 @@ describe('AppComponent', () => { expect(app).toBeTruthy(); }); - it(`should have as title 'red-ui-app'`, () => { + it(`should have as title 'red-ui'`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; - expect(app.title).toEqual('red-ui-app'); + expect(app.title).toEqual('red-ui'); }); it('should render title', () => { @@ -27,7 +27,7 @@ describe('AppComponent', () => { fixture.detectChanges(); const compiled = fixture.nativeElement; expect(compiled.querySelector('h1').textContent).toContain( - 'Welcome to red-ui-app!' + 'Welcome to red-ui!' ); }); }); diff --git a/apps/red-ui-app/src/app/app.component.ts b/apps/red-ui/src/app/app.component.ts similarity index 89% rename from apps/red-ui-app/src/app/app.component.ts rename to apps/red-ui/src/app/app.component.ts index 5adad95f9..bc831f09b 100644 --- a/apps/red-ui-app/src/app/app.component.ts +++ b/apps/red-ui/src/app/app.component.ts @@ -6,5 +6,5 @@ import { Component } from '@angular/core'; styleUrls: ['./app.component.scss'], }) export class AppComponent { - title = 'red-ui-app'; + title = 'red-ui'; } diff --git a/apps/red-ui-app/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts similarity index 100% rename from apps/red-ui-app/src/app/app.module.ts rename to apps/red-ui/src/app/app.module.ts diff --git a/apps/red-ui-app/src/assets/.gitkeep b/apps/red-ui/src/assets/.gitkeep similarity index 100% rename from apps/red-ui-app/src/assets/.gitkeep rename to apps/red-ui/src/assets/.gitkeep diff --git a/apps/red-ui-app/src/environments/environment.prod.ts b/apps/red-ui/src/environments/environment.prod.ts similarity index 100% rename from apps/red-ui-app/src/environments/environment.prod.ts rename to apps/red-ui/src/environments/environment.prod.ts diff --git a/apps/red-ui-app/src/environments/environment.ts b/apps/red-ui/src/environments/environment.ts similarity index 100% rename from apps/red-ui-app/src/environments/environment.ts rename to apps/red-ui/src/environments/environment.ts diff --git a/apps/red-ui-app/src/favicon.ico b/apps/red-ui/src/favicon.ico similarity index 100% rename from apps/red-ui-app/src/favicon.ico rename to apps/red-ui/src/favicon.ico diff --git a/apps/red-ui-app/src/index.html b/apps/red-ui/src/index.html similarity index 100% rename from apps/red-ui-app/src/index.html rename to apps/red-ui/src/index.html diff --git a/apps/red-ui-app/src/main.ts b/apps/red-ui/src/main.ts similarity index 100% rename from apps/red-ui-app/src/main.ts rename to apps/red-ui/src/main.ts diff --git a/apps/red-ui-app/src/polyfills.ts b/apps/red-ui/src/polyfills.ts similarity index 100% rename from apps/red-ui-app/src/polyfills.ts rename to apps/red-ui/src/polyfills.ts diff --git a/apps/red-ui-app/src/styles.scss b/apps/red-ui/src/styles.scss similarity index 100% rename from apps/red-ui-app/src/styles.scss rename to apps/red-ui/src/styles.scss diff --git a/apps/red-ui-app/src/test-setup.ts b/apps/red-ui/src/test-setup.ts similarity index 100% rename from apps/red-ui-app/src/test-setup.ts rename to apps/red-ui/src/test-setup.ts diff --git a/apps/red-ui-app/tsconfig.app.json b/apps/red-ui/tsconfig.app.json similarity index 100% rename from apps/red-ui-app/tsconfig.app.json rename to apps/red-ui/tsconfig.app.json diff --git a/apps/red-ui-app/tsconfig.json b/apps/red-ui/tsconfig.json similarity index 100% rename from apps/red-ui-app/tsconfig.json rename to apps/red-ui/tsconfig.json diff --git a/apps/red-ui-app/tsconfig.spec.json b/apps/red-ui/tsconfig.spec.json similarity index 100% rename from apps/red-ui-app/tsconfig.spec.json rename to apps/red-ui/tsconfig.spec.json diff --git a/apps/red-ui-app/tslint.json b/apps/red-ui/tslint.json similarity index 100% rename from apps/red-ui-app/tslint.json rename to apps/red-ui/tslint.json diff --git a/bamboo-specs/src/main/java/buildjob/PlanSpec.java b/bamboo-specs/src/main/java/buildjob/PlanSpec.java index c8e68f01f..a8263ca67 100644 --- a/bamboo-specs/src/main/java/buildjob/PlanSpec.java +++ b/bamboo-specs/src/main/java/buildjob/PlanSpec.java @@ -61,7 +61,7 @@ public class PlanSpec { public Plan createDockerBuildPlan() { return new Plan(project(), "Redaction UI", new BambooKey("UI")) .description("Docker build for Redaction UI.").stages( - new Stage("Build Stage").jobs(creatGinCloudPlatformImagesJob("red-ui-app"))) + new Stage("Build Stage").jobs(creatGinCloudPlatformImagesJob("red-ui"))) .stages(new Stage("Upstream Push Stage").jobs(creatGinCloudPlatformUpstreamJob())) .linkedRepositories("RED / ui").triggers(new BitbucketServerTrigger()).planBranchManagement( new PlanBranchManagement().createForVcsBranch() diff --git a/docker/red-ui-app/Dockerfile b/docker/red-ui/Dockerfile similarity index 84% rename from docker/red-ui-app/Dockerfile rename to docker/red-ui/Dockerfile index d7bc7181b..d4edef844 100644 --- a/docker/red-ui-app/Dockerfile +++ b/docker/red-ui/Dockerfile @@ -15,7 +15,7 @@ COPY . . ## Build the angular app in production mode and store the artifacts in dist folder RUN yarn lint RUN npm version patch --no-git-tag-version -RUN yarn build --prod --project=red-ui-app +RUN yarn build --prod --project=red-ui ### STAGE 2: Setup ### FROM nginx:1.17.6-alpine @@ -27,6 +27,6 @@ COPY docker/common/nginx/default.conf /etc/nginx/conf.d/ RUN rm -rf /usr/share/nginx/html/* ## From ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder -COPY --from=builder /ng-app/dist/apps/red-ui-app /usr/share/nginx/html -COPY docker/red-ui-app/docker-entrypoint.sh / +COPY --from=builder /ng-app/dist/apps/red-ui /usr/share/nginx/html +COPY docker/red-ui/docker-entrypoint.sh / CMD ["/docker-entrypoint.sh"] diff --git a/docker/red-ui-app/docker-entrypoint.sh b/docker/red-ui/docker-entrypoint.sh similarity index 100% rename from docker/red-ui-app/docker-entrypoint.sh rename to docker/red-ui/docker-entrypoint.sh diff --git a/nx.json b/nx.json index e034347f6..044a3bdf8 100644 --- a/nx.json +++ b/nx.json @@ -22,12 +22,8 @@ } }, "projects": { - "red-ui-app": { + "red-ui": { "tags": [] - }, - "red-ui-app-e2e": { - "tags": [], - "implicitDependencies": ["red-ui-app"] } } } diff --git a/workspace.json b/workspace.json index b143b63f2..cec5e6005 100644 --- a/workspace.json +++ b/workspace.json @@ -1,39 +1,39 @@ { "version": 1, "projects": { - "red-ui-app": { + "red-ui": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" } }, - "root": "apps/red-ui-app", - "sourceRoot": "apps/red-ui-app/src", + "root": "apps/red-ui", + "sourceRoot": "apps/red-ui/src", "prefix": "redaction", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "dist/apps/red-ui-app", - "index": "apps/red-ui-app/src/index.html", - "main": "apps/red-ui-app/src/main.ts", - "polyfills": "apps/red-ui-app/src/polyfills.ts", - "tsConfig": "apps/red-ui-app/tsconfig.app.json", + "outputPath": "dist/apps/red-ui", + "index": "apps/red-ui/src/index.html", + "main": "apps/red-ui/src/main.ts", + "polyfills": "apps/red-ui/src/polyfills.ts", + "tsConfig": "apps/red-ui/tsconfig.app.json", "aot": true, "assets": [ - "apps/red-ui-app/src/favicon.ico", - "apps/red-ui-app/src/assets" + "apps/red-ui/src/favicon.ico", + "apps/red-ui/src/assets" ], - "styles": ["apps/red-ui-app/src/styles.scss"], + "styles": ["apps/red-ui/src/styles.scss"], "scripts": [] }, "configurations": { "production": { "fileReplacements": [ { - "replace": "apps/red-ui-app/src/environments/environment.ts", - "with": "apps/red-ui-app/src/environments/environment.prod.ts" + "replace": "apps/red-ui/src/environments/environment.ts", + "with": "apps/red-ui/src/environments/environment.prod.ts" } ], "optimization": true, @@ -62,65 +62,38 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "red-ui-app:build" + "browserTarget": "red-ui:build" }, "configurations": { "production": { - "browserTarget": "red-ui-app:build:production" + "browserTarget": "red-ui:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "red-ui-app:build" + "browserTarget": "red-ui:build" } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ - "apps/red-ui-app/tsconfig.app.json", - "apps/red-ui-app/tsconfig.spec.json" + "apps/red-ui/tsconfig.app.json", + "apps/red-ui/tsconfig.spec.json" ], - "exclude": ["**/node_modules/**", "!apps/red-ui-app/**/*"] + "exclude": ["**/node_modules/**", "!apps/red-ui/**/*"] } }, "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "apps/red-ui-app/jest.config.js", + "jestConfig": "apps/red-ui/jest.config.js", "passWithNoTests": true } } } - }, - "red-ui-app-e2e": { - "root": "apps/red-ui-app-e2e", - "sourceRoot": "apps/red-ui-app-e2e/src", - "projectType": "application", - "architect": { - "e2e": { - "builder": "@nrwl/cypress:cypress", - "options": { - "cypressConfig": "apps/red-ui-app-e2e/cypress.json", - "tsConfig": "apps/red-ui-app-e2e/tsconfig.e2e.json", - "devServerTarget": "red-ui-app:serve" - }, - "configurations": { - "production": { - "devServerTarget": "red-ui-app:serve:production" - } - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": ["apps/red-ui-app-e2e/tsconfig.e2e.json"], - "exclude": ["**/node_modules/**", "!apps/red-ui-app-e2e/**/*"] - } - } - } } }, "cli": { @@ -135,5 +108,5 @@ "unitTestRunner": "jest" } }, - "defaultProject": "red-ui-app" + "defaultProject": "red-ui" }