From c680f5b4e5b478d41335dafd81863fe0e934da40 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 8 Feb 2017 21:26:55 +0200 Subject: [PATCH] first commit --- .editorconfig | 13 +++++++++++++ .gitignore | 31 +++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ README.md | 14 ++++++++++++++ angular-cli.json | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ e2e/dashboard.e2e.ts | 18 ++++++++++++++++++ e2e/tsconfig.json | 16 ++++++++++++++++ karma.conf.js | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ mock-api/datum/activity.txt | 5 +++++ mock-api/datum/admin.txt | 10 ++++++++++ mock-api/datum/boolean.txt | 20 ++++++++++++++++++++ mock-api/datum/company.txt | 7 +++++++ mock-api/datum/createdtimestamp.txt | 10 ++++++++++ mock-api/datum/features.txt | 20 ++++++++++++++++++++ mock-api/datum/firstname.txt | 10 ++++++++++ mock-api/datum/icon.txt | 5 +++++ mock-api/datum/itemtimestamp.txt | 23 +++++++++++++++++++++++ mock-api/datum/lastname.txt | 10 ++++++++++ mock-api/datum/modifiers.txt | 5 +++++ mock-api/datum/uuid.txt | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ mock-api/schemas/features.yaml | 13 +++++++++++++ mock-api/schemas/items.yaml | 11 +++++++++++ mock-api/schemas/users.yaml | 12 ++++++++++++ package.json | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ protractor.conf.js | 32 ++++++++++++++++++++++++++++++++ scripts/ghpages-deploy | 25 +++++++++++++++++++++++++ src/app/app.component.html | 1 + src/app/app.component.scss | 30 ++++++++++++++++++++++++++++++ src/app/app.component.ts | 32 ++++++++++++++++++++++++++++++++ src/app/app.module.ts | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/app/app.routes.ts | 23 +++++++++++++++++++++++ src/app/data/bus-stop/bus-stop.component.html | 19 +++++++++++++++++++ src/app/data/bus-stop/bus-stop.component.ts | 298 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/app/data/bus-stop/bus-stop.scss | 4 ++++ src/app/data/data.component.html | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/app/data/data.component.scss | 5 +++++ src/app/data/data.component.ts | 25 +++++++++++++++++++++++++ src/app/environment.ts | 7 +++++++ src/app/index.ts | 2 ++ src/app/login/login.component.html | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/app/login/login.component.scss | 11 +++++++++++ src/app/login/login.component.ts | 27 +++++++++++++++++++++++++++ src/app/main/main.component.html | 13 +++++++++++++ src/app/main/main.component.scss | 0 src/app/main/main.component.ts | 39 +++++++++++++++++++++++++++++++++++++++ src/app/templates/templates.component.html | 318 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/app/templates/templates.component.scss | 0 src/app/templates/templates.component.ts | 10 ++++++++++ src/assets/ico/favicon.ico | Bin 0 -> 32988 bytes src/assets/icons/appcenter.svg | 18 ++++++++++++++++++ src/assets/icons/covalent-mark.svg | 15 +++++++++++++++ src/assets/icons/covalent.svg | 12 ++++++++++++ src/assets/icons/github.svg | 6 ++++++ src/assets/icons/listener.svg | 21 +++++++++++++++++++++ src/assets/icons/querygrid.svg | 19 +++++++++++++++++++ src/assets/icons/teradata-ux.svg | 41 +++++++++++++++++++++++++++++++++++++++++ src/assets/icons/teradata.svg | 2 ++ src/components/chart/chart.component.html | 3 +++ src/components/chart/chart.component.scss | 26 ++++++++++++++++++++++++++ src/components/chart/chart.component.ts | 10 ++++++++++ src/config/api.config.ts | 1 + src/config/interceptors/request.interceptor.ts | 11 +++++++++++ src/data/alerts.json | 33 +++++++++++++++++++++++++++++++++ src/data/data.csv | 15 +++++++++++++++ src/data/data.json | 43 +++++++++++++++++++++++++++++++++++++++++++ src/data/data.tsv | 9 +++++++++ src/data/datatime.csv | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/data/features.json | 1 + src/data/items.json | 33 +++++++++++++++++++++++++++++++++ src/data/products.json | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/data/users.json | 42 ++++++++++++++++++++++++++++++++++++++++++ src/environments/environment.prod.ts | 3 +++ src/environments/environment.ts | 3 +++ src/favicon.ico | Bin 0 -> 15086 bytes src/favicon.png | Bin 0 -> 1145 bytes src/helpers/editor.component.ts | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/helpers/renderer.component.ts | 42 ++++++++++++++++++++++++++++++++++++++++++ src/index.html | 20 ++++++++++++++++++++ src/main.ts | 12 ++++++++++++ src/models/boolean-select-list.ts | 4 ++++ src/models/bus-stop.ts | 16 ++++++++++++++++ src/models/region-select-list.ts | 4 ++++ src/models/road-select-list.ts | 4 ++++ src/models/settlement-select-list.ts | 4 ++++ src/models/state-common-select-list.ts | 4 ++++ src/models/surface-type-select-list.ts | 4 ++++ src/polyfills.ts | 21 +++++++++++++++++++++ src/services/boolean-select-list.service.ts | 19 +++++++++++++++++++ src/services/bus-stop-create.service.ts | 21 +++++++++++++++++++++ src/services/bus-stop.service.ts | 41 +++++++++++++++++++++++++++++++++++++++++ src/services/region-select-list.service.ts | 23 +++++++++++++++++++++++ src/services/road-select-list.service.ts | 0 src/services/settlement-select-list.service.ts | 0 src/services/state-common-selectlist.service.ts | 23 +++++++++++++++++++++++ src/services/surface-type-select-list.service.ts | 0 src/styles.scss | 13 +++++++++++++ src/test.ts | 33 +++++++++++++++++++++++++++++++++ src/theme.scss | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/tsconfig.json | 27 +++++++++++++++++++++++++++ src/typings.d.ts | 6 ++++++ tslint.json | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 101 files changed, 3035 insertions(+), 0 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 angular-cli.json create mode 100644 e2e/dashboard.e2e.ts create mode 100644 e2e/tsconfig.json create mode 100644 karma.conf.js create mode 100644 mock-api/datum/activity.txt create mode 100644 mock-api/datum/admin.txt create mode 100644 mock-api/datum/boolean.txt create mode 100644 mock-api/datum/company.txt create mode 100644 mock-api/datum/createdtimestamp.txt create mode 100644 mock-api/datum/features.txt create mode 100644 mock-api/datum/firstname.txt create mode 100644 mock-api/datum/icon.txt create mode 100644 mock-api/datum/itemtimestamp.txt create mode 100644 mock-api/datum/lastname.txt create mode 100644 mock-api/datum/modifiers.txt create mode 100644 mock-api/datum/uuid.txt create mode 100644 mock-api/schemas/features.yaml create mode 100644 mock-api/schemas/items.yaml create mode 100644 mock-api/schemas/users.yaml create mode 100644 package.json create mode 100644 protractor.conf.js create mode 100644 scripts/ghpages-deploy create mode 100644 src/app/app.component.html create mode 100644 src/app/app.component.scss create mode 100644 src/app/app.component.ts create mode 100644 src/app/app.module.ts create mode 100644 src/app/app.routes.ts create mode 100644 src/app/data/bus-stop/bus-stop.component.html create mode 100644 src/app/data/bus-stop/bus-stop.component.ts create mode 100644 src/app/data/bus-stop/bus-stop.scss create mode 100644 src/app/data/data.component.html create mode 100644 src/app/data/data.component.scss create mode 100644 src/app/data/data.component.ts create mode 100644 src/app/environment.ts create mode 100644 src/app/index.ts create mode 100644 src/app/login/login.component.html create mode 100644 src/app/login/login.component.scss create mode 100644 src/app/login/login.component.ts create mode 100644 src/app/main/main.component.html create mode 100644 src/app/main/main.component.scss create mode 100644 src/app/main/main.component.ts create mode 100644 src/app/templates/templates.component.html create mode 100644 src/app/templates/templates.component.scss create mode 100644 src/app/templates/templates.component.ts create mode 100644 src/assets/ico/favicon.ico create mode 100644 src/assets/icons/appcenter.svg create mode 100644 src/assets/icons/covalent-mark.svg create mode 100644 src/assets/icons/covalent.svg create mode 100644 src/assets/icons/github.svg create mode 100644 src/assets/icons/listener.svg create mode 100644 src/assets/icons/querygrid.svg create mode 100644 src/assets/icons/teradata-ux.svg create mode 100644 src/assets/icons/teradata.svg create mode 100644 src/components/chart/chart.component.html create mode 100644 src/components/chart/chart.component.scss create mode 100644 src/components/chart/chart.component.ts create mode 100644 src/config/api.config.ts create mode 100644 src/config/interceptors/request.interceptor.ts create mode 100644 src/data/alerts.json create mode 100644 src/data/data.csv create mode 100644 src/data/data.json create mode 100644 src/data/data.tsv create mode 100644 src/data/datatime.csv create mode 100644 src/data/features.json create mode 100644 src/data/items.json create mode 100644 src/data/products.json create mode 100644 src/data/users.json create mode 100644 src/environments/environment.prod.ts create mode 100644 src/environments/environment.ts create mode 100644 src/favicon.ico create mode 100644 src/favicon.png create mode 100644 src/helpers/editor.component.ts create mode 100644 src/helpers/renderer.component.ts create mode 100644 src/index.html create mode 100644 src/main.ts create mode 100644 src/models/boolean-select-list.ts create mode 100644 src/models/bus-stop.ts create mode 100644 src/models/region-select-list.ts create mode 100644 src/models/road-select-list.ts create mode 100644 src/models/settlement-select-list.ts create mode 100644 src/models/state-common-select-list.ts create mode 100644 src/models/surface-type-select-list.ts create mode 100644 src/polyfills.ts create mode 100644 src/services/boolean-select-list.service.ts create mode 100644 src/services/bus-stop-create.service.ts create mode 100644 src/services/bus-stop.service.ts create mode 100644 src/services/region-select-list.service.ts create mode 100644 src/services/road-select-list.service.ts create mode 100644 src/services/settlement-select-list.service.ts create mode 100644 src/services/state-common-selectlist.service.ts create mode 100644 src/services/surface-type-select-list.service.ts create mode 100644 src/styles.scss create mode 100644 src/test.ts create mode 100644 src/theme.scss create mode 100644 src/tsconfig.json create mode 100644 src/typings.d.ts create mode 100644 tslint.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..da0310f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a8fef9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/deploy +/tmp + +# dependencies +/node_modules +/bower_components + +# IDEs and editors +/.idea +/.vscode + +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log +testem.log +/typings +/.vagrant + +# e2e +/e2e/*.js +/e2e/*.map + +#System Files +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..138243a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2016 by Teradata. All rights reserved. http://teradata.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1146c47 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Covalent QuickStart + +Quickstart App with @covalent packages + +## Setup + +* Ensure you have Node 4.4+ and NPM 3+ installed. +* Install Angular CLI `npm i -g angular-cli@latest` +* Install Typescript 2.0 `npm i -g typescript` +* Install TSLint `npm install -g tslint` +* Install Protractor for e2e testing `npm install -g protractor` +* Install Node packages `npm i` +* Update Webdriver `webdriver-manager update` and `./node_modules/.bin/webdriver-manager update` +* Run local build `ng serve` diff --git a/angular-cli.json b/angular-cli.json new file mode 100644 index 0000000..06e2dea --- /dev/null +++ b/angular-cli.json @@ -0,0 +1,55 @@ +{ + "project": { + "version": "1.0.0-beta.26", + "name": "covalent-quickstart" + }, + "apps": [{ + "root": "src", + "outDir": "dist", + "assets": [ + "assets", + "data", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "test": "test.ts", + "tsconfig": "tsconfig.json", + "prefix": "app", + "mobile": false, + "styles": [ + "styles.scss", + "theme.scss", + "../node_modules/@covalent/core/common/platform.css", + "../node_modules/@swimlane/ngx-charts/release/ngx-charts.css", + "../node_modules/ag-grid/dist/styles/ag-grid.css", + "../node_modules/ag-grid/dist/styles/theme-dark.css" + ], + "scripts": [ + "../node_modules/hammerjs/hammer.min.js", + "../node_modules/showdown/dist/showdown.js" + ], + "environments": { + "source": "environments/environment.ts", + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + }], + "addons": [], + "packages": [], + "e2e": { + "protractor": { + "config": "./protractor.conf.js" + } + }, + "test": { + "karma": { + "config": "./karma.conf.js" + } + }, + "defaults": { + "styleExt": "scss", + "prefixInterfaces": false, + "lazyRoutePrefix": "+" + } +} \ No newline at end of file diff --git a/e2e/dashboard.e2e.ts b/e2e/dashboard.e2e.ts new file mode 100644 index 0000000..45fb851 --- /dev/null +++ b/e2e/dashboard.e2e.ts @@ -0,0 +1,18 @@ +import { browser, element, by, $, protractor } from 'protractor/globals'; + +describe('basic e2e test with loading', function(): void { + let EC = protractor.ExpectedConditions; + describe('home', function(): void { + browser.get('/'); + it('should load home page', function(): void { + expect(browser.getTitle()).toBe('Covalent QuickStart'); + // Waits for the element 'td-loading' to not be present on the dom. + browser.wait(EC.not(EC.presenceOf($('td-loading'))), 10000) + .then(() => { + + // checks if elements were rendered + expect(element(by.id('dashboard-favorites-card')).isPresent()).toBe(true); + }); + }); + }); +}); diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json new file mode 100644 index 0000000..656bdb1 --- /dev/null +++ b/e2e/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "declaration": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "module": "commonjs", + "moduleResolution": "node", + "outDir": "../dist/out-tsc-e2e", + "sourceMap": true, + "target": "es5", + "typeRoots": [ + "../node_modules/@types" + ] + } +} diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000..7342d7e --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,53 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/0.13/config/configuration-file.html + +module.exports = function (config) { + var configuration = { + basePath: '.', + frameworks: ['jasmine', 'angular-cli'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-firefox-launcher'), + require('karma-remap-istanbul'), + require('angular-cli/plugins/karma') + ], + customLaunchers: { + // chrome setup for travis CI using chromium + Chrome_travis_ci: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, + files: [ + { pattern: './src/test.ts', watched: false } + ], + preprocessors: { + './src/test.ts': ['angular-cli'] + }, + remapIstanbulReporter: { + reports: { + html: 'coverage', + lcovonly: './coverage/coverage.lcov' + } + }, + angularCli: { + config: './angular-cli.json', + environment: 'dev' + }, + mime: { + 'text/x-typescript': ['ts','tsx'] + }, + reporters: ['progress', 'karma-remap-istanbul'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }; + if (process.env.TRAVIS) { + configuration.browsers = ['Chrome_travis_ci']; + } + config.set(configuration); +}; diff --git a/mock-api/datum/activity.txt b/mock-api/datum/activity.txt new file mode 100644 index 0000000..6f83e32 --- /dev/null +++ b/mock-api/datum/activity.txt @@ -0,0 +1,5 @@ +updated account +made a deposit +changed refresh settings on their account +liked the latest announcements +sent a personal message diff --git a/mock-api/datum/admin.txt b/mock-api/datum/admin.txt new file mode 100644 index 0000000..226b5bb --- /dev/null +++ b/mock-api/datum/admin.txt @@ -0,0 +1,10 @@ +1 +1 +0 +0 +0 +0 +0 +0 +0 +0 diff --git a/mock-api/datum/boolean.txt b/mock-api/datum/boolean.txt new file mode 100644 index 0000000..d987e49 --- /dev/null +++ b/mock-api/datum/boolean.txt @@ -0,0 +1,20 @@ +1 +1 +0 +0 +1 +0 +0 +1 +0 +1 +1 +0 +0 +0 +0 +0 +1 +0 +1 +1 diff --git a/mock-api/datum/company.txt b/mock-api/datum/company.txt new file mode 100644 index 0000000..14390a6 --- /dev/null +++ b/mock-api/datum/company.txt @@ -0,0 +1,7 @@ +teradata +gmail +yahoo +hotmail +outlook +msn +blue diff --git a/mock-api/datum/createdtimestamp.txt b/mock-api/datum/createdtimestamp.txt new file mode 100644 index 0000000..8b6dddc --- /dev/null +++ b/mock-api/datum/createdtimestamp.txt @@ -0,0 +1,10 @@ +10/01/2015 11:05 AM +10/01/2015 11:05 AM +10/01/2015 11:06 AM +10/01/2015 11:06 AM +10/01/2015 11:07 AM +10/01/2015 11:07 AM +10/01/2015 11:07 AM +10/01/2015 11:07 AM +10/01/2015 11:08 AM +10/01/2015 11:08 AM diff --git a/mock-api/datum/features.txt b/mock-api/datum/features.txt new file mode 100644 index 0000000..8531647 --- /dev/null +++ b/mock-api/datum/features.txt @@ -0,0 +1,20 @@ +Ingest +Containers +Deployment +Life Cycle +Statistics +Workloads +Analyzer +Apps +Workflows +Trend +Alerts +Loading +Movement +Orchestration +Availability +Data Warehouse +Data Lake +Server +Compute +Services diff --git a/mock-api/datum/firstname.txt b/mock-api/datum/firstname.txt new file mode 100644 index 0000000..3c55809 --- /dev/null +++ b/mock-api/datum/firstname.txt @@ -0,0 +1,10 @@ +Aaron +Benjamin +Carl +Olive +Edward +Alice +Beverly +Cheryl +Danielle +Elizabeth diff --git a/mock-api/datum/icon.txt b/mock-api/datum/icon.txt new file mode 100644 index 0000000..974b849 --- /dev/null +++ b/mock-api/datum/icon.txt @@ -0,0 +1,5 @@ +account_circle +account_balance_wallet +autorenew +thumb_up +message diff --git a/mock-api/datum/itemtimestamp.txt b/mock-api/datum/itemtimestamp.txt new file mode 100644 index 0000000..fba8fff --- /dev/null +++ b/mock-api/datum/itemtimestamp.txt @@ -0,0 +1,23 @@ +7/23/2016 12:05 AM +7/23/2016 12:05 AM +7/23/2016 12:05 AM +7/23/2016 12:05 AM +7/23/2016 12:05 AM +7/23/2016 12:05 AM +7/23/2016 12:05 AM +7/23/2016 12:05 AM +8/17/2016 12:05 AM +8/17/2016 12:05 AM +8/17/2016 12:05 AM +8/17/2016 12:05 AM +8/17/2016 12:05 AM +8/17/2016 12:05 AM +8/23/2016 12:07 AM +8/23/2016 12:07 AM +8/23/2016 12:07 AM +8/23/2016 12:07 AM +8/23/2016 12:07 AM +8/23/2016 12:07 AM +8/23/2016 12:09 AM +8/23/2016 12:09 AM +8/23/2016 12:09 AM diff --git a/mock-api/datum/lastname.txt b/mock-api/datum/lastname.txt new file mode 100644 index 0000000..d4266b9 --- /dev/null +++ b/mock-api/datum/lastname.txt @@ -0,0 +1,10 @@ +Burke +Davidson +Kim +Park +Gonzales +Guerrero +Hopkins +Obrien +Payne +Stephens diff --git a/mock-api/datum/modifiers.txt b/mock-api/datum/modifiers.txt new file mode 100644 index 0000000..1d5b703 --- /dev/null +++ b/mock-api/datum/modifiers.txt @@ -0,0 +1,5 @@ +Streamers +Manager +Monitor +Availability +Status diff --git a/mock-api/datum/uuid.txt b/mock-api/datum/uuid.txt new file mode 100644 index 0000000..50a08c4 --- /dev/null +++ b/mock-api/datum/uuid.txt @@ -0,0 +1,200 @@ +afd96ae7-fe58-4d7d-95ad-4bad518afaa8 +94b8a4eb-7014-4de5-8c09-4b1cd0171535 +be0f2f50-3df0-42b1-8530-3c4542c2c5cc +7a91f600-34cd-4400-b771-f7198b38ba94 +bea0f0d9-61fb-46b2-ab1b-c0a647887206 +29429c1f-31e9-4753-b57a-ab652642a9f2 +bf916685-7846-47d9-bea7-f7fe7bd9917b +1832a1fc-a4b1-4b0b-8f1e-0db4c96396be +34a7361c-f0f2-47f6-9ea6-2fe821ef5459 +3759fcaa-42b1-426d-9205-ca85a64d73e0 +2acca72c-2b97-45a8-be6e-b010d460426b +d3b96c14-321c-42cb-a0ba-3142d84a5877 +4be06cac-99bc-4c86-ba51-56f9d6507f26 +42c3677f-2b93-4ffd-bf51-e161aacc7c56 +30f49435-a131-490f-8090-dbae911789e9 +a4530934-05ce-4811-9d82-fb782dfc20f4 +2947a5e8-6843-4ce7-8c7e-70ac8979f248 +cb0b76ac-d421-4f0b-bd70-c47ba65ed507 +6dc2a966-f278-42f3-917a-e42b316c22ef +e6919a88-ef3e-461f-8fe8-deacf078af07 +b3341881-fffd-4301-b53f-e03e113ee26b +1d611eff-5f42-44b7-bacb-671559c32e41 +2f934de4-b4e8-4854-8a81-5d47389393d4 +51af46a4-6f31-46b0-87d5-a9a06b67d45f +d6022b51-53f4-4842-a99c-825d0e423cd0 +368d2386-b06b-4a3d-8871-32176bd46de0 +5d12e6d7-24fe-4b50-b0f1-bb5428dcdda5 +979a8bce-a05d-4e50-a576-d74f68a7a1cc +b40fe11b-978e-452d-97c4-da88192085fc +97f53684-9125-4bf4-8813-941b97bf4bb0 +f59f190a-f095-4d48-b6e7-ad4d22c3bf09 +6c760c34-3cc6-443c-89a9-607a221abe6e +c10064b9-6319-4e09-bf48-46f88a54ec84 +d4173848-1aea-49f2-8949-1a93aedce311 +55cc7e09-d588-49ae-9cea-74a18ad8170c +67d8ee98-85b1-44d2-b8a1-a01b568be22a +1c3f0909-beeb-4226-b635-b39c5192d3bc +088a329f-858b-49df-af73-321bf562d2a9 +67b456d2-6a28-4738-8b79-3b0dcb8e766b +d049060d-3fcc-4405-a2e0-bb2f8ee457be +9df10508-2bc3-469e-b263-d70f0b864dad +b3922336-0d9a-4d2a-904d-4ca513c28507 +0d94a03b-50b2-431f-a031-21309292c2a1 +b52b230c-169b-4af4-b067-9e2fa77e0b94 +46fbf0a5-5463-4fc9-a969-382137d9515e +cb575fc6-7643-4b53-a6af-0815eff219ae +cf9ae615-3ad6-4d59-8b58-1fabc8d35e6d +53e471b5-0df3-4d83-abb1-6955e90c0f0d +431d0a94-889d-475f-8643-68936270edd6 +6ac012c5-6208-40e5-9880-0edaad22c4e3 +d7514b6b-bc1f-4b1b-bd87-5aeb1ae8f642 +c872ea65-c1ca-41a5-9967-a7d2db18fac7 +91f15f76-8dee-44c7-aa93-0f23ca0f5789 +c2c71407-7eeb-4420-b1ff-fb05aa8c25ff +cd689a0d-2ca9-4e5c-90a1-eb0dcc327f83 +85bb1ed1-8931-43e2-a3da-0bd035878a18 +60f5639b-11f8-40df-8cbb-7ab3f4ffb113 +a48e4bb4-4ec6-481d-a802-e23f54db5054 +b068c79e-7cf9-45f6-8335-77ab68f6c86e +dc9805c8-2ce1-4d21-b68e-861b0eb55ba1 +a5b6d5a7-c2a4-4095-9a09-2b498ab94d4b +bfce7bf7-f350-4152-8eb2-02ff2b93daa4 +5afe6e64-9d57-4bdb-aee9-11d4b16d3f9e +1bfcfa7e-de12-43c2-a37a-240dd99a8f1f +45cc37d4-89ac-4e24-b50a-0feb7df59c44 +7a668e71-8823-4ae4-95ce-e16233d4b4c2 +e06a30fa-1370-4673-b7d0-1d18c63d8ede +37404edd-61f6-4a86-a8dd-9b4b2077d176 +e037efbd-ec95-4faf-84e0-628cbbcae98e +b37d84cf-7eb7-4069-b160-2f4a758fa423 +fcd69850-94f8-4d91-ba2f-334ea0e7b443 +507af92e-4c14-4a8a-afa6-d9b79d967da8 +5fe94f89-f78d-45cd-b107-d7bd4e136ae3 +a3d7fff5-0bfa-407f-91ee-04052449d3cb +407383f5-a3c8-472d-8923-0cea06db80e6 +b48dd39e-bebf-4397-bdde-8a21f0284d16 +e5e162a0-4794-41f2-8e01-575f51cceea9 +b0e17177-14d4-4ad7-88d4-2ffdf8e61b62 +8d21948c-776c-48f5-b38f-10aa0a926a3d +44abdb9d-e9cf-46a7-b611-d0e7222a21a6 +3e12702e-7356-4838-b76c-8c4e30781d32 +b7ea554b-d351-4988-9eaa-40f93374a7eb +ad0c4d06-9f1a-40a4-a37c-e5e5220c9c1c +8d020676-ed7e-4958-9490-fe8372dfbd9a +bbb78cfc-dcad-43ee-ae3b-6a8fb619d079 +b3538d89-5079-4593-9892-e168dd48d294 +dd2e9c4c-df2b-47f5-8cbe-3ebbcc5e10f5 +cc7b7d97-ae42-4985-831b-944a9d5797c0 +03c6192f-9934-4933-8632-702dc4d2be68 +29c2aabf-61f3-40c9-bffe-deb502f3e365 +e5d56aa0-e700-48fd-bb38-93eaa4ca46ad +14885bde-979d-40b4-8054-f209f7864299 +b89ffb45-02db-49cf-95bb-d161aa63c228 +05c4c9dd-08b5-4cee-b577-4e479f705717 +47c18660-781c-482f-be31-5be6e865ddc8 +427a13d9-a246-4911-87ec-1fe8c54892aa +21526022-b753-43c6-bb5b-a81afd907cfc +7ae51985-7156-4424-bfd5-7714415cd7b0 +de87d1c2-78ce-45dc-ae1e-0e480f7674d7 +fb4d8e06-88fc-4d35-b288-2394140e7167 +0db7e170-0011-4306-a2a3-a00a1d376dfc +2d0ee417-1c51-4fe2-a7f7-4f302f6f6884 +3a71fe0a-0622-4eae-8839-b8e85a494245 +4a452718-5a23-4f0a-928d-154b16fcbcdc +3bafe52e-9a7f-4ca7-adbc-f511fb0bb7af +726e5278-8cf2-4b2e-91fd-88c4819a5e85 +6badaf13-7269-4c3c-a362-924554a0caee +7fec0ab8-541e-44d7-8ed4-b17387e7ccef +5d9968d6-082e-4857-bce0-249bc3ef4b3f +6a149930-fb2e-4315-bd53-156f5739548b +ad3ac830-15b7-4ece-b1fb-0e8a643036ce +c4a4aad5-9957-438f-af00-bcacc693fa3b +a8a9afb1-ce77-41d6-9c6f-f66287b0558b +d5446a05-3c2c-417b-8b4d-519d93bb4d81 +b03af126-f479-4501-a390-10394a885371 +2bae9cf9-5dda-4d21-8dec-45479b48c296 +f707ea79-d56d-46d5-b063-67cc2df87b53 +d6ac2680-3868-4814-8998-dc6a08e96112 +da440782-4703-44b4-abca-8e6611e9204f +30aa09ad-832a-476f-9201-e111f4eae1c5 +b8378481-8a8d-4e97-945a-ff0a0293f4df +83c7200e-5883-41f4-81bb-7e3bd6f85e6c +4a9b0ec4-7530-4944-a836-5834910667f9 +a70ce8bd-58ad-4d22-9ecd-69a1b3825718 +e60e38b3-d4ed-4331-ab11-f1217a5ad5ab +781eed13-c362-48c3-bf7d-308fb7588eea +f8055118-c788-4327-b1ba-d999cc016a2f +d993b911-6c26-4586-9f00-b0ff164603fe +13d64c8e-d1c7-42d5-adb6-7ef6a822676e +41cd7e44-25e2-44ad-9624-74b380a070f0 +4e0a68ce-3dca-4e3f-91dd-218b10900bf1 +ba424283-d4ed-4670-8030-1bbfd3f26397 +7fab8302-9908-4b3e-8c06-b21d4d0ba3cd +7d7cd4c5-41ef-444b-a641-5187a838cc93 +269d7c9f-b0d0-471d-9a58-f3b787ab8895 +2f3a0eb4-6b32-41c9-8e76-48abc1dd1488 +eb3b3f2c-1b0d-4227-a2b1-d07beecb85d4 +1b01da19-0186-446b-98a3-cbf65dda92ee +945b56ef-c86f-4fb7-bc52-66b66ebf09c5 +12e1a829-4536-49bd-9979-e0e35860ad07 +51ece058-b199-458e-8472-8d0a484dc4a2 +dd28eb11-2778-403d-9425-7b270c0698b6 +5faef1c0-f198-4d72-b22a-f27adb5e35e3 +0c870484-f061-436b-889b-a758805d4f79 +e30f4edd-3330-4c89-84d4-e2e0ad1f5a2f +8a843267-3b4d-4ec4-a020-44b30bd1babb +1899cb11-ee64-4db8-ae4b-1f0e30defb1c +11122d50-3fdc-4ed9-9a8b-844b7b86ed7b +e0d9b68a-56ff-4796-8a19-dd3663b13968 +915f14c5-2cb3-49c9-a622-a80ba37f1384 +fb3260a3-4b85-413d-85a6-0ef0ef645329 +c630b9a6-3f68-438e-9c42-0cc9fe34738a +e91c9a70-8a18-4dc4-bee9-fd4168b6fe38 +9a912a50-0b96-47dd-9298-8a82ad9603c2 +44f3cb64-990e-417a-b243-c4c24da9e176 +9a445e7e-0f7b-479b-a03a-735d776ae689 +32222f12-c741-4fc8-b7d9-24731f7370a7 +210e9d28-65da-4198-8a0f-a3ee7000cdcc +c38ed1eb-6b39-4d70-b6bb-a81c6cc8bd4f +e44d7ce3-8684-4ff9-b4cf-111e99d8c9c5 +cba1016c-0510-4b49-9e06-05ed529a3852 +9870c4bb-b2d5-447d-9a09-932575e7c000 +a29246ff-8b44-410e-b0b5-6af4f21235d7 +0f0d7ad0-fac8-45f5-bc8f-c46532e5058f +36de97a7-6f0d-45c4-afdb-fdf5f98ce3a0 +397b1291-23b6-44de-be9e-c6a8c81189b8 +2e257d24-2210-4685-ad83-e69375f85f1f +12269eab-62cc-419e-8e8d-70ce4547f9b0 +985d5865-ea43-4204-9a12-608869c71a91 +cfac6212-c7ed-445a-80dc-c9eb32ca446d +bff768e5-457b-4fee-a73b-29fe67c26c11 +d6825f5c-d941-434a-ae08-e1c011645b28 +35809df1-fd92-4f45-bc67-107bd6396840 +2c883d1d-d142-4972-816b-cd802e2e8d32 +98794878-6704-4e2a-b92c-7efd0a5ad1f7 +37160f69-8fb1-420b-a986-e5a0bf364588 +e10713b5-6679-464f-8dc2-b3cbc5aca57e +ff300382-af4d-4274-b120-74a6d14532c9 +8387b4a2-15a1-431f-a62b-4095dc2590f2 +3a7983a9-3bf2-42ce-9106-13ea4ef5b57d +fde2b650-5182-4477-926c-4bb37fe8aaa1 +d3b9c91d-1f79-48d3-8eab-d6c666b4ce1d +dc131382-1c07-4cdc-95ce-7f3bbdf5722f +5517823d-a1e3-4599-ac89-cc561ac09b3a +5bd1d82b-2c4d-48aa-9d77-eb200434b9b8 +72b9666c-827f-480c-bcd3-9a45fe0c392d +95b7a077-bfdd-4874-9b67-45784d810efd +537d5d85-a579-4be5-8f14-ba61d88c5abf +e255297e-1d45-4890-8dd3-be7a2880b7d2 +ac72cd75-60aa-462b-a0e2-00e012f29742 +7d25df42-bc84-4ace-a906-39d7750f89e7 +beac52d9-e750-4ac8-8624-7f3267c25bbb +9e821db9-af1a-4e2f-93d2-bee75b9fff81 +0969305a-cffc-4244-b687-c444cf9dc738 +38bb0878-a734-4aea-ba3d-ad568faa3d75 +3df0d493-b225-4e2a-b95b-35ae645f8f61 +e4fdcdab-a88c-4a48-96cd-37c7a36d9f26 +663c8aec-7844-457f-b01e-c6ba6de6f7f6 +aeb9cd2c-6990-4e6f-89e9-d8145f40d570 +c59069e4-5b8e-4cdd-9676-82f6db6936b7 diff --git a/mock-api/schemas/features.yaml b/mock-api/schemas/features.yaml new file mode 100644 index 0000000..7d7187a --- /dev/null +++ b/mock-api/schemas/features.yaml @@ -0,0 +1,13 @@ +# this is a sample schema file for a feature object. + +--- +initial_entries: 12 +randomize: true +id: _uuid_ +user: _firstname_ _lastname_ +title: _features_ _modifiers_ +icon: _icon_ +created: _itemtimestamp_ +modified: _itemtimestamp_ +enabled: _boolean_ +... diff --git a/mock-api/schemas/items.yaml b/mock-api/schemas/items.yaml new file mode 100644 index 0000000..61d361c --- /dev/null +++ b/mock-api/schemas/items.yaml @@ -0,0 +1,11 @@ +# this is a sample schema file for a user object. + +--- +initial_entries: 10 +randomize: false +item_id: _uuid_ +name: _firstname_ _lastname_ +description: _activity_ +icon: _icon_ +created: _itemtimestamp_ +... diff --git a/mock-api/schemas/users.yaml b/mock-api/schemas/users.yaml new file mode 100644 index 0000000..8b9c358 --- /dev/null +++ b/mock-api/schemas/users.yaml @@ -0,0 +1,12 @@ +# this is a sample schema file for a user object. + +--- +initial_entries: 5 +randomize: false +displayName: _firstname_ _lastname_ +id: _firstname_._lastname_ +email: _firstname_._lastname_@_company_.com +created: _createdtimestamp_ +lastAccess: _itemtimestamp_ +siteAdmin: _admin_ +... diff --git a/package.json b/package.json new file mode 100644 index 0000000..2946844 --- /dev/null +++ b/package.json @@ -0,0 +1,99 @@ +{ + "name": "covalent-quickstart", + "version": "1.0.0-beta.1", + "private": true, + "description": "Quickstart App with @covalent packages", + "keywords": [ + "angular", + "components", + "reusable" + ], + "scripts": { + "e2e": "protractor", + "e2e-test": "protractor ./protractor.conf.js", + "lint": "tslint -c ./tslint.json \"./src/**/*.ts\" -e \"./src/**/typings.d.ts\" -e \"./src/environments/**\"", + "reinstall": "rm -rf node_modules tmp deploy dist && npm i", + "postinstall": "webdriver-manager update", + "start-api": "cd mock-api && covalent-data &", + "stop-api": "pkill covalent-data", + "webdriver-update": "bash ./node_modules/.bin/webdriver-manager update", + "test": "ng test --code-coverage --single-run", + "ghpages-deploy": "ng build --base-href /covalent-quickstart/ --aot -prod && bash scripts/ghpages-deploy" + }, + "engines": { + "node": ">4.4 < 7", + "npm": ">3" + }, + "repository": { + "type": "git", + "url": "https://github.com/teradata/covalent-quickstart.git" + }, + "license": "MIT", + "author": "Teradata UX", + "contributors": [ + "Kyle Ledbetter ", + "Richa Vyas ", + "Ed Morales ", + "Jason Weaver ", + "Jeremy Smartt ", + "Ilsun Park " + ], + "dependencies": { + "@angular/common": "2.4.5", + "@angular/compiler": "2.4.5", + "@angular/core": "2.4.5", + "@angular/forms": "2.4.5", + "@angular/http": "2.4.5", + "@angular/material": "2.0.0-beta.1", + "@angular/platform-browser": "2.4.5", + "@angular/platform-browser-dynamic": "2.4.5", + "@angular/platform-server": "2.4.5", + "@angular/router": "3.4.5", + "@covalent/core": "1.0.0-beta.1", + "@covalent/charts": "1.0.0-beta.1", + "@covalent/dynamic-forms": "1.0.0-beta.1", + "@covalent/highlight": "1.0.0-beta.1", + "@covalent/http": "1.0.0-beta.1", + "@covalent/markdown": "1.0.0-beta.1", + "@swimlane/ngx-charts": "^3.1.2", + "core-js": "^2.4.1", + "hammerjs": "^2.0.8", + "highlight.js": "9.9.0", + "rxjs": "^5.0.1", + "showdown": "1.6.0", + "zone.js": "^0.7.2", + "moment": "^2.17.1", + "d3": "^4.4.0", + "ag-grid": "7.2.x", + "ag-grid-ng2": "7.2.x" + }, + "devDependencies": { + "@angular/compiler-cli": "2.4.5", + "@types/hammerjs": "2.0.30", + "@types/jasmine": "2.2.31", + "@types/node": "6.0.34", + "@types/selenium-webdriver": "2.53.36", + "angular-cli": "1.0.0-beta.26", + "codelyzer": "2.0.0-beta.4", + "ember-cli-inject-live-reload": "1.4.0", + "jasmine-core": "2.4.1", + "jasmine-spec-reporter": "2.5.0", + "karma": "1.2.0", + "karma-chrome-launcher": "2.0.0", + "karma-cli": "1.0.1", + "karma-jasmine": "1.0.2", + "karma-remap-istanbul": "0.2.1", + "karma-firefox-launcher": "1.0.0", + "karma-phantomjs-launcher": "1.0.1", + "node-sass": "3.8.0", + "phantomjs-prebuilt": "2.1.7", + "protractor": "4.0.5", + "sass-loader": "^4.0.2", + "ts-node": "1.2.1", + "tslint": "^4.3.1", + "typescript": "2.1.5" + }, + "optionalDependencies": { + "@covalent/data": "0.4.0" + } +} \ No newline at end of file diff --git a/protractor.conf.js b/protractor.conf.js new file mode 100644 index 0000000..d18cc59 --- /dev/null +++ b/protractor.conf.js @@ -0,0 +1,32 @@ +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/docs/referenceConf.js + +/*global jasmine */ +var SpecReporter = require('jasmine-spec-reporter'); + +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './e2e/**/*.e2e.ts' + ], + capabilities: { + 'browserName': 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + useAllAngular2AppRoots: true, + beforeLaunch: function() { + require('ts-node').register({ + project: 'e2e' + }); + }, + onPrepare: function() { + jasmine.getEnv().addReporter(new SpecReporter()); + } +}; diff --git a/scripts/ghpages-deploy b/scripts/ghpages-deploy new file mode 100644 index 0000000..eaf9c92 --- /dev/null +++ b/scripts/ghpages-deploy @@ -0,0 +1,25 @@ +#!/bin/bash +echo 'Replace api endpoint with heroku' + +cat <<'EOF' >> api.config.ts +export const MOCK_API: string = "https://whispering-beyond-86495.herokuapp.com"; +EOF + +mv src/config/api.config.ts api.config.ts.default +mv api.config.ts src/config/api.config.ts + +git branch -f gh-pages +git checkout gh-pages +echo 'Created and Checked out gh-pages branch' + +git reset --hard origin/develop + +cp -r dist/* . +echo 'Copied dist/ directory into root dir' + +echo 'Tracking files' +git add -A . +echo 'Commiting files' +git commit -a -m 'gh-pages update' +echo 'Pushing files into gh-pages branch' +git push origin gh-pages --force diff --git a/src/app/app.component.html b/src/app/app.component.html new file mode 100644 index 0000000..0680b43 --- /dev/null +++ b/src/app/app.component.html @@ -0,0 +1 @@ + diff --git a/src/app/app.component.scss b/src/app/app.component.scss new file mode 100644 index 0000000..5f40e1d --- /dev/null +++ b/src/app/app.component.scss @@ -0,0 +1,30 @@ +/* :host /deep/ lets shadowdom style child elements */ +:host /deep/ { + /** + * CSS Overrides for bug fixes + */ + + /** + * END CSS Overrides for bug fixes + */ + + /* Manage list custom styles */ + .md-sort-item { + /deep/ { + .md-list-item { + padding: 0; + } + } + } + .md-sort-icon { + font-size: 15px; + margin-right: 10px; + } + .md-sort-header { + padding: 10px; + &:hover { + background-color: #EEEEEE; + cursor: pointer; + } + } +} \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts new file mode 100644 index 0000000..f9e0e91 --- /dev/null +++ b/src/app/app.component.ts @@ -0,0 +1,32 @@ +import { Component } from '@angular/core'; +import { DomSanitizer } from '@angular/platform-browser'; +import { MdIconRegistry } from '@angular/material'; + +@Component({ + selector: 'qs-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], +}) +export class AppComponent { + + constructor(private _iconRegistry: MdIconRegistry, + private _domSanitizer: DomSanitizer) { + this._iconRegistry.addSvgIconInNamespace('assets', 'teradata', + this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/teradata.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'github', + this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/github.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'covalent', + this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/covalent.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'covalent-mark', + this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/covalent-mark.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'teradata-ux', + this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/teradata-ux.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'appcenter', + this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/appcenter.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'listener', + this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/listener.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'querygrid', + this._domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/querygrid.svg')); + } + +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts new file mode 100644 index 0000000..5259f93 --- /dev/null +++ b/src/app/app.module.ts @@ -0,0 +1,78 @@ +import { NgModule, Type } from '@angular/core'; +import { BrowserModule, Title } from '@angular/platform-browser'; + +import { CovalentCoreModule } from '@covalent/core'; +import { CovalentHttpModule, IHttpInterceptor } from '@covalent/http'; +import { CovalentHighlightModule } from '@covalent/highlight'; +import { CovalentMarkdownModule } from '@covalent/markdown'; +import { CovalentChartsModule } from '@covalent/charts'; + +import { AppComponent } from './app.component'; +import { MainComponent } from './main/main.component'; +import { LoginComponent } from './login/login.component'; +import { DataComponent } from './data/data.component'; +import { TemplatesComponent } from './templates/templates.component';; +import { appRoutes, appRoutingProviders } from './app.routes'; +import { AgGridModule } from 'ag-grid-ng2/main'; +import { ChartComponent } from '../components/chart/chart.component'; + +import { RequestInterceptor } from '../config/interceptors/request.interceptor'; + +import { NgxChartsModule } from '@swimlane/ngx-charts'; + +import { BusStopComponent } from './data/bus-stop/bus-stop.component'; +import { EditorComponent } from '../helpers/editor.component'; +import { RendererComponent } from '../helpers/renderer.component'; + +// Services +import { BusStopCreateService } from '../services/bus-stop-create.service'; +import { BooleanSelectListService } from '../services/boolean-select-list.service'; +import { BusStopService } from '../services/bus-stop.service'; + +const httpInterceptorProviders: Type[] = [ + RequestInterceptor, +]; + +@NgModule({ + declarations: [ + AppComponent, + MainComponent, + DataComponent, + LoginComponent, + ChartComponent, + TemplatesComponent, + BusStopComponent, + EditorComponent, + RendererComponent, + ], // directives, components, and pipes owned by this NgModule + imports: [ + BrowserModule, + AgGridModule.withComponents([ + BusStopComponent, + EditorComponent, + RendererComponent, + ]), + CovalentCoreModule.forRoot(), + CovalentChartsModule.forRoot(), + CovalentHttpModule.forRoot({ + interceptors: [{ + interceptor: RequestInterceptor, paths: ['**'], + }], + }), + CovalentHighlightModule.forRoot(), + CovalentMarkdownModule.forRoot(), + appRoutes, + NgxChartsModule, + ], // modules needed to run this module + providers: [ + appRoutingProviders, + httpInterceptorProviders, + Title, + BusStopCreateService, + BooleanSelectListService, + BusStopService + ], // additional providers needed for this module + entryComponents: [ ], + bootstrap: [ AppComponent ], +}) +export class AppModule {} diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts new file mode 100644 index 0000000..bbbfdfd --- /dev/null +++ b/src/app/app.routes.ts @@ -0,0 +1,23 @@ +import { Routes, RouterModule } from '@angular/router'; + +import { MainComponent } from './main/main.component'; +import { DataComponent } from './data/data.component'; +import { LoginComponent } from './login/login.component'; +import { TemplatesComponent } from './templates/templates.component'; +import { BusStopComponent } from './data/bus-stop/bus-stop.component'; + +const routes: Routes = [ + {path: 'login', component: LoginComponent}, + {path: '', component: MainComponent, children: [ + {path: '',component: TemplatesComponent}, + {path: 'data', component: DataComponent, children: [ + {path: 'bus-stop', component: BusStopComponent}, + ]} + ]}, +]; + +export const appRoutingProviders: any[] = [ + +]; + +export const appRoutes: any = RouterModule.forRoot(routes, { useHash: false }); diff --git a/src/app/data/bus-stop/bus-stop.component.html b/src/app/data/bus-stop/bus-stop.component.html new file mode 100644 index 0000000..accbe4b --- /dev/null +++ b/src/app/data/bus-stop/bus-stop.component.html @@ -0,0 +1,19 @@ + +
+

