From 2a8c76b70f65ccc3b3b892f43d5ae7349760c8aa Mon Sep 17 00:00:00 2001 From: Priyanka Arora Date: Fri, 14 Aug 2020 15:04:04 -0700 Subject: [PATCH 01/13] fix(draft): first draft --- angular.json | 3 + scripts/test-schematics.sh | 3 + src/lib/package-lock.json | 5 ++ src/lib/schematics/collection.json | 18 +++--- src/lib/schematics/ng-add/files/proxy.conf.js | 4 +- .../ng-add/files/src/app/app.routes.ts | 4 +- src/lib/schematics/ng-add/index.ts | 58 ++++++++++++++++--- src/lib/schematics/ng-add/schema.ts | 1 - src/lib/schematics/tsconfig.json | 45 +++++++------- src/lib/schematics/tsconfig.spec.json | 23 ++++---- src/lib/theme/_mixins.scss | 45 +++++++------- 11 files changed, 129 insertions(+), 80 deletions(-) create mode 100644 src/lib/package-lock.json diff --git a/angular.json b/angular.json index 91047b6..1f4081f 100644 --- a/angular.json +++ b/angular.json @@ -155,5 +155,8 @@ "@schematics/angular:directive": { "prefix": "app" } + }, + "cli": { + "analytics": false } } diff --git a/scripts/test-schematics.sh b/scripts/test-schematics.sh index ca09fdf..854d187 100755 --- a/scripts/test-schematics.sh +++ b/scripts/test-schematics.sh @@ -10,6 +10,9 @@ npm link cd /tmp rm -rf testxyz ng new testxyz +cd testxyz +ng add @angular/material +ng add @covalent/core # Run covalent schematics cd testxyz diff --git a/src/lib/package-lock.json b/src/lib/package-lock.json new file mode 100644 index 0000000..93dcfca --- /dev/null +++ b/src/lib/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "@td-vantage/ui-platform", + "version": "0.0.0-PLATFORM", + "lockfileVersion": 1 +} diff --git a/src/lib/schematics/collection.json b/src/lib/schematics/collection.json index 5ee1182..272383b 100644 --- a/src/lib/schematics/collection.json +++ b/src/lib/schematics/collection.json @@ -1,11 +1,11 @@ { - "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json", - "schematics": { - "ng-add": { - "description": "Adds vantage ui platform to the application without affecting any templates", - "factory": "./ng-add/index#addDependenciesAndFiles", - "schema": "./ng-add/schema.json", - "aliases": ["vantage-shell", "install"] - } + "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json", + "schematics": { + "ng-add": { + "description": "Adds vantage ui platform to the application without affecting any templates", + "factory": "./ng-add/index#addDependenciesAndFiles", + "schema": "./ng-add/schema.json", + "aliases": ["vantage-shell", "install"] } - } \ No newline at end of file + } +} diff --git a/src/lib/schematics/ng-add/files/proxy.conf.js b/src/lib/schematics/ng-add/files/proxy.conf.js index 382338f..f5781ca 100644 --- a/src/lib/schematics/ng-add/files/proxy.conf.js +++ b/src/lib/schematics/ng-add/files/proxy.conf.js @@ -6,8 +6,8 @@ const vantageLoginProxyConfig = require('./src/lib/auth/config/vantageLoginProxy /* * * * * * * * * * * */ const serverUrl = 'https://vantage.url.io'; // REPLACE WITH VANTAGE BASE URL -const localUrl = "localhost:4200"; -const localProto = "http"; // http or https +const localUrl = 'localhost:4200'; +const localProto = 'http'; // http or https /* * * * * * * * * * * */ /* This section contains the routes proxied through */ diff --git a/src/lib/schematics/ng-add/files/src/app/app.routes.ts b/src/lib/schematics/ng-add/files/src/app/app.routes.ts index e077bec..26cce39 100644 --- a/src/lib/schematics/ng-add/files/src/app/app.routes.ts +++ b/src/lib/schematics/ng-add/files/src/app/app.routes.ts @@ -11,8 +11,6 @@ const routes: Routes = [ { path: '**', redirectTo: '/' }, ]; -export const appRoutingProviders: any[] = [ - VantageAuthenticationGuard, -]; +export const appRoutingProviders: any[] = [VantageAuthenticationGuard]; export const appRoutes: any = RouterModule.forRoot(routes); diff --git a/src/lib/schematics/ng-add/index.ts b/src/lib/schematics/ng-add/index.ts index ef6e491..7322d75 100644 --- a/src/lib/schematics/ng-add/index.ts +++ b/src/lib/schematics/ng-add/index.ts @@ -1,4 +1,17 @@ -import { Rule, chain, Tree, mergeWith, url, apply, branchAndMerge, SchematicsException, template, UpdateRecorder } from '@angular-devkit/schematics'; +import { + Rule, + chain, + Tree, + mergeWith, + url, + apply, + branchAndMerge, + SchematicsException, + template, + UpdateRecorder, + FileEntry, + SchematicContext, +} from '@angular-devkit/schematics'; import { addPackageToPackageJson } from '@angular/material/schematics/ng-add/package-config'; import { uiPlatformVersion } from '../version-names'; import { ISchema } from './schema'; @@ -10,7 +23,7 @@ import { InsertChange } from '@schematics/angular/utility/change'; import { getAppModulePath } from '@schematics/angular/utility/ng-ast-utils'; import { getWorkspace } from '@schematics/angular/utility/config'; import { experimental } from '@angular-devkit/core'; -import { getSourceFile, getProjectMainFile } from '@angular/cdk/schematics/utils'; +import { getSourceFile, getProjectMainFile, getProjectStyleFile } from '@angular/cdk/schematics/utils'; import { SourceFile } from 'typescript'; import { Change } from '@schematics/angular/utility/change'; @@ -20,11 +33,13 @@ export function addDependenciesAndFiles(options: ISchema): Rule { }; let ruleSet: Rule[] = [addVantagePacakgeRule]; - - if (options.ssoServerURL && options.ssoServerURL.trim().length) { // enable SSO + + if (options.ssoServerURL && options.ssoServerURL.trim().length) { + // enable SSO ruleSet.push(mergeFiles(options)); ruleSet.push(addSSOImports); - } + ruleSet.push(updateStyles); + } return chain(ruleSet); } @@ -38,7 +53,36 @@ function mergeFiles(options: ISchema): Rule { return branchAndMerge(mergeWith(templateSource)); } -function addSSOImports(): Rule { +function updateStyles(): Rule { + return (host: Tree, context: SchematicContext) => { + const workspace: experimental.workspace.WorkspaceSchema = getWorkspace(host); + const project: experimental.workspace.WorkspaceProject = getProjectFromWorkspace(workspace); + const styleFilePath: string = getProjectStyleFile(project); + + const file: Buffer = host.read(styleFilePath); + + const themeFile: FileEntry = host.get('theme.scss'); + // context.logger.log('info', themeFile.content.toString()); + // if (!themeFile) { + // throw new SchematicsException('Please install covalent core.'); + // } + + // if(file && themeFile) { + context.logger.log('info', themeFile.content.toString()); + const fileContent: string = file.toString(); + const content: string = themeFile.content.toString(); + + if (content) { + host.overwrite(styleFilePath, fileContent + '\n' + content); + } + host.delete('theme.scss'); + // } + + return host; + }; +} + +function addSSOImports(): Rule { return (host: Tree) => { const workspace: experimental.workspace.WorkspaceSchema = getWorkspace(host); const project: experimental.workspace.WorkspaceProject = getProjectFromWorkspace(workspace); @@ -53,7 +97,7 @@ function addSSOImports(): Rule { addModuleImportToRootModule(host, `CovalentHttpModule.forRoot()`, '@covalent/http', project); replaceContentInAppModule(host, `CovalentHttpModule.forRoot()`, replacementString); addModuleImportToRootModule(host, 'appRoutes', './app.routes', project); - + addProvider(host, `VantageAuthenticationInterceptor`, '@td-vantage/ui-platform/auth'); addProvider(host, `appRoutingProviders`, './app.routes'); }; diff --git a/src/lib/schematics/ng-add/schema.ts b/src/lib/schematics/ng-add/schema.ts index e0252a9..2b5a1a0 100644 --- a/src/lib/schematics/ng-add/schema.ts +++ b/src/lib/schematics/ng-add/schema.ts @@ -1,5 +1,4 @@ export interface ISchema { /** Whether SSO should be set up. */ ssoServerURL: string; - } diff --git a/src/lib/schematics/tsconfig.json b/src/lib/schematics/tsconfig.json index 972d367..41441a0 100644 --- a/src/lib/schematics/tsconfig.json +++ b/src/lib/schematics/tsconfig.json @@ -1,24 +1,23 @@ { - "compileOnSave": false, - "compilerOptions": { - "rootDir": "./", - "baseUrl": "./", - "declaration": false, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "outDir": "../../../../deploy/ui-platform/schematics", - "lib": ["es2017", "dom"], - "moduleResolution": "node", - "sourceMap": true, - "target": "es5", - "typeRoots": ["./../../../../node_modules/@types"], - "noUnusedParameters": false, - "noUnusedLocals": false, - "allowUnreachableCode": false, - "pretty": true, - "importHelpers": true - }, - "include": ["**/*"], - "exclude": ["**/*.spec.ts", "**/files/**/*"] - } - \ No newline at end of file + "compileOnSave": false, + "compilerOptions": { + "rootDir": "./", + "baseUrl": "./", + "declaration": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "outDir": "../../../../deploy/ui-platform/schematics", + "lib": ["es2017", "dom"], + "moduleResolution": "node", + "sourceMap": true, + "target": "es5", + "typeRoots": ["./../../../../node_modules/@types"], + "noUnusedParameters": false, + "noUnusedLocals": false, + "allowUnreachableCode": false, + "pretty": true, + "importHelpers": true + }, + "include": ["**/*"], + "exclude": ["**/*.spec.ts", "**/files/**/*"] +} diff --git a/src/lib/schematics/tsconfig.spec.json b/src/lib/schematics/tsconfig.spec.json index b90b028..9775e29 100644 --- a/src/lib/schematics/tsconfig.spec.json +++ b/src/lib/schematics/tsconfig.spec.json @@ -1,13 +1,12 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./", - "lib": ["es6", "dom"], - "module": "commonjs", - "types": ["jasmine", "hammerjs", "node"] - }, - "include": ["**/*", "**/*.spec.ts"], - "exclude": ["*/files/**/*", "*/files/**/**/*"] - } - \ No newline at end of file + "extends": "../../../tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./", + "lib": ["es6", "dom"], + "module": "commonjs", + "types": ["jasmine", "hammerjs", "node"] + }, + "include": ["**/*", "**/*.spec.ts"], + "exclude": ["*/files/**/*", "*/files/**/**/*"] +} diff --git a/src/lib/theme/_mixins.scss b/src/lib/theme/_mixins.scss index c29507b..cc5f77f 100644 --- a/src/lib/theme/_mixins.scss +++ b/src/lib/theme/_mixins.scss @@ -1,33 +1,32 @@ // Helper mixins for Teradata Brand palettes -// +// // Mixins here loop over Teradata brand palette and create classes to be used // in Teradata Products. - // Text color palette mixin -@mixin tc($palette, $name, $default){ +@mixin tc($palette, $name, $default) { .tc-#{$name} { - color: map-get($palette, $default) - } - @each $size,$color in $palette { - @if $size != contrast { - .tc-#{$name}-#{$size} { - color: $color - } - } - } + color: map-get($palette, $default); + } + @each $size, $color in $palette { + @if $size != contrast { + .tc-#{$name}-#{$size} { + color: $color; + } + } + } } // Background color palette mixin -@mixin bgc($palette, $name, $default){ +@mixin bgc($palette, $name, $default) { .bgc-#{$name} { - color: map-get($palette, $default) - } - @each $size,$color in $palette { - @if $size != contrast { - .bgc-#{$name}-#{$size} { - color: $color - } - } - } -} \ No newline at end of file + color: map-get($palette, $default); + } + @each $size, $color in $palette { + @if $size != contrast { + .bgc-#{$name}-#{$size} { + color: $color; + } + } + } +} From 27409538af58e235156aa690652725092c437e19 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 25 Aug 2020 14:41:03 -0700 Subject: [PATCH 02/13] feat(): assets service (#120) * feat(assets-service): http service for deriving help, etc * feat(assets-service): service to retrieve vantage assets * feat(assets-service): removed console log * feat(assets-service): removed unneeded dependency * fix(): use proxy.conf.js in angular.json when running ng serve * feat(assets-service): cleaned up demo Co-authored-by: js186150 --- angular.json | 6 ++- package-lock.json | 2 +- proxy.conf.js | 5 +++ src/docs-ui/app/app.module.ts | 6 +++ src/docs-ui/app/demos/demos.component.html | 10 +++++ src/docs-ui/app/demos/demos.component.ts | 10 +++++ src/lib/assets/assets.module.ts | 9 ++++ src/lib/assets/assets.service.ts | 52 ++++++++++++++++++++++ src/lib/assets/index.ts | 1 + src/lib/assets/package.json | 10 +++++ src/lib/assets/public_api.ts | 2 + 11 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 src/lib/assets/assets.module.ts create mode 100644 src/lib/assets/assets.service.ts create mode 100644 src/lib/assets/index.ts create mode 100644 src/lib/assets/package.json create mode 100644 src/lib/assets/public_api.ts diff --git a/angular.json b/angular.json index bfae178..3056771 100644 --- a/angular.json +++ b/angular.json @@ -69,11 +69,13 @@ "serve": { "builder": "@angular-builders/custom-webpack:dev-server", "options": { - "browserTarget": "docs-ui:build" + "browserTarget": "docs-ui:build", + "proxyConfig": "./proxy.conf.js" }, "configurations": { "production": { - "browserTarget": "docs-ui:build:production" + "browserTarget": "docs-ui:build:production", + "proxyConfig": "./proxy.conf.js" } } }, diff --git a/package-lock.json b/package-lock.json index cddf52b..424195d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3887,7 +3887,7 @@ } }, "@covalent/core": { - "version": "git+https://github.com/Teradata/covalent-nightly.git#47bd083adaf527144fd23e15e074013e01c720ce", + "version": "git+https://github.com/Teradata/covalent-nightly.git#63f97545bad77146266d49015f629096958a3372", "from": "git+https://github.com/Teradata/covalent-nightly.git" }, "@covalent/echarts": { diff --git a/proxy.conf.js b/proxy.conf.js index f5781ca..a2104f3 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -21,6 +21,11 @@ const PROXY_CONFIG = { secure: false, changeOrigin: true, }, + '/vantage-assets': { + target: serverUrl, + secure: false, + changeOrigin: true, + }, }; module.exports = PROXY_CONFIG; diff --git a/src/docs-ui/app/app.module.ts b/src/docs-ui/app/app.module.ts index bd5b74a..0f0b254 100644 --- a/src/docs-ui/app/app.module.ts +++ b/src/docs-ui/app/app.module.ts @@ -38,12 +38,14 @@ import { MatSortModule } from '@angular/material/sort'; import { MatPaginatorModule } from '@angular/material/paginator'; import { CovalentCommonModule } from '@covalent/core/common'; +import { CovalentDynamicMenuModule } from '@covalent/core/dynamic-menu'; import { CovalentLayoutModule } from '@covalent/core/layout'; import { CovalentMessageModule } from '@covalent/core/message'; import { CovalentLoadingModule } from '@covalent/core/loading'; import { CovalentDialogsModule } from '@covalent/core/dialogs'; import { CovalentMediaModule } from '@covalent/core/media'; import { CovalentBreadcrumbsModule } from '@covalent/core/breadcrumbs'; +import { CovalentJsonFormatterModule } from '@covalent/core/json-formatter'; import { CovalentMarkdownNavigatorModule } from '@covalent/markdown-navigator'; @@ -53,6 +55,7 @@ import { VantageUserFeedbackModule } from '@td-vantage/ui-platform/utilities'; import { VantageUserModule } from '@td-vantage/ui-platform/user'; import { VantageAuthenticationModule } from '@td-vantage/ui-platform/auth'; import { VantageAccessModule } from '@td-vantage/ui-platform/access'; +import { VantageAssetsModule } from '@td-vantage/ui-platform/assets'; import { VantageThemeModule } from '@td-vantage/ui-platform/theme'; import { VantageSQLEModule } from '@td-vantage/ui-platform/sqle'; import { VantageAppSwitcherModule } from '@td-vantage/ui-platform/app-switcher'; @@ -123,6 +126,7 @@ import { IconsDemoComponent } from './icons-demo/icons-demo.component'; MatPaginatorModule, /** Covalent Modules */ CovalentCommonModule, + CovalentDynamicMenuModule, CovalentLayoutModule, CovalentBreadcrumbsModule, CovalentMediaModule, @@ -130,6 +134,7 @@ import { IconsDemoComponent } from './icons-demo/icons-demo.component'; CovalentLoadingModule, CovalentMessageModule, CovalentMarkdownNavigatorModule, + CovalentJsonFormatterModule, TranslateModule.forRoot(), CovalentHttpModule.forRoot(), @@ -137,6 +142,7 @@ import { IconsDemoComponent } from './icons-demo/icons-demo.component'; VantageUserModule, VantageAuthenticationModule, VantageAccessModule, + VantageAssetsModule, VantageThemeModule, VantageAppSwitcherModule, VantageSQLEModule, diff --git a/src/docs-ui/app/demos/demos.component.html b/src/docs-ui/app/demos/demos.component.html index 9ad8e32..c1605cf 100644 --- a/src/docs-ui/app/demos/demos.component.html +++ b/src/docs-ui/app/demos/demos.component.html @@ -33,6 +33,16 @@

