├── src
├── assets
│ └── .gitkeep
├── app
│ ├── admin
│ │ ├── admin.component.scss
│ │ ├── admin.component.html
│ │ ├── admin.component.ts
│ │ ├── admin.module.ts
│ │ ├── admin-routing.module.ts
│ │ └── admin.component.spec.ts
│ ├── customer
│ │ ├── customer.component.scss
│ │ ├── customer.component.html
│ │ ├── customer.component.ts
│ │ └── customer.component.spec.ts
│ ├── dashboard
│ │ ├── dashboard.component.scss
│ │ ├── dashboard.component.html
│ │ ├── dashboard.component.ts
│ │ └── dashboard.component.spec.ts
│ ├── breadcrumb
│ │ ├── breadcrumb.component.scss
│ │ ├── breadcrumb.component.html
│ │ ├── breadcrumb.component.spec.ts
│ │ └── breadcrumb.component.ts
│ ├── app.component.scss
│ ├── general-data.service.ts
│ ├── search-box
│ │ ├── search-box.directive.ts
│ │ └── search-box.directive.spec.ts
│ ├── app.component.ts
│ ├── general-data.service.spec.ts
│ ├── app-routing.module.ts
│ ├── app.component.spec.ts
│ ├── app.module.ts
│ └── app.component.html
├── favicon.ico
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── typings.d.ts
├── styles.scss
├── tsconfig.app.json
├── index.html
├── main.ts
├── tsconfig.spec.json
├── test.ts
└── polyfills.ts
├── openshift
├── .gitignore
├── templates
│ ├── nginx-runtime
│ │ ├── s2i
│ │ │ └── bin
│ │ │ │ ├── assemble
│ │ │ │ ├── assemble-runtime
│ │ │ │ └── run
│ │ ├── fetch_env.js
│ │ ├── Dockerfile
│ │ ├── nginx-runtime.json
│ │ └── nginx.conf.template
│ ├── angular-builder
│ │ ├── Dockerfile
│ │ └── angular-builder.json
│ ├── angular-app
│ │ └── angular-app.json
│ └── angular-on-nginx
│ │ ├── angular-on-nginx-build.json
│ │ └── angular-on-nginx-deploy.json
├── scripts
│ ├── grantDeploymentPrivileges.sh
│ ├── configureDeployment.sh
│ └── configureBuild.sh
├── initializeProjects.sh
├── generateDeployments.sh
├── generateBuilds.sh
└── README.md
├── e2e
├── tsconfig.e2e.json
├── app.po.ts
└── app.e2e-spec.ts
├── .editorconfig
├── tsconfig.json
├── LICENSE
├── .gitignore
├── protractor.conf.js
├── karma.conf.js
├── .angular-cli.json
├── package.json
├── ACCESSIBILITY.md
├── Jenkinsfile
├── tslint.json
└── README.md
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/admin/admin.component.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/customer/customer.component.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/dashboard/dashboard.component.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/breadcrumb/breadcrumb.component.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/openshift/.gitignore:
--------------------------------------------------------------------------------
1 | *_DeploymentConfig.json
2 | *_BuildConfig.json
3 |
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/angular-scaffold/HEAD/src/favicon.ico
--------------------------------------------------------------------------------
/openshift/templates/nginx-runtime/s2i/bin/assemble:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo no assemble needed
3 |
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/openshift/templates/nginx-runtime/s2i/bin/assemble-runtime:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo no assemble-runtime needed
3 |
--------------------------------------------------------------------------------
/openshift/templates/angular-builder/Dockerfile:
--------------------------------------------------------------------------------
1 | # Get community edition of nodejs v6.x
2 | FROM centos/nodejs-6-centos7
3 |
4 |
--------------------------------------------------------------------------------
/src/app/app.component.scss:
--------------------------------------------------------------------------------
1 | $bootstrap-sass-asset-helper: true;
2 | // @import "~bootstrap-sass/assets/stylesheets/bootstrap";
--------------------------------------------------------------------------------
/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | /* SystemJS module definition */
2 | declare var module: NodeModule;
3 | interface NodeModule {
4 | id: string;
5 | }
6 |
--------------------------------------------------------------------------------
/src/app/customer/customer.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | customer works!
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/app/dashboard/dashboard.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | dashboard works!
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/styles.scss:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 | @import "~mygovbc-bootstrap-theme/dist/mygovbc-bootstrap-theme.min.css";
3 |
--------------------------------------------------------------------------------
/src/app/general-data.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | @Injectable()
4 | export class GeneralDataService {
5 |
6 | constructor() { }
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/src/app/admin/admin.component.html:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/src/app/search-box/search-box.directive.ts:
--------------------------------------------------------------------------------
1 | import { Directive } from '@angular/core';
2 |
3 | @Directive({
4 | selector: '[appSearchBox]'
5 | })
6 | export class SearchBoxDirective {
7 |
8 | constructor() { }
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types":[
8 | "jasmine",
9 | "node"
10 | ]
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/e2e/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, element, by } from 'protractor';
2 |
3 | export class BaseApp2Page {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('app-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/app/breadcrumb/breadcrumb.component.html:
--------------------------------------------------------------------------------
1 |
2 | - Home
3 | -
4 | {{ breadcrumb.label }}
5 |
6 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "module": "es2015",
6 | "baseUrl": "",
7 | "types": []
8 | },
9 | "exclude": [
10 | "test.ts",
11 | "**/*.spec.ts"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/src/app/search-box/search-box.directive.spec.ts:
--------------------------------------------------------------------------------
1 | import { SearchBoxDirective } from './search-box.directive';
2 |
3 | describe('SearchBoxDirective', () => {
4 | it('should create an instance', () => {
5 | const directive = new SearchBoxDirective();
6 | expect(directive).toBeTruthy();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { BreadcrumbComponent } from './breadcrumb/breadcrumb.component';
3 |
4 | @Component({
5 | selector: 'app-root',
6 | templateUrl: './app.component.html',
7 | styleUrls: ['./app.component.scss']
8 | })
9 | export class AppComponent {
10 | title = 'app works!';
11 | }
12 |
--------------------------------------------------------------------------------
/src/app/admin/admin.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-admin',
5 | templateUrl: './admin.component.html',
6 | styleUrls: ['./admin.component.scss']
7 | })
8 | export class AdminComponent implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | My App Title
6 |
7 |
8 |
9 |
10 |
11 |
12 | Loading...
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/app/customer/customer.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-customer',
5 | templateUrl: './customer.component.html',
6 | styleUrls: ['./customer.component.scss']
7 | })
8 | export class CustomerComponent implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/app/dashboard/dashboard.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-dashboard',
5 | templateUrl: './dashboard.component.html',
6 | styleUrls: ['./dashboard.component.scss']
7 | })
8 | export class DashboardComponent implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule);
12 |
--------------------------------------------------------------------------------
/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { BaseApp2Page } from './app.po';
2 |
3 | describe('base-app2 App', () => {
4 | let page: BaseApp2Page;
5 |
6 | beforeEach(() => {
7 | page = new BaseApp2Page();
8 | });
9 |
10 | it('should display message saying app works', () => {
11 | page.navigateTo();
12 | page.getParagraphText().then((value)=> expect(value).toEqual("Theming your app"));
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "baseUrl": "",
8 | "types": [
9 | "jasmine",
10 | "node"
11 | ]
12 | },
13 | "files": [
14 | "test.ts"
15 | ],
16 | "include": [
17 | "**/*.spec.ts",
18 | "**/*.d.ts"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/src/app/admin/admin.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 |
4 | import { AdminRoutingModule } from './admin-routing.module';
5 | import { AdminComponent } from './admin.component';
6 |
7 | @NgModule({
8 | imports: [
9 | CommonModule,
10 | AdminRoutingModule
11 | ],
12 | declarations: [AdminComponent]
13 | })
14 | export class AdminModule { }
15 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 |
6 | export const environment = {
7 | production: false
8 | };
9 |
--------------------------------------------------------------------------------
/src/app/admin/admin-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Routes, RouterModule } from '@angular/router';
3 | import { AdminComponent } from 'app/admin/admin.component';
4 |
5 | const routes: Routes = [
6 | {
7 | path: 'admin',
8 | component: AdminComponent
9 | }
10 | ];
11 |
12 | @NgModule({
13 | imports: [RouterModule, RouterModule.forChild(routes)],
14 | exports: [RouterModule]
15 | })
16 | export class AdminRoutingModule { }
17 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "outDir": "./dist/out-tsc",
5 | "baseUrl": "src",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "moduleResolution": "node",
9 | "emitDecoratorMetadata": true,
10 | "experimentalDecorators": true,
11 | "target": "es5",
12 | "typeRoots": [
13 | "node_modules/@types"
14 | ],
15 | "lib": [
16 | "es2016",
17 | "dom"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/app/general-data.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, inject } from '@angular/core/testing';
2 |
3 | import { GeneralDataService } from './general-data.service';
4 |
5 | describe('GeneralDataService', () => {
6 | beforeEach(() => {
7 | TestBed.configureTestingModule({
8 | providers: [GeneralDataService]
9 | });
10 | });
11 |
12 | it('should ...', inject([GeneralDataService], (service: GeneralDataService) => {
13 | expect(service).toBeTruthy();
14 | }));
15 | });
16 |
--------------------------------------------------------------------------------
/openshift/templates/nginx-runtime/fetch_env.js:
--------------------------------------------------------------------------------
1 | function fetch_config_endpoint(r) {
2 | // CONFIG_ENDPOINT_HOST and CONFIG_ENDPOINT_PORT are names of the
3 | // environment variables injected by kubernetes. The actual values
4 | // of those environment variables contain the IP and port
5 | var endpoint = "http://";
6 | endpoint += process.env[process.env.CONFIG_ENDPOINT_HOST]
7 | endpoint += ":"
8 | endpoint += process.env[process.env.CONFIG_ENDPOINT_PORT];
9 |
10 | return endpoint;
11 | }
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright © 2017, Province of British Columbia, Canada.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/openshift/templates/nginx-runtime/s2i/bin/run:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "---> replacing configuration"
4 | sed "s~%RealIpFrom%~${RealIpFrom:-172.51.0.0/16}~g; s~%IpFilterRules%~${IpFilterRules}~g; s~%AdditionalRealIpFromRules%~${AdditionalRealIpFromRules}~g; s~%HTTP_BASIC%~${HTTP_BASIC}~g" /tmp/nginx.conf.template > /etc/nginx/nginx.conf
5 |
6 | if [ -n "$HTTP_BASIC_USERNAME" ] && [ -n "$HTTP_BASIC_PASSWORD" ]; then
7 | echo "---> Generating .htpasswd file"
8 | `echo "$HTTP_BASIC_USERNAME:$(openssl passwd -crypt $HTTP_BASIC_PASSWORD)" > /tmp/.htpasswd`
9 | fi
10 |
11 | echo "---> starting nginx"
12 | /usr/sbin/nginx -g "daemon off;"
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 |
8 | # dependencies
9 | /node_modules
10 |
11 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | testem.log
34 | /typings
35 |
36 | # e2e
37 | /e2e/*.js
38 | /e2e/*.map
39 |
40 | # System Files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/openshift/templates/nginx-runtime/Dockerfile:
--------------------------------------------------------------------------------
1 | # Use the offical nginx (based on debian)
2 | FROM nginx:mainline
3 |
4 | # Required for HTTP Basic feature
5 | RUN apt-get update && apt-get install openssl
6 |
7 | # Copy our OpenShift s2i scripts over to default location
8 | COPY ./s2i/bin/ /usr/libexec/s2i/
9 |
10 | # Expose this variable to OpenShift
11 | LABEL io.openshift.s2i.scripts-url=image:///usr/libexec/s2i
12 |
13 | # Copy config from source to container
14 | COPY nginx.conf.template /tmp/
15 | COPY fetch_env.js /tmp/
16 |
17 | # Fix up permissions
18 | RUN chmod -R 0777 /tmp /var /etc /mnt /usr/libexec/s2i/ && chmod 0777 /run
19 |
20 | # Nginx runs on port 8080 by default
21 | EXPOSE 8080
22 |
23 | # Switch to usermode
24 | USER 104
25 |
--------------------------------------------------------------------------------
/src/app/customer/customer.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { CustomerComponent } from './customer.component';
4 |
5 | describe('CustomerComponent', () => {
6 | let component: CustomerComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ CustomerComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(CustomerComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/dashboard/dashboard.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { DashboardComponent } from './dashboard.component';
4 |
5 | describe('DashboardComponent', () => {
6 | let component: DashboardComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ DashboardComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(DashboardComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Routes, RouterModule } from '@angular/router';
3 | import { DashboardComponent } from 'app/dashboard/dashboard.component';
4 | import { CustomerComponent } from 'app/customer/customer.component';
5 |
6 | const routes: Routes = [
7 | {
8 | path: '',
9 | children: []
10 | },
11 | {
12 | path: 'dashboard',
13 | component: DashboardComponent,
14 | data: {
15 | breadcrumb: 'Dashboard'
16 | }
17 | },
18 | {
19 | path: 'customer',
20 | component: CustomerComponent,
21 | data: {
22 | breadcrumb: 'Customer'
23 | }
24 |
25 | }
26 | ];
27 |
28 | @NgModule({
29 | imports: [RouterModule.forRoot(routes)],
30 | exports: [RouterModule]
31 | })
32 | export class AppRoutingModule { }
33 |
--------------------------------------------------------------------------------
/src/app/admin/admin.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 | import {
3 | RouterTestingModule
4 | } from '@angular/router/testing';
5 |
6 | import { AdminComponent } from './admin.component';
7 |
8 | describe('AdminComponent', () => {
9 | let component: AdminComponent;
10 | let fixture: ComponentFixture;
11 |
12 | beforeEach(async(() => {
13 | TestBed.configureTestingModule({
14 | declarations: [ AdminComponent ],
15 | imports: [ RouterTestingModule ]
16 | })
17 | .compileComponents();
18 | }));
19 |
20 | beforeEach(() => {
21 | fixture = TestBed.createComponent(AdminComponent);
22 | component = fixture.componentInstance;
23 | fixture.detectChanges();
24 | });
25 |
26 | it('should create', () => {
27 | expect(component).toBeTruthy();
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './e2e/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | beforeLaunch: function() {
23 | require('ts-node').register({
24 | project: 'e2e/tsconfig.e2e.json'
25 | });
26 | },
27 | onPrepare() {
28 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/src/app/breadcrumb/breadcrumb.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 | import {
3 | RouterTestingModule
4 | } from '@angular/router/testing';
5 | import { RouterLink, RouterLinkWithHref } from '@angular/router';
6 |
7 | import { BreadcrumbComponent } from './breadcrumb.component';
8 |
9 | describe('BreadcrumbComponent', () => {
10 | let component: BreadcrumbComponent;
11 | let fixture: ComponentFixture;
12 |
13 | beforeEach(async(() => {
14 | TestBed.configureTestingModule({
15 | declarations: [ BreadcrumbComponent ],
16 | imports: [ RouterTestingModule ]
17 | })
18 | .compileComponents();
19 |
20 |
21 | }));
22 |
23 | beforeEach(() => {
24 | fixture = TestBed.createComponent(BreadcrumbComponent);
25 | component = fixture.componentInstance;
26 | fixture.detectChanges();
27 | });
28 |
29 | it('should be created', () => {
30 | expect(component).toBeTruthy();
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import {
3 | RouterTestingModule
4 | } from '@angular/router/testing';
5 |
6 | import { AppComponent } from './app.component';
7 | import { BreadcrumbComponent } from './breadcrumb/breadcrumb.component';
8 |
9 | describe('AppComponent', () => {
10 | beforeEach(async(() => {
11 | TestBed.configureTestingModule({
12 | declarations: [
13 | AppComponent,
14 | BreadcrumbComponent
15 | ],
16 | imports: [ RouterTestingModule ]
17 | }).compileComponents();
18 | }));
19 |
20 | it('should create the app', async(() => {
21 | const fixture = TestBed.createComponent(AppComponent);
22 | const app = fixture.debugElement.componentInstance;
23 | expect(app).toBeTruthy();
24 | }));
25 |
26 | it('should render title in a span tag', async(() => {
27 | const fixture = TestBed.createComponent(AppComponent);
28 | fixture.detectChanges();
29 | const compiled = fixture.debugElement.nativeElement;
30 | expect(compiled.querySelector('span.title').textContent).toContain('Put your title here');
31 | }));
32 | });
33 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/long-stack-trace-zone';
4 | import 'zone.js/dist/proxy.js';
5 | import 'zone.js/dist/sync-test';
6 | import 'zone.js/dist/jasmine-patch';
7 | import 'zone.js/dist/async-test';
8 | import 'zone.js/dist/fake-async-test';
9 | import { getTestBed } from '@angular/core/testing';
10 | import {
11 | BrowserDynamicTestingModule,
12 | platformBrowserDynamicTesting
13 | } from '@angular/platform-browser-dynamic/testing';
14 |
15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
16 | declare var __karma__: any;
17 | declare var require: any;
18 |
19 | // Prevent Karma from running prematurely.
20 | __karma__.loaded = function () {};
21 |
22 | // First, initialize the Angular testing environment.
23 | getTestBed().initTestEnvironment(
24 | BrowserDynamicTestingModule,
25 | platformBrowserDynamicTesting()
26 | );
27 | // Then we find all the tests.
28 | const context = require.context('./', true, /\.spec\.ts$/);
29 | // And load the modules.
30 | context.keys().map(context);
31 | // Finally, start Karma to run the tests.
32 | __karma__.start();
33 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 | import { FormsModule } from '@angular/forms';
4 | import { HttpModule } from '@angular/http';
5 | import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
6 | import { AppRoutingModule } from './app-routing.module';
7 |
8 | import { AppComponent } from './app.component';
9 | import { CustomerComponent } from './customer/customer.component';
10 | import { SearchBoxDirective } from './search-box/search-box.directive';
11 | import { GeneralDataService } from 'app/general-data.service';
12 | import { DashboardComponent } from './dashboard/dashboard.component';
13 | import { AdminModule } from 'app/admin/admin.module';
14 | import { BreadcrumbComponent } from './breadcrumb/breadcrumb.component';
15 |
16 | @NgModule({
17 | declarations: [
18 | AppComponent,
19 | CustomerComponent,
20 | SearchBoxDirective,
21 | DashboardComponent,
22 | BreadcrumbComponent
23 | ],
24 | imports: [
25 | BrowserModule,
26 | FormsModule,
27 | HttpModule,
28 | AppRoutingModule,
29 | NgbModule,
30 | AdminModule,
31 | ],
32 | providers: [GeneralDataService],
33 | bootstrap: [AppComponent]
34 | })
35 | export class AppModule { }
36 |
--------------------------------------------------------------------------------
/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/0.13/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular/cli'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular/cli/plugins/karma')
14 | ],
15 | client:{
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | files: [
19 | { pattern: './src/test.ts', watched: false }
20 | ],
21 | preprocessors: {
22 | './src/test.ts': ['@angular/cli']
23 | },
24 | mime: {
25 | 'text/x-typescript': ['ts','tsx']
26 | },
27 | coverageIstanbulReporter: {
28 | reports: [ 'html', 'lcovonly' ],
29 | fixWebpackSourcePaths: true
30 | },
31 | angularCli: {
32 | environment: 'dev'
33 | },
34 | reporters: config.angularCli && config.angularCli.codeCoverage
35 | ? ['progress', 'coverage-istanbul']
36 | : ['progress', 'kjhtml'],
37 | port: 9876,
38 | colors: true,
39 | logLevel: config.LOG_INFO,
40 | autoWatch: true,
41 | browsers: ['ChromeHeadless'],
42 | singleRun: false
43 | });
44 | };
45 |
--------------------------------------------------------------------------------
/.angular-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "project": {
4 | "name": "base-app2"
5 | },
6 | "apps": [
7 | {
8 | "root": "src",
9 | "outDir": "dist",
10 | "assets": [
11 | "assets",
12 | "favicon.ico"
13 | ],
14 | "index": "index.html",
15 | "main": "main.ts",
16 | "polyfills": "polyfills.ts",
17 | "test": "test.ts",
18 | "tsconfig": "tsconfig.app.json",
19 | "testTsconfig": "tsconfig.spec.json",
20 | "prefix": "app",
21 | "styles": [
22 | "styles.scss"
23 | ],
24 | "scripts": [],
25 | "environmentSource": "environments/environment.ts",
26 | "environments": {
27 | "dev": "environments/environment.ts",
28 | "prod": "environments/environment.prod.ts"
29 | }
30 | }
31 | ],
32 | "e2e": {
33 | "protractor": {
34 | "config": "./protractor.conf.js"
35 | }
36 | },
37 | "lint": [
38 | {
39 | "project": "src/tsconfig.app.json"
40 | },
41 | {
42 | "project": "src/tsconfig.spec.json"
43 | },
44 | {
45 | "project": "e2e/tsconfig.e2e.json"
46 | }
47 | ],
48 | "test": {
49 | "karma": {
50 | "config": "./karma.conf.js"
51 | }
52 | },
53 | "defaults": {
54 | "styleExt": "scss",
55 | "component": {},
56 | "serve": {
57 | "port": 4300
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "myappname",
3 | "version": "0.0.0",
4 | "license": "Apache-2.0",
5 | "scripts": {
6 | "ng": "ng",
7 | "start": "ng serve -o",
8 | "build": "ng build --prod",
9 | "test": "ng test",
10 | "lint": "ng lint",
11 | "e2e": "ng e2e",
12 | "postinstall": "ng build --prod"
13 | },
14 | "private": true,
15 | "dependencies": {
16 | "@angular/common": "^4.4.2",
17 | "@angular/compiler": "^4.4.2",
18 | "@angular/compiler-cli": "^4.4.2",
19 | "@angular/core": "^4.4.2",
20 | "@angular/forms": "^4.4.2",
21 | "@angular/http": "^4.4.2",
22 | "@angular/platform-browser": "^4.4.2",
23 | "@angular/platform-browser-dynamic": "^4.4.2",
24 | "@angular/router": "^4.4.2",
25 | "@ng-bootstrap/ng-bootstrap": "v1.0.0-beta.6",
26 | "core-js": "^2.5.1",
27 | "mygovbc-bootstrap-theme": "^0.4.1",
28 | "rxjs": "^5.4.3",
29 | "typescript": "2.3.x",
30 | "zone.js": "^0.8.17"
31 | },
32 | "devDependencies": {
33 | "@angular/cli": "1.7.0",
34 | "@types/jasmine": "^2.6.0",
35 | "@types/node": "^8.0.28",
36 | "ajv": "^5.2.2",
37 | "codelyzer": "^3.2.0",
38 | "jasmine-core": "^2.8.0",
39 | "jasmine-spec-reporter": "^4.2.1",
40 | "karma": "^1.7.1",
41 | "karma-chrome-launcher": "~2.2.0",
42 | "karma-cli": "~1.0.1",
43 | "karma-coverage-istanbul-reporter": "^1.3.0",
44 | "karma-jasmine": "~1.1.0",
45 | "karma-jasmine-html-reporter": "^0.2.2",
46 | "ngx-bootstrap": "^1.9.3",
47 | "protractor": "~5.1.0",
48 | "ts-node": "^3.3.0",
49 | "tslint": "^5.7.0"
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/openshift/scripts/grantDeploymentPrivileges.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | USER_ID="$(id -u)"
4 | SCRIPT_DIR=$(dirname $0)
5 |
6 | # ===================================================================================
7 | # Granting deployment configurations access to the images in the tools project
8 | # ===================================================================================
9 | TARGET_PROJECT_NAME=${1}
10 | TOOLS_PROJECT_NAME=${2}
11 | # -----------------------------------------------------------------------------------
12 | #DEBUG_MESSAGES=1
13 | # -----------------------------------------------------------------------------------
14 | if [ -z "$TARGET_PROJECT_NAME" ]; then
15 | echo "You must supply TARGET_PROJECT_NAME."
16 | MissingParam=1
17 | fi
18 |
19 | if [ -z "$TOOLS_PROJECT_NAME" ]; then
20 | echo "You must supply TOOLS_PROJECT_NAME."
21 | MissingParam=1
22 | fi
23 |
24 | if [ ! -z "$MissingParam" ]; then
25 | echo "============================================"
26 | echo "One or more parameters are missing!"
27 | echo "--------------------------------------------"
28 | echo "TARGET_PROJECT_NAME[{1}]: ${1}"
29 | echo "TOOLS_PROJECT_NAME[{2}]: ${2}"
30 | echo "============================================"
31 | echo
32 | exit 1
33 | fi
34 | # ===================================================================================
35 |
36 | echo "Granting deployment configuration access from ${TARGET_PROJECT_NAME}, to ${TOOLS_PROJECT_NAME} ..."
37 |
38 | if [ ! -z "$DEBUG_MESSAGES" ]; then
39 | echo
40 | echo "------------------------------------------------------------------------"
41 | echo "Parameters for call to oc command ..."
42 | echo "------------------------------------------------------------------------"
43 | echo "TARGET_PROJECT_NAME=${TARGET_PROJECT_NAME}"
44 | echo "TOOLS_PROJECT_NAME=${TOOLS_PROJECT_NAME}"
45 | echo "------------------------------------------------------------------------"
46 | echo
47 | fi
48 |
49 | oc policy add-role-to-user \
50 | system:image-puller \
51 | system:serviceaccount:${TARGET_PROJECT_NAME}:default \
52 | -n ${TOOLS_PROJECT_NAME}
53 | echo
54 |
--------------------------------------------------------------------------------
/ACCESSIBILITY.md:
--------------------------------------------------------------------------------
1 | # Accessibility
2 |
3 | This applications aims to meet or exceed the [World Wide Web Consortium (W3C) Web Content Accessibility Guidelines (WCAG) 2.0](https://www.w3.org/TR/WCAG20/).
4 |
5 | ## Tested Assistive Technologies
6 |
7 | The following technologies are recommended to be tested with this application, chosen because of their popularity and coverage using data from http://webaim.org/projects/screenreadersurvey6/:
8 |
9 | 1. JAWS IE 11 on Windows 10
10 | 2. NVDA Firefox (evergreen) on Windows 10
11 | 3. VoiceOver on Mac OS (should get iOS coverage)
12 |
13 | ## General Advice
14 |
15 | 1. Use native HTML5 elements/attributes where possible, e.g., `