Rich Grid with Pure JavaScript

+
+
+ + +
+ ...Loading +
+ + +
+ +
+
\ No newline at end of file diff --git a/src/app/data/bus-stop/bus-stop.component.ts b/src/app/data/bus-stop/bus-stop.component.ts new file mode 100644 index 0000000..c29529f --- /dev/null +++ b/src/app/data/bus-stop/bus-stop.component.ts @@ -0,0 +1,298 @@ +import {Component, ViewEncapsulation} from "@angular/core"; +import {GridOptions} from "ag-grid/main"; + +import { BusStopService } from '../../../services/bus-stop.service'; +import { BusStop } from '../../../models/bus-stop'; +import { EditorComponent } from '../../../helpers/editor.component'; +import { RendererComponent } from '../../../helpers/renderer.component'; +import { BusStopCreateService } from '../../../services/bus-stop-create.service'; +import { BooleanSelectListService } from '../../../services/boolean-select-list.service'; +import { RegionSelectList } from '../../../models/region-select-list'; +import { StateCommonSelectList } from '../../../models/state-common-select-list'; +import { RoadSelectList } from '../../../models/road-select-list'; +import { BooleanSelectList } from '../../../models/boolean-select-list'; +import { SettlementSelectList } from '../../../models/settlement-select-list'; +import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list'; + + +// only import this if you are using the ag-Grid-Enterprise + +@Component({ + selector: 'rich-grid', + templateUrl: 'bus-stop.component.html', + styleUrls: ['bus-stop.scss'], + encapsulation: ViewEncapsulation.None +}) +export class BusStopComponent { + + public showGrid: boolean; + public rowData: any[]; + public rowCount: string; + public regions: RegionSelectList[]; + public states: StateCommonSelectList[]; + public surfaceTypes: SurfaceTypeSelectList[]; + public settlements: SettlementSelectList[]; + public roads: RoadSelectList[]; + public boolean: BooleanSelectList[]; + public isLoading: boolean = false; + public isBootstrapping: boolean = true; + public isSelected: boolean = true; + private columnDefs: any[]; + private gridOptions: GridOptions; + + constructor( + protected service: BusStopService, + private dataService: BusStopCreateService, + private booleanService: BooleanSelectListService + ) { + this.gridOptions = {}; + this.gridOptions.enableSorting = true; + this.showGrid = true; + this.gridOptions.rowModelType = 'virtual'; + this.booleanService.getModels().then((models) => this.boolean = models); + this.dataService.getModels().then(models => { + this.regions = models.regionSelectListDsM as RegionSelectList[]; + this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; + this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[]; + this.settlements = models.settlementSelectListDsM as SettlementSelectList[]; + this.roads = models.roadSelectListDsM as RoadSelectList[]; + }).then(() => { + this.createColumnDefs(); + this.isBootstrapping = false; + }); + this.service.getData().then((data) => { + if (data.length){ + this.rowData = data; + } else { + this.rowData = [new BusStop]; + } + }).then(() => { + this.gridOptions.api.setDatasource(this.setRowData(this.rowData)); + this.gridOptions.api.refreshVirtualPageCache(); + }); + } + setRowData(allOfTheData) { + let dataSource = { + rowCount: null, // behave as infinite scroll + getRows: function (params) { + console.log('asking for ' + params.startRow + ' to ' + params.endRow); + // At this point in your code, you would call the server, using $http if in AngularJS. + // To make the demo look real, wait for 500ms before returning + // take a slice of the total rows + let rowsThisPage = allOfTheData.slice(params.startRow, params.endRow); + // if on or after the last page, work out the last row. + let lastRow = -1; + if (allOfTheData.length <= params.endRow) { + lastRow = allOfTheData.length; + } + // call the success callback + params.successCallback(rowsThisPage, lastRow); + } + }; + return dataSource; + + } + onDeleteConfirm(event): void { + if (window.confirm('Вы уверены что хотите удалить??')) { + event.confirm.resolve(); + } else { + event.confirm.reject(); + } + } + public addNewRow() { + this.rowData.unshift(new BusStop()); + this.gridOptions.api.setDatasource(this.setRowData(this.rowData)); + this.gridOptions.api.refreshVirtualPageCache(); + } + + private createColumnDefs() { + this.columnDefs = [ + { + headerName: '#', + width: 30, + checkboxSelection: true, + suppressSorting: true, + suppressMenu: true, + pinned: true + }, + { + headerName: 'ID', + field: 'busStopId', + }, + { + headerName: 'Назва дороги', + field: 'roadId', + editable: true, + cellEditorFramework: EditorComponent, + cellRendererFramework: RendererComponent, + cellEditorParams: { + data: this.roads, + valueCol: 'roadId', + labelCol: 'name' + } + }, + { + headerName: 'Область', + field: 'regionId', + editable: true, + cellEditorFramework: EditorComponent, + cellRendererFramework: RendererComponent, + cellEditorParams: { + data: this.regions, + valueCol: 'regionId', + labelCol: 'name' + } + }, + { + headerName: 'Місцезнаходження, км+ справа', + field: 'locationRight', + editable: true, + }, + { + headerName: 'Місцезнаходження, км+ зліва', + field: 'locationLeft', + editable: true, + }, + { + headerName: 'Технічний стан', + field: 'stateCommonId', + editable: true, + cellEditorFramework: EditorComponent, + cellRendererFramework: RendererComponent, + cellEditorParams: { + data: this.states, + valueCol: 'stateCommonId', + labelCol: 'value' + } + }, + { + headerName: 'Наявність туалету', + field: 'toiletAvailability', + editable: true, + cellEditorFramework: EditorComponent, + cellRendererFramework: RendererComponent, + cellEditorParams: { + data: this.boolean, + valueCol: 'value', + labelCol: 'label' + } + } + ]; + } + + private onCellClicked($event) { + console.log('onCellClicked: ' + $event.rowIndex + ' ' + $event.colDef.field); + } + + private onCellValueChanged($event) { + if ($event.oldValue !== $event.newValue) { + let data = JSON.stringify($event.data); + let id = $event.data.busStopId; + let result = null; + if (id) { + this.isLoading = true; + result = this.service.update(id, data).then(() => this.isLoading = false); + } else { + // Protection of posting new row being already sent. + if (this.isLoading) { + return ; + } + this.isLoading = true; + result = this.service.create(data).then((busStop) => { + this.rowData[$event.node.rowIndex] = busStop; + this.gridOptions.api.setDatasource(this.setRowData(this.rowData)); + this.gridOptions.api.refreshVirtualPageCache(); + this.isLoading = false; + }); + } + } + } + + private deleteRows() { + let rows = this.gridOptions.api.getSelectedNodes(); + if (!rows.length) { + return ; + } + rows.forEach(element => { + let id = element.data.busStopId; + if (id) { + this.isLoading = true; + this.service.delete(id).then(() => this.isLoading = false); + } + }); + // Sort in order to protect array from reindexing (remove rear elements first) + let sorted = rows.sort((a, b) => { + if (a > b) { + return -1; + } else { + return 1; + } + }); + sorted.forEach(item => { + this.rowData.splice(item.rowIndex, 1); + }); + this.gridOptions.api.setDatasource(this.setRowData(this.rowData)); + this.gridOptions.api.refreshVirtualPageCache(); + } + + private onCellDoubleClicked($event) { + console.log('onCellDoubleClicked: ' + $event.rowIndex + ' ' + $event.colDef.field); + } + + private onCellContextMenu($event) { + console.log('onCellContextMenu: ' + $event.rowIndex + ' ' + $event.colDef.field); + } + + private onCellFocused($event) { + console.log('onCellFocused: (' + $event.rowIndex + ',' + $event.colIndex + ')'); + } + + private onRowSelected($event) { + // taking out, as when we 'select all', it prints to much to the console!! + // console.log('onRowSelected: ' + $event.node.data.name); + } + + private onSelectionChanged() { + console.log('selectionChanged'); + } + + private onBeforeFilterChanged() { + console.log('beforeFilterChanged'); + } + + private onAfterFilterChanged() { + console.log('afterFilterChanged'); + } + + private onFilterModified() { + console.log('onFilterModified'); + } + + private onBeforeSortChanged() { + console.log('onBeforeSortChanged'); + } + + private onAfterSortChanged() { + console.log('onAfterSortChanged'); + } + + private onVirtualRowRemoved($event) { + // because this event gets fired LOTS of times, we don't print it to the + // console. if you want to see it, just uncomment out this line + // console.log('onVirtualRowRemoved: ' + $event.rowIndex); + } + + private onRowClicked($event) { + console.log('onRowClicked: ' + $event.node.data.name); + } + + public onQuickFilterChanged($event) { + this.gridOptions.api.setQuickFilter($event.target.value); + } + + // here we use one generic event to handle all the column type events. + // the method just prints the event name + private onColumnEvent($event) { + console.log('onColumnEvent: ' + $event); + } +} diff --git a/src/app/data/bus-stop/bus-stop.scss b/src/app/data/bus-stop/bus-stop.scss new file mode 100644 index 0000000..de4dc3d --- /dev/null +++ b/src/app/data/bus-stop/bus-stop.scss @@ -0,0 +1,4 @@ +.toolbar button { + margin: 2px; + padding: 0; +} \ No newline at end of file diff --git a/src/app/data/data.component.html b/src/app/data/data.component.html new file mode 100644 index 0000000..73def4c --- /dev/null +++ b/src/app/data/data.component.html @@ -0,0 +1,68 @@ + +
+ Quickstart + + + chrome_reader_mode + + + + +
+ + + Відомості + + + + dashboard + Автомобільні дороги + + + insert_chart + Обслуговування + + + star + Прив'язки населених пунктів + + + people + Інтенсивності + + + dashboard + Категорія доріг + + + dashboard + З'їзди + + + dashboard + Ширина проїзних частин + + + dashboard + Покриття доріг + + + dashboard + Об'єкти сервісу + + + dashboard + Автобусні зупинки + + +
+ {{title}} + + + + + +
+ +
+
\ No newline at end of file diff --git a/src/app/data/data.component.scss b/src/app/data/data.component.scss new file mode 100644 index 0000000..b58a212 --- /dev/null +++ b/src/app/data/data.component.scss @@ -0,0 +1,5 @@ +.md-fab-bottom-right { + position: fixed; + bottom: 10px; + right: 10px; +} diff --git a/src/app/data/data.component.ts b/src/app/data/data.component.ts new file mode 100644 index 0000000..46d3b11 --- /dev/null +++ b/src/app/data/data.component.ts @@ -0,0 +1,25 @@ +import { Component, AfterViewInit } from '@angular/core'; + +import { Title } from '@angular/platform-browser'; + +import { TdMediaService } from '@covalent/core'; + +@Component({ + selector: 'qs-dashboard-product', + templateUrl: './data.component.html', + styleUrls: ['./data.component.scss'], +}) +export class DataComponent implements AfterViewInit { + + title: string; + constructor(private _titleService: Title, + public media: TdMediaService) { } + + ngAfterViewInit(): void { + // broadcast to all listener observables when loading the page + this.media.broadcast(); + + this._titleService.setTitle( 'Product Dashboard' ); + this.title = this._titleService.getTitle(); + } +} diff --git a/src/app/environment.ts b/src/app/environment.ts new file mode 100644 index 0000000..52efc69 --- /dev/null +++ b/src/app/environment.ts @@ -0,0 +1,7 @@ +// The file for the current environment will overwrite this one during build +// Different environments can be found in config/environment.{dev|prod}.ts +// The build system defaults to the dev environment + +export const environment: any = { + production: false, +}; diff --git a/src/app/index.ts b/src/app/index.ts new file mode 100644 index 0000000..b7fc2a2 --- /dev/null +++ b/src/app/index.ts @@ -0,0 +1,2 @@ +export {environment} from './environment'; +export {AppModule} from './app.module'; diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html new file mode 100644 index 0000000..705fdd4 --- /dev/null +++ b/src/app/login/login.component.html @@ -0,0 +1,44 @@ +
+ + Login + +
+
+
+ + Login + sign in via your current corporate account + + +
+
+ + + person + + Required + + {{userElement.value.length}} / 30 + +
+
+ + + lock + + Required + + Something hard to guess + +
+
+
+ + + + +
+
+
+
+
\ No newline at end of file diff --git a/src/app/login/login.component.scss b/src/app/login/login.component.scss new file mode 100644 index 0000000..ae6e7a4 --- /dev/null +++ b/src/app/login/login.component.scss @@ -0,0 +1,11 @@ +:host /deep/ { + .md-input-prefix { + width: 44px; + text-align: center; + } + md-divider { + display: block; + border-top-style: solid; + border-top-width: 1px; + } +} \ No newline at end of file diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts new file mode 100644 index 0000000..5ed2a96 --- /dev/null +++ b/src/app/login/login.component.ts @@ -0,0 +1,27 @@ +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +import { TdLoadingService } from '@covalent/core'; + +@Component({ + selector: 'qs-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.scss'], +}) +export class LoginComponent { + + username: string; + password: string; + + constructor(private _router: Router, + private _loadingService: TdLoadingService) {} + + login(): void { + this._loadingService.register(); + alert('Mock log in as ' + this.username); + setTimeout(() => { + this._router.navigate(['/']); + this._loadingService.resolve(); + }, 2000); + } +} diff --git a/src/app/main/main.component.html b/src/app/main/main.component.html new file mode 100644 index 0000000..500a25b --- /dev/null +++ b/src/app/main/main.component.html @@ -0,0 +1,13 @@ + + + + + + + exit_to_appSign out + + + + diff --git a/src/app/main/main.component.scss b/src/app/main/main.component.scss new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/app/main/main.component.scss diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts new file mode 100644 index 0000000..c70a93a --- /dev/null +++ b/src/app/main/main.component.ts @@ -0,0 +1,39 @@ +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'qs-main', + templateUrl: './main.component.html', + styleUrls: ['./main.component.scss'], +}) +export class MainComponent { + + routes: Object[] = [ + { + title: 'Відомості', + route: '/data', + icon: 'view_quilt', + }, + { + title: 'Список доріг', + route: '/', + icon: 'view_quilt', + }, + { + title: 'Список паспортів доріг', + route: '/', + icon: 'view_quilt', + }, + { + title: 'Редагування маршрутів', + route: '/', + icon: 'view_quilt', + }, + ]; + + constructor(private _router: Router) {} + + logout(): void { + this._router.navigate(['/login']); + } +} diff --git a/src/app/templates/templates.component.html b/src/app/templates/templates.component.html new file mode 100644 index 0000000..b692c68 --- /dev/null +++ b/src/app/templates/templates.component.html @@ -0,0 +1,318 @@ + + + + + +
+
+
+
+
+

