├── .browserslistrc ├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .huskyrc.js ├── .prettierignore ├── LICENSE ├── README.md ├── angular.json ├── commitlint.config.js ├── config.js.default ├── cypress.env.json ├── cypress.json ├── cypress ├── fixtures │ └── login.json ├── integration │ └── example.spec.ts ├── plugins │ ├── cy-ts-preprocessor.js │ └── index.js ├── support │ ├── commands.js │ └── index.js └── tsconfig.json ├── docker ├── nginx │ ├── Dockerfile │ ├── default.conf │ ├── docker-start.sh │ ├── mime.types │ └── nginx.conf └── nodejs │ ├── Dockerfile │ ├── docker-start.sh │ ├── package.json │ └── server.js ├── karma.conf.js ├── package-lock.json ├── package.json ├── prettier.config.js ├── proxy.conf.js ├── public └── .npmignore ├── src ├── assets │ ├── i18n │ │ └── en.json │ ├── ico │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── apple-icon-precomposed.png │ │ ├── apple-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── favicon.ico │ │ ├── favicon_16x16.ico │ │ ├── favicon_32x32.ico │ │ ├── favicon_512x512.svg │ │ ├── manifest.json │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ └── ms-icon-70x70.png │ └── icons │ │ ├── covalent.svg │ │ ├── teradata-dark.svg │ │ ├── teradata-icon.svg │ │ ├── teradata-solid.svg │ │ └── teradata.svg ├── lib │ ├── core │ │ ├── core.module.ts │ │ └── index.ts │ └── utils │ │ └── translate.ts ├── polyfills.ts ├── theme.scss ├── typings.d.ts └── vantage-ui-template │ ├── app │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routes.ts │ ├── dashboard │ │ ├── dashboard.component.html │ │ ├── dashboard.component.scss │ │ ├── dashboard.component.spec.ts │ │ └── dashboard.component.ts │ ├── index.ts │ └── main │ │ ├── main.component.html │ │ ├── main.component.scss │ │ └── main.component.ts │ ├── config.js │ ├── config │ └── api.config.ts │ ├── environments │ ├── environment.prod.ts │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ └── tsconfig.spec.json ├── stylelint.config.js ├── tsconfig.json └── tslint.json /.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-10 12 | IE 11 -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | ### What's included? 4 | 5 | - What was implemented 6 | - Why it was implemented this way 7 | 8 | #### Test Steps 9 | 10 | - [ ] `npm ci` 11 | - [ ] `npm run serve` 12 | - [ ] Login and test this view 13 | 14 | #### Definition of Done 15 | 16 | - [ ] Adheres to [Covalent](https://teradata.github.io/covalent/), [Angular-Material](https://material.angular.io/) & [Material Design](https://material.io/guidelines/) patterns 17 | - [ ] All user-facing strings are properly stored in `/src/assets/i18n/en-US.json` 18 | - [ ] Changes are a11y compliant 19 | - [ ] Responsiveness is handled 20 | - [ ] `npm run lint` passes (runs tslint, stylelint, prettier) 21 | - [ ] `npm run test` (unit tests) 22 | - [ ] `npm run e2e` (e2e tests) 23 | - [ ] `npm run build:prod` (AOT, product build test) 24 | 25 | ##### Animated Gif 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /deploy 6 | /tmp 7 | 8 | # dependencies 9 | /node_modules 10 | /bower_components 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 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 | /.vagrant 36 | 37 | #System Files 38 | .DS_Store 39 | Thumbs.db 40 | 41 | # cypress 42 | cypress/videos/ 43 | cypress/screenshots/ 44 | -------------------------------------------------------------------------------- /.huskyrc.js: -------------------------------------------------------------------------------- 1 | const { covalentHooks, generateHuskyConfig } = require('./node_modules/@covalent/coding-standards/husky/husky.js'); 2 | const huskyHooks = generateHuskyConfig(covalentHooks()); 3 | module.exports = huskyHooks; 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | yarn.lock 4 | /bin 5 | /deploy 6 | /coverage 7 | /dist 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 by Teradata. All rights reserved. http://teradata.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Teradata Vantage UI Template 2 | 3 | ###### Create Apps for Teradata Vantage using the Covalent UI Framework 4 | 5 | --- 6 | 7 | ### Setup 8 | 9 | - Ensure you have **Node 10.15.3** (on a Mac use Homebrew and `brew install node@10.15.3`) 10 | - Ensure you have **NPM 6+** installed. 11 | - Install Docker Engine: [https://docs.docker.com/engine/installation/](https://docs.docker.com/engine/installation/) 12 | - Install Angular CLI `npm i -g @angular/cli` 13 | - Install Typescript `npm i -g typescript` 14 | - Install TSLint `npm i -g tslint` 15 | - Install Node packages `npm ci` 16 | 17 | ### Development 18 | 19 | 1. Update the `serverUrl` variable in the `proxy.conf.js` and `loginUrl` variable in the `cypress.env.json` to point to your vantage environment. 20 | 21 | 2. Run local webserver `npm run serve` 22 | 23 | 3. In Chrome go to [http://localhost:4200](http://localhost:4200) 24 | 25 | ### Build Container Image 26 | 27 | 1. Clean up the `deploy` directory. 28 | 29 | Mac: 30 | 31 | ```bash 32 | rm -rf ./deploy/ 33 | mkdir ./deploy/ 34 | ``` 35 | 36 | Win: 37 | 38 | ```bash 39 | rmdir /S .\deploy\ 40 | mkdir .\deploy\ 41 | ``` 42 | 43 | 2. Build Angular assets 44 | 45 | ```bash 46 | npm run build:prod 47 | ``` 48 | 49 | 3. Move assets into `deploy` directory. 50 | 51 | Mac: 52 | 53 | ``` 54 | cp -r ./docker/* ./deploy 55 | cp -r ./dist/* ./deploy 56 | ``` 57 | 58 | Win: 59 | 60 | ``` 61 | copy .\docker\* .\deploy 62 | copy .\dist\* .\deploy 63 | ``` 64 | 65 | 4. Build docker image with assets 66 | - Replace `WEB_SERVER` with `nodejs` or `nginx` depending on your need 67 | - Replace `IMAGE_NAME` with a name of your choice 68 | 69 | Mac: 70 | 71 | ```bash 72 | docker build -f deploy/WEB_SERVER/Dockerfile -t IMAGE_NAME ./deploy 73 | ``` 74 | 75 | Win: 76 | 77 | ```bash 78 | docker build -f deploy\WEB_SERVER\Dockerfile -t IMAGE_NAME .\deploy 79 | ``` 80 | 81 | 4. Run command `docker images` and see it listed 82 | 83 | 5. You can run commands locally now like: 84 | - Replace `YOUR_BASE_URL` with your Vantage Environment Base URL 85 | - Replace `IMAGE_NAME` with the image name you used on step 3. 86 | 87 | ```bash 88 | docker run -e APPCENTER_BASE_URL=YOUR_BASE_URL -p 49160:8080 -d IMAGE_NAME 89 | 90 | docker exec -it CONTAINER_ID /bin/bash 91 | ``` 92 | 93 | ### Deployment to Registry 94 | 95 | 1. Tag docker image and push to a repository 96 | - Replace `IMAGE_NAME` with the image name you used when building the image. 97 | - Replace `TAG` with a tag for the image. e.g. Version number 98 | - Replace `REPOSITORY` with the URL of the repository where you need to push the image. 99 | 100 | ```bash 101 | docker tag IMAGE_NAME:latest REPOSITORY/IMAGE_NAME:TAG 102 | docker push REPOSITORY/IMAGE_NAME:TAG 103 | ``` 104 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "vantage-ui-template": { 7 | "projectType": "application", 8 | "schematics": { 9 | "@schematics/angular:component": { 10 | "style": "scss" 11 | } 12 | }, 13 | "root": "", 14 | "sourceRoot": "src", 15 | "architect": { 16 | "build": { 17 | "builder": "@angular-builders/custom-webpack:browser", 18 | "options": { 19 | "indexTransform": "node_modules/@td-vantage/ui-platform/utilities/pre-loader", 20 | "outputPath": "dist", 21 | "index": "src/vantage-ui-template/index.html", 22 | "main": "src/vantage-ui-template/main.ts", 23 | "tsConfig": "src/vantage-ui-template/tsconfig.app.json", 24 | "polyfills": "src/polyfills.ts", 25 | "aot": false, 26 | "assets": [ 27 | "src/assets", 28 | { 29 | "glob": "config.js", 30 | "input": "src/vantage-ui-template/", 31 | "output": "/" 32 | }, 33 | { 34 | "glob": "favicon.ico", 35 | "input": "src/vantage-ui-template/", 36 | "output": "/" 37 | } 38 | ], 39 | "styles": ["src/theme.scss", "src/vantage-ui-template/styles.scss"], 40 | "scripts": ["node_modules/hammerjs/hammer.min.js"] 41 | }, 42 | "configurations": { 43 | "production": { 44 | "optimization": true, 45 | "outputHashing": "all", 46 | "sourceMap": false, 47 | "extractCss": true, 48 | "namedChunks": false, 49 | "aot": true, 50 | "extractLicenses": true, 51 | "vendorChunk": false, 52 | "buildOptimizer": true, 53 | "fileReplacements": [ 54 | { 55 | "replace": "src/vantage-ui-template/environments/environment.ts", 56 | "with": "src/vantage-ui-template/environments/environment.prod.ts" 57 | } 58 | ], 59 | "budgets": [ 60 | { 61 | "type": "initial", 62 | "maximumWarning": "2mb", 63 | "maximumError": "5mb" 64 | } 65 | ] 66 | } 67 | } 68 | }, 69 | "serve": { 70 | "builder": "@angular-builders/custom-webpack:dev-server", 71 | "options": { 72 | "browserTarget": "vantage-ui-template:build", 73 | "proxyConfig": "./proxy.conf.js" 74 | }, 75 | "configurations": { 76 | "production": { 77 | "browserTarget": "vantage-ui-template:build:production", 78 | "proxyConfig": "./proxy.conf.js" 79 | } 80 | } 81 | }, 82 | "extract-i18n": { 83 | "builder": "@angular-devkit/build-angular:extract-i18n", 84 | "options": { 85 | "browserTarget": "vantage-ui-template:build" 86 | } 87 | }, 88 | "test": { 89 | "builder": "@angular-devkit/build-angular:karma", 90 | "options": { 91 | "main": "src/vantage-ui-template/test.ts", 92 | "karmaConfig": "./karma.conf.js", 93 | "polyfills": "src/polyfills.ts", 94 | "tsConfig": "src/vantage-ui-template/tsconfig.spec.json", 95 | "scripts": ["node_modules/hammerjs/hammer.min.js"], 96 | "styles": ["src/theme.scss", "src/vantage-ui-template/styles.scss"], 97 | "assets": [ 98 | "src/assets", 99 | { 100 | "glob": "config.js", 101 | "input": "src/vantage-ui-template/", 102 | "output": "/" 103 | }, 104 | { 105 | "glob": "favicon.ico", 106 | "input": "src/vantage-ui-template/", 107 | "output": "/" 108 | } 109 | ] 110 | } 111 | }, 112 | "lint": { 113 | "builder": "@angular-devkit/build-angular:tslint", 114 | "options": { 115 | "tsConfig": ["src/vantage-ui-template/tsconfig.app.json", "src/vantage-ui-template/tsconfig.spec.json"], 116 | "exclude": ["**/node_modules/**"] 117 | } 118 | }, 119 | "e2e": { 120 | "builder": "@nrwl/cypress:cypress", 121 | "options": { 122 | "devServerTarget": "vantage-ui-template:serve", 123 | "cypressConfig": "./cypress.json", 124 | "tsConfig": "./tsconfig.json", 125 | "browser": "electron", 126 | "headless": true 127 | }, 128 | "configurations": { 129 | "production": { 130 | "devServerTarget": "vantage-ui-template:serve:production" 131 | } 132 | } 133 | } 134 | } 135 | } 136 | }, 137 | "defaultProject": "vantage-ui-template", 138 | "schematics": { 139 | "@schematics/angular:component": { 140 | "prefix": "app", 141 | "styleext": "scss" 142 | }, 143 | "@schematics/angular:directive": { 144 | "prefix": "app" 145 | } 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | var defaultConfig = require('./node_modules/@covalent/coding-standards/commitlint/commitlint.config.js'); 2 | module.exports = defaultConfig; 3 | -------------------------------------------------------------------------------- /config.js.default: -------------------------------------------------------------------------------- 1 | var config = { 2 | VANTAGE_URL: 'https://vantage.url.io', 3 | }; -------------------------------------------------------------------------------- /cypress.env.json: -------------------------------------------------------------------------------- 1 | { 2 | "loginUrl": "https://vantage.url.io" 3 | } 4 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "http://localhost:4200/", 3 | "chromeWebSecurity": false, 4 | "defaultCommandTimeout": 10000, 5 | "integrationFolder": "./cypress/integration/" 6 | } 7 | -------------------------------------------------------------------------------- /cypress/fixtures/login.json: -------------------------------------------------------------------------------- 1 | { 2 | "username": "username", 3 | "password": "password" 4 | } 5 | -------------------------------------------------------------------------------- /cypress/integration/example.spec.ts: -------------------------------------------------------------------------------- 1 | import { login, logout, ILoginCredentials, waitForAngular } from '@td-vantage/ui-platform/testing/cypress'; 2 | const LOGIN_FIXTURE: string = 'login'; 3 | 4 | describe('Example test', () => { 5 | before(() => { 6 | cy.fixture(LOGIN_FIXTURE).then((credentials: ILoginCredentials) => { 7 | login(credentials); 8 | }); 9 | }); 10 | 11 | it('Should verify app loads', () => { 12 | waitForAngular(); 13 | cy.get('body').contains('TEST CONTENT'); 14 | }); 15 | 16 | after(() => { 17 | logout(); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /cypress/plugins/cy-ts-preprocessor.js: -------------------------------------------------------------------------------- 1 | const wp = require('@cypress/webpack-preprocessor'); 2 | 3 | const webpackOptions = { 4 | resolve: { 5 | extensions: ['.ts', '.js'], 6 | }, 7 | module: { 8 | rules: [ 9 | { 10 | test: /\.ts$/, 11 | exclude: [/node_modules/], 12 | use: [ 13 | { 14 | loader: 'ts-loader', 15 | }, 16 | ], 17 | }, 18 | ], 19 | }, 20 | }; 21 | 22 | const options = { 23 | webpackOptions, 24 | }; 25 | 26 | module.exports = wp(options); 27 | -------------------------------------------------------------------------------- /cypress/plugins/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example plugins/index.js can be used to load plugins 3 | // 4 | // You can change the location of this file or turn off loading 5 | // the plugins file with the 'pluginsFile' configuration option. 6 | // 7 | // You can read more here: 8 | // https://on.cypress.io/plugins-guide 9 | // *********************************************************** 10 | 11 | // This function is called when a project is opened or re-opened (e.g. due to 12 | // the project's config changing) 13 | 14 | const cypressTypeScriptPreprocessor = require('./cy-ts-preprocessor'); 15 | 16 | module.exports = (on) => { 17 | on('file:preprocessor', cypressTypeScriptPreprocessor); 18 | }; 19 | -------------------------------------------------------------------------------- /cypress/support/commands.js: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add("login", (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This is will overwrite an existing command -- 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /cypress/support/index.js: -------------------------------------------------------------------------------- 1 | import { whiteListSSOCookies } from '@td-vantage/ui-platform/testing/cypress'; 2 | 3 | // *********************************************************** 4 | // This example support/index.js is processed and 5 | // loaded automatically before your test files. 6 | // 7 | // This is a great place to put global configuration and 8 | // behavior that modifies Cypress. 9 | // 10 | // You can change the location of this file or turn off 11 | // automatically serving support files with the 12 | // 'supportFile' configuration option. 13 | // 14 | // You can read more here: 15 | // https://on.cypress.io/configuration 16 | // *********************************************************** 17 | 18 | // Import commands.js using ES2015 syntax: 19 | import './commands'; 20 | whiteListSSOCookies(); 21 | // Alternatively you can use CommonJS syntax: 22 | // require('./commands') 23 | -------------------------------------------------------------------------------- /cypress/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "include": ["integration/**/*.ts", "support/**/*.ts", "../node_modules/cypress"] 4 | } 5 | -------------------------------------------------------------------------------- /docker/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.2 2 | RUN apk update 3 | RUN apk add bash 4 | RUN apk add nginx 5 | RUN rm -rf /var/cache/apk/* 6 | COPY * /usr/share/nginx/html/ 7 | COPY assets/ /usr/share/nginx/html/assets/ 8 | COPY nginx/default.conf /etc/nginx/conf.d/ 9 | COPY nginx/nginx.conf /etc/nginx/ 10 | COPY nginx/mime.types /etc/nginx/ 11 | COPY nginx/docker-start.sh / 12 | 13 | EXPOSE 8080 14 | VOLUME ["/usr/share/nginx/html"] 15 | 16 | CMD ["/docker-start.sh"] 17 | -------------------------------------------------------------------------------- /docker/nginx/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8080; 3 | server_name localhost; 4 | 5 | #charset koi8-r; 6 | #access_log /var/log/nginx/log/host.access.log main; 7 | 8 | root /usr/share/nginx/html; 9 | index /index.html; 10 | client_max_body_size 20M; 11 | 12 | location ~/api/ { 13 | proxy_pass VANTAGEBASEURL; 14 | } 15 | 16 | location / { 17 | try_files $uri $uri/ /index.html; 18 | } 19 | 20 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 21 | expires 365d; 22 | add_header Cache-Control "public"; 23 | } 24 | 25 | 26 | error_page 500 /error/500.html; 27 | } 28 | -------------------------------------------------------------------------------- /docker/nginx/docker-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Only start container if all ENV vars are provided 4 | [ -z "$APPCENTER_BASE_URL" ] && echo "Need to set APPCENTER_BASE_URL" && exit 1; 5 | 6 | contextPath="/" 7 | 8 | # If APP_CONTEXT_PATH is empty, we default it to `/` 9 | if [[ "$APP_CONTEXT_PATH" ]]; 10 | then 11 | if [[ "$APP_CONTEXT_PATH" != "/" ]]; 12 | then 13 | contextPath="$APP_CONTEXT_PATH/" 14 | fi 15 | fi 16 | 17 | # Add a config file from env 18 | cat < /usr/share/nginx/html/config.js 19 | var config = { 20 | VANTAGE_URL: '$APPCENTER_BASE_URL', 21 | }; 22 | EOF 23 | # Replace href before deploying 24 | sed -i -e "s|||g" /usr/share/nginx/html/index.html 25 | # Filter the BaseURL into nginx.conf 26 | sed -i -e "s|VANTAGEBASEURL|$APPCENTER_BASE_URL|g" /etc/nginx/conf.d/default.conf 27 | 28 | # Start nginx 29 | echo "Starting nginx..." 30 | nginx -g "daemon off;" 31 | -------------------------------------------------------------------------------- /docker/nginx/mime.types: -------------------------------------------------------------------------------- 1 | types { 2 | 3 | # Data interchange 4 | 5 | application/atom+xml atom; 6 | application/json json map topojson; 7 | application/ld+json jsonld; 8 | application/rss+xml rss; 9 | application/vnd.geo+json geojson; 10 | application/xml rdf xml; 11 | 12 | 13 | # JavaScript 14 | 15 | # Normalize to standard type. 16 | # https://tools.ietf.org/html/rfc4329#section-7.2 17 | application/javascript js; 18 | 19 | 20 | # Manifest files 21 | 22 | application/manifest+json webmanifest; 23 | application/x-web-app-manifest+json webapp; 24 | text/cache-manifest appcache; 25 | 26 | 27 | # Media files 28 | 29 | audio/midi mid midi kar; 30 | audio/mp4 aac f4a f4b m4a; 31 | audio/mpeg mp3; 32 | audio/ogg oga ogg opus; 33 | audio/x-realaudio ra; 34 | audio/x-wav wav; 35 | image/bmp bmp; 36 | image/gif gif; 37 | image/jpeg jpeg jpg; 38 | image/png png; 39 | image/svg+xml svg svgz; 40 | image/tiff tif tiff; 41 | image/vnd.wap.wbmp wbmp; 42 | image/webp webp; 43 | image/x-jng jng; 44 | video/3gpp 3gp 3gpp; 45 | video/mp4 f4p f4v m4v mp4; 46 | video/mpeg mpeg mpg; 47 | video/ogg ogv; 48 | video/quicktime mov; 49 | video/webm webm; 50 | video/x-flv flv; 51 | video/x-mng mng; 52 | video/x-ms-asf asf asx; 53 | video/x-ms-wmv wmv; 54 | video/x-msvideo avi; 55 | 56 | # Serving `.ico` image files with a different media type 57 | # prevents Internet Explorer from displaying then as images: 58 | # https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee 59 | 60 | image/x-icon cur ico; 61 | 62 | 63 | # Microsoft Office 64 | 65 | application/msword doc; 66 | application/vnd.ms-excel xls; 67 | application/vnd.ms-powerpoint ppt; 68 | application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; 69 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; 70 | application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; 71 | 72 | 73 | # Web fonts 74 | 75 | application/font-woff woff; 76 | application/font-woff2 woff2; 77 | application/vnd.ms-fontobject eot; 78 | 79 | # Browsers usually ignore the font media types and simply sniff 80 | # the bytes to figure out the font type. 81 | # https://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern 82 | # 83 | # However, Blink and WebKit based browsers will show a warning 84 | # in the console if the following font types are served with any 85 | # other media types. 86 | 87 | application/x-font-ttf ttc ttf; 88 | font/opentype otf; 89 | 90 | 91 | # Other 92 | 93 | application/java-archive ear jar war; 94 | application/mac-binhex40 hqx; 95 | application/octet-stream bin deb dll dmg exe img iso msi msm msp safariextz; 96 | application/pdf pdf; 97 | application/postscript ai eps ps; 98 | application/rtf rtf; 99 | application/vnd.google-earth.kml+xml kml; 100 | application/vnd.google-earth.kmz kmz; 101 | application/vnd.wap.wmlc wmlc; 102 | application/x-7z-compressed 7z; 103 | application/x-bb-appworld bbaw; 104 | application/x-bittorrent torrent; 105 | application/x-chrome-extension crx; 106 | application/x-cocoa cco; 107 | application/x-java-archive-diff jardiff; 108 | application/x-java-jnlp-file jnlp; 109 | application/x-makeself run; 110 | application/x-opera-extension oex; 111 | application/x-perl pl pm; 112 | application/x-pilot pdb prc; 113 | application/x-rar-compressed rar; 114 | application/x-redhat-package-manager rpm; 115 | application/x-sea sea; 116 | application/x-shockwave-flash swf; 117 | application/x-stuffit sit; 118 | application/x-tcl tcl tk; 119 | application/x-x509-ca-cert crt der pem; 120 | application/x-xpinstall xpi; 121 | application/xhtml+xml xhtml; 122 | application/xslt+xml xsl; 123 | application/zip zip; 124 | text/css css; 125 | text/html htm html shtml; 126 | text/mathml mml; 127 | text/plain txt; 128 | text/vcard vcard vcf; 129 | text/vnd.rim.location.xloc xloc; 130 | text/vnd.sun.j2me.app-descriptor jad; 131 | text/vnd.wap.wml wml; 132 | text/vtt vtt; 133 | text/x-component htc; 134 | 135 | } 136 | -------------------------------------------------------------------------------- /docker/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes 1; 2 | 3 | events { 4 | worker_connections 1024; 5 | } 6 | 7 | http { 8 | client_max_body_size 20M; 9 | sendfile on; 10 | keepalive_timeout 65; 11 | server_tokens off; 12 | include /etc/nginx/mime.types; 13 | include /etc/nginx/conf.d/default.conf; 14 | 15 | gzip on; 16 | gzip_http_version 1.0; 17 | gzip_comp_level 2; 18 | gzip_min_length 1100; 19 | gzip_buffers 4 8k; 20 | gzip_proxied any; 21 | gzip_types 22 | # text/html is always compressed by HttpGzipModule 23 | text/css 24 | text/javascript 25 | text/xml 26 | text/plain 27 | text/x-component 28 | application/javascript 29 | application/json 30 | application/xml 31 | application/rss+xml 32 | font/truetype 33 | font/opentype 34 | application/vnd.ms-fontobject 35 | image/svg+xml; 36 | 37 | gzip_static on; 38 | 39 | gzip_proxied expired no-cache no-store private auth; 40 | gzip_disable "MSIE [1-6]\."; 41 | gzip_vary on; 42 | } 43 | -------------------------------------------------------------------------------- /docker/nodejs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:carbon 2 | 3 | # Create app directory 4 | WORKDIR /usr/share/app 5 | 6 | # Install app dependencies 7 | COPY nodejs/package.json . 8 | COPY nodejs/docker-start.sh / 9 | # For npm@5 or later, copy package-lock.json as well 10 | # COPY package.json package-lock.json . 11 | 12 | RUN npm ci 13 | 14 | # Bundle app source 15 | COPY nodejs/server.js . 16 | COPY . . 17 | 18 | EXPOSE 8080 19 | CMD ["/docker-start.sh"] 20 | -------------------------------------------------------------------------------- /docker/nodejs/docker-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Only start container if all ENV vars are provided 4 | [ -z "$APPCENTER_BASE_URL" ] && echo "Need to set APPCENTER_BASE_URL" && exit 1; 5 | 6 | contextPath="/" 7 | 8 | # If APP_CONTEXT_PATH is empty, we default it to `/` 9 | if [[ "$APP_CONTEXT_PATH" ]]; 10 | then 11 | if [[ "$APP_CONTEXT_PATH" != "/" ]]; 12 | then 13 | contextPath="$APP_CONTEXT_PATH/" 14 | fi 15 | fi 16 | 17 | # Add a config file from env 18 | cat < /usr/share/app/config.js 19 | var config = { 20 | VANTAGE_URL: '$APPCENTER_BASE_URL', 21 | }; 22 | EOF 23 | # Replace href before deploying 24 | sed -i -e "s|||g" /usr/share/app/index.html 25 | # Start nodejs 26 | echo "Starting nodejs..." 27 | npm --prefix /usr/share/app start 28 | -------------------------------------------------------------------------------- /docker/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "covalent-nodejs-docker-app", 3 | "version": "1.0.0", 4 | "description": "Covalent running in Node.js on Docker", 5 | "license": "MIT", 6 | "author": "Teradata UI", 7 | "main": "server.js", 8 | "scripts": { 9 | "start": "node server.js" 10 | }, 11 | "dependencies": { 12 | "express": "^4.13.3", 13 | "request": "2.81.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /docker/nodejs/server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const express = require('express'); 4 | const request = require('request'); 5 | 6 | // Constants 7 | // port that will be running inside the docker 8 | // use this number when deploying app 9 | const PORT = 8080; 10 | const HOST = '0.0.0.0'; 11 | // Base Url env variable set by Vantage backend 12 | const redirectServer = process.env.APPCENTER_BASE_URL; 13 | 14 | // App 15 | const app = express(); 16 | 17 | // proxy to the webservice requests 18 | app.all('/api/*', function(req, res) { 19 | // the url to the service endpoints 20 | // for self signed certificates used in vantage develop using the rejectUnauthorized: false 21 | // probably shouldn't do this in production 22 | var url = redirectServer + req.url; 23 | req 24 | .pipe( 25 | request({ 26 | url, 27 | agentOptions: { 28 | rejectUnauthorized: false, 29 | }, 30 | }), 31 | ) 32 | .pipe(res); 33 | }); 34 | 35 | // serve up the Covalent files 36 | app.use(express.static(__dirname + '/')); 37 | 38 | app.use('/*', function(req, res) { 39 | res.sendFile(__dirname + '/index.html'); 40 | }); 41 | 42 | app.use(function(req, res) { 43 | res.status(404); 44 | res.render('404', { layout: false, title: '404: File Not Found' }); 45 | }); 46 | 47 | app.listen(PORT, HOST); 48 | console.log(`Running on http://${HOST}:${PORT}`); 49 | -------------------------------------------------------------------------------- /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-devkit/build-angular'], 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-devkit/build-angular/plugins/karma'), 14 | ], 15 | client: { 16 | clearContext: false, // leave Jasmine Spec Runner output visible in browser 17 | jasmine: { 18 | random: false, 19 | stopOnFailure: true, 20 | }, 21 | }, 22 | customLaunchers: { 23 | ChromeCustom: { 24 | base: 'ChromeHeadless', 25 | flags: ['--no-sandbox'], 26 | }, 27 | }, 28 | files: [ 29 | { pattern: './config.js.default' }, 30 | { pattern: './node_modules/hammerjs/hammer.min.js' }, 31 | { pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, watched: true }, 32 | ], 33 | preprocessors: {}, 34 | mime: { 35 | 'text/x-typescript': ['ts', 'tsx'], 36 | }, 37 | coverageIstanbulReporter: { 38 | dir: require('path').join(__dirname, 'coverage'), 39 | reports: ['html', 'lcovonly', 'cobertura'], 40 | reports: ['html', 'lcovonly', 'text-summary'], 41 | fixWebpackSourcePaths: true, 42 | }, 43 | angularCli: { 44 | environment: 'dev', 45 | }, 46 | reporters: 47 | config.angularCli && config.angularCli.codeCoverage ? ['progress', 'coverage-istanbul'] : ['progress', 'kjhtml'], 48 | port: 9876, 49 | colors: true, 50 | logLevel: config.LOG_INFO, 51 | autoWatch: true, 52 | browsers: ['ChromeCustom'], 53 | singleRun: false, 54 | browserNoActivityTimeout: 90000, 55 | browserDisconnectTolerance: 10, 56 | }); 57 | }; 58 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vantage-ui-template", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Vantage UI Template with Covalent + Vantage UI Platform", 6 | "keywords": [ 7 | "vantage", 8 | "template", 9 | "ui" 10 | ], 11 | "scripts": { 12 | "cypress:open": "cypress open", 13 | "cypress:run": "cypress run", 14 | "e2e": "node --max_old_space_size=8192 ./node_modules/.bin/ng e2e --prod", 15 | "serve": "./node_modules/.bin/ng serve", 16 | "serve:dhc": "npm run serve -- --host 0.0.0.0 --disable-host-check", 17 | "serve:prod": "node --max_old_space_size=8192 ./node_modules/.bin/ng serve --aot --prod --sourceMap=false --optimization", 18 | "lint": "npm run tslint && npm run stylelint && npm run prettier:check", 19 | "tslint": "ng lint --format codeFrame", 20 | "stylelint": "./node_modules/.bin/stylelint 'src/**/*.scss' '!**/assets/**' --config stylelint.config.js --syntax scss", 21 | "test": "./node_modules/.bin/ng test --code-coverage --source-map=false --watch=false", 22 | "build:prod": "rm -rf ./dist && node --max_old_space_size=8192 ./node_modules/.bin/ng build --aot --prod --sourceMap=false --optimization", 23 | "prettier": "./node_modules/.bin/prettier --write './**/*.{ts,js,json,css,scss,yml,html,md}'", 24 | "prettier:check": "./node_modules/.bin/prettier --check './**/*.{ts,js,json,css,scss,yml,html,md}'" 25 | }, 26 | "engines": { 27 | "node": ">=10.15.3", 28 | "npm": ">=6" 29 | }, 30 | "repository": { 31 | "type": "git", 32 | "url": "https://github.com/Teradata/vantage-ui-template" 33 | }, 34 | "bugs": { 35 | "url": "https://github.com/Teradata/vantage-ui-template/issues" 36 | }, 37 | "license": "MIT", 38 | "author": "Teradata UI", 39 | "dependencies": { 40 | "@angular/animations": "^9.0.5", 41 | "@angular/cdk": "^9.1.1", 42 | "@angular/common": "^9.0.5", 43 | "@angular/compiler": "^9.0.5", 44 | "@angular/core": "^9.0.5", 45 | "@angular/forms": "^9.0.5", 46 | "@angular/material": "^9.1.1", 47 | "@angular/platform-browser": "^9.0.5", 48 | "@angular/platform-browser-dynamic": "^9.0.5", 49 | "@angular/platform-server": "^9.0.5", 50 | "@angular/router": "^9.0.5", 51 | "@covalent/core": "^3.0.0", 52 | "@covalent/echarts": "^3.0.0", 53 | "@covalent/highlight": "^3.0.0", 54 | "@covalent/http": "^3.0.0", 55 | "@ngx-translate/core": "^12.1.2", 56 | "@ngx-translate/http-loader": "^4.0.0", 57 | "@td-vantage/ui-platform": "1.0.0-beta.1", 58 | "core-js": "^2.6.11", 59 | "echarts": "^4.6.0", 60 | "hammerjs": "^2.0.8", 61 | "rxjs": "^6.5.4", 62 | "tslib": "^1.11.1", 63 | "web-animations-js": "^2.3.2", 64 | "zone.js": "^0.10.2" 65 | }, 66 | "devDependencies": { 67 | "@angular-builders/custom-webpack": "^9.0.0", 68 | "@angular-devkit/build-angular": "^0.900.5", 69 | "@angular/cli": "^9.0.5", 70 | "@angular/compiler-cli": "^9.0.5", 71 | "@covalent/coding-standards": "^3.0.0", 72 | "@cypress/webpack-preprocessor": "^4.1.3", 73 | "@nrwl/cypress": "^9.0.4", 74 | "@nrwl/workspace": "^9.0.4", 75 | "@types/hammerjs": "^2.0.36", 76 | "@types/jasmine": "^3.5.8", 77 | "@types/jasminewd2": "^2.0.8", 78 | "@types/node": "^13.9.0", 79 | "cypress": "^4.1.0", 80 | "jasmine-core": "^3.5.0", 81 | "karma": "^4.4.1", 82 | "karma-chrome-launcher": "^3.1.0", 83 | "karma-coverage-istanbul-reporter": "^2.1.1", 84 | "karma-jasmine": "^3.1.1", 85 | "karma-jasmine-html-reporter": "^1.5.2", 86 | "karma-spec-reporter": "^0.0.32", 87 | "ts-loader": "^6.2.1", 88 | "ts-node": "^8.6.2", 89 | "typescript": "~3.7.5" 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | var defaultConfig = require('./node_modules/@covalent/coding-standards/prettier/prettier.config.js'); 2 | module.exports = defaultConfig; 3 | -------------------------------------------------------------------------------- /proxy.conf.js: -------------------------------------------------------------------------------- 1 | const vantageLoginProxyConfig = require('@td-vantage/ui-platform/auth/config/vantageLoginProxyConfig'); 2 | 3 | /* * * * * * * * * * * */ 4 | /* Edit these variables to point to your */ 5 | /* Vantage and local development environments */ 6 | /* * * * * * * * * * * */ 7 | 8 | const serverUrl = undefined; // Replace with Vantage base url. Ex: https://vantage.url.io 9 | const localUrl = 'localhost:4200'; 10 | const localProto = 'http'; // http or https 11 | 12 | if (!serverUrl) { 13 | throw Error('Update the serverUrl variable in the proxy.conf.js to point to your vantage env.'); 14 | } 15 | 16 | /* * * * * * * * * * * */ 17 | /* This section contains the routes proxied through */ 18 | /* your local development environment and the Vantage deployment */ 19 | /* * * * * * * * * * * */ 20 | 21 | const PROXY_CONFIG = { 22 | ...vantageLoginProxyConfig({ serverUrl, localUrl, localProto }), 23 | '/api': { 24 | target: serverUrl, 25 | secure: false, 26 | changeOrigin: true, 27 | }, 28 | }; 29 | 30 | module.exports = PROXY_CONFIG; 31 | -------------------------------------------------------------------------------- /public/.npmignore: -------------------------------------------------------------------------------- 1 | # compiled aot output 2 | *.ngsummary.json 3 | *.ngfactory.ts 4 | *.shim.ngstyle.ts -------------------------------------------------------------------------------- /src/assets/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "APP_TITLE": "UI Template", 3 | "DASHBOARD": "Dashboard", 4 | "SIGN_OUT": "Sign Out", 5 | "DARK_MODE": "Dark Mode", 6 | "LIGHT_MODE": "Light Mode" 7 | } 8 | -------------------------------------------------------------------------------- /src/assets/ico/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/android-icon-144x144.png -------------------------------------------------------------------------------- /src/assets/ico/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/android-icon-192x192.png -------------------------------------------------------------------------------- /src/assets/ico/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/android-icon-36x36.png -------------------------------------------------------------------------------- /src/assets/ico/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/android-icon-48x48.png -------------------------------------------------------------------------------- /src/assets/ico/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/android-icon-72x72.png -------------------------------------------------------------------------------- /src/assets/ico/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/android-icon-96x96.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-114x114.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-120x120.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-144x144.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-152x152.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-180x180.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-57x57.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-60x60.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-72x72.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-76x76.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon-precomposed.png -------------------------------------------------------------------------------- /src/assets/ico/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/apple-icon.png -------------------------------------------------------------------------------- /src/assets/ico/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /src/assets/ico/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/favicon-16x16.png -------------------------------------------------------------------------------- /src/assets/ico/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/favicon-32x32.png -------------------------------------------------------------------------------- /src/assets/ico/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/favicon-96x96.png -------------------------------------------------------------------------------- /src/assets/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/favicon.ico -------------------------------------------------------------------------------- /src/assets/ico/favicon_16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/favicon_16x16.ico -------------------------------------------------------------------------------- /src/assets/ico/favicon_32x32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/favicon_32x32.ico -------------------------------------------------------------------------------- /src/assets/ico/favicon_512x512.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 12 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/assets/ico/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /src/assets/ico/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/ms-icon-144x144.png -------------------------------------------------------------------------------- /src/assets/ico/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/ms-icon-150x150.png -------------------------------------------------------------------------------- /src/assets/ico/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/ms-icon-310x310.png -------------------------------------------------------------------------------- /src/assets/ico/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/assets/ico/ms-icon-70x70.png -------------------------------------------------------------------------------- /src/assets/icons/covalent.svg: -------------------------------------------------------------------------------- 1 | 2 | covalent 2 3 | Created using Figma 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/assets/icons/teradata-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Teradata 4 | Copyright Teradata 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/assets/icons/teradata-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Teradata 4 | Copyright Teradata 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/assets/icons/teradata-solid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Teradata 4 | Copyright Teradata 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/assets/icons/teradata.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Teradata 4 | Copyright Teradata 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/lib/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | @NgModule({ 4 | declarations: [], 5 | imports: [], 6 | exports: [], 7 | }) 8 | export class CoreModule {} 9 | -------------------------------------------------------------------------------- /src/lib/core/index.ts: -------------------------------------------------------------------------------- 1 | export * from './core.module'; 2 | -------------------------------------------------------------------------------- /src/lib/utils/translate.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | 3 | import { TranslateService, TranslateLoader } from '@ngx-translate/core'; 4 | import { TranslateHttpLoader } from '@ngx-translate/http-loader'; 5 | 6 | export const TRANSLATE_STORAGE_KEY: string = 'ngx-translate-lang'; 7 | export const SUPPORTED_LANGS: string[] = ['en']; 8 | /** 9 | * Utility method to get selected language from sessionStorage or browser 10 | */ 11 | export function getSelectedLanguage(translateService: TranslateService): string { 12 | const storedLanguage: string = sessionStorage.getItem(TRANSLATE_STORAGE_KEY); 13 | // Check if the language has been stored else if the language wasnt stored, then use browser default if supported 14 | if (storedLanguage && translateService.getLangs().indexOf(storedLanguage) > -1) { 15 | return storedLanguage; 16 | } else if (translateService.getLangs().indexOf(translateService.getBrowserLang()) > -1) { 17 | return translateService.getBrowserLang(); 18 | } 19 | // If everything fails, then use default lang 20 | return translateService.getDefaultLang(); 21 | } 22 | 23 | export function getSelectedLocale(translateService: TranslateService): string { 24 | return translateService.getBrowserCultureLang(); 25 | } 26 | 27 | /** 28 | * Crate custom TranslateLoader since we have a diff dir structure for our json files 29 | */ 30 | export function createTranslateLoader(httpClient: HttpClient): TranslateLoader { 31 | return new TranslateHttpLoader(httpClient, 'assets/i18n/', '.json'); 32 | } 33 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /** Required for Covalent Http */ 56 | import 'core-js/es7/reflect'; 57 | 58 | /*************************************************************************************************** 59 | * Zone JS is required by default for Angular itself. 60 | */ 61 | import 'zone.js/dist/zone'; // Included with Angular CLI. 62 | 63 | /*************************************************************************************************** 64 | * APPLICATION IMPORTS 65 | */ 66 | -------------------------------------------------------------------------------- /src/theme.scss: -------------------------------------------------------------------------------- 1 | @import '~@angular/material/theming'; 2 | @import '~@covalent/core/theming/all-theme'; 3 | @import '~@covalent/highlight/highlight-theme'; 4 | 5 | // Plus imports for other components in your app. 6 | 7 | // Custom typography 8 | $custom-typography: mat-typography-config( 9 | $button: mat-typography-level(14px, 14px, 400), 10 | $font-family: 'Arial, Helvetica, sans-serif', 11 | ); 12 | 13 | // Include the base styles for Angular Material core. We include this here so that you only 14 | // have to load a single css file for Angular Material in your app. 15 | @include mat-core($custom-typography); 16 | 17 | @import '~@td-vantage/ui-platform/theming'; 18 | 19 | // Include the core styles for Covalent 20 | @include covalent-core(); 21 | 22 | // Include material-icons 23 | @import '../node_modules/@covalent/core/common/material-icons.css'; 24 | 25 | // Include covalent utility classes 26 | @include covalent-utilities(); 27 | 28 | // Include flex layout classes 29 | @include covalent-layout(); 30 | 31 | // Include covalent color classes 32 | @include covalent-colors(); 33 | 34 | // Create the theme object (a Sass map containing all of the palettes). 35 | $theme: mat-light-theme($td-primary, $td-accent, $td-warn); 36 | 37 | // Include theme styles for core and each component used in your app. 38 | // Alternatively, you can import and @include the theme mixins for each component 39 | // that you are using. 40 | @include angular-material-theme($theme); 41 | @include covalent-theme($theme); 42 | @include covalent-highlight-theme(); 43 | // Include Teradata brand 44 | @include teradata-brand($theme); 45 | 46 | /* ------------------------------------- DARK THEME ------------------------------------------ */ 47 | 48 | .dark-theme { 49 | $dark-theme: mat-dark-theme($td-dark-primary, $td-dark-accent, $td-dark-warn); 50 | 51 | @include angular-material-theme($dark-theme); 52 | @include covalent-theme($dark-theme); 53 | // Include Teradata brand 54 | @include teradata-brand($dark-theme); 55 | 56 | [class^='tc-grey-'], 57 | [class*=' tc-grey-'] { 58 | color: white !important; 59 | } 60 | .mat-focused:not(.mat-form-field-invalid) .mat-form-field-placeholder { 61 | color: mat-color($td-dark-primary, lighter); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | // Typings reference file, see links for more information 2 | // https://github.com/typings/typings 3 | // https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html 4 | 5 | declare var System: any; 6 | declare var require: any; 7 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/vantage-ui-template/app/app.component.scss -------------------------------------------------------------------------------- /src/vantage-ui-template/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async, ComponentFixture } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | imports: [RouterTestingModule], 9 | declarations: [AppComponent], 10 | }).compileComponents(); 11 | })); 12 | 13 | it('should create the app', () => { 14 | const fixture: ComponentFixture = TestBed.createComponent(AppComponent); 15 | const app: AppComponent = fixture.debugElement.componentInstance; 16 | expect(app).toBeTruthy(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { DomSanitizer } from '@angular/platform-browser'; 3 | import { MatIconRegistry } from '@angular/material/icon'; 4 | 5 | @Component({ 6 | selector: 'td-app', 7 | templateUrl: './app.component.html', 8 | styleUrls: ['./app.component.scss'], 9 | }) 10 | export class AppComponent { 11 | constructor(private _iconRegistry: MatIconRegistry, private _domSanitizer: DomSanitizer) { 12 | // SVG Icons 13 | this._iconRegistry.addSvgIcon( 14 | 'teradata', 15 | this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/teradata.svg'), 16 | ); 17 | this._iconRegistry.addSvgIcon( 18 | 'teradata-dark', 19 | this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/teradata-dark.svg'), 20 | ); 21 | this._iconRegistry.addSvgIcon( 22 | 'teradata-solid', 23 | this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/teradata-solid.svg'), 24 | ); 25 | this._iconRegistry.addSvgIcon( 26 | 'teradata-icon', 27 | this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/teradata-icon.svg'), 28 | ); 29 | this._iconRegistry.addSvgIcon( 30 | 'covalent', 31 | this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/covalent.svg'), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, Type } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 4 | import { CommonModule } from '@angular/common'; 5 | import { HttpClientModule, HttpClientXsrfModule } from '@angular/common/http'; 6 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 7 | import { MatButtonModule } from '@angular/material/button'; 8 | import { MatListModule } from '@angular/material/list'; 9 | import { MatIconModule } from '@angular/material/icon'; 10 | import { MatCardModule } from '@angular/material/card'; 11 | import { MatMenuModule } from '@angular/material/menu'; 12 | import { MatInputModule } from '@angular/material/input'; 13 | import { MatSelectModule } from '@angular/material/select'; 14 | import { MatDialogModule } from '@angular/material/dialog'; 15 | import { MatSnackBarModule } from '@angular/material/snack-bar'; 16 | import { MatToolbarModule } from '@angular/material/toolbar'; 17 | import { MatTabsModule } from '@angular/material/tabs'; 18 | import { MatSidenavModule } from '@angular/material/sidenav'; 19 | import { MatTooltipModule } from '@angular/material/tooltip'; 20 | import { CovalentCommonModule } from '@covalent/core/common'; 21 | import { CovalentLayoutModule } from '@covalent/core/layout'; 22 | import { CovalentMediaModule } from '@covalent/core/media'; 23 | import { CovalentLoadingModule } from '@covalent/core/loading'; 24 | import { CovalentDialogsModule } from '@covalent/core/dialogs'; 25 | import { CovalentHttpModule, ITdHttpInterceptor } from '@covalent/http'; 26 | import { CovalentBaseEchartsModule } from '@covalent/echarts/base'; 27 | import { VantageUserModule } from '@td-vantage/ui-platform/user'; 28 | import { VantageSystemModule } from '@td-vantage/ui-platform/system'; 29 | import { VantageAuthenticationModule, VantageAuthenticationInterceptor } from '@td-vantage/ui-platform/auth'; 30 | import { VantageUserFeedbackModule } from '@td-vantage/ui-platform/utilities'; 31 | import { AppComponent } from './app.component'; 32 | import { appRoutes, appRoutingProviders } from './app.routes'; 33 | import { TranslateModule, TranslateService } from '@ngx-translate/core'; 34 | import { getSelectedLanguage, SUPPORTED_LANGS } from '@shared/utils/translate'; 35 | import { MainComponent } from './main/main.component'; 36 | import { DashboardComponent } from './dashboard/dashboard.component'; 37 | import { CovalentNavLinksModule } from '@covalent/core/nav-links'; 38 | import { VantageThemeModule } from '@td-vantage/ui-platform/theme'; 39 | 40 | const httpInterceptorProviders: Type[] = [VantageAuthenticationInterceptor]; 41 | 42 | @NgModule({ 43 | // directives, components, and pipes owned by this NgModule 44 | declarations: [AppComponent, MainComponent, DashboardComponent], 45 | imports: [ 46 | appRoutes, 47 | // Angular Modules 48 | HttpClientModule, 49 | HttpClientXsrfModule.withOptions(), 50 | FormsModule, 51 | ReactiveFormsModule, 52 | CommonModule, 53 | BrowserModule, 54 | BrowserAnimationsModule, 55 | // Material Modules 56 | MatButtonModule, 57 | MatListModule, 58 | MatIconModule, 59 | MatCardModule, 60 | MatMenuModule, 61 | MatInputModule, 62 | MatSelectModule, 63 | MatDialogModule, 64 | MatSnackBarModule, 65 | MatToolbarModule, 66 | MatTabsModule, 67 | MatSidenavModule, 68 | MatTooltipModule, 69 | // Vantage UI Platform 70 | VantageAuthenticationModule, 71 | VantageUserModule, 72 | VantageSystemModule, 73 | VantageUserFeedbackModule, 74 | VantageThemeModule, 75 | // Covalent Modules 76 | CovalentCommonModule, 77 | CovalentLayoutModule, 78 | CovalentMediaModule, 79 | CovalentDialogsModule, 80 | CovalentLoadingModule, 81 | CovalentBaseEchartsModule, 82 | CovalentNavLinksModule, 83 | TranslateModule.forRoot(), 84 | CovalentHttpModule.forRoot({ 85 | interceptors: [ 86 | { 87 | interceptor: VantageAuthenticationInterceptor, 88 | paths: ['**'], 89 | }, 90 | ], 91 | }), 92 | ], 93 | // additional providers needed for this module 94 | providers: [appRoutingProviders, httpInterceptorProviders], 95 | bootstrap: [AppComponent], 96 | }) 97 | export class AppModule { 98 | constructor(translateService: TranslateService) { 99 | // set the default language 100 | translateService.setDefaultLang('en'); 101 | translateService.addLangs(SUPPORTED_LANGS); 102 | 103 | // Get selected language and load it 104 | const selectedLanguage: string = getSelectedLanguage(translateService); 105 | 106 | // using require here so can avoid making an http request ajax to get the language files 107 | // this prevents the language keys from flashing on the screen for a second before the actual 108 | // language files are loaded 109 | 110 | /* tslint:disable-next-line */ 111 | const data: any = require('../../assets/i18n/' + selectedLanguage + '.json'); 112 | translateService.setTranslation(selectedLanguage, data, false); 113 | translateService.use(selectedLanguage); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes, RouterModule } from '@angular/router'; 2 | import { MainComponent } from './main/main.component'; 3 | import { DashboardComponent } from './dashboard/dashboard.component'; 4 | import { VantageAuthenticationGuard } from '@td-vantage/ui-platform/auth'; 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', 9 | component: MainComponent, 10 | canActivate: [VantageAuthenticationGuard], 11 | children: [{ path: '', component: DashboardComponent }], 12 | }, 13 | { path: '**', redirectTo: '/' }, 14 | ]; 15 | 16 | export const appRoutingProviders: any[] = [VantageAuthenticationGuard]; 17 | 18 | export const appRoutes: any = RouterModule.forRoot(routes); 19 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/dashboard/dashboard.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | dashboard 5 | {{ 'DASHBOARD' | translate }} 6 | 7 |
8 |
9 |
10 | 11 |
12 |
13 | TEST CONTENT 14 |
15 |
16 |
17 |
18 |
19 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/dashboard/dashboard.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/vantage-ui-template/app/dashboard/dashboard.component.scss -------------------------------------------------------------------------------- /src/vantage-ui-template/app/dashboard/dashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async, ComponentFixture } from '@angular/core/testing'; 2 | import { CommonModule } from '@angular/common'; 3 | import { NoopAnimationsModule } from '@angular/platform-browser/animations'; 4 | 5 | import { CovalentMediaModule } from '@covalent/core/media'; 6 | import { MatDialogModule } from '@angular/material/dialog'; 7 | import { MatIconModule } from '@angular/material/icon'; 8 | import { MatToolbarModule } from '@angular/material/toolbar'; 9 | 10 | import { CovalentHttpModule } from '@covalent/http'; 11 | import { CovalentLoadingModule } from '@covalent/core/loading'; 12 | import { CovalentDialogsModule } from '@covalent/core/dialogs'; 13 | 14 | import { VantageSystemModule } from '@td-vantage/ui-platform/system'; 15 | import { VantageUserFeedbackModule } from '@td-vantage/ui-platform/utilities'; 16 | import { TranslateModule } from '@ngx-translate/core'; 17 | import { DashboardComponent } from './dashboard.component'; 18 | 19 | describe('Dashboard Component', () => { 20 | let fixture: ComponentFixture; 21 | let comp: DashboardComponent; 22 | 23 | beforeEach(async(() => { 24 | TestBed.configureTestingModule({ 25 | imports: [ 26 | CommonModule, 27 | NoopAnimationsModule, 28 | MatDialogModule, 29 | MatIconModule, 30 | MatToolbarModule, 31 | TranslateModule.forRoot(), 32 | CovalentMediaModule, 33 | CovalentHttpModule.forRoot(), 34 | CovalentLoadingModule, 35 | CovalentDialogsModule, 36 | VantageUserFeedbackModule, 37 | VantageSystemModule, 38 | ], 39 | declarations: [DashboardComponent], 40 | }) 41 | .compileComponents() 42 | .then(() => { 43 | fixture = TestBed.createComponent(DashboardComponent); 44 | comp = fixture.componentInstance; 45 | }); 46 | })); 47 | 48 | it('checks if component was instantiated', async(() => { 49 | fixture.detectChanges(); 50 | expect(comp).toBeTruthy(); 51 | })); 52 | }); 53 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { TdLoadingService } from '@covalent/core/loading'; 3 | import { VantageErrorService } from '@td-vantage/ui-platform/utilities'; 4 | import { VantageSystemService, ISystem } from '@td-vantage/ui-platform/system'; 5 | import { forkJoin } from 'rxjs'; 6 | 7 | @Component({ 8 | selector: 'td-dashboard', 9 | templateUrl: './dashboard.component.html', 10 | styleUrls: ['./dashboard.component.scss'], 11 | }) 12 | export class DashboardComponent implements OnInit { 13 | systems: ISystem[]; 14 | 15 | constructor( 16 | private _systemService: VantageSystemService, 17 | private _loadingService: TdLoadingService, 18 | private _errorService: VantageErrorService, 19 | ) {} 20 | 21 | async ngOnInit(): Promise { 22 | this._loadingService.register('overview.dashboard'); 23 | try { 24 | await forkJoin([this.loadSystems()]).toPromise(); 25 | } catch (error) { 26 | this._errorService.open(error); 27 | } 28 | this._loadingService.resolve('overview.dashboard'); 29 | } 30 | 31 | async loadSystems(): Promise { 32 | const response: { data: ISystem[] } = await this._systemService.query().toPromise(); 33 | this.systems = response.data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/index.ts: -------------------------------------------------------------------------------- 1 | export { AppModule } from './app.module'; 2 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/main/main.component.html: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | exit_to_app 13 | {{ 'SIGN_OUT' | translate }} 14 | 15 | 16 | 17 | 20 | 21 | 24 |
25 | 26 | 31 | 32 | 38 | 39 |
40 | 41 |
42 |
43 | -------------------------------------------------------------------------------- /src/vantage-ui-template/app/main/main.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/vantage-ui-template/app/main/main.component.scss -------------------------------------------------------------------------------- /src/vantage-ui-template/app/main/main.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { VantageThemeService } from '@td-vantage/ui-platform/theme'; 3 | import { IUser } from '@td-vantage/ui-platform/user'; 4 | 5 | import { VantageSessionService } from '@td-vantage/ui-platform/auth'; 6 | import { ITdLink } from '@covalent/core/nav-links'; 7 | 8 | @Component({ 9 | selector: 'td-main', 10 | templateUrl: './main.component.html', 11 | styleUrls: ['./main.component.scss'], 12 | }) 13 | export class MainComponent implements OnInit { 14 | // Logged in user 15 | user: IUser; 16 | 17 | // Sidenav routes 18 | links: ITdLink[] = [ 19 | { 20 | label: 'Dashboard', 21 | link: { 22 | routerLink: '/', 23 | }, 24 | icon: { 25 | name: 'dashboard', 26 | }, 27 | show: true, 28 | }, 29 | ]; 30 | 31 | constructor(private _vantageSessionService: VantageSessionService, public _themeService: VantageThemeService) {} 32 | 33 | ngOnInit(): void { 34 | this.user = this._vantageSessionService.user; 35 | } 36 | 37 | logout(): void { 38 | this.user = undefined; 39 | this._vantageSessionService.logout(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/vantage-ui-template/config.js: -------------------------------------------------------------------------------- 1 | var config = { 2 | VANTAGE_URL: 'https://vantage.url.io', 3 | }; 4 | -------------------------------------------------------------------------------- /src/vantage-ui-template/config/api.config.ts: -------------------------------------------------------------------------------- 1 | declare var config: any; 2 | 3 | export const VANTAGE_URL: string = config.VANTAGE_URL; 4 | -------------------------------------------------------------------------------- /src/vantage-ui-template/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment: { production: boolean } = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /src/vantage-ui-template/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: { production: boolean } = { 7 | production: false, 8 | }; 9 | -------------------------------------------------------------------------------- /src/vantage-ui-template/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/vantage-ui-template/favicon.ico -------------------------------------------------------------------------------- /src/vantage-ui-template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Teradata 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/vantage-ui-template/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | import { enableProdMode } from '@angular/core'; 3 | import { environment } from './environments/environment'; 4 | import { AppModule } from './app'; 5 | 6 | if (environment.production) { 7 | enableProdMode(); 8 | } 9 | 10 | platformBrowserDynamic().bootstrapModule(AppModule); 11 | -------------------------------------------------------------------------------- /src/vantage-ui-template/styles.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Teradata/vantage-ui-template/15b1122cbf955f34f54c7d9d8024bc5dd915f1b4/src/vantage-ui-template/styles.scss -------------------------------------------------------------------------------- /src/vantage-ui-template/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/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; 6 | 7 | declare const require: any; 8 | 9 | // First, initialize the Angular testing environment. 10 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); 11 | // Then we find all the tests. 12 | const context: any = require.context('./', true, /\.spec\.ts$/); 13 | // And load the modules. 14 | context.keys().map(context); 15 | -------------------------------------------------------------------------------- /src/vantage-ui-template/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "outDir": "../../out-tsc/app", 6 | "types": ["hammerjs"], 7 | "paths": { 8 | "@shared/*": ["../lib/*"] 9 | } 10 | }, 11 | "files": ["../polyfills.ts", "../typings.d.ts", "main.ts"], 12 | "exclude": ["test.ts", "**/*.spec.*"] 13 | } 14 | -------------------------------------------------------------------------------- /src/vantage-ui-template/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "outDir": "../../out-tsc/spec", 6 | "lib": ["es6", "dom"], 7 | "module": "commonjs", 8 | "types": ["jasmine", "hammerjs", "node"] 9 | }, 10 | "include": ["../polyfills.ts", "test.ts", "**/*.spec.*"] 11 | } 12 | -------------------------------------------------------------------------------- /stylelint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['./node_modules/@covalent/coding-standards/stylelint/stylelint.config.js'], 3 | }; 4 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "importHelpers": true, 14 | "target": "es2015", 15 | "typeRoots": ["node_modules/@types"], 16 | "lib": ["es2018", "dom"], 17 | "paths": { 18 | "@shared/*": ["./src/lib/*"] 19 | }, 20 | "noUnusedParameters": false, 21 | "noUnusedLocals": false, 22 | "allowUnreachableCode": false, 23 | "pretty": true 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["./node_modules/@covalent/coding-standards/tslint/tslint.js"] 3 | } 4 | --------------------------------------------------------------------------------