Connections:

+
+

Assets Module

+

Help JSON

+ +

Help Contents:

+ +
+

Utilities Module

Error Dialog

diff --git a/src/docs-ui/app/demos/demos.component.ts b/src/docs-ui/app/demos/demos.component.ts index 785e746..3a8a4a7 100644 --- a/src/docs-ui/app/demos/demos.component.ts +++ b/src/docs-ui/app/demos/demos.component.ts @@ -5,6 +5,7 @@ import { VantageCredentialsDialogComponent, VantageConnectionService } from '@td import { VantageErrorService } from '@td-vantage/ui-platform/utilities'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; +import { VantageAssetsService, IHelpAssets } from '@td-vantage/ui-platform/assets'; @Component({ selector: 'app-demos', @@ -14,11 +15,14 @@ import { takeUntil } from 'rxjs/operators'; export class DemosComponent implements OnInit, OnDestroy { private unsubscribe: Subject = new Subject(); + helpJSON: IHelpAssets; + constructor( public _themeService: VantageThemeService, private _dialog: MatDialog, private _errorService: VantageErrorService, public connectionService: VantageConnectionService, + public assetsService: VantageAssetsService, ) {} ngOnInit(): void { @@ -62,4 +66,10 @@ export class DemosComponent implements OnInit, OnDestroy { error, }); } + + getHelpJSON(): void { + this.assetsService.getHelpJSON().subscribe((helpJSON: IHelpAssets) => { + this.helpJSON = helpJSON; + }); + } } diff --git a/src/lib/assets/assets.module.ts b/src/lib/assets/assets.module.ts new file mode 100644 index 0000000..0c91f32 --- /dev/null +++ b/src/lib/assets/assets.module.ts @@ -0,0 +1,9 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { VANTAGE_ASSETS_PROVIDER } from './assets.service'; + +@NgModule({ + imports: [CommonModule], + providers: [VANTAGE_ASSETS_PROVIDER], +}) +export class VantageAssetsModule {} diff --git a/src/lib/assets/assets.service.ts b/src/lib/assets/assets.service.ts new file mode 100644 index 0000000..e859cf0 --- /dev/null +++ b/src/lib/assets/assets.service.ts @@ -0,0 +1,52 @@ +import { map, catchError } from 'rxjs/operators'; +import { Injectable, Optional, SkipSelf, Provider } from '@angular/core'; +import { HttpHeaders, HttpResponse } from '@angular/common/http'; +import { mixinHttp, TdGET, TdResponse } from '@covalent/http'; +import { Observable, of } from 'rxjs'; + +import { IMenuItem } from '@covalent/core/dynamic-menu'; + +export interface IHelpAssets { + [name: string]: { + links: IMenuItem[]; + }; +} + +@Injectable() +export class VantageAssetsService extends mixinHttp(class {}, { + baseUrl: '/vantage-assets', + baseHeaders: new HttpHeaders({ + Accept: 'application/json', + }), +}) { + /** + * Retrieve the help JSON definition asset + */ + @TdGET({ + path: '/json/help/help.json', + options: { + observe: 'response', + }, + }) + getHelpJSON(@TdResponse() response?: Observable>): Observable { + return response.pipe( + catchError((error: Response) => { + return of(error); + }), + map((res: HttpResponse) => { + return res.body; + }), + ); + } +} + +export function VANTAGE_ASSETS_PROVIDER_FACTORY(parent: VantageAssetsService): VantageAssetsService { + return parent || new VantageAssetsService(); +} + +export const VANTAGE_ASSETS_PROVIDER: Provider = { + // If there is already a service available, use that. Otherwise, provide a new one. + provide: VantageAssetsService, + deps: [[new Optional(), new SkipSelf(), VantageAssetsService]], + useFactory: VANTAGE_ASSETS_PROVIDER_FACTORY, +}; diff --git a/src/lib/assets/index.ts b/src/lib/assets/index.ts new file mode 100644 index 0000000..4aaf8f9 --- /dev/null +++ b/src/lib/assets/index.ts @@ -0,0 +1 @@ +export * from './public_api'; diff --git a/src/lib/assets/package.json b/src/lib/assets/package.json new file mode 100644 index 0000000..5255d3a --- /dev/null +++ b/src/lib/assets/package.json @@ -0,0 +1,10 @@ +{ + "ngPackage": { + "lib": { + "entryFile": "index.ts", + "umdModuleIds": { + "@covalent/http": "covalent.http" + } + } + } +} diff --git a/src/lib/assets/public_api.ts b/src/lib/assets/public_api.ts new file mode 100644 index 0000000..8029ace --- /dev/null +++ b/src/lib/assets/public_api.ts @@ -0,0 +1,2 @@ +export * from './assets.module'; +export * from './assets.service'; From 01227c8b9977a3d75d0ca5052ec67b004b358adc Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 26 Aug 2020 13:10:31 -0700 Subject: [PATCH 03/13] feat(assets-url-change): relocated assets service url (#121) --- proxy.conf.js | 2 +- src/lib/assets/assets.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy.conf.js b/proxy.conf.js index a2104f3..aa39b15 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -21,7 +21,7 @@ const PROXY_CONFIG = { secure: false, changeOrigin: true, }, - '/vantage-assets': { + '/ui-assets': { target: serverUrl, secure: false, changeOrigin: true, diff --git a/src/lib/assets/assets.service.ts b/src/lib/assets/assets.service.ts index e859cf0..e41789b 100644 --- a/src/lib/assets/assets.service.ts +++ b/src/lib/assets/assets.service.ts @@ -14,7 +14,7 @@ export interface IHelpAssets { @Injectable() export class VantageAssetsService extends mixinHttp(class {}, { - baseUrl: '/vantage-assets', + baseUrl: '/ui-assets', baseHeaders: new HttpHeaders({ Accept: 'application/json', }), From dec86423b82912c0590c08eb655dd45a9b054d53 Mon Sep 17 00:00:00 2001 From: "Lennan, Thomas R" Date: Wed, 2 Sep 2020 15:19:25 -0700 Subject: [PATCH 04/13] fix(app-switcher-close): close exp panel on menu close, detect changes --- .../app-switcher-menu/app-switcher-menu.component.html | 1 + .../app-switcher-menu/app-switcher-menu.component.ts | 9 +++++++-- src/lib/app-switcher/app-switcher.component.html | 3 ++- src/lib/app-switcher/app-switcher.component.ts | 8 +++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.html b/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.html index cb17c1c..03bcea9 100644 --- a/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.html +++ b/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.html @@ -43,6 +43,7 @@ { const elem: HTMLElement = this.elRef.nativeElement.querySelector('.td-menu-content'); elem.scrollTop = elem.scrollHeight; diff --git a/src/lib/app-switcher/app-switcher.component.html b/src/lib/app-switcher/app-switcher.component.html index dcb9c0a..fe75829 100644 --- a/src/lib/app-switcher/app-switcher.component.html +++ b/src/lib/app-switcher/app-switcher.component.html @@ -1,8 +1,9 @@ - + Date: Wed, 2 Sep 2020 18:45:50 -0400 Subject: [PATCH 05/13] feat(): add notification node icon (#119) Co-authored-by: Adam Nelson Co-authored-by: Jeremy Smartt --- src/lib/theme/icons/teradata-icons.svg | 7 ++++++- src/lib/theme/utilities/icons.ts | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/theme/icons/teradata-icons.svg b/src/lib/theme/icons/teradata-icons.svg index 3554067..0d5d12f 100644 --- a/src/lib/theme/icons/teradata-icons.svg +++ b/src/lib/theme/icons/teradata-icons.svg @@ -130,7 +130,7 @@ - + @@ -138,6 +138,11 @@ + + + + + diff --git a/src/lib/theme/utilities/icons.ts b/src/lib/theme/utilities/icons.ts index 1c42b3a..a1326eb 100644 --- a/src/lib/theme/utilities/icons.ts +++ b/src/lib/theme/utilities/icons.ts @@ -34,6 +34,7 @@ export const TD_ICONS: TdIcon[] = [ 'no_results', 'node_branch', 'node_merge', + 'node_notification', 'object_storage', 'operations', 'operators_divide', @@ -125,6 +126,7 @@ export type TdIcon = | 'no_results' | 'node_branch' | 'node_merge' + | 'node_notification' | 'object_storage' | 'operations' | 'operators_divide' From 5c5c09d25aa7972746639c0261074ca362314d67 Mon Sep 17 00:00:00 2001 From: Julie Knowles Date: Wed, 2 Sep 2020 16:19:27 -0700 Subject: [PATCH 06/13] Create PULL_REQUEST_TEMPATE.md --- .github/PULL_REQUEST_TEMPATE.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPATE.md diff --git a/.github/PULL_REQUEST_TEMPATE.md b/.github/PULL_REQUEST_TEMPATE.md new file mode 100644 index 0000000..622e729 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPATE.md @@ -0,0 +1,26 @@ +## Description + + +### What's included? + +- One +- Two +- Three + +#### Test Steps + +- [ ] `npm ci` +- [ ] In `proxy.conf.js` file, change serverUrl to `https://appcenter.ux.ac.uda.io` +- [ ] `npm run serve` +- [ ] then this +- [ ] finally this + +#### General Tests for Every PR + +- [ ] `npm run serve:prod` still works. +- [ ] `npm run tslint` passes. +- [ ] `npm run stylelint` passes. +- [ ] `npm test` passes and code coverage is not lower. +- [ ] `npm run build:lib` still works. + +##### Screenshots or link to StackBlitz/Plunker From ae53957a9ebd00cbd3774e241f047cbe4178fc10 Mon Sep 17 00:00:00 2001 From: "Lennan, Thomas R" Date: Wed, 2 Sep 2020 17:30:04 -0700 Subject: [PATCH 07/13] fix(app-switcher-close): more change detection --- .../app-switcher-menu/app-switcher-menu.component.ts | 1 + src/lib/app-switcher/app-switcher.component.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.ts b/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.ts index a3ad590..d1b2adf 100644 --- a/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.ts +++ b/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.ts @@ -29,6 +29,7 @@ export class VantageAppSwitcherMenuComponent { setTimeout(() => { const elem: HTMLElement = this.elRef.nativeElement.querySelector('.td-menu-content'); elem.scrollTop = elem.scrollHeight; + this._changeDetectorRef.detectChanges(); }); } } diff --git a/src/lib/app-switcher/app-switcher.component.ts b/src/lib/app-switcher/app-switcher.component.ts index 13a7930..f87cfc3 100644 --- a/src/lib/app-switcher/app-switcher.component.ts +++ b/src/lib/app-switcher/app-switcher.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, Input, ViewChild } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, ViewChild, ChangeDetectorRef } from '@angular/core'; import { IVantageAppSwitcherItem } from './services/products.service'; import { VantageAppSwitcherMenuComponent } from './app-switcher-menu/app-switcher-menu.component'; @@ -15,7 +15,10 @@ export class VantageAppSwitcherComponent { @Input() exploreMoreLink: string; @ViewChild('appSwitcherMenu', { static: true }) appSwitcherMenu: VantageAppSwitcherMenuComponent; + constructor(private _changeDetectorRef: ChangeDetectorRef) {} + menuClosed(): void { this.appSwitcherMenu.expansionPanel.close(); + this._changeDetectorRef.detectChanges(); } } From e09d5a45a91ba35dacb0e079f41909e4bd9b1414 Mon Sep 17 00:00:00 2001 From: "Lennan, Thomas R" Date: Wed, 2 Sep 2020 17:32:25 -0700 Subject: [PATCH 08/13] fix(app-switcher-close): updated demo links --- src/docs-ui/app/app.component.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/docs-ui/app/app.component.ts b/src/docs-ui/app/app.component.ts index 56e4bc1..90b11e6 100644 --- a/src/docs-ui/app/app.component.ts +++ b/src/docs-ui/app/app.component.ts @@ -13,29 +13,29 @@ export class AppComponent { products: IVantageAppSwitcherItem[] = [ { text: 'Vantage Launcher', - href: 'http://teradata.com', + href: 'https://www.teradata.com', svgIcon: 'td-logo:logo-mark', divider: true, }, { text: 'Editor', - href: 'http://teradata.com', + href: 'https://www.teradata.com', icon: 'settings', }, { text: 'Analyst', - href: 'http://teradata.com', + href: 'https://www.teradata.com', icon: 'settings', }, { text: 'App Center', - href: 'http://teradata.com', + href: 'https://www.teradata.com', newTab: false, }, { text: 'Console', - href: 'http://teradata.com', + href: 'https://www.teradata.com', icon: 'settings', newTab: true, }, @@ -44,24 +44,24 @@ export class AppComponent { otherProducts: IVantageAppSwitcherItem[] = [ { text: 'Jupyter', - href: 'http://teradata.com', + href: 'https://www.teradata.com', icon: 'settings', newTab: true, }, { text: 'Something else', - href: 'http://teradata.com', + href: 'https://www.teradata.com', icon: 'settings', }, { text: 'Another thing', - href: 'http://teradata.com', + href: 'https://www.teradata.com', icon: 'settings', newTab: false, }, ]; - exploreMoreLink: string = 'http://teradata.com/products'; + exploreMoreLink: string = 'https://www.teradata.com/products'; constructor( private _iconRegistry: MatIconRegistry, From 171645c01ab818f1240245cf6c102ed431c0b9d4 Mon Sep 17 00:00:00 2001 From: "Lennan, Thomas R" Date: Thu, 3 Sep 2020 09:13:33 -0700 Subject: [PATCH 09/13] fix(app-switcher-close): reverted menu component change detection --- .../app-switcher-menu/app-switcher-menu.component.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.ts b/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.ts index d1b2adf..a68321d 100644 --- a/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.ts +++ b/src/lib/app-switcher/app-switcher-menu/app-switcher-menu.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, Input, ElementRef, ViewChild, ChangeDetectorRef } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, ElementRef, ViewChild } from '@angular/core'; import { MatExpansionPanel } from '@angular/material/expansion'; @@ -17,7 +17,7 @@ export class VantageAppSwitcherMenuComponent { @ViewChild('expansionPanel') expansionPanel: MatExpansionPanel; - constructor(private elRef: ElementRef, private _changeDetectorRef: ChangeDetectorRef) {} + constructor(private elRef: ElementRef) {} _blockEvent(event: Event): void { event.preventDefault(); @@ -25,11 +25,9 @@ export class VantageAppSwitcherMenuComponent { } scrollToBottom(): void { - this._changeDetectorRef.detectChanges(); setTimeout(() => { const elem: HTMLElement = this.elRef.nativeElement.querySelector('.td-menu-content'); elem.scrollTop = elem.scrollHeight; - this._changeDetectorRef.detectChanges(); }); } } From 1f6ae9a2cd2656c5040c85e256c6a0998a91119f Mon Sep 17 00:00:00 2001 From: jk250044 Date: Thu, 3 Sep 2020 13:53:15 -0700 Subject: [PATCH 10/13] feat(): generate changelog and bump to version v1.0.0-beta.5 --- docs/CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 81aae6a..350e851 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,36 @@ + + +# [1.0.0-beta.5](https://github.com/Teradata/vantage-ui-platform/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2020-09-03) + +### Bug Fixes + +- firefox bfCache caching ([#113](https://github.com/Teradata/vantage-ui-platform/issues/113)) ([7b10c04](https://github.com/Teradata/vantage-ui-platform/commit/7b10c04)) +- **app-switcher-close:** close exp panel on menu close, detect changes ([dec8642](https://github.com/Teradata/vantage-ui-platform/commit/dec8642)) +- **app-switcher-close:** more change detection ([ae53957](https://github.com/Teradata/vantage-ui-platform/commit/ae53957)) +- **app-switcher-close:** reverted menu component change detection ([171645c](https://github.com/Teradata/vantage-ui-platform/commit/171645c)) +- **app-switcher-close:** updated demo links ([e09d5a4](https://github.com/Teradata/vantage-ui-platform/commit/e09d5a4)) +- **build:** missing directory ([#118](https://github.com/Teradata/vantage-ui-platform/issues/118)) ([6b437a7](https://github.com/Teradata/vantage-ui-platform/commit/6b437a7)) +- **color:** set body color based on mode ([3409f1f](https://github.com/Teradata/vantage-ui-platform/commit/3409f1f)) +- **query:** update data iinterface ([#111](https://github.com/Teradata/vantage-ui-platform/issues/111)) ([c9e55f7](https://github.com/Teradata/vantage-ui-platform/commit/c9e55f7)) + +### Features + +- **app-switcher:** Allow for open in new tab ([#108](https://github.com/Teradata/vantage-ui-platform/issues/108)) ([20bced8](https://github.com/Teradata/vantage-ui-platform/commit/20bced8)) +- **assets-url-change:** relocated assets service url ([#121](https://github.com/Teradata/vantage-ui-platform/issues/121)) ([01227c8](https://github.com/Teradata/vantage-ui-platform/commit/01227c8)) +- **num-vals-as-str:** result set numeric values as strings ([#106](https://github.com/Teradata/vantage-ui-platform/issues/106)) ([778bddf](https://github.com/Teradata/vantage-ui-platform/commit/778bddf)) +- **nums-as-strings:** define interface for column metadata ([#109](https://github.com/Teradata/vantage-ui-platform/issues/109)) ([89bbca7](https://github.com/Teradata/vantage-ui-platform/commit/89bbca7)) +- **query:** add column types ([#112](https://github.com/Teradata/vantage-ui-platform/issues/112)) ([68ec52e](https://github.com/Teradata/vantage-ui-platform/commit/68ec52e)) +- **vui-user-profile:** add component ([#104](https://github.com/Teradata/vantage-ui-platform/issues/104)) ([8cc090c](https://github.com/Teradata/vantage-ui-platform/commit/8cc090c)) +- add notification node icon ([#119](https://github.com/Teradata/vantage-ui-platform/issues/119)) ([df9aa62](https://github.com/Teradata/vantage-ui-platform/commit/df9aa62)) +- assets service ([#120](https://github.com/Teradata/vantage-ui-platform/issues/120)) ([2740953](https://github.com/Teradata/vantage-ui-platform/commit/2740953)) +- long form small scale styles and markdown update ([#117](https://github.com/Teradata/vantage-ui-platform/issues/117)) ([2e3c114](https://github.com/Teradata/vantage-ui-platform/commit/2e3c114)) +- new icons and icon view ([#116](https://github.com/Teradata/vantage-ui-platform/issues/116)) ([3b608d5](https://github.com/Teradata/vantage-ui-platform/commit/3b608d5)) +- update createsession method with default payload param ([#107](https://github.com/Teradata/vantage-ui-platform/issues/107)) ([36a5b8f](https://github.com/Teradata/vantage-ui-platform/commit/36a5b8f)) + +### Reverts + +- **account-profile:** depracting account-profile for covalent version ([#103](https://github.com/Teradata/vantage-ui-platform/issues/103)) ([f66cf1d](https://github.com/Teradata/vantage-ui-platform/commit/f66cf1d)) + # [1.0.0-beta.4](https://github.com/Teradata/vantage-ui-platform/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2020-06-02) diff --git a/package.json b/package.json index 57701f2..772b257 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@td-vantage/ui-platform", - "version": "1.0.0-beta.4", + "version": "1.0.0-beta.5", "description": "Teradata Vantage Angular Platform for easy integration and usage", "keywords": [ "teradata", @@ -110,4 +110,4 @@ "tsickle": "0.35.0", "typescript": "~3.7.5" } -} \ No newline at end of file +} From b128034c43337fb2c3dacae588d13b6c380b27d5 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 9 Sep 2020 09:46:31 -0700 Subject: [PATCH 11/13] feat(learn-links): support dynamic learn links (#124) --- src/lib/assets/assets.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/assets/assets.service.ts b/src/lib/assets/assets.service.ts index e41789b..f3a5301 100644 --- a/src/lib/assets/assets.service.ts +++ b/src/lib/assets/assets.service.ts @@ -9,6 +9,7 @@ import { IMenuItem } from '@covalent/core/dynamic-menu'; export interface IHelpAssets { [name: string]: { links: IMenuItem[]; + learn?: IMenuItem[]; }; } From f30aafeac6caa7cd76b0cf56f92d0dc6f8af49b1 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 9 Sep 2020 10:11:48 -0700 Subject: [PATCH 12/13] feat(learn-link-type): include description property (#125) --- src/lib/assets/assets.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/assets/assets.service.ts b/src/lib/assets/assets.service.ts index f3a5301..cfab7ea 100644 --- a/src/lib/assets/assets.service.ts +++ b/src/lib/assets/assets.service.ts @@ -6,10 +6,14 @@ import { Observable, of } from 'rxjs'; import { IMenuItem } from '@covalent/core/dynamic-menu'; +export interface ILearnLinkItem extends IMenuItem { + description?: string; +} + export interface IHelpAssets { [name: string]: { links: IMenuItem[]; - learn?: IMenuItem[]; + learn?: ILearnLinkItem[]; }; } From da72285916c54cb5b04ebaed4516dc9dad1604f7 Mon Sep 17 00:00:00 2001 From: Priyanka Arora Date: Thu, 17 Sep 2020 13:37:30 -0700 Subject: [PATCH 13/13] fix(add): code cleanup --- src/lib/schematics/ng-add/index.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/lib/schematics/ng-add/index.ts b/src/lib/schematics/ng-add/index.ts index 7322d75..7394e38 100644 --- a/src/lib/schematics/ng-add/index.ts +++ b/src/lib/schematics/ng-add/index.ts @@ -6,7 +6,6 @@ import { url, apply, branchAndMerge, - SchematicsException, template, UpdateRecorder, FileEntry, @@ -28,11 +27,11 @@ import { SourceFile } from 'typescript'; import { Change } from '@schematics/angular/utility/change'; export function addDependenciesAndFiles(options: ISchema): Rule { - let addVantagePacakgeRule: Rule = (host: Tree) => { + const addVantagePacakgeRule: Rule = (host: Tree) => { addPackageToPackageJson(host, '@td-vantage/ui-platform', `${uiPlatformVersion}`); }; - let ruleSet: Rule[] = [addVantagePacakgeRule]; + const ruleSet: Rule[] = [addVantagePacakgeRule]; if (options.ssoServerURL && options.ssoServerURL.trim().length) { // enable SSO @@ -58,25 +57,15 @@ function updateStyles(): Rule { const workspace: experimental.workspace.WorkspaceSchema = getWorkspace(host); const project: experimental.workspace.WorkspaceProject = getProjectFromWorkspace(workspace); const styleFilePath: string = getProjectStyleFile(project); - const file: Buffer = host.read(styleFilePath); - const themeFile: FileEntry = host.get('theme.scss'); - // context.logger.log('info', themeFile.content.toString()); - // if (!themeFile) { - // throw new SchematicsException('Please install covalent core.'); - // } - - // if(file && themeFile) { - context.logger.log('info', themeFile.content.toString()); const fileContent: string = file.toString(); - const content: string = themeFile.content.toString(); + const content: string = themeFile && themeFile.content.toString(); if (content) { host.overwrite(styleFilePath, fileContent + '\n' + content); + host.delete('theme.scss'); } - host.delete('theme.scss'); - // } return host; };