Awesome Landing Page Template

+

Covalent isn't just for web application interfaces. You can easily build a reponsive landing pages just like this!

+ +
+
+
+
+
+
+
+ +
+

Covalent Templates

+
+
+
+ system_update_alt +
Landing Page Template
+
+
+ dashboard +
Dashboard Template
+
+
+ email +
Email App Template
+
+
+ view_array +
IDE Editor Template
+
+
+
+
+ +
+
+
+
+ + + Plan Name + + Plan description goes here. + + +

Features

+ + description +

Feature Name

+
+ + + description +

Feature Name

+
+ + + description +

Feature Name

+
+ + + description +

Feature Name

+
+
+
+
+ +
+ + + Plan Name + + Plan description goes here. + + +

Features

+ + description +

Feature Name

+
+ + + description +

Feature Name

+
+ + + description +

Feature Name

+
+ + + description +

Feature Name

+
+
+
+
+ +
+ + + Plan Name + + Plan description goes here. + + +

Features

+ + description +

Feature Name

+
+ + + description +

Feature Name

+
+ + + description +

Feature Name

+
+ + + description +

Feature Name

+
+
+
+
+
+ + + Plan Name + + Plan description goes here. + + +

Features

+ + description +

Feature Name

+
+ + + description +

Feature Name

+
+ + + description +

Feature Name

+
+ + + description +

Feature Name

+
+
+
+
+
+
+
+
+
+
+
+
+
+

Contact Our Company

+

Ready to make dive into Angular 2? Clone this repo and get started today!

+ +
+
+
+
+
+
+
+
+ +

Menu Name

+ +

List Item

+
+ +

List item

+
+ +

List item

+
+ +

List item

+
+
+
+
+ +

Menu Name

+ +

List item

+
+ +

List item

+
+ +

List item

+
+ +

List item

+
+
+
+
+ +

Menu Name

+ +

List item

+
+ +

List item

+
+ +

List item

+
+ +

List item

+
+
+
+
+
+
+ +

© Copyright 2016 Company Name, Inc. All rights reserved.

+
+
+
+
+
+ + + code + \ No newline at end of file diff --git a/src/app/templates/templates.component.scss b/src/app/templates/templates.component.scss new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/app/templates/templates.component.scss diff --git a/src/app/templates/templates.component.ts b/src/app/templates/templates.component.ts new file mode 100644 index 0000000..3bb3a36 --- /dev/null +++ b/src/app/templates/templates.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'qs-templates', + templateUrl: './templates.component.html', + styleUrls: ['./templates.component.scss'], +}) +export class TemplatesComponent { + +} diff --git a/src/assets/ico/favicon.ico b/src/assets/ico/favicon.ico new file mode 100644 index 0000000..f369961 Binary files /dev/null and b/src/assets/ico/favicon.ico differ diff --git a/src/assets/icons/appcenter.svg b/src/assets/icons/appcenter.svg new file mode 100644 index 0000000..b48bc89 --- /dev/null +++ b/src/assets/icons/appcenter.svg @@ -0,0 +1,18 @@ + + + + appcenter + Created with Sketch. + + + + + + + + + + + + + diff --git a/src/assets/icons/covalent-mark.svg b/src/assets/icons/covalent-mark.svg new file mode 100644 index 0000000..b37a473 --- /dev/null +++ b/src/assets/icons/covalent-mark.svg @@ -0,0 +1,15 @@ + + + + covalent + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/covalent.svg b/src/assets/icons/covalent.svg new file mode 100644 index 0000000..6cddc20 --- /dev/null +++ b/src/assets/icons/covalent.svg @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/src/assets/icons/github.svg b/src/assets/icons/github.svg new file mode 100644 index 0000000..f327104 --- /dev/null +++ b/src/assets/icons/github.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/assets/icons/listener.svg b/src/assets/icons/listener.svg new file mode 100644 index 0000000..b613cc1 --- /dev/null +++ b/src/assets/icons/listener.svg @@ -0,0 +1,21 @@ + + + + listener + Created with Sketch. + + + + + + + + + + + + + + + + diff --git a/src/assets/icons/querygrid.svg b/src/assets/icons/querygrid.svg new file mode 100644 index 0000000..4120475 --- /dev/null +++ b/src/assets/icons/querygrid.svg @@ -0,0 +1,19 @@ + + + + querygrid + Created with Sketch. + + + + + + + + + + + + + + diff --git a/src/assets/icons/teradata-ux.svg b/src/assets/icons/teradata-ux.svg new file mode 100644 index 0000000..3ad3af3 --- /dev/null +++ b/src/assets/icons/teradata-ux.svg @@ -0,0 +1,41 @@ + + + + teradata-ux + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/teradata.svg b/src/assets/icons/teradata.svg new file mode 100644 index 0000000..d4550ee --- /dev/null +++ b/src/assets/icons/teradata.svg @@ -0,0 +1,2 @@ + + diff --git a/src/components/chart/chart.component.html b/src/components/chart/chart.component.html new file mode 100644 index 0000000..5846cfe --- /dev/null +++ b/src/components/chart/chart.component.html @@ -0,0 +1,3 @@ +
+ JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDECJANFEBMARAPR0.050K100K150K200K250K300K350K400K450K500K +
\ No newline at end of file diff --git a/src/components/chart/chart.component.scss b/src/components/chart/chart.component.scss new file mode 100644 index 0000000..6351e53 --- /dev/null +++ b/src/components/chart/chart.component.scss @@ -0,0 +1,26 @@ +.chart-container { + display: inline-block; + position: relative; + width: 95%; + padding-bottom: 55%; + vertical-align: top; + overflow: hidden; +} +.chart { + display: inline-block; + position: absolute; + top: 0; + left: 0; + right: 20px; + .bar-1 { + fill: #EF6C00; + } + .bar-2 { + fill: #009688; + } + text { + fill: rgba(0, 0, 0, 0.54); + font: 10px sans-serif; + text-anchor: end; + } +} \ No newline at end of file diff --git a/src/components/chart/chart.component.ts b/src/components/chart/chart.component.ts new file mode 100644 index 0000000..545d9b1 --- /dev/null +++ b/src/components/chart/chart.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'qs-chart-component', + templateUrl: './chart.component.html', + styleUrls: ['./chart.component.scss'], +}) +export class ChartComponent { + +} diff --git a/src/config/api.config.ts b/src/config/api.config.ts new file mode 100644 index 0000000..07d2474 --- /dev/null +++ b/src/config/api.config.ts @@ -0,0 +1 @@ +export const MOCK_API: string = 'http://localhost:8080'; diff --git a/src/config/interceptors/request.interceptor.ts b/src/config/interceptors/request.interceptor.ts new file mode 100644 index 0000000..2924698 --- /dev/null +++ b/src/config/interceptors/request.interceptor.ts @@ -0,0 +1,11 @@ +import { Injectable } from '@angular/core'; +import { RequestOptionsArgs } from '@angular/http'; +import { IHttpInterceptor } from '@covalent/http'; + +@Injectable() +export class RequestInterceptor implements IHttpInterceptor { + onRequest(requestOptions: RequestOptionsArgs): RequestOptionsArgs { + // you add headers or do something before a request here. + return requestOptions; + } +} diff --git a/src/data/alerts.json b/src/data/alerts.json new file mode 100644 index 0000000..32a258e --- /dev/null +++ b/src/data/alerts.json @@ -0,0 +1,33 @@ +[ + { + "item_id": "1", + "name": "Sim Card", + "description": "sim card expiring", + "icon": "sim_card", + "created" : "07/13/2016 11:05 AM" + },{ + "item_id": "2", + "name": "Motherboard", + "description": "board heat nearing critical", + "icon": "developer_board", + "created" : "07/01/2016 03:41 PM" + },{ + "item_id": "3", + "name": "RAM Usage", + "description": "exceeded ram capacity", + "icon": "memory", + "created" : "06/15/2016 09:02 AM" + },{ + "item_id": "4", + "name": "Wireless Signal", + "description": "interrupted signal strength", + "icon": "router", + "created" : "03/23/2016 11:01 PM" + },{ + "item_id": "5", + "name": "Battery", + "description": "battery level unknown", + "icon": "battery_unknown", + "created" : "12/23/2015 11:05 AM" + } +] \ No newline at end of file diff --git a/src/data/data.csv b/src/data/data.csv new file mode 100644 index 0000000..f845947 --- /dev/null +++ b/src/data/data.csv @@ -0,0 +1,15 @@ +salesperson,sales +Bob,33 +Robin,12 +Anne,41 +Mark,16 +Joe,59 +Eve,38 +Karen,21 +Kirsty,25 +Chris,30 +Lisa,47 +Tom,5 +Stacy,20 +Charles,13 +Mary,29 diff --git a/src/data/data.json b/src/data/data.json new file mode 100644 index 0000000..8ba66c1 --- /dev/null +++ b/src/data/data.json @@ -0,0 +1,43 @@ +[{ + "x": 0, + "y": 250 +}, { + "x": 40, + "y": 170 +}, { + "x": 80, + "y": 140 +}, { + "x": 120, + "y": 220 +}, { + "x": 160, + "y": 220 +}, { + "x": 200, + "y": 190 +}, { + "x": 240, + "y": 170 +}, { + "x": 280, + "y": 140 +}, { + "x": 320, + "y": 200 +}, { + "x": 360, + "y": 180 +}, { + "x": 400, + "y": 190 +}, { + "x": 440, + "y": 210 +}, { + "x": 480, + "y": 170 +}, { + "x": 500, + "y": 200 +}] \ No newline at end of file diff --git a/src/data/data.tsv b/src/data/data.tsv new file mode 100644 index 0000000..faf4a12 --- /dev/null +++ b/src/data/data.tsv @@ -0,0 +1,9 @@ +col1 col2 col3 col4 +1 63.4 62.7 72.2 +2 58.0 59.9 67.7 +3 53.3 59.1 69.4 +4 55.7 58.8 68.0 +5 64.2 58.7 72.4 +6 58.8 57.0 77.0 +7 57.9 56.7 82.3 +8 61.8 56.8 78.9 diff --git a/src/data/datatime.csv b/src/data/datatime.csv new file mode 100644 index 0000000..a8989d7 --- /dev/null +++ b/src/data/datatime.csv @@ -0,0 +1,151 @@ +date,close +22-Apr-07,63.4 +24-Apr-07,93.24 +25-Apr-07,95.35 +26-Apr-07,98.84 +27-Apr-07,99.92 +30-Apr-07,99.80 +1-May-07,99.47 +2-May-07,100.39 +3-May-07,100.40 +4-May-07,100.81 +7-May-07,103.92 +8-May-07,105.06 +9-May-07,106.88 +10-May-07,107.34 +11-May-07,108.74 +14-May-07,109.36 +15-May-07,107.52 +16-May-07,107.34 +17-May-07,109.44 +18-May-07,110.02 +21-May-07,111.98 +22-May-07,113.54 +23-May-07,112.89 +24-May-07,110.69 +25-May-07,113.62 +29-May-07,114.35 +30-May-07,118.77 +31-May-07,121.19 +1-Jun-07,118.40 +4-Jun-07,121.33 +5-Jun-07,122.67 +6-Jun-07,123.64 +7-Jun-07,124.07 +8-Jun-07,124.49 +11-Jun-07,120.19 +12-Jun-07,120.38 +13-Jun-07,117.50 +14-Jun-07,118.75 +15-Jun-07,120.50 +18-Jun-07,125.09 +19-Jun-07,123.66 +20-Jun-07,121.55 +21-Jun-07,123.90 +22-Jun-07,123.00 +25-Jun-07,122.34 +26-Jun-07,119.65 +27-Jun-07,121.89 +28-Jun-07,120.56 +29-Jun-07,122.04 +2-Jul-07,121.26 +3-Jul-07,127.17 +5-Jul-07,132.75 +6-Jul-07,132.30 +9-Jul-07,130.33 +10-Jul-07,132.35 +11-Jul-07,132.39 +12-Jul-07,134.07 +13-Jul-07,137.73 +16-Jul-07,138.10 +17-Jul-07,138.91 +18-Jul-07,138.12 +19-Jul-07,140.00 +20-Jul-07,143.75 +23-Jul-07,143.70 +24-Jul-07,134.89 +25-Jul-07,137.26 +26-Jul-07,146.00 +27-Jul-07,143.85 +30-Jul-07,141.43 +31-Jul-07,131.76 +1-Aug-07,135.00 +2-Aug-07,136.49 +3-Aug-07,131.85 +6-Aug-07,135.25 +7-Aug-07,135.03 +8-Aug-07,134.01 +9-Aug-07,126.39 +10-Aug-07,125.00 +13-Aug-07,127.79 +14-Aug-07,124.03 +15-Aug-07,119.90 +16-Aug-07,117.05 +17-Aug-07,122.06 +20-Aug-07,122.22 +21-Aug-07,127.57 +22-Aug-07,132.51 +23-Aug-07,131.07 +24-Aug-07,135.30 +27-Aug-07,132.25 +28-Aug-07,126.82 +29-Aug-07,134.08 +30-Aug-07,136.25 +31-Aug-07,138.48 +4-Sep-07,144.16 +5-Sep-07,136.76 +6-Sep-07,135.01 +7-Sep-07,131.77 +10-Sep-07,136.71 +11-Sep-07,135.49 +12-Sep-07,136.85 +13-Sep-07,137.20 +14-Sep-07,138.81 +17-Sep-07,138.41 +18-Sep-07,140.92 +19-Sep-07,140.77 +20-Sep-07,140.31 +21-Sep-07,144.15 +24-Sep-07,148.28 +25-Sep-07,153.18 +26-Sep-07,152.77 +27-Sep-07,154.50 +28-Sep-07,153.47 +1-Oct-07,156.34 +2-Oct-07,158.45 +3-Oct-07,157.92 +4-Oct-07,156.24 +5-Oct-07,161.45 +8-Oct-07,167.91 +9-Oct-07,167.86 +10-Oct-07,166.79 +11-Oct-07,162.23 +12-Oct-07,167.25 +15-Oct-07,166.98 +16-Oct-07,169.58 +17-Oct-07,172.75 +18-Oct-07,173.50 +19-Oct-07,170.42 +22-Oct-07,174.36 +23-Oct-07,186.16 +24-Oct-07,185.93 +25-Oct-07,182.78 +26-Oct-07,184.70 +29-Oct-07,185.09 +30-Oct-07,187.00 +31-Oct-07,189.95 +1-Nov-07,187.44 +2-Nov-07,187.87 +5-Nov-07,186.18 +6-Nov-07,191.79 +7-Nov-07,186.30 +8-Nov-07,175.47 +9-Nov-07,165.37 +12-Nov-07,153.76 +13-Nov-07,169.96 +14-Nov-07,166.11 +15-Nov-07,164.30 +16-Nov-07,166.39 +19-Nov-07,163.95 +20-Nov-07,168.85 +21-Nov-07,168.46 \ No newline at end of file diff --git a/src/data/features.json b/src/data/features.json new file mode 100644 index 0000000..91080de --- /dev/null +++ b/src/data/features.json @@ -0,0 +1 @@ +[{"created":"7/23/2016 12:05 AM","enabled":0,"icon":"thumb_up","id":"6dc2a966-f278-42f3-917a-e42b316c22ef","modified":"7/23/2016 12:05 AM","title":"Workflows Manager","user":"Carl Davidson"},{"created":"8/23/2016 12:07 AM","enabled":0,"icon":"autorenew","id":"42c3677f-2b93-4ffd-bf51-e161aacc7c56","modified":"8/23/2016 12:07 AM","title":"Workflows Availability","user":"Elizabeth Guerrero"},{"created":"8/23/2016 12:07 AM","enabled":0,"icon":"message","id":"8387b4a2-15a1-431f-a62b-4095dc2590f2","modified":"8/23/2016 12:07 AM","title":"Server Monitor","user":"Danielle Guerrero"},{"created":"8/23/2016 12:09 AM","enabled":0,"icon":"autorenew","id":"d049060d-3fcc-4405-a2e0-bb2f8ee457be","modified":"8/23/2016 12:09 AM","title":"Services Status","user":"Carl Burke"},{"created":"8/17/2016 12:05 AM","enabled":1,"icon":"thumb_up","id":"5faef1c0-f198-4d72-b22a-f27adb5e35e3","modified":"8/17/2016 12:05 AM","title":"Ingest Monitor","user":"Edward Stephens"},{"created":"8/17/2016 12:05 AM","enabled":0,"icon":"account_circle","id":"e10713b5-6679-464f-8dc2-b3cbc5aca57e","modified":"8/17/2016 12:05 AM","title":"Orchestration Monitor","user":"Beverly Guerrero"},{"created":"7/23/2016 12:05 AM","enabled":0,"icon":"message","id":"5d9968d6-082e-4857-bce0-249bc3ef4b3f","modified":"7/23/2016 12:05 AM","title":"Availability Manager","user":"Elizabeth Stephens"},{"created":"8/23/2016 12:09 AM","enabled":0,"icon":"account_balance_wallet","id":"e255297e-1d45-4890-8dd3-be7a2880b7d2","modified":"8/23/2016 12:09 AM","title":"Server Availability","user":"Aaron Obrien"},{"created":"7/23/2016 12:05 AM","enabled":0,"icon":"autorenew","id":"8387b4a2-15a1-431f-a62b-4095dc2590f2","modified":"7/23/2016 12:05 AM","title":"Alerts Availability","user":"Elizabeth Payne"},{"created":"7/23/2016 12:05 AM","enabled":1,"icon":"message","id":"0f0d7ad0-fac8-45f5-bc8f-c46532e5058f","modified":"7/23/2016 12:05 AM","title":"Orchestration Status","user":"Carl Hopkins"},{"created":"7/23/2016 12:05 AM","enabled":0,"icon":"account_circle","id":"67b456d2-6a28-4738-8b79-3b0dcb8e766b","modified":"7/23/2016 12:05 AM","title":"Movement Availability","user":"Danielle Park"},{"created":"8/23/2016 12:09 AM","enabled":0,"icon":"thumb_up","id":"c4a4aad5-9957-438f-af00-bcacc693fa3b","modified":"8/23/2016 12:09 AM","title":"Orchestration Status","user":"Alice Guerrero"}] \ No newline at end of file diff --git a/src/data/items.json b/src/data/items.json new file mode 100644 index 0000000..434712a --- /dev/null +++ b/src/data/items.json @@ -0,0 +1,33 @@ +[ + { + "item_id": "1", + "name": "Suzy Cuningham", + "description": "updated her account", + "icon": "account_circle", + "created" : "07/13/2016 11:05 AM" + },{ + "item_id": "2", + "name": "Bobby Daniels", + "description": "made a deposit of $25.15", + "icon": "account_balance_wallet", + "created" : "07/01/2016 03:41 PM" + },{ + "item_id": "3", + "name": "John Walker", + "description": "changed refresh settings on their account", + "icon": "autorenew", + "created" : "06/15/2016 09:02 AM" + },{ + "item_id": "4", + "name": "Eddy Stevens", + "description": "liked the latest announcements", + "icon": "thumb_up", + "created" : "03/23/2016 11:01 PM" + },{ + "item_id": "5", + "name": "Jan Williams", + "description": "sent a personal message to a user", + "icon": "message", + "created" : "12/23/2015 11:05 AM" + } +] \ No newline at end of file diff --git a/src/data/products.json b/src/data/products.json new file mode 100644 index 0000000..ea16226 --- /dev/null +++ b/src/data/products.json @@ -0,0 +1,45 @@ +[ + { + "item_id": "1", + "name": "Analyze This", + "description": "product description", + "icon": "account_balance", + "color": "pink-A200", + "category" : "analytics" + },{ + "item_id": "2", + "name": "Android Usage", + "description": "product description", + "icon": "android", + "color": "green-700", + "category" : "analytics" + },{ + "item_id": "3", + "name": "Watch Usage", + "description": "product description", + "icon": "watch", + "color": "purple-600", + "category" : "analytics" + },{ + "item_id": "4", + "name": "Customer Sentiment", + "description": "product description", + "icon": "face", + "color": "light-blue-600", + "category" : "customers" + },{ + "item_id": "5", + "name": "Member Retention", + "description": "product description", + "icon": "card_membership", + "color": "orange-700", + "category" : "customers" + },{ + "item_id": "6", + "name": "Rewards Usage", + "description": "product description", + "icon": "card_giftcard", + "color": "indigo-600", + "category" : "customers" + } +] \ No newline at end of file diff --git a/src/data/users.json b/src/data/users.json new file mode 100644 index 0000000..583ce39 --- /dev/null +++ b/src/data/users.json @@ -0,0 +1,42 @@ +[ + { + "displayName" : "Suzy Cuningham", + "id" : "suzy.cuningham", + "email" : "suzy.cuningham@gmail.com", + "created" : "10/01/2015 11:05 AM", + "lastAccess" : "12/23/2015 11:05 AM", + "siteAdmin": true + }, + { + "displayName" : "Bobby Daniels", + "id" : "bobbyD", + "email" : "bobbyD@outlook.com", + "created" : "10/01/2015 11:05 AM", + "lastAccess" : "12/23/2015 11:05 AM", + "siteAdmin": false + }, + { + "displayName" : "John Walker", + "id" : "johnnyWalker", + "email" : "johnnyWalker@blue.com", + "created" : "10/01/2015 11:05 AM", + "lastAccess" : "12/23/2015 11:05 AM", + "siteAdmin": false + }, + { + "displayName" : "Eddy Stevens", + "id" : "eStevens", + "email" : "eStevens@yahoo.com", + "created" : "10/01/2015 11:05 AM", + "lastAccess" : "12/23/2015 11:05 AM", + "siteAdmin": false + }, + { + "displayName" : "Jan Williams", + "id" : "jDubz", + "email" : "jDubz@msn.com", + "created" : "10/01/2015 11:05 AM", + "lastAccess" : "12/23/2015 11:05 AM", + "siteAdmin": false + } +] diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts new file mode 100644 index 0000000..3612073 --- /dev/null +++ b/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/src/environments/environment.ts b/src/environments/environment.ts new file mode 100644 index 0000000..ffe8aed --- /dev/null +++ b/src/environments/environment.ts @@ -0,0 +1,3 @@ +export const environment = { + production: false +}; diff --git a/src/favicon.ico b/src/favicon.ico new file mode 100644 index 0000000..fe7278d Binary files /dev/null and b/src/favicon.ico differ diff --git a/src/favicon.png b/src/favicon.png new file mode 100644 index 0000000..965ffa1 Binary files /dev/null and b/src/favicon.png differ diff --git a/src/helpers/editor.component.ts b/src/helpers/editor.component.ts new file mode 100644 index 0000000..d090145 --- /dev/null +++ b/src/helpers/editor.component.ts @@ -0,0 +1,58 @@ +import { Component, ViewContainerRef, ViewChild, AfterViewInit } from '@angular/core'; + +import { AgEditorComponent } from 'ag-grid-ng2/main'; + +@Component({ + selector: 'editor-cell', + template: ` +
+
+ + {{item[this.params.labelCol]}} + +
+
+ ` +}) +export class EditorComponent implements AgEditorComponent, AfterViewInit { + @ViewChild('container', {read: ViewContainerRef}) public container; + public item: Object = null; + public data: Object[]; + private params: any; + ngAfterViewInit() { + this.container.element.nativeElement.focus(); + } + + agInit(params: any): void { + this.params = params; + if (!this.params.valueCol) { + this.params.valueCol = 'id'; + } + if (!this.params.labelCol) { + this.params.labelCol = 'name'; + } + this.data = params.data || []; + } + + getValue(): any { + return this.item; + } + + isPopup(): boolean { + return true; + } + + setValue(item: Object): void { + this.item = item; + } + + onClick(item: Object) { + this.setValue(item); + this.params.api.stopEditing(); + } + + onKeyDown(event): boolean { + event.stopPropagation(); + return false; + } +} diff --git a/src/helpers/renderer.component.ts b/src/helpers/renderer.component.ts new file mode 100644 index 0000000..168af5e --- /dev/null +++ b/src/helpers/renderer.component.ts @@ -0,0 +1,42 @@ +import { Component } from '@angular/core'; + +import { AgRendererComponent } from 'ag-grid-ng2/main'; + +import { RegionSelectList } from '../models/region-select-list'; + +@Component({ + selector: 'render-cell', + template: `{{this.label}}` +}) +export class RendererComponent implements AgRendererComponent { + private params: any; + private valueCol: string = 'id'; + private labelCol: string = 'name'; + private model: Object = null; + private label: string = null; + agInit(params: any): void { + this.params = params; + if (params.colDef.cellEditorParams && params.colDef.cellEditorParams.valueCol) { + this.valueCol = params.colDef.cellEditorParams.valueCol; + } + if (params.colDef.cellEditorParams && params.colDef.cellEditorParams.labelCol) { + this.labelCol = params.colDef.cellEditorParams.labelCol; + } + this.setValue(params); + } + refresh(params: any): void { + this.params = params; + this.setValue(params); + } + private setValue(params) { + this.model = params.value; + let label = this.params.colDef.cellEditorParams.data.find((element, index, array) => { + if (element[this.valueCol] === params.value) { + return true; + } + }); + if (label) { + this.label = label[this.labelCol]; + } + } +} diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..10f0198 --- /dev/null +++ b/src/index.html @@ -0,0 +1,20 @@ + + + + + Covalent Quickstart + + + + + + + + +
+ +
Quickstart Loading...
+
+
+ + diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..5c3c520 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,12 @@ +import './polyfills.ts'; + +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { enableProdMode } from '@angular/core'; +import { environment } from './environments/environment'; +import { AppModule } from './app/'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/src/models/boolean-select-list.ts b/src/models/boolean-select-list.ts new file mode 100644 index 0000000..edd03a0 --- /dev/null +++ b/src/models/boolean-select-list.ts @@ -0,0 +1,4 @@ +export class BooleanSelectList { + value: number; + label: string; + } diff --git a/src/models/bus-stop.ts b/src/models/bus-stop.ts new file mode 100644 index 0000000..bda0065 --- /dev/null +++ b/src/models/bus-stop.ts @@ -0,0 +1,16 @@ +export class BusStop { + busStopID: number; + roadId: number; + regionId: number; + settlementId: number; + locationLeft: string; + locationRight: string; + surfaceTypeId: number; + areaStopAvailability: string; + areaLandAvailability: string; + pocketAvailability: string; + toiletAvailability: string; + yearBuild: string; + yearRepair: string; + stateCommonId: number; +} diff --git a/src/models/region-select-list.ts b/src/models/region-select-list.ts new file mode 100644 index 0000000..900eb7f --- /dev/null +++ b/src/models/region-select-list.ts @@ -0,0 +1,4 @@ +export class RegionSelectList { + regionId: number; + name: string; + } diff --git a/src/models/road-select-list.ts b/src/models/road-select-list.ts new file mode 100644 index 0000000..ab0bb31 --- /dev/null +++ b/src/models/road-select-list.ts @@ -0,0 +1,4 @@ +export class RoadSelectList { + roadId: number; + name: string; +} diff --git a/src/models/settlement-select-list.ts b/src/models/settlement-select-list.ts new file mode 100644 index 0000000..760fbc9 --- /dev/null +++ b/src/models/settlement-select-list.ts @@ -0,0 +1,4 @@ +export class SettlementSelectList { + settlementId: number; + name: string; + } diff --git a/src/models/state-common-select-list.ts b/src/models/state-common-select-list.ts new file mode 100644 index 0000000..f6cd860 --- /dev/null +++ b/src/models/state-common-select-list.ts @@ -0,0 +1,4 @@ +export class StateCommonSelectList { + stateCommonId: number; + value: string; + } diff --git a/src/models/surface-type-select-list.ts b/src/models/surface-type-select-list.ts new file mode 100644 index 0000000..d5cc5bf --- /dev/null +++ b/src/models/surface-type-select-list.ts @@ -0,0 +1,4 @@ +export class SurfaceTypeSelectList { + surfaceTypeId: number; + name: string; + } diff --git a/src/polyfills.ts b/src/polyfills.ts new file mode 100644 index 0000000..ebf7ac0 --- /dev/null +++ b/src/polyfills.ts @@ -0,0 +1,21 @@ +// This file includes polyfills needed by Angular 2 and is loaded before +// the app. You can add your own extra polyfills to this file. +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/set'; +import 'core-js/es6/reflect'; + +import 'core-js/es7/reflect'; +import 'zone.js/dist/zone'; + +import 'rxjs/Rx'; diff --git a/src/services/boolean-select-list.service.ts b/src/services/boolean-select-list.service.ts new file mode 100644 index 0000000..5336c22 --- /dev/null +++ b/src/services/boolean-select-list.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@angular/core'; + +import { BooleanSelectList } from '../models/boolean-select-list'; + +@Injectable() +export class BooleanSelectListService { + getModels(): Promise { + let values = []; + let trueValue = new BooleanSelectList(); + trueValue.value = 1; + trueValue.label = 'Да'; + let falseValue = new BooleanSelectList(); + falseValue.value = 0; + falseValue.label = 'Нет'; + values.push(falseValue); + values.push(trueValue); + return Promise.resolve(values); + } +} diff --git a/src/services/bus-stop-create.service.ts b/src/services/bus-stop-create.service.ts new file mode 100644 index 0000000..7d55bcb --- /dev/null +++ b/src/services/bus-stop-create.service.ts @@ -0,0 +1,21 @@ +import { Injectable } from '@angular/core'; +import { Headers, Http } from '@angular/http'; + +import 'rxjs/add/operator/toPromise'; + +@Injectable() +export class BusStopCreateService { + private apiUrl = 'http://localhost:5000/busstop/directory'; + private headers = new Headers({'Content-Type': 'applicaton/json'}); + constructor(private http: Http) { } + getModels(): Promise { + return this.http.get(this.apiUrl) + .toPromise() + .then(response => response.json()) + .catch(this.handleError); + } + private handleError(error: any): Promise { + console.error('An error occured', error); + return Promise.reject(error.message || error); + } +} diff --git a/src/services/bus-stop.service.ts b/src/services/bus-stop.service.ts new file mode 100644 index 0000000..bae51e2 --- /dev/null +++ b/src/services/bus-stop.service.ts @@ -0,0 +1,41 @@ +import { Injectable } from '@angular/core'; +import { Headers, Http } from '@angular/http'; + +import 'rxjs/add/operator/toPromise'; + +import { BusStop } from '../models/bus-stop'; + +@Injectable() +export class BusStopService { + private url = 'http://localhost:5000/busstop'; + private headers = new Headers({'Content-Type': 'application/json'}); + constructor(private http: Http) { } + getData(): Promise { + return this.http.get(this.url) + .toPromise() + .then(response => response.json().busStopEditDsM as BusStop[]) + .catch(this.handleError); + } + update(id: number, data: string): Promise { + return this.http.post(this.url + '/update?id=' + id, data, { headers: this.headers }) + .toPromise() + .then(response => response.json()) + .catch(this.handleError); + } + create(data: string): Promise { + return this.http.post(this.url + '/create', data, { headers: this.headers }) + .toPromise() + .then(response => response.json() as BusStop) + .catch(this.handleError); + } + delete(id: number): Promise { + return this.http.delete(this.url + '/delete?id=' + id, { headers: this.headers }) + .toPromise() + .then(response => response.json()) + .catch(this.handleError); + } + private handleError(error: any): Promise { + console.error('An error occured', error); + return Promise.reject(error.message || error); + } +} diff --git a/src/services/region-select-list.service.ts b/src/services/region-select-list.service.ts new file mode 100644 index 0000000..53125c2 --- /dev/null +++ b/src/services/region-select-list.service.ts @@ -0,0 +1,23 @@ +import { Injectable } from '@angular/core'; +import { Headers, Http } from '@angular/http'; + +import 'rxjs/add/operator/toPromise'; + +import { RegionSelectList } from '../models/region-select-list'; + +@Injectable() +export class RegionSelectListService { + private apiUrl = 'http://localhost:5000/directory/regionds'; + private headers = new Headers({'Content-Type': 'applicaton/json'}); + constructor(private http: Http) { } + getModels(): Promise { + return this.http.get(this.apiUrl) + .toPromise() + .then(response => response.json().regionSelectListDsM as RegionSelectList[]) + .catch(this.handleError); + } + private handleError(error: any): Promise { + console.error('An error occured', error); + return Promise.reject(error.message || error); + } +} diff --git a/src/services/road-select-list.service.ts b/src/services/road-select-list.service.ts new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/services/road-select-list.service.ts diff --git a/src/services/settlement-select-list.service.ts b/src/services/settlement-select-list.service.ts new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/services/settlement-select-list.service.ts diff --git a/src/services/state-common-selectlist.service.ts b/src/services/state-common-selectlist.service.ts new file mode 100644 index 0000000..af33b7c --- /dev/null +++ b/src/services/state-common-selectlist.service.ts @@ -0,0 +1,23 @@ +import { Injectable } from '@angular/core'; +import { Headers, Http } from '@angular/http'; + +import 'rxjs/add/operator/toPromise'; + +import { StateCommonSelectList } from '../models/state-common-select-list'; + +@Injectable() +export class StateCommonSelectListService { + private apiUrl = 'http://localhost:5000/directory/statecommonds'; + private headers = new Headers({'Content-Type': 'applicaton/json'}); + constructor(private http: Http) { } + getModels(): Promise { + return this.http.get(this.apiUrl) + .toPromise() + .then(response => response.json().stateCommonSelectListDsM as StateCommonSelectList[]) + .catch(this.handleError); + } + private handleError(error: any): Promise { + console.error('An error occured', error); + return Promise.reject(error.message || error); + } +} diff --git a/src/services/surface-type-select-list.service.ts b/src/services/surface-type-select-list.service.ts new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/services/surface-type-select-list.service.ts diff --git a/src/styles.scss b/src/styles.scss new file mode 100644 index 0000000..00e5f0c --- /dev/null +++ b/src/styles.scss @@ -0,0 +1,13 @@ +// Custom style for loading elements without height +.will-load { + min-height: 80px; +} +// Href line height wasn't right for md-icon-button +a[md-icon-button] { + line-height: 36px; +} + +// Capitalize +.text-capital { + text-transform: capitalize; +} \ No newline at end of file diff --git a/src/test.ts b/src/test.ts new file mode 100644 index 0000000..ae8e02e --- /dev/null +++ b/src/test.ts @@ -0,0 +1,33 @@ +import './polyfills.ts'; + +import 'zone.js/dist/long-stack-trace-zone'; +import 'zone.js/dist/proxy.js'; +import 'zone.js/dist/sync-test'; +import 'zone.js/dist/jasmine-patch'; +import 'zone.js/dist/async-test'; +import 'zone.js/dist/fake-async-test'; + +// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. +declare var __karma__: any; +declare var require: any; + +// Prevent Karma from running prematurely. +__karma__.loaded = function (): void { /* noop */ }; + +Promise.all([ + System.import('@angular/core/testing'), + System.import('@angular/platform-browser-dynamic/testing'), +]) + // First, initialize the Angular testing environment. + .then(([testing, testingBrowser]: any[]) => { + testing.getTestBed().initTestEnvironment( + testingBrowser.BrowserDynamicTestingModule, + testingBrowser.platformBrowserDynamicTesting(), + ); + }) + // Then we find all the tests. + .then(() => require.context('./', true, /\.spec\.ts/)) + // And load the modules. + .then((context: any) => context.keys().map(context)) + // Finally, start Karma to run the tests. + .then(__karma__.start, __karma__.error); diff --git a/src/theme.scss b/src/theme.scss new file mode 100644 index 0000000..8f5811a --- /dev/null +++ b/src/theme.scss @@ -0,0 +1,76 @@ +@import '~@angular/material/core/theming/all-theme'; +@import '~@covalent/core/theming/all-theme'; +@import '~@covalent/markdown/markdown-theme'; +@import '~@covalent/charts/charts-theme'; +@import '~@covalent/highlight/highlight-theme'; +// Plus imports for other components in your app. + +// Include the base styles for Angular Material core. We include this here so that you only +// have to load a single css file for Angular Material in your app. +@include md-core(); + +// Define the palettes for your theme using the Material Design palettes available in palette.scss +// (imported above). For each palette, you can optionally specify a default, lighter, and darker +// hue. +$primary: md-palette($md-blue, 700); +$accent: md-palette($md-orange, 800, A100, A400); + +// The warn palette is optional (defaults to red). +$warn: md-palette($md-red, 600); + +// Create the theme object (a Sass map containing all of the palettes). +$theme: md-light-theme($primary, $accent, $warn); + +// Include theme styles for core and each component used in your app. +// Alternatively, you can import and @include the theme mixins for each component +// that you are using. +@include angular-material-theme($theme); +@include covalent-theme($theme); +@include covalent-markdown-theme($theme); +@include covalent-charts-theme($theme); +@include covalent-highlight-theme(); + +// Active icon color in list nav +md-nav-list { + [md-list-item].active { + md-icon[md-list-avatar] { + background-color: md-color($accent); + color: md-color($accent, default-contrast) + } + md-icon[md-list-icon] { + color: md-color($accent); + } + } +} + +// Custom theme examples +.white-orange { + $primary2: md-palette($md-grey, 50); + $accent2: md-palette($md-orange, 800); + $warn2: md-palette($md-red, 600); + + $white-orange: md-light-theme($primary2, $accent2, $warn2); + + @include angular-material-theme($white-orange); + @include covalent-theme($white-orange); +} +.dark-grey-blue { + $primary3: md-palette($md-blue-grey, 800); + $accent3: md-palette($md-teal, 500); + $warn3: md-palette($md-red, 600); + + $dark-grey-blue: md-dark-theme($primary3, $accent3, $warn3); + + @include angular-material-theme($dark-grey-blue); + @include covalent-theme($dark-grey-blue); +} +.light-blue-red { + $primary4: md-palette($md-light-blue, 700); + $accent4: md-palette($md-red, 700); + $warn4: md-palette($md-deep-orange, 800); + + $light-blue-red: md-light-theme($primary4, $accent4, $warn4); + + @include angular-material-theme($light-blue-red); + @include covalent-theme($light-blue-red); +} \ No newline at end of file diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 0000000..1de6f1b --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "declaration": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "lib": ["es6", "dom"], + "module": "es6", + "moduleResolution": "node", + "outDir": "../dist/out-tsc", + "sourceMap": true, + "target": "es5", + "typeRoots": [ + "../node_modules/@types" + ], + "types": [ + "jasmine", "hammerjs" + ], + "noUnusedParameters": false, + "noUnusedLocals": false, + "allowUnreachableCode": false, + "pretty": true + }, + "exclude": [ + "**/*.spec.*" + ] +} diff --git a/src/typings.d.ts b/src/typings.d.ts new file mode 100644 index 0000000..10872d8 --- /dev/null +++ b/src/typings.d.ts @@ -0,0 +1,6 @@ +// Typings reference file, see links for more information +// https://github.com/typings/typings +// https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html + +declare var System: any; +declare var require: any; \ No newline at end of file diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..4231308 --- /dev/null +++ b/tslint.json @@ -0,0 +1,205 @@ +{ + "rulesDirectory": ["./node_modules/codelyzer"], + "rules": { + "align": [ + true, + "statements" + ], + "array-type": [ + true, + "array" + ], + "arrow-parens": true, + "ban": [ + true, + [] + ], + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": false, + "indent": [ + true, + "spaces" + ], + "interface-name": [ + true, + "always-prefix" + ], + "jsdoc-format": true, + "label-position": true, + "max-line-length": [true, 150], + "member-access": [ + false + ], + "member-ordering": [ + true, + { + "order" : [ + "private-static-field", + "protected-static-field", + "public-static-field", + "private-instance-field", + "protected-instance-field", + "public-instance-field", + "constructor", + "public-static-method", + "protected-static-method", + "private-static-method", + "public-instance-method", + "protected-instance-method", + "private-instance-method" + ] + } + ], + "new-parens": true, + "no-angle-bracket-type-assertion": false, + "no-any": false, + "no-arg": true, + "no-bitwise": true, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": [true], + "no-console": [ + true, + "assert", + "count", + "debug", + "dir", + "dirxml", + "error", + "group", + "groupCollapsed", + "groupEnd", + "info", + "log", + "profile", + "profileEnd", + "table", + "time", + "timeEnd", + "timeStamp", + "trace", + "warn" + ], + "no-construct": true, + "no-debugger": true, + "no-default-export": true, + "no-duplicate-variable": true, + "no-empty": true, + "no-empty-interface": false, + "no-eval": true, + "no-inferrable-types": [ + false, + "ignore-params" + ], + "no-internal-module": true, + "no-invalid-this": true, + "no-magic-numbers": false, //TODO_LINT (we should lint for this) + "no-namespace": true, + "no-null-keyword": true, + "no-reference": true, + "no-require-imports": true, + "no-shadowed-variable": true, + "no-string-literal": true, + "no-string-throw": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unused-expression": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "no-var-requires": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-catch", + "check-finally", + "check-else", + "check-open-brace", + "check-whitespace" + ], + "one-variable-per-declaration": true, + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "radix": true, + "semicolon": [ + true, + "always" + ], + "switch-default": true, + "trailing-comma": [ + true, + { + "multiline": "always", + "single": "always" + } + ], + "triple-equals": true, + "typedef": [ + true, + "call-signature", + "parameter", + "arrow-parameter", + "property-declaration", + "variable-declaration", + "member-variable-declaration" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "use-isnan": true, + "variable-name": [ + true, + "ban-keywords", + "check-format", + "allow-leading-underscore" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-type" + ], + // ANGULAR 2 Rules + "directive-selector": [true, "attribute", "qs", "camelCase"], + "component-selector": [true, "element", "qs", "kebab-case"], + "component-class-suffix": true, + "directive-class-suffix": true, + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-attribute-parameter-decorator": true, + "no-input-rename": false, // so we can rename @Input so we can change API easier -> @Input('rename') name + "no-output-rename": false, // same but for @Output + "no-forward-ref" : false, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "pipe-naming": [ + true, + "camelCase" + ] + } +} -- libgit2 0.21.4