From 20115f7d9f5eb65e261a1fc6dd36b90965a0dd74 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sat, 2 Mar 2019 15:43:10 -0600 Subject: [PATCH 001/163] more errors in environmental setup found during deployment. also alphabetized the urls list because that's how I roll --- angular.json | 3 +-- projects/account/src/environments/environment.dev.ts | 2 +- projects/account/src/environments/environment.test.ts | 3 ++- projects/market/src/environments/environment.dev.ts | 6 +++--- projects/market/src/environments/environment.prod.ts | 6 +++--- projects/market/src/environments/environment.test.ts | 7 ++++--- projects/market/src/environments/environment.ts | 6 +++--- projects/sso/src/environments/environment.dev.ts | 6 +++--- projects/sso/src/environments/environment.prod.ts | 4 ++-- projects/sso/src/environments/environment.test.ts | 5 +++-- projects/sso/src/environments/environment.ts | 6 +++--- 11 files changed, 28 insertions(+), 26 deletions(-) diff --git a/angular.json b/angular.json index 17c815d..83b7ba2 100644 --- a/angular.json +++ b/angular.json @@ -623,8 +623,7 @@ "replace": "projects/account/src/environments/environment.ts", "with": "projects/account/src/environments/environment.dev.ts" } - ], - "outputHashing": "all" + ] }, "test": { "fileReplacements": [ diff --git a/projects/account/src/environments/environment.dev.ts b/projects/account/src/environments/environment.dev.ts index 12b874c..601dadb 100644 --- a/projects/account/src/environments/environment.dev.ts +++ b/projects/account/src/environments/environment.dev.ts @@ -1,10 +1,10 @@ export const environment = { production: false, mycroftUrls: { + account: 'https://home-test.mycroft.ai', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', singleSignOn: 'https://sso.mycroft.test', - account: 'https://home-test.mycroft.ai', marketplace: 'https://market.mycroft.test', mimic: 'https://mimic.mycroft.ai', translate: 'https://translate-test.mycroft.ai', diff --git a/projects/account/src/environments/environment.test.ts b/projects/account/src/environments/environment.test.ts index 646fb1b..729d692 100644 --- a/projects/account/src/environments/environment.test.ts +++ b/projects/account/src/environments/environment.test.ts @@ -1,11 +1,12 @@ export const environment = { production: false, mycroftUrls: { + account: 'https://account.mycroft-test.net', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', singleSignOn: 'https://sso.mycroft-test.net', - account: 'https://account.mycroft-test.net', marketplace: 'https://market.mycroft-test.net', + mimic: 'https://mimic.mycroft.ai', translate: 'https://translate-test.mycroft.ai', wordPress: 'https://test.mycroft.ai' } diff --git a/projects/market/src/environments/environment.dev.ts b/projects/market/src/environments/environment.dev.ts index 6e3d7d1..898a719 100644 --- a/projects/market/src/environments/environment.dev.ts +++ b/projects/market/src/environments/environment.dev.ts @@ -1,13 +1,13 @@ export const environment = { production: false, mycroftUrls: { + account: 'https://account.mycroft.test', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', - singleSignOn: 'https://sso.mycroft.test', - account: 'https://account.mycroft.test', marketplace: 'https://market.mycroft.test', mimic: 'http://mimic.mycroft.ai', + singleSignOn: 'https://sso.mycroft.test', translate: 'https://translate-test.mycroft.ai', - wordpress: 'https://test.mycroft.ai' + wordPress: 'https://test.mycroft.ai' } }; diff --git a/projects/market/src/environments/environment.prod.ts b/projects/market/src/environments/environment.prod.ts index 4ee385d..1fa6f98 100644 --- a/projects/market/src/environments/environment.prod.ts +++ b/projects/market/src/environments/environment.prod.ts @@ -1,14 +1,14 @@ export const environment = { production: true, mycroftUrls: { + account: 'https://home.mycroft.ai', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', - singleSignOn: 'https://sso.mycroft.ai', - account: 'https://home.mycroft.ai', marketplace: 'https://market.mycroft.ai', mimic: 'https://mimic.mycroft.ai', + singleSignOn: 'https://sso.mycroft.ai', translate: 'https://translate.mycroft.ai', - wordpress: 'https://mycroft.ai' + wordPress: 'https://mycroft.ai' } }; diff --git a/projects/market/src/environments/environment.test.ts b/projects/market/src/environments/environment.test.ts index 4371857..f60dda4 100644 --- a/projects/market/src/environments/environment.test.ts +++ b/projects/market/src/environments/environment.test.ts @@ -1,12 +1,13 @@ export const environment = { production: false, mycroftUrls: { + account: 'https://account.mycroft-test.net', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', - singleSignOn: 'https://sso.mycroft-test.net', - account: 'https://account.mycroft-test.net', marketplace: 'https://market.mycroft-test.net', + mimic: 'http://mimic.mycroft.ai', + singleSignOn: 'https://sso.mycroft-test.net', translate: 'https://translate-test.mycroft.ai', - wordpress: 'https://test.mycroft.ai' + wordPress: 'https://test.mycroft.ai' } }; diff --git a/projects/market/src/environments/environment.ts b/projects/market/src/environments/environment.ts index 3539daa..77c7240 100644 --- a/projects/market/src/environments/environment.ts +++ b/projects/market/src/environments/environment.ts @@ -5,14 +5,14 @@ export const environment = { production: false, mycroftUrls: { + account: 'https://account.mycroft.ai', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', - singleSignOn: 'http://localhost:4201', - account: 'https://home-test.mycroft.ai', marketplace: 'http://localhost:4202', mimic: 'http://mimic.mycroft,ai', + singleSignOn: 'http://localhost:4201', translate: 'https://translate-test.mycroft.ai', - wordpress: 'https://test.mycroft.ai' + wordPress: 'https://test.mycroft.ai' } }; diff --git a/projects/sso/src/environments/environment.dev.ts b/projects/sso/src/environments/environment.dev.ts index 6e3d7d1..898a719 100644 --- a/projects/sso/src/environments/environment.dev.ts +++ b/projects/sso/src/environments/environment.dev.ts @@ -1,13 +1,13 @@ export const environment = { production: false, mycroftUrls: { + account: 'https://account.mycroft.test', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', - singleSignOn: 'https://sso.mycroft.test', - account: 'https://account.mycroft.test', marketplace: 'https://market.mycroft.test', mimic: 'http://mimic.mycroft.ai', + singleSignOn: 'https://sso.mycroft.test', translate: 'https://translate-test.mycroft.ai', - wordpress: 'https://test.mycroft.ai' + wordPress: 'https://test.mycroft.ai' } }; diff --git a/projects/sso/src/environments/environment.prod.ts b/projects/sso/src/environments/environment.prod.ts index a856958..092f715 100644 --- a/projects/sso/src/environments/environment.prod.ts +++ b/projects/sso/src/environments/environment.prod.ts @@ -1,12 +1,12 @@ export const environment = { production: true, mycroftUrls: { + account: 'https://account.mycroft.ai', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', - singleSignOn: 'https://sso.mycroft.ai', - account: 'https://account.mycroft.ai', marketplace: 'https://market.mycroft.ai', mimic: 'https://mimic.mycroft.ai', + singleSignOn: 'https://sso.mycroft.ai', translate: 'https://translate.mycroft.ai', wordpress: 'https://mycroft.ai' } diff --git a/projects/sso/src/environments/environment.test.ts b/projects/sso/src/environments/environment.test.ts index 4371857..d667885 100644 --- a/projects/sso/src/environments/environment.test.ts +++ b/projects/sso/src/environments/environment.test.ts @@ -1,11 +1,12 @@ export const environment = { production: false, mycroftUrls: { + account: 'https://account.mycroft-test.net', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', - singleSignOn: 'https://sso.mycroft-test.net', - account: 'https://account.mycroft-test.net', marketplace: 'https://market.mycroft-test.net', + mimic: 'http://mimic.mycroft.ai', + singleSignOn: 'https://sso.mycroft-test.net', translate: 'https://translate-test.mycroft.ai', wordpress: 'https://test.mycroft.ai' } diff --git a/projects/sso/src/environments/environment.ts b/projects/sso/src/environments/environment.ts index 0ba1b3a..aeba54b 100644 --- a/projects/sso/src/environments/environment.ts +++ b/projects/sso/src/environments/environment.ts @@ -5,14 +5,14 @@ export const environment = { production: false, mycroftUrls: { + account: 'https://account.mycroft.test', chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', - singleSignOn: 'https://sso.mycroft.test', - account: 'https://account.mycroft.test', marketplace: 'https://market.mycroft.test', mimic: 'https://mimic.mycroft.ai', + singleSignOn: 'https://sso.mycroft.test', translate: 'https://translate-test.mycroft.ai', - wordpress: 'https://test.mycroft.ai' + wordPress: 'https://test.mycroft.ai' } }; From ec161a05e23e638654896371581d6aea576bc40b Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 4 Mar 2019 02:00:36 -0600 Subject: [PATCH 002/163] change ip for the account application --- Jenkinsfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bd70741..ab7ceb8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,12 +43,14 @@ pipeline { echo 'Deploying to test environment web servers...' withCredentials([sshUserPrivateKey(credentialsId: '6413826d-79f6-4d03-9902-ee1b73a96efd', keyFileVariable: 'JENKINS_SSH_KEY', passphraseVariable: '', usernameVariable: 'SERVER_USER')]) { // Deploy account application and its associated libraries - sh 'scp -r dist/shared root@192.81.211.55:/var/www/' - sh 'scp -r dist/globalnav root@192.81.211.55:/var/www/' - sh 'scp -r dist/page-not-found root@192.81.211.55:/var/www/' - sh 'scp -r dist/account root@192.81.211.55:/var/www/' + echo 'Deploying account application...' + sh 'scp -r dist/shared root@192.241.152.213:/var/www/' + sh 'scp -r dist/globalnav root@192.241.152.213:/var/www/' + sh 'scp -r dist/page-not-found root@192.241.152.213:/var/www/' + sh 'scp -r dist/account root@192.241.152.213:/var/www/' // Deploy single sign on application and its associated libraries + echo 'Deploying single sign on application...' sh 'scp -r dist/shared root@198.199.90.118:/var/www/' sh 'scp -r dist/globalnav root@198.199.90.118:/var/www/' sh 'scp -r dist/page-not-found root@198.199.90.118:/var/www/' @@ -81,12 +83,14 @@ pipeline { echo 'Deploying to production environment web servers...' withCredentials([sshUserPrivateKey(credentialsId: '6413826d-79f6-4d03-9902-ee1b73a96efd', keyFileVariable: 'JENKINS_SSH_KEY', passphraseVariable: '', usernameVariable: 'SERVER_USER')]) { // Deploy account application and its associated libraries + echo 'Deploying account application...' sh 'scp -r dist/shared root@???:/var/www/' sh 'scp -r dist/globalnav root@???:/var/www/' sh 'scp -r dist/page-not-found root@???:/var/www/' sh 'scp -r dist/account root@???:/var/www/' // Deploy single sign on application and its associated libraries + echo 'Deploying single sign on application...' sh 'scp -r dist/shared root@???:/var/www/' sh 'scp -r dist/globalnav root@???:/var/www/' sh 'scp -r dist/page-not-found root@???:/var/www/' From 390e6eaf8eea826601d085e0ab2832fb8f37648b Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 4 Mar 2019 02:11:54 -0600 Subject: [PATCH 003/163] shortened stage names --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ab7ceb8..a6a4e75 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { } // Deploy to the Test environment - stage('Build for Test Environment') { + stage('Build for Test') { when { branch 'test' } @@ -35,7 +35,7 @@ pipeline { } } - stage('Deploy to Test Environment') { + stage('Deploy to Test') { when { branch 'test' } @@ -60,7 +60,7 @@ pipeline { } // Deploy to the Production environment - stage('Build for Production Environment') { + stage('Build for Production') { when { branch 'master' } @@ -75,7 +75,7 @@ pipeline { } } - stage('Deploy to Production Environment') { + stage('Deploy to Production') { when { branch 'master' } From 967de549883d4192eca4c02fdc77d0d9e16f119c Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 4 Mar 2019 14:49:32 -0600 Subject: [PATCH 004/163] fixed a bug where "Maybe Later" option was not selected for an account without a membership. --- .../lib/membership-options/membership-options.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/shared/src/lib/membership-options/membership-options.component.html b/projects/shared/src/lib/membership-options/membership-options.component.html index c89d7bc..a8c9333 100644 --- a/projects/shared/src/lib/membership-options/membership-options.component.html +++ b/projects/shared/src/lib/membership-options/membership-options.component.html @@ -11,7 +11,7 @@

{{membership.type}}

{{membership.price}} USD

- +

Maybe Later

From 58484b1f6b01d8aa6397ab43fd8beee1dc8e451e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 4 Mar 2019 16:22:59 -0600 Subject: [PATCH 005/163] renamed subscription to membership --- .../membership.component.html} | 0 .../membership.component.scss} | 0 .../membership.component.ts} | 6 +++--- projects/account/src/app/profile/profile.module.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename projects/account/src/app/profile/{subscription/subscription.component.html => membership/membership.component.html} (100%) rename projects/account/src/app/profile/{subscription/subscription.component.scss => membership/membership.component.scss} (100%) rename projects/account/src/app/profile/{subscription/subscription.component.ts => membership/membership.component.ts} (89%) diff --git a/projects/account/src/app/profile/subscription/subscription.component.html b/projects/account/src/app/profile/membership/membership.component.html similarity index 100% rename from projects/account/src/app/profile/subscription/subscription.component.html rename to projects/account/src/app/profile/membership/membership.component.html diff --git a/projects/account/src/app/profile/subscription/subscription.component.scss b/projects/account/src/app/profile/membership/membership.component.scss similarity index 100% rename from projects/account/src/app/profile/subscription/subscription.component.scss rename to projects/account/src/app/profile/membership/membership.component.scss diff --git a/projects/account/src/app/profile/subscription/subscription.component.ts b/projects/account/src/app/profile/membership/membership.component.ts similarity index 89% rename from projects/account/src/app/profile/subscription/subscription.component.ts rename to projects/account/src/app/profile/membership/membership.component.ts index 766f9a6..28f1023 100644 --- a/projects/account/src/app/profile/subscription/subscription.component.ts +++ b/projects/account/src/app/profile/membership/membership.component.ts @@ -29,10 +29,10 @@ const yearlySupporter: SubscriptionType = { @Component({ selector: 'account-subscription', - templateUrl: './subscription.component.html', - styleUrls: ['./subscription.component.scss'] + templateUrl: './membership.component.html', + styleUrls: ['./membership.component.scss'] }) -export class SubscriptionComponent implements OnDestroy { +export class MembershipComponent implements OnDestroy { @Input() accountMembership: Membership; public subscriptionTypes: SubscriptionType[]; public alignVertical: boolean; diff --git a/projects/account/src/app/profile/profile.module.ts b/projects/account/src/app/profile/profile.module.ts index 1c35efa..6661b89 100644 --- a/projects/account/src/app/profile/profile.module.ts +++ b/projects/account/src/app/profile/profile.module.ts @@ -16,7 +16,7 @@ import { DeleteComponent } from './delete/delete.component'; import { LoginComponent } from './login/login.component'; import { ProfileComponent } from './profile.component'; import { ProfileService } from './profile.service'; -import { SubscriptionComponent } from './subscription/subscription.component'; +import { MembershipComponent } from './membership/membership.component'; import { SharedModule } from 'shared'; @NgModule({ @@ -25,7 +25,7 @@ import { SharedModule } from 'shared'; DeleteComponent, LoginComponent, ProfileComponent, - SubscriptionComponent + MembershipComponent ], entryComponents: [ LoginComponent From dc6bf2f646f875f29b884a35e53cb7d3df36a732 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 5 Mar 2019 00:36:51 -0600 Subject: [PATCH 006/163] Fixed bug where button text was not white when button was selected --- src/stylesheets/components/_buttons.scss | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/stylesheets/components/_buttons.scss b/src/stylesheets/components/_buttons.scss index 8c141f8..b102f44 100644 --- a/src/stylesheets/components/_buttons.scss +++ b/src/stylesheets/components/_buttons.scss @@ -37,9 +37,6 @@ $button-border-radius: 4px; .mat-button-toggle-checked { background-color: mat-color($mycroft-primary); - - .mat-button-toggle-label-content { - color: mat-contrast($mycroft-primary, 500); - } + color: mat-contrast($mycroft-primary, 500); } } From 97c123719eb2caa572370f9b05832cb670a94730 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 5 Mar 2019 16:25:35 -0600 Subject: [PATCH 007/163] added links to navigate to the appropriate pages when selecting a menu item --- .../lib/account-menu/account-menu.component.html | 10 +++++----- .../lib/account-menu/account-menu.component.ts | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/projects/globalnav/src/lib/account-menu/account-menu.component.html b/projects/globalnav/src/lib/account-menu/account-menu.component.html index 87c1ae3..6dd257e 100644 --- a/projects/globalnav/src/lib/account-menu/account-menu.component.html +++ b/projects/globalnav/src/lib/account-menu/account-menu.component.html @@ -11,7 +11,7 @@ Log In - @@ -19,15 +19,15 @@ If the user is authenticated, the menu will present them with account management options --> - - - @@ -36,7 +36,7 @@ Add Device - diff --git a/projects/globalnav/src/lib/account-menu/account-menu.component.ts b/projects/globalnav/src/lib/account-menu/account-menu.component.ts index bd091c9..0f3d3a8 100644 --- a/projects/globalnav/src/lib/account-menu/account-menu.component.ts +++ b/projects/globalnav/src/lib/account-menu/account-menu.component.ts @@ -29,15 +29,27 @@ export class AccountMenuComponent implements OnInit { ngOnInit() { } + navigateToDevices() { + window.location.href = this.mycroftUrls.account + '/device'; + } + navigateToLogin() { window.location.href = this.mycroftUrls.singleSignOn + '/login?redirect=' + window.location.href; } - navigate_to_create_account() { + navigateToCreateAccount() { window.location.href = this.mycroftUrls.account + '/create-account?redirect=' + window.location.href; } - navigate_to_log_out() { + navigateToLogOut() { window.location.href = this.mycroftUrls.singleSignOn + '/logout?redirect=' + window.location.href; } + + navigateToProfile() { + window.location.href = this.mycroftUrls.account + '/profile'; + } + + navigateToSkills() { + window.location.href = this.mycroftUrls.account + '/skill'; + } } From 337e23f68d6e718078cf30deed0e1efd6387d36b Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 5 Mar 2019 16:38:10 -0600 Subject: [PATCH 008/163] removed code that has been moved to the device-list component --- .../src/app/device/device.component.ts | 46 +------------------ 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/projects/account/src/app/device/device.component.ts b/projects/account/src/app/device/device.component.ts index 48a7ac5..bc7954b 100644 --- a/projects/account/src/app/device/device.component.ts +++ b/projects/account/src/app/device/device.component.ts @@ -1,10 +1,4 @@ import { Component, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material'; - -import { faPlus, faTrash } from '@fortawesome/free-solid-svg-icons'; - -import { DeviceService, Device } from './device.service'; -import { RemoveComponent } from './remove/remove.component'; @Component({ selector: 'account-device', @@ -12,45 +6,9 @@ import { RemoveComponent } from './remove/remove.component'; styleUrls: ['./device.component.scss'] }) export class DeviceComponent implements OnInit { - public addIcon = faPlus; - public deleteIcon = faTrash; - public devices: Device[]; - public platforms = { - 'mark-one': {icon: '../assets/mark-1-icon.svg', displayName: 'Mark I'}, - 'mark-two': {icon: '../assets/mark-2-icon.svg', displayName: 'Mark II'}, - 'picroft': {icon: '../assets/picroft-icon.svg', displayName: 'Picroft'}, - 'kde': {icon: '../assets/kde-icon.svg', displayName: 'KDE'} - }; - private selectedDevice: Device; - - constructor(public dialog: MatDialog, private deviceService: DeviceService) { } + constructor() { + } ngOnInit() { - this.devices = this.deviceService.devices; - } - - onRemovalClick (device: Device) { - const removalDialogRef = this.dialog.open(RemoveComponent, {data: false}); - this.selectedDevice = device; - removalDialogRef.afterClosed().subscribe( - (result) => { - if (result) { this.deviceService.deleteDevice(device); } - } - ); - } - - defineStaticDeviceFields(device: Device) { - const knownPlatform = this.platforms[device.platform]; - return [ - {name: 'Platform', value: knownPlatform ? knownPlatform.displayName : device.platform}, - {name: 'Core Version', value: device.coreVersion}, - {name: 'Enclosure Version', value: device.enclosureVersion} - ]; - } - - getDeviceIcon(device: Device) { - const knownPlatform = this.platforms[device.platform]; - // TODO: get unknown product icon from design team. - return knownPlatform ? knownPlatform.icon : '../assets/mark-1-icon.svg'; } } From a5990033931c0806dcd3eb4873b3bedf3898a160 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 5 Mar 2019 17:03:04 -0600 Subject: [PATCH 009/163] re-worked the device page --- .../device/attribute/attr-edit.component.html | 39 ------- .../device/attribute/attr-edit.component.ts | 34 ------ .../device/attribute/attr-view.component.html | 13 --- .../device/attribute/attr-view.component.scss | 9 -- .../device/attribute/attr-view.component.ts | 43 ------- .../device/attribute/attribute.component.html | 40 +++++++ ...omponent.scss => attribute.component.scss} | 8 +- .../device/attribute/attribute.component.ts | 32 ++++++ .../geography/geography-edit.component.html | 43 ------- .../geography/geography-edit.component.ts | 25 ---- .../geography/geography-view.component.html | 9 -- .../geography/geography-view.component.ts | 22 ---- .../geography/geography.component.html | 8 ++ ...omponent.scss => geography.component.scss} | 0 .../geography/geography.component.ts | 23 ++++ .../attribute/group/group-edit.component.html | 8 -- .../attribute/group/group-edit.component.ts | 25 ---- .../attribute/group/group-view.component.html | 9 -- .../attribute/group/group-view.component.ts | 22 ---- .../attribute/group/group.component.html | 7 ++ .../group.component.scss} | 0 .../device/attribute/group/group.component.ts | 21 ++++ .../placement/placement-edit.component.html | 8 -- .../placement/placement-edit.component.ts | 26 ----- .../placement/placement-view.component.html | 9 -- .../placement/placement-view.component.scss | 0 .../placement/placement-view.component.ts | 22 ---- .../placement/placement.component.html | 6 + .../placement.component.scss} | 0 .../placement/placement.component.ts | 22 ++++ .../attribute/voice/voice-edit.component.html | 8 -- .../attribute/voice/voice-edit.component.scss | 0 .../attribute/voice/voice-edit.component.ts | 27 ----- .../attribute/voice/voice-view.component.html | 9 -- .../attribute/voice/voice-view.component.scss | 0 .../attribute/voice/voice-view.component.ts | 22 ---- .../attribute/voice/voice.component.html | 8 ++ .../voice.component.scss} | 0 .../device/attribute/voice/voice.component.ts | 25 ++++ .../wake-word/wake-word-edit.component.html | 8 -- .../wake-word/wake-word-edit.component.scss | 0 .../wake-word/wake-word-edit.component.ts | 27 ----- .../wake-word/wake-word-view.component.html | 9 -- .../wake-word/wake-word-view.component.scss | 0 .../wake-word/wake-word-view.component.ts | 22 ---- .../wake-word/wake-word.component.html | 8 ++ .../wake-word.component.scss} | 0 .../wake-word/wake-word.component.ts | 25 ++++ .../device-list/device-list.component.html | 104 ++++++++--------- .../device-list/device-list.component.scss | 75 ++++++++---- .../device-list/device-list.component.ts | 17 ++- .../src/app/device/device.component.html | 6 +- .../account/src/app/device/device.module.ts | 51 +++------ .../account/src/app/device/device.service.ts | 107 +++++++++++------- .../preferences/preferences.component.html | 96 ++++++++-------- .../preferences/preferences.component.scss | 10 +- .../preferences/preferences.component.ts | 7 +- 57 files changed, 478 insertions(+), 726 deletions(-) delete mode 100644 projects/account/src/app/device/attribute/attr-edit.component.html delete mode 100644 projects/account/src/app/device/attribute/attr-edit.component.ts delete mode 100644 projects/account/src/app/device/attribute/attr-view.component.html delete mode 100644 projects/account/src/app/device/attribute/attr-view.component.scss delete mode 100644 projects/account/src/app/device/attribute/attr-view.component.ts create mode 100644 projects/account/src/app/device/attribute/attribute.component.html rename projects/account/src/app/device/attribute/{attr-edit.component.scss => attribute.component.scss} (72%) create mode 100644 projects/account/src/app/device/attribute/attribute.component.ts delete mode 100644 projects/account/src/app/device/attribute/geography/geography-edit.component.html delete mode 100644 projects/account/src/app/device/attribute/geography/geography-edit.component.ts delete mode 100644 projects/account/src/app/device/attribute/geography/geography-view.component.html delete mode 100644 projects/account/src/app/device/attribute/geography/geography-view.component.ts create mode 100644 projects/account/src/app/device/attribute/geography/geography.component.html rename projects/account/src/app/device/attribute/geography/{geography-edit.component.scss => geography.component.scss} (100%) create mode 100644 projects/account/src/app/device/attribute/geography/geography.component.ts delete mode 100644 projects/account/src/app/device/attribute/group/group-edit.component.html delete mode 100644 projects/account/src/app/device/attribute/group/group-edit.component.ts delete mode 100644 projects/account/src/app/device/attribute/group/group-view.component.html delete mode 100644 projects/account/src/app/device/attribute/group/group-view.component.ts create mode 100644 projects/account/src/app/device/attribute/group/group.component.html rename projects/account/src/app/device/attribute/{geography/geography-view.component.scss => group/group.component.scss} (100%) create mode 100644 projects/account/src/app/device/attribute/group/group.component.ts delete mode 100644 projects/account/src/app/device/attribute/placement/placement-edit.component.html delete mode 100644 projects/account/src/app/device/attribute/placement/placement-edit.component.ts delete mode 100644 projects/account/src/app/device/attribute/placement/placement-view.component.html delete mode 100644 projects/account/src/app/device/attribute/placement/placement-view.component.scss delete mode 100644 projects/account/src/app/device/attribute/placement/placement-view.component.ts create mode 100644 projects/account/src/app/device/attribute/placement/placement.component.html rename projects/account/src/app/device/attribute/{group/group-edit.component.scss => placement/placement.component.scss} (100%) create mode 100644 projects/account/src/app/device/attribute/placement/placement.component.ts delete mode 100644 projects/account/src/app/device/attribute/voice/voice-edit.component.html delete mode 100644 projects/account/src/app/device/attribute/voice/voice-edit.component.scss delete mode 100644 projects/account/src/app/device/attribute/voice/voice-edit.component.ts delete mode 100644 projects/account/src/app/device/attribute/voice/voice-view.component.html delete mode 100644 projects/account/src/app/device/attribute/voice/voice-view.component.scss delete mode 100644 projects/account/src/app/device/attribute/voice/voice-view.component.ts create mode 100644 projects/account/src/app/device/attribute/voice/voice.component.html rename projects/account/src/app/device/attribute/{group/group-view.component.scss => voice/voice.component.scss} (100%) create mode 100644 projects/account/src/app/device/attribute/voice/voice.component.ts delete mode 100644 projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.html delete mode 100644 projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.scss delete mode 100644 projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.ts delete mode 100644 projects/account/src/app/device/attribute/wake-word/wake-word-view.component.html delete mode 100644 projects/account/src/app/device/attribute/wake-word/wake-word-view.component.scss delete mode 100644 projects/account/src/app/device/attribute/wake-word/wake-word-view.component.ts create mode 100644 projects/account/src/app/device/attribute/wake-word/wake-word.component.html rename projects/account/src/app/device/attribute/{placement/placement-edit.component.scss => wake-word/wake-word.component.scss} (100%) create mode 100644 projects/account/src/app/device/attribute/wake-word/wake-word.component.ts diff --git a/projects/account/src/app/device/attribute/attr-edit.component.html b/projects/account/src/app/device/attribute/attr-edit.component.html deleted file mode 100644 index 1cad605..0000000 --- a/projects/account/src/app/device/attribute/attr-edit.component.html +++ /dev/null @@ -1,39 +0,0 @@ -
{{dialogTitle}}
- -
-
{{dialogInstructions}}
- - - - - - {{possibleValue.name}} - - - -
- - - - - - -
- -
- - - - - - - -
-
- -
- - -
diff --git a/projects/account/src/app/device/attribute/attr-edit.component.ts b/projects/account/src/app/device/attribute/attr-edit.component.ts deleted file mode 100644 index 54f7e12..0000000 --- a/projects/account/src/app/device/attribute/attr-edit.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {Component, Input, OnInit} from '@angular/core'; -import { MatDialogRef } from '@angular/material'; - -import { faTrashAlt } from '@fortawesome/free-solid-svg-icons'; - -import { DeviceAttribute } from '../device.service'; -import { GeographyEditComponent } from './geography/geography-edit.component'; -import { GroupEditComponent } from './group/group-edit.component'; -import { PlacementEditComponent } from './placement/placement-edit.component'; - - -@Component({ - selector: 'account-device-attribute-edit', - templateUrl: './attr-edit.component.html', - styleUrls: ['./attr-edit.component.scss'] -}) -export class AttrEditComponent implements OnInit { - @Input() dialogData: string; - @Input() dialogInstructions: string; - @Input() dialogRef: MatDialogRef; - @Input() dialogTitle: string; - @Input() possibleValues: DeviceAttribute[]; - public deleteIcon = faTrashAlt; - - constructor() { - } - - ngOnInit() { - } - - onCancelClick(): void { - this.dialogRef.close(); - } -} diff --git a/projects/account/src/app/device/attribute/attr-view.component.html b/projects/account/src/app/device/attribute/attr-view.component.html deleted file mode 100644 index 6e87022..0000000 --- a/projects/account/src/app/device/attribute/attr-view.component.html +++ /dev/null @@ -1,13 +0,0 @@ - - {{label}} -
- - -
- {{hint}} -
diff --git a/projects/account/src/app/device/attribute/attr-view.component.scss b/projects/account/src/app/device/attribute/attr-view.component.scss deleted file mode 100644 index 4f2daa4..0000000 --- a/projects/account/src/app/device/attribute/attr-view.component.scss +++ /dev/null @@ -1,9 +0,0 @@ -mat-form-field { - margin-bottom: 20px; - width: 100%; -} - -fa-icon { - padding-right: 10px -} - diff --git a/projects/account/src/app/device/attribute/attr-view.component.ts b/projects/account/src/app/device/attribute/attr-view.component.ts deleted file mode 100644 index 377be65..0000000 --- a/projects/account/src/app/device/attribute/attr-view.component.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { MatDialog } from '@angular/material'; - -import { faCaretRight } from '@fortawesome/free-solid-svg-icons'; - -@Component({ - selector: 'account-device-attribute-view', - templateUrl: './attr-view.component.html', - styleUrls: ['./attr-view.component.scss'] -}) -export class AttrViewComponent implements OnInit { - @Input() editDialog: any; - @Input() hint: string; - @Input() label: string; - @Input() possibleValues: any[]; - @Input() value: any; - public editIcon = faCaretRight; - - constructor(private dialog: MatDialog) { - } - - ngOnInit() { - } - - onClick() { - const dialogRef = this.dialog.open(this.editDialog, { data: this.value.name }); - dialogRef.afterClosed().subscribe( - (result) => { this.updateDevice(result); } - ); - } - - updateDevice(newValue: string) { - if (newValue) { - this.possibleValues.forEach( - (value) => { - if (value.name === newValue) { - this.value = value; - } - } - ); - } - } -} diff --git a/projects/account/src/app/device/attribute/attribute.component.html b/projects/account/src/app/device/attribute/attribute.component.html new file mode 100644 index 0000000..2b65d94 --- /dev/null +++ b/projects/account/src/app/device/attribute/attribute.component.html @@ -0,0 +1,40 @@ + + {{panelTitle}} +
{{instructions}}
+ + + + + + + {{possibleValue.name}} + + + +
+ + + + + + +
+ +
+ + + + + + + +
+ + + + + +
+
diff --git a/projects/account/src/app/device/attribute/attr-edit.component.scss b/projects/account/src/app/device/attribute/attribute.component.scss similarity index 72% rename from projects/account/src/app/device/attribute/attr-edit.component.scss rename to projects/account/src/app/device/attribute/attribute.component.scss index 38ddd4b..4c2c0e0 100644 --- a/projects/account/src/app/device/attribute/attr-edit.component.scss +++ b/projects/account/src/app/device/attribute/attribute.component.scss @@ -2,6 +2,12 @@ @import '~src/stylesheets/mycroft-colors'; @import '~src/stylesheets/components/buttons'; +mat-expansion-panel { + margin-bottom: 16px; + margin-left: auto; + margin-right: auto; + max-width: 500px; +} .predefined-group { margin-bottom: 12px; margin-top: 12px; @@ -9,7 +15,7 @@ .mat-body{ margin-bottom: 16px; - width: 250px; + max-width: 500px; } fa-icon { diff --git a/projects/account/src/app/device/attribute/attribute.component.ts b/projects/account/src/app/device/attribute/attribute.component.ts new file mode 100644 index 0000000..997849e --- /dev/null +++ b/projects/account/src/app/device/attribute/attribute.component.ts @@ -0,0 +1,32 @@ +import {Component, Input, OnInit} from '@angular/core'; +import { Observable } from 'rxjs'; + +import { faTrashAlt } from '@fortawesome/free-solid-svg-icons'; + +import { DeviceAttribute } from '../device.service'; + + +@Component({ + selector: 'account-device-attribute', + templateUrl: './attribute.component.html', + styleUrls: ['./attribute.component.scss'] +}) +export class AttributeComponent implements OnInit { + @Input() currentValue: DeviceAttribute; + @Input() instructions: string; + @Input() panelTitle: string; + @Input() possibleValues$: Observable; + @Input() possibleValues: DeviceAttribute[]; + @Input() userCanAdd: boolean; + public deleteIcon = faTrashAlt; + + constructor() { + } + + ngOnInit() { + } + + onCancelClick(): void { + // this.dialogRef.close(); + } +} diff --git a/projects/account/src/app/device/attribute/geography/geography-edit.component.html b/projects/account/src/app/device/attribute/geography/geography-edit.component.html deleted file mode 100644 index 8d75455..0000000 --- a/projects/account/src/app/device/attribute/geography/geography-edit.component.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/account/src/app/device/attribute/geography/geography-edit.component.ts b/projects/account/src/app/device/attribute/geography/geography-edit.component.ts deleted file mode 100644 index f1982aa..0000000 --- a/projects/account/src/app/device/attribute/geography/geography-edit.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; - -import { DeviceAttribute, DeviceService} from '../../device.service'; - -@Component({ - selector: 'account-device-geography-edit', - templateUrl: './geography-edit.component.html', - styleUrls: ['./geography-edit.component.scss'] -}) -export class GeographyEditComponent implements OnInit { - public deviceGeographies: DeviceAttribute[]; - public dialogInstructions = ''; - - constructor( - private deviceService: DeviceService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: string) { - } - - ngOnInit() { - this.deviceGeographies = this.deviceService.deviceGeographies; - } - -} diff --git a/projects/account/src/app/device/attribute/geography/geography-view.component.html b/projects/account/src/app/device/attribute/geography/geography-view.component.html deleted file mode 100644 index 7381950..0000000 --- a/projects/account/src/app/device/attribute/geography/geography-view.component.html +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/projects/account/src/app/device/attribute/geography/geography-view.component.ts b/projects/account/src/app/device/attribute/geography/geography-view.component.ts deleted file mode 100644 index 6153e44..0000000 --- a/projects/account/src/app/device/attribute/geography/geography-view.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; - -import { Device, DeviceAttribute, DeviceService } from '../../device.service'; -import { GeographyEditComponent } from './geography-edit.component'; - -@Component({ - selector: 'account-device-geography-view', - templateUrl: './geography-view.component.html', - styleUrls: ['./geography-view.component.scss'] -}) -export class GeographyViewComponent implements OnInit { - @Input() device: Device; - public deviceGeographies: DeviceAttribute[]; - public dialog = GeographyEditComponent; - - constructor( private service: DeviceService) { - } - - ngOnInit() { - this.deviceGeographies = this.service.deviceGeographies; - } -} diff --git a/projects/account/src/app/device/attribute/geography/geography.component.html b/projects/account/src/app/device/attribute/geography/geography.component.html new file mode 100644 index 0000000..103a5e3 --- /dev/null +++ b/projects/account/src/app/device/attribute/geography/geography.component.html @@ -0,0 +1,8 @@ + + diff --git a/projects/account/src/app/device/attribute/geography/geography-edit.component.scss b/projects/account/src/app/device/attribute/geography/geography.component.scss similarity index 100% rename from projects/account/src/app/device/attribute/geography/geography-edit.component.scss rename to projects/account/src/app/device/attribute/geography/geography.component.scss diff --git a/projects/account/src/app/device/attribute/geography/geography.component.ts b/projects/account/src/app/device/attribute/geography/geography.component.ts new file mode 100644 index 0000000..b63dc26 --- /dev/null +++ b/projects/account/src/app/device/attribute/geography/geography.component.ts @@ -0,0 +1,23 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { Observable } from 'rxjs'; + +import { DeviceAttribute, DeviceService} from '../../device.service'; + +@Component({ + selector: 'account-device-geography', + templateUrl: './geography.component.html', + styleUrls: ['./geography.component.scss'] +}) +export class GeographyComponent implements OnInit { + @Input() currentValue: DeviceAttribute; + public geographies$ = new Observable(); + public dialogInstructions = ''; + + constructor(private deviceService: DeviceService) { + } + + ngOnInit() { + this.geographies$ = this.deviceService.getGeographies(); + } + +} diff --git a/projects/account/src/app/device/attribute/group/group-edit.component.html b/projects/account/src/app/device/attribute/group/group-edit.component.html deleted file mode 100644 index fc04f71..0000000 --- a/projects/account/src/app/device/attribute/group/group-edit.component.html +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/projects/account/src/app/device/attribute/group/group-edit.component.ts b/projects/account/src/app/device/attribute/group/group-edit.component.ts deleted file mode 100644 index 5631a7e..0000000 --- a/projects/account/src/app/device/attribute/group/group-edit.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; - -import { DeviceAttribute, DeviceService} from '../../device.service'; - -@Component({ - selector: 'account-device-group-edit', - templateUrl: './group-edit.component.html', - styleUrls: ['./group-edit.component.scss'] -}) -export class GroupEditComponent implements OnInit { - public deviceGroups: DeviceAttribute[]; - public dialogInstructions = 'Groups are useful to organize multiple ' + - 'devices. You can reuse device names if they are in different groups.'; - - constructor( - private deviceService: DeviceService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DeviceAttribute) { - } - - ngOnInit() { - this.deviceGroups = this.deviceService.deviceGroups; - } -} diff --git a/projects/account/src/app/device/attribute/group/group-view.component.html b/projects/account/src/app/device/attribute/group/group-view.component.html deleted file mode 100644 index b130f05..0000000 --- a/projects/account/src/app/device/attribute/group/group-view.component.html +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/projects/account/src/app/device/attribute/group/group-view.component.ts b/projects/account/src/app/device/attribute/group/group-view.component.ts deleted file mode 100644 index d0cf1ec..0000000 --- a/projects/account/src/app/device/attribute/group/group-view.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; - -import { Device, DeviceAttribute, DeviceService } from '../../device.service'; -import { GroupEditComponent } from './group-edit.component'; - -@Component({ - selector: 'account-device-group-view', - templateUrl: './group-view.component.html', - styleUrls: ['./group-view.component.scss'] -}) -export class GroupViewComponent implements OnInit { - @Input() device: Device; - public deviceGroups: DeviceAttribute[]; - public dialog = GroupEditComponent; - - constructor( private service: DeviceService) { - } - - ngOnInit() { - this.deviceGroups = this.service.deviceGroups; - } -} diff --git a/projects/account/src/app/device/attribute/group/group.component.html b/projects/account/src/app/device/attribute/group/group.component.html new file mode 100644 index 0000000..0c0506b --- /dev/null +++ b/projects/account/src/app/device/attribute/group/group.component.html @@ -0,0 +1,7 @@ + + diff --git a/projects/account/src/app/device/attribute/geography/geography-view.component.scss b/projects/account/src/app/device/attribute/group/group.component.scss similarity index 100% rename from projects/account/src/app/device/attribute/geography/geography-view.component.scss rename to projects/account/src/app/device/attribute/group/group.component.scss diff --git a/projects/account/src/app/device/attribute/group/group.component.ts b/projects/account/src/app/device/attribute/group/group.component.ts new file mode 100644 index 0000000..c8ac1a3 --- /dev/null +++ b/projects/account/src/app/device/attribute/group/group.component.ts @@ -0,0 +1,21 @@ +import { Component, OnInit } from '@angular/core'; + +import { DeviceAttribute, DeviceService} from '../../device.service'; + +@Component({ + selector: 'account-device-group', + templateUrl: './group.component.html', + styleUrls: ['./group.component.scss'] +}) +export class GroupComponent implements OnInit { + public deviceGroups: DeviceAttribute[]; + public dialogInstructions = 'Groups are useful to organize multiple ' + + 'devices. You can reuse device names if they are in different groups.'; + + constructor(private deviceService: DeviceService) { + } + + ngOnInit() { + // this.deviceGroups = this.deviceService.deviceGroups; + } +} diff --git a/projects/account/src/app/device/attribute/placement/placement-edit.component.html b/projects/account/src/app/device/attribute/placement/placement-edit.component.html deleted file mode 100644 index 0fb6ab8..0000000 --- a/projects/account/src/app/device/attribute/placement/placement-edit.component.html +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/projects/account/src/app/device/attribute/placement/placement-edit.component.ts b/projects/account/src/app/device/attribute/placement/placement-edit.component.ts deleted file mode 100644 index b915c7b..0000000 --- a/projects/account/src/app/device/attribute/placement/placement-edit.component.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; - -import { DeviceAttribute, DeviceService} from '../../device.service'; - - -@Component({ - selector: 'account-device-placement-edit', - templateUrl: './placement-edit.component.html', - styleUrls: ['./placement-edit.component.scss'] -}) -export class PlacementEditComponent implements OnInit { - public devicePlacements: DeviceAttribute[]; - public dialogInstructions = 'You can optionally indicate where a device is ' + - 'placed within a location. Field is informational only.'; - - constructor( - private deviceService: DeviceService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: string) { - } - - ngOnInit() { - this.devicePlacements = this.deviceService.devicePlacements; - } -} diff --git a/projects/account/src/app/device/attribute/placement/placement-view.component.html b/projects/account/src/app/device/attribute/placement/placement-view.component.html deleted file mode 100644 index e92b86e..0000000 --- a/projects/account/src/app/device/attribute/placement/placement-view.component.html +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/projects/account/src/app/device/attribute/placement/placement-view.component.scss b/projects/account/src/app/device/attribute/placement/placement-view.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/device/attribute/placement/placement-view.component.ts b/projects/account/src/app/device/attribute/placement/placement-view.component.ts deleted file mode 100644 index 3aab78b..0000000 --- a/projects/account/src/app/device/attribute/placement/placement-view.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; - -import {Device, DeviceAttribute, DeviceService} from '../../device.service'; -import { PlacementEditComponent } from './placement-edit.component'; - -@Component({ - selector: 'account-device-placement-view', - templateUrl: './placement-view.component.html', - styleUrls: ['./placement-view.component.scss'] -}) -export class PlacementViewComponent implements OnInit { - @Input() device: Device; - public devicePlacements: DeviceAttribute[]; - public dialog = PlacementEditComponent; - - constructor( private service: DeviceService) { - } - - ngOnInit() { - this.devicePlacements = this.service.devicePlacements; - } -} diff --git a/projects/account/src/app/device/attribute/placement/placement.component.html b/projects/account/src/app/device/attribute/placement/placement.component.html new file mode 100644 index 0000000..0496982 --- /dev/null +++ b/projects/account/src/app/device/attribute/placement/placement.component.html @@ -0,0 +1,6 @@ + + diff --git a/projects/account/src/app/device/attribute/group/group-edit.component.scss b/projects/account/src/app/device/attribute/placement/placement.component.scss similarity index 100% rename from projects/account/src/app/device/attribute/group/group-edit.component.scss rename to projects/account/src/app/device/attribute/placement/placement.component.scss diff --git a/projects/account/src/app/device/attribute/placement/placement.component.ts b/projects/account/src/app/device/attribute/placement/placement.component.ts new file mode 100644 index 0000000..5a7758c --- /dev/null +++ b/projects/account/src/app/device/attribute/placement/placement.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; + +import { DeviceAttribute, DeviceService} from '../../device.service'; + + +@Component({ + selector: 'account-device-placement', + templateUrl: './placement.component.html', + styleUrls: ['./placement.component.scss'] +}) +export class PlacementComponent implements OnInit { + public devicePlacements: DeviceAttribute[]; + public dialogInstructions = 'You can optionally indicate where a device is ' + + 'placed within a location. Field is informational only.'; + + constructor(private deviceService: DeviceService) { + } + + ngOnInit() { + this.devicePlacements = this.deviceService.devicePlacements; + } +} diff --git a/projects/account/src/app/device/attribute/voice/voice-edit.component.html b/projects/account/src/app/device/attribute/voice/voice-edit.component.html deleted file mode 100644 index e5df1b7..0000000 --- a/projects/account/src/app/device/attribute/voice/voice-edit.component.html +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/projects/account/src/app/device/attribute/voice/voice-edit.component.scss b/projects/account/src/app/device/attribute/voice/voice-edit.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/device/attribute/voice/voice-edit.component.ts b/projects/account/src/app/device/attribute/voice/voice-edit.component.ts deleted file mode 100644 index 6e1a1d1..0000000 --- a/projects/account/src/app/device/attribute/voice/voice-edit.component.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; - -import { DeviceAttribute, DeviceService} from '../../device.service'; - - -@Component({ - selector: 'account-device-voice-edit', - templateUrl: './voice-edit.component.html', - styleUrls: ['./voice-edit.component.scss'] -}) -export class VoiceEditComponent implements OnInit { - public deviceVoices: DeviceAttribute[]; - public dialogInstructions = 'Mycroft\'s voice technology is rapidly ' + - 'evolving. Local voices guarantee the most privacy. Premium voices ' + - 'are more natural but require an internet connection.'; - - constructor( - private deviceService: DeviceService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: string) { - } - - ngOnInit() { - this.deviceVoices = this.deviceService.deviceVoices; - } -} diff --git a/projects/account/src/app/device/attribute/voice/voice-view.component.html b/projects/account/src/app/device/attribute/voice/voice-view.component.html deleted file mode 100644 index ad06fb4..0000000 --- a/projects/account/src/app/device/attribute/voice/voice-view.component.html +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/projects/account/src/app/device/attribute/voice/voice-view.component.scss b/projects/account/src/app/device/attribute/voice/voice-view.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/device/attribute/voice/voice-view.component.ts b/projects/account/src/app/device/attribute/voice/voice-view.component.ts deleted file mode 100644 index 21e5005..0000000 --- a/projects/account/src/app/device/attribute/voice/voice-view.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; - -import {Device, DeviceAttribute, DeviceService} from '../../device.service'; -import { VoiceEditComponent } from './voice-edit.component'; - -@Component({ - selector: 'account-device-voice-view', - templateUrl: './voice-view.component.html', - styleUrls: ['./voice-view.component.scss'] -}) -export class VoiceViewComponent implements OnInit { - @Input() device: Device; - public deviceVoices: DeviceAttribute[]; - public dialog = VoiceEditComponent; - - constructor( private service: DeviceService) { - } - - ngOnInit() { - this.deviceVoices = this.service.deviceVoices; - } -} diff --git a/projects/account/src/app/device/attribute/voice/voice.component.html b/projects/account/src/app/device/attribute/voice/voice.component.html new file mode 100644 index 0000000..6e87743 --- /dev/null +++ b/projects/account/src/app/device/attribute/voice/voice.component.html @@ -0,0 +1,8 @@ + + diff --git a/projects/account/src/app/device/attribute/group/group-view.component.scss b/projects/account/src/app/device/attribute/voice/voice.component.scss similarity index 100% rename from projects/account/src/app/device/attribute/group/group-view.component.scss rename to projects/account/src/app/device/attribute/voice/voice.component.scss diff --git a/projects/account/src/app/device/attribute/voice/voice.component.ts b/projects/account/src/app/device/attribute/voice/voice.component.ts new file mode 100644 index 0000000..bc0a730 --- /dev/null +++ b/projects/account/src/app/device/attribute/voice/voice.component.ts @@ -0,0 +1,25 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { Observable } from 'rxjs'; + +import { DeviceAttribute, DeviceService} from '../../device.service'; + + +@Component({ + selector: 'account-device-voice', + templateUrl: './voice.component.html', + styleUrls: ['./voice.component.scss'] +}) +export class VoiceComponent implements OnInit { + @Input() currentValue: DeviceAttribute; + public voices$ = new Observable(); + public dialogInstructions = 'Mycroft\'s voice technology is rapidly ' + + 'evolving. Local voices guarantee the most privacy. Premium voices ' + + 'are more natural but require an internet connection.'; + + constructor(private deviceService: DeviceService) { + } + + ngOnInit() { + this.voices$ = this.deviceService.getVoices(); + } +} diff --git a/projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.html b/projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.html deleted file mode 100644 index bf7aeca..0000000 --- a/projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.html +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.scss b/projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.ts b/projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.ts deleted file mode 100644 index c17c722..0000000 --- a/projects/account/src/app/device/attribute/wake-word/wake-word-edit.component.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; - -import { DeviceAttribute, DeviceService} from '../../device.service'; - - -@Component({ - selector: 'account-device-wake-word-edit', - templateUrl: './wake-word-edit.component.html', - styleUrls: ['./wake-word-edit.component.scss'] -}) -export class WakeWordEditComponent implements OnInit { - public deviceWakeWords: DeviceAttribute[]; - public dialogInstructions = 'Mycroft\'s voice technology is rapidly ' + - 'evolving. Local voices guarantee the most privacy. Premium voices ' + - 'are more natural but require an internet connection.'; - - constructor( - private deviceService: DeviceService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: string) { - } - - ngOnInit() { - this.deviceWakeWords = this.deviceService.deviceWakeWords; - } -} diff --git a/projects/account/src/app/device/attribute/wake-word/wake-word-view.component.html b/projects/account/src/app/device/attribute/wake-word/wake-word-view.component.html deleted file mode 100644 index 9da9ad3..0000000 --- a/projects/account/src/app/device/attribute/wake-word/wake-word-view.component.html +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/projects/account/src/app/device/attribute/wake-word/wake-word-view.component.scss b/projects/account/src/app/device/attribute/wake-word/wake-word-view.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/device/attribute/wake-word/wake-word-view.component.ts b/projects/account/src/app/device/attribute/wake-word/wake-word-view.component.ts deleted file mode 100644 index 5a413a5..0000000 --- a/projects/account/src/app/device/attribute/wake-word/wake-word-view.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; - -import {Device, DeviceAttribute, DeviceService} from '../../device.service'; -import { WakeWordEditComponent} from './wake-word-edit.component'; - -@Component({ - selector: 'account-device-wake-word-view', - templateUrl: './wake-word-view.component.html', - styleUrls: ['./wake-word-view.component.scss'] -}) -export class WakeWordViewComponent implements OnInit { - @Input() device: Device; - public deviceWakeWords: DeviceAttribute[]; - public dialog = WakeWordEditComponent; - - constructor( private service: DeviceService) { - } - - ngOnInit() { - this.deviceWakeWords = this.service.deviceVoices; - } -} diff --git a/projects/account/src/app/device/attribute/wake-word/wake-word.component.html b/projects/account/src/app/device/attribute/wake-word/wake-word.component.html new file mode 100644 index 0000000..4fdd2d0 --- /dev/null +++ b/projects/account/src/app/device/attribute/wake-word/wake-word.component.html @@ -0,0 +1,8 @@ + + diff --git a/projects/account/src/app/device/attribute/placement/placement-edit.component.scss b/projects/account/src/app/device/attribute/wake-word/wake-word.component.scss similarity index 100% rename from projects/account/src/app/device/attribute/placement/placement-edit.component.scss rename to projects/account/src/app/device/attribute/wake-word/wake-word.component.scss diff --git a/projects/account/src/app/device/attribute/wake-word/wake-word.component.ts b/projects/account/src/app/device/attribute/wake-word/wake-word.component.ts new file mode 100644 index 0000000..f3b4999 --- /dev/null +++ b/projects/account/src/app/device/attribute/wake-word/wake-word.component.ts @@ -0,0 +1,25 @@ +import { Component, Input, OnInit } from '@angular/core'; + +import { DeviceAttribute, DeviceService} from '../../device.service'; +import { Observable } from 'rxjs'; + + +@Component({ + selector: 'account-device-wake-word', + templateUrl: './wake-word.component.html', + styleUrls: ['./wake-word.component.scss'] +}) +export class WakeWordComponent implements OnInit { + @Input() currentValue: DeviceAttribute; + public wakeWords$ = new Observable(); + public dialogInstructions = 'Mycroft\'s voice technology is rapidly ' + + 'evolving. Local voices guarantee the most privacy. Premium voices ' + + 'are more natural but require an internet connection.'; + + constructor(private deviceService: DeviceService) { + } + + ngOnInit() { + this.wakeWords$ = this.deviceService.getWakeWords(); + } +} diff --git a/projects/account/src/app/device/device-list/device-list.component.html b/projects/account/src/app/device/device-list/device-list.component.html index e0e16f3..c1378e1 100644 --- a/projects/account/src/app/device/device-list/device-list.component.html +++ b/projects/account/src/app/device/device-list/device-list.component.html @@ -4,64 +4,50 @@ - - - - - -
+
+ + -
-
{{device.name}}
-
{{device.placement.name}}
-
-
- - -
-
- - - Name - - Must be unique within a device group (if defined) + {{device.name}} + + + + + Location + - - - - - - -
- -
-
- -
-
- {{staticData.name}}:   - {{staticData.value}} -
-
- - - - - -
-
-
- + + Platform + + + + Placement + + + + Core Version + + + + Voice + + + + Enclosure Version + + + + Wake Word + + + + + + + + +
diff --git a/projects/account/src/app/device/device-list/device-list.component.scss b/projects/account/src/app/device/device-list/device-list.component.scss index 753488f..0c77bc9 100644 --- a/projects/account/src/app/device/device-list/device-list.component.scss +++ b/projects/account/src/app/device/device-list/device-list.component.scss @@ -4,41 +4,76 @@ @mixin panel-defaults { border-radius: 12px; - max-width: 1000px; - min-width: 250px; + width: 330px; margin-left: auto; margin-right: auto; - + margin-bottom: 16px; } #add-device-button { @include action-button-primary; @include panel-defaults; - border-radius: 12px; cursor: pointer; height: 50px; margin-top: 32px; - img { - height: 32px; - margin-left: 16px; - } - .mat-h2 { - margin-bottom: 0; - } - fa-icon { color: mat-color($mycroft-accent, 'A200'); margin-right: 16px; } + + img { + height: 32px; + margin-left: 16px; + margin-right: 16px; + } + + .mat-h2 { + margin-bottom: 0; + } + +} + +mat-card { + @include panel-defaults; + + button { + margin-bottom: 8px; + margin-left: 8px; + margin-right: 8px; + } + + mat-card-content { + margin-top: 32px; + } + + mat-card-title { + color: mat-color($mycroft-primary, 700); + font-weight: bold; + + img { + height: 60px; + margin-right: 16px; + } + } + + mat-divider { + margin-left: 16px; + width: 90%; + } + + mat-label { + color: mat-color($mycroft-primary); + } + } mat-expansion-panel { @include panel-defaults; - margin-top: 16px; + margin-bottom: 16px; button { - width: 100%; + margin-left: 16px; } fa-icon { @@ -51,19 +86,15 @@ mat-expansion-panel { mat-form-field { margin-bottom: 20px; - width: 100%; + max-width: 320px; } - //.delete-button { - // margin-top: 20px; - //} - .mat-body-primary { + color: mat-color($mycroft-primary); margin-bottom: 0; } .mat-h2 { - color: mat-color($mycroft-primary); margin-bottom: 0; } @@ -71,7 +102,7 @@ mat-expansion-panel { padding: 0; } - .settings-button { - margin-bottom: 20px; + .static-data { + margin-top: 16px; } } diff --git a/projects/account/src/app/device/device-list/device-list.component.ts b/projects/account/src/app/device/device-list/device-list.component.ts index fe24dde..d3cd950 100644 --- a/projects/account/src/app/device/device-list/device-list.component.ts +++ b/projects/account/src/app/device/device-list/device-list.component.ts @@ -1,7 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material'; +import { Observable } from 'rxjs'; -import { faCog, faPlus, faTrash } from '@fortawesome/free-solid-svg-icons'; +import { faSave, faPlus, faTrash } from '@fortawesome/free-solid-svg-icons'; import { DeviceService, Device } from '../device.service'; import { RemoveComponent } from '../remove/remove.component'; @@ -14,7 +15,7 @@ import { RemoveComponent } from '../remove/remove.component'; export class DeviceListComponent implements OnInit { public addIcon = faPlus; public deleteIcon = faTrash; - public devices: Device[]; + public devices$ = new Observable(); public platforms = { 'mark-one': {icon: '../assets/mark-1-icon.svg', displayName: 'Mark I'}, 'mark-two': {icon: '../assets/mark-2-icon.svg', displayName: 'Mark II'}, @@ -22,12 +23,12 @@ export class DeviceListComponent implements OnInit { 'kde': {icon: '../assets/kde-icon.svg', displayName: 'KDE'} }; private selectedDevice: Device; - public settingsIcon = faCog; + public saveIcon = faSave; constructor(public dialog: MatDialog, private deviceService: DeviceService) { } ngOnInit() { - this.devices = this.deviceService.devices; + this.devices$ = this.deviceService.getDevices(); } onRemovalClick (device: Device) { @@ -40,13 +41,9 @@ export class DeviceListComponent implements OnInit { ); } - defineStaticDeviceFields(device: Device) { + getPlatform(device: Device) { const knownPlatform = this.platforms[device.platform]; - return [ - {name: 'Platform', value: knownPlatform ? knownPlatform.displayName : device.platform}, - {name: 'Core Version', value: device.coreVersion}, - {name: 'Enclosure Version', value: device.enclosureVersion} - ]; + return knownPlatform ? knownPlatform.displayName : device.platform; } getDeviceIcon(device: Device) { diff --git a/projects/account/src/app/device/device.component.html b/projects/account/src/app/device/device.component.html index 758760e..a136a1f 100644 --- a/projects/account/src/app/device/device.component.html +++ b/projects/account/src/app/device/device.component.html @@ -1,10 +1,12 @@ -
+
- + + +
diff --git a/projects/account/src/app/device/device.module.ts b/projects/account/src/app/device/device.module.ts index f52cc31..ef9a006 100644 --- a/projects/account/src/app/device/device.module.ts +++ b/projects/account/src/app/device/device.module.ts @@ -1,6 +1,5 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { DragDropModule } from '@angular/cdk/drag-drop'; import { FlexLayoutModule } from '@angular/flex-layout'; import { FormsModule } from '@angular/forms'; import { @@ -8,66 +7,47 @@ import { MatButtonToggleModule, MatCardModule, MatDialogModule, + MatDividerModule, MatExpansionModule, MatFormFieldModule, MatInputModule, MatRadioModule, - MatSelectModule, - MatSlideToggleModule, MatTabsModule, MatToolbarModule } from '@angular/material'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { AttrEditComponent } from './attribute/attr-edit.component'; -import { AttrViewComponent } from './attribute/attr-view.component'; +import { AttributeComponent } from './attribute/attribute.component'; import { DeviceComponent } from './device.component'; import { DeviceListComponent } from './device-list/device-list.component'; import { DeviceService } from './device.service'; -import { GeographyEditComponent } from './attribute/geography/geography-edit.component'; -import { GeographyViewComponent } from './attribute/geography/geography-view.component'; -import { GroupEditComponent } from './attribute/group/group-edit.component'; -import { GroupViewComponent } from './attribute/group/group-view.component'; -import { PlacementEditComponent } from './attribute/placement/placement-edit.component'; -import { PlacementViewComponent } from './attribute/placement/placement-view.component'; +import { GeographyComponent } from './attribute/geography/geography.component'; +import { GroupComponent } from './attribute/group/group.component'; +import { PlacementComponent } from './attribute/placement/placement.component'; import { RemoveComponent } from './remove/remove.component'; -import { VoiceEditComponent } from './attribute/voice/voice-edit.component'; -import { VoiceViewComponent } from './attribute/voice/voice-view.component'; +import { VoiceComponent } from './attribute/voice/voice.component'; import { PreferencesComponent } from './preferences/preferences.component'; -import { WakeWordEditComponent } from './attribute/wake-word/wake-word-edit.component'; -import { WakeWordViewComponent } from './attribute/wake-word/wake-word-view.component'; +import { WakeWordComponent } from './attribute/wake-word/wake-word.component'; @NgModule({ declarations: [ - AttrEditComponent, - AttrViewComponent, + AttributeComponent, DeviceComponent, DeviceListComponent, - GeographyEditComponent, - GeographyViewComponent, - GroupEditComponent, - GroupViewComponent, - PlacementEditComponent, - PlacementViewComponent, + GeographyComponent, + GroupComponent, + PlacementComponent, RemoveComponent, - VoiceEditComponent, - VoiceViewComponent, + VoiceComponent, PreferencesComponent, - WakeWordEditComponent, - WakeWordViewComponent + WakeWordComponent, ], entryComponents: [ - GeographyEditComponent, - GroupEditComponent, - PlacementEditComponent, - RemoveComponent, - VoiceEditComponent, - WakeWordEditComponent + RemoveComponent ], imports: [ CommonModule, - DragDropModule, FlexLayoutModule, FontAwesomeModule, FormsModule, @@ -75,12 +55,11 @@ import { WakeWordViewComponent } from './attribute/wake-word/wake-word-view.comp MatButtonToggleModule, MatCardModule, MatDialogModule, + MatDividerModule, MatExpansionModule, MatFormFieldModule, MatInputModule, MatRadioModule, - MatSelectModule, - MatSlideToggleModule, MatTabsModule, MatToolbarModule ], diff --git a/projects/account/src/app/device/device.service.ts b/projects/account/src/app/device/device.service.ts index b3ff46d..8742948 100644 --- a/projects/account/src/app/device/device.service.ts +++ b/projects/account/src/app/device/device.service.ts @@ -1,15 +1,21 @@ +import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +const deviceUrl = '/api/devices'; +const geographyUrl = 'api/geographies'; +const preferencesUrl = '/api/preferences'; +const voicesUrl = '/api/voices'; +const wakeWordUrl = '/api/wake-words'; + export interface DeviceAttribute { id?: string; name: string; - preDefined: boolean; + userDefined: boolean; } export interface Device { coreVersion: string; enclosureVersion: string; - group: DeviceAttribute; id: string; location: DeviceAttribute; name: string; @@ -19,6 +25,16 @@ export interface Device { wakeWord: DeviceAttribute; } +export interface AccountPrefrences { + dateFormat: string; + geography: DeviceAttribute; + location: DeviceAttribute; + measurementSystem: string; + timeFormat: string; + voice: DeviceAttribute; + wakeWord: DeviceAttribute; +} + @Injectable({ providedIn: 'root' }) @@ -27,87 +43,90 @@ export class DeviceService { { coreVersion: '18.08', enclosureVersion: '1.2.3', - group: {id: '1', name: 'None', preDefined: true}, id: 'abc-def-ghi', - location: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', preDefined: false}, + location: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', userDefined: false}, name: 'Mark', - placement: {id: 'bbb-bbb-bbb', name: 'Living Room', preDefined: false}, + placement: {id: 'bbb-bbb-bbb', name: 'Living Room', userDefined: false}, platform: 'mark-one', - voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', preDefined: true}, - wakeWord: {id: '1a2b-3c4d-5e6f', name: 'Hey Mycroft', preDefined: true}, + voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', userDefined: true}, + wakeWord: {id: '1a2b-3c4d-5e6f', name: 'Hey Mycroft', userDefined: true}, }, { coreVersion: '18.08', enclosureVersion: '1.2.3', - group: {id: '1', name: 'None', preDefined: true}, id: 'bcd-efg-hij', - location: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', preDefined: false}, + location: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', userDefined: false}, name: 'Marky Mark', - placement: {id: 'bbb-bbb-bbb', name: 'Kitchen', preDefined: true}, + placement: {id: 'bbb-bbb-bbb', name: 'Kitchen', userDefined: true}, platform: 'mark-two', - voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', preDefined: true}, - wakeWord: {id: 'a1b2-c3d4-e5f6', name: 'Christopher', preDefined: true} + voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', userDefined: true}, + wakeWord: {id: 'a1b2-c3d4-e5f6', name: 'Christopher', userDefined: true} }, { coreVersion: '18.08', enclosureVersion: '1.2.3', - group: {id: '2', name: 'Parent House', preDefined: false}, id: 'cde-fgh-ijk', - location: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', preDefined: false}, + location: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', userDefined: false}, name: 'American Pie', - placement: {id: 'ddd-ddd-ddd', name: 'Bedroom', preDefined: true}, + placement: {id: 'ddd-ddd-ddd', name: 'Bedroom', userDefined: true}, platform: 'picroft', - voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', preDefined: true}, - wakeWord: {id: 'a1b2-c3d4-e5f6', name: 'Christopher', preDefined: true} + voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', userDefined: true}, + wakeWord: {id: 'a1b2-c3d4-e5f6', name: 'Christopher', userDefined: true} }, { coreVersion: '18.08', enclosureVersion: '1.2.3', - group: {id: '2', name: 'Parent House', preDefined: false}, id: 'def-ghi-jkl', - location: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', preDefined: false}, + location: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', userDefined: false}, name: 'Kappa Delta Epsilon', - placement: {id: 'fff-fff-fff', name: 'Kitchen', preDefined: true}, + placement: {id: 'fff-fff-fff', name: 'Kitchen', userDefined: true}, platform: 'kde', - voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', preDefined: true}, - wakeWord: {id: 'abcd-efgh-ijkl', name: 'Hey Jarvis', preDefined: true} + voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', userDefined: true}, + wakeWord: {id: 'abcd-efgh-ijkl', name: 'Hey Jarvis', userDefined: true} } ]; - public deviceGroups: DeviceAttribute[] = [ - { id: '1', name: 'None', preDefined: true}, - { id: null, name: 'Home', preDefined: true}, - { id: null, name: 'Office', preDefined: true}, - { id: '2', name: 'Parent House', preDefined: false} - ]; - public devicePlacements: DeviceAttribute[] = [ - { id: '1', name: 'None', preDefined: true}, - { id: null, name: 'Bedroom', preDefined: true}, - { id: null, name: 'Kitchen', preDefined: true}, - { id: '2', name: 'Living Room', preDefined: false} + { id: '1', name: 'None', userDefined: true}, + { id: null, name: 'Bedroom', userDefined: true}, + { id: null, name: 'Kitchen', userDefined: true}, + { id: '2', name: 'Living Room', userDefined: false} ]; public deviceGeographies: DeviceAttribute[] = [ - {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', preDefined: false}, - {id: 'a1b2-c3d4-e5f6', name: 'United Kingdom, ABCDE, BST', preDefined: false} + {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', userDefined: false}, + {id: 'a1b2-c3d4-e5f6', name: 'United Kingdom, ABCDE, BST', userDefined: false} ]; public deviceVoices: DeviceAttribute[] = [ - {id: '1a2b-3c4d-5e6f', name: 'British Male', preDefined: true}, - {id: 'a1b2-c3d4-e5f6', name: 'American Female', preDefined: true}, - {id: 'abcd-efgh-ijkl', name: 'American Male', preDefined: true} + {id: '1a2b-3c4d-5e6f', name: 'British Male', userDefined: true}, + {id: 'a1b2-c3d4-e5f6', name: 'American Female', userDefined: true}, + {id: 'abcd-efgh-ijkl', name: 'American Male', userDefined: true} ]; - public deviceWakeWords: DeviceAttribute[] = [ - {id: '1a2b-3c4d-5e6f', name: 'Hey Mycroft', preDefined: true}, - {id: 'a1b2-c3d4-e5f6', name: 'Christopher', preDefined: true}, - {id: 'abcd-efgh-ijkl', name: 'Hey Jarvis', preDefined: true} - ]; + constructor(private http: HttpClient) { } - constructor() { } + getDevices() { + return this.http.get(deviceUrl); + } deleteDevice(device: Device): void { console.log('deleting device... '); } + + getAccountPreferences() { + return this.http.get(preferencesUrl); + } + + getGeographies() { + return this.http.get(geographyUrl); + } + getVoices() { + return this.http.get(voicesUrl); + } + + getWakeWords() { + return this.http.get(wakeWordUrl); + } + } diff --git a/projects/account/src/app/device/preferences/preferences.component.html b/projects/account/src/app/device/preferences/preferences.component.html index 8aa6f35..c4d0c83 100644 --- a/projects/account/src/app/device/preferences/preferences.component.html +++ b/projects/account/src/app/device/preferences/preferences.component.html @@ -1,51 +1,51 @@ - - - Basic Settings - -
- Use device groups - - Measurement System - - Imperial - Metric - - - - Time Format - - 12 Hour - 24 Hour - - - - Date Format - - DD/MM/YYYY - MM/DD/YYYY - - -
-
+ + + + Basic Settings + + +
+ Measurement System + + Imperial + Metric + +
+
+ Time Format + + 12 Hour + 24 Hour + +
+
+ Date Format + + DD/MM/YYYY + MM/DD/YYYY + +
+
+
- - - Defaults - -
- Default Location - -
-
+ + + Defaults + + + + + - - - Advanced Settings - -
-
-

{{paragraph}}

+ + + Advanced Settings + +
+
+

{{paragraph}}

+
+
- -
- + + diff --git a/projects/account/src/app/device/preferences/preferences.component.scss b/projects/account/src/app/device/preferences/preferences.component.scss index db6b8e3..9d57aa7 100644 --- a/projects/account/src/app/device/preferences/preferences.component.scss +++ b/projects/account/src/app/device/preferences/preferences.component.scss @@ -1,8 +1,12 @@ @import "~src/stylesheets/components/buttons"; @import "~src/stylesheets/components/cards"; -#basic-settings-card { +mat-card { @include section-card; + max-width: 700px; +} + +#basic-settings-card { margin-top: 16px; mat-button-toggle-group { @@ -19,11 +23,7 @@ } } -#default-settings-card { - @include section-card; -} #advanced-settings-card { - @include section-card; button { @include action-button-primary; margin-left: auto; diff --git a/projects/account/src/app/device/preferences/preferences.component.ts b/projects/account/src/app/device/preferences/preferences.component.ts index 0be1f0c..7964556 100644 --- a/projects/account/src/app/device/preferences/preferences.component.ts +++ b/projects/account/src/app/device/preferences/preferences.component.ts @@ -1,5 +1,8 @@ import { Component, OnInit } from '@angular/core'; +import { AccountPrefrences, DeviceService } from '../device.service'; +import { Observable } from 'rxjs'; + @Component({ selector: 'account-device-preferences', templateUrl: './preferences.component.html', @@ -17,10 +20,12 @@ export class PreferencesComponent implements OnInit { 'Follow the link below for documentation on the options available ' + 'and how to edit them.' ]; + public preferences$ = new Observable(); - constructor() { } + constructor(private deviceService: DeviceService) { } ngOnInit() { + this.preferences$ = this.deviceService.getAccountPreferences(); } } From ecf4f1cfd89276ecc0022ca12108c3c0db5c5897 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 5 Mar 2019 23:10:51 -0600 Subject: [PATCH 010/163] enable google login --- .../facebook-button.component.ts | 1 - .../google-button.component.html | 2 +- .../google-button/google-button.component.ts | 14 +++++- .../src/lib/google-button/google-logo.svg | 43 ------------------- projects/shared/src/lib/shared.module.ts | 12 +++--- projects/shared/src/lib/shared.service.ts | 9 ---- projects/shared/src/projects.ts | 1 - 7 files changed, 19 insertions(+), 63 deletions(-) delete mode 100644 projects/shared/src/lib/google-button/google-logo.svg delete mode 100644 projects/shared/src/lib/shared.service.ts diff --git a/projects/shared/src/lib/facebook-button/facebook-button.component.ts b/projects/shared/src/lib/facebook-button/facebook-button.component.ts index 45a320a..6339be1 100644 --- a/projects/shared/src/lib/facebook-button/facebook-button.component.ts +++ b/projects/shared/src/lib/facebook-button/facebook-button.component.ts @@ -21,5 +21,4 @@ export class FacebookButtonComponent { ); } - } diff --git a/projects/shared/src/lib/google-button/google-button.component.html b/projects/shared/src/lib/google-button/google-button.component.html index 46bded8..f492de0 100644 --- a/projects/shared/src/lib/google-button/google-button.component.html +++ b/projects/shared/src/lib/google-button/google-button.component.html @@ -1,4 +1,4 @@ - diff --git a/projects/shared/src/lib/google-button/google-button.component.ts b/projects/shared/src/lib/google-button/google-button.component.ts index a777178..d43e9b4 100644 --- a/projects/shared/src/lib/google-button/google-button.component.ts +++ b/projects/shared/src/lib/google-button/google-button.component.ts @@ -1,6 +1,7 @@ -import { Component} from '@angular/core'; +import { Component, EventEmitter, Output } from '@angular/core'; import { faGoogle } from '@fortawesome/free-brands-svg-icons'; +import { AuthService, GoogleLoginProvider } from 'angular-6-social-login'; @Component({ selector: 'shared-google-button', @@ -9,6 +10,15 @@ import { faGoogle } from '@fortawesome/free-brands-svg-icons'; }) export class GoogleButtonComponent { public googleIcon = faGoogle; + @Output() googleEmail = new EventEmitter(); + + constructor(private authService: AuthService) { } + + googleLogin() { + const platformProvider = GoogleLoginProvider.PROVIDER_ID; + this.authService.signIn(platformProvider).then( + (userData) => { this.googleEmail.emit(userData.email); } + ); +} - constructor() { } } diff --git a/projects/shared/src/lib/google-button/google-logo.svg b/projects/shared/src/lib/google-button/google-logo.svg deleted file mode 100644 index 032b6ac..0000000 --- a/projects/shared/src/lib/google-button/google-logo.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - btn_google_light_normal_ios - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/projects/shared/src/lib/shared.module.ts b/projects/shared/src/lib/shared.module.ts index b65fe31..07b39e1 100644 --- a/projects/shared/src/lib/shared.module.ts +++ b/projects/shared/src/lib/shared.module.ts @@ -15,7 +15,6 @@ import { GithubButtonComponent } from './github-button/github-button.component'; import { GoogleButtonComponent } from './google-button/google-button.component'; import { MembershipOptionsComponent } from './membership-options/membership-options.component'; import { SharedComponent } from './shared.component'; -import { SharedService } from './shared.service'; export function getAuthServiceConfigs() { return new AuthServiceConfig( @@ -24,10 +23,12 @@ export function getAuthServiceConfigs() { id: FacebookLoginProvider.PROVIDER_ID, provider: new FacebookLoginProvider('2266714353557295') }, - // { - // id: GoogleLoginProvider.PROVIDER_ID, - // provider: new GoogleLoginProvider("Your-Google-Client-Id") - // } + { + id: GoogleLoginProvider.PROVIDER_ID, + provider: new GoogleLoginProvider( + '17489788035-6jpef494tdpiidg80vvfldh2biueiqfi.apps.googleusercontent.com' + ) + } ] ); } @@ -55,7 +56,6 @@ export function getAuthServiceConfigs() { SharedComponent ], providers: [ - SharedService, { provide: AuthServiceConfig, useFactory: getAuthServiceConfigs } ] }) diff --git a/projects/shared/src/lib/shared.service.ts b/projects/shared/src/lib/shared.service.ts deleted file mode 100644 index a869789..0000000 --- a/projects/shared/src/lib/shared.service.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Injectable } from '@angular/core'; - -@Injectable({ - providedIn: 'root' -}) -export class SharedService { - - constructor() { } -} diff --git a/projects/shared/src/projects.ts b/projects/shared/src/projects.ts index bb2d857..ad95a14 100644 --- a/projects/shared/src/projects.ts +++ b/projects/shared/src/projects.ts @@ -2,6 +2,5 @@ * Public API Surface of shared */ -export * from './lib/shared.service'; export * from './lib/shared.component'; export * from './lib/shared.module'; From c18994bbb5d9d6c518eb74466e488f413cd1cd51 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 5 Mar 2019 23:11:40 -0600 Subject: [PATCH 011/163] used shared login buttons and enable google login --- projects/sso/src/app/app.service.ts | 7 ++-- .../federated-login.component.html | 12 ++----- .../federated-login.component.ts | 35 +++---------------- projects/sso/src/app/login/login.module.ts | 29 +++------------ 4 files changed, 14 insertions(+), 69 deletions(-) diff --git a/projects/sso/src/app/app.service.ts b/projects/sso/src/app/app.service.ts index 80c3db1..7b2ddaf 100644 --- a/projects/sso/src/app/app.service.ts +++ b/projects/sso/src/app/app.service.ts @@ -59,11 +59,8 @@ export class AppService { return this.http.get(internalAuthUrl, {headers: httpHeaders}); } - validateFederatedLogin(socialLoginData: any) { - return this.http.post( - federatedAuthUrl, - socialLoginData - ); + validateFederatedLogin(email: string) { + return this.http.post(federatedAuthUrl, {email: email}); } logout(): Observable { diff --git a/projects/sso/src/app/login/federated-login/federated-login.component.html b/projects/sso/src/app/login/federated-login/federated-login.component.html index c5d6e10..64c193c 100644 --- a/projects/sso/src/app/login/federated-login/federated-login.component.html +++ b/projects/sso/src/app/login/federated-login/federated-login.component.html @@ -1,13 +1,7 @@
- - - diff --git a/projects/sso/src/app/login/federated-login/federated-login.component.ts b/projects/sso/src/app/login/federated-login/federated-login.component.ts index e3f00a2..609f3b1 100644 --- a/projects/sso/src/app/login/federated-login/federated-login.component.ts +++ b/projects/sso/src/app/login/federated-login/federated-login.component.ts @@ -1,12 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { MatSnackBar } from '@angular/material'; -import { faFacebook, faGithub } from '@fortawesome/free-brands-svg-icons'; -import { - AuthService, - FacebookLoginProvider, - GoogleLoginProvider -} from 'angular-6-social-login'; +import { faGithub } from '@fortawesome/free-brands-svg-icons'; import { AppService } from '../../app.service'; @@ -19,39 +14,19 @@ const tenSeconds = 10000; styleUrls: ['./federated-login.component.scss'] }) export class FederatedLoginComponent implements OnInit { - public facebookIcon = faFacebook; public githubIcon = faGithub; constructor( - private authService: AuthService, private errorSnackBar: MatSnackBar, private ssoService: AppService ) { } ngOnInit() { } - public federatedSignIn(platform: string) { - let platformProvider; - if ( platform === 'facebook') { - platformProvider = FacebookLoginProvider.PROVIDER_ID; - this.facebookGoogleLogin(platformProvider); - } else if (platform === 'google') { - platformProvider = GoogleLoginProvider.PROVIDER_ID; - this.facebookGoogleLogin(platformProvider); - } else if (platform === 'github') { - this.ssoService.gitHubLogin().subscribe((response) => { console.log(response); }); - } - - } - - private facebookGoogleLogin(platformProvider) { - this.authService.signIn(platformProvider).then( - (userData) => { - this.ssoService.validateFederatedLogin(userData).subscribe( - (response) => { this.ssoService.navigateToRedirectURI(noDelay); }, - (response) => { this.onAuthFailure(response); } - ); - } + private validateFederatedLogin(email: string) { + this.ssoService.validateFederatedLogin(email).subscribe( + (response) => { this.ssoService.navigateToRedirectURI(noDelay); }, + (response) => { this.onAuthFailure(response); } ); } diff --git a/projects/sso/src/app/login/login.module.ts b/projects/sso/src/app/login/login.module.ts index 44b74b0..4c10874 100644 --- a/projects/sso/src/app/login/login.module.ts +++ b/projects/sso/src/app/login/login.module.ts @@ -14,32 +14,12 @@ import { } from '@angular/material'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { - AuthServiceConfig, - FacebookLoginProvider, - GoogleLoginProvider, - SocialLoginModule -} from 'angular-6-social-login'; +import { AppService } from '../app.service'; import { FederatedLoginComponent } from './federated-login/federated-login.component'; import { InternalLoginComponent } from './internal-login/internal-login.component'; import { LoginComponent } from './login.component'; -import { AppService } from '../app.service'; - -export function getAuthServiceConfigs() { - return new AuthServiceConfig( - [ - { - id: FacebookLoginProvider.PROVIDER_ID, - provider: new FacebookLoginProvider('2266714353557295') - }, - // { - // id: GoogleLoginProvider.PROVIDER_ID, - // provider: new GoogleLoginProvider("Your-Google-Client-Id") - // } - ] - ); -} +import { SharedModule } from 'shared'; @NgModule({ declarations: [ @@ -63,11 +43,10 @@ export function getAuthServiceConfigs() { MatInputModule, MatSnackBarModule, ReactiveFormsModule, - SocialLoginModule + SharedModule ], providers: [ - AppService, - { provide: AuthServiceConfig, useFactory: getAuthServiceConfigs } + AppService ] }) export class LoginModule { } From f221e542922f4ff432a219b9a67a45040964da3b Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 6 Mar 2019 11:19:02 -0600 Subject: [PATCH 012/163] squashed a bug where users selecting not to be a member could not progress through new account setup --- .../membership-options/membership-options.component.html | 8 ++++---- .../membership-options/membership-options.component.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/shared/src/lib/membership-options/membership-options.component.html b/projects/shared/src/lib/membership-options/membership-options.component.html index a8c9333..7b85609 100644 --- a/projects/shared/src/lib/membership-options/membership-options.component.html +++ b/projects/shared/src/lib/membership-options/membership-options.component.html @@ -1,17 +1,17 @@

{{membership.type}}

{{membership.price}} USD

- +

Maybe Later

diff --git a/projects/shared/src/lib/membership-options/membership-options.component.ts b/projects/shared/src/lib/membership-options/membership-options.component.ts index c95c8e4..a203b02 100644 --- a/projects/shared/src/lib/membership-options/membership-options.component.ts +++ b/projects/shared/src/lib/membership-options/membership-options.component.ts @@ -40,8 +40,8 @@ export class MembershipOptionsComponent implements OnDestroy { this.membershipTypes = [yearlySupporter, monthlySupporter]; } - onMembershipSelect(membership: MembershipType) { - this.selectedMembership.emit(membership.type); + onMembershipSelect(membershipType: string) { + this.selectedMembership.emit(membershipType); } ngOnDestroy(): void { From 68742cd753f3bda8e8d0ad352d071ec93f459e74 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 6 Mar 2019 11:19:34 -0600 Subject: [PATCH 013/163] swapped order of membership and open data set at request of marketing --- .../support-step/support-step.component.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/projects/account/src/app/create-account/support-step/support-step.component.html b/projects/account/src/app/create-account/support-step/support-step.component.html index 864d0cf..09865fe 100644 --- a/projects/account/src/app/create-account/support-step/support-step.component.html +++ b/projects/account/src/app/create-account/support-step/support-step.component.html @@ -1,3 +1,11 @@ + +

Become a Member

+

+ {{paragraph}} +

+ +
+

Join Mycroft's Open Dataset

@@ -8,11 +16,3 @@ Maybe Later - - -

Become a Member

-

- {{paragraph}} -

- -
From b90233c96cbaf0de2d0b81c6906c6d665bb8b5b7 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 6 Mar 2019 11:20:52 -0600 Subject: [PATCH 014/163] replaced lingering references to "display name" with "username" --- .../create-account/username-step/username-step.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/create-account/username-step/username-step.component.html b/projects/account/src/app/create-account/username-step/username-step.component.html index df76c31..6188680 100644 --- a/projects/account/src/app/create-account/username-step/username-step.component.html +++ b/projects/account/src/app/create-account/username-step/username-step.component.html @@ -2,10 +2,10 @@

What should we call you?

{{whyUsernameParagraph}}

- Display Name + Username - Display Name is required + Username is required From 5e42064e4adf9db1257adcafb2c4e235eb83debb Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 8 Mar 2019 17:47:51 -0600 Subject: [PATCH 015/163] added logic to get the membership types from the API --- .../membership/membership.component.html | 6 ++- .../membership/membership.component.ts | 47 +++++-------------- .../src/app/profile/profile.component.html | 6 ++- .../src/app/profile/profile.component.ts | 6 ++- .../src/app/profile/profile.service.ts | 12 +++++ .../membership-options.component.html | 6 +-- .../membership-options.component.ts | 29 ++++-------- 7 files changed, 51 insertions(+), 61 deletions(-) diff --git a/projects/account/src/app/profile/membership/membership.component.html b/projects/account/src/app/profile/membership/membership.component.html index 7c8072f..2685c91 100644 --- a/projects/account/src/app/profile/membership/membership.component.html +++ b/projects/account/src/app/profile/membership/membership.component.html @@ -4,7 +4,11 @@ Mycroft supporters gain access to premium services, such as voices. - + + Proudly supporting Mycroft for {{accountMembership.duration}}! diff --git a/projects/account/src/app/profile/membership/membership.component.ts b/projects/account/src/app/profile/membership/membership.component.ts index 28f1023..2695487 100644 --- a/projects/account/src/app/profile/membership/membership.component.ts +++ b/projects/account/src/app/profile/membership/membership.component.ts @@ -1,51 +1,28 @@ import { Component, Input, OnDestroy } from '@angular/core'; import { MediaChange, MediaObserver } from '@angular/flex-layout'; -import { Subscription } from 'rxjs'; - -import { Membership } from '../profile.service'; - -export interface SubscriptionType { - name: string; - price: string; - period: string; -} - -const nonSupporter: SubscriptionType = { - name: 'Maybe Later', - price: '$0', - period: null -}; -const monthlySupporter: SubscriptionType = { - name: 'Monthly Supporter', - price: '$1.99', - period: 'month' -}; -const yearlySupporter: SubscriptionType = { - name: 'Yearly Supporter', - price: '$19.99', - period: 'year' -}; +import { Router } from '@angular/router'; +import { Observable, Subscription } from 'rxjs'; +import { Membership, MembershipType } from '../profile.service'; @Component({ - selector: 'account-subscription', - templateUrl: './membership.component.html', - styleUrls: ['./membership.component.scss'] + selector: 'account-membership', + templateUrl: './membership.component.html', + styleUrls: ['./membership.component.scss'] }) export class MembershipComponent implements OnDestroy { @Input() accountMembership: Membership; - public subscriptionTypes: SubscriptionType[]; + @Input() membershipTypes: MembershipType[]; public alignVertical: boolean; private mediaWatcher: Subscription; - constructor(public mediaObserver: MediaObserver) { - this.mediaWatcher = mediaObserver.media$.subscribe( - (change: MediaChange) => { + constructor(public mediaObserver: MediaObserver, private router: Router) { + this.mediaWatcher = mediaObserver.media$.subscribe( + (change: MediaChange) => { this.alignVertical = ['xs', 'sm'].includes(change.mqAlias); } - ); - this.subscriptionTypes = [yearlySupporter, monthlySupporter, nonSupporter]; - } + ); + } ngOnDestroy(): void { this.mediaWatcher.unsubscribe(); diff --git a/projects/account/src/app/profile/profile.component.html b/projects/account/src/app/profile/profile.component.html index be1d7d4..99c0f69 100644 --- a/projects/account/src/app/profile/profile.component.html +++ b/projects/account/src/app/profile/profile.component.html @@ -1,6 +1,10 @@ - + + diff --git a/projects/account/src/app/profile/profile.component.ts b/projects/account/src/app/profile/profile.component.ts index 610cc57..7124af1 100644 --- a/projects/account/src/app/profile/profile.component.ts +++ b/projects/account/src/app/profile/profile.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { ProfileService, Account } from './profile.service'; +import { Account, MembershipType, ProfileService } from './profile.service'; import { Observable } from 'rxjs'; @Component({ @@ -9,11 +9,13 @@ import { Observable } from 'rxjs'; styleUrls: ['./profile.component.scss'] }) export class ProfileComponent implements OnInit { - public account$: Observable; + public account$ = new Observable(); + public membershipTypes$ = new Observable(); constructor(private service: ProfileService) { } ngOnInit() { this.account$ = this.service.getAccount(); + this.membershipTypes$ = this.service.getMembershipTypes(); } } diff --git a/projects/account/src/app/profile/profile.service.ts b/projects/account/src/app/profile/profile.service.ts index 550e38a..bdd379b 100644 --- a/projects/account/src/app/profile/profile.service.ts +++ b/projects/account/src/app/profile/profile.service.ts @@ -7,6 +7,7 @@ import { environment } from '../../environments/environment'; import { catchError } from 'rxjs/operators'; const accountUrl = '/api/account'; +const membershipTypesUrl = '/api/memberships'; export interface Agreement { type: string; @@ -27,6 +28,13 @@ export interface Account { agreements: Agreement[]; } +export interface MembershipType { + type: string; + rate: string; + ratePeriod: string; + stripePlan: string; +} + @Injectable() export class ProfileService { constructor(private http: HttpClient) { @@ -61,4 +69,8 @@ export class ProfileService { catchError(this.handleError) ); } + + getMembershipTypes(): Observable { + return this.http.get(membershipTypesUrl); + } } diff --git a/projects/shared/src/lib/membership-options/membership-options.component.html b/projects/shared/src/lib/membership-options/membership-options.component.html index 7b85609..35fa699 100644 --- a/projects/shared/src/lib/membership-options/membership-options.component.html +++ b/projects/shared/src/lib/membership-options/membership-options.component.html @@ -2,16 +2,16 @@ class="options-button-group" [vertical]="alignVertical" [value]="accountMembership" + (change)="onMembershipSelect($event)" >

{{membership.type}}

-

{{membership.price}} USD

+

{{membership.rate}} USD

- +

Maybe Later

diff --git a/projects/shared/src/lib/membership-options/membership-options.component.ts b/projects/shared/src/lib/membership-options/membership-options.component.ts index a203b02..1f1d1df 100644 --- a/projects/shared/src/lib/membership-options/membership-options.component.ts +++ b/projects/shared/src/lib/membership-options/membership-options.component.ts @@ -1,24 +1,16 @@ import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core'; import { MediaChange, MediaObserver } from '@angular/flex-layout'; -import { Subscription } from 'rxjs'; +import { MatButtonToggleChange } from '@angular/material'; + +import { Observable, Subscription } from 'rxjs'; export interface MembershipType { type: string; - price: string; - period: string; + rate: string; + ratePeriod: string; + stripePlan: string; } -const monthlySupporter: MembershipType = { - type: 'Monthly Membership', - price: '$1.99', - period: 'month' -}; -const yearlySupporter: MembershipType = { - type: 'Yearly Membership', - price: '$19.99', - period: 'year' -}; - @Component({ selector: 'shared-membership-options', templateUrl: './membership-options.component.html', @@ -27,9 +19,9 @@ const yearlySupporter: MembershipType = { export class MembershipOptionsComponent implements OnDestroy { @Input() accountMembership: string; public alignVertical: boolean; - public membershipTypes: MembershipType[]; + @Input() membershipTypes: MembershipType[]; public mediaWatcher: Subscription; - @Output() selectedMembership = new EventEmitter(); + @Output() membershipSelected = new EventEmitter(); constructor(public mediaObserver: MediaObserver) { this.mediaWatcher = mediaObserver.media$.subscribe( @@ -37,11 +29,10 @@ export class MembershipOptionsComponent implements OnDestroy { this.alignVertical = ['xs', 'sm'].includes(change.mqAlias); } ); - this.membershipTypes = [yearlySupporter, monthlySupporter]; } - onMembershipSelect(membershipType: string) { - this.selectedMembership.emit(membershipType); + onMembershipSelect(membershipType: MatButtonToggleChange) { + this.membershipSelected.emit(membershipType.value); } ngOnDestroy(): void { From db397a2466d6e1d352297bd664f3961c2dc1f415 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 8 Mar 2019 17:56:08 -0600 Subject: [PATCH 016/163] commented out buttons to change username and password until they can be implemented --- projects/account/src/app/profile/login/login.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/profile/login/login.component.html b/projects/account/src/app/profile/login/login.component.html index 45f5f9f..1213fbb 100644 --- a/projects/account/src/app/profile/login/login.component.html +++ b/projects/account/src/app/profile/login/login.component.html @@ -14,8 +14,8 @@
- - + +
From f90ce08f9f15b8460aceb4df56551719e60d0ee8 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 8 Mar 2019 23:08:14 -0600 Subject: [PATCH 017/163] removed unused import --- .../src/lib/membership-options/membership-options.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/shared/src/lib/membership-options/membership-options.component.ts b/projects/shared/src/lib/membership-options/membership-options.component.ts index 1f1d1df..acb2a1c 100644 --- a/projects/shared/src/lib/membership-options/membership-options.component.ts +++ b/projects/shared/src/lib/membership-options/membership-options.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core import { MediaChange, MediaObserver } from '@angular/flex-layout'; import { MatButtonToggleChange } from '@angular/material'; -import { Observable, Subscription } from 'rxjs'; +import { Subscription } from 'rxjs'; export interface MembershipType { type: string; From f905d4444eaaa3fb0f4f904036a75babb3d63444 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 01:16:47 -0500 Subject: [PATCH 018/163] implement child routes in the skill feature module to support lazy loading --- .../src/app/skill/skill-routing.module.ts | 18 ++++++++++++++++++ .../account/src/app/skill/skill.component.html | 1 + projects/account/src/app/skill/skill.module.ts | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 projects/account/src/app/skill/skill-routing.module.ts diff --git a/projects/account/src/app/skill/skill-routing.module.ts b/projects/account/src/app/skill/skill-routing.module.ts new file mode 100644 index 0000000..b3f35b7 --- /dev/null +++ b/projects/account/src/app/skill/skill-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +import { SkillComponent } from './skill.component'; + +const skillRoutes: Routes = [ + {path: 'skill', component: SkillComponent}, +]; + +@NgModule({ + imports: [ + RouterModule.forChild(skillRoutes) + ], + exports: [ + RouterModule + ] +}) +export class SkillRoutingModule { } diff --git a/projects/account/src/app/skill/skill.component.html b/projects/account/src/app/skill/skill.component.html index ac14e1f..294b631 100644 --- a/projects/account/src/app/skill/skill.component.html +++ b/projects/account/src/app/skill/skill.component.html @@ -1,3 +1,4 @@ +

Configure Your Skills

{{helpText}}

diff --git a/projects/account/src/app/skill/skill.module.ts b/projects/account/src/app/skill/skill.module.ts index 8ddf259..cdc99ba 100644 --- a/projects/account/src/app/skill/skill.module.ts +++ b/projects/account/src/app/skill/skill.module.ts @@ -17,6 +17,7 @@ import { SkillComponent } from './skill.component'; import { SettingFieldComponent } from './setting-field/setting-field.component'; import { SettingSectionComponent } from './setting-section/setting-section.component'; import { SkillPanelComponent } from './skill-panel/skill-panel.component'; +import { SkillRoutingModule } from './skill-routing.module'; @NgModule({ declarations: [ @@ -35,7 +36,8 @@ import { SkillPanelComponent } from './skill-panel/skill-panel.component'; MatExpansionModule, MatInputModule, MatSelectModule, - MatTabsModule + MatTabsModule, + SkillRoutingModule ] }) export class SkillModule { } From fba3cdd19f1755fc118aef60830f43d19a266100 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:41:01 -0500 Subject: [PATCH 019/163] implement routing in the device feature module. --- .../src/app/device/device-routing.module.ts | 18 ++++++++++++++++++ .../src/app/device/device.component.html | 1 + .../account/src/app/device/device.module.ts | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 projects/account/src/app/device/device-routing.module.ts diff --git a/projects/account/src/app/device/device-routing.module.ts b/projects/account/src/app/device/device-routing.module.ts new file mode 100644 index 0000000..d299178 --- /dev/null +++ b/projects/account/src/app/device/device-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +import { DeviceComponent} from './device.component'; + +const deviceRoutes: Routes = [ + {path: 'devices', component: DeviceComponent}, +]; + +@NgModule({ + imports: [ + RouterModule.forChild(deviceRoutes) + ], + exports: [ + RouterModule + ] +}) +export class DeviceRoutingModule { } diff --git a/projects/account/src/app/device/device.component.html b/projects/account/src/app/device/device.component.html index a136a1f..92d4e24 100644 --- a/projects/account/src/app/device/device.component.html +++ b/projects/account/src/app/device/device.component.html @@ -1,3 +1,4 @@ +

diff --git a/projects/account/src/app/device/device.module.ts b/projects/account/src/app/device/device.module.ts index ef9a006..3e852e8 100644 --- a/projects/account/src/app/device/device.module.ts +++ b/projects/account/src/app/device/device.module.ts @@ -21,6 +21,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { AttributeComponent } from './attribute/attribute.component'; import { DeviceComponent } from './device.component'; import { DeviceListComponent } from './device-list/device-list.component'; +import { DeviceRoutingModule } from './device-routing.module'; import { DeviceService } from './device.service'; import { GeographyComponent } from './attribute/geography/geography.component'; import { GroupComponent } from './attribute/group/group.component'; @@ -61,7 +62,8 @@ import { WakeWordComponent } from './attribute/wake-word/wake-word.component'; MatInputModule, MatRadioModule, MatTabsModule, - MatToolbarModule + MatToolbarModule, + DeviceRoutingModule ], providers: [ DeviceService From e4cb8d0921e562c5435fbe650d7317eaaa72f411 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:42:35 -0500 Subject: [PATCH 020/163] implement routing in the create-account feature module. --- .../agreement-step.component.ts | 2 +- .../create-account-routing.module.ts | 21 +++++++++++++++++++ .../create-account.component.html | 1 + .../create-account/create-account.module.ts | 2 ++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 projects/account/src/app/create-account/create-account-routing.module.ts diff --git a/projects/account/src/app/create-account/agreement-step/agreement-step.component.ts b/projects/account/src/app/create-account/agreement-step/agreement-step.component.ts index 451dfc2..92c42f4 100644 --- a/projects/account/src/app/create-account/agreement-step/agreement-step.component.ts +++ b/projects/account/src/app/create-account/agreement-step/agreement-step.component.ts @@ -4,7 +4,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; -import { Agreement, CreateAccountService } from '../create-account.service'; +import { CreateAccountService } from '../create-account.service'; @Component({ diff --git a/projects/account/src/app/create-account/create-account-routing.module.ts b/projects/account/src/app/create-account/create-account-routing.module.ts new file mode 100644 index 0000000..f19a2b4 --- /dev/null +++ b/projects/account/src/app/create-account/create-account-routing.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +import { CreateAccountComponent } from './create-account.component'; + +const createAccountRoutes: Routes = [ + { + path: 'new', + component: CreateAccountComponent + } +]; + +@NgModule({ + imports: [ + RouterModule.forChild(createAccountRoutes) + ], + exports: [ + RouterModule + ] +}) +export class CreateAccountRoutingModule { } diff --git a/projects/account/src/app/create-account/create-account.component.html b/projects/account/src/app/create-account/create-account.component.html index 92091d9..6565a4e 100644 --- a/projects/account/src/app/create-account/create-account.component.html +++ b/projects/account/src/app/create-account/create-account.component.html @@ -1,3 +1,4 @@ +
diff --git a/projects/account/src/app/create-account/create-account.module.ts b/projects/account/src/app/create-account/create-account.module.ts index 3580efb..15703df 100644 --- a/projects/account/src/app/create-account/create-account.module.ts +++ b/projects/account/src/app/create-account/create-account.module.ts @@ -17,6 +17,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { AuthenticationStepComponent } from './authentication-step/authentication-step.component'; import { AgreementStepComponent } from './agreement-step/agreement-step.component'; import { CreateAccountComponent } from './create-account.component'; +import { CreateAccountRoutingModule } from './create-account-routing.module'; import { CreateAccountService } from './create-account.service'; import { UsernameStepComponent } from './username-step/username-step.component'; import { SharedModule } from 'shared'; @@ -46,6 +47,7 @@ import { DoneStepComponent } from './done-step/done-step.component'; MatStepperModule, ReactiveFormsModule, SharedModule, + CreateAccountRoutingModule ], providers: [ CreateAccountService From 573b1f2f8a6a1b0828af7c157474fdaed7ef28db Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:43:36 -0500 Subject: [PATCH 021/163] new resolver route guards so that the profile page doesn't load until all the data is fetched --- .../app/profile/account-resolver.service.ts | 20 +++++++++++++++++++ .../profile/membership-resolver.service.ts | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 projects/account/src/app/profile/account-resolver.service.ts create mode 100644 projects/account/src/app/profile/membership-resolver.service.ts diff --git a/projects/account/src/app/profile/account-resolver.service.ts b/projects/account/src/app/profile/account-resolver.service.ts new file mode 100644 index 0000000..ffeb6c5 --- /dev/null +++ b/projects/account/src/app/profile/account-resolver.service.ts @@ -0,0 +1,20 @@ +import { Injectable } from '@angular/core'; +import { + Resolve, + RouterStateSnapshot, + ActivatedRouteSnapshot +} from '@angular/router'; +import { Observable } from 'rxjs'; + +import { Account, ProfileService } from './profile.service'; + +@Injectable({ + providedIn: 'root', +}) +export class AccountResolverService implements Resolve { + constructor(private profileService: ProfileService) {} + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Observable { + return this.profileService.getAccount(); + } +} diff --git a/projects/account/src/app/profile/membership-resolver.service.ts b/projects/account/src/app/profile/membership-resolver.service.ts new file mode 100644 index 0000000..118aa1a --- /dev/null +++ b/projects/account/src/app/profile/membership-resolver.service.ts @@ -0,0 +1,20 @@ +import { Injectable } from '@angular/core'; +import { + Resolve, + RouterStateSnapshot, + ActivatedRouteSnapshot +} from '@angular/router'; +import { Observable } from 'rxjs'; + +import { MembershipType, ProfileService } from './profile.service'; + +@Injectable({ + providedIn: 'root', +}) +export class MembershipResolverService implements Resolve { + constructor(private profileService: ProfileService) {} + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Observable { + return this.profileService.getMembershipTypes(); + } +} From ab6c36f364adbf1d867b17efdb18bfa5a8ba2d31 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:44:08 -0500 Subject: [PATCH 022/163] added stripe API key to environment variables --- projects/account/src/environments/environment.dev.ts | 3 ++- projects/account/src/environments/environment.prod.ts | 3 ++- projects/account/src/environments/environment.test.ts | 3 ++- projects/account/src/environments/environment.ts | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/projects/account/src/environments/environment.dev.ts b/projects/account/src/environments/environment.dev.ts index 601dadb..15cfadd 100644 --- a/projects/account/src/environments/environment.dev.ts +++ b/projects/account/src/environments/environment.dev.ts @@ -9,5 +9,6 @@ export const environment = { mimic: 'https://mimic.mycroft.ai', translate: 'https://translate-test.mycroft.ai', wordPress: 'https://test.mycroft.ai' - } + }, + stripeApiKey: 'pk_test_TqHz3ZzSHLFAjlmamQvLgQ5F' }; diff --git a/projects/account/src/environments/environment.prod.ts b/projects/account/src/environments/environment.prod.ts index 3015510..08c5810 100644 --- a/projects/account/src/environments/environment.prod.ts +++ b/projects/account/src/environments/environment.prod.ts @@ -9,5 +9,6 @@ export const environment = { singleSignOn: 'https://sso.mycroft.ai', translate: 'https://translate.mycroft.ai', wordPress: 'https://mycroft.ai' - } + }, + stripeApiKey: 'pk_live_5sXD1Bgfb9f8bSd37cQVUv64' }; diff --git a/projects/account/src/environments/environment.test.ts b/projects/account/src/environments/environment.test.ts index 729d692..6538946 100644 --- a/projects/account/src/environments/environment.test.ts +++ b/projects/account/src/environments/environment.test.ts @@ -9,5 +9,6 @@ export const environment = { mimic: 'https://mimic.mycroft.ai', translate: 'https://translate-test.mycroft.ai', wordPress: 'https://test.mycroft.ai' - } + }, + stripeApiKey: 'pk_test_TqHz3ZzSHLFAjlmamQvLgQ5F' }; diff --git a/projects/account/src/environments/environment.ts b/projects/account/src/environments/environment.ts index 5a60773..14c40c2 100644 --- a/projects/account/src/environments/environment.ts +++ b/projects/account/src/environments/environment.ts @@ -13,7 +13,8 @@ export const environment = { singleSignOn: 'https://sso.mycroft.test', translate: 'https://translate-test.mycroft.ai', wordPress: 'https://test.mycroft.ai' - } + }, + stripeApiKey: 'pk_test_TqHz3ZzSHLFAjlmamQvLgQ5F' }; /* From 11cf24dc14883159e11c9dde50b40920b6ae93c0 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:44:55 -0500 Subject: [PATCH 023/163] moved feature module routes to their respective modules --- projects/account/src/app/app-routing.module.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/projects/account/src/app/app-routing.module.ts b/projects/account/src/app/app-routing.module.ts index f6e6db4..4423d31 100644 --- a/projects/account/src/app/app-routing.module.ts +++ b/projects/account/src/app/app-routing.module.ts @@ -1,23 +1,23 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { CreateAccountComponent } from './create-account/create-account.component'; -import { DeviceComponent } from './device/device.component'; import { PageNotFoundComponent } from 'page-not-found'; -import { ProfileComponent } from './profile/profile.component'; -import { SkillComponent } from './skill/skill.component'; const routes: Routes = [ - { path: 'create-account', component: CreateAccountComponent }, - { path: 'device', component: DeviceComponent }, - { path: 'profile', component: ProfileComponent }, - { path: 'skill', component: SkillComponent }, { path: '', redirectTo: '/profile', pathMatch: 'full' }, { path: '**', component: PageNotFoundComponent } ]; @NgModule({ - imports: [ RouterModule.forRoot(routes) ], + imports: [ + RouterModule.forRoot( + routes, + { + anchorScrolling: 'enabled', + scrollPositionRestoration: 'enabled' + } + ) + ], exports: [ RouterModule ] }) export class AppRoutingModule { From bd97f49703d48290121ee82c90e1499ed4f39f93 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:45:17 -0500 Subject: [PATCH 024/163] minor url tweak --- projects/account/src/app/skill/skill-routing.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/skill/skill-routing.module.ts b/projects/account/src/app/skill/skill-routing.module.ts index b3f35b7..ee6e003 100644 --- a/projects/account/src/app/skill/skill-routing.module.ts +++ b/projects/account/src/app/skill/skill-routing.module.ts @@ -4,7 +4,7 @@ import { RouterModule, Routes } from '@angular/router'; import { SkillComponent } from './skill.component'; const skillRoutes: Routes = [ - {path: 'skill', component: SkillComponent}, + {path: 'skills', component: SkillComponent}, ]; @NgModule({ From f9b718dd3f4bbe8abc58a38902181f77547baee6 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:46:27 -0500 Subject: [PATCH 025/163] removed unused import --- projects/globalnav/src/lib/globalnav.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/globalnav/src/lib/globalnav.component.ts b/projects/globalnav/src/lib/globalnav.component.ts index 63a02cd..0a74e3c 100644 --- a/projects/globalnav/src/lib/globalnav.component.ts +++ b/projects/globalnav/src/lib/globalnav.component.ts @@ -1,6 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; import { MediaMatcher } from '@angular/cdk/layout'; -import { Observable } from 'rxjs'; import { faBars, From 689c3f00c4cfdc5481c151e674a3d70f350d65c9 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:46:37 -0500 Subject: [PATCH 026/163] minor url tweaks --- .../globalnav/src/lib/account-menu/account-menu.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/globalnav/src/lib/account-menu/account-menu.component.ts b/projects/globalnav/src/lib/account-menu/account-menu.component.ts index 0f3d3a8..b4d763b 100644 --- a/projects/globalnav/src/lib/account-menu/account-menu.component.ts +++ b/projects/globalnav/src/lib/account-menu/account-menu.component.ts @@ -30,7 +30,7 @@ export class AccountMenuComponent implements OnInit { } navigateToDevices() { - window.location.href = this.mycroftUrls.account + '/device'; + window.location.href = this.mycroftUrls.account + '/devices'; } navigateToLogin() { @@ -50,6 +50,6 @@ export class AccountMenuComponent implements OnInit { } navigateToSkills() { - window.location.href = this.mycroftUrls.account + '/skill'; + window.location.href = this.mycroftUrls.account + '/skills'; } } From 4bd41e3f797221409cefcebfd799468e214feeb8 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:52:10 -0500 Subject: [PATCH 027/163] indenting stuff --- projects/shared/package.json | 14 ++++---- projects/shared/tsconfig.lib.json | 58 +++++++++++++++--------------- projects/shared/tsconfig.spec.json | 28 +++++++-------- projects/shared/tslint.json | 30 ++++++++-------- 4 files changed, 65 insertions(+), 65 deletions(-) diff --git a/projects/shared/package.json b/projects/shared/package.json index 76def0c..319379f 100644 --- a/projects/shared/package.json +++ b/projects/shared/package.json @@ -1,8 +1,8 @@ { - "name": "shared", - "version": "0.0.1", - "peerDependencies": { - "@angular/common": "^7.0.0", - "@angular/core": "^7.0.0" - } -} \ No newline at end of file + "name": "shared", + "version": "0.0.1", + "peerDependencies": { + "@angular/common": "^7.0.0", + "@angular/core": "^7.0.0" + } +} diff --git a/projects/shared/tsconfig.lib.json b/projects/shared/tsconfig.lib.json index 3fe337f..aa48ea9 100644 --- a/projects/shared/tsconfig.lib.json +++ b/projects/shared/tsconfig.lib.json @@ -1,32 +1,32 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/lib", - "target": "es2015", - "module": "es2015", - "moduleResolution": "node", - "declaration": true, - "sourceMap": true, - "inlineSources": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "importHelpers": true, - "types": [], - "lib": [ - "dom", - "es2018" + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/lib", + "target": "es2015", + "module": "es2015", + "moduleResolution": "node", + "declaration": true, + "sourceMap": true, + "inlineSources": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "types": [], + "lib": [ + "dom", + "es2018" + ] + }, + "angularCompilerOptions": { + "annotateForClosureCompiler": true, + "skipTemplateCodegen": true, + "strictMetadataEmit": true, + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true, + "enableResourceInlining": true + }, + "exclude": [ + "src/test.ts", + "**/*.spec.ts" ] - }, - "angularCompilerOptions": { - "annotateForClosureCompiler": true, - "skipTemplateCodegen": true, - "strictMetadataEmit": true, - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true, - "enableResourceInlining": true - }, - "exclude": [ - "src/test.ts", - "**/*.spec.ts" - ] } diff --git a/projects/shared/tsconfig.spec.json b/projects/shared/tsconfig.spec.json index 16da33d..4feaf99 100644 --- a/projects/shared/tsconfig.spec.json +++ b/projects/shared/tsconfig.spec.json @@ -1,17 +1,17 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/spec", - "types": [ - "jasmine", - "node" + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "src/test.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" ] - }, - "files": [ - "src/test.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] } diff --git a/projects/shared/tslint.json b/projects/shared/tslint.json index 3e2c5bd..34edb79 100644 --- a/projects/shared/tslint.json +++ b/projects/shared/tslint.json @@ -1,17 +1,17 @@ { - "extends": "../../tslint.json", - "rules": { - "directive-selector": [ - true, - "attribute", - "shared", - "camelCase" - ], - "component-selector": [ - true, - "element", - "shared", - "kebab-case" - ] - } + "extends": "../../tslint.json", + "rules": { + "directive-selector": [ + true, + "attribute", + "shared", + "camelCase" + ], + "component-selector": [ + true, + "element", + "shared", + "kebab-case" + ] + } } From 012ad39fe32ab65d03218ed596862a5362e7f984 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:54:24 -0500 Subject: [PATCH 028/163] moved the membership-options component back into the profile component since it is only used there. --- .../membership-options.component.html | 2 +- .../membership-options.component.scss | 0 .../membership-options.component.ts | 51 +++++++++++++++++++ .../account/src/app/profile/profile.module.ts | 28 ++++++++-- .../membership-options.component.ts | 42 --------------- projects/shared/src/lib/shared.component.ts | 2 +- projects/shared/src/lib/shared.module.ts | 3 -- 7 files changed, 76 insertions(+), 52 deletions(-) rename projects/{shared/src/lib => account/src/app/profile}/membership-options/membership-options.component.html (93%) rename projects/{shared/src/lib => account/src/app/profile}/membership-options/membership-options.component.scss (100%) create mode 100644 projects/account/src/app/profile/membership-options/membership-options.component.ts delete mode 100644 projects/shared/src/lib/membership-options/membership-options.component.ts diff --git a/projects/shared/src/lib/membership-options/membership-options.component.html b/projects/account/src/app/profile/membership-options/membership-options.component.html similarity index 93% rename from projects/shared/src/lib/membership-options/membership-options.component.html rename to projects/account/src/app/profile/membership-options/membership-options.component.html index 35fa699..f3c4315 100644 --- a/projects/shared/src/lib/membership-options/membership-options.component.html +++ b/projects/account/src/app/profile/membership-options/membership-options.component.html @@ -1,7 +1,7 @@ (); + public selectedMembershipType: string; + + constructor(public mediaObserver: MediaObserver, private profileService: ProfileService) { + this.mediaWatcher = mediaObserver.media$.subscribe( + (change: MediaChange) => { + this.alignVertical = ['xs', 'sm'].includes(change.mqAlias); + } + ); + } + + ngOnInit(): void { + this.profileService.selectedMembershipType.subscribe( + (membershipType) => { this.selectedMembershipType = membershipType; } + ); + this.profileService.setSelectedMembershipType( + this.accountMembership, + this.membershipTypes + ); + + } + + ngOnDestroy(): void { + this.mediaWatcher.unsubscribe(); + } + + onMembershipSelect(newMembershipType: MatButtonToggleChange) { + this.profileService.selectedMembershipType.next(newMembershipType.value); + this.membershipChange.emit(newMembershipType.value); + } + +} diff --git a/projects/account/src/app/profile/profile.module.ts b/projects/account/src/app/profile/profile.module.ts index 6661b89..256b088 100644 --- a/projects/account/src/app/profile/profile.module.ts +++ b/projects/account/src/app/profile/profile.module.ts @@ -4,42 +4,60 @@ import { FlexLayoutModule } from '@angular/flex-layout'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { + MatBottomSheetModule, MatButtonModule, + MatButtonToggleModule, MatCardModule, + MatDialogModule, MatFormFieldModule, MatInputModule, MatToolbarModule } from '@angular/material'; +import { NgxStripeModule } from 'ngx-stripe'; + import { AgreementsComponent } from './agreements/agreements.component'; import { DeleteComponent } from './delete/delete.component'; +import { environment} from '../../environments/environment'; import { LoginComponent } from './login/login.component'; +import { MembershipComponent } from './membership/membership.component'; +import { MembershipOptionsComponent } from './membership-options/membership-options.component'; +import { PaymentComponent } from './payment/payment.component'; import { ProfileComponent } from './profile.component'; import { ProfileService } from './profile.service'; -import { MembershipComponent } from './membership/membership.component'; -import { SharedModule } from 'shared'; +import { ProfileRoutingModule } from './profile-routing.module'; +import { VerifyCardDialogComponent } from './payment/verify-card-dialog.component'; @NgModule({ declarations: [ AgreementsComponent, DeleteComponent, LoginComponent, + MembershipComponent, + MembershipOptionsComponent, + PaymentComponent, ProfileComponent, - MembershipComponent + VerifyCardDialogComponent ], entryComponents: [ - LoginComponent + LoginComponent, + PaymentComponent, + VerifyCardDialogComponent ], imports: [ CommonModule, FlexLayoutModule, FontAwesomeModule, + MatBottomSheetModule, MatButtonModule, + MatButtonToggleModule, MatCardModule, + MatDialogModule, MatFormFieldModule, MatInputModule, MatToolbarModule, - SharedModule + NgxStripeModule.forRoot(environment.stripeApiKey), + ProfileRoutingModule ], providers: [ ProfileService diff --git a/projects/shared/src/lib/membership-options/membership-options.component.ts b/projects/shared/src/lib/membership-options/membership-options.component.ts deleted file mode 100644 index acb2a1c..0000000 --- a/projects/shared/src/lib/membership-options/membership-options.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core'; -import { MediaChange, MediaObserver } from '@angular/flex-layout'; -import { MatButtonToggleChange } from '@angular/material'; - -import { Subscription } from 'rxjs'; - -export interface MembershipType { - type: string; - rate: string; - ratePeriod: string; - stripePlan: string; -} - -@Component({ - selector: 'shared-membership-options', - templateUrl: './membership-options.component.html', - styleUrls: ['./membership-options.component.scss'] -}) -export class MembershipOptionsComponent implements OnDestroy { - @Input() accountMembership: string; - public alignVertical: boolean; - @Input() membershipTypes: MembershipType[]; - public mediaWatcher: Subscription; - @Output() membershipSelected = new EventEmitter(); - - constructor(public mediaObserver: MediaObserver) { - this.mediaWatcher = mediaObserver.media$.subscribe( - (change: MediaChange) => { - this.alignVertical = ['xs', 'sm'].includes(change.mqAlias); - } - ); - } - - onMembershipSelect(membershipType: MatButtonToggleChange) { - this.membershipSelected.emit(membershipType.value); - } - - ngOnDestroy(): void { - this.mediaWatcher.unsubscribe(); - } - -} diff --git a/projects/shared/src/lib/shared.component.ts b/projects/shared/src/lib/shared.component.ts index cfdc48a..ae82521 100644 --- a/projects/shared/src/lib/shared.component.ts +++ b/projects/shared/src/lib/shared.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; @Component({ - selector: 'lib-shared', + selector: 'shared-base', template: `

shared works! diff --git a/projects/shared/src/lib/shared.module.ts b/projects/shared/src/lib/shared.module.ts index 07b39e1..f5a586e 100644 --- a/projects/shared/src/lib/shared.module.ts +++ b/projects/shared/src/lib/shared.module.ts @@ -13,7 +13,6 @@ import { import { FacebookButtonComponent } from './facebook-button/facebook-button.component'; import { GithubButtonComponent } from './github-button/github-button.component'; import { GoogleButtonComponent } from './google-button/google-button.component'; -import { MembershipOptionsComponent } from './membership-options/membership-options.component'; import { SharedComponent } from './shared.component'; export function getAuthServiceConfigs() { @@ -38,7 +37,6 @@ export function getAuthServiceConfigs() { FacebookButtonComponent, GithubButtonComponent, GoogleButtonComponent, - MembershipOptionsComponent, SharedComponent ], imports: [ @@ -52,7 +50,6 @@ export function getAuthServiceConfigs() { FacebookButtonComponent, GithubButtonComponent, GoogleButtonComponent, - MembershipOptionsComponent, SharedComponent ], providers: [ From 09bb9830bbae3ed3d7982da30d7df98179fb9be6 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:55:37 -0500 Subject: [PATCH 029/163] implemented stripe payment for memberships and feature level routing --- .../membership/membership.component.html | 9 +-- .../membership/membership.component.ts | 60 ++++++++++++++++--- .../src/app/profile/profile-routing.module.ts | 27 +++++++++ .../src/app/profile/profile.component.html | 19 +++--- .../src/app/profile/profile.component.ts | 44 ++++++++++++-- .../src/app/profile/profile.service.ts | 39 ++++++++---- 6 files changed, 160 insertions(+), 38 deletions(-) create mode 100644 projects/account/src/app/profile/profile-routing.module.ts diff --git a/projects/account/src/app/profile/membership/membership.component.html b/projects/account/src/app/profile/membership/membership.component.html index 2685c91..c6fef63 100644 --- a/projects/account/src/app/profile/membership/membership.component.html +++ b/projects/account/src/app/profile/membership/membership.component.html @@ -4,12 +4,13 @@ Mycroft supporters gain access to premium services, such as voices. - - - + + Proudly supporting Mycroft for {{accountMembership.duration}}! diff --git a/projects/account/src/app/profile/membership/membership.component.ts b/projects/account/src/app/profile/membership/membership.component.ts index 2695487..53d9582 100644 --- a/projects/account/src/app/profile/membership/membership.component.ts +++ b/projects/account/src/app/profile/membership/membership.component.ts @@ -1,9 +1,11 @@ import { Component, Input, OnDestroy } from '@angular/core'; import { MediaChange, MediaObserver } from '@angular/flex-layout'; +import { MatBottomSheet, MatBottomSheetConfig } from '@angular/material'; import { Router } from '@angular/router'; -import { Observable, Subscription } from 'rxjs'; +import { BehaviorSubject, Subscription } from 'rxjs'; -import { Membership, MembershipType } from '../profile.service'; +import { AccountMembership, MembershipType, ProfileService } from '../profile.service'; +import { PaymentComponent } from '../payment/payment.component'; @Component({ selector: 'account-membership', @@ -11,12 +13,17 @@ import { Membership, MembershipType } from '../profile.service'; styleUrls: ['./membership.component.scss'] }) export class MembershipComponent implements OnDestroy { - @Input() accountMembership: Membership; - @Input() membershipTypes: MembershipType[]; + @Input() accountMembership: AccountMembership; public alignVertical: boolean; + @Input() membershipTypes: MembershipType[]; private mediaWatcher: Subscription; - constructor(public mediaObserver: MediaObserver, private router: Router) { + constructor( + public bottomSheet: MatBottomSheet, + public mediaObserver: MediaObserver, + private profileService: ProfileService, + private router: Router + ) { this.mediaWatcher = mediaObserver.media$.subscribe( (change: MediaChange) => { this.alignVertical = ['xs', 'sm'].includes(change.mqAlias); @@ -24,7 +31,44 @@ export class MembershipComponent implements OnDestroy { ); } - ngOnDestroy(): void { - this.mediaWatcher.unsubscribe(); - } + ngOnDestroy(): void { + this.mediaWatcher.unsubscribe(); + } + + onMembershipChange(membershipType: string) { + const selectedMembership = this.membershipTypes.find( + (membership) => membership.type === membershipType + ); + if (selectedMembership) { + if (this.accountMembership) { + // We have the user's credit card info but they decide to change plans + this.profileService.updateAccount({support: {membership: membershipType}}); + } else { + // No credit card info. Go to payment screen to collect + this.openBottomSheet(); + } + } else { + // Membership termination + this.profileService.updateAccount({support: {membership: null}}); + } + } + + openBottomSheet() { + const bottomSheetConfig = { + disableClose: true, + restoreFocus: true + }; + const bottomSheetRef = this.bottomSheet.open(PaymentComponent, bottomSheetConfig); + bottomSheetRef.afterDismissed().subscribe( + (dismissValue) => { + if (dismissValue) { + this.profileService.setSelectedMembershipType( + this.accountMembership, + this.membershipTypes + ); + } + } + ); + } + } diff --git a/projects/account/src/app/profile/profile-routing.module.ts b/projects/account/src/app/profile/profile-routing.module.ts new file mode 100644 index 0000000..3869af2 --- /dev/null +++ b/projects/account/src/app/profile/profile-routing.module.ts @@ -0,0 +1,27 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +import { AccountResolverService } from './account-resolver.service'; +import { MembershipResolverService } from './membership-resolver.service'; +import { ProfileComponent } from './profile.component'; + +const profileRoutes: Routes = [ + { + path: 'profile', + component: ProfileComponent, + resolve: { + account: AccountResolverService, + membershipTypes: MembershipResolverService + } + } +]; + +@NgModule({ + imports: [ + RouterModule.forChild(profileRoutes) + ], + exports: [ + RouterModule + ] +}) +export class ProfileRoutingModule { } diff --git a/projects/account/src/app/profile/profile.component.html b/projects/account/src/app/profile/profile.component.html index 99c0f69..0ef642b 100644 --- a/projects/account/src/app/profile/profile.component.html +++ b/projects/account/src/app/profile/profile.component.html @@ -1,10 +1,9 @@ - - - - - - - + + + + + + diff --git a/projects/account/src/app/profile/profile.component.ts b/projects/account/src/app/profile/profile.component.ts index 7124af1..105add3 100644 --- a/projects/account/src/app/profile/profile.component.ts +++ b/projects/account/src/app/profile/profile.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; import { Account, MembershipType, ProfileService } from './profile.service'; -import { Observable } from 'rxjs'; @Component({ selector: 'account-profile', @@ -9,13 +9,45 @@ import { Observable } from 'rxjs'; styleUrls: ['./profile.component.scss'] }) export class ProfileComponent implements OnInit { - public account$ = new Observable(); - public membershipTypes$ = new Observable(); + public account: Account; + public membershipTypes: MembershipType[]; + private stripeToken: string; - constructor(private service: ProfileService) { } + constructor(private service: ProfileService, private route: ActivatedRoute) { } + /** + * If a stripe token exists in local storage, then we got here from the + * payment page. In this case, we need to update the account with the + * new membership before retrieving it. Otherwise, go straight to + * retrieving the account data. + * + * NOTE: This feels hacky. The original author is an Angular noob. + * There could be a better way to code the new membership flow. + */ ngOnInit() { - this.account$ = this.service.getAccount(); - this.membershipTypes$ = this.service.getMembershipTypes(); + this.route.data.subscribe( + (data: {account: Account, membershipTypes: MembershipType[]}) => { + this.account = data.account; + this.membershipTypes = data.membershipTypes; + } + ); } + + checkForNewMembership(): void { + this.stripeToken = localStorage.getItem('stripeToken'); + if (this.stripeToken) { + localStorage.removeItem('stripeToken'); + this.updateMembership(); + } + } + + updateMembership() { + // TODO: put new code in here to update the account + } + + getProfileData() { + // this.account$ = this.service.getAccount(); + // this.membershipTypes$ = this.service.getMembershipTypes(); + } + } diff --git a/projects/account/src/app/profile/profile.service.ts b/projects/account/src/app/profile/profile.service.ts index bdd379b..7c92efd 100644 --- a/projects/account/src/app/profile/profile.service.ts +++ b/projects/account/src/app/profile/profile.service.ts @@ -1,31 +1,30 @@ import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable, throwError } from 'rxjs'; - -import { environment } from '../../environments/environment'; +import { Observable, Subject, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; const accountUrl = '/api/account'; +import { environment } from '../../environments/environment'; const membershipTypesUrl = '/api/memberships'; -export interface Agreement { +export interface AccountAgreement { type: string; acceptDate: string; } -export interface Membership { +export interface AccountMembership { type: string; - duration: string; - paymentAccountId: string; + duration?: string; + paymentAccountId?: string; } export interface Account { id: string; emailAddress: string; username: string; - membership: Membership; - agreements: Agreement[]; + membership: AccountMembership; + agreements: AccountAgreement[]; } export interface MembershipType { @@ -37,6 +36,8 @@ export interface MembershipType { @Injectable() export class ProfileService { + public selectedMembershipType = new Subject(); + constructor(private http: HttpClient) { } @@ -60,7 +61,6 @@ export class ProfileService { 'Something bad happened; please try again later.'); } - /** * API call to retrieve account info to display. */ @@ -73,4 +73,23 @@ export class ProfileService { getMembershipTypes(): Observable { return this.http.get(membershipTypesUrl); } + + updateAccount(accountChanges: any) { + return this.http.patch(accountUrl, {accountChanges}).pipe( + catchError(this.handleError) + ); + } + + setSelectedMembershipType(accountMembership: AccountMembership, membershipTypes: MembershipType[]) { + let selectedMembership: MembershipType; + if (accountMembership) { + selectedMembership = membershipTypes.find( + (membershipType) => membershipType.type === accountMembership.type + ); + this.selectedMembershipType.next(selectedMembership.type); + } else { + this.selectedMembershipType.next('Maybe Later'); + } + } + } From 11ac617597e1dee1d7c0f05622dad5d56796532d Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:56:14 -0500 Subject: [PATCH 030/163] new bottom sheet for payment info --- .../profile/payment/payment.component.html | 14 +++ .../profile/payment/payment.component.scss | 39 +++++++ .../app/profile/payment/payment.component.ts | 108 ++++++++++++++++++ .../payment/verify-card-dialog.component.html | 1 + .../payment/verify-card-dialog.component.scss | 0 .../payment/verify-card-dialog.component.ts | 12 ++ 6 files changed, 174 insertions(+) create mode 100644 projects/account/src/app/profile/payment/payment.component.html create mode 100644 projects/account/src/app/profile/payment/payment.component.scss create mode 100644 projects/account/src/app/profile/payment/payment.component.ts create mode 100644 projects/account/src/app/profile/payment/verify-card-dialog.component.html create mode 100644 projects/account/src/app/profile/payment/verify-card-dialog.component.scss create mode 100644 projects/account/src/app/profile/payment/verify-card-dialog.component.ts diff --git a/projects/account/src/app/profile/payment/payment.component.html b/projects/account/src/app/profile/payment/payment.component.html new file mode 100644 index 0000000..313b94a --- /dev/null +++ b/projects/account/src/app/profile/payment/payment.component.html @@ -0,0 +1,14 @@ + + Thank you for supporting Mycroft! + + This is a blurb saying how much we appreciate your support! +

Please enter your payment information below

+ + + + + + + + + diff --git a/projects/account/src/app/profile/payment/payment.component.scss b/projects/account/src/app/profile/payment/payment.component.scss new file mode 100644 index 0000000..26bb608 --- /dev/null +++ b/projects/account/src/app/profile/payment/payment.component.scss @@ -0,0 +1,39 @@ +@import "../../../../../../node_modules/@angular/material/theming"; +@import "mycroft-colors"; +@import "../../../../../../src/stylesheets/components/buttons"; + +mat-card { + margin-right: auto; + margin-left: auto; + margin-bottom: 16px; + max-width: 500px; + padding: 32px; + + mat-card-title { + color: mat-color($mycroft-primary, 700); + font-weight: bold; + } + + mat-card-content { + p { + margin-top: 32px; + margin-left: auto; + margin-right: auto; + width: 320px; + } + + mat-card { + border-radius: 10px; + border-style: solid; + border-width: 1px; + border-color: mat-color($mycroft-accent, 200); + padding: 16px; + width: 320px; + } + } + + #submit-button { + @include action-button-primary; + margin-top: 16px + } +} diff --git a/projects/account/src/app/profile/payment/payment.component.ts b/projects/account/src/app/profile/payment/payment.component.ts new file mode 100644 index 0000000..383f930 --- /dev/null +++ b/projects/account/src/app/profile/payment/payment.component.ts @@ -0,0 +1,108 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { + MatBottomSheetRef, + MatDialog, + MatDialogRef, + MatSnackBar +} from '@angular/material'; + +import { ElementOptions, StripeCardComponent, StripeService } from 'ngx-stripe'; + +import { ProfileService } from '../profile.service'; +import { VerifyCardDialogComponent } from './verify-card-dialog.component'; + +const twoSeconds = 2000; + + +@Component({ + selector: 'account-payment', + templateUrl: './payment.component.html', + styleUrls: ['./payment.component.scss'] +}) +export class PaymentComponent implements OnInit { + @ViewChild(StripeCardComponent) card: StripeCardComponent; + public cardOptions: ElementOptions = { + style: { + base: { + iconColor: '#22a7f0', + color: '#2c3e50', + '::placeholder': { + color: '#969fa8' + } + } + } + }; + private membershipType: string; + private dialogRef: MatDialogRef; + + constructor( + private bottomSheetRef: MatBottomSheetRef, + private paymentSnackbar: MatSnackBar, + private profileService: ProfileService, + private stripeService: StripeService, + public verifyCardDialog: MatDialog + + ) { + } + + ngOnInit() { + } + + submitPayment() { + this.openDialog(); + this.stripeService.createToken(this.card.getCard(), {}).subscribe( + result => { + if (result.token) { + this.updateAccount(result.token.id); + } else if (result.error) { + this.showStripeError(result.error.message); + } + } + ); + } + + openDialog(): void { + this.dialogRef = this.verifyCardDialog.open( + VerifyCardDialogComponent, + {width: '250px'} + ); + } + + updateAccount(stripeToken: string) { + const newMembership = { + support: { + membership: this.membershipType, + paymentMethod: 'Stripe', + paymentToken: stripeToken + } + }; + this.profileService.updateAccount(newMembership).subscribe( + () => { this.showStripeSuccess(); } + ); + } + + showStripeSuccess() { + this.dialogRef.close(); + const paymentSnackbarRef = this.paymentSnackbar.open( + 'Card verification successful', + null, + {panelClass: 'mycroft-no-action-snackbar', duration: twoSeconds} + ); + paymentSnackbarRef.afterDismissed().subscribe( + () => { this.bottomSheetRef.dismiss(); } + ); + } + + showStripeError(errorMessage: string) { + this.dialogRef.close(); + this.paymentSnackbar.open( + errorMessage, + null, + {panelClass: 'mycroft-no-action-snackbar', duration: twoSeconds} + ); + } + + onCancel() { + this.bottomSheetRef.dismiss('cancel'); + } +} diff --git a/projects/account/src/app/profile/payment/verify-card-dialog.component.html b/projects/account/src/app/profile/payment/verify-card-dialog.component.html new file mode 100644 index 0000000..c0e0f52 --- /dev/null +++ b/projects/account/src/app/profile/payment/verify-card-dialog.component.html @@ -0,0 +1 @@ + diff --git a/projects/account/src/app/profile/payment/verify-card-dialog.component.scss b/projects/account/src/app/profile/payment/verify-card-dialog.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/projects/account/src/app/profile/payment/verify-card-dialog.component.ts b/projects/account/src/app/profile/payment/verify-card-dialog.component.ts new file mode 100644 index 0000000..77241d6 --- /dev/null +++ b/projects/account/src/app/profile/payment/verify-card-dialog.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; +import { MatDialogRef } from '@angular/material'; + + +@Component({ + selector: 'account-verify-card-dialog', + templateUrl: './verify-card-dialog.component.html', + styleUrls: ['./verify-card-dialog.component.scss'] +}) +export class VerifyCardDialogComponent { + constructor(public dialogRef: MatDialogRef) {} +} From 1d7a585f531814d30031428a6b9d42a7fa58c8e1 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 10:58:18 -0500 Subject: [PATCH 031/163] new npm module for stripe payments --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 917f1d4..97e1460 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "core-js": "^2.5.4", "font-awesome": "^4.7.0", "ngx-cookie-service": "^2.1.0", + "ngx-stripe": "^7.2.0", "rxjs": "~6.3.3", "zone.js": "~0.8.26" }, From 16d29237d610af5919ed7c5c17740314b50902db Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 11:15:45 -0500 Subject: [PATCH 032/163] moved the profile edit components into their own folder so that the add components can be added here as well. this is being done so that the add and edit functions can share membership payment code --- .../agreements/agreements.component.html | 0 .../agreements/agreements.component.scss | 2 +- .../agreements/agreements.component.ts | 4 +- .../{ => edit}/delete/delete.component.html | 0 .../{ => edit}/delete/delete.component.scss | 2 +- .../{ => edit}/delete/delete.component.ts | 0 .../src/app/profile/edit/edit.component.html | 9 ++++ .../edit.component.scss} | 0 .../src/app/profile/edit/edit.component.ts | 26 +++++++++ .../{ => edit}/login/login.component.html | 0 .../{ => edit}/login/login.component.scss | 6 +-- .../{ => edit}/login/login.component.ts | 4 +- .../membership/membership.component.html | 0 .../membership/membership.component.scss | 4 +- .../membership/membership.component.ts | 6 +-- .../src/app/profile/profile-routing.module.ts | 4 +- .../src/app/profile/profile.component.html | 9 ---- .../src/app/profile/profile.component.ts | 53 ------------------- .../account/src/app/profile/profile.module.ts | 14 ++--- 19 files changed, 58 insertions(+), 85 deletions(-) rename projects/account/src/app/profile/{ => edit}/agreements/agreements.component.html (100%) rename projects/account/src/app/profile/{ => edit}/agreements/agreements.component.scss (88%) rename projects/account/src/app/profile/{ => edit}/agreements/agreements.component.ts (79%) rename projects/account/src/app/profile/{ => edit}/delete/delete.component.html (100%) rename projects/account/src/app/profile/{ => edit}/delete/delete.component.scss (84%) rename projects/account/src/app/profile/{ => edit}/delete/delete.component.ts (100%) create mode 100644 projects/account/src/app/profile/edit/edit.component.html rename projects/account/src/app/profile/{profile.component.scss => edit/edit.component.scss} (100%) create mode 100644 projects/account/src/app/profile/edit/edit.component.ts rename projects/account/src/app/profile/{ => edit}/login/login.component.html (100%) rename projects/account/src/app/profile/{ => edit}/login/login.component.scss (71%) rename projects/account/src/app/profile/{ => edit}/login/login.component.ts (79%) rename projects/account/src/app/profile/{ => edit}/membership/membership.component.html (100%) rename projects/account/src/app/profile/{ => edit}/membership/membership.component.scss (73%) rename projects/account/src/app/profile/{ => edit}/membership/membership.component.ts (94%) delete mode 100644 projects/account/src/app/profile/profile.component.html delete mode 100644 projects/account/src/app/profile/profile.component.ts diff --git a/projects/account/src/app/profile/agreements/agreements.component.html b/projects/account/src/app/profile/edit/agreements/agreements.component.html similarity index 100% rename from projects/account/src/app/profile/agreements/agreements.component.html rename to projects/account/src/app/profile/edit/agreements/agreements.component.html diff --git a/projects/account/src/app/profile/agreements/agreements.component.scss b/projects/account/src/app/profile/edit/agreements/agreements.component.scss similarity index 88% rename from projects/account/src/app/profile/agreements/agreements.component.scss rename to projects/account/src/app/profile/edit/agreements/agreements.component.scss index 4df7663..b827d52 100644 --- a/projects/account/src/app/profile/agreements/agreements.component.scss +++ b/projects/account/src/app/profile/edit/agreements/agreements.component.scss @@ -1,4 +1,4 @@ -@import "~src/stylesheets/components/cards"; +@import "../../../../../../../src/stylesheets/components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/profile/agreements/agreements.component.ts b/projects/account/src/app/profile/edit/agreements/agreements.component.ts similarity index 79% rename from projects/account/src/app/profile/agreements/agreements.component.ts rename to projects/account/src/app/profile/edit/agreements/agreements.component.ts index 3e30b49..6c1a6fb 100644 --- a/projects/account/src/app/profile/agreements/agreements.component.ts +++ b/projects/account/src/app/profile/edit/agreements/agreements.component.ts @@ -1,9 +1,9 @@ import { Component, Input, OnInit } from '@angular/core'; -import { Account } from '../profile.service'; +import { Account } from '../../profile.service'; @Component({ - selector: 'account-agreements', + selector: 'account-agreements-edit', templateUrl: './agreements.component.html', styleUrls: ['./agreements.component.scss'] }) diff --git a/projects/account/src/app/profile/delete/delete.component.html b/projects/account/src/app/profile/edit/delete/delete.component.html similarity index 100% rename from projects/account/src/app/profile/delete/delete.component.html rename to projects/account/src/app/profile/edit/delete/delete.component.html diff --git a/projects/account/src/app/profile/delete/delete.component.scss b/projects/account/src/app/profile/edit/delete/delete.component.scss similarity index 84% rename from projects/account/src/app/profile/delete/delete.component.scss rename to projects/account/src/app/profile/edit/delete/delete.component.scss index b286803..2980b2c 100644 --- a/projects/account/src/app/profile/delete/delete.component.scss +++ b/projects/account/src/app/profile/edit/delete/delete.component.scss @@ -1,4 +1,4 @@ -@import "~src/stylesheets/components/cards"; +@import "../../../../../../../src/stylesheets/components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/profile/delete/delete.component.ts b/projects/account/src/app/profile/edit/delete/delete.component.ts similarity index 100% rename from projects/account/src/app/profile/delete/delete.component.ts rename to projects/account/src/app/profile/edit/delete/delete.component.ts diff --git a/projects/account/src/app/profile/edit/edit.component.html b/projects/account/src/app/profile/edit/edit.component.html new file mode 100644 index 0000000..87e8f80 --- /dev/null +++ b/projects/account/src/app/profile/edit/edit.component.html @@ -0,0 +1,9 @@ + + + + + + diff --git a/projects/account/src/app/profile/profile.component.scss b/projects/account/src/app/profile/edit/edit.component.scss similarity index 100% rename from projects/account/src/app/profile/profile.component.scss rename to projects/account/src/app/profile/edit/edit.component.scss diff --git a/projects/account/src/app/profile/edit/edit.component.ts b/projects/account/src/app/profile/edit/edit.component.ts new file mode 100644 index 0000000..1d6efd0 --- /dev/null +++ b/projects/account/src/app/profile/edit/edit.component.ts @@ -0,0 +1,26 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { Account, MembershipType, ProfileService } from '../profile.service'; + +@Component({ + selector: 'account-profile-edit', + templateUrl: './edit.component.html', + styleUrls: ['./edit.component.scss'] +}) +export class EditComponent implements OnInit { + public account: Account; + public membershipTypes: MembershipType[]; + + constructor(private service: ProfileService, private route: ActivatedRoute) { } + + ngOnInit() { + this.route.data.subscribe( + (data: {account: Account, membershipTypes: MembershipType[]}) => { + this.account = data.account; + this.membershipTypes = data.membershipTypes; + } + ); + } + +} diff --git a/projects/account/src/app/profile/login/login.component.html b/projects/account/src/app/profile/edit/login/login.component.html similarity index 100% rename from projects/account/src/app/profile/login/login.component.html rename to projects/account/src/app/profile/edit/login/login.component.html diff --git a/projects/account/src/app/profile/login/login.component.scss b/projects/account/src/app/profile/edit/login/login.component.scss similarity index 71% rename from projects/account/src/app/profile/login/login.component.scss rename to projects/account/src/app/profile/edit/login/login.component.scss index ba24334..1ef686d 100644 --- a/projects/account/src/app/profile/login/login.component.scss +++ b/projects/account/src/app/profile/edit/login/login.component.scss @@ -1,7 +1,7 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "~src/stylesheets/components/buttons"; -@import "~src/stylesheets/components/cards"; +@import "../../../../../../../src/stylesheets/components/buttons"; +@import "../../../../../../../src/stylesheets/components/cards"; mat-card { diff --git a/projects/account/src/app/profile/login/login.component.ts b/projects/account/src/app/profile/edit/login/login.component.ts similarity index 79% rename from projects/account/src/app/profile/login/login.component.ts rename to projects/account/src/app/profile/edit/login/login.component.ts index 5f1bdb1..0de83d3 100644 --- a/projects/account/src/app/profile/login/login.component.ts +++ b/projects/account/src/app/profile/edit/login/login.component.ts @@ -2,10 +2,10 @@ import { Component, Input } from '@angular/core'; import { faEdit } from '@fortawesome/free-solid-svg-icons'; -import { Account } from '../profile.service'; +import { Account } from '../../profile.service'; @Component({ - selector: 'account-login', + selector: 'account-login-edit', templateUrl: './login.component.html', styleUrls: ['./login.component.scss'] }) diff --git a/projects/account/src/app/profile/membership/membership.component.html b/projects/account/src/app/profile/edit/membership/membership.component.html similarity index 100% rename from projects/account/src/app/profile/membership/membership.component.html rename to projects/account/src/app/profile/edit/membership/membership.component.html diff --git a/projects/account/src/app/profile/membership/membership.component.scss b/projects/account/src/app/profile/edit/membership/membership.component.scss similarity index 73% rename from projects/account/src/app/profile/membership/membership.component.scss rename to projects/account/src/app/profile/edit/membership/membership.component.scss index 3393092..ba68329 100644 --- a/projects/account/src/app/profile/membership/membership.component.scss +++ b/projects/account/src/app/profile/edit/membership/membership.component.scss @@ -1,5 +1,5 @@ -@import "~src/stylesheets/components/buttons"; -@import "~src/stylesheets/components/cards"; +@import "../../../../../../../src/stylesheets/components/buttons"; +@import "../../../../../../../src/stylesheets/components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/profile/membership/membership.component.ts b/projects/account/src/app/profile/edit/membership/membership.component.ts similarity index 94% rename from projects/account/src/app/profile/membership/membership.component.ts rename to projects/account/src/app/profile/edit/membership/membership.component.ts index 53d9582..741957f 100644 --- a/projects/account/src/app/profile/membership/membership.component.ts +++ b/projects/account/src/app/profile/edit/membership/membership.component.ts @@ -4,11 +4,11 @@ import { MatBottomSheet, MatBottomSheetConfig } from '@angular/material'; import { Router } from '@angular/router'; import { BehaviorSubject, Subscription } from 'rxjs'; -import { AccountMembership, MembershipType, ProfileService } from '../profile.service'; -import { PaymentComponent } from '../payment/payment.component'; +import { AccountMembership, MembershipType, ProfileService } from '../../profile.service'; +import { PaymentComponent } from '../../payment/payment.component'; @Component({ - selector: 'account-membership', + selector: 'account-membership-edit', templateUrl: './membership.component.html', styleUrls: ['./membership.component.scss'] }) diff --git a/projects/account/src/app/profile/profile-routing.module.ts b/projects/account/src/app/profile/profile-routing.module.ts index 3869af2..0161072 100644 --- a/projects/account/src/app/profile/profile-routing.module.ts +++ b/projects/account/src/app/profile/profile-routing.module.ts @@ -3,12 +3,12 @@ import { RouterModule, Routes } from '@angular/router'; import { AccountResolverService } from './account-resolver.service'; import { MembershipResolverService } from './membership-resolver.service'; -import { ProfileComponent } from './profile.component'; +import { EditComponent } from './edit/edit.component'; const profileRoutes: Routes = [ { path: 'profile', - component: ProfileComponent, + component: EditComponent, resolve: { account: AccountResolverService, membershipTypes: MembershipResolverService diff --git a/projects/account/src/app/profile/profile.component.html b/projects/account/src/app/profile/profile.component.html deleted file mode 100644 index 0ef642b..0000000 --- a/projects/account/src/app/profile/profile.component.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/projects/account/src/app/profile/profile.component.ts b/projects/account/src/app/profile/profile.component.ts deleted file mode 100644 index 105add3..0000000 --- a/projects/account/src/app/profile/profile.component.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; - -import { Account, MembershipType, ProfileService } from './profile.service'; - -@Component({ - selector: 'account-profile', - templateUrl: './profile.component.html', - styleUrls: ['./profile.component.scss'] -}) -export class ProfileComponent implements OnInit { - public account: Account; - public membershipTypes: MembershipType[]; - private stripeToken: string; - - constructor(private service: ProfileService, private route: ActivatedRoute) { } - - /** - * If a stripe token exists in local storage, then we got here from the - * payment page. In this case, we need to update the account with the - * new membership before retrieving it. Otherwise, go straight to - * retrieving the account data. - * - * NOTE: This feels hacky. The original author is an Angular noob. - * There could be a better way to code the new membership flow. - */ - ngOnInit() { - this.route.data.subscribe( - (data: {account: Account, membershipTypes: MembershipType[]}) => { - this.account = data.account; - this.membershipTypes = data.membershipTypes; - } - ); - } - - checkForNewMembership(): void { - this.stripeToken = localStorage.getItem('stripeToken'); - if (this.stripeToken) { - localStorage.removeItem('stripeToken'); - this.updateMembership(); - } - } - - updateMembership() { - // TODO: put new code in here to update the account - } - - getProfileData() { - // this.account$ = this.service.getAccount(); - // this.membershipTypes$ = this.service.getMembershipTypes(); - } - -} diff --git a/projects/account/src/app/profile/profile.module.ts b/projects/account/src/app/profile/profile.module.ts index 256b088..b51a6f2 100644 --- a/projects/account/src/app/profile/profile.module.ts +++ b/projects/account/src/app/profile/profile.module.ts @@ -16,14 +16,14 @@ import { import { NgxStripeModule } from 'ngx-stripe'; -import { AgreementsComponent } from './agreements/agreements.component'; -import { DeleteComponent } from './delete/delete.component'; +import { AgreementsComponent } from './edit/agreements/agreements.component'; +import { DeleteComponent } from './edit/delete/delete.component'; +import { EditComponent } from './edit/edit.component'; import { environment} from '../../environments/environment'; -import { LoginComponent } from './login/login.component'; -import { MembershipComponent } from './membership/membership.component'; +import { LoginComponent } from './edit/login/login.component'; +import { MembershipComponent } from './edit/membership/membership.component'; import { MembershipOptionsComponent } from './membership-options/membership-options.component'; import { PaymentComponent } from './payment/payment.component'; -import { ProfileComponent } from './profile.component'; import { ProfileService } from './profile.service'; import { ProfileRoutingModule } from './profile-routing.module'; import { VerifyCardDialogComponent } from './payment/verify-card-dialog.component'; @@ -32,15 +32,15 @@ import { VerifyCardDialogComponent } from './payment/verify-card-dialog.componen declarations: [ AgreementsComponent, DeleteComponent, + EditComponent, LoginComponent, MembershipComponent, MembershipOptionsComponent, PaymentComponent, - ProfileComponent, VerifyCardDialogComponent ], entryComponents: [ - LoginComponent, + EditComponent, PaymentComponent, VerifyCardDialogComponent ], From 8310cb8dd8ef83841da9cf0fea6931230fa06b13 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 11:48:58 -0500 Subject: [PATCH 033/163] removed unused imports --- .../src/app/profile/edit/membership/membership.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/profile/edit/membership/membership.component.ts b/projects/account/src/app/profile/edit/membership/membership.component.ts index 741957f..f211dce 100644 --- a/projects/account/src/app/profile/edit/membership/membership.component.ts +++ b/projects/account/src/app/profile/edit/membership/membership.component.ts @@ -1,8 +1,8 @@ import { Component, Input, OnDestroy } from '@angular/core'; import { MediaChange, MediaObserver } from '@angular/flex-layout'; -import { MatBottomSheet, MatBottomSheetConfig } from '@angular/material'; +import { MatBottomSheet } from '@angular/material'; import { Router } from '@angular/router'; -import { BehaviorSubject, Subscription } from 'rxjs'; +import { Subscription } from 'rxjs'; import { AccountMembership, MembershipType, ProfileService } from '../../profile.service'; import { PaymentComponent } from '../../payment/payment.component'; From 2b8a84a19e2edd07151c57129a767023c316933e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 12:36:28 -0500 Subject: [PATCH 034/163] removed router now that the payment dialog is a bottom screen --- .../src/app/profile/edit/membership/membership.component.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/projects/account/src/app/profile/edit/membership/membership.component.ts b/projects/account/src/app/profile/edit/membership/membership.component.ts index f211dce..19a91fd 100644 --- a/projects/account/src/app/profile/edit/membership/membership.component.ts +++ b/projects/account/src/app/profile/edit/membership/membership.component.ts @@ -1,7 +1,6 @@ import { Component, Input, OnDestroy } from '@angular/core'; import { MediaChange, MediaObserver } from '@angular/flex-layout'; import { MatBottomSheet } from '@angular/material'; -import { Router } from '@angular/router'; import { Subscription } from 'rxjs'; import { AccountMembership, MembershipType, ProfileService } from '../../profile.service'; @@ -22,7 +21,6 @@ export class MembershipComponent implements OnDestroy { public bottomSheet: MatBottomSheet, public mediaObserver: MediaObserver, private profileService: ProfileService, - private router: Router ) { this.mediaWatcher = mediaObserver.media$.subscribe( (change: MediaChange) => { From ca6156797edc2e32973d847e07895982ba635641 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 12 Mar 2019 13:23:26 -0500 Subject: [PATCH 035/163] moved account creation in to the profile module so that it could share code with the profile page. implemented stripe in new account flow --- projects/account/src/app/app.module.ts | 2 - .../create-account-routing.module.ts | 21 ----- .../create-account/create-account.module.ts | 56 ------------- .../create-account/create-account.service.ts | 83 ------------------- .../edit/membership/membership.component.ts | 3 +- .../agreement-step.component.html | 0 .../agreement-step.component.scss | 4 +- .../agreement-step.component.ts | 6 +- .../authentication-step.component.html | 0 .../authentication-step.component.scss | 2 +- .../authentication-step.component.ts | 0 .../new}/done-step/done-step.component.html | 0 .../new}/done-step/done-step.component.scss | 4 +- .../new}/done-step/done-step.component.ts | 0 .../new/new.component.html} | 4 +- .../new/new.component.scss} | 4 +- .../new/new.component.ts} | 40 +++++---- .../support-step/support-step.component.html | 7 +- .../support-step/support-step.component.scss | 4 +- .../support-step/support-step.component.ts | 51 +++++++++++- .../username-step.component.html | 0 .../username-step.component.scss | 4 +- .../username-step/username-step.component.ts | 0 .../app/profile/payment/payment.component.ts | 13 ++- .../payment/verify-card-dialog.component.html | 5 +- .../payment/verify-card-dialog.component.scss | 3 + .../src/app/profile/profile-routing.module.ts | 8 ++ .../account/src/app/profile/profile.module.ts | 44 +++++++++- .../src/app/profile/profile.service.ts | 76 ++++++++++++++++- 29 files changed, 234 insertions(+), 210 deletions(-) delete mode 100644 projects/account/src/app/create-account/create-account-routing.module.ts delete mode 100644 projects/account/src/app/create-account/create-account.module.ts delete mode 100644 projects/account/src/app/create-account/create-account.service.ts rename projects/account/src/app/{create-account => profile/new}/agreement-step/agreement-step.component.html (100%) rename projects/account/src/app/{create-account => profile/new}/agreement-step/agreement-step.component.scss (80%) rename projects/account/src/app/{create-account => profile/new}/agreement-step/agreement-step.component.ts (85%) rename projects/account/src/app/{create-account => profile/new}/authentication-step/authentication-step.component.html (100%) rename projects/account/src/app/{create-account => profile/new}/authentication-step/authentication-step.component.scss (85%) rename projects/account/src/app/{create-account => profile/new}/authentication-step/authentication-step.component.ts (100%) rename projects/account/src/app/{create-account => profile/new}/done-step/done-step.component.html (100%) rename projects/account/src/app/{create-account => profile/new}/done-step/done-step.component.scss (62%) rename projects/account/src/app/{create-account => profile/new}/done-step/done-step.component.ts (100%) rename projects/account/src/app/{create-account/create-account.component.html => profile/new/new.component.html} (95%) rename projects/account/src/app/{create-account/create-account.component.scss => profile/new/new.component.scss} (65%) rename projects/account/src/app/{create-account/create-account.component.ts => profile/new/new.component.ts} (80%) rename projects/account/src/app/{create-account => profile/new}/support-step/support-step.component.html (73%) rename projects/account/src/app/{create-account => profile/new}/support-step/support-step.component.scss (64%) rename projects/account/src/app/{create-account => profile/new}/support-step/support-step.component.ts (58%) rename projects/account/src/app/{create-account => profile/new}/username-step/username-step.component.html (100%) rename projects/account/src/app/{create-account => profile/new}/username-step/username-step.component.scss (69%) rename projects/account/src/app/{create-account => profile/new}/username-step/username-step.component.ts (100%) diff --git a/projects/account/src/app/app.module.ts b/projects/account/src/app/app.module.ts index a265c31..ae20bc3 100644 --- a/projects/account/src/app/app.module.ts +++ b/projects/account/src/app/app.module.ts @@ -5,7 +5,6 @@ import { NgModule } from '@angular/core'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; -import { CreateAccountModule } from './create-account/create-account.module'; import { GlobalnavModule } from 'globalnav'; import { PageNotFoundModule } from 'page-not-found'; import { DeviceModule } from './device/device.module'; @@ -19,7 +18,6 @@ import { SkillModule } from './skill/skill.module'; imports: [ BrowserModule, BrowserAnimationsModule, - CreateAccountModule, GlobalnavModule, HttpClientModule, DeviceModule, diff --git a/projects/account/src/app/create-account/create-account-routing.module.ts b/projects/account/src/app/create-account/create-account-routing.module.ts deleted file mode 100644 index f19a2b4..0000000 --- a/projects/account/src/app/create-account/create-account-routing.module.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; - -import { CreateAccountComponent } from './create-account.component'; - -const createAccountRoutes: Routes = [ - { - path: 'new', - component: CreateAccountComponent - } -]; - -@NgModule({ - imports: [ - RouterModule.forChild(createAccountRoutes) - ], - exports: [ - RouterModule - ] -}) -export class CreateAccountRoutingModule { } diff --git a/projects/account/src/app/create-account/create-account.module.ts b/projects/account/src/app/create-account/create-account.module.ts deleted file mode 100644 index 15703df..0000000 --- a/projects/account/src/app/create-account/create-account.module.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FlexLayoutModule } from '@angular/flex-layout'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { - MatButtonModule, - MatButtonToggleModule, - MatCardModule, - MatFormFieldModule, - MatInputModule, - MatSnackBarModule, - MatStepperModule -} from '@angular/material'; - -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; - -import { AuthenticationStepComponent } from './authentication-step/authentication-step.component'; -import { AgreementStepComponent } from './agreement-step/agreement-step.component'; -import { CreateAccountComponent } from './create-account.component'; -import { CreateAccountRoutingModule } from './create-account-routing.module'; -import { CreateAccountService } from './create-account.service'; -import { UsernameStepComponent } from './username-step/username-step.component'; -import { SharedModule } from 'shared'; -import { SupportStepComponent } from './support-step/support-step.component'; -import { DoneStepComponent } from './done-step/done-step.component'; - -@NgModule({ - declarations: [ - CreateAccountComponent, - AgreementStepComponent, - UsernameStepComponent, - AuthenticationStepComponent, - SupportStepComponent, - DoneStepComponent - ], - imports: [ - CommonModule, - FontAwesomeModule, - FlexLayoutModule, - FormsModule, - MatButtonModule, - MatButtonToggleModule, - MatCardModule, - MatFormFieldModule, - MatInputModule, - MatSnackBarModule, - MatStepperModule, - ReactiveFormsModule, - SharedModule, - CreateAccountRoutingModule - ], - providers: [ - CreateAccountService - ] -}) -export class CreateAccountModule { } diff --git a/projects/account/src/app/create-account/create-account.service.ts b/projects/account/src/app/create-account/create-account.service.ts deleted file mode 100644 index b74746b..0000000 --- a/projects/account/src/app/create-account/create-account.service.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { HttpClient, HttpErrorResponse } from '@angular/common/http'; -import { Injectable } from '@angular/core'; -import { FormGroup } from '@angular/forms'; -import { MatSnackBar } from '@angular/material'; - -import { throwError } from 'rxjs'; -import { catchError } from 'rxjs/operators'; - -import { environment } from '../../environments/environment'; - -const accountUrl = '/api/account'; -const agreementUrl = '/api/agreement/'; -const fiveSeconds = 5000; - -export interface Agreement { - type: string; - version: string; - content: string; -} - -export function storeRedirect() { - localStorage.setItem( - 'redirect', - decodeURIComponent(window.location.search).slice(10) - ); -} - -export function navigateToLogin(delay: number): void { - const redirectURI = localStorage.getItem('redirect'); - const singleSignOnURI = environment.mycroftUrls.singleSignOn + - '/login?redirect=' + - redirectURI; - localStorage.removeItem('redirect'); - setTimeout(() => { window.location.assign(singleSignOnURI); }, delay); -} - -@Injectable({ - providedIn: 'root' -}) -export class CreateAccountService { - - constructor(private http: HttpClient, private errorSnackbar: MatSnackBar) { - } - - handleError(error: HttpErrorResponse) { - if (error.status === 400) { - this.errorSnackbar.open( - 'Account creation failed.', - null, - {panelClass: 'mycroft-snackbar', duration: fiveSeconds} - ); - } - if (error.error instanceof ErrorEvent) { - // A client-side or network error occurred. Handle it accordingly. - console.error('An error occurred:', error.error.message); - } else { - // The backend returned an unsuccessful response code. - // The response body may contain clues as to what went wrong, - console.error( - `Backend returned code ${error.status}, ` + - `body was: ${error.error}`); - } - // return an observable with a user-facing error message - return throwError( - 'Something bad happened; please try again later.'); - } - - getAgreement(agreementType: string) { - let url_suffix: string; - if (agreementType === 'Terms of Use') { - url_suffix = 'terms-of-use'; - } else { - url_suffix = 'privacy-policy'; - } - return this.http.get(agreementUrl + url_suffix); - } - - addAccount(newAcctForm: FormGroup) { - return this.http.post(accountUrl, newAcctForm.value).pipe( - catchError(this.handleError) - ); - } -} diff --git a/projects/account/src/app/profile/edit/membership/membership.component.ts b/projects/account/src/app/profile/edit/membership/membership.component.ts index 19a91fd..9b31f5c 100644 --- a/projects/account/src/app/profile/edit/membership/membership.component.ts +++ b/projects/account/src/app/profile/edit/membership/membership.component.ts @@ -53,13 +53,14 @@ export class MembershipComponent implements OnDestroy { openBottomSheet() { const bottomSheetConfig = { + data: {newAccount: false}, disableClose: true, restoreFocus: true }; const bottomSheetRef = this.bottomSheet.open(PaymentComponent, bottomSheetConfig); bottomSheetRef.afterDismissed().subscribe( (dismissValue) => { - if (dismissValue) { + if (dismissValue === 'cancel') { this.profileService.setSelectedMembershipType( this.accountMembership, this.membershipTypes diff --git a/projects/account/src/app/create-account/agreement-step/agreement-step.component.html b/projects/account/src/app/profile/new/agreement-step/agreement-step.component.html similarity index 100% rename from projects/account/src/app/create-account/agreement-step/agreement-step.component.html rename to projects/account/src/app/profile/new/agreement-step/agreement-step.component.html diff --git a/projects/account/src/app/create-account/agreement-step/agreement-step.component.scss b/projects/account/src/app/profile/new/agreement-step/agreement-step.component.scss similarity index 80% rename from projects/account/src/app/create-account/agreement-step/agreement-step.component.scss rename to projects/account/src/app/profile/new/agreement-step/agreement-step.component.scss index b75fab6..5272a60 100644 --- a/projects/account/src/app/create-account/agreement-step/agreement-step.component.scss +++ b/projects/account/src/app/profile/new/agreement-step/agreement-step.component.scss @@ -1,6 +1,6 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "~src/stylesheets/components/buttons"; +@import "../../../../../../../src/stylesheets/components/buttons"; h2 { margin-left: 16px; diff --git a/projects/account/src/app/create-account/agreement-step/agreement-step.component.ts b/projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts similarity index 85% rename from projects/account/src/app/create-account/agreement-step/agreement-step.component.ts rename to projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts index 92c42f4..4ff2a74 100644 --- a/projects/account/src/app/create-account/agreement-step/agreement-step.component.ts +++ b/projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts @@ -4,7 +4,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; -import { CreateAccountService } from '../create-account.service'; +import { ProfileService } from '../../profile.service'; @Component({ @@ -19,11 +19,11 @@ export class AgreementStepComponent implements OnInit { @Input() newAcctForm: FormGroup; @Input() step: string; - constructor(private newAcctService: CreateAccountService, private sanitizer: DomSanitizer) { + constructor(private profileService: ProfileService, private sanitizer: DomSanitizer) { } ngOnInit() { - this.newAcctService.getAgreement(this.step).subscribe( + this.profileService.getAgreement(this.step).subscribe( (response) => { this.agreementContent = this.sanitizer.bypassSecurityTrustHtml(response.content); } ); } diff --git a/projects/account/src/app/create-account/authentication-step/authentication-step.component.html b/projects/account/src/app/profile/new/authentication-step/authentication-step.component.html similarity index 100% rename from projects/account/src/app/create-account/authentication-step/authentication-step.component.html rename to projects/account/src/app/profile/new/authentication-step/authentication-step.component.html diff --git a/projects/account/src/app/create-account/authentication-step/authentication-step.component.scss b/projects/account/src/app/profile/new/authentication-step/authentication-step.component.scss similarity index 85% rename from projects/account/src/app/create-account/authentication-step/authentication-step.component.scss rename to projects/account/src/app/profile/new/authentication-step/authentication-step.component.scss index 2bd5b2e..715d41b 100644 --- a/projects/account/src/app/create-account/authentication-step/authentication-step.component.scss +++ b/projects/account/src/app/profile/new/authentication-step/authentication-step.component.scss @@ -1,4 +1,4 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; .mat-h1 { diff --git a/projects/account/src/app/create-account/authentication-step/authentication-step.component.ts b/projects/account/src/app/profile/new/authentication-step/authentication-step.component.ts similarity index 100% rename from projects/account/src/app/create-account/authentication-step/authentication-step.component.ts rename to projects/account/src/app/profile/new/authentication-step/authentication-step.component.ts diff --git a/projects/account/src/app/create-account/done-step/done-step.component.html b/projects/account/src/app/profile/new/done-step/done-step.component.html similarity index 100% rename from projects/account/src/app/create-account/done-step/done-step.component.html rename to projects/account/src/app/profile/new/done-step/done-step.component.html diff --git a/projects/account/src/app/create-account/done-step/done-step.component.scss b/projects/account/src/app/profile/new/done-step/done-step.component.scss similarity index 62% rename from projects/account/src/app/create-account/done-step/done-step.component.scss rename to projects/account/src/app/profile/new/done-step/done-step.component.scss index ce125bc..56afd26 100644 --- a/projects/account/src/app/create-account/done-step/done-step.component.scss +++ b/projects/account/src/app/profile/new/done-step/done-step.component.scss @@ -1,5 +1,5 @@ -@import "~@angular/material/theming"; -@import "~src/stylesheets/components/buttons"; +@import "../../../../../../../node_modules/@angular/material/theming"; +@import "../../../../../../../src/stylesheets/components/buttons"; mat-card { margin-left: auto; diff --git a/projects/account/src/app/create-account/done-step/done-step.component.ts b/projects/account/src/app/profile/new/done-step/done-step.component.ts similarity index 100% rename from projects/account/src/app/create-account/done-step/done-step.component.ts rename to projects/account/src/app/profile/new/done-step/done-step.component.ts diff --git a/projects/account/src/app/create-account/create-account.component.html b/projects/account/src/app/profile/new/new.component.html similarity index 95% rename from projects/account/src/app/create-account/create-account.component.html rename to projects/account/src/app/profile/new/new.component.html index 6565a4e..8c022eb 100644 --- a/projects/account/src/app/create-account/create-account.component.html +++ b/projects/account/src/app/profile/new/new.component.html @@ -50,7 +50,7 @@ - +
+
+ + diff --git a/projects/account/src/app/device/preferences/preferences.component.scss b/projects/account/src/app/modules/device/preferences/preferences.component.scss similarity index 64% rename from projects/account/src/app/device/preferences/preferences.component.scss rename to projects/account/src/app/modules/device/preferences/preferences.component.scss index 9d57aa7..ae4970b 100644 --- a/projects/account/src/app/device/preferences/preferences.component.scss +++ b/projects/account/src/app/modules/device/preferences/preferences.component.scss @@ -1,6 +1,11 @@ -@import "~src/stylesheets/components/buttons"; -@import "~src/stylesheets/components/cards"; +@import "../../../../../../../node_modules/@angular/material/theming"; +@import "mycroft-colors"; +@import "../../../../../../../src/stylesheets/components/buttons"; +@import "../../../../../../../src/stylesheets/components/cards"; +.mat-h1 { + color: mat-color($mycroft-primary) +} mat-card { @include section-card; max-width: 700px; diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.ts b/projects/account/src/app/modules/device/preferences/preferences.component.ts new file mode 100644 index 0000000..343bffb --- /dev/null +++ b/projects/account/src/app/modules/device/preferences/preferences.component.ts @@ -0,0 +1,53 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { AbstractControl, Form, FormGroup } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; + +import { AccountPreferences, DeviceService } from '../../../core/http/device.service'; +import { MatButtonToggleChange } from '@angular/material'; + +@Component({ + selector: 'account-device-preferences', + templateUrl: './preferences.component.html', + styleUrls: ['./preferences.component.scss'] +}) +export class PreferencesComponent implements OnInit { + public advancedSettingsDesc: string[]; + @Input() deviceSetup: boolean; + @Input() preferences: AccountPreferences; + @Input() preferencesForm: FormGroup; + + constructor( + private deviceService: DeviceService, + private route: ActivatedRoute, + ) { } + + ngOnInit() { + this.buildAdvancedSettingsDesc(); + } + + buildAdvancedSettingsDesc() { + this.advancedSettingsDesc = [ + 'Mycroft Core can be further configured ' + + 'for development and experimentation purposes. Example configurations ' + + 'include text-to-speech technologies, speech-to-text technologies and ' + + 'wake word listeners.', + 'These advanced options can be managed by editing a configuration file ' + + 'on the device. Proceed with caution; a bad configuration file could ' + + 'render your device unusable.', + 'Follow the link below for documentation on the options available ' + + 'and how to edit them.' + ]; + } + + changeDateFormat(newValue: MatButtonToggleChange) { + this.preferencesForm.patchValue({dateFormat: newValue.value}); + } + + changeMeasurementSystem(newValue: MatButtonToggleChange) { + this.preferencesForm.patchValue({measurementSystem: newValue.value}); + } + + changeTimeFormat(newValue: MatButtonToggleChange) { + this.preferencesForm.patchValue({timeFormat: newValue.value}); + } +} diff --git a/projects/account/src/app/device/remove/remove.component.html b/projects/account/src/app/modules/device/remove/remove.component.html similarity index 100% rename from projects/account/src/app/device/remove/remove.component.html rename to projects/account/src/app/modules/device/remove/remove.component.html diff --git a/projects/account/src/app/device/remove/remove.component.scss b/projects/account/src/app/modules/device/remove/remove.component.scss similarity index 63% rename from projects/account/src/app/device/remove/remove.component.scss rename to projects/account/src/app/modules/device/remove/remove.component.scss index 4fbeabc..cf4b863 100644 --- a/projects/account/src/app/device/remove/remove.component.scss +++ b/projects/account/src/app/modules/device/remove/remove.component.scss @@ -1,4 +1,4 @@ -@import '~src/stylesheets/components/buttons'; +@import '../../../../../../../src/stylesheets/components/buttons'; .mat-body{ margin-bottom: 16px; diff --git a/projects/account/src/app/device/remove/remove.component.ts b/projects/account/src/app/modules/device/remove/remove.component.ts similarity index 100% rename from projects/account/src/app/device/remove/remove.component.ts rename to projects/account/src/app/modules/device/remove/remove.component.ts From 9a23ef2e3e62139bb8dd19850143da58b39d462b Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 13 Mar 2019 23:50:13 -0500 Subject: [PATCH 039/163] removed grouping component as it will not be implemented in initial release --- .../attribute/group/group.component.html | 7 ------- .../attribute/group/group.component.scss | 0 .../device/attribute/group/group.component.ts | 21 ------------------- .../src/app/modules/device/device.module.ts | 10 ++++----- 4 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 projects/account/src/app/modules/device/attribute/group/group.component.html delete mode 100644 projects/account/src/app/modules/device/attribute/group/group.component.scss delete mode 100644 projects/account/src/app/modules/device/attribute/group/group.component.ts diff --git a/projects/account/src/app/modules/device/attribute/group/group.component.html b/projects/account/src/app/modules/device/attribute/group/group.component.html deleted file mode 100644 index 0c0506b..0000000 --- a/projects/account/src/app/modules/device/attribute/group/group.component.html +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/projects/account/src/app/modules/device/attribute/group/group.component.scss b/projects/account/src/app/modules/device/attribute/group/group.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/modules/device/attribute/group/group.component.ts b/projects/account/src/app/modules/device/attribute/group/group.component.ts deleted file mode 100644 index 47ea72d..0000000 --- a/projects/account/src/app/modules/device/attribute/group/group.component.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -import { DeviceAttribute, DeviceService} from '../../../../core/http/device.service'; - -@Component({ - selector: 'account-device-group', - templateUrl: './group.component.html', - styleUrls: ['./group.component.scss'] -}) -export class GroupComponent implements OnInit { - public deviceGroups: DeviceAttribute[]; - public dialogInstructions = 'Groups are useful to organize multiple ' + - 'devices. You can reuse device names if they are in different groups.'; - - constructor(private deviceService: DeviceService) { - } - - ngOnInit() { - // this.deviceGroups = this.deviceService.deviceGroups; - } -} diff --git a/projects/account/src/app/modules/device/device.module.ts b/projects/account/src/app/modules/device/device.module.ts index ff34454..d466177 100644 --- a/projects/account/src/app/modules/device/device.module.ts +++ b/projects/account/src/app/modules/device/device.module.ts @@ -25,14 +25,13 @@ import { DeviceListComponent } from './device-list/device-list.component'; import { DeviceRoutingModule } from './device-routing.module'; import { DeviceService } from '../../core/http/device.service'; import { GeographyComponent } from './attribute/geography/geography.component'; -import { GroupComponent } from './attribute/group/group.component'; import { PlacementComponent } from './attribute/placement/placement.component'; import { RemoveComponent } from './remove/remove.component'; import { VoiceComponent } from './attribute/voice/voice.component'; import { PreferencesComponent } from './preferences/preferences.component'; import { WakeWordComponent } from './attribute/wake-word/wake-word.component'; -import { AddComponent } from './add/add.component'; -import { PairingComponent } from './add/pairing/pairing.component'; +import { DeviceAddComponent } from './device-add/device-add.component'; +import { PairingComponent } from './device-add/pairing/pairing.component'; @NgModule({ declarations: [ @@ -40,17 +39,16 @@ import { PairingComponent } from './add/pairing/pairing.component'; DeviceComponent, DeviceListComponent, GeographyComponent, - GroupComponent, PlacementComponent, RemoveComponent, VoiceComponent, PreferencesComponent, WakeWordComponent, - AddComponent, + DeviceAddComponent, PairingComponent, ], entryComponents: [ - AddComponent, + DeviceAddComponent, RemoveComponent ], imports: [ From cfa13d8bb748049e667136e192ffc72c14296dbb Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 13 Mar 2019 23:50:38 -0500 Subject: [PATCH 040/163] new location for route guards --- .../account/src/app/modules/device/device-routing.module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/modules/device/device-routing.module.ts b/projects/account/src/app/modules/device/device-routing.module.ts index 33ef040..dcb9df8 100644 --- a/projects/account/src/app/modules/device/device-routing.module.ts +++ b/projects/account/src/app/modules/device/device-routing.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { AddComponent } from './add/add.component'; +import { DeviceAddComponent } from './device-add/device-add.component'; import { DeviceComponent} from './device.component'; import { PreferencesResolverService } from '../../core/guards/preferences-resolver.service'; @@ -9,7 +9,7 @@ const deviceRoutes: Routes = [ {path: 'devices', component: DeviceComponent}, { path: 'devices/add', - component: AddComponent, + component: DeviceAddComponent, resolve: { preferences: PreferencesResolverService } From b6a37d4e40c9be3bd1e5ccbea39efc70ec80c93e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 13 Mar 2019 23:51:14 -0500 Subject: [PATCH 041/163] new device add component --- .../device-add/device-add.component.html | 64 ++++++++++++++ .../device-add/device-add.component.scss | 5 ++ .../device/device-add/device-add.component.ts | 86 +++++++++++++++++++ .../device-add/pairing/pairing.component.html | 10 +++ .../device-add/pairing/pairing.component.scss | 8 ++ .../device-add/pairing/pairing.component.ts | 17 ++++ 6 files changed, 190 insertions(+) create mode 100644 projects/account/src/app/modules/device/device-add/device-add.component.html create mode 100644 projects/account/src/app/modules/device/device-add/device-add.component.scss create mode 100644 projects/account/src/app/modules/device/device-add/device-add.component.ts create mode 100644 projects/account/src/app/modules/device/device-add/pairing/pairing.component.html create mode 100644 projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss create mode 100644 projects/account/src/app/modules/device/device-add/pairing/pairing.component.ts diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.html b/projects/account/src/app/modules/device/device-add/device-add.component.html new file mode 100644 index 0000000..92e95c9 --- /dev/null +++ b/projects/account/src/app/modules/device/device-add/device-add.component.html @@ -0,0 +1,64 @@ + + + + + + + + + + + + +
+ + +
+
+ + +
+ + + +
+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.scss b/projects/account/src/app/modules/device/device-add/device-add.component.scss new file mode 100644 index 0000000..fc2d384 --- /dev/null +++ b/projects/account/src/app/modules/device/device-add/device-add.component.scss @@ -0,0 +1,5 @@ +mat-horizontal-stepper { + margin-left: auto; + margin-right: auto; + max-width: 800px; +} diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.ts b/projects/account/src/app/modules/device/device-add/device-add.component.ts new file mode 100644 index 0000000..5375fad --- /dev/null +++ b/projects/account/src/app/modules/device/device-add/device-add.component.ts @@ -0,0 +1,86 @@ +import { Component, OnInit } from '@angular/core'; +import { MediaChange, MediaObserver } from '@angular/flex-layout'; +import { + AbstractControl, + FormBuilder, + FormGroup, + Validators +} from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; + +import { faCheck } from '@fortawesome/free-solid-svg-icons'; +import { Subscription } from 'rxjs'; + +import { AccountPreferences, DeviceService } from '../../../core/http/device.service'; + +@Component({ + selector: 'account-device-add', + templateUrl: './device-add.component.html', + styleUrls: ['./device-add.component.scss'] +}) +export class DeviceAddComponent implements OnInit { + public alignVertical: boolean; + public deviceForm: FormGroup; + private mediaWatcher: Subscription; + public pairingCodeControl: AbstractControl; + public pairDeviceForm: FormGroup; + public preferencesForm: FormGroup; + public preferences: AccountPreferences; + public stepDoneIcon = faCheck; + + constructor( + private formBuilder: FormBuilder, + public mediaObserver: MediaObserver, + private deviceService: DeviceService, + private route: ActivatedRoute + ) { + this.mediaWatcher = mediaObserver.media$.subscribe( + (change: MediaChange) => { + this.alignVertical = ['xs', 'sm'].includes(change.mqAlias); + } + ); + } + + ngOnInit() { + this.getAccountPreferences(); + this.buildForms(); + this.setControlFormAliases(); + } + + private buildForms() { + this.preferencesForm = this.deviceService.buildPreferencesForm(this.preferences); + this.pairDeviceForm = this.formBuilder.group({ + pairingCode: ['', Validators.required], + }); + this.deviceForm = this.formBuilder.group( + { + name: ['', Validators.required], + placement: [''], + country: ['', Validators.required], + region: ['', Validators.required], + city: ['', Validators.required], + timeZone: ['', Validators.required] + } + ); + } + + getAccountPreferences() { + this.route.data.subscribe( + (data: {preferences: AccountPreferences}) => { + this.preferences = data.preferences; + } + ); + } + + private setControlFormAliases() { + this.pairingCodeControl = this.pairDeviceForm.controls['pairingCode']; + } + + onPairingSubmit() { + console.log('attempting to pair device'); + } + + onPreferencesSubmit() { + console.log('attempting to pair device'); + } +} diff --git a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html new file mode 100644 index 0000000..02d7044 --- /dev/null +++ b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html @@ -0,0 +1,10 @@ + + Verify your pairing code + +

Enter the code spoken by your device:

+ + Pairing Code + + +
+
diff --git a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss new file mode 100644 index 0000000..8a98cbc --- /dev/null +++ b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss @@ -0,0 +1,8 @@ +@import "../../../../../../../../node_modules/@angular/material/theming"; +@import "mycroft-colors"; + +mat-card { + mat-card-title { + color: mat-color($mycroft-primary) + } +} diff --git a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.ts b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.ts new file mode 100644 index 0000000..34e084f --- /dev/null +++ b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.ts @@ -0,0 +1,17 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { AbstractControl } from '@angular/forms'; + +@Component({ + selector: 'account-device-pairing', + templateUrl: './pairing.component.html', + styleUrls: ['./pairing.component.scss'] +}) +export class PairingComponent implements OnInit { + @Input() pairingCodeControl: AbstractControl; + + constructor() { } + + ngOnInit() { + } + +} From 7bd674b2969251acd53ee2951280b07ad7bbaffa Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 14 Mar 2019 00:55:46 -0500 Subject: [PATCH 042/163] minor presentation change --- .../src/app/skill/skill-setting/skill-settings.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/skill/skill-setting/skill-settings.component.html b/projects/account/src/app/skill/skill-setting/skill-settings.component.html index 73a9670..30bc508 100644 --- a/projects/account/src/app/skill/skill-setting/skill-settings.component.html +++ b/projects/account/src/app/skill/skill-setting/skill-settings.component.html @@ -23,7 +23,7 @@

Devices

{{settingsGroup.devices.join(', ')}}

From 426423da9f075b59713bed1eac902cb5582316f8 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 14 Mar 2019 12:07:56 -0500 Subject: [PATCH 043/163] moved interfaces into a models folder --- .../src/app/core/http/device.service.ts | 85 +------------------ .../src/app/shared/models/device.model.ts | 14 +++ .../shared/models/deviceAttribute.model.ts | 6 ++ .../src/app/shared/models/geography.model.ts | 8 ++ .../app/shared/models/preferences.model.ts | 12 +++ 5 files changed, 44 insertions(+), 81 deletions(-) create mode 100644 projects/account/src/app/shared/models/device.model.ts create mode 100644 projects/account/src/app/shared/models/deviceAttribute.model.ts create mode 100644 projects/account/src/app/shared/models/geography.model.ts create mode 100644 projects/account/src/app/shared/models/preferences.model.ts diff --git a/projects/account/src/app/core/http/device.service.ts b/projects/account/src/app/core/http/device.service.ts index 61ed534..66947e4 100644 --- a/projects/account/src/app/core/http/device.service.ts +++ b/projects/account/src/app/core/http/device.service.ts @@ -2,99 +2,22 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { AccountPreferences } from '../../shared/models/preferences.model'; +import { Device } from '../../shared/models/device.model'; +import { DeviceAttribute } from '../../shared/models/deviceAttribute.model'; + const deviceUrl = '/api/devices'; const geographyUrl = 'api/geographies'; const preferencesUrl = '/api/preferences'; const voicesUrl = '/api/voices'; const wakeWordUrl = '/api/wake-words'; -export interface DeviceAttribute { - id?: string; - name: string; - userDefined: boolean; -} -export interface Geography { - latitude: number; - longitude: number; - country: string; - region: string; - city: string; - timezone: string; -} -export interface Device { - coreVersion: string; - enclosureVersion: string; - id: string; - geography: DeviceAttribute; - name: string; - placement: DeviceAttribute; - platform: string; - voice: DeviceAttribute; - wakeWord: DeviceAttribute; -} - -export interface AccountPreferences { - dateFormat: string; - geography: Geography; - location: DeviceAttribute; - measurementSystem: string; - timeFormat: string; - voice: DeviceAttribute; - wakeWord: DeviceAttribute; -} @Injectable({ providedIn: 'root' }) export class DeviceService { - public devices: Device[] = [ - { - coreVersion: '18.08', - enclosureVersion: '1.2.3', - id: 'abc-def-ghi', - geography: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', userDefined: false}, - name: 'Mark', - placement: {id: 'bbb-bbb-bbb', name: 'Living Room', userDefined: false}, - platform: 'mark-one', - voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', userDefined: true}, - wakeWord: {id: '1a2b-3c4d-5e6f', name: 'Hey Mycroft', userDefined: true}, - }, - { - coreVersion: '18.08', - enclosureVersion: '1.2.3', - id: 'bcd-efg-hij', - geography: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', userDefined: false}, - name: 'Marky Mark', - placement: {id: 'bbb-bbb-bbb', name: 'Kitchen', userDefined: true}, - platform: 'mark-two', - voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', userDefined: true}, - wakeWord: {id: 'a1b2-c3d4-e5f6', name: 'Christopher', userDefined: true} - }, - { - coreVersion: '18.08', - enclosureVersion: '1.2.3', - id: 'cde-fgh-ijk', - geography: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', userDefined: false}, - name: 'American Pie', - placement: {id: 'ddd-ddd-ddd', name: 'Bedroom', userDefined: true}, - platform: 'picroft', - voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', userDefined: true}, - wakeWord: {id: 'a1b2-c3d4-e5f6', name: 'Christopher', userDefined: true} - }, - { - coreVersion: '18.08', - enclosureVersion: '1.2.3', - id: 'def-ghi-jkl', - geography: {id: '1a2b-3c4d-5e6f', name: 'United States, 64101, CST', userDefined: false}, - name: 'Kappa Delta Epsilon', - placement: {id: 'fff-fff-fff', name: 'Kitchen', userDefined: true}, - platform: 'kde', - voice: {id: '1a2b-3c4d-5e6f', name: 'British Male', userDefined: true}, - wakeWord: {id: 'abcd-efgh-ijkl', name: 'Hey Jarvis', userDefined: true} - } - ]; - public devicePlacements: DeviceAttribute[] = [ { id: '1', name: 'None', userDefined: true}, { id: null, name: 'Bedroom', userDefined: true}, diff --git a/projects/account/src/app/shared/models/device.model.ts b/projects/account/src/app/shared/models/device.model.ts new file mode 100644 index 0000000..732e712 --- /dev/null +++ b/projects/account/src/app/shared/models/device.model.ts @@ -0,0 +1,14 @@ +import { DeviceAttribute } from './deviceAttribute.model'; +import { Geography } from './geography.model'; + +export interface Device { + coreVersion: string; + enclosureVersion: string; + id: string; + geography: Geography; + name: string; + placement: DeviceAttribute; + platform: string; + voice: DeviceAttribute; + wakeWord: DeviceAttribute; +} diff --git a/projects/account/src/app/shared/models/deviceAttribute.model.ts b/projects/account/src/app/shared/models/deviceAttribute.model.ts new file mode 100644 index 0000000..402eb0f --- /dev/null +++ b/projects/account/src/app/shared/models/deviceAttribute.model.ts @@ -0,0 +1,6 @@ +export interface DeviceAttribute { + id?: string; + name: string; + userDefined: boolean; +} + diff --git a/projects/account/src/app/shared/models/geography.model.ts b/projects/account/src/app/shared/models/geography.model.ts new file mode 100644 index 0000000..b3d7b68 --- /dev/null +++ b/projects/account/src/app/shared/models/geography.model.ts @@ -0,0 +1,8 @@ +export interface Geography { + latitude: number; + longitude: number; + country: string; + region: string; + city: string; + timezone: string; +} diff --git a/projects/account/src/app/shared/models/preferences.model.ts b/projects/account/src/app/shared/models/preferences.model.ts new file mode 100644 index 0000000..e79f999 --- /dev/null +++ b/projects/account/src/app/shared/models/preferences.model.ts @@ -0,0 +1,12 @@ +import { DeviceAttribute } from './deviceAttribute.model'; +import { Geography } from './geography.model'; + +export interface AccountPreferences { + dateFormat: string; + geography: Geography; + location: DeviceAttribute; + measurementSystem: string; + timeFormat: string; + voice: DeviceAttribute; + wakeWord: DeviceAttribute; +} From ddf2961d30778ef7af7b006f6b20fb0b2592df3e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 14 Mar 2019 12:09:01 -0500 Subject: [PATCH 044/163] reflect new location of models --- .../modules/device/attribute/attribute.component.ts | 2 +- .../device/attribute/geography/geography.component.ts | 3 ++- .../device/attribute/placement/placement.component.ts | 3 ++- .../modules/device/attribute/voice/voice.component.ts | 3 ++- .../device/attribute/wake-word/wake-word.component.ts | 3 ++- .../modules/device/device-add/device-add.component.ts | 3 ++- .../account/src/app/modules/device/device.module.ts | 10 ++++++---- .../device/preferences/preferences.component.ts | 10 +++------- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/projects/account/src/app/modules/device/attribute/attribute.component.ts b/projects/account/src/app/modules/device/attribute/attribute.component.ts index 888084d..b9d3696 100644 --- a/projects/account/src/app/modules/device/attribute/attribute.component.ts +++ b/projects/account/src/app/modules/device/attribute/attribute.component.ts @@ -3,7 +3,7 @@ import { Observable } from 'rxjs'; import { faTrashAlt } from '@fortawesome/free-solid-svg-icons'; -import { DeviceAttribute } from '../../../core/http/device.service'; +import { DeviceAttribute } from '../../../shared/models/deviceAttribute.model'; @Component({ diff --git a/projects/account/src/app/modules/device/attribute/geography/geography.component.ts b/projects/account/src/app/modules/device/attribute/geography/geography.component.ts index 0731d33..8c367ce 100644 --- a/projects/account/src/app/modules/device/attribute/geography/geography.component.ts +++ b/projects/account/src/app/modules/device/attribute/geography/geography.component.ts @@ -1,7 +1,8 @@ import { Component, Input, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; -import { DeviceAttribute, DeviceService} from '../../../../core/http/device.service'; +import { DeviceAttribute } from '../../../../shared/models/deviceAttribute.model'; +import { DeviceService} from '../../../../core/http/device.service'; @Component({ selector: 'account-device-geography', diff --git a/projects/account/src/app/modules/device/attribute/placement/placement.component.ts b/projects/account/src/app/modules/device/attribute/placement/placement.component.ts index 5c75d2b..273978c 100644 --- a/projects/account/src/app/modules/device/attribute/placement/placement.component.ts +++ b/projects/account/src/app/modules/device/attribute/placement/placement.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; -import { DeviceAttribute, DeviceService} from '../../../../core/http/device.service'; +import { DeviceAttribute } from '../../../../shared/models/deviceAttribute.model'; +import { DeviceService} from '../../../../core/http/device.service'; @Component({ diff --git a/projects/account/src/app/modules/device/attribute/voice/voice.component.ts b/projects/account/src/app/modules/device/attribute/voice/voice.component.ts index 5d9d814..d8e57b9 100644 --- a/projects/account/src/app/modules/device/attribute/voice/voice.component.ts +++ b/projects/account/src/app/modules/device/attribute/voice/voice.component.ts @@ -1,7 +1,8 @@ import { Component, Input, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; -import { DeviceAttribute, DeviceService} from '../../../../core/http/device.service'; +import { DeviceAttribute } from '../../../../shared/models/deviceAttribute.model'; +import { DeviceService } from '../../../../core/http/device.service'; @Component({ diff --git a/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.ts b/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.ts index a150fcd..46c70d4 100644 --- a/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.ts +++ b/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.ts @@ -1,6 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; -import { DeviceAttribute, DeviceService} from '../../../../core/http/device.service'; +import { DeviceAttribute } from '../../../../shared/models/deviceAttribute.model'; +import { DeviceService} from '../../../../core/http/device.service'; import { Observable } from 'rxjs'; diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.ts b/projects/account/src/app/modules/device/device-add/device-add.component.ts index 5375fad..928851c 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.ts +++ b/projects/account/src/app/modules/device/device-add/device-add.component.ts @@ -11,7 +11,8 @@ import { ActivatedRoute } from '@angular/router'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; import { Subscription } from 'rxjs'; -import { AccountPreferences, DeviceService } from '../../../core/http/device.service'; +import { AccountPreferences } from '../../../shared/models/preferences.model'; +import { DeviceService } from '../../../core/http/device.service'; @Component({ selector: 'account-device-add', diff --git a/projects/account/src/app/modules/device/device.module.ts b/projects/account/src/app/modules/device/device.module.ts index d466177..f7e36b8 100644 --- a/projects/account/src/app/modules/device/device.module.ts +++ b/projects/account/src/app/modules/device/device.module.ts @@ -7,7 +7,6 @@ import { MatButtonToggleModule, MatCardModule, MatDialogModule, - MatDividerModule, MatExpansionModule, MatFormFieldModule, MatInputModule, @@ -26,12 +25,14 @@ import { DeviceRoutingModule } from './device-routing.module'; import { DeviceService } from '../../core/http/device.service'; import { GeographyComponent } from './attribute/geography/geography.component'; import { PlacementComponent } from './attribute/placement/placement.component'; -import { RemoveComponent } from './remove/remove.component'; -import { VoiceComponent } from './attribute/voice/voice.component'; import { PreferencesComponent } from './preferences/preferences.component'; +import { RemoveComponent } from './remove/remove.component'; +import { SharedModule } from '../../shared/shared.module'; +import { VoiceComponent } from './attribute/voice/voice.component'; import { WakeWordComponent } from './attribute/wake-word/wake-word.component'; import { DeviceAddComponent } from './device-add/device-add.component'; import { PairingComponent } from './device-add/pairing/pairing.component'; +import { DeviceLocationComponent } from './device-list/device-location/device-location.component'; @NgModule({ declarations: [ @@ -46,6 +47,7 @@ import { PairingComponent } from './device-add/pairing/pairing.component'; WakeWordComponent, DeviceAddComponent, PairingComponent, + DeviceLocationComponent, ], entryComponents: [ DeviceAddComponent, @@ -61,7 +63,6 @@ import { PairingComponent } from './device-add/pairing/pairing.component'; MatButtonToggleModule, MatCardModule, MatDialogModule, - MatDividerModule, MatExpansionModule, MatFormFieldModule, MatInputModule, @@ -69,6 +70,7 @@ import { PairingComponent } from './device-add/pairing/pairing.component'; MatStepperModule, MatTabsModule, MatToolbarModule, + SharedModule, DeviceRoutingModule ], providers: [ diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.ts b/projects/account/src/app/modules/device/preferences/preferences.component.ts index 343bffb..ad78c38 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.ts +++ b/projects/account/src/app/modules/device/preferences/preferences.component.ts @@ -1,8 +1,7 @@ import { Component, OnInit, Input } from '@angular/core'; -import { AbstractControl, Form, FormGroup } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; +import { FormGroup } from '@angular/forms'; -import { AccountPreferences, DeviceService } from '../../../core/http/device.service'; +import { AccountPreferences } from '../../../shared/models/preferences.model'; import { MatButtonToggleChange } from '@angular/material'; @Component({ @@ -16,10 +15,7 @@ export class PreferencesComponent implements OnInit { @Input() preferences: AccountPreferences; @Input() preferencesForm: FormGroup; - constructor( - private deviceService: DeviceService, - private route: ActivatedRoute, - ) { } + constructor() { } ngOnInit() { this.buildAdvancedSettingsDesc(); From 3d29a5f2b7a958fd2fbad7f97f94c2a84935ca16 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 14 Mar 2019 12:45:43 -0500 Subject: [PATCH 045/163] moved device module --- projects/account/src/app/app.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/app.module.ts b/projects/account/src/app/app.module.ts index ae20bc3..6274930 100644 --- a/projects/account/src/app/app.module.ts +++ b/projects/account/src/app/app.module.ts @@ -7,7 +7,7 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { GlobalnavModule } from 'globalnav'; import { PageNotFoundModule } from 'page-not-found'; -import { DeviceModule } from './device/device.module'; +import { DeviceModule } from './modules/device/device.module'; import { ProfileModule } from './profile/profile.module'; import { SharedModule } from 'shared'; import { SkillModule } from './skill/skill.module'; From 463aa460da352eb34a0c4bab783f49a613181f27 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 14 Mar 2019 12:46:53 -0500 Subject: [PATCH 046/163] added a common component --- .../display-field.component.html | 4 ++++ .../display-field.component.scss | 6 ++++++ .../display-field/display-field.component.ts | 18 +++++++++++++++++ .../account/src/app/shared/shared.module.ts | 20 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 projects/account/src/app/shared/components/display-field/display-field.component.html create mode 100644 projects/account/src/app/shared/components/display-field/display-field.component.scss create mode 100644 projects/account/src/app/shared/components/display-field/display-field.component.ts create mode 100644 projects/account/src/app/shared/shared.module.ts diff --git a/projects/account/src/app/shared/components/display-field/display-field.component.html b/projects/account/src/app/shared/components/display-field/display-field.component.html new file mode 100644 index 0000000..368b9ca --- /dev/null +++ b/projects/account/src/app/shared/components/display-field/display-field.component.html @@ -0,0 +1,4 @@ + + {{label}} + + diff --git a/projects/account/src/app/shared/components/display-field/display-field.component.scss b/projects/account/src/app/shared/components/display-field/display-field.component.scss new file mode 100644 index 0000000..07bfca3 --- /dev/null +++ b/projects/account/src/app/shared/components/display-field/display-field.component.scss @@ -0,0 +1,6 @@ +@import "~@angular/material/theming"; +@import '~src/stylesheets/mycroft-colors'; + +mat-label { + color: mat-color($mycroft-primary); +} diff --git a/projects/account/src/app/shared/components/display-field/display-field.component.ts b/projects/account/src/app/shared/components/display-field/display-field.component.ts new file mode 100644 index 0000000..aa8f991 --- /dev/null +++ b/projects/account/src/app/shared/components/display-field/display-field.component.ts @@ -0,0 +1,18 @@ +import { Component, Input, OnInit } from '@angular/core'; + +@Component({ + selector: 'account-display-field', + templateUrl: './display-field.component.html', + styleUrls: ['./display-field.component.scss'] +}) +export class DisplayFieldComponent implements OnInit { + @Input() label: string; + @Input() value: string; + + constructor() { + } + + ngOnInit() { + } + +} diff --git a/projects/account/src/app/shared/shared.module.ts b/projects/account/src/app/shared/shared.module.ts new file mode 100644 index 0000000..afdd70a --- /dev/null +++ b/projects/account/src/app/shared/shared.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MatFormFieldModule, MatInputModule } from '@angular/material'; + +import { DisplayFieldComponent } from './components/display-field/display-field.component'; + +@NgModule({ + declarations: [ + DisplayFieldComponent + ], + exports: [ + DisplayFieldComponent + ], + imports: [ + CommonModule, + MatFormFieldModule, + MatInputModule + ] +}) +export class SharedModule { } From 731393ad057d77e2a10640ba93d7350e94d0826e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 14 Mar 2019 12:47:24 -0500 Subject: [PATCH 047/163] added a device resolver --- .../core/guards/device-resolver.service.ts | 21 +++++++++++++++++++ .../modules/device/device-routing.module.ts | 9 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 projects/account/src/app/core/guards/device-resolver.service.ts diff --git a/projects/account/src/app/core/guards/device-resolver.service.ts b/projects/account/src/app/core/guards/device-resolver.service.ts new file mode 100644 index 0000000..f482f73 --- /dev/null +++ b/projects/account/src/app/core/guards/device-resolver.service.ts @@ -0,0 +1,21 @@ +import { Injectable } from '@angular/core'; +import { + Resolve, + RouterStateSnapshot, + ActivatedRouteSnapshot +} from '@angular/router'; +import { Observable } from 'rxjs'; + +import { Device } from '../../shared/models/device.model'; +import { DeviceService } from '../http/device.service'; + +@Injectable({ + providedIn: 'root', +}) +export class DeviceResolverService implements Resolve { + constructor(private deviceService: DeviceService) {} + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Observable { + return this.deviceService.getDevices(); + } +} diff --git a/projects/account/src/app/modules/device/device-routing.module.ts b/projects/account/src/app/modules/device/device-routing.module.ts index dcb9df8..43c2090 100644 --- a/projects/account/src/app/modules/device/device-routing.module.ts +++ b/projects/account/src/app/modules/device/device-routing.module.ts @@ -4,9 +4,16 @@ import { RouterModule, Routes } from '@angular/router'; import { DeviceAddComponent } from './device-add/device-add.component'; import { DeviceComponent} from './device.component'; import { PreferencesResolverService } from '../../core/guards/preferences-resolver.service'; +import { DeviceResolverService } from '../../core/guards/device-resolver.service'; const deviceRoutes: Routes = [ - {path: 'devices', component: DeviceComponent}, + { + path: 'devices', + component: DeviceComponent, + resolve: { + devices: DeviceResolverService + } + }, { path: 'devices/add', component: DeviceAddComponent, From cc0a6f83ae0cc5d571c7168f57c7252da417baa3 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 14 Mar 2019 12:47:44 -0500 Subject: [PATCH 048/163] moved preferences model --- .../src/app/core/guards/preferences-resolver.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/account/src/app/core/guards/preferences-resolver.service.ts b/projects/account/src/app/core/guards/preferences-resolver.service.ts index c6a9bff..00773fb 100644 --- a/projects/account/src/app/core/guards/preferences-resolver.service.ts +++ b/projects/account/src/app/core/guards/preferences-resolver.service.ts @@ -6,7 +6,8 @@ import { } from '@angular/router'; import { Observable } from 'rxjs'; -import { AccountPreferences, DeviceService } from '../http/device.service'; +import { AccountPreferences } from '../../shared/models/preferences.model'; +import { DeviceService } from '../http/device.service'; @Injectable({ providedIn: 'root', From 0b8e1c854addf10b0c558ea734461e4d590456c2 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 14 Mar 2019 13:03:39 -0500 Subject: [PATCH 049/163] abstracted out the contents of each tab in the device card to improve readability --- .../device-config.component.html | 12 +++++ .../device-config.component.scss | 3 ++ .../device-config/device-config.component.ts | 18 +++++++ .../device-list/device-list.component.html | 46 +++++----------- .../device-list/device-list.component.scss | 53 ++----------------- .../device-list/device-list.component.ts | 21 +++++--- .../device-location.component.html | 15 ++++++ .../device-location.component.scss | 3 ++ .../device-location.component.ts | 15 ++++++ .../src/app/modules/device/device.module.ts | 4 +- 10 files changed, 101 insertions(+), 89 deletions(-) create mode 100644 projects/account/src/app/modules/device/device-list/device-config/device-config.component.html create mode 100644 projects/account/src/app/modules/device/device-list/device-config/device-config.component.scss create mode 100644 projects/account/src/app/modules/device/device-list/device-config/device-config.component.ts create mode 100644 projects/account/src/app/modules/device/device-list/device-location/device-location.component.html create mode 100644 projects/account/src/app/modules/device/device-list/device-location/device-location.component.scss create mode 100644 projects/account/src/app/modules/device/device-list/device-location/device-location.component.ts diff --git a/projects/account/src/app/modules/device/device-list/device-config/device-config.component.html b/projects/account/src/app/modules/device/device-list/device-config/device-config.component.html new file mode 100644 index 0000000..2897c44 --- /dev/null +++ b/projects/account/src/app/modules/device/device-list/device-config/device-config.component.html @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/projects/account/src/app/modules/device/device-list/device-config/device-config.component.scss b/projects/account/src/app/modules/device/device-list/device-config/device-config.component.scss new file mode 100644 index 0000000..db53c73 --- /dev/null +++ b/projects/account/src/app/modules/device/device-list/device-config/device-config.component.scss @@ -0,0 +1,3 @@ +mat-card-content { + margin-top: 32px; +} diff --git a/projects/account/src/app/modules/device/device-list/device-config/device-config.component.ts b/projects/account/src/app/modules/device/device-list/device-config/device-config.component.ts new file mode 100644 index 0000000..7a0a9ca --- /dev/null +++ b/projects/account/src/app/modules/device/device-list/device-config/device-config.component.ts @@ -0,0 +1,18 @@ +import { Component, Input, OnInit } from '@angular/core'; + +import { Device } from '../../../../shared/models/device.model'; + +@Component({ + selector: 'account-device-config', + templateUrl: './device-config.component.html', + styleUrls: ['./device-config.component.scss'] +}) +export class DeviceConfigComponent implements OnInit { + @Input() device: Device; + + constructor() { } + + ngOnInit() { + } + +} diff --git a/projects/account/src/app/modules/device/device-list/device-list.component.html b/projects/account/src/app/modules/device/device-list/device-list.component.html index 32e1316..f93a281 100644 --- a/projects/account/src/app/modules/device/device-list/device-list.component.html +++ b/projects/account/src/app/modules/device/device-list/device-list.component.html @@ -5,42 +5,24 @@
- + {{device.name}} - - - - Location - - - - Platform - - - - Placement - - - - Core Version - - - - Voice - - - - Enclosure Version - - - - Wake Word - - - + + + + + + + + + + + + + @@ -46,7 +59,7 @@ - + @@ -61,4 +74,31 @@ Next + + +
+ + + +
+
+ + +
+ + + +
+
+
diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.ts b/projects/account/src/app/modules/device/device-add/device-add.component.ts index 928851c..9fc1bd0 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.ts +++ b/projects/account/src/app/modules/device/device-add/device-add.component.ts @@ -26,6 +26,7 @@ export class DeviceAddComponent implements OnInit { public pairingCodeControl: AbstractControl; public pairDeviceForm: FormGroup; public preferencesForm: FormGroup; + public defaultsForm: FormGroup; public preferences: AccountPreferences; public stepDoneIcon = faCheck; @@ -49,18 +50,41 @@ export class DeviceAddComponent implements OnInit { } private buildForms() { - this.preferencesForm = this.deviceService.buildPreferencesForm(this.preferences); this.pairDeviceForm = this.formBuilder.group({ - pairingCode: ['', Validators.required], + pairingCode: [ + null, + [ + Validators.required, + Validators.maxLength(6), + Validators.minLength(6) + ] + ], }); + this.preferencesForm = this.formBuilder.group( + { + dateFormat: [null, Validators.required], + measurementSystem: [null, Validators.required], + timeFormat: [null, Validators.required], + } + ); + this.defaultsForm = this.formBuilder.group( + { + country: [null], + region: [null], + city: [null], + timezone: [null], + wakeWord: [null], + voice: [null] + } + ); this.deviceForm = this.formBuilder.group( { - name: ['', Validators.required], - placement: [''], - country: ['', Validators.required], - region: ['', Validators.required], - city: ['', Validators.required], - timeZone: ['', Validators.required] + name: [null, Validators.required], + placement: [null], + country: [null, Validators.required], + region: [null, Validators.required], + city: [null, Validators.required], + timeZone: [null, Validators.required] } ); } @@ -82,6 +106,10 @@ export class DeviceAddComponent implements OnInit { } onPreferencesSubmit() { - console.log('attempting to pair device'); + console.log('preferences set'); + } + + onDefaultsSubmit() { + console.log('defaults set'); } } diff --git a/projects/account/src/app/modules/device/device.module.ts b/projects/account/src/app/modules/device/device.module.ts index d36adc9..ed3cec2 100644 --- a/projects/account/src/app/modules/device/device.module.ts +++ b/projects/account/src/app/modules/device/device.module.ts @@ -3,8 +3,8 @@ import { CommonModule } from '@angular/common'; import { FlexLayoutModule } from '@angular/flex-layout'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { + MatAutocompleteModule, MatButtonModule, - MatButtonToggleModule, MatCardModule, MatDialogModule, MatExpansionModule, @@ -34,6 +34,7 @@ import { PairingComponent } from './device-add/pairing/pairing.component'; import { DeviceListComponent } from './device-list/device-list.component'; import { DeviceConfigComponent } from './device-list/device-config/device-config.component'; import { DeviceLocationComponent } from './device-list/device-location/device-location.component'; +import { DefaultsComponent } from './defaults/defaults.component'; @NgModule({ declarations: [ @@ -50,6 +51,7 @@ import { DeviceLocationComponent } from './device-list/device-location/device-lo PairingComponent, DeviceLocationComponent, DeviceConfigComponent, + DefaultsComponent, ], entryComponents: [ DeviceAddComponent, @@ -61,8 +63,8 @@ import { DeviceLocationComponent } from './device-list/device-location/device-lo FontAwesomeModule, FormsModule, ReactiveFormsModule, + MatAutocompleteModule, MatButtonModule, - MatButtonToggleModule, MatCardModule, MatDialogModule, MatExpansionModule, diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.html b/projects/account/src/app/modules/device/preferences/preferences.component.html index d5d1798..8f7c75b 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.html +++ b/projects/account/src/app/modules/device/preferences/preferences.component.html @@ -1,84 +1,40 @@ -

- Looks like you haven't setup your device preferences yet... -

-

Take a minute to fill out the form below to improve your Mycroft experience!

-
- - - Preferences - - -

These settings will be applied to all your devices.

-
- Measurement System - - Imperial - Metric - -
-
- Time Format - - 12 Hour - 24 Hour - -
-
- Date Format - - DD/MM/YYYY - MM/DD/YYYY - -
-
-
+ + Setup your device preferences + Manage your device preferences + +

+ Preferences are applied to all your devices to present information + in a manner you are accustomed to. +

+ + + + + + +
+
- - - Defaults - -

Optional values used as defaults during device setup.

- - - Country - - - - Region - - - - City - - - - Time Zone - - - - - - -
- - - - Advanced Settings - -
-
-

{{paragraph}}

-
- + + + Advanced Settings + +
+
+

{{paragraph}}

- - + +
+
diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.scss b/projects/account/src/app/modules/device/preferences/preferences.component.scss index ae4970b..0adb224 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.scss +++ b/projects/account/src/app/modules/device/preferences/preferences.component.scss @@ -1,31 +1,19 @@ -@import "../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; -@import "../../../../../../../src/stylesheets/components/buttons"; -@import "../../../../../../../src/stylesheets/components/cards"; +@import "components/buttons"; +@import "components/cards"; -.mat-h1 { - color: mat-color($mycroft-primary) -} mat-card { @include section-card; max-width: 700px; + + mat-card-title { + color: mat-color($mycroft-primary) + } } -#basic-settings-card { +#required-settings-card { margin-top: 16px; - - mat-button-toggle-group { - @include options-button-group; - - mat-button-toggle { - width: 130px; - } - } - - mat-label { - margin-bottom: 8px; - margin-top: 16px; - } } #advanced-settings-card { diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.ts b/projects/account/src/app/modules/device/preferences/preferences.component.ts index ad78c38..3798838 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.ts +++ b/projects/account/src/app/modules/device/preferences/preferences.component.ts @@ -1,8 +1,9 @@ import { Component, OnInit, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; +import { MatButtonToggleChange } from '@angular/material'; import { AccountPreferences } from '../../../shared/models/preferences.model'; -import { MatButtonToggleChange } from '@angular/material'; +import { OptionButtonsConfig } from '../../../shared/models/option-buttons-config.model'; @Component({ selector: 'account-device-preferences', @@ -14,8 +15,30 @@ export class PreferencesComponent implements OnInit { @Input() deviceSetup: boolean; @Input() preferences: AccountPreferences; @Input() preferencesForm: FormGroup; + public measurementOptionsConfig: OptionButtonsConfig; + public timeFormatOptionsConfig: OptionButtonsConfig; + public dateFormatOptionsConfig: OptionButtonsConfig; - constructor() { } + constructor() { + this.dateFormatOptionsConfig = { + label: 'Date Format', + options: ['DD/MM/YYYY', 'MM/DD/YYYY'], + buttonWidth: '130px', + labelWidth: '180px' + }; + this.measurementOptionsConfig = { + label: 'Measurement System', + options: ['Imperial', 'Metric'], + buttonWidth: '130px', + labelWidth: '180px' + }; + this.timeFormatOptionsConfig = { + label: 'Time Format', + options: ['12 Hour', '24 Hour'], + buttonWidth: '130px', + labelWidth: '180px' + }; + } ngOnInit() { this.buildAdvancedSettingsDesc(); @@ -35,15 +58,15 @@ export class PreferencesComponent implements OnInit { ]; } - changeDateFormat(newValue: MatButtonToggleChange) { - this.preferencesForm.patchValue({dateFormat: newValue.value}); + changeDateFormat(newValue: string) { + this.preferencesForm.patchValue({dateFormat: newValue}); } - changeMeasurementSystem(newValue: MatButtonToggleChange) { - this.preferencesForm.patchValue({measurementSystem: newValue.value}); + changeMeasurementSystem(newValue: string) { + this.preferencesForm.patchValue({measurementSystem: newValue}); } - changeTimeFormat(newValue: MatButtonToggleChange) { - this.preferencesForm.patchValue({timeFormat: newValue.value}); + changeTimeFormat(newValue: string) { + this.preferencesForm.patchValue({timeFormat: newValue}); } } From c166ec41d770ff0791879f0af5688384f8f8b77d Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 15 Mar 2019 01:30:50 -0500 Subject: [PATCH 056/163] remove unnecessary noise --- projects/account/src/app/profile/new/new.component.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/profile/new/new.component.scss b/projects/account/src/app/profile/new/new.component.scss index 28450d2..fefff6e 100644 --- a/projects/account/src/app/profile/new/new.component.scss +++ b/projects/account/src/app/profile/new/new.component.scss @@ -1,6 +1,6 @@ -@import "../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; -@import "../../../../../../src/stylesheets/components/buttons"; +@import "components/buttons"; button { @include action-button-primary; From 18b852ccde82f06000b6d633dd26035affe9766b Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 15 Mar 2019 01:39:03 -0500 Subject: [PATCH 057/163] improved spacing --- .../device/defaults/defaults.component.html | 122 +++++++++--------- .../device/defaults/defaults.component.scss | 4 + 2 files changed, 66 insertions(+), 60 deletions(-) diff --git a/projects/account/src/app/modules/device/defaults/defaults.component.html b/projects/account/src/app/modules/device/defaults/defaults.component.html index fc19d3c..ad24893 100644 --- a/projects/account/src/app/modules/device/defaults/defaults.component.html +++ b/projects/account/src/app/modules/device/defaults/defaults.component.html @@ -5,66 +5,68 @@

Optional values used as defaults during device setup.

Geographical Location

- - Country - - - - {{country.name}} - - - - - Region - - - - {{region.name}} - - - - - City - - - - {{city.name}} - - - - - Time Zone - - - - {{timezone.name}} - - - +
+ + Country + + + + {{country.name}} + + + + + Region + + + + {{region.name}} + + + + + City + + + + {{city.name}} + + + + + Time Zone + + + + {{timezone.name}} + + + +

Voice

Date: Fri, 15 Mar 2019 01:49:04 -0500 Subject: [PATCH 058/163] brute force right align next buttons --- .../device-add/device-add.component.html | 24 ++++++++++++------- .../device-add/device-add.component.scss | 12 ++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.html b/projects/account/src/app/modules/device/device-add/device-add.component.html index a33ac3f..25f113a 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.html +++ b/projects/account/src/app/modules/device/device-add/device-add.component.html @@ -12,9 +12,11 @@
- +
+ +
@@ -25,9 +27,11 @@ [deviceSetup]="true" > - +
+ +
@@ -38,9 +42,11 @@ [deviceSetup]="true" > - +
+ +
diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.scss b/projects/account/src/app/modules/device/device-add/device-add.component.scss index fc2d384..c021b28 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.scss +++ b/projects/account/src/app/modules/device/device-add/device-add.component.scss @@ -1,3 +1,15 @@ +@import "~@angular/material/theming"; +@import "mycroft-colors"; +@import "components/buttons"; + +button { + @include action-button-primary; + + &:disabled { + background-color: mat-color($mycroft-accent, 200); + } +} + mat-horizontal-stepper { margin-left: auto; margin-right: auto; From 53a64f53dcca8b1056c495fcf55b07f32adaba1a Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 15 Mar 2019 14:58:45 -0500 Subject: [PATCH 059/163] fixed an issue with timezone not being valid when populated from city --- .../src/app/modules/device/defaults/defaults.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/modules/device/defaults/defaults.component.ts b/projects/account/src/app/modules/device/defaults/defaults.component.ts index 285b7fb..7b54400 100644 --- a/projects/account/src/app/modules/device/defaults/defaults.component.ts +++ b/projects/account/src/app/modules/device/defaults/defaults.component.ts @@ -155,14 +155,14 @@ export class DefaultsComponent implements OnInit { this.defaultsForm.controls['timezone'].setValue(foundCity.timezone); } - + this.getTimezones(); } getTimezones() { const country = this.countries.find( (cntry) => cntry.name === this.defaultsForm.controls['country'].value ); - if (!this.cities) { + if (!this.timezones) { this.geoService.getTimezonesByCountry(country).subscribe( (cities) => { this.timezones = cities; From 9d65165ef23bfca20a21df31cfbc3cb479a9c330 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 17 Mar 2019 22:34:21 -0500 Subject: [PATCH 060/163] abstracted the country input to reduce code duplication --- .../country-input.component.html | 17 ++++ .../country-input.component.scss | 1 + .../country-input/country-input.component.ts | 79 +++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 projects/account/src/app/shared/components/country-input/country-input.component.html create mode 100644 projects/account/src/app/shared/components/country-input/country-input.component.scss create mode 100644 projects/account/src/app/shared/components/country-input/country-input.component.ts diff --git a/projects/account/src/app/shared/components/country-input/country-input.component.html b/projects/account/src/app/shared/components/country-input/country-input.component.html new file mode 100644 index 0000000..ca6de16 --- /dev/null +++ b/projects/account/src/app/shared/components/country-input/country-input.component.html @@ -0,0 +1,17 @@ + + + Country + + + + {{country.name}} + + + + diff --git a/projects/account/src/app/shared/components/country-input/country-input.component.scss b/projects/account/src/app/shared/components/country-input/country-input.component.scss new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/projects/account/src/app/shared/components/country-input/country-input.component.scss @@ -0,0 +1 @@ + diff --git a/projects/account/src/app/shared/components/country-input/country-input.component.ts b/projects/account/src/app/shared/components/country-input/country-input.component.ts new file mode 100644 index 0000000..bb14071 --- /dev/null +++ b/projects/account/src/app/shared/components/country-input/country-input.component.ts @@ -0,0 +1,79 @@ +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { map, startWith, tap } from 'rxjs/operators'; + +import { Country } from '../../models/country.model'; +import { Observable } from 'rxjs'; +import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; + +@Component({ + selector: 'account-country-input', + templateUrl: './country-input.component.html', + styleUrls: ['./country-input.component.scss'] +}) +export class CountryInputComponent implements OnInit { + @Input() countries$: Observable; + private countries: Country[]; + @Input() deviceForm: FormGroup; + public filteredCountries$: Observable; + @Output() countrySelected = new EventEmitter(); + + constructor() { } + + ngOnInit() { + } + + getCountries() { + if (!this.countries) { + this.countries$.subscribe( + (countries) => { + this.countries = countries; + this.deviceForm.controls['country'].validator = this.geographyValidator(this.countries); + this.filteredCountries$ = this.deviceForm.controls['country'].valueChanges.pipe( + startWith(''), + map((value) => this.filterCountries(value)), + tap(() => { this.checkForCountryValidity(); }) + ); + } + ); + } + } + + private filterCountries(value: string): Country[] { + console.log(value); + const filterValue = value.toLowerCase(); + let filteredCountries: Country[]; + + if (this.countries) { + filteredCountries = this.countries.filter( + (country) => country.name.toLowerCase().includes(filterValue) + ); + } else { + filteredCountries = []; + } + + return filteredCountries; + } + + geographyValidator(geographies: any[]): ValidatorFn { + return (geographyControl: AbstractControl) => { + let valid = true; + if (geographyControl.value) { + const foundGeography = geographies.find( + (geography) => geography.name === geographyControl.value + ); + if (!foundGeography) { + valid = false; + } + } + return valid ? null : {geographyNotFound: true}; + + }; + } + + checkForCountryValidity() { + if (this.deviceForm.controls['country'].valid) { + this.countrySelected.emit(this.deviceForm.controls['country'].value); + } + } + +} From 40d3c5a4afe82959694c6d3c33efd2953c3f91bb Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 17 Mar 2019 22:36:32 -0500 Subject: [PATCH 061/163] abstracted the country input to reduce code duplication --- .../device/defaults/defaults.component.html | 21 +++------- .../device/defaults/defaults.component.scss | 5 ++- .../device/defaults/defaults.component.ts | 40 +++---------------- 3 files changed, 16 insertions(+), 50 deletions(-) diff --git a/projects/account/src/app/modules/device/defaults/defaults.component.html b/projects/account/src/app/modules/device/defaults/defaults.component.html index ad24893..99a360d 100644 --- a/projects/account/src/app/modules/device/defaults/defaults.component.html +++ b/projects/account/src/app/modules/device/defaults/defaults.component.html @@ -6,21 +6,12 @@

Geographical Location

- - Country - - - - {{country.name}} - - - + + Region (); public regions: Region[]; public timezones: Timezone[]; public filteredCities$: Observable; - public filteredCountries$: Observable; + public selectedCountry: Country; public filteredRegions$: Observable; public filteredTimezones$: Observable; @@ -44,40 +45,10 @@ export class DefaultsComponent implements OnInit { this.defaultsForm.controls['region'].disable(); this.defaultsForm.controls['city'].disable(); this.defaultsForm.controls['timezone'].disable(); + this.countries$ = this.geoService.getCountries(); } - getCountries() { - if (!this.countries) { - this.geoService.getCountries().subscribe( - (countries) => { - this.countries = countries; - this.defaultsForm.controls['country'].validator = this.geographyValidator(this.countries); - this.filteredCountries$ = this.defaultsForm.controls['country'].valueChanges.pipe( - startWith(''), - map((value) => this.filterCountries(value)), - tap(() => { this.toggleCountryDependentControls(); }) - ); - } - ); - } - } - - private filterCountries(value: string): Country[] { - const filterValue = value.toLowerCase(); - let filteredCountries: Country[]; - - if (this.countries) { - filteredCountries = this.countries.filter( - (country) => country.name.toLowerCase().includes(filterValue) - ); - } else { - filteredCountries = []; - } - - return filteredCountries; - } - getRegions() { const country = this.countries.find( (cntry) => cntry.name === this.defaultsForm.controls['country'].value @@ -209,7 +180,8 @@ export class DefaultsComponent implements OnInit { }; } - toggleCountryDependentControls() { + onCountrySelect(selectedCountry: Country) { + this.selectedCountry = selectedCountry; if (this.defaultsForm.controls['country'].value && this.defaultsForm.controls['country'].valid) { this.defaultsForm.controls['region'].enable(); this.defaultsForm.controls['timezone'].enable(); From bc3b3ff36697c2632499d6481572e29b527a8e4a Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 17 Mar 2019 22:43:45 -0500 Subject: [PATCH 062/163] minor refactor --- .../country-input/country-input.component.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/projects/account/src/app/shared/components/country-input/country-input.component.ts b/projects/account/src/app/shared/components/country-input/country-input.component.ts index bb14071..5d8e30a 100644 --- a/projects/account/src/app/shared/components/country-input/country-input.component.ts +++ b/projects/account/src/app/shared/components/country-input/country-input.component.ts @@ -27,7 +27,7 @@ export class CountryInputComponent implements OnInit { this.countries$.subscribe( (countries) => { this.countries = countries; - this.deviceForm.controls['country'].validator = this.geographyValidator(this.countries); + this.deviceForm.controls['country'].validator = this.countryValidator(); this.filteredCountries$ = this.deviceForm.controls['country'].valueChanges.pipe( startWith(''), map((value) => this.filterCountries(value)), @@ -54,18 +54,18 @@ export class CountryInputComponent implements OnInit { return filteredCountries; } - geographyValidator(geographies: any[]): ValidatorFn { - return (geographyControl: AbstractControl) => { + countryValidator(): ValidatorFn { + return (countryControl: AbstractControl) => { let valid = true; - if (geographyControl.value) { - const foundGeography = geographies.find( - (geography) => geography.name === geographyControl.value + if (countryControl.value) { + const foundCountry = this.countries.find( + (country) => country.name === countryControl.value ); - if (!foundGeography) { + if (!foundCountry) { valid = false; } } - return valid ? null : {geographyNotFound: true}; + return valid ? null : {countryNotFound: true}; }; } From 7079750fb75807a80d6aadf06bbdaed494f1eafc Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 00:28:32 -0500 Subject: [PATCH 063/163] added region shared component --- .../country-input/country-input.component.ts | 16 +++- .../region-input/region-input.component.html | 17 ++++ .../region-input/region-input.component.scss | 0 .../region-input/region-input.component.ts | 79 +++++++++++++++++++ .../account/src/app/shared/shared.module.ts | 15 +++- 5 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 projects/account/src/app/shared/components/region-input/region-input.component.html create mode 100644 projects/account/src/app/shared/components/region-input/region-input.component.scss create mode 100644 projects/account/src/app/shared/components/region-input/region-input.component.ts diff --git a/projects/account/src/app/shared/components/country-input/country-input.component.ts b/projects/account/src/app/shared/components/country-input/country-input.component.ts index 5d8e30a..f6108e0 100644 --- a/projects/account/src/app/shared/components/country-input/country-input.component.ts +++ b/projects/account/src/app/shared/components/country-input/country-input.component.ts @@ -31,7 +31,7 @@ export class CountryInputComponent implements OnInit { this.filteredCountries$ = this.deviceForm.controls['country'].valueChanges.pipe( startWith(''), map((value) => this.filterCountries(value)), - tap(() => { this.checkForCountryValidity(); }) + tap(() => { this.checkForValidCountry(); }) ); } ); @@ -39,7 +39,6 @@ export class CountryInputComponent implements OnInit { } private filterCountries(value: string): Country[] { - console.log(value); const filterValue = value.toLowerCase(); let filteredCountries: Country[]; @@ -70,9 +69,18 @@ export class CountryInputComponent implements OnInit { }; } - checkForCountryValidity() { + checkForValidCountry() { if (this.deviceForm.controls['country'].valid) { - this.countrySelected.emit(this.deviceForm.controls['country'].value); + if (this.deviceForm.controls['country'].value) { + const foundCountry = this.countries.find( + (country) => country.name === this.deviceForm.controls['country'].value + ); + this.countrySelected.emit(foundCountry); + } else { + this.countrySelected.emit(null); + } + } else { + this.countrySelected.emit(null); } } diff --git a/projects/account/src/app/shared/components/region-input/region-input.component.html b/projects/account/src/app/shared/components/region-input/region-input.component.html new file mode 100644 index 0000000..d73d4e3 --- /dev/null +++ b/projects/account/src/app/shared/components/region-input/region-input.component.html @@ -0,0 +1,17 @@ + + + Region + + + + {{region.name}} + + + + diff --git a/projects/account/src/app/shared/components/region-input/region-input.component.scss b/projects/account/src/app/shared/components/region-input/region-input.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/projects/account/src/app/shared/components/region-input/region-input.component.ts b/projects/account/src/app/shared/components/region-input/region-input.component.ts new file mode 100644 index 0000000..d370534 --- /dev/null +++ b/projects/account/src/app/shared/components/region-input/region-input.component.ts @@ -0,0 +1,79 @@ +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { map, startWith, tap } from 'rxjs/operators'; +import { Region } from '../../models/region.model'; +import { Observable } from 'rxjs'; +import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; + +@Component({ + selector: 'account-region-input', + templateUrl: './region-input.component.html', + styleUrls: ['./region-input.component.scss'] +}) +export class RegionInputComponent implements OnInit { + @Input() deviceForm: FormGroup; + @Input() filteredRegions$: Observable; + @Input() regions$: Observable; + private regions: Region[]; + @Output() regionSelected = new EventEmitter(); + + constructor() { } + + ngOnInit() { + } + + getRegions() { + if (!this.deviceForm.controls['region'].value) { + this.regions$.subscribe( + (regions) => { + this.regions = regions; + this.deviceForm.controls['region'].validator = this.regionValidator(); + this.filteredRegions$ = this.deviceForm.controls['region'].valueChanges.pipe( + startWith(''), + map((value) => this.filterRegions(value)), + tap(() => { + this.checkForValidRegion(); + }) + ); + } + ); + } + } + + private filterRegions(value: string): Region[] { + const filterValue = value.toLowerCase(); + let filteredRegions: Region[]; + + if (this.regions) { + filteredRegions = this.regions.filter( + (region) => region.name.toLowerCase().includes(filterValue) + ); + } else { + filteredRegions = []; + } + + return filteredRegions; + } + + regionValidator(): ValidatorFn { + return (regionControl: AbstractControl) => { + let valid = true; + if (regionControl.value) { + const foundRegion = this.regions.find( + (region) => region.name === regionControl.value + ); + if (!foundRegion) { + valid = false; + } + } + return valid ? null : {regionNotFound: true}; + + }; + } + + checkForValidRegion() { + if (this.deviceForm.controls['region'].valid) { + this.regionSelected.emit(this.deviceForm.controls['region'].value); + } + } + +} diff --git a/projects/account/src/app/shared/shared.module.ts b/projects/account/src/app/shared/shared.module.ts index 023968c..0f7a961 100644 --- a/projects/account/src/app/shared/shared.module.ts +++ b/projects/account/src/app/shared/shared.module.ts @@ -1,7 +1,9 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FlexLayoutModule } from '@angular/flex-layout'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { + MatAutocompleteModule, MatButtonToggleModule, MatFormFieldModule, MatInputModule @@ -9,19 +11,28 @@ import { import { DisplayFieldComponent } from './components/display-field/display-field.component'; import { OptionButtonsComponent } from './components/option-buttons/option-buttons.component'; +import { CountryInputComponent } from './components/country-input/country-input.component'; +import { RegionInputComponent } from './components/region-input/region-input.component'; @NgModule({ declarations: [ DisplayFieldComponent, - OptionButtonsComponent + OptionButtonsComponent, + CountryInputComponent, + RegionInputComponent ], exports: [ + CountryInputComponent, DisplayFieldComponent, - OptionButtonsComponent + OptionButtonsComponent, + RegionInputComponent ], imports: [ CommonModule, FlexLayoutModule, + FormsModule, + ReactiveFormsModule, + MatAutocompleteModule, MatButtonToggleModule, MatFormFieldModule, MatInputModule From 2ae7728f59ec1b7e7c8647feaa27a26f3a6ce10e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 01:02:04 -0500 Subject: [PATCH 064/163] minor refactor --- .../country-input/country-input.component.ts | 14 ++++++----- .../region-input/region-input.component.ts | 23 ++++++++++++++----- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/projects/account/src/app/shared/components/country-input/country-input.component.ts b/projects/account/src/app/shared/components/country-input/country-input.component.ts index f6108e0..3d655b7 100644 --- a/projects/account/src/app/shared/components/country-input/country-input.component.ts +++ b/projects/account/src/app/shared/components/country-input/country-input.component.ts @@ -13,13 +13,15 @@ import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; export class CountryInputComponent implements OnInit { @Input() countries$: Observable; private countries: Country[]; + private countryControl: AbstractControl; + @Output() countrySelected = new EventEmitter(); @Input() deviceForm: FormGroup; public filteredCountries$: Observable; - @Output() countrySelected = new EventEmitter(); constructor() { } ngOnInit() { + this.countryControl = this.deviceForm.controls['country']; } getCountries() { @@ -27,8 +29,8 @@ export class CountryInputComponent implements OnInit { this.countries$.subscribe( (countries) => { this.countries = countries; - this.deviceForm.controls['country'].validator = this.countryValidator(); - this.filteredCountries$ = this.deviceForm.controls['country'].valueChanges.pipe( + this.countryControl.validator = this.countryValidator(); + this.filteredCountries$ = this.countryControl.valueChanges.pipe( startWith(''), map((value) => this.filterCountries(value)), tap(() => { this.checkForValidCountry(); }) @@ -70,10 +72,10 @@ export class CountryInputComponent implements OnInit { } checkForValidCountry() { - if (this.deviceForm.controls['country'].valid) { - if (this.deviceForm.controls['country'].value) { + if (this.countryControl.valid) { + if (this.countryControl.value) { const foundCountry = this.countries.find( - (country) => country.name === this.deviceForm.controls['country'].value + (country) => country.name === this.countryControl.value ); this.countrySelected.emit(foundCountry); } else { diff --git a/projects/account/src/app/shared/components/region-input/region-input.component.ts b/projects/account/src/app/shared/components/region-input/region-input.component.ts index d370534..ebb9aab 100644 --- a/projects/account/src/app/shared/components/region-input/region-input.component.ts +++ b/projects/account/src/app/shared/components/region-input/region-input.component.ts @@ -14,20 +14,22 @@ export class RegionInputComponent implements OnInit { @Input() filteredRegions$: Observable; @Input() regions$: Observable; private regions: Region[]; + private regionControl: AbstractControl; @Output() regionSelected = new EventEmitter(); constructor() { } ngOnInit() { - } + this.regionControl = this.deviceForm.controls['region']; + } getRegions() { - if (!this.deviceForm.controls['region'].value) { + if (!this.regionControl.value) { this.regions$.subscribe( (regions) => { this.regions = regions; - this.deviceForm.controls['region'].validator = this.regionValidator(); - this.filteredRegions$ = this.deviceForm.controls['region'].valueChanges.pipe( + this.regionControl.validator = this.regionValidator(); + this.filteredRegions$ = this.regionControl.valueChanges.pipe( startWith(''), map((value) => this.filterRegions(value)), tap(() => { @@ -71,8 +73,17 @@ export class RegionInputComponent implements OnInit { } checkForValidRegion() { - if (this.deviceForm.controls['region'].valid) { - this.regionSelected.emit(this.deviceForm.controls['region'].value); + if (this.regionControl.valid) { + if (this.regionControl.value) { + const foundRegion = this.regions.find( + (region) => region.name === this.regionControl.value + ); + this.regionSelected.emit(foundRegion); + } else { + this.regionSelected.emit(null); + } + } else { + this.regionSelected.emit(null); } } From 8dd9075ee9ff228abe2bcdf93e4b491428df19e2 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 01:03:46 -0500 Subject: [PATCH 065/163] added city shared component --- .../city-input/city-input.component.html | 17 ++++ .../city-input/city-input.component.scss | 0 .../city-input/city-input.component.ts | 82 +++++++++++++++++++ .../account/src/app/shared/shared.module.ts | 11 ++- 4 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 projects/account/src/app/shared/components/city-input/city-input.component.html create mode 100644 projects/account/src/app/shared/components/city-input/city-input.component.scss create mode 100644 projects/account/src/app/shared/components/city-input/city-input.component.ts diff --git a/projects/account/src/app/shared/components/city-input/city-input.component.html b/projects/account/src/app/shared/components/city-input/city-input.component.html new file mode 100644 index 0000000..6892bb5 --- /dev/null +++ b/projects/account/src/app/shared/components/city-input/city-input.component.html @@ -0,0 +1,17 @@ + + + City + + + + {{city.name}} + + + + diff --git a/projects/account/src/app/shared/components/city-input/city-input.component.scss b/projects/account/src/app/shared/components/city-input/city-input.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/projects/account/src/app/shared/components/city-input/city-input.component.ts b/projects/account/src/app/shared/components/city-input/city-input.component.ts new file mode 100644 index 0000000..b2bf2d2 --- /dev/null +++ b/projects/account/src/app/shared/components/city-input/city-input.component.ts @@ -0,0 +1,82 @@ +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Observable } from 'rxjs'; +import { startWith, map, tap} from 'rxjs/operators'; + +import { City } from '../../models/city.model'; +import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; + +@Component({ + selector: 'account-city-input', + templateUrl: './city-input.component.html', + styleUrls: ['./city-input.component.scss'] +}) +export class CityInputComponent implements OnInit { + @Input() cities$: Observable; + private cities: City[]; + @Input() deviceForm: FormGroup; + public filteredCities$ = new Observable(); + @Output() citySelected = new EventEmitter(); + private cityControl: AbstractControl; + + constructor() { + } + + ngOnInit() { + this.cityControl = this.deviceForm.controls['city']; + } + + getCities() { + if (!this.cities) { + this.cities$.subscribe( + (cities) => { + this.cities = cities; + this.cityControl.validator = this.cityValidator(); + this.filteredCities$ = this.cityControl.valueChanges.pipe( + startWith(''), + map((value) => this.filterCities(value)), + tap(() => { this.checkForValidCity(); }) + + ); + } + ); + } + } + + private filterCities(value: string): City[] { + const filterValue = value.toLowerCase(); + let filteredCities: City[]; + + if (this.cities) { + filteredCities = this.cities.filter( + (cty) => cty.name.toLowerCase().includes(filterValue) + ); + } else { + filteredCities = []; + } + + return filteredCities; + } + + cityValidator(): ValidatorFn { + return (cityControl: AbstractControl) => { + let valid = true; + if (cityControl.value) { + const foundCity = this.cities.find( + (city) => city.name === cityControl.value + ); + if (!foundCity) { + valid = false; + } + } + return valid ? null : {regionNotFound: true}; + + }; + } + + checkForValidCity() { + if (this.cityControl.valid) { + this.citySelected.emit(this.cityControl.value); + } + } + +} diff --git a/projects/account/src/app/shared/shared.module.ts b/projects/account/src/app/shared/shared.module.ts index 0f7a961..7f1c896 100644 --- a/projects/account/src/app/shared/shared.module.ts +++ b/projects/account/src/app/shared/shared.module.ts @@ -9,19 +9,24 @@ import { MatInputModule } from '@angular/material'; +import { CityInputComponent } from './components/city-input/city-input.component'; +import { CountryInputComponent } from './components/country-input/country-input.component'; import { DisplayFieldComponent } from './components/display-field/display-field.component'; import { OptionButtonsComponent } from './components/option-buttons/option-buttons.component'; -import { CountryInputComponent } from './components/country-input/country-input.component'; import { RegionInputComponent } from './components/region-input/region-input.component'; +import { TimezoneInputComponent } from './components/timezone-input/timezone-input.component'; @NgModule({ declarations: [ + CityInputComponent, + CountryInputComponent, DisplayFieldComponent, OptionButtonsComponent, - CountryInputComponent, - RegionInputComponent + RegionInputComponent, + TimezoneInputComponent ], exports: [ + CityInputComponent, CountryInputComponent, DisplayFieldComponent, OptionButtonsComponent, From cfbb2a4bcb7969455201b7159579bea31bb69f02 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 01:28:08 -0500 Subject: [PATCH 066/163] added empty value check to fix a bug --- .../city-input/city-input.component.ts | 35 ++++++++++++------- .../region-input/region-input.component.ts | 26 +++++++------- 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/projects/account/src/app/shared/components/city-input/city-input.component.ts b/projects/account/src/app/shared/components/city-input/city-input.component.ts index b2bf2d2..8b63a11 100644 --- a/projects/account/src/app/shared/components/city-input/city-input.component.ts +++ b/projects/account/src/app/shared/components/city-input/city-input.component.ts @@ -43,18 +43,20 @@ export class CityInputComponent implements OnInit { } private filterCities(value: string): City[] { - const filterValue = value.toLowerCase(); - let filteredCities: City[]; + if (value) { + const filterValue = value.toLowerCase(); + let filteredCities: City[]; - if (this.cities) { - filteredCities = this.cities.filter( - (cty) => cty.name.toLowerCase().includes(filterValue) - ); - } else { - filteredCities = []; + if (this.cities) { + filteredCities = this.cities.filter( + (cty) => cty.name.toLowerCase().includes(filterValue) + ); + } else { + filteredCities = []; + } + + return filteredCities; } - - return filteredCities; } cityValidator(): ValidatorFn { @@ -68,14 +70,23 @@ export class CityInputComponent implements OnInit { valid = false; } } - return valid ? null : {regionNotFound: true}; + return valid ? null : {cityNotFound: true}; }; } checkForValidCity() { if (this.cityControl.valid) { - this.citySelected.emit(this.cityControl.value); + if (this.cityControl.value) { + const foundCity = this.cities.find( + (city) => city.name === this.cityControl.value + ); + this.citySelected.emit(foundCity); + } else { + this.citySelected.emit(null); + } + } else { + this.citySelected.emit(null); } } diff --git a/projects/account/src/app/shared/components/region-input/region-input.component.ts b/projects/account/src/app/shared/components/region-input/region-input.component.ts index ebb9aab..0d1d572 100644 --- a/projects/account/src/app/shared/components/region-input/region-input.component.ts +++ b/projects/account/src/app/shared/components/region-input/region-input.component.ts @@ -32,9 +32,7 @@ export class RegionInputComponent implements OnInit { this.filteredRegions$ = this.regionControl.valueChanges.pipe( startWith(''), map((value) => this.filterRegions(value)), - tap(() => { - this.checkForValidRegion(); - }) + tap(() => {this.checkForValidRegion(); }) ); } ); @@ -42,18 +40,20 @@ export class RegionInputComponent implements OnInit { } private filterRegions(value: string): Region[] { - const filterValue = value.toLowerCase(); - let filteredRegions: Region[]; + if (value) { + const filterValue = value.toLowerCase(); + let filteredRegions: Region[]; - if (this.regions) { - filteredRegions = this.regions.filter( - (region) => region.name.toLowerCase().includes(filterValue) - ); - } else { - filteredRegions = []; + if (this.regions) { + filteredRegions = this.regions.filter( + (region) => region.name.toLowerCase().includes(filterValue) + ); + } else { + filteredRegions = []; + } + + return filteredRegions; } - - return filteredRegions; } regionValidator(): ValidatorFn { From 4c9e04ffedfaffbca2246aaa1b3ee152c7c51ddc Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 01:29:57 -0500 Subject: [PATCH 067/163] added timezone shared component --- .../timezone-input.component.html | 17 +++++ .../timezone-input.component.scss | 0 .../timezone-input.component.ts | 76 +++++++++++++++++++ .../account/src/app/shared/shared.module.ts | 3 +- 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 projects/account/src/app/shared/components/timezone-input/timezone-input.component.html create mode 100644 projects/account/src/app/shared/components/timezone-input/timezone-input.component.scss create mode 100644 projects/account/src/app/shared/components/timezone-input/timezone-input.component.ts diff --git a/projects/account/src/app/shared/components/timezone-input/timezone-input.component.html b/projects/account/src/app/shared/components/timezone-input/timezone-input.component.html new file mode 100644 index 0000000..e8a6108 --- /dev/null +++ b/projects/account/src/app/shared/components/timezone-input/timezone-input.component.html @@ -0,0 +1,17 @@ + + + Time Zone + + + + {{timezone.name}} + + + + diff --git a/projects/account/src/app/shared/components/timezone-input/timezone-input.component.scss b/projects/account/src/app/shared/components/timezone-input/timezone-input.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/projects/account/src/app/shared/components/timezone-input/timezone-input.component.ts b/projects/account/src/app/shared/components/timezone-input/timezone-input.component.ts new file mode 100644 index 0000000..bf4e6fb --- /dev/null +++ b/projects/account/src/app/shared/components/timezone-input/timezone-input.component.ts @@ -0,0 +1,76 @@ +import { Component, Input, OnInit, Output } from '@angular/core'; +import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; +import { Observable } from 'rxjs'; +import { startWith, map, tap } from 'rxjs/operators'; + +import { Timezone } from '../../models/timezone.model'; + +@Component({ + selector: 'account-timezone-input', + templateUrl: './timezone-input.component.html', + styleUrls: ['./timezone-input.component.scss'] +}) +export class TimezoneInputComponent implements OnInit { + @Input() deviceForm: FormGroup; + public filteredTimezones$ = new Observable(); + @Input() timezones$: Observable; + private timezones: Timezone[]; + private timezoneControl: AbstractControl; + + constructor() { } + + ngOnInit(): void { + this.timezoneControl = this.deviceForm.controls['timezone']; + } + + getTimezones() { + if (!this.timezoneControl.value) { + this.timezones$.subscribe( + (timezones) => { + this.timezones = timezones; + this.timezoneControl.validator = this.timezoneValidator(); + this.filteredTimezones$ = this.timezoneControl.valueChanges.pipe( + startWith(''), + map((value) => this.filterTimezones(value)), + // tap(() => { this.populateTimezone(); }) + + ); + } + ); + } + } + + private filterTimezones(value: string): Timezone[] { + if (value) { + const filterValue = value.toLowerCase(); + let filteredTimezones: Timezone[]; + + if (this.timezones) { + filteredTimezones = this.timezones.filter( + (tz) => tz.name.toLowerCase().includes(filterValue) + ); + } else { + filteredTimezones = []; + } + + return filteredTimezones; + } + } + + timezoneValidator(): ValidatorFn { + return (timezoneControl: AbstractControl) => { + let valid = true; + if (timezoneControl.value) { + const foundTimezone = this.timezones.find( + (timezone) => timezone.name === timezoneControl.value + ); + if (!foundTimezone) { + valid = false; + } + } + return valid ? null : {timezoneNotFound: true}; + + }; + } + +} diff --git a/projects/account/src/app/shared/shared.module.ts b/projects/account/src/app/shared/shared.module.ts index 7f1c896..32cf044 100644 --- a/projects/account/src/app/shared/shared.module.ts +++ b/projects/account/src/app/shared/shared.module.ts @@ -30,7 +30,8 @@ import { TimezoneInputComponent } from './components/timezone-input/timezone-inp CountryInputComponent, DisplayFieldComponent, OptionButtonsComponent, - RegionInputComponent + RegionInputComponent, + TimezoneInputComponent ], imports: [ CommonModule, From 81b73f169be3401af81a8da59c17d87cb7284c73 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 01:30:28 -0500 Subject: [PATCH 068/163] updated to use shared city and timezone components --- .../device/defaults/defaults.component.html | 62 ++----- .../device/defaults/defaults.component.ts | 166 ++---------------- 2 files changed, 34 insertions(+), 194 deletions(-) diff --git a/projects/account/src/app/modules/device/defaults/defaults.component.html b/projects/account/src/app/modules/device/defaults/defaults.component.html index 99a360d..e1e380b 100644 --- a/projects/account/src/app/modules/device/defaults/defaults.component.html +++ b/projects/account/src/app/modules/device/defaults/defaults.component.html @@ -12,51 +12,23 @@ (countrySelected)="onCountrySelect($event)" > - - Region - - - - {{region.name}} - - - - - City - - - - {{city.name}} - - - - - Time Zone - - - - {{timezone.name}} - - - + + + + + +

Voice

diff --git a/projects/account/src/app/modules/device/defaults/defaults.component.ts b/projects/account/src/app/modules/device/defaults/defaults.component.ts index 5036494..a746cc6 100644 --- a/projects/account/src/app/modules/device/defaults/defaults.component.ts +++ b/projects/account/src/app/modules/device/defaults/defaults.component.ts @@ -1,7 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; +import { FormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; -import { map, startWith, tap } from 'rxjs/operators'; import { City } from '../../../shared/models/city.model'; import { Country } from '../../../shared/models/country.model'; @@ -16,19 +15,14 @@ import { Timezone } from '../../../shared/models/timezone.model'; styleUrls: ['./defaults.component.scss'] }) export class DefaultsComponent implements OnInit { + public cities$ = new Observable(); + public countries$ = new Observable(); @Input() defaultsForm: FormGroup; @Input() deviceSetup: boolean; + public regions$ = new Observable(); + public timezones$ = new Observable(); public voiceOptionsConfig: OptionButtonsConfig; public wakeWordOptionsConfig: OptionButtonsConfig; - public cities: City[]; - public countries: Country[]; - public countries$ = new Observable(); - public regions: Region[]; - public timezones: Timezone[]; - public filteredCities$: Observable; - public selectedCountry: Country; - public filteredRegions$: Observable; - public filteredTimezones$: Observable; constructor(private geoService: GeographyService) { this.voiceOptionsConfig = { @@ -49,161 +43,35 @@ export class DefaultsComponent implements OnInit { } - getRegions() { - const country = this.countries.find( - (cntry) => cntry.name === this.defaultsForm.controls['country'].value - ); - if (!this.regions) { - this.geoService.getRegionsByCountry(country).subscribe( - (regions) => { - this.regions = regions; - this.defaultsForm.controls['region'].validator = this.geographyValidator(this.regions); - this.filteredRegions$ = this.defaultsForm.controls['region'].valueChanges.pipe( - startWith(''), - map((value) => this.filterRegions(value)), - tap(() => { this.toggleCityControl(); }) - ); - } - ); - } - } - - private filterRegions(value: string): Region[] { - const filterValue = value.toLowerCase(); - let filteredRegions: Region[]; - - if (this.regions) { - filteredRegions = this.regions.filter( - (region) => region.name.toLowerCase().includes(filterValue) - ); - } else { - filteredRegions = []; - } - - return filteredRegions; - } - - getCities() { - const region = this.regions.find( - (rgn) => rgn.name === this.defaultsForm.controls['region'].value - ); - if (!this.cities) { - this.geoService.getCitiesByRegion(region).subscribe( - (cities) => { - this.cities = cities; - this.defaultsForm.controls['city'].validator = this.geographyValidator(this.cities); - this.filteredCities$ = this.defaultsForm.controls['city'].valueChanges.pipe( - startWith(''), - map((value) => this.filterCities(value)), - tap(() => { this.populateTimezone(); }) - - ); - } - ); - } - } - - private filterCities(value: string): City[] { - const filterValue = value.toLowerCase(); - let filteredCities: City[]; - - if (this.cities) { - filteredCities = this.cities.filter( - (cty) => cty.name.toLowerCase().includes(filterValue) - ); - } else { - filteredCities = []; - } - - return filteredCities; - } - - populateTimezone() { - if (this.defaultsForm.controls['city'].value && this.defaultsForm.controls['city'].valid) { - const foundCity = this.cities.find( - (cty) => cty.name === this.defaultsForm.controls['city'].value - ); - - this.defaultsForm.controls['timezone'].setValue(foundCity.timezone); - } - this.getTimezones(); - } - - getTimezones() { - const country = this.countries.find( - (cntry) => cntry.name === this.defaultsForm.controls['country'].value - ); - if (!this.timezones) { - this.geoService.getTimezonesByCountry(country).subscribe( - (cities) => { - this.timezones = cities; - this.defaultsForm.controls['timezone'].validator = this.geographyValidator(this.timezones); - this.filteredTimezones$ = this.defaultsForm.controls['timezone'].valueChanges.pipe( - startWith(''), - map((value) => this.filterTimezones(value)), - tap(() => { this.populateTimezone(); }) - - ); - } - ); - } - } - - private filterTimezones(value: string): Timezone[] { - const filterValue = value.toLowerCase(); - let filteredTimezones: Timezone[]; - - if (this.timezones) { - filteredTimezones = this.timezones.filter( - (tz) => tz.name.toLowerCase().includes(filterValue) - ); - } else { - filteredTimezones = []; - } - - return filteredTimezones; - } - - geographyValidator(geographies: any[]): ValidatorFn { - return (geographyControl: AbstractControl) => { - let valid = true; - if (geographyControl.value) { - const foundGeography = geographies.find( - (geography) => geography.name === geographyControl.value - ); - if (!foundGeography) { - valid = false; - } - } - return valid ? null : {geographyNotFound: true}; - - }; - } - - onCountrySelect(selectedCountry: Country) { - this.selectedCountry = selectedCountry; - if (this.defaultsForm.controls['country'].value && this.defaultsForm.controls['country'].valid) { + onCountrySelect(selectedCountry: Country): void { + if (selectedCountry) { this.defaultsForm.controls['region'].enable(); this.defaultsForm.controls['timezone'].enable(); + this.regions$ = this.geoService.getRegionsByCountry(selectedCountry); + this.timezones$ = this.geoService.getTimezonesByCountry(selectedCountry); } else { this.defaultsForm.controls['region'].disable(); this.defaultsForm.controls['region'].setValue(null); - this.regions = null; this.defaultsForm.controls['timezone'].disable(); this.defaultsForm.controls['timezone'].setValue(null); } } - toggleCityControl() { - if (this.defaultsForm.controls['region'].value && this.defaultsForm.controls['region'].valid) { + onRegionSelect(selectedRegion: Region): void { + if (selectedRegion) { this.defaultsForm.controls['city'].enable(); + this.cities$ = this.geoService.getCitiesByRegion(selectedRegion); } else { this.defaultsForm.controls['city'].disable(); this.defaultsForm.controls['city'].setValue(null); - this.cities = null; } } + onCitySelect(selectedCity: City): void { + if (selectedCity) { + this.defaultsForm.controls['timezone'].setValue(selectedCity.timezone); + } + } changeVoice(newValue: string) { this.defaultsForm.patchValue({voice: newValue}); } From 311dbe21f5a0ddb3c69e870fcbc9f9e01f7ce3a0 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 16:53:04 -0500 Subject: [PATCH 069/163] minor refactor --- .../device-list/device-list.component.html | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/projects/account/src/app/modules/device/device-list/device-list.component.html b/projects/account/src/app/modules/device/device-list/device-list.component.html index f93a281..2eb488f 100644 --- a/projects/account/src/app/modules/device/device-list/device-list.component.html +++ b/projects/account/src/app/modules/device/device-list/device-list.component.html @@ -1,35 +1,35 @@ -
- - ADD DEVICE - -
+
+ + ADD DEVICE + +
-
- - - - {{device.name}} - - - - - +
+ + + + {{device.name}} + + + + + - - - - - - - - - - -
+ + + + +
+ + + + +
+
From f2690af66b69d3355324c8fa22e3f1147b19e99b Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 16:54:33 -0500 Subject: [PATCH 070/163] make the device-edit component reusable for defaults and device attributes. moved the geography components from shared to here as this is now the only place they are used. --- .../city-input/city-input.component.html | 1 + .../city-input/city-input.component.scss | 0 .../city-input/city-input.component.ts | 25 ++-- .../country-input.component.html | 1 + .../country-input.component.scss | 0 .../country-input/country-input.component.ts | 3 +- .../device-edit/device-edit.component.html | 81 +++++++++++++ .../device-edit.component.scss} | 0 .../device-edit/device-edit.component.ts | 111 ++++++++++++++++++ .../region-input/region-input.component.html | 1 + .../region-input/region-input.component.scss | 0 .../region-input/region-input.component.ts | 25 ++-- .../timezone-input.component.html | 1 + .../timezone-input.component.scss | 0 .../timezone-input.component.ts | 26 ++-- 15 files changed, 234 insertions(+), 41 deletions(-) rename projects/account/src/app/{shared/components => modules/device/device-edit}/city-input/city-input.component.html (94%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/city-input/city-input.component.scss (100%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/city-input/city-input.component.ts (84%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/country-input/country-input.component.html (94%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/country-input/country-input.component.scss (100%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/country-input/country-input.component.ts (96%) create mode 100644 projects/account/src/app/modules/device/device-edit/device-edit.component.html rename projects/account/src/app/modules/device/{defaults/defaults.component.scss => device-edit/device-edit.component.scss} (100%) create mode 100644 projects/account/src/app/modules/device/device-edit/device-edit.component.ts rename projects/account/src/app/{shared/components => modules/device/device-edit}/region-input/region-input.component.html (94%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/region-input/region-input.component.scss (100%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/region-input/region-input.component.ts (84%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/timezone-input/timezone-input.component.html (94%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/timezone-input/timezone-input.component.scss (100%) rename projects/account/src/app/{shared/components => modules/device/device-edit}/timezone-input/timezone-input.component.ts (77%) diff --git a/projects/account/src/app/shared/components/city-input/city-input.component.html b/projects/account/src/app/modules/device/device-edit/city-input/city-input.component.html similarity index 94% rename from projects/account/src/app/shared/components/city-input/city-input.component.html rename to projects/account/src/app/modules/device/device-edit/city-input/city-input.component.html index 6892bb5..2daffb2 100644 --- a/projects/account/src/app/shared/components/city-input/city-input.component.html +++ b/projects/account/src/app/modules/device/device-edit/city-input/city-input.component.html @@ -6,6 +6,7 @@ type="text" formControlName="city" [matAutocomplete]="cityComplete" + [required]="required" (focus)="getCities()" > diff --git a/projects/account/src/app/shared/components/city-input/city-input.component.scss b/projects/account/src/app/modules/device/device-edit/city-input/city-input.component.scss similarity index 100% rename from projects/account/src/app/shared/components/city-input/city-input.component.scss rename to projects/account/src/app/modules/device/device-edit/city-input/city-input.component.scss diff --git a/projects/account/src/app/shared/components/city-input/city-input.component.ts b/projects/account/src/app/modules/device/device-edit/city-input/city-input.component.ts similarity index 84% rename from projects/account/src/app/shared/components/city-input/city-input.component.ts rename to projects/account/src/app/modules/device/device-edit/city-input/city-input.component.ts index 8b63a11..e957b7b 100644 --- a/projects/account/src/app/shared/components/city-input/city-input.component.ts +++ b/projects/account/src/app/modules/device/device-edit/city-input/city-input.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Observable } from 'rxjs'; import { startWith, map, tap} from 'rxjs/operators'; -import { City } from '../../models/city.model'; +import { City } from '../../../../shared/models/city.model'; import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; @Component({ @@ -17,6 +17,7 @@ export class CityInputComponent implements OnInit { public filteredCities$ = new Observable(); @Output() citySelected = new EventEmitter(); private cityControl: AbstractControl; + @Input() required: boolean; constructor() { } @@ -43,20 +44,18 @@ export class CityInputComponent implements OnInit { } private filterCities(value: string): City[] { - if (value) { - const filterValue = value.toLowerCase(); - let filteredCities: City[]; + const filterValue = value.toLowerCase(); + let filteredCities: City[]; - if (this.cities) { - filteredCities = this.cities.filter( - (cty) => cty.name.toLowerCase().includes(filterValue) - ); - } else { - filteredCities = []; - } - - return filteredCities; + if (this.cities) { + filteredCities = this.cities.filter( + (cty) => cty.name.toLowerCase().includes(filterValue) + ); + } else { + filteredCities = []; } + + return filteredCities; } cityValidator(): ValidatorFn { diff --git a/projects/account/src/app/shared/components/country-input/country-input.component.html b/projects/account/src/app/modules/device/device-edit/country-input/country-input.component.html similarity index 94% rename from projects/account/src/app/shared/components/country-input/country-input.component.html rename to projects/account/src/app/modules/device/device-edit/country-input/country-input.component.html index ca6de16..f3df082 100644 --- a/projects/account/src/app/shared/components/country-input/country-input.component.html +++ b/projects/account/src/app/modules/device/device-edit/country-input/country-input.component.html @@ -3,6 +3,7 @@ Country (); @Input() deviceForm: FormGroup; public filteredCountries$: Observable; + @Input() required: boolean; constructor() { } diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.html b/projects/account/src/app/modules/device/device-edit/device-edit.component.html new file mode 100644 index 0000000..a30ccbb --- /dev/null +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.html @@ -0,0 +1,81 @@ + + + Setup your device defaults + Manage your device defaults + Configure your new device + Change device configuration + + + + + + Name + + + + Placement + + e.g. Kitchen, Bedroom, Office + + + + + +

+ Optional values used as defaults during device setup. +

+ +

Geographical Location

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

Voice

+ + + +

Wake Word

+ + +
+
+ diff --git a/projects/account/src/app/modules/device/defaults/defaults.component.scss b/projects/account/src/app/modules/device/device-edit/device-edit.component.scss similarity index 100% rename from projects/account/src/app/modules/device/defaults/defaults.component.scss rename to projects/account/src/app/modules/device/device-edit/device-edit.component.scss diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts new file mode 100644 index 0000000..6cd39b2 --- /dev/null +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts @@ -0,0 +1,111 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { AbstractControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'; +import { Observable } from 'rxjs'; + +import { City } from '../../../shared/models/city.model'; +import { Country } from '../../../shared/models/country.model'; +import { GeographyService } from '../../../core/http/geography_service'; +import { OptionButtonsConfig } from '../../../shared/models/option-buttons-config.model'; +import { Region } from '../../../shared/models/region.model'; +import { Timezone } from '../../../shared/models/timezone.model'; +import { AccountPreferences } from '../../../shared/models/preferences.model'; + +@Component({ + selector: 'account-device-edit', + templateUrl: './device-edit.component.html', + styleUrls: ['./device-edit.component.scss'] +}) +export class DeviceEditComponent implements OnInit { + @Input() action: string; + public cities$ = new Observable(); + public countries$ = new Observable(); + @Input() deviceForm: FormGroup; + @Input() preferences: AccountPreferences; + public regions$ = new Observable(); + public timezones$ = new Observable(); + public voiceOptionsConfig: OptionButtonsConfig; + public wakeWordOptionsConfig: OptionButtonsConfig; + + constructor(private geoService: GeographyService) { + this.voiceOptionsConfig = { + options: ['British Male', 'American Female', 'American Male', 'Google Voice'], + buttonWidth: '140px' + }; + this.wakeWordOptionsConfig = { + options: ['Hey Mycroft', 'Christopher', 'Hey Ezra', 'Hey Jarvis'], + buttonWidth: '130px' + }; + } + + ngOnInit() { + // Disable the controls that depend on other control values to be pre-populated. + this.deviceForm.controls['region'].disable(); + this.deviceForm.controls['city'].disable(); + this.deviceForm.controls['timezone'].disable(); + this.countries$ = this.geoService.getCountries(); + if (this.action === 'device setup' && this.preferences) { + this.applyDefaultValues(); + } + } + + applyDefaultValues() { + if (this.preferences.geography.country) { + this.deviceForm.controls['country'].setValue( + this.preferences.geography.country + ); + } + if (this.preferences.geography.region) { + this.deviceForm.controls['region'].setValue( + this.preferences.geography.region + ); + } + if (this.preferences.geography.city) { + this.deviceForm.controls['city'].setValue( + this.preferences.geography.city + ); + } + if (this.preferences.geography.timezone) { + this.deviceForm.controls['timezone'].setValue( + this.preferences.geography.timezone + ); + } + } + + onCountrySelect(selectedCountry: Country): void { + if (selectedCountry) { + this.deviceForm.controls['region'].enable(); + this.deviceForm.controls['timezone'].enable(); + this.regions$ = this.geoService.getRegionsByCountry(selectedCountry); + this.timezones$ = this.geoService.getTimezonesByCountry(selectedCountry); + } else { + this.deviceForm.controls['region'].disable(); + this.deviceForm.controls['region'].setValue(''); + this.deviceForm.controls['timezone'].disable(); + this.deviceForm.controls['timezone'].setValue(''); + } + } + + onRegionSelect(selectedRegion: Region): void { + if (selectedRegion) { + this.deviceForm.controls['city'].enable(); + this.cities$ = this.geoService.getCitiesByRegion(selectedRegion); + } else { + this.deviceForm.controls['city'].disable(); + this.deviceForm.controls['city'].setValue(''); + } + } + + onCitySelect(selectedCity: City): void { + if (selectedCity) { + this.deviceForm.controls['timezone'].setValue(selectedCity.timezone); + } + } + + changeVoice(newValue: string) { + this.deviceForm.patchValue({voice: newValue}); + } + + changeWakeWord(newValue: string) { + this.deviceForm.patchValue({wakeWord: newValue}); + } +} diff --git a/projects/account/src/app/shared/components/region-input/region-input.component.html b/projects/account/src/app/modules/device/device-edit/region-input/region-input.component.html similarity index 94% rename from projects/account/src/app/shared/components/region-input/region-input.component.html rename to projects/account/src/app/modules/device/device-edit/region-input/region-input.component.html index d73d4e3..1b5cc8a 100644 --- a/projects/account/src/app/shared/components/region-input/region-input.component.html +++ b/projects/account/src/app/modules/device/device-edit/region-input/region-input.component.html @@ -6,6 +6,7 @@ type="text" formControlName="region" [matAutocomplete]="regionComplete" + [required]="required" (focus)="getRegions()" > diff --git a/projects/account/src/app/shared/components/region-input/region-input.component.scss b/projects/account/src/app/modules/device/device-edit/region-input/region-input.component.scss similarity index 100% rename from projects/account/src/app/shared/components/region-input/region-input.component.scss rename to projects/account/src/app/modules/device/device-edit/region-input/region-input.component.scss diff --git a/projects/account/src/app/shared/components/region-input/region-input.component.ts b/projects/account/src/app/modules/device/device-edit/region-input/region-input.component.ts similarity index 84% rename from projects/account/src/app/shared/components/region-input/region-input.component.ts rename to projects/account/src/app/modules/device/device-edit/region-input/region-input.component.ts index 0d1d572..f5b6d31 100644 --- a/projects/account/src/app/shared/components/region-input/region-input.component.ts +++ b/projects/account/src/app/modules/device/device-edit/region-input/region-input.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { map, startWith, tap } from 'rxjs/operators'; -import { Region } from '../../models/region.model'; +import { Region } from '../../../../shared/models/region.model'; import { Observable } from 'rxjs'; import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; @@ -16,6 +16,7 @@ export class RegionInputComponent implements OnInit { private regions: Region[]; private regionControl: AbstractControl; @Output() regionSelected = new EventEmitter(); + @Input() required: boolean; constructor() { } @@ -40,20 +41,18 @@ export class RegionInputComponent implements OnInit { } private filterRegions(value: string): Region[] { - if (value) { - const filterValue = value.toLowerCase(); - let filteredRegions: Region[]; + const filterValue = value.toLowerCase(); + let filteredRegions: Region[]; - if (this.regions) { - filteredRegions = this.regions.filter( - (region) => region.name.toLowerCase().includes(filterValue) - ); - } else { - filteredRegions = []; - } - - return filteredRegions; + if (this.regions) { + filteredRegions = this.regions.filter( + (region) => region.name.toLowerCase().includes(filterValue) + ); + } else { + filteredRegions = []; } + + return filteredRegions; } regionValidator(): ValidatorFn { diff --git a/projects/account/src/app/shared/components/timezone-input/timezone-input.component.html b/projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.html similarity index 94% rename from projects/account/src/app/shared/components/timezone-input/timezone-input.component.html rename to projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.html index e8a6108..ea00a6e 100644 --- a/projects/account/src/app/shared/components/timezone-input/timezone-input.component.html +++ b/projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.html @@ -6,6 +6,7 @@ type="text" formControlName="timezone" [matAutocomplete]="timezoneComplete" + [required]="required" (focus)="getTimezones()" > diff --git a/projects/account/src/app/shared/components/timezone-input/timezone-input.component.scss b/projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.scss similarity index 100% rename from projects/account/src/app/shared/components/timezone-input/timezone-input.component.scss rename to projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.scss diff --git a/projects/account/src/app/shared/components/timezone-input/timezone-input.component.ts b/projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.ts similarity index 77% rename from projects/account/src/app/shared/components/timezone-input/timezone-input.component.ts rename to projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.ts index bf4e6fb..0e62df1 100644 --- a/projects/account/src/app/shared/components/timezone-input/timezone-input.component.ts +++ b/projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.ts @@ -3,7 +3,7 @@ import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; import { Observable } from 'rxjs'; import { startWith, map, tap } from 'rxjs/operators'; -import { Timezone } from '../../models/timezone.model'; +import { Timezone } from '../../../../shared/models/timezone.model'; @Component({ selector: 'account-timezone-input', @@ -13,6 +13,7 @@ import { Timezone } from '../../models/timezone.model'; export class TimezoneInputComponent implements OnInit { @Input() deviceForm: FormGroup; public filteredTimezones$ = new Observable(); + @Input() required: boolean; @Input() timezones$: Observable; private timezones: Timezone[]; private timezoneControl: AbstractControl; @@ -32,7 +33,6 @@ export class TimezoneInputComponent implements OnInit { this.filteredTimezones$ = this.timezoneControl.valueChanges.pipe( startWith(''), map((value) => this.filterTimezones(value)), - // tap(() => { this.populateTimezone(); }) ); } @@ -41,20 +41,18 @@ export class TimezoneInputComponent implements OnInit { } private filterTimezones(value: string): Timezone[] { - if (value) { - const filterValue = value.toLowerCase(); - let filteredTimezones: Timezone[]; + const filterValue = value.toLowerCase(); + let filteredTimezones: Timezone[]; - if (this.timezones) { - filteredTimezones = this.timezones.filter( - (tz) => tz.name.toLowerCase().includes(filterValue) - ); - } else { - filteredTimezones = []; - } - - return filteredTimezones; + if (this.timezones) { + filteredTimezones = this.timezones.filter( + (tz) => tz.name.toLowerCase().includes(filterValue) + ); + } else { + filteredTimezones = []; } + + return filteredTimezones; } timezoneValidator(): ValidatorFn { From 60c02a2fd879ee4f7127820d961da271d5a72fec Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 16:55:26 -0500 Subject: [PATCH 071/163] added ability to automatically convert user input to uppercase. also added some styling --- .../device/device-add/pairing/pairing.component.html | 9 ++++++++- .../device/device-add/pairing/pairing.component.scss | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html index 02d7044..cc0f92b 100644 --- a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html +++ b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html @@ -4,7 +4,14 @@

Enter the code spoken by your device:

Pairing Code - + + Six alphanumeric characters diff --git a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss index 8a98cbc..ae64f5c 100644 --- a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss +++ b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss @@ -1,7 +1,11 @@ -@import "../../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; mat-card { + margin-left: auto; + margin-right: auto; + max-width: 300px; + mat-card-title { color: mat-color($mycroft-primary) } From ba563bd3f6524b6950c1d75a4fc798419184d569 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 18 Mar 2019 16:56:44 -0500 Subject: [PATCH 072/163] added device info and completed steps to device setup --- .../add-complete/add-complete.component.html | 11 ++ .../add-complete/add-complete.component.scss | 20 +++ .../add-complete/add-complete.component.ts | 16 +++ .../device-add/device-add.component.html | 117 ++++++++++++------ .../device/device-add/device-add.component.ts | 14 ++- 5 files changed, 138 insertions(+), 40 deletions(-) create mode 100644 projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.html create mode 100644 projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.scss create mode 100644 projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.ts diff --git a/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.html b/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.html new file mode 100644 index 0000000..c00760d --- /dev/null +++ b/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.html @@ -0,0 +1,11 @@ + + Your device is ready! + +

Here are some example questions and commands:

+

{{wakeWord}}...

+

Who is Abraham Lincoln?

+

What is the latest news?

+

Set a timer for ten minutes.

+

Set an alarm for eight o'clock tomorrow morning.

+
+
diff --git a/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.scss b/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.scss new file mode 100644 index 0000000..796e677 --- /dev/null +++ b/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.scss @@ -0,0 +1,20 @@ +@import "~@angular/material/theming"; +@import "mycroft-colors"; + +mat-card { + margin-left: auto; + margin-right: auto; + max-width: 500px; + + mat-card-title { + color: mat-color($mycroft-primary) + } + + .mat-subheading-2 { + color: mat-color($mycroft-accent, A700) + } + + p { + margin-left: 16px; + } +} diff --git a/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.ts b/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.ts new file mode 100644 index 0000000..3c80ad8 --- /dev/null +++ b/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.ts @@ -0,0 +1,16 @@ +import { Component, Input, OnInit } from '@angular/core'; + +@Component({ + selector: 'account-device-add-complete', + templateUrl: './add-complete.component.html', + styleUrls: ['./add-complete.component.scss'] +}) +export class AddCompleteComponent implements OnInit { + @Input() wakeWord: string; + + constructor() { } + + ngOnInit() { + } + +} diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.html b/projects/account/src/app/modules/device/device-add/device-add.component.html index 25f113a..d4a4a2c 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.html +++ b/projects/account/src/app/modules/device/device-add/device-add.component.html @@ -14,13 +14,13 @@
- +
- +
- - +
- - - - - - - - - - - - + +
+ + +
+ +
+
+
+ + + + +
+ +
+
@@ -75,36 +86,68 @@ - - +
+ +
+ +
+
- +
- +
+ +
- +
- - - + +
+ +
+ +
+ + +
+ +
+
+
+ + + + +
+ +
+
+ diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.ts b/projects/account/src/app/modules/device/device-add/device-add.component.ts index 9fc1bd0..79ca59d 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.ts +++ b/projects/account/src/app/modules/device/device-add/device-add.component.ts @@ -69,6 +69,8 @@ export class DeviceAddComponent implements OnInit { ); this.defaultsForm = this.formBuilder.group( { + name: [null], + placement: [null], country: [null], region: [null], city: [null], @@ -79,12 +81,14 @@ export class DeviceAddComponent implements OnInit { ); this.deviceForm = this.formBuilder.group( { - name: [null, Validators.required], + name: [null], placement: [null], country: [null, Validators.required], region: [null, Validators.required], city: [null, Validators.required], - timeZone: [null, Validators.required] + timezone: [null, Validators.required], + wakeWord: [null, Validators.required], + voice: [null, Validators.required] } ); } @@ -105,11 +109,15 @@ export class DeviceAddComponent implements OnInit { console.log('attempting to pair device'); } + onDeviceSubmit() { + console.log('device added'); + } + onPreferencesSubmit() { console.log('preferences set'); } onDefaultsSubmit() { - console.log('defaults set'); + console.log('device-config set'); } } From a44e64cc878004798df13991cb0294ee61541974 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 19 Mar 2019 23:14:02 -0500 Subject: [PATCH 073/163] changed to pass a authentication token to backend instead of the user's email for security purposes --- .../lib/facebook-button/facebook-button.component.ts | 10 +++++++--- .../src/lib/google-button/google-button.component.ts | 8 ++++++-- .../src/lib/shared/models/federated-login.model.ts | 4 ++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 projects/shared/src/lib/shared/models/federated-login.model.ts diff --git a/projects/shared/src/lib/facebook-button/facebook-button.component.ts b/projects/shared/src/lib/facebook-button/facebook-button.component.ts index 6339be1..bdfe9a6 100644 --- a/projects/shared/src/lib/facebook-button/facebook-button.component.ts +++ b/projects/shared/src/lib/facebook-button/facebook-button.component.ts @@ -3,21 +3,25 @@ import { Component, EventEmitter, Output } from '@angular/core'; import { faFacebook } from '@fortawesome/free-brands-svg-icons'; import { AuthService, FacebookLoginProvider } from 'angular-6-social-login'; -@Component({ +import { FederatedLoginToken } from '../shared/models/federated-login.model'; + +@Component( { selector: 'shared-facebook-button', templateUrl: './facebook-button.component.html', styleUrls: ['./facebook-button.component.scss'] }) export class FacebookButtonComponent { public facebookIcon = faFacebook; - @Output() facebookEmail = new EventEmitter(); + @Output() facebookToken = new EventEmitter(); constructor(private authService: AuthService) { } facebookLogin() { const platformProvider = FacebookLoginProvider.PROVIDER_ID; this.authService.signIn(platformProvider).then( - (userData) => { this.facebookEmail.emit(userData.email); } + (userData) => { + this.facebookToken.emit({platform: 'Facebook', token: userData.token}); + } ); } diff --git a/projects/shared/src/lib/google-button/google-button.component.ts b/projects/shared/src/lib/google-button/google-button.component.ts index d43e9b4..bcf2df7 100644 --- a/projects/shared/src/lib/google-button/google-button.component.ts +++ b/projects/shared/src/lib/google-button/google-button.component.ts @@ -3,6 +3,8 @@ import { Component, EventEmitter, Output } from '@angular/core'; import { faGoogle } from '@fortawesome/free-brands-svg-icons'; import { AuthService, GoogleLoginProvider } from 'angular-6-social-login'; +import { FederatedLoginToken } from '../shared/models/federated-login.model'; + @Component({ selector: 'shared-google-button', templateUrl: './google-button.component.html', @@ -10,14 +12,16 @@ import { AuthService, GoogleLoginProvider } from 'angular-6-social-login'; }) export class GoogleButtonComponent { public googleIcon = faGoogle; - @Output() googleEmail = new EventEmitter(); + @Output() googleToken = new EventEmitter(); constructor(private authService: AuthService) { } googleLogin() { const platformProvider = GoogleLoginProvider.PROVIDER_ID; this.authService.signIn(platformProvider).then( - (userData) => { this.googleEmail.emit(userData.email); } + (userData) => { + this.googleToken.emit({platform: 'Google', token: userData.token}); + } ); } diff --git a/projects/shared/src/lib/shared/models/federated-login.model.ts b/projects/shared/src/lib/shared/models/federated-login.model.ts new file mode 100644 index 0000000..ac8f1f1 --- /dev/null +++ b/projects/shared/src/lib/shared/models/federated-login.model.ts @@ -0,0 +1,4 @@ +export interface FederatedLoginToken { + platform: string; + token: string; +} From 903883cd2f61f79915a69c4f199b7ba66fabb6e5 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 19 Mar 2019 23:14:24 -0500 Subject: [PATCH 074/163] changed to pass a authentication token to backend instead of the user's email for security purposes --- projects/sso/src/app/app.service.ts | 9 +++++++-- .../login/federated-login/federated-login.component.html | 4 ++-- .../login/federated-login/federated-login.component.ts | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/projects/sso/src/app/app.service.ts b/projects/sso/src/app/app.service.ts index 7b2ddaf..a5cbeff 100644 --- a/projects/sso/src/app/app.service.ts +++ b/projects/sso/src/app/app.service.ts @@ -21,6 +21,11 @@ const internalAuthUrl = '/api/internal-login'; const federatedAuthUrl = '/api/validate-federated'; const logoutUrl = '/api/logout'; +export interface FederatedLoginToken { + platform: string; + token: string; +} + export function storeRedirect() { localStorage.setItem( 'redirect', @@ -59,8 +64,8 @@ export class AppService { return this.http.get(internalAuthUrl, {headers: httpHeaders}); } - validateFederatedLogin(email: string) { - return this.http.post(federatedAuthUrl, {email: email}); + validateFederatedLogin(loginToken: FederatedLoginToken) { + return this.http.post(federatedAuthUrl, loginToken); } logout(): Observable { diff --git a/projects/sso/src/app/login/federated-login/federated-login.component.html b/projects/sso/src/app/login/federated-login/federated-login.component.html index 64c193c..3564835 100644 --- a/projects/sso/src/app/login/federated-login/federated-login.component.html +++ b/projects/sso/src/app/login/federated-login/federated-login.component.html @@ -1,6 +1,6 @@
- - + + -
- -
-
@@ -85,17 +74,6 @@ - - - -
- -
- -
-
@@ -149,5 +127,4 @@
- diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.ts b/projects/account/src/app/modules/device/device-add/device-add.component.ts index 79ca59d..5c6a80e 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.ts +++ b/projects/account/src/app/modules/device/device-add/device-add.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { MediaChange, MediaObserver } from '@angular/flex-layout'; import { - AbstractControl, FormBuilder, FormGroup, Validators @@ -13,6 +12,7 @@ import { Subscription } from 'rxjs'; import { AccountPreferences } from '../../../shared/models/preferences.model'; import { DeviceService } from '../../../core/http/device.service'; +import { AccountDefaults } from '../../../shared/models/defaults.model'; @Component({ selector: 'account-device-add', @@ -21,12 +21,11 @@ import { DeviceService } from '../../../core/http/device.service'; }) export class DeviceAddComponent implements OnInit { public alignVertical: boolean; + public defaults: AccountDefaults; + public defaultsForm: FormGroup; public deviceForm: FormGroup; private mediaWatcher: Subscription; - public pairingCodeControl: AbstractControl; - public pairDeviceForm: FormGroup; public preferencesForm: FormGroup; - public defaultsForm: FormGroup; public preferences: AccountPreferences; public stepDoneIcon = faCheck; @@ -44,22 +43,11 @@ export class DeviceAddComponent implements OnInit { } ngOnInit() { - this.getAccountPreferences(); + this.getResolverData(); this.buildForms(); - this.setControlFormAliases(); } private buildForms() { - this.pairDeviceForm = this.formBuilder.group({ - pairingCode: [ - null, - [ - Validators.required, - Validators.maxLength(6), - Validators.minLength(6) - ] - ], - }); this.preferencesForm = this.formBuilder.group( { dateFormat: [null, Validators.required], @@ -67,13 +55,18 @@ export class DeviceAddComponent implements OnInit { timeFormat: [null, Validators.required], } ); + + // The defaults and device forms must have the same fields because they + // both use the same component. The name, pairing code and placement + // controls are only placeholders in this context to facilitate form re-use. this.defaultsForm = this.formBuilder.group( { - name: [null], - placement: [null], - country: [null], - region: [null], city: [null], + country: [null], + name: [null], + pairingCode: [null], + placement: [null], + region: [null], timezone: [null], wakeWord: [null], voice: [null] @@ -81,11 +74,19 @@ export class DeviceAddComponent implements OnInit { ); this.deviceForm = this.formBuilder.group( { - name: [null], - placement: [null], - country: [null, Validators.required], - region: [null, Validators.required], city: [null, Validators.required], + name: [null, Validators.required], + country: [null, Validators.required], + pairingCode: [ + null, + [ + Validators.required, + Validators.maxLength(6), + Validators.minLength(6) + ] + ], + placement: [null], + region: [null, Validators.required], timezone: [null, Validators.required], wakeWord: [null, Validators.required], voice: [null, Validators.required] @@ -93,31 +94,24 @@ export class DeviceAddComponent implements OnInit { ); } - getAccountPreferences() { + getResolverData() { this.route.data.subscribe( - (data: {preferences: AccountPreferences}) => { + (data: {defaults: AccountDefaults, preferences: AccountPreferences}) => { this.preferences = data.preferences; + this.defaults = data.defaults; } ); } - private setControlFormAliases() { - this.pairingCodeControl = this.pairDeviceForm.controls['pairingCode']; - } - - onPairingSubmit() { - console.log('attempting to pair device'); - } - onDeviceSubmit() { - console.log('device added'); + this.deviceService.addDevice(this.deviceForm); } onPreferencesSubmit() { - console.log('preferences set'); + this.deviceService.addAccountPreferences(this.preferencesForm); } onDefaultsSubmit() { - console.log('device-config set'); + this.deviceService.addAccountDefaults(this.defaultsForm); } } From 3fd84f7d6c95a4555a7df79ed721a51a9c25e1ec Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 20 Mar 2019 22:39:37 -0500 Subject: [PATCH 080/163] new methods for calling the backend during device setup --- .../src/app/core/http/device.service.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/projects/account/src/app/core/http/device.service.ts b/projects/account/src/app/core/http/device.service.ts index 253d202..6aaf47f 100644 --- a/projects/account/src/app/core/http/device.service.ts +++ b/projects/account/src/app/core/http/device.service.ts @@ -4,7 +4,11 @@ import { Injectable } from '@angular/core'; import { AccountPreferences } from '../../shared/models/preferences.model'; import { Device } from '../../shared/models/device.model'; import { DeviceAttribute } from '../../shared/models/deviceAttribute.model'; +import { FormGroup } from '@angular/forms'; +import { AccountDefaults } from '../../shared/models/defaults.model'; +import { subscribeOn } from 'rxjs/operators'; +const defaultsUrl = '/api/defaults'; const deviceUrl = '/api/devices'; const geographyUrl = 'api/geographies'; const preferencesUrl = '/api/preferences'; @@ -29,14 +33,30 @@ export class DeviceService { return this.http.get(deviceUrl); } + addDevice(deviceForm: FormGroup) { + this.http.post(deviceUrl, deviceForm.value).subscribe(); + } + deleteDevice(device: Device): void { console.log('deleting device... '); } + addAccountPreferences(preferencesForm: FormGroup) { + this.http.post(preferencesUrl, preferencesForm.value).subscribe(); + } + getAccountPreferences() { return this.http.get(preferencesUrl); } + addAccountDefaults(defaultsForm: FormGroup) { + this.http.post(defaultsUrl, defaultsForm.value).subscribe(); + } + + getAccountDefaults() { + return this.http.get(defaultsUrl); + } + getGeographies() { return this.http.get(geographyUrl); } From d1b062f276b45d7083b202c9711936cda4145fbd Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 20 Mar 2019 22:41:51 -0500 Subject: [PATCH 081/163] moved device edit components since they are no longer reused --- projects/account/src/app/shared/shared.module.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/projects/account/src/app/shared/shared.module.ts b/projects/account/src/app/shared/shared.module.ts index 32cf044..59d5049 100644 --- a/projects/account/src/app/shared/shared.module.ts +++ b/projects/account/src/app/shared/shared.module.ts @@ -9,29 +9,17 @@ import { MatInputModule } from '@angular/material'; -import { CityInputComponent } from './components/city-input/city-input.component'; -import { CountryInputComponent } from './components/country-input/country-input.component'; import { DisplayFieldComponent } from './components/display-field/display-field.component'; import { OptionButtonsComponent } from './components/option-buttons/option-buttons.component'; -import { RegionInputComponent } from './components/region-input/region-input.component'; -import { TimezoneInputComponent } from './components/timezone-input/timezone-input.component'; @NgModule({ declarations: [ - CityInputComponent, - CountryInputComponent, DisplayFieldComponent, OptionButtonsComponent, - RegionInputComponent, - TimezoneInputComponent ], exports: [ - CityInputComponent, - CountryInputComponent, DisplayFieldComponent, OptionButtonsComponent, - RegionInputComponent, - TimezoneInputComponent ], imports: [ CommonModule, From 056ee31d93d8c42b53abd4e051539408b2eae2fa Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 20 Mar 2019 22:42:47 -0500 Subject: [PATCH 082/163] split defaults out of preferences into their own entity --- .../src/app/shared/models/defaults.model.ts | 16 ++++++++++++++++ .../src/app/shared/models/preferences.model.ts | 8 +------- .../account/src/app/shared/models/voice.model.ts | 4 ++++ .../src/app/shared/models/wake-word.model.ts | 4 ++++ 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 projects/account/src/app/shared/models/defaults.model.ts create mode 100644 projects/account/src/app/shared/models/voice.model.ts create mode 100644 projects/account/src/app/shared/models/wake-word.model.ts diff --git a/projects/account/src/app/shared/models/defaults.model.ts b/projects/account/src/app/shared/models/defaults.model.ts new file mode 100644 index 0000000..8726a8e --- /dev/null +++ b/projects/account/src/app/shared/models/defaults.model.ts @@ -0,0 +1,16 @@ +import { Country } from './country.model'; +import { City } from './city.model'; +import { Region } from './region.model'; +import { Timezone} from './timezone.model'; +import { Voice } from './voice.model'; +import { WakeWord } from './wake-word.model'; + +export interface AccountDefaults { + id: string; + country: Country; + region: Region; + city: City; + timezone: Timezone; + voice: Voice; + wakeWord: WakeWord; +} diff --git a/projects/account/src/app/shared/models/preferences.model.ts b/projects/account/src/app/shared/models/preferences.model.ts index e79f999..6cc3882 100644 --- a/projects/account/src/app/shared/models/preferences.model.ts +++ b/projects/account/src/app/shared/models/preferences.model.ts @@ -1,12 +1,6 @@ -import { DeviceAttribute } from './deviceAttribute.model'; -import { Geography } from './geography.model'; - export interface AccountPreferences { + id: string; dateFormat: string; - geography: Geography; - location: DeviceAttribute; measurementSystem: string; timeFormat: string; - voice: DeviceAttribute; - wakeWord: DeviceAttribute; } diff --git a/projects/account/src/app/shared/models/voice.model.ts b/projects/account/src/app/shared/models/voice.model.ts new file mode 100644 index 0000000..d62433e --- /dev/null +++ b/projects/account/src/app/shared/models/voice.model.ts @@ -0,0 +1,4 @@ +export interface Voice { + id: string; + displayName: string; +} diff --git a/projects/account/src/app/shared/models/wake-word.model.ts b/projects/account/src/app/shared/models/wake-word.model.ts new file mode 100644 index 0000000..ea93545 --- /dev/null +++ b/projects/account/src/app/shared/models/wake-word.model.ts @@ -0,0 +1,4 @@ +export interface WakeWord { + id: string; + wakeWord: string; +} From 7173e80f41f9715b210c9e2aa13b3c23678af332 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 20 Mar 2019 22:43:28 -0500 Subject: [PATCH 083/163] split defaults out of preferences into their own entity --- .../src/app/modules/device/device.module.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/projects/account/src/app/modules/device/device.module.ts b/projects/account/src/app/modules/device/device.module.ts index ed3cec2..d18e281 100644 --- a/projects/account/src/app/modules/device/device.module.ts +++ b/projects/account/src/app/modules/device/device.module.ts @@ -34,7 +34,12 @@ import { PairingComponent } from './device-add/pairing/pairing.component'; import { DeviceListComponent } from './device-list/device-list.component'; import { DeviceConfigComponent } from './device-list/device-config/device-config.component'; import { DeviceLocationComponent } from './device-list/device-location/device-location.component'; -import { DefaultsComponent } from './defaults/defaults.component'; +import { DeviceEditComponent } from './device-edit/device-edit.component'; +import { CityInputComponent } from './device-edit/city-input/city-input.component'; +import { CountryInputComponent } from './device-edit/country-input/country-input.component'; +import { RegionInputComponent } from './device-edit/region-input/region-input.component'; +import { TimezoneInputComponent } from './device-edit/timezone-input/timezone-input.component'; +import { AddCompleteComponent } from './device-add/add-complete/add-complete.component'; @NgModule({ declarations: [ @@ -48,10 +53,14 @@ import { DefaultsComponent } from './defaults/defaults.component'; PreferencesComponent, WakeWordComponent, DeviceAddComponent, - PairingComponent, DeviceLocationComponent, + DeviceEditComponent, DeviceConfigComponent, - DefaultsComponent, + CityInputComponent, + CountryInputComponent, + RegionInputComponent, + TimezoneInputComponent, + AddCompleteComponent ], entryComponents: [ DeviceAddComponent, From b13244410abbbb428a45338dd23d9e1418121835 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 20 Mar 2019 22:45:03 -0500 Subject: [PATCH 084/163] removed obsolete components --- .../device/attribute/attribute.component.html | 40 --------- .../device/attribute/attribute.component.scss | 28 ------- .../device/attribute/attribute.component.ts | 32 -------- .../geography/geography.component.html | 8 -- .../geography/geography.component.scss | 0 .../geography/geography.component.ts | 24 ------ .../placement/placement.component.html | 6 -- .../placement/placement.component.scss | 0 .../placement/placement.component.ts | 23 ------ .../attribute/voice/voice.component.html | 8 -- .../attribute/voice/voice.component.scss | 0 .../device/attribute/voice/voice.component.ts | 26 ------ .../wake-word/wake-word.component.html | 8 -- .../wake-word/wake-word.component.scss | 0 .../wake-word/wake-word.component.ts | 26 ------ .../device/defaults/defaults.component.html | 51 ------------ .../device/defaults/defaults.component.ts | 82 ------------------- .../device-edit/device-edit.component.html | 22 ++++- .../device-edit/device-edit.component.ts | 34 +++++--- .../src/app/modules/device/device.module.ts | 11 --- 20 files changed, 43 insertions(+), 386 deletions(-) delete mode 100644 projects/account/src/app/modules/device/attribute/attribute.component.html delete mode 100644 projects/account/src/app/modules/device/attribute/attribute.component.scss delete mode 100644 projects/account/src/app/modules/device/attribute/attribute.component.ts delete mode 100644 projects/account/src/app/modules/device/attribute/geography/geography.component.html delete mode 100644 projects/account/src/app/modules/device/attribute/geography/geography.component.scss delete mode 100644 projects/account/src/app/modules/device/attribute/geography/geography.component.ts delete mode 100644 projects/account/src/app/modules/device/attribute/placement/placement.component.html delete mode 100644 projects/account/src/app/modules/device/attribute/placement/placement.component.scss delete mode 100644 projects/account/src/app/modules/device/attribute/placement/placement.component.ts delete mode 100644 projects/account/src/app/modules/device/attribute/voice/voice.component.html delete mode 100644 projects/account/src/app/modules/device/attribute/voice/voice.component.scss delete mode 100644 projects/account/src/app/modules/device/attribute/voice/voice.component.ts delete mode 100644 projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.html delete mode 100644 projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.scss delete mode 100644 projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.ts delete mode 100644 projects/account/src/app/modules/device/defaults/defaults.component.html delete mode 100644 projects/account/src/app/modules/device/defaults/defaults.component.ts diff --git a/projects/account/src/app/modules/device/attribute/attribute.component.html b/projects/account/src/app/modules/device/attribute/attribute.component.html deleted file mode 100644 index 2b65d94..0000000 --- a/projects/account/src/app/modules/device/attribute/attribute.component.html +++ /dev/null @@ -1,40 +0,0 @@ - - {{panelTitle}} -
{{instructions}}
- - - - - - - {{possibleValue.name}} - - - -
- - - - - - -
- -
- - - - - - - -
- - - - - -
-
diff --git a/projects/account/src/app/modules/device/attribute/attribute.component.scss b/projects/account/src/app/modules/device/attribute/attribute.component.scss deleted file mode 100644 index f2c1b6a..0000000 --- a/projects/account/src/app/modules/device/attribute/attribute.component.scss +++ /dev/null @@ -1,28 +0,0 @@ -@import '../../../../../../../node_modules/@angular/material/theming'; -@import '../../../../../../../src/stylesheets/mycroft-colors'; -@import '../../../../../../../src/stylesheets/components/buttons'; - -mat-expansion-panel { - margin-bottom: 16px; - margin-left: auto; - margin-right: auto; - max-width: 500px; -} -.predefined-group { - margin-bottom: 12px; - margin-top: 12px; -} - -.mat-body{ - margin-bottom: 16px; - max-width: 500px; -} - -fa-icon { - color: mat-color($mycroft-warn); - margin-left: 16px; -} - -.attribute-save-button { - @include action-button-primary; -} diff --git a/projects/account/src/app/modules/device/attribute/attribute.component.ts b/projects/account/src/app/modules/device/attribute/attribute.component.ts deleted file mode 100644 index b9d3696..0000000 --- a/projects/account/src/app/modules/device/attribute/attribute.component.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {Component, Input, OnInit} from '@angular/core'; -import { Observable } from 'rxjs'; - -import { faTrashAlt } from '@fortawesome/free-solid-svg-icons'; - -import { DeviceAttribute } from '../../../shared/models/deviceAttribute.model'; - - -@Component({ - selector: 'account-device-attribute', - templateUrl: './attribute.component.html', - styleUrls: ['./attribute.component.scss'] -}) -export class AttributeComponent implements OnInit { - @Input() currentValue: DeviceAttribute; - @Input() instructions: string; - @Input() panelTitle: string; - @Input() possibleValues$: Observable; - @Input() possibleValues: DeviceAttribute[]; - @Input() userCanAdd: boolean; - public deleteIcon = faTrashAlt; - - constructor() { - } - - ngOnInit() { - } - - onCancelClick(): void { - // this.dialogRef.close(); - } -} diff --git a/projects/account/src/app/modules/device/attribute/geography/geography.component.html b/projects/account/src/app/modules/device/attribute/geography/geography.component.html deleted file mode 100644 index 103a5e3..0000000 --- a/projects/account/src/app/modules/device/attribute/geography/geography.component.html +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/projects/account/src/app/modules/device/attribute/geography/geography.component.scss b/projects/account/src/app/modules/device/attribute/geography/geography.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/modules/device/attribute/geography/geography.component.ts b/projects/account/src/app/modules/device/attribute/geography/geography.component.ts deleted file mode 100644 index 8c367ce..0000000 --- a/projects/account/src/app/modules/device/attribute/geography/geography.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Observable } from 'rxjs'; - -import { DeviceAttribute } from '../../../../shared/models/deviceAttribute.model'; -import { DeviceService} from '../../../../core/http/device.service'; - -@Component({ - selector: 'account-device-geography', - templateUrl: './geography.component.html', - styleUrls: ['./geography.component.scss'] -}) -export class GeographyComponent implements OnInit { - @Input() currentValue: DeviceAttribute; - public geographies$ = new Observable(); - public dialogInstructions = ''; - - constructor(private deviceService: DeviceService) { - } - - ngOnInit() { - this.geographies$ = this.deviceService.getGeographies(); - } - -} diff --git a/projects/account/src/app/modules/device/attribute/placement/placement.component.html b/projects/account/src/app/modules/device/attribute/placement/placement.component.html deleted file mode 100644 index 0496982..0000000 --- a/projects/account/src/app/modules/device/attribute/placement/placement.component.html +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/projects/account/src/app/modules/device/attribute/placement/placement.component.scss b/projects/account/src/app/modules/device/attribute/placement/placement.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/modules/device/attribute/placement/placement.component.ts b/projects/account/src/app/modules/device/attribute/placement/placement.component.ts deleted file mode 100644 index 273978c..0000000 --- a/projects/account/src/app/modules/device/attribute/placement/placement.component.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -import { DeviceAttribute } from '../../../../shared/models/deviceAttribute.model'; -import { DeviceService} from '../../../../core/http/device.service'; - - -@Component({ - selector: 'account-device-placement', - templateUrl: './placement.component.html', - styleUrls: ['./placement.component.scss'] -}) -export class PlacementComponent implements OnInit { - public devicePlacements: DeviceAttribute[]; - public dialogInstructions = 'You can optionally indicate where a device is ' + - 'placed within a geography. Field is informational only.'; - - constructor(private deviceService: DeviceService) { - } - - ngOnInit() { - this.devicePlacements = this.deviceService.devicePlacements; - } -} diff --git a/projects/account/src/app/modules/device/attribute/voice/voice.component.html b/projects/account/src/app/modules/device/attribute/voice/voice.component.html deleted file mode 100644 index 6e87743..0000000 --- a/projects/account/src/app/modules/device/attribute/voice/voice.component.html +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/projects/account/src/app/modules/device/attribute/voice/voice.component.scss b/projects/account/src/app/modules/device/attribute/voice/voice.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/modules/device/attribute/voice/voice.component.ts b/projects/account/src/app/modules/device/attribute/voice/voice.component.ts deleted file mode 100644 index d8e57b9..0000000 --- a/projects/account/src/app/modules/device/attribute/voice/voice.component.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Observable } from 'rxjs'; - -import { DeviceAttribute } from '../../../../shared/models/deviceAttribute.model'; -import { DeviceService } from '../../../../core/http/device.service'; - - -@Component({ - selector: 'account-device-voice', - templateUrl: './voice.component.html', - styleUrls: ['./voice.component.scss'] -}) -export class VoiceComponent implements OnInit { - @Input() currentValue: DeviceAttribute; - public voices$ = new Observable(); - public dialogInstructions = 'Mycroft\'s voice technology is rapidly ' + - 'evolving. Local voices guarantee the most privacy. Premium voices ' + - 'are more natural but require an internet connection.'; - - constructor(private deviceService: DeviceService) { - } - - ngOnInit() { - this.voices$ = this.deviceService.getVoices(); - } -} diff --git a/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.html b/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.html deleted file mode 100644 index 4fdd2d0..0000000 --- a/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.html +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.scss b/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.ts b/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.ts deleted file mode 100644 index 46c70d4..0000000 --- a/projects/account/src/app/modules/device/attribute/wake-word/wake-word.component.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; - -import { DeviceAttribute } from '../../../../shared/models/deviceAttribute.model'; -import { DeviceService} from '../../../../core/http/device.service'; -import { Observable } from 'rxjs'; - - -@Component({ - selector: 'account-device-wake-word', - templateUrl: './wake-word.component.html', - styleUrls: ['./wake-word.component.scss'] -}) -export class WakeWordComponent implements OnInit { - @Input() currentValue: DeviceAttribute; - public wakeWords$ = new Observable(); - public dialogInstructions = 'Mycroft\'s voice technology is rapidly ' + - 'evolving. Local voices guarantee the most privacy. Premium voices ' + - 'are more natural but require an internet connection.'; - - constructor(private deviceService: DeviceService) { - } - - ngOnInit() { - this.wakeWords$ = this.deviceService.getWakeWords(); - } -} diff --git a/projects/account/src/app/modules/device/defaults/defaults.component.html b/projects/account/src/app/modules/device/defaults/defaults.component.html deleted file mode 100644 index e1e380b..0000000 --- a/projects/account/src/app/modules/device/defaults/defaults.component.html +++ /dev/null @@ -1,51 +0,0 @@ - - Setup your device defaults - Manage your device defaults - -

Optional values used as defaults during device setup.

- -

Geographical Location

-
- - - - - - - - -
- -

Voice

- - - -

Wake Word

- - -
-
- diff --git a/projects/account/src/app/modules/device/defaults/defaults.component.ts b/projects/account/src/app/modules/device/defaults/defaults.component.ts deleted file mode 100644 index a746cc6..0000000 --- a/projects/account/src/app/modules/device/defaults/defaults.component.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; -import { Observable } from 'rxjs'; - -import { City } from '../../../shared/models/city.model'; -import { Country } from '../../../shared/models/country.model'; -import { GeographyService } from '../../../core/http/geography_service'; -import { OptionButtonsConfig } from '../../../shared/models/option-buttons-config.model'; -import { Region } from '../../../shared/models/region.model'; -import { Timezone } from '../../../shared/models/timezone.model'; - -@Component({ - selector: 'account-device-defaults', - templateUrl: './defaults.component.html', - styleUrls: ['./defaults.component.scss'] -}) -export class DefaultsComponent implements OnInit { - public cities$ = new Observable(); - public countries$ = new Observable(); - @Input() defaultsForm: FormGroup; - @Input() deviceSetup: boolean; - public regions$ = new Observable(); - public timezones$ = new Observable(); - public voiceOptionsConfig: OptionButtonsConfig; - public wakeWordOptionsConfig: OptionButtonsConfig; - - constructor(private geoService: GeographyService) { - this.voiceOptionsConfig = { - options: ['British Male', 'American Female', 'American Male', 'Google Voice'], - buttonWidth: '140px' - }; - this.wakeWordOptionsConfig = { - options: ['Hey Mycroft', 'Christopher', 'Hey Ezra', 'Hey Jarvis'], - buttonWidth: '130px' - }; - } - - ngOnInit() { - this.defaultsForm.controls['region'].disable(); - this.defaultsForm.controls['city'].disable(); - this.defaultsForm.controls['timezone'].disable(); - this.countries$ = this.geoService.getCountries(); - } - - - onCountrySelect(selectedCountry: Country): void { - if (selectedCountry) { - this.defaultsForm.controls['region'].enable(); - this.defaultsForm.controls['timezone'].enable(); - this.regions$ = this.geoService.getRegionsByCountry(selectedCountry); - this.timezones$ = this.geoService.getTimezonesByCountry(selectedCountry); - } else { - this.defaultsForm.controls['region'].disable(); - this.defaultsForm.controls['region'].setValue(null); - this.defaultsForm.controls['timezone'].disable(); - this.defaultsForm.controls['timezone'].setValue(null); - } - } - - onRegionSelect(selectedRegion: Region): void { - if (selectedRegion) { - this.defaultsForm.controls['city'].enable(); - this.cities$ = this.geoService.getCitiesByRegion(selectedRegion); - } else { - this.defaultsForm.controls['city'].disable(); - this.defaultsForm.controls['city'].setValue(null); - } - } - - onCitySelect(selectedCity: City): void { - if (selectedCity) { - this.defaultsForm.controls['timezone'].setValue(selectedCity.timezone); - } - } - changeVoice(newValue: string) { - this.defaultsForm.patchValue({voice: newValue}); - } - - changeWakeWord(newValue: string) { - this.defaultsForm.patchValue({wakeWord: newValue}); - } -} diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.html b/projects/account/src/app/modules/device/device-edit/device-edit.component.html index a30ccbb..85cb159 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.html +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.html @@ -1,3 +1,11 @@ + Setup your device defaults @@ -9,13 +17,25 @@ + + Pairing Code + + Code spoken by device + Name + Must be unique Placement diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts index 6cd39b2..dbaa20f 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { AbstractControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'; +import { FormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; import { City } from '../../../shared/models/city.model'; @@ -8,7 +8,7 @@ import { GeographyService } from '../../../core/http/geography_service'; import { OptionButtonsConfig } from '../../../shared/models/option-buttons-config.model'; import { Region } from '../../../shared/models/region.model'; import { Timezone } from '../../../shared/models/timezone.model'; -import { AccountPreferences } from '../../../shared/models/preferences.model'; +import { AccountDefaults } from '../../../shared/models/defaults.model'; @Component({ selector: 'account-device-edit', @@ -20,7 +20,7 @@ export class DeviceEditComponent implements OnInit { public cities$ = new Observable(); public countries$ = new Observable(); @Input() deviceForm: FormGroup; - @Input() preferences: AccountPreferences; + @Input() defaults: AccountDefaults; public regions$ = new Observable(); public timezones$ = new Observable(); public voiceOptionsConfig: OptionButtonsConfig; @@ -43,30 +43,40 @@ export class DeviceEditComponent implements OnInit { this.deviceForm.controls['city'].disable(); this.deviceForm.controls['timezone'].disable(); this.countries$ = this.geoService.getCountries(); - if (this.action === 'device setup' && this.preferences) { + if (this.action === 'device setup' && this.defaults) { this.applyDefaultValues(); } } applyDefaultValues() { - if (this.preferences.geography.country) { + if (this.defaults.country) { this.deviceForm.controls['country'].setValue( - this.preferences.geography.country + this.defaults.country.name ); } - if (this.preferences.geography.region) { + if (this.defaults.region) { this.deviceForm.controls['region'].setValue( - this.preferences.geography.region + this.defaults.region.name ); } - if (this.preferences.geography.city) { + if (this.defaults.city) { this.deviceForm.controls['city'].setValue( - this.preferences.geography.city + this.defaults.city.name ); } - if (this.preferences.geography.timezone) { + if (this.defaults.timezone) { this.deviceForm.controls['timezone'].setValue( - this.preferences.geography.timezone + this.defaults.timezone.name + ); + } + if (this.defaults.voice) { + this.deviceForm.controls['voice'].setValue( + this.defaults.voice.displayName + ); + } + if (this.defaults.wakeWord) { + this.deviceForm.controls['wakeWord'].setValue( + this.defaults.wakeWord.wakeWord ); } } diff --git a/projects/account/src/app/modules/device/device.module.ts b/projects/account/src/app/modules/device/device.module.ts index d18e281..8cbebc2 100644 --- a/projects/account/src/app/modules/device/device.module.ts +++ b/projects/account/src/app/modules/device/device.module.ts @@ -18,19 +18,13 @@ import { import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { AttributeComponent } from './attribute/attribute.component'; import { DeviceComponent } from './device.component'; import { DeviceRoutingModule } from './device-routing.module'; import { DeviceService } from '../../core/http/device.service'; -import { GeographyComponent } from './attribute/geography/geography.component'; -import { PlacementComponent } from './attribute/placement/placement.component'; import { PreferencesComponent } from './preferences/preferences.component'; import { RemoveComponent } from './remove/remove.component'; import { SharedModule } from '../../shared/shared.module'; -import { VoiceComponent } from './attribute/voice/voice.component'; -import { WakeWordComponent } from './attribute/wake-word/wake-word.component'; import { DeviceAddComponent } from './device-add/device-add.component'; -import { PairingComponent } from './device-add/pairing/pairing.component'; import { DeviceListComponent } from './device-list/device-list.component'; import { DeviceConfigComponent } from './device-list/device-config/device-config.component'; import { DeviceLocationComponent } from './device-list/device-location/device-location.component'; @@ -43,15 +37,10 @@ import { AddCompleteComponent } from './device-add/add-complete/add-complete.com @NgModule({ declarations: [ - AttributeComponent, DeviceComponent, DeviceListComponent, - GeographyComponent, - PlacementComponent, RemoveComponent, - VoiceComponent, PreferencesComponent, - WakeWordComponent, DeviceAddComponent, DeviceLocationComponent, DeviceEditComponent, From e7f03933c67803cd4b1660faf86b2b37b809dfbc Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Wed, 20 Mar 2019 22:46:14 -0500 Subject: [PATCH 085/163] removed unused import --- .../src/app/modules/device/preferences/preferences.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.ts b/projects/account/src/app/modules/device/preferences/preferences.component.ts index 3798838..165a7b4 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.ts +++ b/projects/account/src/app/modules/device/preferences/preferences.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { MatButtonToggleChange } from '@angular/material'; import { AccountPreferences } from '../../../shared/models/preferences.model'; import { OptionButtonsConfig } from '../../../shared/models/option-buttons-config.model'; From 6cf8b65b9e0754f30cae5fb0a7ba2655a773c339 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 13:13:10 -0500 Subject: [PATCH 086/163] added a save button --- .../device/device-edit/device-edit.component.html | 3 +++ .../device/device-edit/device-edit.component.scss | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.html b/projects/account/src/app/modules/device/device-edit/device-edit.component.html index 85cb159..3f20079 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.html +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.html @@ -97,5 +97,8 @@ > + + + diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.scss b/projects/account/src/app/modules/device/device-edit/device-edit.component.scss index b475ab7..2f302c4 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.scss +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.scss @@ -1,5 +1,6 @@ @import "~@angular/material/theming"; @import "mycroft-colors"; +@import "components/buttons"; @import "components/cards"; mat-card { @@ -15,11 +16,16 @@ mat-card { margin-top: 32px; } - //account-country-input { - // max-width: 280px; - //} - mat-form-field { max-width: 280px; } + + button { + @include action-button-primary; + margin: 16px; + + &:disabled { + background-color: mat-color($mycroft-accent, 200); + } + } } From a9960a4892e0bb7ea45765212ad9566d98738f41 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 13:14:37 -0500 Subject: [PATCH 087/163] added a save button --- .../device/preferences/preferences.component.html | 3 +++ .../device/preferences/preferences.component.scss | 10 ++++++++++ .../device/preferences/preferences.component.ts | 7 ++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.html b/projects/account/src/app/modules/device/preferences/preferences.component.html index 8f7c75b..fbf9eb8 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.html +++ b/projects/account/src/app/modules/device/preferences/preferences.component.html @@ -25,6 +25,9 @@ > + + + diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.scss b/projects/account/src/app/modules/device/preferences/preferences.component.scss index 0adb224..67f2004 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.scss +++ b/projects/account/src/app/modules/device/preferences/preferences.component.scss @@ -14,6 +14,16 @@ mat-card { #required-settings-card { margin-top: 16px; + + button { + @include action-button-primary; + margin: 16px; + + &:disabled { + background-color: mat-color($mycroft-accent, 200); + } + } + } #advanced-settings-card { diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.ts b/projects/account/src/app/modules/device/preferences/preferences.component.ts index 165a7b4..88d68c5 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.ts +++ b/projects/account/src/app/modules/device/preferences/preferences.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { AccountPreferences } from '../../../shared/models/preferences.model'; +import { DeviceService } from '../../../core/http/device.service'; import { OptionButtonsConfig } from '../../../shared/models/option-buttons-config.model'; @Component({ @@ -18,7 +19,7 @@ export class PreferencesComponent implements OnInit { public timeFormatOptionsConfig: OptionButtonsConfig; public dateFormatOptionsConfig: OptionButtonsConfig; - constructor() { + constructor(private deviceService: DeviceService) { this.dateFormatOptionsConfig = { label: 'Date Format', options: ['DD/MM/YYYY', 'MM/DD/YYYY'], @@ -68,4 +69,8 @@ export class PreferencesComponent implements OnInit { changeTimeFormat(newValue: string) { this.preferencesForm.patchValue({timeFormat: newValue}); } + + onSave() { + this.deviceService.updateAccountPreferences(this.preferencesForm); + } } From 6de6de45922a1742b5a21f7c6909c00a4821dd02 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 13:15:26 -0500 Subject: [PATCH 088/163] added defaults resolver --- .../account/src/app/modules/device/device-routing.module.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/account/src/app/modules/device/device-routing.module.ts b/projects/account/src/app/modules/device/device-routing.module.ts index 1c4ceda..94ed7d4 100644 --- a/projects/account/src/app/modules/device/device-routing.module.ts +++ b/projects/account/src/app/modules/device/device-routing.module.ts @@ -12,7 +12,9 @@ const deviceRoutes: Routes = [ path: 'devices', component: DeviceComponent, resolve: { - devices: DeviceResolverService + defaults: DefaultsResolverService, + devices: DeviceResolverService, + preferences: PreferencesResolverService } }, { From 300bc99dfe402a546145b9d4d991029525940f82 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 13:16:01 -0500 Subject: [PATCH 089/163] added support for forms --- .../app/modules/device/device.component.html | 19 ++++++++- .../app/modules/device/device.component.ts | 39 ++++++++++++++++++- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/projects/account/src/app/modules/device/device.component.html b/projects/account/src/app/modules/device/device.component.html index 92d4e24..3543a6c 100644 --- a/projects/account/src/app/modules/device/device.component.html +++ b/projects/account/src/app/modules/device/device.component.html @@ -1,12 +1,27 @@
- + - + + + + + + + + diff --git a/projects/account/src/app/modules/device/device.component.ts b/projects/account/src/app/modules/device/device.component.ts index bc7954b..c5002c2 100644 --- a/projects/account/src/app/modules/device/device.component.ts +++ b/projects/account/src/app/modules/device/device.component.ts @@ -1,4 +1,8 @@ import { Component, OnInit } from '@angular/core'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; +import { AccountDefaults } from '../../shared/models/defaults.model'; +import { AccountPreferences } from '../../shared/models/preferences.model'; @Component({ selector: 'account-device', @@ -6,9 +10,42 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./device.component.scss'] }) export class DeviceComponent implements OnInit { - constructor() { + defaults: AccountDefaults; + defaultsForm: FormGroup; + preferences: AccountPreferences; + preferencesForm: FormGroup; + + constructor(private formBuilder: FormBuilder, private route: ActivatedRoute) { } ngOnInit() { + this.route.data.subscribe( + (data: {defaults: AccountDefaults, preferences: AccountPreferences}) => { + this.defaults = data.defaults; + this.preferences = data.preferences; + } + ); + + this.defaultsForm = this.formBuilder.group( + { + city: [null], + country: [null], + name: [null], + pairingCode: [null], + placement: [null], + region: [null], + timezone: [null], + wakeWord: [null], + voice: [null] + } + ); + this.preferencesForm = this.formBuilder.group( + { + dateFormat: [null, Validators.required], + measurementSystem: [null, Validators.required], + timeFormat: [null, Validators.required], + } + ); + } } From 6d1b993b77422d2e4ea62a4a19694366e641e948 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 13:16:26 -0500 Subject: [PATCH 090/163] added account preferences update --- projects/account/src/app/core/http/device.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/account/src/app/core/http/device.service.ts b/projects/account/src/app/core/http/device.service.ts index 6aaf47f..8d45490 100644 --- a/projects/account/src/app/core/http/device.service.ts +++ b/projects/account/src/app/core/http/device.service.ts @@ -49,6 +49,10 @@ export class DeviceService { return this.http.get(preferencesUrl); } + updateAccountPreferences(preferencesForm: FormGroup): void { + this.http.patch(preferencesUrl, preferencesForm.value); + } + addAccountDefaults(defaultsForm: FormGroup) { this.http.post(defaultsUrl, defaultsForm.value).subscribe(); } From a68fda473536bf230fb479abc831504f884337e9 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 13:23:37 -0500 Subject: [PATCH 091/163] deleted two files that are now elsewhere --- .../preferences/preferences.component.html | 51 ------------------- .../preferences/preferences.component.ts | 31 ----------- 2 files changed, 82 deletions(-) delete mode 100644 projects/account/src/app/device/preferences/preferences.component.html delete mode 100644 projects/account/src/app/device/preferences/preferences.component.ts diff --git a/projects/account/src/app/device/preferences/preferences.component.html b/projects/account/src/app/device/preferences/preferences.component.html deleted file mode 100644 index c4d0c83..0000000 --- a/projects/account/src/app/device/preferences/preferences.component.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - Basic Settings - - -
- Measurement System - - Imperial - Metric - -
-
- Time Format - - 12 Hour - 24 Hour - -
-
- Date Format - - DD/MM/YYYY - MM/DD/YYYY - -
-
-
- - - - Defaults - - - - - - - - - Advanced Settings - -
-
-

{{paragraph}}

-
- -
-
-
diff --git a/projects/account/src/app/device/preferences/preferences.component.ts b/projects/account/src/app/device/preferences/preferences.component.ts deleted file mode 100644 index 7964556..0000000 --- a/projects/account/src/app/device/preferences/preferences.component.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -import { AccountPrefrences, DeviceService } from '../device.service'; -import { Observable } from 'rxjs'; - -@Component({ - selector: 'account-device-preferences', - templateUrl: './preferences.component.html', - styleUrls: ['./preferences.component.scss'] -}) -export class PreferencesComponent implements OnInit { - public advancedSettingsDesc = [ - 'Mycroft Core can be further configured ' + - 'for development and experimentation purposes. Example configurations ' + - 'include text-to-speech technologies, speech-to-text technologies and ' + - 'wake word listeners.', - 'These advanced options can be managed by editing a configuration file ' + - 'on the device. Proceed with caution; a bad configuration file could ' + - 'render your device unusable.', - 'Follow the link below for documentation on the options available ' + - 'and how to edit them.' - ]; - public preferences$ = new Observable(); - - constructor(private deviceService: DeviceService) { } - - ngOnInit() { - this.preferences$ = this.deviceService.getAccountPreferences(); - } - -} From a10a2efa907a5f2957d49f86a2d4cf1dc2ffce08 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 15:14:37 -0500 Subject: [PATCH 092/163] fixed some issues with preferences editing --- .../device/device-add/device-add.component.ts | 2 +- .../src/app/modules/device/device.component.ts | 15 ++++++++++++--- .../device/preferences/preferences.component.html | 4 ++-- .../device/preferences/preferences.component.ts | 10 +++++++++- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.ts b/projects/account/src/app/modules/device/device-add/device-add.component.ts index 5c6a80e..f3dae56 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.ts +++ b/projects/account/src/app/modules/device/device-add/device-add.component.ts @@ -108,7 +108,7 @@ export class DeviceAddComponent implements OnInit { } onPreferencesSubmit() { - this.deviceService.addAccountPreferences(this.preferencesForm); + this.deviceService.addAccountPreferences(this.preferencesForm).subscribe(); } onDefaultsSubmit() { diff --git a/projects/account/src/app/modules/device/device.component.ts b/projects/account/src/app/modules/device/device.component.ts index c5002c2..bede745 100644 --- a/projects/account/src/app/modules/device/device.component.ts +++ b/projects/account/src/app/modules/device/device.component.ts @@ -41,9 +41,18 @@ export class DeviceComponent implements OnInit { ); this.preferencesForm = this.formBuilder.group( { - dateFormat: [null, Validators.required], - measurementSystem: [null, Validators.required], - timeFormat: [null, Validators.required], + dateFormat: [ + this.preferences ? this.preferences.dateFormat : null, + Validators.required + ], + measurementSystem: [ + this.preferences ? this.preferences.measurementSystem : null, + Validators.required + ], + timeFormat: [ + this.preferences ? this.preferences.timeFormat : null, + Validators.required + ], } ); diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.html b/projects/account/src/app/modules/device/preferences/preferences.component.html index fbf9eb8..0f1f023 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.html +++ b/projects/account/src/app/modules/device/preferences/preferences.component.html @@ -1,4 +1,4 @@ - + Setup your device preferences Manage your device preferences @@ -26,7 +26,7 @@ - + diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.ts b/projects/account/src/app/modules/device/preferences/preferences.component.ts index 88d68c5..dda8c84 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.ts +++ b/projects/account/src/app/modules/device/preferences/preferences.component.ts @@ -71,6 +71,14 @@ export class PreferencesComponent implements OnInit { } onSave() { - this.deviceService.updateAccountPreferences(this.preferencesForm); + if (this.preferences) { + this.deviceService.updateAccountPreferences(this.preferencesForm).subscribe( + () => { this.preferences = this.preferencesForm.value; } + ); + } else { + this.deviceService.addAccountPreferences(this.preferencesForm).subscribe( + () => { this.preferences = this.preferencesForm.value; } + ); + } } } From ad69d41e945616152a1c896b4150ea48a414113c Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 15:15:00 -0500 Subject: [PATCH 093/163] fixed some issues with preferences editing --- projects/account/src/app/core/http/device.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/account/src/app/core/http/device.service.ts b/projects/account/src/app/core/http/device.service.ts index 8d45490..17ba248 100644 --- a/projects/account/src/app/core/http/device.service.ts +++ b/projects/account/src/app/core/http/device.service.ts @@ -7,6 +7,7 @@ import { DeviceAttribute } from '../../shared/models/deviceAttribute.model'; import { FormGroup } from '@angular/forms'; import { AccountDefaults } from '../../shared/models/defaults.model'; import { subscribeOn } from 'rxjs/operators'; +import { Observable } from 'rxjs'; const defaultsUrl = '/api/defaults'; const deviceUrl = '/api/devices'; @@ -42,15 +43,15 @@ export class DeviceService { } addAccountPreferences(preferencesForm: FormGroup) { - this.http.post(preferencesUrl, preferencesForm.value).subscribe(); + return this.http.post(preferencesUrl, preferencesForm.value); } getAccountPreferences() { return this.http.get(preferencesUrl); } - updateAccountPreferences(preferencesForm: FormGroup): void { - this.http.patch(preferencesUrl, preferencesForm.value); + updateAccountPreferences(preferencesForm: FormGroup): Observable { + return this.http.patch(preferencesUrl, preferencesForm.value); } addAccountDefaults(defaultsForm: FormGroup) { From a3d31a3bdc5ae9f0b47dfe8517a70b853a2c3cb5 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 15:23:22 -0500 Subject: [PATCH 094/163] minor refactor --- .../app/modules/device/preferences/preferences.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.scss b/projects/account/src/app/modules/device/preferences/preferences.component.scss index 67f2004..75bff69 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.scss +++ b/projects/account/src/app/modules/device/preferences/preferences.component.scss @@ -13,7 +13,7 @@ mat-card { } #required-settings-card { - margin-top: 16px; + margin-top: 32px; button { @include action-button-primary; From 3e523eb37ab73d7a037d3fd64256b6c4034bc4ee Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 16:50:23 -0500 Subject: [PATCH 095/163] added default update functionality --- .../src/app/core/http/device.service.ts | 6 +++- .../device/device-add/device-add.component.ts | 2 +- .../device-edit/device-edit.component.html | 2 +- .../device-edit/device-edit.component.scss | 35 ++++++++++++------- .../device-edit/device-edit.component.ts | 18 ++++++++-- .../app/modules/device/device.component.ts | 12 +++---- 6 files changed, 51 insertions(+), 24 deletions(-) diff --git a/projects/account/src/app/core/http/device.service.ts b/projects/account/src/app/core/http/device.service.ts index 17ba248..f8179d3 100644 --- a/projects/account/src/app/core/http/device.service.ts +++ b/projects/account/src/app/core/http/device.service.ts @@ -55,7 +55,11 @@ export class DeviceService { } addAccountDefaults(defaultsForm: FormGroup) { - this.http.post(defaultsUrl, defaultsForm.value).subscribe(); + return this.http.post(defaultsUrl, defaultsForm.value); + } + + updateAccountDefaults(defaultsForm: FormGroup) { + return this.http.patch(defaultsUrl, defaultsForm.value); } getAccountDefaults() { diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.ts b/projects/account/src/app/modules/device/device-add/device-add.component.ts index f3dae56..e70d1b9 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.ts +++ b/projects/account/src/app/modules/device/device-add/device-add.component.ts @@ -112,6 +112,6 @@ export class DeviceAddComponent implements OnInit { } onDefaultsSubmit() { - this.deviceService.addAccountDefaults(this.defaultsForm); + this.deviceService.addAccountDefaults(this.defaultsForm).subscribe(); } } diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.html b/projects/account/src/app/modules/device/device-edit/device-edit.component.html index 3f20079..8a174ee 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.html +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.html @@ -98,7 +98,7 @@ - + diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.scss b/projects/account/src/app/modules/device/device-edit/device-edit.component.scss index 2f302c4..5cf9b10 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.scss +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.scss @@ -6,26 +6,35 @@ mat-card { @include section-card; max-width: 700px; + margin-bottom: 16px; + margin-top: 32px; mat-card-title { color: mat-color($mycroft-primary) } - .mat-h2 { - color: mat-color($mycroft-accent, A700); - margin-top: 32px; - } - - mat-form-field { - max-width: 280px; - } - - button { - @include action-button-primary; + mat-card-content { margin: 16px; - &:disabled { - background-color: mat-color($mycroft-accent, 200); + .mat-h2 { + color: mat-color($mycroft-accent, A700); + margin-top: 32px; + } + + mat-form-field { + max-width: 280px; + } + } + + mat-card-actions { + button { + @include action-button-primary; + margin-bottom: 16px; + margin-right: 16px; + + &:disabled { + background-color: mat-color($mycroft-accent, 200); + } } } } diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts index dbaa20f..ceeb0d2 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts @@ -2,13 +2,14 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; +import { AccountDefaults } from '../../../shared/models/defaults.model'; import { City } from '../../../shared/models/city.model'; import { Country } from '../../../shared/models/country.model'; +import { DeviceService } from '../../../core/http/device.service'; import { GeographyService } from '../../../core/http/geography_service'; import { OptionButtonsConfig } from '../../../shared/models/option-buttons-config.model'; import { Region } from '../../../shared/models/region.model'; import { Timezone } from '../../../shared/models/timezone.model'; -import { AccountDefaults } from '../../../shared/models/defaults.model'; @Component({ selector: 'account-device-edit', @@ -26,7 +27,7 @@ export class DeviceEditComponent implements OnInit { public voiceOptionsConfig: OptionButtonsConfig; public wakeWordOptionsConfig: OptionButtonsConfig; - constructor(private geoService: GeographyService) { + constructor(private deviceService: DeviceService, private geoService: GeographyService) { this.voiceOptionsConfig = { options: ['British Male', 'American Female', 'American Male', 'Google Voice'], buttonWidth: '140px' @@ -118,4 +119,17 @@ export class DeviceEditComponent implements OnInit { changeWakeWord(newValue: string) { this.deviceForm.patchValue({wakeWord: newValue}); } + + onSave() { + if (this.defaults) { + this.deviceService.updateAccountDefaults(this.deviceForm).subscribe( + () => { this.defaults = this.deviceForm.value; } + ); + } else { + this.deviceService.addAccountDefaults(this.deviceForm).subscribe( + () => { this.defaults = this.deviceForm.value; } + + ); + } + } } diff --git a/projects/account/src/app/modules/device/device.component.ts b/projects/account/src/app/modules/device/device.component.ts index bede745..76611b5 100644 --- a/projects/account/src/app/modules/device/device.component.ts +++ b/projects/account/src/app/modules/device/device.component.ts @@ -28,15 +28,15 @@ export class DeviceComponent implements OnInit { this.defaultsForm = this.formBuilder.group( { - city: [null], - country: [null], + city: [this.defaults ? this.defaults.city : null], + country: [this.defaults ? this.defaults.country : null], name: [null], pairingCode: [null], placement: [null], - region: [null], - timezone: [null], - wakeWord: [null], - voice: [null] + region: [this.defaults ? this.defaults.region : null], + timezone: [this.defaults ? this.defaults.timezone : null], + wakeWord: [this.defaults ? this.defaults.wakeWord : null], + voice: [this.defaults ? this.defaults.voice : null] } ); this.preferencesForm = this.formBuilder.group( From 68a2f993b97e22992bb00dac6ee3f66ebff35e08 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 23:18:36 -0500 Subject: [PATCH 096/163] added a couple of aliases to clean up the eternal '../../../../..' --- tsconfig.json | 84 +++++++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 6c6a98b..ec9ad54 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,41 +1,47 @@ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "module": "es2015", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "target": "es5", - "typeRoots": [ - "node_modules/@types" - ], - "lib": [ - "es2018", - "dom" - ], - "paths": { - "globalnav": [ - "dist/globalnav" - ], - "globalnav/*": [ - "dist/globalnav/*" - ], - "page-not-found": [ - "dist/page-not-found" - ], - "page-not-found/*": [ - "dist/page-not-found/*" - ], - "shared": [ - "dist/shared" - ], - "shared/*": [ - "dist/shared/*" - ] + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "es2015", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es5", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ], + "paths": { + "globalnav": [ + "dist/globalnav" + ], + "globalnav/*": [ + "dist/globalnav/*" + ], + "page-not-found": [ + "dist/page-not-found" + ], + "page-not-found/*": [ + "dist/page-not-found/*" + ], + "shared": [ + "dist/shared" + ], + "shared/*": [ + "dist/shared/*" + ], + "@account/http/*": [ + "projects/account/src/app/core/http/*" + ], + "@account/models/*": [ + "projects/account/src/app/shared/models/*" + ] + } } - } -} \ No newline at end of file +} From 06245845d3c2032b4f4e59a64358189cf0381da0 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 23:20:25 -0500 Subject: [PATCH 097/163] utilize new alias for models directory --- .../account/src/app/core/http/device.service.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/projects/account/src/app/core/http/device.service.ts b/projects/account/src/app/core/http/device.service.ts index f8179d3..af59857 100644 --- a/projects/account/src/app/core/http/device.service.ts +++ b/projects/account/src/app/core/http/device.service.ts @@ -1,12 +1,11 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { AccountPreferences } from '../../shared/models/preferences.model'; -import { Device } from '../../shared/models/device.model'; -import { DeviceAttribute } from '../../shared/models/deviceAttribute.model'; +import { AccountPreferences } from '@account/models/preferences.model'; +import { Device } from '@account/models/device.model'; +import { DeviceAttribute } from '@account/models/deviceAttribute.model'; import { FormGroup } from '@angular/forms'; -import { AccountDefaults } from '../../shared/models/defaults.model'; -import { subscribeOn } from 'rxjs/operators'; +import { AccountDefaults } from '@account/models/defaults.model'; import { Observable } from 'rxjs'; const defaultsUrl = '/api/defaults'; @@ -20,13 +19,6 @@ const wakeWordUrl = '/api/wake-words'; @Injectable({providedIn: 'root'}) export class DeviceService { - public devicePlacements: DeviceAttribute[] = [ - {id: '1', name: 'None', userDefined: true}, - {id: null, name: 'Bedroom', userDefined: true}, - {id: null, name: 'Kitchen', userDefined: true}, - {id: '2', name: 'Living Room', userDefined: false} - ]; - constructor(private http: HttpClient) { } From 1b7f18ae180aa139fa88f1c3eed7f42cc441b98e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 23:22:16 -0500 Subject: [PATCH 098/163] changed directory structure to reduce some confusion --- .../city-input/city-input.component.html | 0 .../city-input/city-input.component.scss | 0 .../input}/city-input/city-input.component.ts | 3 +- .../country-input.component.html | 0 .../country-input.component.scss | 0 .../country-input/country-input.component.ts | 4 +- .../region-input/region-input.component.html | 0 .../region-input/region-input.component.scss | 0 .../region-input/region-input.component.ts | 3 +- .../timezone-input.component.html | 0 .../timezone-input.component.scss | 0 .../timezone-input.component.ts | 3 +- .../view/defaults/defaults.component.html | 59 +++++++++++ .../view/defaults/defaults.component.scss | 40 ++++++++ .../view/defaults/defaults.component.ts | 97 +++++++++++++++++++ .../device-info/device-info.component.html | 70 +++++++++++++ .../device-info/device-info.component.scss} | 0 .../view/device-info/device-info.component.ts | 17 ++++ .../device-list/device-list.component.html | 16 +-- .../device-list/device-list.component.scss | 5 + .../device-list/device-list.component.ts | 18 ++-- .../preferences/preferences.component.html | 0 .../preferences/preferences.component.scss | 6 +- .../preferences/preferences.component.ts | 6 +- .../device-edit/device-edit.component.html | 2 +- .../device-edit/device-edit.component.ts | 21 +++- .../device-config.component.html | 12 --- .../device-config/device-config.component.ts | 18 ---- .../device-location.component.html | 15 --- .../device-location.component.scss | 3 - .../device-location.component.ts | 15 --- .../modules/device/device-routing.module.ts | 17 ++-- .../app/modules/device/device.component.scss | 1 - .../src/app/modules/device/device.module.ts | 28 +++--- .../devices/devices.component.html} | 2 +- .../pages/devices/devices.component.scss | 0 .../devices/devices.component.ts} | 12 +-- 37 files changed, 368 insertions(+), 125 deletions(-) rename projects/account/src/app/modules/device/{device-edit => components/input}/city-input/city-input.component.html (100%) rename projects/account/src/app/modules/device/{device-edit => components/input}/city-input/city-input.component.scss (100%) rename projects/account/src/app/modules/device/{device-edit => components/input}/city-input/city-input.component.ts (96%) rename projects/account/src/app/modules/device/{device-edit => components/input}/country-input/country-input.component.html (100%) rename projects/account/src/app/modules/device/{device-edit => components/input}/country-input/country-input.component.scss (100%) rename projects/account/src/app/modules/device/{device-edit => components/input}/country-input/country-input.component.ts (97%) rename projects/account/src/app/modules/device/{device-edit => components/input}/region-input/region-input.component.html (100%) rename projects/account/src/app/modules/device/{device-edit => components/input}/region-input/region-input.component.scss (100%) rename projects/account/src/app/modules/device/{device-edit => components/input}/region-input/region-input.component.ts (96%) rename projects/account/src/app/modules/device/{device-edit => components/input}/timezone-input/timezone-input.component.html (100%) rename projects/account/src/app/modules/device/{device-edit => components/input}/timezone-input/timezone-input.component.scss (100%) rename projects/account/src/app/modules/device/{device-edit => components/input}/timezone-input/timezone-input.component.ts (95%) create mode 100644 projects/account/src/app/modules/device/components/view/defaults/defaults.component.html create mode 100644 projects/account/src/app/modules/device/components/view/defaults/defaults.component.scss create mode 100644 projects/account/src/app/modules/device/components/view/defaults/defaults.component.ts create mode 100644 projects/account/src/app/modules/device/components/view/device-info/device-info.component.html rename projects/account/src/app/modules/device/{device-list/device-config/device-config.component.scss => components/view/device-info/device-info.component.scss} (100%) create mode 100644 projects/account/src/app/modules/device/components/view/device-info/device-info.component.ts rename projects/account/src/app/modules/device/{ => components/view}/device-list/device-list.component.html (59%) rename projects/account/src/app/modules/device/{ => components/view}/device-list/device-list.component.scss (94%) rename projects/account/src/app/modules/device/{ => components/view}/device-list/device-list.component.ts (77%) rename projects/account/src/app/modules/device/{ => components/view}/preferences/preferences.component.html (100%) rename projects/account/src/app/modules/device/{ => components/view}/preferences/preferences.component.scss (71%) rename projects/account/src/app/modules/device/{ => components/view}/preferences/preferences.component.ts (92%) delete mode 100644 projects/account/src/app/modules/device/device-list/device-config/device-config.component.html delete mode 100644 projects/account/src/app/modules/device/device-list/device-config/device-config.component.ts delete mode 100644 projects/account/src/app/modules/device/device-list/device-location/device-location.component.html delete mode 100644 projects/account/src/app/modules/device/device-list/device-location/device-location.component.scss delete mode 100644 projects/account/src/app/modules/device/device-list/device-location/device-location.component.ts delete mode 100644 projects/account/src/app/modules/device/device.component.scss rename projects/account/src/app/modules/device/{device.component.html => pages/devices/devices.component.html} (96%) create mode 100644 projects/account/src/app/modules/device/pages/devices/devices.component.scss rename projects/account/src/app/modules/device/{device.component.ts => pages/devices/devices.component.ts} (85%) diff --git a/projects/account/src/app/modules/device/device-edit/city-input/city-input.component.html b/projects/account/src/app/modules/device/components/input/city-input/city-input.component.html similarity index 100% rename from projects/account/src/app/modules/device/device-edit/city-input/city-input.component.html rename to projects/account/src/app/modules/device/components/input/city-input/city-input.component.html diff --git a/projects/account/src/app/modules/device/device-edit/city-input/city-input.component.scss b/projects/account/src/app/modules/device/components/input/city-input/city-input.component.scss similarity index 100% rename from projects/account/src/app/modules/device/device-edit/city-input/city-input.component.scss rename to projects/account/src/app/modules/device/components/input/city-input/city-input.component.scss diff --git a/projects/account/src/app/modules/device/device-edit/city-input/city-input.component.ts b/projects/account/src/app/modules/device/components/input/city-input/city-input.component.ts similarity index 96% rename from projects/account/src/app/modules/device/device-edit/city-input/city-input.component.ts rename to projects/account/src/app/modules/device/components/input/city-input/city-input.component.ts index e957b7b..00e4a60 100644 --- a/projects/account/src/app/modules/device/device-edit/city-input/city-input.component.ts +++ b/projects/account/src/app/modules/device/components/input/city-input/city-input.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Observable } from 'rxjs'; import { startWith, map, tap} from 'rxjs/operators'; -import { City } from '../../../../shared/models/city.model'; +import { City } from '../../../../../shared/models/city.model'; import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; @Component({ @@ -24,6 +24,7 @@ export class CityInputComponent implements OnInit { ngOnInit() { this.cityControl = this.deviceForm.controls['city']; + this.cityControl.disable(); } getCities() { diff --git a/projects/account/src/app/modules/device/device-edit/country-input/country-input.component.html b/projects/account/src/app/modules/device/components/input/country-input/country-input.component.html similarity index 100% rename from projects/account/src/app/modules/device/device-edit/country-input/country-input.component.html rename to projects/account/src/app/modules/device/components/input/country-input/country-input.component.html diff --git a/projects/account/src/app/modules/device/device-edit/country-input/country-input.component.scss b/projects/account/src/app/modules/device/components/input/country-input/country-input.component.scss similarity index 100% rename from projects/account/src/app/modules/device/device-edit/country-input/country-input.component.scss rename to projects/account/src/app/modules/device/components/input/country-input/country-input.component.scss diff --git a/projects/account/src/app/modules/device/device-edit/country-input/country-input.component.ts b/projects/account/src/app/modules/device/components/input/country-input/country-input.component.ts similarity index 97% rename from projects/account/src/app/modules/device/device-edit/country-input/country-input.component.ts rename to projects/account/src/app/modules/device/components/input/country-input/country-input.component.ts index 06025a8..7a731f9 100644 --- a/projects/account/src/app/modules/device/device-edit/country-input/country-input.component.ts +++ b/projects/account/src/app/modules/device/components/input/country-input/country-input.component.ts @@ -1,9 +1,9 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; import { map, startWith, tap } from 'rxjs/operators'; -import { Country } from '../../../../shared/models/country.model'; +import { Country } from '@account/models/country.model'; import { Observable } from 'rxjs'; -import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; @Component({ selector: 'account-country-input', diff --git a/projects/account/src/app/modules/device/device-edit/region-input/region-input.component.html b/projects/account/src/app/modules/device/components/input/region-input/region-input.component.html similarity index 100% rename from projects/account/src/app/modules/device/device-edit/region-input/region-input.component.html rename to projects/account/src/app/modules/device/components/input/region-input/region-input.component.html diff --git a/projects/account/src/app/modules/device/device-edit/region-input/region-input.component.scss b/projects/account/src/app/modules/device/components/input/region-input/region-input.component.scss similarity index 100% rename from projects/account/src/app/modules/device/device-edit/region-input/region-input.component.scss rename to projects/account/src/app/modules/device/components/input/region-input/region-input.component.scss diff --git a/projects/account/src/app/modules/device/device-edit/region-input/region-input.component.ts b/projects/account/src/app/modules/device/components/input/region-input/region-input.component.ts similarity index 96% rename from projects/account/src/app/modules/device/device-edit/region-input/region-input.component.ts rename to projects/account/src/app/modules/device/components/input/region-input/region-input.component.ts index f5b6d31..2447ff1 100644 --- a/projects/account/src/app/modules/device/device-edit/region-input/region-input.component.ts +++ b/projects/account/src/app/modules/device/components/input/region-input/region-input.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { map, startWith, tap } from 'rxjs/operators'; -import { Region } from '../../../../shared/models/region.model'; +import { Region } from '../../../../../shared/models/region.model'; import { Observable } from 'rxjs'; import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; @@ -22,6 +22,7 @@ export class RegionInputComponent implements OnInit { ngOnInit() { this.regionControl = this.deviceForm.controls['region']; + this.regionControl.disable(); } getRegions() { diff --git a/projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.html b/projects/account/src/app/modules/device/components/input/timezone-input/timezone-input.component.html similarity index 100% rename from projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.html rename to projects/account/src/app/modules/device/components/input/timezone-input/timezone-input.component.html diff --git a/projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.scss b/projects/account/src/app/modules/device/components/input/timezone-input/timezone-input.component.scss similarity index 100% rename from projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.scss rename to projects/account/src/app/modules/device/components/input/timezone-input/timezone-input.component.scss diff --git a/projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.ts b/projects/account/src/app/modules/device/components/input/timezone-input/timezone-input.component.ts similarity index 95% rename from projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.ts rename to projects/account/src/app/modules/device/components/input/timezone-input/timezone-input.component.ts index 0e62df1..22b063d 100644 --- a/projects/account/src/app/modules/device/device-edit/timezone-input/timezone-input.component.ts +++ b/projects/account/src/app/modules/device/components/input/timezone-input/timezone-input.component.ts @@ -3,7 +3,7 @@ import { AbstractControl, FormGroup, ValidatorFn } from '@angular/forms'; import { Observable } from 'rxjs'; import { startWith, map, tap } from 'rxjs/operators'; -import { Timezone } from '../../../../shared/models/timezone.model'; +import { Timezone } from '../../../../../shared/models/timezone.model'; @Component({ selector: 'account-timezone-input', @@ -22,6 +22,7 @@ export class TimezoneInputComponent implements OnInit { ngOnInit(): void { this.timezoneControl = this.deviceForm.controls['timezone']; + this.timezoneControl.disable(); } getTimezones() { diff --git a/projects/account/src/app/modules/device/components/view/defaults/defaults.component.html b/projects/account/src/app/modules/device/components/view/defaults/defaults.component.html new file mode 100644 index 0000000..6644e1d --- /dev/null +++ b/projects/account/src/app/modules/device/components/view/defaults/defaults.component.html @@ -0,0 +1,59 @@ + + Setup your device defaults + Manage your device defaults + + +

Optional values used as defaults during device setup.

+ +

Geographical Location

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

Voice

+ + + +

Wake Word

+ + +
+ + + +
+ diff --git a/projects/account/src/app/modules/device/components/view/defaults/defaults.component.scss b/projects/account/src/app/modules/device/components/view/defaults/defaults.component.scss new file mode 100644 index 0000000..5cf9b10 --- /dev/null +++ b/projects/account/src/app/modules/device/components/view/defaults/defaults.component.scss @@ -0,0 +1,40 @@ +@import "~@angular/material/theming"; +@import "mycroft-colors"; +@import "components/buttons"; +@import "components/cards"; + +mat-card { + @include section-card; + max-width: 700px; + margin-bottom: 16px; + margin-top: 32px; + + mat-card-title { + color: mat-color($mycroft-primary) + } + + mat-card-content { + margin: 16px; + + .mat-h2 { + color: mat-color($mycroft-accent, A700); + margin-top: 32px; + } + + mat-form-field { + max-width: 280px; + } + } + + mat-card-actions { + button { + @include action-button-primary; + margin-bottom: 16px; + margin-right: 16px; + + &:disabled { + background-color: mat-color($mycroft-accent, 200); + } + } + } +} diff --git a/projects/account/src/app/modules/device/components/view/defaults/defaults.component.ts b/projects/account/src/app/modules/device/components/view/defaults/defaults.component.ts new file mode 100644 index 0000000..f5d5a52 --- /dev/null +++ b/projects/account/src/app/modules/device/components/view/defaults/defaults.component.ts @@ -0,0 +1,97 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { Observable } from 'rxjs'; + +import { City } from '@account/models/city.model'; +import { Country } from '@account/models/country.model'; +import { DeviceService } from '@account/http/device.service'; +import { GeographyService } from '@account/http/geography_service'; +import { OptionButtonsConfig } from '@account/models/option-buttons-config.model'; +import { Region } from '@account/models/region.model'; +import { Timezone } from '@account/models/timezone.model'; + +@Component({ + selector: 'account-defaults', + templateUrl: './defaults.component.html', + styleUrls: ['./defaults.component.scss'] +}) +export class DefaultsComponent implements OnInit { + @Input() deviceSetup: boolean; + public cities$ = new Observable(); + public countries$ = new Observable(); + @Input() defaultsForm: FormGroup; + public regions$ = new Observable(); + public timezones$ = new Observable(); + public voiceOptionsConfig: OptionButtonsConfig; + public wakeWordOptionsConfig: OptionButtonsConfig; + + constructor( + private deviceService: DeviceService, + private formBuilder: FormBuilder, + private geoService: GeographyService + ) { + this.voiceOptionsConfig = { + options: ['British Male', 'American Female', 'American Male', 'Google Voice'], + buttonWidth: '140px' + }; + this.wakeWordOptionsConfig = { + options: ['Hey Mycroft', 'Christopher', 'Hey Ezra', 'Hey Jarvis'], + buttonWidth: '130px' + }; + this.defaultsForm = this.formBuilder.group( + { + name: [null] + } + ); + } + + ngOnInit() { + this.countries$ = this.geoService.getCountries(); + } + + onCountrySelect(selectedCountry: Country): void { + if (selectedCountry) { + this.defaultsForm.controls['region'].enable(); + this.defaultsForm.controls['timezone'].enable(); + this.regions$ = this.geoService.getRegionsByCountry(selectedCountry); + this.timezones$ = this.geoService.getTimezonesByCountry(selectedCountry); + } else { + this.defaultsForm.controls['region'].disable(); + this.defaultsForm.controls['region'].setValue(''); + this.defaultsForm.controls['timezone'].disable(); + this.defaultsForm.controls['timezone'].setValue(''); + } + } + + onRegionSelect(selectedRegion: Region): void { + if (selectedRegion) { + this.defaultsForm.controls['city'].enable(); + this.cities$ = this.geoService.getCitiesByRegion(selectedRegion); + } else { + this.defaultsForm.controls['city'].disable(); + this.defaultsForm.controls['city'].setValue(''); + } + } + + onCitySelect(selectedCity: City): void { + if (selectedCity) { + this.defaultsForm.controls['timezone'].setValue(selectedCity.timezone); + } + } + + changeVoice(newValue: string) { + this.defaultsForm.patchValue({voice: newValue}); + } + + changeWakeWord(newValue: string) { + this.defaultsForm.patchValue({wakeWord: newValue}); + } + + onSave() { + if (this.deviceSetup) { + this.deviceService.addAccountDefaults(this.defaultsForm).subscribe(); + } else { + this.deviceService.updateAccountDefaults(this.defaultsForm).subscribe(); + } + } +} diff --git a/projects/account/src/app/modules/device/components/view/device-info/device-info.component.html b/projects/account/src/app/modules/device/components/view/device-info/device-info.component.html new file mode 100644 index 0000000..a8f7408 --- /dev/null +++ b/projects/account/src/app/modules/device/components/view/device-info/device-info.component.html @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Placement + + e.g. Kitchen, Bedroom, Office + + + + diff --git a/projects/account/src/app/modules/device/device-list/device-config/device-config.component.scss b/projects/account/src/app/modules/device/components/view/device-info/device-info.component.scss similarity index 100% rename from projects/account/src/app/modules/device/device-list/device-config/device-config.component.scss rename to projects/account/src/app/modules/device/components/view/device-info/device-info.component.scss diff --git a/projects/account/src/app/modules/device/components/view/device-info/device-info.component.ts b/projects/account/src/app/modules/device/components/view/device-info/device-info.component.ts new file mode 100644 index 0000000..e3cd3e4 --- /dev/null +++ b/projects/account/src/app/modules/device/components/view/device-info/device-info.component.ts @@ -0,0 +1,17 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { Device } from '@account/models/device.model'; + +@Component({ + selector: 'account-device-info', + templateUrl: './device-info.component.html', + styleUrls: ['./device-info.component.scss'] +}) +export class DeviceInfoComponent implements OnInit { + @Input() device: Device; + + constructor() { } + + ngOnInit() { + } + +} diff --git a/projects/account/src/app/modules/device/device-list/device-list.component.html b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.html similarity index 59% rename from projects/account/src/app/modules/device/device-list/device-list.component.html rename to projects/account/src/app/modules/device/components/view/device-list/device-list.component.html index 2eb488f..e2153d5 100644 --- a/projects/account/src/app/modules/device/device-list/device-list.component.html +++ b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.html @@ -10,24 +10,12 @@ {{device.name}} - - - - - - - - - - + - diff --git a/projects/account/src/app/modules/device/device-list/device-list.component.scss b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.scss similarity index 94% rename from projects/account/src/app/modules/device/device-list/device-list.component.scss rename to projects/account/src/app/modules/device/components/view/device-list/device-list.component.scss index aba1ba2..3d4ca31 100644 --- a/projects/account/src/app/modules/device/device-list/device-list.component.scss +++ b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.scss @@ -60,6 +60,11 @@ mat-card { mat-tab-group { height: 280px; + + mat-card-content { + margin-top: 32px; + } + } } diff --git a/projects/account/src/app/modules/device/device-list/device-list.component.ts b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.ts similarity index 77% rename from projects/account/src/app/modules/device/device-list/device-list.component.ts rename to projects/account/src/app/modules/device/components/view/device-list/device-list.component.ts index 5524599..5ca3cfd 100644 --- a/projects/account/src/app/modules/device/device-list/device-list.component.ts +++ b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.ts @@ -1,12 +1,12 @@ import { Component, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { faPlus } from '@fortawesome/free-solid-svg-icons'; -import { DeviceService } from '../../../core/http/device.service'; -import { Device} from '../../../shared/models/device.model'; -import { RemoveComponent } from '../remove/remove.component'; +import { DeviceService } from '../../../../../core/http/device.service'; +import { Device } from '@account/models/device.model'; +import { RemoveComponent } from '../../../remove/remove.component'; @Component({ selector: 'account-device-list', @@ -27,7 +27,8 @@ export class DeviceListComponent implements OnInit { constructor( public dialog: MatDialog, private deviceService: DeviceService, - private route: ActivatedRoute + private route: ActivatedRoute, + private router: Router ) { } ngOnInit() { @@ -36,7 +37,7 @@ export class DeviceListComponent implements OnInit { ); } - onRemovalClick (device: Device) { + onRemovalClick(device: Device) { const removalDialogRef = this.dialog.open(RemoveComponent, {data: false}); this.selectedDevice = device; removalDialogRef.afterClosed().subscribe( @@ -46,6 +47,11 @@ export class DeviceListComponent implements OnInit { ); } + onDeviceEdit(device: Device) { + this.deviceService.selectedDevice = device; + this.router.navigate(['/devices', device.id]); + } + getPlatform(device: Device) { const knownPlatform = this.platforms[device.platform]; return knownPlatform ? knownPlatform.displayName : device.platform; diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.html b/projects/account/src/app/modules/device/components/view/preferences/preferences.component.html similarity index 100% rename from projects/account/src/app/modules/device/preferences/preferences.component.html rename to projects/account/src/app/modules/device/components/view/preferences/preferences.component.html diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.scss b/projects/account/src/app/modules/device/components/view/preferences/preferences.component.scss similarity index 71% rename from projects/account/src/app/modules/device/preferences/preferences.component.scss rename to projects/account/src/app/modules/device/components/view/preferences/preferences.component.scss index 75bff69..d1dd584 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.scss +++ b/projects/account/src/app/modules/device/components/view/preferences/preferences.component.scss @@ -1,7 +1,7 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "components/buttons"; -@import "components/cards"; +@import "../../../../../../../../../src/stylesheets/components/buttons"; +@import "../../../../../../../../../src/stylesheets/components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/modules/device/preferences/preferences.component.ts b/projects/account/src/app/modules/device/components/view/preferences/preferences.component.ts similarity index 92% rename from projects/account/src/app/modules/device/preferences/preferences.component.ts rename to projects/account/src/app/modules/device/components/view/preferences/preferences.component.ts index dda8c84..5255cf6 100644 --- a/projects/account/src/app/modules/device/preferences/preferences.component.ts +++ b/projects/account/src/app/modules/device/components/view/preferences/preferences.component.ts @@ -1,9 +1,9 @@ import { Component, OnInit, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { AccountPreferences } from '../../../shared/models/preferences.model'; -import { DeviceService } from '../../../core/http/device.service'; -import { OptionButtonsConfig } from '../../../shared/models/option-buttons-config.model'; +import { AccountPreferences } from '@account/models/preferences.model'; +import { DeviceService } from '../../../../../core/http/device.service'; +import { OptionButtonsConfig } from '@account/models/option-buttons-config.model'; @Component({ selector: 'account-device-preferences', diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.html b/projects/account/src/app/modules/device/device-edit/device-edit.component.html index 8a174ee..bd90c9e 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.html +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.html @@ -11,7 +11,7 @@ Setup your device defaults Manage your device defaults Configure your new device - Change device configuration + Change device configuration diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts index ceeb0d2..1147140 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; import { AccountDefaults } from '../../../shared/models/defaults.model'; @@ -27,7 +27,11 @@ export class DeviceEditComponent implements OnInit { public voiceOptionsConfig: OptionButtonsConfig; public wakeWordOptionsConfig: OptionButtonsConfig; - constructor(private deviceService: DeviceService, private geoService: GeographyService) { + constructor( + private deviceService: DeviceService, + private formBuilder: FormBuilder, + private geoService: GeographyService + ) { this.voiceOptionsConfig = { options: ['British Male', 'American Female', 'American Male', 'Google Voice'], buttonWidth: '140px' @@ -36,9 +40,22 @@ export class DeviceEditComponent implements OnInit { options: ['Hey Mycroft', 'Christopher', 'Hey Ezra', 'Hey Jarvis'], buttonWidth: '130px' }; + this.deviceForm = this.formBuilder.group( + { + name: [null] + } + ); } ngOnInit() { + console.log(this.deviceService.selectedDevice); + // if (!this.deviceForm) { + // this.deviceForm = this.formBuilder.group( + // { + // name: [this.deviceService.selectedDevice.name] + // } + // ); + // } // Disable the controls that depend on other control values to be pre-populated. this.deviceForm.controls['region'].disable(); this.deviceForm.controls['city'].disable(); diff --git a/projects/account/src/app/modules/device/device-list/device-config/device-config.component.html b/projects/account/src/app/modules/device/device-list/device-config/device-config.component.html deleted file mode 100644 index 2897c44..0000000 --- a/projects/account/src/app/modules/device/device-list/device-config/device-config.component.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/projects/account/src/app/modules/device/device-list/device-config/device-config.component.ts b/projects/account/src/app/modules/device/device-list/device-config/device-config.component.ts deleted file mode 100644 index 7a0a9ca..0000000 --- a/projects/account/src/app/modules/device/device-list/device-config/device-config.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; - -import { Device } from '../../../../shared/models/device.model'; - -@Component({ - selector: 'account-device-config', - templateUrl: './device-config.component.html', - styleUrls: ['./device-config.component.scss'] -}) -export class DeviceConfigComponent implements OnInit { - @Input() device: Device; - - constructor() { } - - ngOnInit() { - } - -} diff --git a/projects/account/src/app/modules/device/device-list/device-location/device-location.component.html b/projects/account/src/app/modules/device/device-list/device-location/device-location.component.html deleted file mode 100644 index e1e09f6..0000000 --- a/projects/account/src/app/modules/device/device-list/device-location/device-location.component.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - Placement - - e.g. Kitchen, Bedroom, Office - - diff --git a/projects/account/src/app/modules/device/device-list/device-location/device-location.component.scss b/projects/account/src/app/modules/device/device-list/device-location/device-location.component.scss deleted file mode 100644 index db53c73..0000000 --- a/projects/account/src/app/modules/device/device-list/device-location/device-location.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -mat-card-content { - margin-top: 32px; -} diff --git a/projects/account/src/app/modules/device/device-list/device-location/device-location.component.ts b/projects/account/src/app/modules/device/device-list/device-location/device-location.component.ts deleted file mode 100644 index 58b4ded..0000000 --- a/projects/account/src/app/modules/device/device-list/device-location/device-location.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, Input } from '@angular/core'; - -import { Geography } from '../../../../shared/models/geography.model'; - -@Component({ - selector: 'account-device-location', - templateUrl: './device-location.component.html', - styleUrls: ['./device-location.component.scss'] -}) -export class DeviceLocationComponent { - @Input() geography: Geography; - @Input() placement: string; - - constructor() { } -} diff --git a/projects/account/src/app/modules/device/device-routing.module.ts b/projects/account/src/app/modules/device/device-routing.module.ts index 94ed7d4..38743f1 100644 --- a/projects/account/src/app/modules/device/device-routing.module.ts +++ b/projects/account/src/app/modules/device/device-routing.module.ts @@ -1,16 +1,17 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { DeviceAddComponent } from './device-add/device-add.component'; -import { DeviceComponent} from './device.component'; -import { PreferencesResolverService } from '../../core/guards/preferences-resolver.service'; -import { DeviceResolverService } from '../../core/guards/device-resolver.service'; import { DefaultsResolverService } from '../../core/guards/defaults-resolver.service'; +import { DeviceAddComponent } from './device-add/device-add.component'; +import { DevicesComponent } from './pages/devices/devices.component'; +import { DeviceEditComponent } from './device-edit/device-edit.component'; +import { DeviceResolverService } from '../../core/guards/device-resolver.service'; +import { PreferencesResolverService } from '../../core/guards/preferences-resolver.service'; const deviceRoutes: Routes = [ { path: 'devices', - component: DeviceComponent, + component: DevicesComponent, resolve: { defaults: DefaultsResolverService, devices: DeviceResolverService, @@ -24,7 +25,11 @@ const deviceRoutes: Routes = [ defaults: DefaultsResolverService, preferences: PreferencesResolverService } -} + }, + { + path: 'devices/:device_id', + component: DeviceEditComponent, + } ]; @NgModule({ diff --git a/projects/account/src/app/modules/device/device.component.scss b/projects/account/src/app/modules/device/device.component.scss deleted file mode 100644 index 8b13789..0000000 --- a/projects/account/src/app/modules/device/device.component.scss +++ /dev/null @@ -1 +0,0 @@ - diff --git a/projects/account/src/app/modules/device/device.module.ts b/projects/account/src/app/modules/device/device.module.ts index 8cbebc2..e5149a0 100644 --- a/projects/account/src/app/modules/device/device.module.ts +++ b/projects/account/src/app/modules/device/device.module.ts @@ -18,38 +18,38 @@ import { import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { DeviceComponent } from './device.component'; import { DeviceRoutingModule } from './device-routing.module'; -import { DeviceService } from '../../core/http/device.service'; -import { PreferencesComponent } from './preferences/preferences.component'; +import { DeviceService } from '@account/http/device.service'; +import { PreferencesComponent } from './components/view/preferences/preferences.component'; import { RemoveComponent } from './remove/remove.component'; import { SharedModule } from '../../shared/shared.module'; import { DeviceAddComponent } from './device-add/device-add.component'; -import { DeviceListComponent } from './device-list/device-list.component'; -import { DeviceConfigComponent } from './device-list/device-config/device-config.component'; -import { DeviceLocationComponent } from './device-list/device-location/device-location.component'; +import { DeviceListComponent } from './components/view/device-list/device-list.component'; import { DeviceEditComponent } from './device-edit/device-edit.component'; -import { CityInputComponent } from './device-edit/city-input/city-input.component'; -import { CountryInputComponent } from './device-edit/country-input/country-input.component'; -import { RegionInputComponent } from './device-edit/region-input/region-input.component'; -import { TimezoneInputComponent } from './device-edit/timezone-input/timezone-input.component'; +import { CityInputComponent } from './components/input/city-input/city-input.component'; +import { CountryInputComponent } from './components/input/country-input/country-input.component'; +import { RegionInputComponent } from './components/input/region-input/region-input.component'; +import { TimezoneInputComponent } from './components/input/timezone-input/timezone-input.component'; import { AddCompleteComponent } from './device-add/add-complete/add-complete.component'; +import { DevicesComponent } from './pages/devices/devices.component'; +import { DeviceInfoComponent } from './components/view/device-info/device-info.component'; +import { DefaultsComponent } from './components/view/defaults/defaults.component'; @NgModule({ declarations: [ - DeviceComponent, DeviceListComponent, RemoveComponent, PreferencesComponent, DeviceAddComponent, - DeviceLocationComponent, DeviceEditComponent, - DeviceConfigComponent, CityInputComponent, CountryInputComponent, RegionInputComponent, TimezoneInputComponent, - AddCompleteComponent + AddCompleteComponent, + DevicesComponent, + DeviceInfoComponent, + DefaultsComponent, ], entryComponents: [ DeviceAddComponent, diff --git a/projects/account/src/app/modules/device/device.component.html b/projects/account/src/app/modules/device/pages/devices/devices.component.html similarity index 96% rename from projects/account/src/app/modules/device/device.component.html rename to projects/account/src/app/modules/device/pages/devices/devices.component.html index 3543a6c..cc20723 100644 --- a/projects/account/src/app/modules/device/device.component.html +++ b/projects/account/src/app/modules/device/pages/devices/devices.component.html @@ -1,4 +1,4 @@ - +
diff --git a/projects/account/src/app/modules/device/pages/devices/devices.component.scss b/projects/account/src/app/modules/device/pages/devices/devices.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/projects/account/src/app/modules/device/device.component.ts b/projects/account/src/app/modules/device/pages/devices/devices.component.ts similarity index 85% rename from projects/account/src/app/modules/device/device.component.ts rename to projects/account/src/app/modules/device/pages/devices/devices.component.ts index 76611b5..7b046d4 100644 --- a/projects/account/src/app/modules/device/device.component.ts +++ b/projects/account/src/app/modules/device/pages/devices/devices.component.ts @@ -1,15 +1,15 @@ import { Component, OnInit } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; -import { AccountDefaults } from '../../shared/models/defaults.model'; -import { AccountPreferences } from '../../shared/models/preferences.model'; +import { AccountDefaults } from '@account/models/defaults.model'; +import { AccountPreferences } from '@account/models/preferences.model'; @Component({ - selector: 'account-device', - templateUrl: './device.component.html', - styleUrls: ['./device.component.scss'] + selector: 'account-devices', + templateUrl: './devices.component.html', + styleUrls: ['./devices.component.scss'] }) -export class DeviceComponent implements OnInit { +export class DevicesComponent implements OnInit { defaults: AccountDefaults; defaultsForm: FormGroup; preferences: AccountPreferences; From feb689dcb5505fcc00a4e8585a2632e4fa8fe245 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 23:37:56 -0500 Subject: [PATCH 099/163] fixed compile error --- .../components/view/device-list/device-list.component.ts | 3 +-- .../app/modules/device/device-edit/device-edit.component.ts | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/projects/account/src/app/modules/device/components/view/device-list/device-list.component.ts b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.ts index 5ca3cfd..a4ecb7d 100644 --- a/projects/account/src/app/modules/device/components/view/device-list/device-list.component.ts +++ b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.ts @@ -4,7 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { faPlus } from '@fortawesome/free-solid-svg-icons'; -import { DeviceService } from '../../../../../core/http/device.service'; +import { DeviceService } from '@account/http/device.service'; import { Device } from '@account/models/device.model'; import { RemoveComponent } from '../../../remove/remove.component'; @@ -48,7 +48,6 @@ export class DeviceListComponent implements OnInit { } onDeviceEdit(device: Device) { - this.deviceService.selectedDevice = device; this.router.navigate(['/devices', device.id]); } diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts index 1147140..fc16525 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts @@ -48,7 +48,6 @@ export class DeviceEditComponent implements OnInit { } ngOnInit() { - console.log(this.deviceService.selectedDevice); // if (!this.deviceForm) { // this.deviceForm = this.formBuilder.group( // { From c823e0504a872e35657df1e86970ae9b675b8fd9 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Thu, 21 Mar 2019 23:38:16 -0500 Subject: [PATCH 100/163] removed commented code --- .../src/app/modules/device/pages/devices/devices.component.html | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/account/src/app/modules/device/pages/devices/devices.component.html b/projects/account/src/app/modules/device/pages/devices/devices.component.html index cc20723..acc79ad 100644 --- a/projects/account/src/app/modules/device/pages/devices/devices.component.html +++ b/projects/account/src/app/modules/device/pages/devices/devices.component.html @@ -1,4 +1,3 @@ -
From 15d5ca4b39f882a85ad16546851bf9731999092c Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 00:27:02 -0500 Subject: [PATCH 101/163] updated voice and wake word models to contain what is sent from the server --- .../app/modules/device/device-edit/device-edit.component.ts | 2 +- projects/account/src/app/shared/models/voice.model.ts | 1 + projects/account/src/app/shared/models/wake-word.model.ts | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts index fc16525..afde2ec 100644 --- a/projects/account/src/app/modules/device/device-edit/device-edit.component.ts +++ b/projects/account/src/app/modules/device/device-edit/device-edit.component.ts @@ -93,7 +93,7 @@ export class DeviceEditComponent implements OnInit { } if (this.defaults.wakeWord) { this.deviceForm.controls['wakeWord'].setValue( - this.defaults.wakeWord.wakeWord + this.defaults.wakeWord.displayName ); } } diff --git a/projects/account/src/app/shared/models/voice.model.ts b/projects/account/src/app/shared/models/voice.model.ts index d62433e..1ac26dc 100644 --- a/projects/account/src/app/shared/models/voice.model.ts +++ b/projects/account/src/app/shared/models/voice.model.ts @@ -1,4 +1,5 @@ export interface Voice { id: string; displayName: string; + settingName: string; } diff --git a/projects/account/src/app/shared/models/wake-word.model.ts b/projects/account/src/app/shared/models/wake-word.model.ts index ea93545..6ae7a94 100644 --- a/projects/account/src/app/shared/models/wake-word.model.ts +++ b/projects/account/src/app/shared/models/wake-word.model.ts @@ -1,4 +1,5 @@ export interface WakeWord { id: string; - wakeWord: string; + displayName: string; + settingName: string; } From b32cf46a96983fa3d014cb5e325b9d5619a4959c Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 00:29:02 -0500 Subject: [PATCH 102/163] applied new directory structure to device add page --- .../add-complete/add-complete.component.html | 0 .../add-complete/add-complete.component.scss | 2 +- .../add-complete/add-complete.component.ts | 0 .../device-add/pairing/pairing.component.html | 17 ----------------- .../device-add/pairing/pairing.component.scss | 12 ------------ .../device-add/pairing/pairing.component.ts | 17 ----------------- .../app/modules/device/device-routing.module.ts | 2 +- .../src/app/modules/device/device.module.ts | 4 ++-- .../device-add/device-add.component.html | 0 .../device-add/device-add.component.scss | 4 ++-- .../device-add/device-add.component.ts | 6 +++--- .../device/pages/devices/devices.component.ts | 12 ++++++------ 12 files changed, 15 insertions(+), 61 deletions(-) rename projects/account/src/app/modules/device/{device-add => components/view}/add-complete/add-complete.component.html (100%) rename projects/account/src/app/modules/device/{device-add => components/view}/add-complete/add-complete.component.scss (79%) rename projects/account/src/app/modules/device/{device-add => components/view}/add-complete/add-complete.component.ts (100%) delete mode 100644 projects/account/src/app/modules/device/device-add/pairing/pairing.component.html delete mode 100644 projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss delete mode 100644 projects/account/src/app/modules/device/device-add/pairing/pairing.component.ts rename projects/account/src/app/modules/device/{ => pages}/device-add/device-add.component.html (100%) rename projects/account/src/app/modules/device/{ => pages}/device-add/device-add.component.scss (63%) rename projects/account/src/app/modules/device/{ => pages}/device-add/device-add.component.ts (94%) diff --git a/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.html b/projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.html similarity index 100% rename from projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.html rename to projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.html diff --git a/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.scss b/projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.scss similarity index 79% rename from projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.scss rename to projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.scss index 796e677..c108be6 100644 --- a/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.scss +++ b/projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.scss @@ -1,4 +1,4 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; mat-card { diff --git a/projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.ts b/projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.ts similarity index 100% rename from projects/account/src/app/modules/device/device-add/add-complete/add-complete.component.ts rename to projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.ts diff --git a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html deleted file mode 100644 index cc0f92b..0000000 --- a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.html +++ /dev/null @@ -1,17 +0,0 @@ - - Verify your pairing code - -

Enter the code spoken by your device:

- - Pairing Code - - Six alphanumeric characters - -
-
diff --git a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss deleted file mode 100644 index ae64f5c..0000000 --- a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -@import "~@angular/material/theming"; -@import "mycroft-colors"; - -mat-card { - margin-left: auto; - margin-right: auto; - max-width: 300px; - - mat-card-title { - color: mat-color($mycroft-primary) - } -} diff --git a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.ts b/projects/account/src/app/modules/device/device-add/pairing/pairing.component.ts deleted file mode 100644 index 34e084f..0000000 --- a/projects/account/src/app/modules/device/device-add/pairing/pairing.component.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { AbstractControl } from '@angular/forms'; - -@Component({ - selector: 'account-device-pairing', - templateUrl: './pairing.component.html', - styleUrls: ['./pairing.component.scss'] -}) -export class PairingComponent implements OnInit { - @Input() pairingCodeControl: AbstractControl; - - constructor() { } - - ngOnInit() { - } - -} diff --git a/projects/account/src/app/modules/device/device-routing.module.ts b/projects/account/src/app/modules/device/device-routing.module.ts index 38743f1..c4151ce 100644 --- a/projects/account/src/app/modules/device/device-routing.module.ts +++ b/projects/account/src/app/modules/device/device-routing.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { DefaultsResolverService } from '../../core/guards/defaults-resolver.service'; -import { DeviceAddComponent } from './device-add/device-add.component'; +import { DeviceAddComponent } from './pages/device-add/device-add.component'; import { DevicesComponent } from './pages/devices/devices.component'; import { DeviceEditComponent } from './device-edit/device-edit.component'; import { DeviceResolverService } from '../../core/guards/device-resolver.service'; diff --git a/projects/account/src/app/modules/device/device.module.ts b/projects/account/src/app/modules/device/device.module.ts index e5149a0..1d00fd5 100644 --- a/projects/account/src/app/modules/device/device.module.ts +++ b/projects/account/src/app/modules/device/device.module.ts @@ -23,14 +23,14 @@ import { DeviceService } from '@account/http/device.service'; import { PreferencesComponent } from './components/view/preferences/preferences.component'; import { RemoveComponent } from './remove/remove.component'; import { SharedModule } from '../../shared/shared.module'; -import { DeviceAddComponent } from './device-add/device-add.component'; +import { DeviceAddComponent } from './pages/device-add/device-add.component'; import { DeviceListComponent } from './components/view/device-list/device-list.component'; import { DeviceEditComponent } from './device-edit/device-edit.component'; import { CityInputComponent } from './components/input/city-input/city-input.component'; import { CountryInputComponent } from './components/input/country-input/country-input.component'; import { RegionInputComponent } from './components/input/region-input/region-input.component'; import { TimezoneInputComponent } from './components/input/timezone-input/timezone-input.component'; -import { AddCompleteComponent } from './device-add/add-complete/add-complete.component'; +import { AddCompleteComponent } from './components/view/add-complete/add-complete.component'; import { DevicesComponent } from './pages/devices/devices.component'; import { DeviceInfoComponent } from './components/view/device-info/device-info.component'; import { DefaultsComponent } from './components/view/defaults/defaults.component'; diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.html b/projects/account/src/app/modules/device/pages/device-add/device-add.component.html similarity index 100% rename from projects/account/src/app/modules/device/device-add/device-add.component.html rename to projects/account/src/app/modules/device/pages/device-add/device-add.component.html diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.scss b/projects/account/src/app/modules/device/pages/device-add/device-add.component.scss similarity index 63% rename from projects/account/src/app/modules/device/device-add/device-add.component.scss rename to projects/account/src/app/modules/device/pages/device-add/device-add.component.scss index c021b28..86bcd9b 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.scss +++ b/projects/account/src/app/modules/device/pages/device-add/device-add.component.scss @@ -1,6 +1,6 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "components/buttons"; +@import "../../../../../../../../src/stylesheets/components/buttons"; button { @include action-button-primary; diff --git a/projects/account/src/app/modules/device/device-add/device-add.component.ts b/projects/account/src/app/modules/device/pages/device-add/device-add.component.ts similarity index 94% rename from projects/account/src/app/modules/device/device-add/device-add.component.ts rename to projects/account/src/app/modules/device/pages/device-add/device-add.component.ts index e70d1b9..c4a7388 100644 --- a/projects/account/src/app/modules/device/device-add/device-add.component.ts +++ b/projects/account/src/app/modules/device/pages/device-add/device-add.component.ts @@ -10,9 +10,9 @@ import { ActivatedRoute } from '@angular/router'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; import { Subscription } from 'rxjs'; -import { AccountPreferences } from '../../../shared/models/preferences.model'; -import { DeviceService } from '../../../core/http/device.service'; -import { AccountDefaults } from '../../../shared/models/defaults.model'; +import { AccountPreferences } from '../../../../shared/models/preferences.model'; +import { DeviceService } from '../../../../core/http/device.service'; +import { AccountDefaults } from '../../../../shared/models/defaults.model'; @Component({ selector: 'account-device-add', diff --git a/projects/account/src/app/modules/device/pages/devices/devices.component.ts b/projects/account/src/app/modules/device/pages/devices/devices.component.ts index 7b046d4..1531b63 100644 --- a/projects/account/src/app/modules/device/pages/devices/devices.component.ts +++ b/projects/account/src/app/modules/device/pages/devices/devices.component.ts @@ -28,15 +28,15 @@ export class DevicesComponent implements OnInit { this.defaultsForm = this.formBuilder.group( { - city: [this.defaults ? this.defaults.city : null], - country: [this.defaults ? this.defaults.country : null], + city: [this.defaults ? this.defaults.city.name : null], + country: [this.defaults ? this.defaults.country.name : null], name: [null], pairingCode: [null], placement: [null], - region: [this.defaults ? this.defaults.region : null], - timezone: [this.defaults ? this.defaults.timezone : null], - wakeWord: [this.defaults ? this.defaults.wakeWord : null], - voice: [this.defaults ? this.defaults.voice : null] + region: [this.defaults ? this.defaults.region.name : null], + timezone: [this.defaults ? this.defaults.timezone.name : null], + wakeWord: [this.defaults ? this.defaults.wakeWord.displayName : null], + voice: [this.defaults ? this.defaults.voice.displayName : null] } ); this.preferencesForm = this.formBuilder.group( From 2626a234f5e026d86d99cf9db25940408683ef3c Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 00:52:58 -0500 Subject: [PATCH 103/163] moved models from profile directory to models directory --- .../app/profile/account-resolver.service.ts | 3 +- .../edit/agreements/agreements.component.ts | 3 +- .../src/app/profile/edit/edit.component.ts | 4 +- .../app/profile/edit/login/login.component.ts | 5 +-- .../edit/membership/membership.component.ts | 4 +- .../membership-options.component.ts | 4 +- .../profile/membership-resolver.service.ts | 3 +- .../src/app/profile/new/new.component.ts | 2 +- .../support-step/support-step.component.ts | 3 +- .../src/app/profile/profile.service.ts | 40 +++---------------- .../shared/models/account-agreement.model.ts | 4 ++ .../shared/models/account-membership.model.ts | 6 +++ .../src/app/shared/models/account.model.ts | 10 +++++ .../src/app/shared/models/agreement.model.ts | 6 +++ .../src/app/shared/models/membership.model.ts | 6 +++ 15 files changed, 55 insertions(+), 48 deletions(-) create mode 100644 projects/account/src/app/shared/models/account-agreement.model.ts create mode 100644 projects/account/src/app/shared/models/account-membership.model.ts create mode 100644 projects/account/src/app/shared/models/account.model.ts create mode 100644 projects/account/src/app/shared/models/agreement.model.ts create mode 100644 projects/account/src/app/shared/models/membership.model.ts diff --git a/projects/account/src/app/profile/account-resolver.service.ts b/projects/account/src/app/profile/account-resolver.service.ts index ffeb6c5..2aaf2b2 100644 --- a/projects/account/src/app/profile/account-resolver.service.ts +++ b/projects/account/src/app/profile/account-resolver.service.ts @@ -6,7 +6,8 @@ import { } from '@angular/router'; import { Observable } from 'rxjs'; -import { Account, ProfileService } from './profile.service'; +import { Account } from '@account/models/account.model'; +import { ProfileService } from './profile.service'; @Injectable({ providedIn: 'root', diff --git a/projects/account/src/app/profile/edit/agreements/agreements.component.ts b/projects/account/src/app/profile/edit/agreements/agreements.component.ts index 6c1a6fb..df93b54 100644 --- a/projects/account/src/app/profile/edit/agreements/agreements.component.ts +++ b/projects/account/src/app/profile/edit/agreements/agreements.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { Account } from '../../profile.service'; +import { Account } from '@account/models/account.model'; @Component({ selector: 'account-agreements-edit', @@ -9,7 +9,6 @@ import { Account } from '../../profile.service'; }) export class AgreementsComponent implements OnInit { @Input() account: Account; - // public termsOfUseAccepted: string; constructor() { } diff --git a/projects/account/src/app/profile/edit/edit.component.ts b/projects/account/src/app/profile/edit/edit.component.ts index 1d6efd0..106ea8a 100644 --- a/projects/account/src/app/profile/edit/edit.component.ts +++ b/projects/account/src/app/profile/edit/edit.component.ts @@ -1,7 +1,9 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { Account, MembershipType, ProfileService } from '../profile.service'; +import { Account } from '@account/models/account.model'; +import { MembershipType } from '@account/models/membership.model'; +import { ProfileService } from '../profile.service'; @Component({ selector: 'account-profile-edit', diff --git a/projects/account/src/app/profile/edit/login/login.component.ts b/projects/account/src/app/profile/edit/login/login.component.ts index 0de83d3..79793d1 100644 --- a/projects/account/src/app/profile/edit/login/login.component.ts +++ b/projects/account/src/app/profile/edit/login/login.component.ts @@ -1,8 +1,6 @@ import { Component, Input } from '@angular/core'; -import { faEdit } from '@fortawesome/free-solid-svg-icons'; - -import { Account } from '../../profile.service'; +import { Account } from '@account/models/account.model'; @Component({ selector: 'account-login-edit', @@ -11,7 +9,6 @@ import { Account } from '../../profile.service'; }) export class LoginComponent { @Input() account: Account; - public editIcon = faEdit; constructor() { } } diff --git a/projects/account/src/app/profile/edit/membership/membership.component.ts b/projects/account/src/app/profile/edit/membership/membership.component.ts index 9b31f5c..d96499e 100644 --- a/projects/account/src/app/profile/edit/membership/membership.component.ts +++ b/projects/account/src/app/profile/edit/membership/membership.component.ts @@ -3,7 +3,9 @@ import { MediaChange, MediaObserver } from '@angular/flex-layout'; import { MatBottomSheet } from '@angular/material'; import { Subscription } from 'rxjs'; -import { AccountMembership, MembershipType, ProfileService } from '../../profile.service'; +import { AccountMembership } from '@account/models/account-membership.model'; +import { MembershipType } from '@account/models/membership.model'; +import { ProfileService } from '../../profile.service'; import { PaymentComponent } from '../../payment/payment.component'; @Component({ diff --git a/projects/account/src/app/profile/membership-options/membership-options.component.ts b/projects/account/src/app/profile/membership-options/membership-options.component.ts index a9d2626..948a4da 100644 --- a/projects/account/src/app/profile/membership-options/membership-options.component.ts +++ b/projects/account/src/app/profile/membership-options/membership-options.component.ts @@ -4,7 +4,9 @@ import { MatButtonToggleChange } from '@angular/material'; import { Subscription } from 'rxjs'; -import { AccountMembership, MembershipType, ProfileService } from '../profile.service'; +import { AccountMembership } from '@account/models/account-membership.model'; +import { MembershipType } from '@account/models/membership.model'; +import { ProfileService } from '../profile.service'; @Component({ diff --git a/projects/account/src/app/profile/membership-resolver.service.ts b/projects/account/src/app/profile/membership-resolver.service.ts index 118aa1a..c557e77 100644 --- a/projects/account/src/app/profile/membership-resolver.service.ts +++ b/projects/account/src/app/profile/membership-resolver.service.ts @@ -6,7 +6,8 @@ import { } from '@angular/router'; import { Observable } from 'rxjs'; -import { MembershipType, ProfileService } from './profile.service'; +import { MembershipType } from '@account/models/membership.model'; +import { ProfileService } from './profile.service'; @Injectable({ providedIn: 'root', diff --git a/projects/account/src/app/profile/new/new.component.ts b/projects/account/src/app/profile/new/new.component.ts index 22e1b54..317c697 100644 --- a/projects/account/src/app/profile/new/new.component.ts +++ b/projects/account/src/app/profile/new/new.component.ts @@ -12,8 +12,8 @@ import { ActivatedRoute } from '@angular/router'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; import { Subscription } from 'rxjs'; +import { MembershipType } from '@account/models/membership.model'; import { - MembershipType, navigateToLogin, ProfileService, storeRedirect diff --git a/projects/account/src/app/profile/new/support-step/support-step.component.ts b/projects/account/src/app/profile/new/support-step/support-step.component.ts index e8fae23..63d8bcd 100644 --- a/projects/account/src/app/profile/new/support-step/support-step.component.ts +++ b/projects/account/src/app/profile/new/support-step/support-step.component.ts @@ -2,7 +2,8 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { MatBottomSheet } from '@angular/material'; -import { MembershipType, ProfileService } from '../../profile.service'; +import { MembershipType } from '@account/models/membership.model'; +import { ProfileService } from '../../profile.service'; import { PaymentComponent } from '../../payment/payment.component'; @Component({ diff --git a/projects/account/src/app/profile/profile.service.ts b/projects/account/src/app/profile/profile.service.ts index 3aa57dd..eb5e317 100644 --- a/projects/account/src/app/profile/profile.service.ts +++ b/projects/account/src/app/profile/profile.service.ts @@ -1,12 +1,16 @@ import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { FormGroup } from '@angular/forms'; import { MatSnackBar } from '@angular/material'; import { Observable, Subject, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { environment } from '../../environments/environment'; -import { FormGroup } from '@angular/forms'; +import { Account } from '@account/models/account.model'; +import { AccountMembership } from '@account/models/account-membership.model'; +import { Agreement } from '@account/models/agreement.model'; +import { MembershipType } from '@account/models/membership.model'; // URLs for the http requests @@ -17,40 +21,6 @@ const membershipTypesUrl = '/api/memberships'; const fiveSeconds = 5000; -// Define the various data structures that will be used in this module. -export interface Agreement { - type: string; - version: string; - content: string; -} - -export interface AccountAgreement { - type: string; - acceptDate: string; -} - -export interface AccountMembership { - type: string; - duration?: string; - paymentAccountId?: string; -} - -export interface Account { - id: string; - emailAddress: string; - username: string; - membership: AccountMembership; - agreements: AccountAgreement[]; -} - -export interface MembershipType { - type: string; - rate: string; - ratePeriod: string; - stripePlan: string; -} - - export function storeRedirect() { localStorage.setItem( 'redirect', diff --git a/projects/account/src/app/shared/models/account-agreement.model.ts b/projects/account/src/app/shared/models/account-agreement.model.ts new file mode 100644 index 0000000..621df4a --- /dev/null +++ b/projects/account/src/app/shared/models/account-agreement.model.ts @@ -0,0 +1,4 @@ +export interface AccountAgreement { + type: string; + acceptDate: string; +} diff --git a/projects/account/src/app/shared/models/account-membership.model.ts b/projects/account/src/app/shared/models/account-membership.model.ts new file mode 100644 index 0000000..1a881b1 --- /dev/null +++ b/projects/account/src/app/shared/models/account-membership.model.ts @@ -0,0 +1,6 @@ +export interface AccountMembership { + type: string; + duration?: string; + paymentAccountId?: string; +} + diff --git a/projects/account/src/app/shared/models/account.model.ts b/projects/account/src/app/shared/models/account.model.ts new file mode 100644 index 0000000..a23704a --- /dev/null +++ b/projects/account/src/app/shared/models/account.model.ts @@ -0,0 +1,10 @@ +import { AccountAgreement } from '@account/models/account-agreement.model'; +import { AccountMembership } from '@account/models/account-membership.model'; + +export interface Account { + id: string; + emailAddress: string; + username: string; + membership: AccountMembership; + agreements: AccountAgreement[]; +} diff --git a/projects/account/src/app/shared/models/agreement.model.ts b/projects/account/src/app/shared/models/agreement.model.ts new file mode 100644 index 0000000..04e81e1 --- /dev/null +++ b/projects/account/src/app/shared/models/agreement.model.ts @@ -0,0 +1,6 @@ +export interface Agreement { + type: string; + version: string; + content: string; +} + diff --git a/projects/account/src/app/shared/models/membership.model.ts b/projects/account/src/app/shared/models/membership.model.ts new file mode 100644 index 0000000..ecf190a --- /dev/null +++ b/projects/account/src/app/shared/models/membership.model.ts @@ -0,0 +1,6 @@ +export interface MembershipType { + type: string; + rate: string; + ratePeriod: string; + stripePlan: string; +} From f54ad7be14d18482e7c0b9226fab1b41295c53f3 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 00:53:36 -0500 Subject: [PATCH 104/163] package updates --- package-lock.json | 932 ++++++++++++++++++---------------------------- 1 file changed, 353 insertions(+), 579 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b4c223..76917f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -152,9 +152,9 @@ } }, "@angular/cdk": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-7.2.2.tgz", - "integrity": "sha512-DG4Ip9COZuQngG31gNFrJRtVPYC8H938dCHuqVjHrLEKfdsKzvprI/y0W+tr/sUnIbIJWEPSvnzmS3XYOgmFyg==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-7.3.4.tgz", + "integrity": "sha512-cHl1o7obogCO3Nxf9n8MrXpfHa7AH1QNX2BY+bftYBTHW++YJe+qAwkwWLVqnJD9TQE2OpiR058zoJU20khM/g==", "requires": { "parse5": "^5.0.0", "tslib": "^1.7.1" @@ -570,9 +570,9 @@ "dev": true }, "@angular/material": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@angular/material/-/material-7.2.2.tgz", - "integrity": "sha512-HTtDhK5XkDvP6GPg4WTTa0HbeeagTfVRooTfw0TA+IuTAMBhXt5h1yzuGpFyMap8/PUVZN1D04g2CLhBSzoDxg==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@angular/material/-/material-7.3.4.tgz", + "integrity": "sha512-UWS4Kd3AqJBtAJRds4hhPNez9k1rkWhd6/E17pfcH6KWxP3Pi7tcubaSqoDRGHVbr/QegDn1SOoRokJxLYDn2g==", "requires": { "tslib": "^1.7.1" } @@ -611,14 +611,14 @@ } }, "@babel/generator": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.0.tgz", - "integrity": "sha512-dZTwMvTgWfhmibq4V9X+LMf6Bgl7zAodRn9PvcPdhlzFMbvUutx74dbEv7Atz3ToeEpevYEJtAwfxq/bDCzHWg==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.4.tgz", + "integrity": "sha512-8EXhHRFqlVVWXPezBW5keTiQi/rJMQTg/Y9uVCEZ0CAF3PKtCCaVRnp64Ii1ujhkoDhhF1fVsImoN4yJ2uz4Wg==", "dev": true, "requires": { - "@babel/types": "^7.3.0", + "@babel/types": "^7.3.4", "jsesc": "^2.5.1", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "source-map": "^0.5.0", "trim-right": "^1.0.1" }, @@ -686,9 +686,9 @@ } }, "@babel/parser": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.1.tgz", - "integrity": "sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.4.tgz", + "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==", "dev": true }, "@babel/template": { @@ -703,20 +703,20 @@ } }, "@babel/traverse": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz", - "integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.3.4.tgz", + "integrity": "sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.2.2", + "@babel/generator": "^7.3.4", "@babel/helper-function-name": "^7.1.0", "@babel/helper-split-export-declaration": "^7.0.0", - "@babel/parser": "^7.2.3", - "@babel/types": "^7.2.2", + "@babel/parser": "^7.3.4", + "@babel/types": "^7.3.4", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.10" + "lodash": "^4.17.11" }, "dependencies": { "debug": { @@ -729,9 +729,9 @@ } }, "globals": { - "version": "11.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", - "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", "dev": true }, "ms": { @@ -743,13 +743,13 @@ } }, "@babel/types": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.0.tgz", - "integrity": "sha512-QkFPw68QqWU1/RVPyBe8SO7lXbPfjtqAxRYQKpFpaB8yMq7X2qAqfwK5LKoQufEkSmO5NQ70O6Kc3Afk03RwXw==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz", + "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "to-fast-properties": "^2.0.0" }, "dependencies": { @@ -770,32 +770,32 @@ } }, "@fortawesome/fontawesome-common-types": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.12.tgz", - "integrity": "sha512-ISLNpEx6fhJTYYkvBeo/4DHeL5EIA+VybJoOOnH67m6uXt6V6VFizdEN4qchHagNIeZfzI0LnA22gk0wbVPv/g==" + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.15.tgz", + "integrity": "sha512-ATBRyKJw1d2ko+0DWN9+BXau0EK3I/Q6pPzPv3LhJD7r052YFAkAdfb1Bd7ZqhBsJrdse/S7jKxWUOZ61qBD4g==" }, "@fortawesome/fontawesome-svg-core": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.12.tgz", - "integrity": "sha512-cqTfa3vZ+Z9UYQnmLfCOwyLnf0Xcoxkmm/BSaI29Yikzu9zIeD4es7lBZMDqLOXYSEQC+rCr8caxFlGJcJVA+w==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.15.tgz", + "integrity": "sha512-M/sHyl4g2VBtKYkay1Z+XImMyTVcaBPmehYtPw4HKD9zg2E7eovB7Yx98aUfZjPbroGqa+IL4/+KhWBMOGlHIQ==", "requires": { - "@fortawesome/fontawesome-common-types": "^0.2.12" + "@fortawesome/fontawesome-common-types": "^0.2.15" } }, "@fortawesome/free-brands-svg-icons": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-5.6.3.tgz", - "integrity": "sha512-VCPYnISsTQwYXavO6ajFuYvedqMXk9njEaNrHcvUWhal1XTQNLrwIBjyM/IMGkn06XbGL6ApPg78vh1tIfA5GA==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-5.7.2.tgz", + "integrity": "sha512-91rIjo00vy7PNrXg5auDsPOSTjmgzc+UUqMyUZHmIrXG5OXMHgjAYMTgEIgs91Lm5XcJtggFZCQz1u5fGFnj2A==", "requires": { - "@fortawesome/fontawesome-common-types": "^0.2.12" + "@fortawesome/fontawesome-common-types": "^0.2.15" } }, "@fortawesome/free-solid-svg-icons": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.6.3.tgz", - "integrity": "sha512-ld8Gfp1KrncOpFRheThUDlD6/Ro9ZJGqfCEMXlO/x1Cg7ltLc5iYDG7yxDowLcmFY2BGSmxIIU3ZMW5FVTrfwQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.7.2.tgz", + "integrity": "sha512-iujcXMyAvIbWM8W3jkOLpvJbR+rPpdN1QyqhZeJaLRdHPH4JmuovIAYP4vx5Sa1csZVXfRD1eDWqVZ/jGM620A==", "requires": { - "@fortawesome/fontawesome-common-types": "^0.2.12" + "@fortawesome/fontawesome-common-types": "^0.2.15" } }, "@ngtools/json-schema": { @@ -876,9 +876,9 @@ "dev": true }, "@types/selenium-webdriver": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.14.tgz", - "integrity": "sha512-4GbNCDs98uHCT/OMv40qQC/OpoPbYn9XdXeTiFwHBBFO6eJhYEPUu2zDKirXSbHlvDV8oZ9l8EQ+HrEx/YS9DQ==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.15.tgz", + "integrity": "sha512-5nh8/K2u9p4bk95GGCJB7KBvewaB0TUziZ9DTr+mR2I6RoO4OJVqx7rxK83hs2J1tomwtCGkhiW+Dy8EUnfB+Q==", "dev": true }, "@webassemblyjs/ast": { @@ -1141,9 +1141,9 @@ "dev": true }, "ajv-keywords": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", - "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz", + "integrity": "sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw==", "dev": true }, "amdefine": { @@ -1205,15 +1205,15 @@ } }, "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", "dev": true }, "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", "dev": true }, "ansi-html": { @@ -1553,25 +1553,6 @@ "babel-runtime": "^6.22.0" } }, - "babel-polyfill": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", - "integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "core-js": "^2.4.0", - "regenerator-runtime": "^0.10.0" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", - "dev": true - } - } - }, "babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", @@ -1746,9 +1727,9 @@ "dev": true }, "binary-extensions": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", - "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.0.tgz", + "integrity": "sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw==", "dev": true }, "blob": { @@ -1998,14 +1979,14 @@ } }, "browserslist": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.1.tgz", - "integrity": "sha512-pEBxEXg7JwaakBXjATYw/D1YZh4QUSCX/Mnd/wnqSRPPSi1U39iDhDoKGoBUcraKdxDlrYqJxSI5nNvD+dWP2A==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30000929", - "electron-to-chromium": "^1.3.103", - "node-releases": "^1.1.3" + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" } }, "browserstack": { @@ -2069,9 +2050,9 @@ "dev": true }, "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz", + "integrity": "sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==", "dev": true }, "builtin-status-codes": { @@ -2153,9 +2134,9 @@ } }, "caniuse-lite": { - "version": "1.0.30000932", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000932.tgz", - "integrity": "sha512-4bghJFItvzz8m0T3lLZbacmEY9X1Z2AtIzTr7s7byqZIOumASfr4ynDx7rtm0J85nDmx8vsgR6vnaSoeU8Oh0A==", + "version": "1.0.30000945", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000945.tgz", + "integrity": "sha512-PSGwYChNIXJ4FZr9Z9mrVzBCB1TF3yyiRmIDRIdKDHZ6u+1jYH6xeR28XaquxnMwcZVX3f48S9zi7eswO/G1nQ==", "dev": true }, "canonical-path": { @@ -2473,12 +2454,12 @@ "dev": true }, "compressible": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.15.tgz", - "integrity": "sha512-4aE67DL33dSW9gw4CI2H/yTxqHLNcxp0yS6jB+4h+wr3e43+1z7vm0HU9qXOH8j+qjKuL8+UtkOxYQSMq60Ylw==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.16.tgz", + "integrity": "sha512-JQfEOdnI7dASwCuSPWIeVYwc/zMsu/+tRhoUvEfXz2gxOA2DNjmG5vhtFdBlhWPPGo+RdT9S3tgc/uH5qgDiiA==", "dev": true, "requires": { - "mime-db": ">= 1.36.0 < 2" + "mime-db": ">= 1.38.0 < 2" } }, "compression": { @@ -2660,9 +2641,9 @@ } }, "core-js": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.3.tgz", - "integrity": "sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ==" + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", + "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==" }, "core-util-is": { "version": "1.0.2", @@ -3145,9 +3126,9 @@ "dev": true }, "duplexify": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.1.tgz", - "integrity": "sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "dev": true, "requires": { "end-of-stream": "^1.0.0", @@ -3173,9 +3154,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.108", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.108.tgz", - "integrity": "sha512-/QI4hMpAh48a1Sea6PALGv+kuVne9A2EWGd8HrWHMdYhIzGtbhVVHh6heL5fAzGaDnZuPyrlWJRl8WPm4RyiQQ==", + "version": "1.3.115", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.115.tgz", + "integrity": "sha512-mN2qeapQWdi2B9uddxTZ4nl80y46hbyKY5Wt9Yjih+QZFQLdaujEDK4qJky35WhyxMzHF3ZY41Lgjd2BPDuBhg==", "dev": true }, "elliptic": { @@ -3205,15 +3186,6 @@ "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", "dev": true }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "dev": true, - "requires": { - "iconv-lite": "~0.4.13" - } - }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -3327,9 +3299,9 @@ } }, "es6-promise": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", - "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", + "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==", "dev": true }, "es6-promisify": { @@ -3379,9 +3351,9 @@ } }, "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.2.tgz", + "integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -3951,32 +3923,38 @@ } }, "flush-write-stream": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", - "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", "dev": true, "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.4" + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" } }, "follow-redirects": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.1.tgz", - "integrity": "sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz", + "integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==", "dev": true, "requires": { - "debug": "=3.1.0" + "debug": "^3.2.6" }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true } } }, @@ -4828,9 +4806,9 @@ "dev": true }, "handlebars": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", - "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz", + "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", "dev": true, "requires": { "async": "^2.5.0", @@ -4840,12 +4818,12 @@ }, "dependencies": { "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "dev": true, "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.11" } }, "source-map": { @@ -4873,9 +4851,9 @@ }, "dependencies": { "ajv": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", - "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -5202,9 +5180,9 @@ } }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -5435,15 +5413,6 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, "is-ci": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", @@ -5779,44 +5748,45 @@ } }, "istanbul-api": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.0.6.tgz", - "integrity": "sha512-8W5oeAGWXhtTJjAyVfvavOLVyZCTNCKsyF6GON/INKlBdO7uJ/bv3qnPj5M6ERKzmMCJS1kntnjjGuJ86fn3rQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.1.tgz", + "integrity": "sha512-kVmYrehiwyeBAk/wE71tW6emzLiHGjYIiDrc8sfyty4F8M02/lrgXSm+R1kXysmF20zArvmZXjlE/mg24TVPJw==", "dev": true, "requires": { "async": "^2.6.1", "compare-versions": "^3.2.1", "fileset": "^2.0.3", - "istanbul-lib-coverage": "^2.0.1", - "istanbul-lib-hook": "^2.0.1", - "istanbul-lib-instrument": "^3.0.0", - "istanbul-lib-report": "^2.0.2", - "istanbul-lib-source-maps": "^2.0.1", - "istanbul-reports": "^2.0.1", + "istanbul-lib-coverage": "^2.0.3", + "istanbul-lib-hook": "^2.0.3", + "istanbul-lib-instrument": "^3.1.0", + "istanbul-lib-report": "^2.0.4", + "istanbul-lib-source-maps": "^3.0.2", + "istanbul-reports": "^2.1.1", "js-yaml": "^3.12.0", "make-dir": "^1.3.0", + "minimatch": "^3.0.4", "once": "^1.4.0" }, "dependencies": { "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "dev": true, "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.11" } }, "istanbul-lib-coverage": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", - "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", "dev": true }, "istanbul-lib-instrument": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.0.0.tgz", - "integrity": "sha512-eQY9vN9elYjdgN9Iv6NS/00bptm02EBBk70lRMaVjeA6QYocQgenVrSgC28TJurdnZa80AGO3ASdFN+w/njGiQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz", + "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==", "dev": true, "requires": { "@babel/generator": "^7.0.0", @@ -5824,7 +5794,7 @@ "@babel/template": "^7.0.0", "@babel/traverse": "^7.0.0", "@babel/types": "^7.0.0", - "istanbul-lib-coverage": "^2.0.1", + "istanbul-lib-coverage": "^2.0.3", "semver": "^5.5.0" } } @@ -5884,9 +5854,9 @@ "dev": true }, "istanbul-lib-hook": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.1.tgz", - "integrity": "sha512-ufiZoiJ8CxY577JJWEeFuxXZoMqiKpq/RqZtOAYuQLvlkbJWscq9n3gc4xrCGH9n4pW0qnTxOz1oyMmVtk8E1w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz", + "integrity": "sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA==", "dev": true, "requires": { "append-transform": "^1.0.0" @@ -5908,50 +5878,59 @@ } }, "istanbul-lib-report": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.2.tgz", - "integrity": "sha512-rJ8uR3peeIrwAxoDEbK4dJ7cqqtxBisZKCuwkMtMv0xYzaAnsAi3AHrHPAAtNXzG/bcCgZZ3OJVqm1DTi9ap2Q==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz", + "integrity": "sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA==", "dev": true, "requires": { - "istanbul-lib-coverage": "^2.0.1", + "istanbul-lib-coverage": "^2.0.3", "make-dir": "^1.3.0", - "supports-color": "^5.4.0" + "supports-color": "^6.0.0" }, "dependencies": { "istanbul-lib-coverage": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", - "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, "istanbul-lib-source-maps": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-2.0.1.tgz", - "integrity": "sha512-30l40ySg+gvBLcxTrLzR4Z2XTRj3HgRCA/p2rnbs/3OiTaoj054gAbuP5DcLOtwqmy4XW8qXBHzrmP2/bQ9i3A==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz", + "integrity": "sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ==", "dev": true, "requires": { - "debug": "^3.1.0", - "istanbul-lib-coverage": "^2.0.1", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.3", "make-dir": "^1.3.0", "rimraf": "^2.6.2", "source-map": "^0.6.1" }, "dependencies": { "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" } }, "istanbul-lib-coverage": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", - "integrity": "sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", "dev": true }, "ms": { @@ -5969,12 +5948,12 @@ } }, "istanbul-reports": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.0.1.tgz", - "integrity": "sha512-CT0QgMBJqs6NJLF678ZHcquUAZIoBIUNzdJrRJfpkI9OnzG6MkUfHxbJC3ln981dMswC7/B1mfX3LNkhgJxsuw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.1.1.tgz", + "integrity": "sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw==", "dev": true, "requires": { - "handlebars": "^4.0.11" + "handlebars": "^4.1.0" } }, "jasmine": { @@ -6030,9 +6009,9 @@ "dev": true }, "js-yaml": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz", - "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", + "version": "3.12.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", + "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -6117,56 +6096,15 @@ } }, "jszip": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.5.tgz", - "integrity": "sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.2.0.tgz", + "integrity": "sha512-4WjbsaEtBK/DHeDZOPiPw5nzSGLDEDDreFRDEgnoMwmknPjTqa+23XuYFk6NiGbeiAeZCctiQ/X/z0lQBmDVOQ==", "dev": true, "requires": { - "core-js": "~2.3.0", - "es6-promise": "~3.0.2", - "lie": "~3.1.0", + "lie": "~3.3.0", "pako": "~1.0.2", - "readable-stream": "~2.0.6" - }, - "dependencies": { - "core-js": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", - "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=", - "dev": true - }, - "es6-promise": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", - "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=", - "dev": true - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } + "readable-stream": "~2.3.6", + "set-immediate-shim": "~1.0.1" } }, "karma": { @@ -6229,12 +6167,12 @@ } }, "karma-coverage-istanbul-reporter": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-2.0.4.tgz", - "integrity": "sha512-xJS7QSQIVU6VK9HuJ/ieE5yynxKhjCCkd96NLY/BX/HXsx0CskU9JJiMQbd4cHALiddMwI4OWh1IIzeWrsavJw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-2.0.5.tgz", + "integrity": "sha512-yPvAlKtY3y+rKKWbOo0CzBMVTvJEeMOgbMXuVv3yWvS8YtYKC98AU9vFF0mVBZ2RP1E9SgS90+PT6Kf14P3S4w==", "dev": true, "requires": { - "istanbul-api": "^2.0.5", + "istanbul-api": "^2.1.1", "minimatch": "^3.0.4" } }, @@ -6370,9 +6308,9 @@ } }, "lie": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", - "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", "dev": true, "requires": { "immediate": "~3.0.5" @@ -6534,12 +6472,12 @@ } }, "magic-string": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.1.tgz", - "integrity": "sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg==", + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.2.tgz", + "integrity": "sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg==", "dev": true, "requires": { - "sourcemap-codec": "^1.4.1" + "sourcemap-codec": "^1.4.4" } }, "make-dir": { @@ -6617,14 +6555,14 @@ "dev": true }, "mem": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", - "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", + "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", "dev": true, "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^1.0.0", - "p-is-promise": "^1.1.0" + "p-is-promise": "^2.0.0" } }, "memory-fs": { @@ -6714,18 +6652,18 @@ "optional": true }, "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==", "dev": true }, "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "version": "2.1.22", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", + "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", "dev": true, "requires": { - "mime-db": "~1.37.0" + "mime-db": "~1.38.0" } }, "mimic-fn": { @@ -6918,9 +6856,9 @@ "dev": true }, "ng-packagr": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/ng-packagr/-/ng-packagr-4.6.0.tgz", - "integrity": "sha512-jwWLm0iI9rOqtDYvxrSn/tLEFZLB1D3A8Cve1BFDqbNzIB44Zyg3rglKoF2e3RnDyD1gmqYEWTK+rw2d1P5EXw==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/ng-packagr/-/ng-packagr-4.7.1.tgz", + "integrity": "sha512-MIPKxyrnV22fS3wSfst2XjwWOonFKujVVEnIehYJhiu8GOg37bCdbbr9plsE1jRDmDAUz6M1MvdKibUrJyRp6Q==", "dev": true, "requires": { "@ngtools/json-schema": "^1.1.0", @@ -6937,7 +6875,7 @@ "less-plugin-npm-import": "^2.1.0", "node-sass": "^4.9.3", "node-sass-tilde-importer": "^1.0.0", - "opencollective": "^1.0.3", + "opencollective-postinstall": "^2.0.1", "postcss": "^7.0.0", "postcss-url": "^8.0.0", "read-pkg-up": "^4.0.0", @@ -6985,9 +6923,9 @@ } }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -7052,22 +6990,20 @@ "resolved": "https://registry.npmjs.org/ngx-cookie-service/-/ngx-cookie-service-2.1.0.tgz", "integrity": "sha512-7g7NEo7dYp6ap0j5qZ4Nf6nrU4WVdx8ycRQbWyLPps6mrR/+5vKU73ie0CMuKzl625bDTBjjJ60AmqTsp4l+AQ==" }, + "ngx-stripe": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/ngx-stripe/-/ngx-stripe-7.2.0.tgz", + "integrity": "sha512-5pFpmKBUeB5Yj862CHBlHp1nmysIdcpfGzbS/TstqIgDREXX6Ip9UYIQ7o69nApkivMyPUvYRgNomDDc/cFmWg==", + "requires": { + "tslib": "^1.9.0" + } + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "node-fetch": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz", - "integrity": "sha1-3CNO3WSJmC1Y6PDbT2lQKavNjAQ=", - "dev": true, - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - }, "node-forge": { "version": "0.7.5", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.5.tgz", @@ -7142,9 +7078,9 @@ } }, "node-releases": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.3.tgz", - "integrity": "sha512-6VrvH7z6jqqNFY200kdB6HdzkgM96Oaj9v3dqGfgp6mF+cHmU4wyQKZ2/WPDRVoR0Jz9KqbamaBN0ZhdUaysUQ==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.10.tgz", + "integrity": "sha512-KbUPCpfoBvb3oBkej9+nrU0/7xPlVhmhhUJ1PZqwIP5/1dJkRWKWD3OONjo6M2J7tSCBtDCumLwwqeI+DWWaLQ==", "dev": true, "requires": { "semver": "^5.3.0" @@ -7306,15 +7242,26 @@ } }, "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } } }, "normalize-path": { @@ -7507,9 +7454,9 @@ } }, "on-headers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", - "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true }, "once": { @@ -7530,139 +7477,11 @@ "mimic-fn": "^1.0.0" } }, - "opencollective": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz", - "integrity": "sha1-ruY3K8KBRFg2kMPKja7PwSDdDvE=", - "dev": true, - "requires": { - "babel-polyfill": "6.23.0", - "chalk": "1.1.3", - "inquirer": "3.0.6", - "minimist": "1.2.0", - "node-fetch": "1.6.3", - "opn": "4.0.2" - }, - "dependencies": { - "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", - "dev": true - }, - "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", - "dev": true, - "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" - } - }, - "inquirer": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz", - "integrity": "sha1-4EqqnQW3o8ubD0B9BDdfBEcZA0c=", - "dev": true, - "requires": { - "ansi-escapes": "^1.1.0", - "chalk": "^1.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.0.1", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx": "^4.1.0", - "string-width": "^2.0.0", - "strip-ansi": "^3.0.0", - "through": "^2.3.6" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "opn": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", - "integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=", - "dev": true, - "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true }, "opn": { "version": "5.3.0", @@ -7764,9 +7583,9 @@ "dev": true }, "p-is-promise": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", + "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", "dev": true }, "p-limit": { @@ -7812,9 +7631,9 @@ } }, "pako": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.8.tgz", - "integrity": "sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", "dev": true }, "parallel-transform": { @@ -7829,9 +7648,9 @@ } }, "parse-asn1": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.3.tgz", - "integrity": "sha512-VrPoetlz7B/FqjBLD2f5wBVZvsZVLnRUrxVLfRYhGXCODa/NWE4p3Wp+6+aV3ZPL3KM7/OZmxDIwwijD7yuucg==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", + "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", "dev": true, "requires": { "asn1.js": "^4.0.0", @@ -8415,9 +8234,9 @@ } }, "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "requires": { "safe-buffer": "^5.1.0" @@ -8854,14 +8673,14 @@ } }, "rollup-plugin-commonjs": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz", - "integrity": "sha512-0RM5U4Vd6iHjL6rLvr3lKBwnPsaVml+qxOGaaNUWN1lSq6S33KhITOfHmvxV3z2vy9Mk4t0g4rNlVaJJsNQPWA==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.1.tgz", + "integrity": "sha512-X0A/Cp/t+zbONFinBhiTZrfuUaVwRIp4xsbKq/2ohA2CDULa/7ONSJTelqxon+Vds2R2t2qJTqJQucKUC8GKkw==", "dev": true, "requires": { "estree-walker": "^0.5.2", "magic-string": "^0.25.1", - "resolve": "^1.8.1", + "resolve": "^1.10.0", "rollup-pluginutils": "^2.3.3" }, "dependencies": { @@ -8886,22 +8705,16 @@ } }, "rollup-plugin-node-resolve": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.0.tgz", - "integrity": "sha512-7Ni+/M5RPSUBfUaP9alwYQiIKnKeXCOHiqBpKUl9kwp3jX5ZJtgXAait1cne6pGEVUUztPD6skIKH9Kq9sNtfw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.1.tgz", + "integrity": "sha512-fSS7YDuCe0gYqKsr5OvxMloeZYUSgN43Ypi1WeRZzQcWtHgFayV5tUSPYpxuaioIIWaBXl6NrVk0T2/sKwueLg==", "dev": true, "requires": { "builtin-modules": "^3.0.0", "is-module": "^1.0.0", - "resolve": "^1.8.1" + "resolve": "^1.10.0" }, "dependencies": { - "builtin-modules": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz", - "integrity": "sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==", - "dev": true - }, "resolve": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", @@ -8924,103 +8737,20 @@ } }, "rollup-pluginutils": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz", - "integrity": "sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz", + "integrity": "sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==", "dev": true, "requires": { - "estree-walker": "^0.5.2", - "micromatch": "^2.3.11" + "estree-walker": "^0.6.0", + "micromatch": "^3.1.10" }, "dependencies": { - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "estree-walker": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz", + "integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==", "dev": true - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } } } }, @@ -9042,12 +8772,6 @@ "aproba": "^1.1.1" } }, - "rx": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", - "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=", - "dev": true - }, "rxjs": { "version": "6.3.3", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", @@ -9289,6 +9013,12 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -9660,12 +9390,12 @@ }, "dependencies": { "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "dev": true, "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.11" } } } @@ -10138,21 +9868,37 @@ } }, "terser": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-3.14.1.tgz", - "integrity": "sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw==", + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz", + "integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==", "dev": true, "requires": { - "commander": "~2.17.1", + "commander": "^2.19.0", "source-map": "~0.6.1", - "source-map-support": "~0.5.6" + "source-map-support": "~0.5.10" }, "dependencies": { + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true + }, + "source-map-support": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.10.tgz", + "integrity": "sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } } } }, @@ -10195,13 +9941,13 @@ } }, "find-cache-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz", - "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^1.0.0", + "make-dir": "^2.0.0", "pkg-dir": "^3.0.0" } }, @@ -10233,6 +9979,16 @@ "yallist": "^3.0.2" } }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, "mississippi": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", @@ -10252,9 +10008,9 @@ } }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -10275,6 +10031,12 @@ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", "dev": true }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, "pkg-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", @@ -10294,6 +10056,12 @@ "once": "^1.3.1" } }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -10493,9 +10261,9 @@ } }, "tsickle": { - "version": "0.34.0", - "resolved": "https://registry.npmjs.org/tsickle/-/tsickle-0.34.0.tgz", - "integrity": "sha512-O3wCPRtL18Hc/ZBnaiKwmmjVzeCWTOTpsi0btfC7FWL3RnXpxLPxD6hoJ0QEXuSfG/0QJk+MWNjqT9N6fOyyIg==", + "version": "0.34.3", + "resolved": "https://registry.npmjs.org/tsickle/-/tsickle-0.34.3.tgz", + "integrity": "sha512-mb1v3nsr6rYaZky22xj0d6qv4ogAR40Bc6r37jwWOg3bEIO/ZppEFZiEADs/NNVLcWTPgmNmPZgaX5CfAH6oXA==", "dev": true, "requires": { "minimist": "^1.2.0", @@ -10536,6 +10304,12 @@ "tsutils": "^2.27.2" }, "dependencies": { + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, "resolve": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", @@ -10803,9 +10577,9 @@ "dev": true }, "upath": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", - "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", "dev": true }, "update-notifier": { @@ -11298,9 +11072,9 @@ } }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" From d8308172c70da782b6c9cf8c020f652c0cfb9492 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 00:57:44 -0500 Subject: [PATCH 105/163] moved guards and service from profile folder to core folder --- .../guards}/account-resolver.service.ts | 2 +- .../guards}/membership-resolver.service.ts | 2 +- .../src/app/{profile => core/http}/profile.service.ts | 10 +++++----- .../account/src/app/profile/edit/edit.component.ts | 2 +- .../profile/edit/membership/membership.component.ts | 2 +- .../membership-options/membership-options.component.ts | 2 +- .../new/agreement-step/agreement-step.component.ts | 2 +- projects/account/src/app/profile/new/new.component.ts | 2 +- .../profile/new/support-step/support-step.component.ts | 2 +- .../src/app/profile/payment/payment.component.ts | 2 +- .../account/src/app/profile/profile-routing.module.ts | 4 ++-- projects/account/src/app/profile/profile.module.ts | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) rename projects/account/src/app/{profile => core/guards}/account-resolver.service.ts (90%) rename projects/account/src/app/{profile => core/guards}/membership-resolver.service.ts (91%) rename projects/account/src/app/{profile => core/http}/profile.service.ts (92%) diff --git a/projects/account/src/app/profile/account-resolver.service.ts b/projects/account/src/app/core/guards/account-resolver.service.ts similarity index 90% rename from projects/account/src/app/profile/account-resolver.service.ts rename to projects/account/src/app/core/guards/account-resolver.service.ts index 2aaf2b2..473a2c9 100644 --- a/projects/account/src/app/profile/account-resolver.service.ts +++ b/projects/account/src/app/core/guards/account-resolver.service.ts @@ -7,7 +7,7 @@ import { import { Observable } from 'rxjs'; import { Account } from '@account/models/account.model'; -import { ProfileService } from './profile.service'; +import { ProfileService } from '../http/profile.service'; @Injectable({ providedIn: 'root', diff --git a/projects/account/src/app/profile/membership-resolver.service.ts b/projects/account/src/app/core/guards/membership-resolver.service.ts similarity index 91% rename from projects/account/src/app/profile/membership-resolver.service.ts rename to projects/account/src/app/core/guards/membership-resolver.service.ts index c557e77..d926b3e 100644 --- a/projects/account/src/app/profile/membership-resolver.service.ts +++ b/projects/account/src/app/core/guards/membership-resolver.service.ts @@ -7,7 +7,7 @@ import { import { Observable } from 'rxjs'; import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from './profile.service'; +import { ProfileService } from '../http/profile.service'; @Injectable({ providedIn: 'root', diff --git a/projects/account/src/app/profile/profile.service.ts b/projects/account/src/app/core/http/profile.service.ts similarity index 92% rename from projects/account/src/app/profile/profile.service.ts rename to projects/account/src/app/core/http/profile.service.ts index eb5e317..aa5f7b4 100644 --- a/projects/account/src/app/profile/profile.service.ts +++ b/projects/account/src/app/core/http/profile.service.ts @@ -6,11 +6,11 @@ import { MatSnackBar } from '@angular/material'; import { Observable, Subject, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; -import { environment } from '../../environments/environment'; -import { Account } from '@account/models/account.model'; -import { AccountMembership } from '@account/models/account-membership.model'; -import { Agreement } from '@account/models/agreement.model'; -import { MembershipType } from '@account/models/membership.model'; +import { environment } from '../../../environments/environment'; +import { Account } from '../../shared/models/account.model'; +import { AccountMembership } from '../../shared/models/account-membership.model'; +import { Agreement } from '../../shared/models/agreement.model'; +import { MembershipType } from '../../shared/models/membership.model'; // URLs for the http requests diff --git a/projects/account/src/app/profile/edit/edit.component.ts b/projects/account/src/app/profile/edit/edit.component.ts index 106ea8a..0e14085 100644 --- a/projects/account/src/app/profile/edit/edit.component.ts +++ b/projects/account/src/app/profile/edit/edit.component.ts @@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router'; import { Account } from '@account/models/account.model'; import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '../profile.service'; +import { ProfileService } from '../../core/http/profile.service'; @Component({ selector: 'account-profile-edit', diff --git a/projects/account/src/app/profile/edit/membership/membership.component.ts b/projects/account/src/app/profile/edit/membership/membership.component.ts index d96499e..9eb24a0 100644 --- a/projects/account/src/app/profile/edit/membership/membership.component.ts +++ b/projects/account/src/app/profile/edit/membership/membership.component.ts @@ -5,7 +5,7 @@ import { Subscription } from 'rxjs'; import { AccountMembership } from '@account/models/account-membership.model'; import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '../../profile.service'; +import { ProfileService } from '../../../core/http/profile.service'; import { PaymentComponent } from '../../payment/payment.component'; @Component({ diff --git a/projects/account/src/app/profile/membership-options/membership-options.component.ts b/projects/account/src/app/profile/membership-options/membership-options.component.ts index 948a4da..b1b1619 100644 --- a/projects/account/src/app/profile/membership-options/membership-options.component.ts +++ b/projects/account/src/app/profile/membership-options/membership-options.component.ts @@ -6,7 +6,7 @@ import { Subscription } from 'rxjs'; import { AccountMembership } from '@account/models/account-membership.model'; import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '../profile.service'; +import { ProfileService } from '../../core/http/profile.service'; @Component({ diff --git a/projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts b/projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts index 4ff2a74..2ed18b0 100644 --- a/projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts +++ b/projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts @@ -4,7 +4,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; -import { ProfileService } from '../../profile.service'; +import { ProfileService } from '../../../core/http/profile.service'; @Component({ diff --git a/projects/account/src/app/profile/new/new.component.ts b/projects/account/src/app/profile/new/new.component.ts index 317c697..eaa293f 100644 --- a/projects/account/src/app/profile/new/new.component.ts +++ b/projects/account/src/app/profile/new/new.component.ts @@ -17,7 +17,7 @@ import { navigateToLogin, ProfileService, storeRedirect -} from '../profile.service'; +} from '../../core/http/profile.service'; const noDelay = 0; diff --git a/projects/account/src/app/profile/new/support-step/support-step.component.ts b/projects/account/src/app/profile/new/support-step/support-step.component.ts index 63d8bcd..c14f240 100644 --- a/projects/account/src/app/profile/new/support-step/support-step.component.ts +++ b/projects/account/src/app/profile/new/support-step/support-step.component.ts @@ -3,7 +3,7 @@ import { FormGroup } from '@angular/forms'; import { MatBottomSheet } from '@angular/material'; import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '../../profile.service'; +import { ProfileService } from '../../../core/http/profile.service'; import { PaymentComponent } from '../../payment/payment.component'; @Component({ diff --git a/projects/account/src/app/profile/payment/payment.component.ts b/projects/account/src/app/profile/payment/payment.component.ts index 228da17..e2df5bd 100644 --- a/projects/account/src/app/profile/payment/payment.component.ts +++ b/projects/account/src/app/profile/payment/payment.component.ts @@ -8,7 +8,7 @@ import { import { ElementOptions, StripeCardComponent, StripeService } from 'ngx-stripe'; -import { ProfileService } from '../profile.service'; +import { ProfileService } from '../../core/http/profile.service'; import { VerifyCardDialogComponent } from './verify-card-dialog.component'; const twoSeconds = 2000; diff --git a/projects/account/src/app/profile/profile-routing.module.ts b/projects/account/src/app/profile/profile-routing.module.ts index a10b3e7..73b910a 100644 --- a/projects/account/src/app/profile/profile-routing.module.ts +++ b/projects/account/src/app/profile/profile-routing.module.ts @@ -1,8 +1,8 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { AccountResolverService } from './account-resolver.service'; -import { MembershipResolverService } from './membership-resolver.service'; +import { AccountResolverService } from '../core/guards/account-resolver.service'; +import { MembershipResolverService } from '../core/guards/membership-resolver.service'; import { EditComponent } from './edit/edit.component'; import { NewComponent } from './new/new.component'; diff --git a/projects/account/src/app/profile/profile.module.ts b/projects/account/src/app/profile/profile.module.ts index 29ebd3e..7bf17e0 100644 --- a/projects/account/src/app/profile/profile.module.ts +++ b/projects/account/src/app/profile/profile.module.ts @@ -31,7 +31,7 @@ import { MembershipComponent } from './edit/membership/membership.component'; import { MembershipOptionsComponent } from './membership-options/membership-options.component'; import { NewComponent } from './new/new.component'; import { PaymentComponent } from './payment/payment.component'; -import { ProfileService } from './profile.service'; +import { ProfileService } from '../core/http/profile.service'; import { ProfileRoutingModule } from './profile-routing.module'; import { SharedModule } from 'shared'; import { SupportStepComponent } from './new/support-step/support-step.component'; From 6ae1cfda0407f8eedfd2235388b021e3e82114c8 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 01:08:36 -0500 Subject: [PATCH 106/163] moved profile module into modules directory --- projects/account/src/app/app.module.ts | 2 +- .../profile/edit/agreements/agreements.component.html | 0 .../profile/edit/agreements/agreements.component.scss | 2 +- .../profile/edit/agreements/agreements.component.ts | 0 .../{ => modules}/profile/edit/delete/delete.component.html | 0 .../{ => modules}/profile/edit/delete/delete.component.scss | 2 +- .../{ => modules}/profile/edit/delete/delete.component.ts | 0 .../src/app/{ => modules}/profile/edit/edit.component.html | 0 .../src/app/{ => modules}/profile/edit/edit.component.scss | 0 .../src/app/{ => modules}/profile/edit/edit.component.ts | 2 +- .../{ => modules}/profile/edit/login/login.component.html | 0 .../{ => modules}/profile/edit/login/login.component.scss | 6 +++--- .../app/{ => modules}/profile/edit/login/login.component.ts | 0 .../profile/edit/membership/membership.component.html | 0 .../profile/edit/membership/membership.component.scss | 4 ++-- .../profile/edit/membership/membership.component.ts | 6 +++--- .../membership-options/membership-options.component.html | 0 .../membership-options/membership-options.component.scss | 0 .../membership-options/membership-options.component.ts | 2 +- .../new/agreement-step/agreement-step.component.html | 0 .../new/agreement-step/agreement-step.component.scss | 4 ++-- .../profile/new/agreement-step/agreement-step.component.ts | 2 +- .../authentication-step/authentication-step.component.html | 0 .../authentication-step/authentication-step.component.scss | 2 +- .../authentication-step/authentication-step.component.ts | 0 .../profile/new/done-step/done-step.component.html | 0 .../profile/new/done-step/done-step.component.scss | 4 ++-- .../profile/new/done-step/done-step.component.ts | 0 .../src/app/{ => modules}/profile/new/new.component.html | 0 .../src/app/{ => modules}/profile/new/new.component.scss | 0 .../src/app/{ => modules}/profile/new/new.component.ts | 2 +- .../profile/new/support-step/support-step.component.html | 0 .../profile/new/support-step/support-step.component.scss | 4 ++-- .../profile/new/support-step/support-step.component.ts | 2 +- .../profile/new/username-step/username-step.component.html | 0 .../profile/new/username-step/username-step.component.scss | 4 ++-- .../profile/new/username-step/username-step.component.ts | 0 .../{ => modules}/profile/payment/payment.component.html | 0 .../{ => modules}/profile/payment/payment.component.scss | 4 ++-- .../app/{ => modules}/profile/payment/payment.component.ts | 2 +- .../profile/payment/verify-card-dialog.component.html | 0 .../profile/payment/verify-card-dialog.component.scss | 0 .../profile/payment/verify-card-dialog.component.ts | 3 +-- .../src/app/{ => modules}/profile/profile-routing.module.ts | 4 ++-- .../account/src/app/{ => modules}/profile/profile.module.ts | 4 ++-- 45 files changed, 33 insertions(+), 34 deletions(-) rename projects/account/src/app/{ => modules}/profile/edit/agreements/agreements.component.html (100%) rename projects/account/src/app/{ => modules}/profile/edit/agreements/agreements.component.scss (88%) rename projects/account/src/app/{ => modules}/profile/edit/agreements/agreements.component.ts (100%) rename projects/account/src/app/{ => modules}/profile/edit/delete/delete.component.html (100%) rename projects/account/src/app/{ => modules}/profile/edit/delete/delete.component.scss (84%) rename projects/account/src/app/{ => modules}/profile/edit/delete/delete.component.ts (100%) rename projects/account/src/app/{ => modules}/profile/edit/edit.component.html (100%) rename projects/account/src/app/{ => modules}/profile/edit/edit.component.scss (100%) rename projects/account/src/app/{ => modules}/profile/edit/edit.component.ts (92%) rename projects/account/src/app/{ => modules}/profile/edit/login/login.component.html (100%) rename projects/account/src/app/{ => modules}/profile/edit/login/login.component.scss (71%) rename projects/account/src/app/{ => modules}/profile/edit/login/login.component.ts (100%) rename projects/account/src/app/{ => modules}/profile/edit/membership/membership.component.html (100%) rename projects/account/src/app/{ => modules}/profile/edit/membership/membership.component.scss (72%) rename projects/account/src/app/{ => modules}/profile/edit/membership/membership.component.ts (91%) rename projects/account/src/app/{ => modules}/profile/membership-options/membership-options.component.html (100%) rename projects/account/src/app/{ => modules}/profile/membership-options/membership-options.component.scss (100%) rename projects/account/src/app/{ => modules}/profile/membership-options/membership-options.component.ts (96%) rename projects/account/src/app/{ => modules}/profile/new/agreement-step/agreement-step.component.html (100%) rename projects/account/src/app/{ => modules}/profile/new/agreement-step/agreement-step.component.scss (80%) rename projects/account/src/app/{ => modules}/profile/new/agreement-step/agreement-step.component.ts (95%) rename projects/account/src/app/{ => modules}/profile/new/authentication-step/authentication-step.component.html (100%) rename projects/account/src/app/{ => modules}/profile/new/authentication-step/authentication-step.component.scss (85%) rename projects/account/src/app/{ => modules}/profile/new/authentication-step/authentication-step.component.ts (100%) rename projects/account/src/app/{ => modules}/profile/new/done-step/done-step.component.html (100%) rename projects/account/src/app/{ => modules}/profile/new/done-step/done-step.component.scss (62%) rename projects/account/src/app/{ => modules}/profile/new/done-step/done-step.component.ts (100%) rename projects/account/src/app/{ => modules}/profile/new/new.component.html (100%) rename projects/account/src/app/{ => modules}/profile/new/new.component.scss (100%) rename projects/account/src/app/{ => modules}/profile/new/new.component.ts (99%) rename projects/account/src/app/{ => modules}/profile/new/support-step/support-step.component.html (100%) rename projects/account/src/app/{ => modules}/profile/new/support-step/support-step.component.scss (64%) rename projects/account/src/app/{ => modules}/profile/new/support-step/support-step.component.ts (98%) rename projects/account/src/app/{ => modules}/profile/new/username-step/username-step.component.html (100%) rename projects/account/src/app/{ => modules}/profile/new/username-step/username-step.component.scss (69%) rename projects/account/src/app/{ => modules}/profile/new/username-step/username-step.component.ts (100%) rename projects/account/src/app/{ => modules}/profile/payment/payment.component.html (100%) rename projects/account/src/app/{ => modules}/profile/payment/payment.component.scss (85%) rename projects/account/src/app/{ => modules}/profile/payment/payment.component.ts (98%) rename projects/account/src/app/{ => modules}/profile/payment/verify-card-dialog.component.html (100%) rename projects/account/src/app/{ => modules}/profile/payment/verify-card-dialog.component.scss (100%) rename projects/account/src/app/{ => modules}/profile/payment/verify-card-dialog.component.ts (66%) rename projects/account/src/app/{ => modules}/profile/profile-routing.module.ts (81%) rename projects/account/src/app/{ => modules}/profile/profile.module.ts (96%) diff --git a/projects/account/src/app/app.module.ts b/projects/account/src/app/app.module.ts index 6274930..9501bf0 100644 --- a/projects/account/src/app/app.module.ts +++ b/projects/account/src/app/app.module.ts @@ -8,7 +8,7 @@ import { AppComponent } from './app.component'; import { GlobalnavModule } from 'globalnav'; import { PageNotFoundModule } from 'page-not-found'; import { DeviceModule } from './modules/device/device.module'; -import { ProfileModule } from './profile/profile.module'; +import { ProfileModule } from './modules/profile/profile.module'; import { SharedModule } from 'shared'; import { SkillModule } from './skill/skill.module'; diff --git a/projects/account/src/app/profile/edit/agreements/agreements.component.html b/projects/account/src/app/modules/profile/edit/agreements/agreements.component.html similarity index 100% rename from projects/account/src/app/profile/edit/agreements/agreements.component.html rename to projects/account/src/app/modules/profile/edit/agreements/agreements.component.html diff --git a/projects/account/src/app/profile/edit/agreements/agreements.component.scss b/projects/account/src/app/modules/profile/edit/agreements/agreements.component.scss similarity index 88% rename from projects/account/src/app/profile/edit/agreements/agreements.component.scss rename to projects/account/src/app/modules/profile/edit/agreements/agreements.component.scss index b827d52..e7b9d82 100644 --- a/projects/account/src/app/profile/edit/agreements/agreements.component.scss +++ b/projects/account/src/app/modules/profile/edit/agreements/agreements.component.scss @@ -1,4 +1,4 @@ -@import "../../../../../../../src/stylesheets/components/cards"; +@import "components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/profile/edit/agreements/agreements.component.ts b/projects/account/src/app/modules/profile/edit/agreements/agreements.component.ts similarity index 100% rename from projects/account/src/app/profile/edit/agreements/agreements.component.ts rename to projects/account/src/app/modules/profile/edit/agreements/agreements.component.ts diff --git a/projects/account/src/app/profile/edit/delete/delete.component.html b/projects/account/src/app/modules/profile/edit/delete/delete.component.html similarity index 100% rename from projects/account/src/app/profile/edit/delete/delete.component.html rename to projects/account/src/app/modules/profile/edit/delete/delete.component.html diff --git a/projects/account/src/app/profile/edit/delete/delete.component.scss b/projects/account/src/app/modules/profile/edit/delete/delete.component.scss similarity index 84% rename from projects/account/src/app/profile/edit/delete/delete.component.scss rename to projects/account/src/app/modules/profile/edit/delete/delete.component.scss index 2980b2c..7946a0b 100644 --- a/projects/account/src/app/profile/edit/delete/delete.component.scss +++ b/projects/account/src/app/modules/profile/edit/delete/delete.component.scss @@ -1,4 +1,4 @@ -@import "../../../../../../../src/stylesheets/components/cards"; +@import "components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/profile/edit/delete/delete.component.ts b/projects/account/src/app/modules/profile/edit/delete/delete.component.ts similarity index 100% rename from projects/account/src/app/profile/edit/delete/delete.component.ts rename to projects/account/src/app/modules/profile/edit/delete/delete.component.ts diff --git a/projects/account/src/app/profile/edit/edit.component.html b/projects/account/src/app/modules/profile/edit/edit.component.html similarity index 100% rename from projects/account/src/app/profile/edit/edit.component.html rename to projects/account/src/app/modules/profile/edit/edit.component.html diff --git a/projects/account/src/app/profile/edit/edit.component.scss b/projects/account/src/app/modules/profile/edit/edit.component.scss similarity index 100% rename from projects/account/src/app/profile/edit/edit.component.scss rename to projects/account/src/app/modules/profile/edit/edit.component.scss diff --git a/projects/account/src/app/profile/edit/edit.component.ts b/projects/account/src/app/modules/profile/edit/edit.component.ts similarity index 92% rename from projects/account/src/app/profile/edit/edit.component.ts rename to projects/account/src/app/modules/profile/edit/edit.component.ts index 0e14085..c54e11b 100644 --- a/projects/account/src/app/profile/edit/edit.component.ts +++ b/projects/account/src/app/modules/profile/edit/edit.component.ts @@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router'; import { Account } from '@account/models/account.model'; import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '../../core/http/profile.service'; +import { ProfileService } from '@account/http/profile.service'; @Component({ selector: 'account-profile-edit', diff --git a/projects/account/src/app/profile/edit/login/login.component.html b/projects/account/src/app/modules/profile/edit/login/login.component.html similarity index 100% rename from projects/account/src/app/profile/edit/login/login.component.html rename to projects/account/src/app/modules/profile/edit/login/login.component.html diff --git a/projects/account/src/app/profile/edit/login/login.component.scss b/projects/account/src/app/modules/profile/edit/login/login.component.scss similarity index 71% rename from projects/account/src/app/profile/edit/login/login.component.scss rename to projects/account/src/app/modules/profile/edit/login/login.component.scss index 1ef686d..b9f193d 100644 --- a/projects/account/src/app/profile/edit/login/login.component.scss +++ b/projects/account/src/app/modules/profile/edit/login/login.component.scss @@ -1,7 +1,7 @@ -@import "../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; -@import "../../../../../../../src/stylesheets/components/buttons"; -@import "../../../../../../../src/stylesheets/components/cards"; +@import "components/buttons"; +@import "components/cards"; mat-card { diff --git a/projects/account/src/app/profile/edit/login/login.component.ts b/projects/account/src/app/modules/profile/edit/login/login.component.ts similarity index 100% rename from projects/account/src/app/profile/edit/login/login.component.ts rename to projects/account/src/app/modules/profile/edit/login/login.component.ts diff --git a/projects/account/src/app/profile/edit/membership/membership.component.html b/projects/account/src/app/modules/profile/edit/membership/membership.component.html similarity index 100% rename from projects/account/src/app/profile/edit/membership/membership.component.html rename to projects/account/src/app/modules/profile/edit/membership/membership.component.html diff --git a/projects/account/src/app/profile/edit/membership/membership.component.scss b/projects/account/src/app/modules/profile/edit/membership/membership.component.scss similarity index 72% rename from projects/account/src/app/profile/edit/membership/membership.component.scss rename to projects/account/src/app/modules/profile/edit/membership/membership.component.scss index ba68329..4fb7044 100644 --- a/projects/account/src/app/profile/edit/membership/membership.component.scss +++ b/projects/account/src/app/modules/profile/edit/membership/membership.component.scss @@ -1,5 +1,5 @@ -@import "../../../../../../../src/stylesheets/components/buttons"; -@import "../../../../../../../src/stylesheets/components/cards"; +@import "../../../../../../../../src/stylesheets/components/buttons"; +@import "../../../../../../../../src/stylesheets/components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/profile/edit/membership/membership.component.ts b/projects/account/src/app/modules/profile/edit/membership/membership.component.ts similarity index 91% rename from projects/account/src/app/profile/edit/membership/membership.component.ts rename to projects/account/src/app/modules/profile/edit/membership/membership.component.ts index 9eb24a0..173bcc0 100644 --- a/projects/account/src/app/profile/edit/membership/membership.component.ts +++ b/projects/account/src/app/modules/profile/edit/membership/membership.component.ts @@ -3,9 +3,9 @@ import { MediaChange, MediaObserver } from '@angular/flex-layout'; import { MatBottomSheet } from '@angular/material'; import { Subscription } from 'rxjs'; -import { AccountMembership } from '@account/models/account-membership.model'; -import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '../../../core/http/profile.service'; +import { AccountMembership } from '../../../../shared/models/account-membership.model'; +import { MembershipType } from '../../../../shared/models/membership.model'; +import { ProfileService } from '../../../../core/http/profile.service'; import { PaymentComponent } from '../../payment/payment.component'; @Component({ diff --git a/projects/account/src/app/profile/membership-options/membership-options.component.html b/projects/account/src/app/modules/profile/membership-options/membership-options.component.html similarity index 100% rename from projects/account/src/app/profile/membership-options/membership-options.component.html rename to projects/account/src/app/modules/profile/membership-options/membership-options.component.html diff --git a/projects/account/src/app/profile/membership-options/membership-options.component.scss b/projects/account/src/app/modules/profile/membership-options/membership-options.component.scss similarity index 100% rename from projects/account/src/app/profile/membership-options/membership-options.component.scss rename to projects/account/src/app/modules/profile/membership-options/membership-options.component.scss diff --git a/projects/account/src/app/profile/membership-options/membership-options.component.ts b/projects/account/src/app/modules/profile/membership-options/membership-options.component.ts similarity index 96% rename from projects/account/src/app/profile/membership-options/membership-options.component.ts rename to projects/account/src/app/modules/profile/membership-options/membership-options.component.ts index b1b1619..49f8a1b 100644 --- a/projects/account/src/app/profile/membership-options/membership-options.component.ts +++ b/projects/account/src/app/modules/profile/membership-options/membership-options.component.ts @@ -6,7 +6,7 @@ import { Subscription } from 'rxjs'; import { AccountMembership } from '@account/models/account-membership.model'; import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '../../core/http/profile.service'; +import { ProfileService } from '@account/http/profile.service'; @Component({ diff --git a/projects/account/src/app/profile/new/agreement-step/agreement-step.component.html b/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.html similarity index 100% rename from projects/account/src/app/profile/new/agreement-step/agreement-step.component.html rename to projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.html diff --git a/projects/account/src/app/profile/new/agreement-step/agreement-step.component.scss b/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.scss similarity index 80% rename from projects/account/src/app/profile/new/agreement-step/agreement-step.component.scss rename to projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.scss index 5272a60..980a6a5 100644 --- a/projects/account/src/app/profile/new/agreement-step/agreement-step.component.scss +++ b/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.scss @@ -1,6 +1,6 @@ -@import "../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; -@import "../../../../../../../src/stylesheets/components/buttons"; +@import "components/buttons"; h2 { margin-left: 16px; diff --git a/projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts b/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.ts similarity index 95% rename from projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts rename to projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.ts index 2ed18b0..e2b8bfc 100644 --- a/projects/account/src/app/profile/new/agreement-step/agreement-step.component.ts +++ b/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.ts @@ -4,7 +4,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; -import { ProfileService } from '../../../core/http/profile.service'; +import { ProfileService } from '@account/http/profile.service'; @Component({ diff --git a/projects/account/src/app/profile/new/authentication-step/authentication-step.component.html b/projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.html similarity index 100% rename from projects/account/src/app/profile/new/authentication-step/authentication-step.component.html rename to projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.html diff --git a/projects/account/src/app/profile/new/authentication-step/authentication-step.component.scss b/projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.scss similarity index 85% rename from projects/account/src/app/profile/new/authentication-step/authentication-step.component.scss rename to projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.scss index 715d41b..2bd5b2e 100644 --- a/projects/account/src/app/profile/new/authentication-step/authentication-step.component.scss +++ b/projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.scss @@ -1,4 +1,4 @@ -@import "../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; .mat-h1 { diff --git a/projects/account/src/app/profile/new/authentication-step/authentication-step.component.ts b/projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.ts similarity index 100% rename from projects/account/src/app/profile/new/authentication-step/authentication-step.component.ts rename to projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.ts diff --git a/projects/account/src/app/profile/new/done-step/done-step.component.html b/projects/account/src/app/modules/profile/new/done-step/done-step.component.html similarity index 100% rename from projects/account/src/app/profile/new/done-step/done-step.component.html rename to projects/account/src/app/modules/profile/new/done-step/done-step.component.html diff --git a/projects/account/src/app/profile/new/done-step/done-step.component.scss b/projects/account/src/app/modules/profile/new/done-step/done-step.component.scss similarity index 62% rename from projects/account/src/app/profile/new/done-step/done-step.component.scss rename to projects/account/src/app/modules/profile/new/done-step/done-step.component.scss index 56afd26..71d6db6 100644 --- a/projects/account/src/app/profile/new/done-step/done-step.component.scss +++ b/projects/account/src/app/modules/profile/new/done-step/done-step.component.scss @@ -1,5 +1,5 @@ -@import "../../../../../../../node_modules/@angular/material/theming"; -@import "../../../../../../../src/stylesheets/components/buttons"; +@import "~@angular/material/theming"; +@import "components/buttons"; mat-card { margin-left: auto; diff --git a/projects/account/src/app/profile/new/done-step/done-step.component.ts b/projects/account/src/app/modules/profile/new/done-step/done-step.component.ts similarity index 100% rename from projects/account/src/app/profile/new/done-step/done-step.component.ts rename to projects/account/src/app/modules/profile/new/done-step/done-step.component.ts diff --git a/projects/account/src/app/profile/new/new.component.html b/projects/account/src/app/modules/profile/new/new.component.html similarity index 100% rename from projects/account/src/app/profile/new/new.component.html rename to projects/account/src/app/modules/profile/new/new.component.html diff --git a/projects/account/src/app/profile/new/new.component.scss b/projects/account/src/app/modules/profile/new/new.component.scss similarity index 100% rename from projects/account/src/app/profile/new/new.component.scss rename to projects/account/src/app/modules/profile/new/new.component.scss diff --git a/projects/account/src/app/profile/new/new.component.ts b/projects/account/src/app/modules/profile/new/new.component.ts similarity index 99% rename from projects/account/src/app/profile/new/new.component.ts rename to projects/account/src/app/modules/profile/new/new.component.ts index eaa293f..3a1a8c5 100644 --- a/projects/account/src/app/profile/new/new.component.ts +++ b/projects/account/src/app/modules/profile/new/new.component.ts @@ -17,7 +17,7 @@ import { navigateToLogin, ProfileService, storeRedirect -} from '../../core/http/profile.service'; +} from '@account/http/profile.service'; const noDelay = 0; diff --git a/projects/account/src/app/profile/new/support-step/support-step.component.html b/projects/account/src/app/modules/profile/new/support-step/support-step.component.html similarity index 100% rename from projects/account/src/app/profile/new/support-step/support-step.component.html rename to projects/account/src/app/modules/profile/new/support-step/support-step.component.html diff --git a/projects/account/src/app/profile/new/support-step/support-step.component.scss b/projects/account/src/app/modules/profile/new/support-step/support-step.component.scss similarity index 64% rename from projects/account/src/app/profile/new/support-step/support-step.component.scss rename to projects/account/src/app/modules/profile/new/support-step/support-step.component.scss index 40cb645..71e5197 100644 --- a/projects/account/src/app/profile/new/support-step/support-step.component.scss +++ b/projects/account/src/app/modules/profile/new/support-step/support-step.component.scss @@ -1,6 +1,6 @@ -@import "../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; -@import "../../../../../../../src/stylesheets/components/buttons"; +@import "components/buttons"; .mat-h2 { color: mat-color($mycroft-primary); diff --git a/projects/account/src/app/profile/new/support-step/support-step.component.ts b/projects/account/src/app/modules/profile/new/support-step/support-step.component.ts similarity index 98% rename from projects/account/src/app/profile/new/support-step/support-step.component.ts rename to projects/account/src/app/modules/profile/new/support-step/support-step.component.ts index c14f240..a1ba6a3 100644 --- a/projects/account/src/app/profile/new/support-step/support-step.component.ts +++ b/projects/account/src/app/modules/profile/new/support-step/support-step.component.ts @@ -3,7 +3,7 @@ import { FormGroup } from '@angular/forms'; import { MatBottomSheet } from '@angular/material'; import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '../../../core/http/profile.service'; +import { ProfileService } from '@account/http/profile.service'; import { PaymentComponent } from '../../payment/payment.component'; @Component({ diff --git a/projects/account/src/app/profile/new/username-step/username-step.component.html b/projects/account/src/app/modules/profile/new/username-step/username-step.component.html similarity index 100% rename from projects/account/src/app/profile/new/username-step/username-step.component.html rename to projects/account/src/app/modules/profile/new/username-step/username-step.component.html diff --git a/projects/account/src/app/profile/new/username-step/username-step.component.scss b/projects/account/src/app/modules/profile/new/username-step/username-step.component.scss similarity index 69% rename from projects/account/src/app/profile/new/username-step/username-step.component.scss rename to projects/account/src/app/modules/profile/new/username-step/username-step.component.scss index d0a75ed..18a827b 100644 --- a/projects/account/src/app/profile/new/username-step/username-step.component.scss +++ b/projects/account/src/app/modules/profile/new/username-step/username-step.component.scss @@ -1,6 +1,6 @@ -@import "../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; -@import "../../../../../../../src/stylesheets/components/buttons"; +@import "components/buttons"; .mat-h2 { color: mat-color($mycroft-primary); diff --git a/projects/account/src/app/profile/new/username-step/username-step.component.ts b/projects/account/src/app/modules/profile/new/username-step/username-step.component.ts similarity index 100% rename from projects/account/src/app/profile/new/username-step/username-step.component.ts rename to projects/account/src/app/modules/profile/new/username-step/username-step.component.ts diff --git a/projects/account/src/app/profile/payment/payment.component.html b/projects/account/src/app/modules/profile/payment/payment.component.html similarity index 100% rename from projects/account/src/app/profile/payment/payment.component.html rename to projects/account/src/app/modules/profile/payment/payment.component.html diff --git a/projects/account/src/app/profile/payment/payment.component.scss b/projects/account/src/app/modules/profile/payment/payment.component.scss similarity index 85% rename from projects/account/src/app/profile/payment/payment.component.scss rename to projects/account/src/app/modules/profile/payment/payment.component.scss index 26bb608..f367537 100644 --- a/projects/account/src/app/profile/payment/payment.component.scss +++ b/projects/account/src/app/modules/profile/payment/payment.component.scss @@ -1,6 +1,6 @@ -@import "../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; -@import "../../../../../../src/stylesheets/components/buttons"; +@import "components/buttons"; mat-card { margin-right: auto; diff --git a/projects/account/src/app/profile/payment/payment.component.ts b/projects/account/src/app/modules/profile/payment/payment.component.ts similarity index 98% rename from projects/account/src/app/profile/payment/payment.component.ts rename to projects/account/src/app/modules/profile/payment/payment.component.ts index e2df5bd..c7e7ba0 100644 --- a/projects/account/src/app/profile/payment/payment.component.ts +++ b/projects/account/src/app/modules/profile/payment/payment.component.ts @@ -8,7 +8,7 @@ import { import { ElementOptions, StripeCardComponent, StripeService } from 'ngx-stripe'; -import { ProfileService } from '../../core/http/profile.service'; +import { ProfileService } from '@account/http/profile.service'; import { VerifyCardDialogComponent } from './verify-card-dialog.component'; const twoSeconds = 2000; diff --git a/projects/account/src/app/profile/payment/verify-card-dialog.component.html b/projects/account/src/app/modules/profile/payment/verify-card-dialog.component.html similarity index 100% rename from projects/account/src/app/profile/payment/verify-card-dialog.component.html rename to projects/account/src/app/modules/profile/payment/verify-card-dialog.component.html diff --git a/projects/account/src/app/profile/payment/verify-card-dialog.component.scss b/projects/account/src/app/modules/profile/payment/verify-card-dialog.component.scss similarity index 100% rename from projects/account/src/app/profile/payment/verify-card-dialog.component.scss rename to projects/account/src/app/modules/profile/payment/verify-card-dialog.component.scss diff --git a/projects/account/src/app/profile/payment/verify-card-dialog.component.ts b/projects/account/src/app/modules/profile/payment/verify-card-dialog.component.ts similarity index 66% rename from projects/account/src/app/profile/payment/verify-card-dialog.component.ts rename to projects/account/src/app/modules/profile/payment/verify-card-dialog.component.ts index 77241d6..3462ff8 100644 --- a/projects/account/src/app/profile/payment/verify-card-dialog.component.ts +++ b/projects/account/src/app/modules/profile/payment/verify-card-dialog.component.ts @@ -1,5 +1,4 @@ import { Component } from '@angular/core'; -import { MatDialogRef } from '@angular/material'; @Component({ @@ -8,5 +7,5 @@ import { MatDialogRef } from '@angular/material'; styleUrls: ['./verify-card-dialog.component.scss'] }) export class VerifyCardDialogComponent { - constructor(public dialogRef: MatDialogRef) {} + constructor() {} } diff --git a/projects/account/src/app/profile/profile-routing.module.ts b/projects/account/src/app/modules/profile/profile-routing.module.ts similarity index 81% rename from projects/account/src/app/profile/profile-routing.module.ts rename to projects/account/src/app/modules/profile/profile-routing.module.ts index 73b910a..0c45e58 100644 --- a/projects/account/src/app/profile/profile-routing.module.ts +++ b/projects/account/src/app/modules/profile/profile-routing.module.ts @@ -1,8 +1,8 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { AccountResolverService } from '../core/guards/account-resolver.service'; -import { MembershipResolverService } from '../core/guards/membership-resolver.service'; +import { AccountResolverService } from '../../core/guards/account-resolver.service'; +import { MembershipResolverService } from '../../core/guards/membership-resolver.service'; import { EditComponent } from './edit/edit.component'; import { NewComponent } from './new/new.component'; diff --git a/projects/account/src/app/profile/profile.module.ts b/projects/account/src/app/modules/profile/profile.module.ts similarity index 96% rename from projects/account/src/app/profile/profile.module.ts rename to projects/account/src/app/modules/profile/profile.module.ts index 7bf17e0..f45c154 100644 --- a/projects/account/src/app/profile/profile.module.ts +++ b/projects/account/src/app/modules/profile/profile.module.ts @@ -25,13 +25,13 @@ import { AuthenticationStepComponent } from './new/authentication-step/authentic import { DeleteComponent } from './edit/delete/delete.component'; import { DoneStepComponent } from './new/done-step/done-step.component'; import { EditComponent } from './edit/edit.component'; -import { environment} from '../../environments/environment'; +import { environment} from '../../../environments/environment'; import { LoginComponent } from './edit/login/login.component'; import { MembershipComponent } from './edit/membership/membership.component'; import { MembershipOptionsComponent } from './membership-options/membership-options.component'; import { NewComponent } from './new/new.component'; import { PaymentComponent } from './payment/payment.component'; -import { ProfileService } from '../core/http/profile.service'; +import { ProfileService } from '../../core/http/profile.service'; import { ProfileRoutingModule } from './profile-routing.module'; import { SharedModule } from 'shared'; import { SupportStepComponent } from './new/support-step/support-step.component'; From 7f57622724f520b1f9050e68d28b9d81e94eb12b Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 01:10:45 -0500 Subject: [PATCH 107/163] fixed stylesheet imports --- .../view/add-complete/add-complete.component.scss | 2 +- .../components/view/preferences/preferences.component.scss | 6 +++--- .../device/pages/device-add/device-add.component.scss | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.scss b/projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.scss index c108be6..796e677 100644 --- a/projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.scss +++ b/projects/account/src/app/modules/device/components/view/add-complete/add-complete.component.scss @@ -1,4 +1,4 @@ -@import "../../../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; mat-card { diff --git a/projects/account/src/app/modules/device/components/view/preferences/preferences.component.scss b/projects/account/src/app/modules/device/components/view/preferences/preferences.component.scss index d1dd584..75bff69 100644 --- a/projects/account/src/app/modules/device/components/view/preferences/preferences.component.scss +++ b/projects/account/src/app/modules/device/components/view/preferences/preferences.component.scss @@ -1,7 +1,7 @@ -@import "../../../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; -@import "../../../../../../../../../src/stylesheets/components/buttons"; -@import "../../../../../../../../../src/stylesheets/components/cards"; +@import "components/buttons"; +@import "components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/modules/device/pages/device-add/device-add.component.scss b/projects/account/src/app/modules/device/pages/device-add/device-add.component.scss index 86bcd9b..c021b28 100644 --- a/projects/account/src/app/modules/device/pages/device-add/device-add.component.scss +++ b/projects/account/src/app/modules/device/pages/device-add/device-add.component.scss @@ -1,6 +1,6 @@ -@import "../../../../../../../../node_modules/@angular/material/theming"; +@import "~@angular/material/theming"; @import "mycroft-colors"; -@import "../../../../../../../../src/stylesheets/components/buttons"; +@import "components/buttons"; button { @include action-button-primary; From aeae76ba60251646445a9d0843ba3131b86e2b7f Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 12:22:00 -0500 Subject: [PATCH 108/163] device placement should be a string, not an object --- projects/account/src/app/shared/models/device.model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/shared/models/device.model.ts b/projects/account/src/app/shared/models/device.model.ts index 732e712..3be3631 100644 --- a/projects/account/src/app/shared/models/device.model.ts +++ b/projects/account/src/app/shared/models/device.model.ts @@ -7,7 +7,7 @@ export interface Device { id: string; geography: Geography; name: string; - placement: DeviceAttribute; + placement: string; platform: string; voice: DeviceAttribute; wakeWord: DeviceAttribute; From 21f48983c18b9859f8cd54ca1d2ca9e46d150327 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 16:10:38 -0500 Subject: [PATCH 109/163] add action to navigate to device add --- .../src/lib/account-menu/account-menu.component.html | 2 +- .../globalnav/src/lib/account-menu/account-menu.component.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/globalnav/src/lib/account-menu/account-menu.component.html b/projects/globalnav/src/lib/account-menu/account-menu.component.html index 6dd257e..7079d13 100644 --- a/projects/globalnav/src/lib/account-menu/account-menu.component.html +++ b/projects/globalnav/src/lib/account-menu/account-menu.component.html @@ -32,7 +32,7 @@ Profile - diff --git a/projects/globalnav/src/lib/account-menu/account-menu.component.ts b/projects/globalnav/src/lib/account-menu/account-menu.component.ts index 748c2cc..a7b2956 100644 --- a/projects/globalnav/src/lib/account-menu/account-menu.component.ts +++ b/projects/globalnav/src/lib/account-menu/account-menu.component.ts @@ -52,4 +52,8 @@ export class AccountMenuComponent implements OnInit { navigateToSkills() { window.location.href = this.mycroftUrls.account + '/skills'; } + + navigateToAddDevice() { + window.location.href = this.mycroftUrls.account + '/devices/add'; + } } From 4a5a146536af20d3532ecbea8c315112f989a424 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 22 Mar 2019 16:14:36 -0500 Subject: [PATCH 110/163] fixed typo in mycroft wordpress url definition --- projects/sso/src/environments/environment.prod.ts | 2 +- projects/sso/src/environments/environment.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/sso/src/environments/environment.prod.ts b/projects/sso/src/environments/environment.prod.ts index 092f715..450fd1d 100644 --- a/projects/sso/src/environments/environment.prod.ts +++ b/projects/sso/src/environments/environment.prod.ts @@ -8,7 +8,7 @@ export const environment = { mimic: 'https://mimic.mycroft.ai', singleSignOn: 'https://sso.mycroft.ai', translate: 'https://translate.mycroft.ai', - wordpress: 'https://mycroft.ai' + wordPress: 'https://mycroft.ai' } }; diff --git a/projects/sso/src/environments/environment.test.ts b/projects/sso/src/environments/environment.test.ts index d667885..f60dda4 100644 --- a/projects/sso/src/environments/environment.test.ts +++ b/projects/sso/src/environments/environment.test.ts @@ -8,6 +8,6 @@ export const environment = { mimic: 'http://mimic.mycroft.ai', singleSignOn: 'https://sso.mycroft-test.net', translate: 'https://translate-test.mycroft.ai', - wordpress: 'https://test.mycroft.ai' + wordPress: 'https://test.mycroft.ai' } }; From 21ae05671638052a4081f3d70daf59832b8e21e6 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sat, 23 Mar 2019 18:41:31 -0500 Subject: [PATCH 111/163] got to the previous page in history after device was added --- .../device-add/device-add.component.html | 247 +++++++++--------- .../pages/device-add/device-add.component.ts | 16 +- 2 files changed, 131 insertions(+), 132 deletions(-) diff --git a/projects/account/src/app/modules/device/pages/device-add/device-add.component.html b/projects/account/src/app/modules/device/pages/device-add/device-add.component.html index aff664e..185fa13 100644 --- a/projects/account/src/app/modules/device/pages/device-add/device-add.component.html +++ b/projects/account/src/app/modules/device/pages/device-add/device-add.component.html @@ -1,130 +1,129 @@ + + + + + + + + + - - - - - - - - - - - - - - -
- -
- -
- - -
- - -
- -
-
-
- - -
- - -
- -
-
-
- - - - + +
+ +
- +
- - +
+
- - - - - - - - - - - -
- - -
- -
-
-
- - -
- - -
- -
-
-
- - -
- - -
- -
-
-
- - - - + +
+ +
- +
- - +
+
+ + +
+ + +
+ +
+
+
+ + + + +
+ +
+
+
+ + + + + + + + + + + + +
+ + +
+ +
+
+
+ + +
+ + +
+ +
+
+
+ + +
+ + +
+ +
+
+
+ + + + +
+ +
+
+
diff --git a/projects/account/src/app/modules/device/pages/device-add/device-add.component.ts b/projects/account/src/app/modules/device/pages/device-add/device-add.component.ts index c4a7388..2c3093a 100644 --- a/projects/account/src/app/modules/device/pages/device-add/device-add.component.ts +++ b/projects/account/src/app/modules/device/pages/device-add/device-add.component.ts @@ -1,18 +1,14 @@ import { Component, OnInit } from '@angular/core'; import { MediaChange, MediaObserver } from '@angular/flex-layout'; -import { - FormBuilder, - FormGroup, - Validators -} from '@angular/forms'; +import {FormBuilder, FormGroup, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; import { Subscription } from 'rxjs'; -import { AccountPreferences } from '../../../../shared/models/preferences.model'; -import { DeviceService } from '../../../../core/http/device.service'; -import { AccountDefaults } from '../../../../shared/models/defaults.model'; +import { AccountDefaults } from '@account/models/defaults.model'; +import { AccountPreferences } from '@account/models/preferences.model'; +import { DeviceService } from '@account/http/device.service'; @Component({ selector: 'account-device-add', @@ -114,4 +110,8 @@ export class DeviceAddComponent implements OnInit { onDefaultsSubmit() { this.deviceService.addAccountDefaults(this.defaultsForm).subscribe(); } + + onFinished() { + window.history.back(); + } } From f21ddd7bed0e05133d1ccf78ea134ea50289ab1e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 24 Mar 2019 13:05:00 -0500 Subject: [PATCH 112/163] change production to true for test builds in an effort to improve performance --- projects/account/src/environments/environment.test.ts | 2 +- projects/market/src/environments/environment.test.ts | 2 +- projects/sso/src/environments/environment.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/account/src/environments/environment.test.ts b/projects/account/src/environments/environment.test.ts index 6538946..d92da0f 100644 --- a/projects/account/src/environments/environment.test.ts +++ b/projects/account/src/environments/environment.test.ts @@ -1,5 +1,5 @@ export const environment = { - production: false, + production: true, mycroftUrls: { account: 'https://account.mycroft-test.net', chat: 'https://chat.mycroft.ai', diff --git a/projects/market/src/environments/environment.test.ts b/projects/market/src/environments/environment.test.ts index f60dda4..40ee0ec 100644 --- a/projects/market/src/environments/environment.test.ts +++ b/projects/market/src/environments/environment.test.ts @@ -1,5 +1,5 @@ export const environment = { - production: false, + production: true, mycroftUrls: { account: 'https://account.mycroft-test.net', chat: 'https://chat.mycroft.ai', diff --git a/projects/sso/src/environments/environment.test.ts b/projects/sso/src/environments/environment.test.ts index f60dda4..40ee0ec 100644 --- a/projects/sso/src/environments/environment.test.ts +++ b/projects/sso/src/environments/environment.test.ts @@ -1,5 +1,5 @@ export const environment = { - production: false, + production: true, mycroftUrls: { account: 'https://account.mycroft-test.net', chat: 'https://chat.mycroft.ai', From c415c1b6273b6b9821b82bde5cebff15f879b1af Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 24 Mar 2019 13:54:04 -0500 Subject: [PATCH 113/163] another hack at optimization --- .../src/app/skill/skill-panel/skill-panel.component.html | 5 +++-- projects/account/src/environments/environment.test.ts | 2 +- projects/market/src/environments/environment.test.ts | 2 +- projects/sso/src/environments/environment.test.ts | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/projects/account/src/app/skill/skill-panel/skill-panel.component.html b/projects/account/src/app/skill/skill-panel/skill-panel.component.html index a54a9bf..ed29941 100644 --- a/projects/account/src/app/skill/skill-panel/skill-panel.component.html +++ b/projects/account/src/app/skill/skill-panel/skill-panel.component.html @@ -9,8 +9,9 @@ - - + + + Date: Sun, 24 Mar 2019 14:09:44 -0500 Subject: [PATCH 114/163] another hack at optimization --- angular.json | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/angular.json b/angular.json index 83b7ba2..fb47d9a 100644 --- a/angular.json +++ b/angular.json @@ -87,7 +87,6 @@ "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", - "karmaConfig": "src/karma.conf.js", "styles": [ "src/styles.scss", "src/theme.scss" @@ -393,7 +392,8 @@ "namedChunks": false, "aot": true, "extractLicenses": true, - "vendorChunk": false, + "vendorChunk": true, + "commonChunk": true, "buildOptimizer": true, "budgets": [ { @@ -410,7 +410,16 @@ "with": "projects/sso/src/environments/environment.test.ts" } ], - "outputHashing": "all" + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": true, + "commonChunk": true, + "buildOptimizer": true }, "development": { "fileReplacements": [ @@ -608,6 +617,7 @@ "aot": true, "extractLicenses": true, "vendorChunk": false, + "commonChunk": true, "buildOptimizer": true, "budgets": [ { @@ -632,7 +642,16 @@ "with": "projects/account/src/environments/environment.test.ts" } ], - "outputHashing": "all" + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": true, + "aot": true, + "extractLicenses": true, + "vendorChunk": true, + "commonChunk": true, + "buildOptimizer": true } } }, From b6aea0c4b89093a138fff6b0884877e2bc7acd82 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 24 Mar 2019 14:19:12 -0500 Subject: [PATCH 115/163] fixed a compile error --- .../modules/profile/new/support-step/support-step.component.html | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/account/src/app/modules/profile/new/support-step/support-step.component.html b/projects/account/src/app/modules/profile/new/support-step/support-step.component.html index e805959..58b28ec 100644 --- a/projects/account/src/app/modules/profile/new/support-step/support-step.component.html +++ b/projects/account/src/app/modules/profile/new/support-step/support-step.component.html @@ -4,7 +4,6 @@ {{paragraph}}

From 7cf78a6d1109b3fa8148ccd09c596a4e17702b1e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 24 Mar 2019 14:25:29 -0500 Subject: [PATCH 116/163] fixed a compile error --- .../federated-login/federated-login.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/sso/src/app/login/federated-login/federated-login.component.ts b/projects/sso/src/app/login/federated-login/federated-login.component.ts index f4bce0d..39026fd 100644 --- a/projects/sso/src/app/login/federated-login/federated-login.component.ts +++ b/projects/sso/src/app/login/federated-login/federated-login.component.ts @@ -23,7 +23,7 @@ export class FederatedLoginComponent implements OnInit { ngOnInit() { } - private validateFederatedLogin(loginToken: FederatedLoginToken) { + validateFederatedLogin(loginToken: FederatedLoginToken) { this.ssoService.validateFederatedLogin(loginToken).subscribe( (response) => { this.ssoService.navigateToRedirectURI(noDelay); }, (response) => { this.onAuthFailure(response); } @@ -40,9 +40,9 @@ export class FederatedLoginComponent implements OnInit { } } - private gitHubLogin() { - const githubLoginUrl = 'https://github.com/login/oauth/authorize' + - '?scope=user:email&client_id=752bb0864dd667c902f4'; - window.location.assign(githubLoginUrl); - } + // private gitHubLogin() { + // const githubLoginUrl = 'https://github.com/login/oauth/authorize' + + // '?scope=user:email&client_id=752bb0864dd667c902f4'; + // window.location.assign(githubLoginUrl); + // } } From c7d2afcf6906aa9f7e9058b93ec1760b2c1698c9 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 24 Mar 2019 15:25:01 -0500 Subject: [PATCH 117/163] alphabetized imports, cuz that's how I roll --- .../src/app/modules/device/device.module.ts | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/projects/account/src/app/modules/device/device.module.ts b/projects/account/src/app/modules/device/device.module.ts index 1d00fd5..45a0d06 100644 --- a/projects/account/src/app/modules/device/device.module.ts +++ b/projects/account/src/app/modules/device/device.module.ts @@ -18,38 +18,38 @@ import { import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { DeviceRoutingModule } from './device-routing.module'; -import { DeviceService } from '@account/http/device.service'; -import { PreferencesComponent } from './components/view/preferences/preferences.component'; -import { RemoveComponent } from './remove/remove.component'; -import { SharedModule } from '../../shared/shared.module'; -import { DeviceAddComponent } from './pages/device-add/device-add.component'; -import { DeviceListComponent } from './components/view/device-list/device-list.component'; -import { DeviceEditComponent } from './device-edit/device-edit.component'; +import { AddCompleteComponent } from './components/view/add-complete/add-complete.component'; import { CityInputComponent } from './components/input/city-input/city-input.component'; import { CountryInputComponent } from './components/input/country-input/country-input.component'; -import { RegionInputComponent } from './components/input/region-input/region-input.component'; -import { TimezoneInputComponent } from './components/input/timezone-input/timezone-input.component'; -import { AddCompleteComponent } from './components/view/add-complete/add-complete.component'; -import { DevicesComponent } from './pages/devices/devices.component'; -import { DeviceInfoComponent } from './components/view/device-info/device-info.component'; import { DefaultsComponent } from './components/view/defaults/defaults.component'; +import { DeviceAddComponent } from './pages/device-add/device-add.component'; +import { DeviceEditComponent } from './device-edit/device-edit.component'; +import { DeviceInfoComponent } from './components/view/device-info/device-info.component'; +import { DeviceListComponent } from './components/view/device-list/device-list.component'; +import { DeviceRoutingModule } from './device-routing.module'; +import { DevicesComponent } from './pages/devices/devices.component'; +import { DeviceService } from '@account/http/device.service'; +import { PreferencesComponent } from './components/view/preferences/preferences.component'; +import { RegionInputComponent } from './components/input/region-input/region-input.component'; +import { RemoveComponent } from './remove/remove.component'; +import { SharedModule } from '../../shared/shared.module'; +import { TimezoneInputComponent } from './components/input/timezone-input/timezone-input.component'; @NgModule({ declarations: [ - DeviceListComponent, - RemoveComponent, - PreferencesComponent, - DeviceAddComponent, - DeviceEditComponent, + AddCompleteComponent, CityInputComponent, CountryInputComponent, - RegionInputComponent, - TimezoneInputComponent, - AddCompleteComponent, - DevicesComponent, - DeviceInfoComponent, DefaultsComponent, + DeviceAddComponent, + DeviceEditComponent, + DeviceInfoComponent, + DeviceListComponent, + DevicesComponent, + PreferencesComponent, + RegionInputComponent, + RemoveComponent, + TimezoneInputComponent, ], entryComponents: [ DeviceAddComponent, From 4110c13fc467d6569cb9fd6df08b5114526a0853 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 11:15:08 -0500 Subject: [PATCH 118/163] fixed indentation issue --- .../globalnav/src/lib/account-menu/account-menu.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/globalnav/src/lib/account-menu/account-menu.component.ts b/projects/globalnav/src/lib/account-menu/account-menu.component.ts index a7b2956..f182202 100644 --- a/projects/globalnav/src/lib/account-menu/account-menu.component.ts +++ b/projects/globalnav/src/lib/account-menu/account-menu.component.ts @@ -27,7 +27,7 @@ export class AccountMenuComponent implements OnInit { constructor() { } ngOnInit() { - } + } navigateToDevices() { window.location.href = this.mycroftUrls.account + '/devices'; From efbb7b2ee5aff43b0f0bd909aa6ad06e9695b121 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 11:42:53 -0500 Subject: [PATCH 119/163] Added a landing page for account.mycroft.ai. --- .../account/src/app/app-routing.module.ts | 5 ++++- projects/account/src/app/app.module.ts | 2 ++ .../dashboard/dashboard.component.html | 12 ++++++++++ .../dashboard/dashboard.component.scss | 5 +++++ .../modules/dashboard/dashboard.component.ts | 22 +++++++++++++++++++ .../app/modules/dashboard/dashboard.module.ts | 17 ++++++++++++++ 6 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 projects/account/src/app/modules/dashboard/dashboard.component.html create mode 100644 projects/account/src/app/modules/dashboard/dashboard.component.scss create mode 100644 projects/account/src/app/modules/dashboard/dashboard.component.ts create mode 100644 projects/account/src/app/modules/dashboard/dashboard.module.ts diff --git a/projects/account/src/app/app-routing.module.ts b/projects/account/src/app/app-routing.module.ts index 4423d31..93b6885 100644 --- a/projects/account/src/app/app-routing.module.ts +++ b/projects/account/src/app/app-routing.module.ts @@ -1,10 +1,13 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; +import { AccountResolverService } from './core/guards/account-resolver.service'; +import { DashboardComponent } from './modules/dashboard/dashboard.component'; import { PageNotFoundComponent } from 'page-not-found'; const routes: Routes = [ - { path: '', redirectTo: '/profile', pathMatch: 'full' }, + { path: 'dashboard', component: DashboardComponent, resolve: {account: AccountResolverService} }, + { path: '', redirectTo: '/dashboard', pathMatch: 'full'}, { path: '**', component: PageNotFoundComponent } ]; diff --git a/projects/account/src/app/app.module.ts b/projects/account/src/app/app.module.ts index 9501bf0..3fcf0fe 100644 --- a/projects/account/src/app/app.module.ts +++ b/projects/account/src/app/app.module.ts @@ -5,6 +5,7 @@ import { NgModule } from '@angular/core'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; +import { DashboardModule } from './modules/dashboard/dashboard.module'; import { GlobalnavModule } from 'globalnav'; import { PageNotFoundModule } from 'page-not-found'; import { DeviceModule } from './modules/device/device.module'; @@ -18,6 +19,7 @@ import { SkillModule } from './skill/skill.module'; imports: [ BrowserModule, BrowserAnimationsModule, + DashboardModule, GlobalnavModule, HttpClientModule, DeviceModule, diff --git a/projects/account/src/app/modules/dashboard/dashboard.component.html b/projects/account/src/app/modules/dashboard/dashboard.component.html new file mode 100644 index 0000000..9c9da91 --- /dev/null +++ b/projects/account/src/app/modules/dashboard/dashboard.component.html @@ -0,0 +1,12 @@ + + diff --git a/projects/account/src/app/modules/dashboard/dashboard.component.scss b/projects/account/src/app/modules/dashboard/dashboard.component.scss new file mode 100644 index 0000000..0f48fb3 --- /dev/null +++ b/projects/account/src/app/modules/dashboard/dashboard.component.scss @@ -0,0 +1,5 @@ +iframe { + min-width: 350px; + width: 100%; + height: 100vh; +} diff --git a/projects/account/src/app/modules/dashboard/dashboard.component.ts b/projects/account/src/app/modules/dashboard/dashboard.component.ts new file mode 100644 index 0000000..5268166 --- /dev/null +++ b/projects/account/src/app/modules/dashboard/dashboard.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { Account } from '../../shared/models/account.model'; + +@Component({ + selector: 'account-dashboard', + templateUrl: './dashboard.component.html', + styleUrls: ['./dashboard.component.scss'] +}) +export class DashboardComponent implements OnInit { + public account: Account; + + constructor(private route: ActivatedRoute) { + } + + ngOnInit() { + this.route.data.subscribe( + (data: {account: Account}) => { this.account = data.account; } + ); + } +} diff --git a/projects/account/src/app/modules/dashboard/dashboard.module.ts b/projects/account/src/app/modules/dashboard/dashboard.module.ts new file mode 100644 index 0000000..0d940b3 --- /dev/null +++ b/projects/account/src/app/modules/dashboard/dashboard.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { DashboardComponent } from './dashboard.component'; + +@NgModule({ + declarations: [ + DashboardComponent + ], + entryComponents: [ + DashboardComponent, + ], + imports: [ + CommonModule + ] +}) +export class DashboardModule { } From 8b70dc79fdfb358f6a68b4453e3a1abf915580f3 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 13:24:23 -0500 Subject: [PATCH 120/163] replaced logo with new version and fixed alignment --- .../src/lib/globalnav.component.html | 4 +- .../src/lib/globalnav.component.scss | 8 ++-- projects/globalnav/src/lib/toolbar-logo.png | Bin 0 -> 3374 bytes projects/globalnav/src/lib/toolbar-logo.svg | 36 ------------------ 4 files changed, 6 insertions(+), 42 deletions(-) create mode 100644 projects/globalnav/src/lib/toolbar-logo.png delete mode 100644 projects/globalnav/src/lib/toolbar-logo.svg diff --git a/projects/globalnav/src/lib/globalnav.component.html b/projects/globalnav/src/lib/globalnav.component.html index fe182d1..cfffc53 100644 --- a/projects/globalnav/src/lib/globalnav.component.html +++ b/projects/globalnav/src/lib/globalnav.component.html @@ -1,4 +1,4 @@ - + - - - - - - - - - - - - - - - - - From 50a9de39c138143c0a84676d964d54d908cc7b19 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 15:57:13 -0500 Subject: [PATCH 121/163] replaced png with svg --- .../globalnav/src/lib/globalnav.component.scss | 2 +- projects/globalnav/src/lib/toolbar-logo.png | Bin 3374 -> 0 bytes projects/globalnav/src/lib/toolbar-logo.svg | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 projects/globalnav/src/lib/toolbar-logo.png create mode 100644 projects/globalnav/src/lib/toolbar-logo.svg diff --git a/projects/globalnav/src/lib/globalnav.component.scss b/projects/globalnav/src/lib/globalnav.component.scss index 470449d..3409e13 100644 --- a/projects/globalnav/src/lib/globalnav.component.scss +++ b/projects/globalnav/src/lib/globalnav.component.scss @@ -15,7 +15,7 @@ mat-toolbar { // Use inline css to display the logo at top of sidebar because Angular // libraries do not support static assets yet. .mycroft-logo { - background: url("toolbar-logo.png") no-repeat; + background: url("toolbar-logo.svg") no-repeat; height: 25px; width: 125px; } diff --git a/projects/globalnav/src/lib/toolbar-logo.png b/projects/globalnav/src/lib/toolbar-logo.png deleted file mode 100644 index 4927c023f2008b209d66b916448197f850970538..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3374 zcmY*cXIK+R*CmM%igcs~X)2&VK$?V(1VoyED^&;}Lg<^&ds{(z6$BJTg;fM$DM4ze z0qI5QNu()C2|YjpFSz^d_rCKyckaxYGv~~`|K{->6MbezenuJ^8fJrAy5^@j{51IJ z=}u?Jk_hrN0nq09Iy4o7kd@O7gYPYCGz|?C=UD(~@(X!S3D(HFR(@8-Mlfd|FB!)N zK29z&L0-P6Y#JK1AlT{B%f-)8ILOP>8x0Fm7yZS6ovzPdsHpHSil2wNsFm>@;hR1v z7hy#i1sPdU4Mt&MVKvl)hcI(py??Hs?$kxy{QP`jP-tLapiH2=j1S5cDyO2N0+qcE zy?$N#lp&1{_V#lOlJ-W6{Vno;I=U`sXB5)c59#AAe5UK@>5OW>8_s^jqdNYd%b4%($GfIDy3yOaUV0O|>QBK(v#HOLZ`RMyMer#N=GKU!ZOP-AEm8Zy}mSfc|blcS6ElE z_;0GDR+@WlJup{8)#gbDe>z4r(!Z--`PqpFISAdcPtInsg$^%exw0%oGg%uRCXX-( z0V6;qu{Bdfs#bi}_?0qVG5xODdvka)N_0jqlr2o&9XnY!p8jb0)?R;$u3gzdi)BQNtB5|k;+-@!^Jc!S; zpR_SCH-0|E5g|e93#Z*I^D-$cohmHISXy}?rrM&81!G$l?p=2Sg=lw%1jYIP$Z~Op zWbMkwhhI4O+^AC{`Q?2zxnXwNTp$iW^d>3rzGcUw240pT$g-qMRx~UI4EdX!BRqg4 zs~Y{Z0I~EU;HzrF{N;8f#(r=amag(*6R?6d_IymEh1djQ@iO0s4gyVI+fAZAmf5ku z&!cV55vhTa<(q6VD!8)_cEFU!ts0L>nOhV^w{S?&`T&o(H=@B&1?>SAZ8ju+Ur%VX zE0z&KaVLr1ki=n{pYG&7R;n6Vb>;9K>_~~m%#MCvIe3%?Kx0SXGT98mZe}KTjOyq; zuSDDce$DEL53{c$6wY9b&J_v36CZbr+Knib61pgOu+)pLj4#pEs6ngFh0Idx)zAzc zVA2oi%j%3xa^@oGV|GMP6g+d*s=95bzbFbkP+1<=W|2>S@Ek&n3D$yq5Q>Jz+G?u_ z$aG&Pu@dX?;LHLntp24C09U|^H!pkWv)jtfqzTM3-J;P`f2FsS5@DU_t}rP1my_=| z!;Hl~*oc@J*V-i4=fd>)8ps6a6lPrX)`*5N9ku3xm%{qH#obGW(5Q?TcEs@EA%M)H zVNQTtD&b*h@{mqF?g}jLqt4xI_6Oi6N6R9q2d)lmORO z!5s(*^+f;8uVpBw1-4!7y*hUM=*8rE$2ndk8oMwYQed$18ppDGbC5x;$g#L3%#kdT zrNK{ZvE*zMBNl1h7DAJDUf!gH_e26pIW+n2AF*N)zKRV=8wKvInslSOtM-w2E*U+* zGx9O5TC*TyvTEY6&EWhkP5=I z=5NHW+rZKi;Km-dq^)8PJJw~Oxc~L^d9FW?OpX~lb5WN{TAj?K-ucNX@yv5nvh)MF zhg0T7&x0fNA|Ky4nv7c|EYVilHq{tZ>N~`7XLm<$+^@W1>nvAvwYb4wAhC%j55xi@ zfVCswN6K{v3%4V9gZXYeK0d<6IxUosY87DGzz9K-fXG3HG^NDtoMo<(vNa~9bNpC9 zcP|jJxNcC;b1(-X0PwT-gh}O$$jdPWpK#Qbtc znCz_cMP=-&is71=X_zg{PGYz7Kw*)B&S( zmoVT(UU1&Dxwd87=o9|)<4XeCM28y@dek|$3~z- z3&{gq3pH#=$FFY_a_ZPirv`|<$zyM!i<>=onq?HrA)c-kyqppnL+@bF@DwJ z=R~XWUqhd4NXon_E z>olBk0Nh8$pb({Yr)pE3J#G?c>=+z-Et(7M>8`pwp&Y`rfT~gt8-)`EiM+Y7U$MJt z7jC6u8d`eI6!kKilxEdkOa5H0ttw0v>I+$Ic<=3UUW)qxysqVmO2zy@bvkRz2ZR7p z`)kB3Iik_2Wl5$kYnM7E6pU`@4711uYHCqscWUk%tjbMNZY0A)xEsR{%?>WsLw10_ zC2E8TXo9&j#l0^(zq0SE{6Lq~)|Dzw#1aHgMUoMle*+Sb`Q> zI-002(A&Fof)ZEQQ?m={xQ8&*?MwBH5xjX!F-~l49rnv+<3v35^)>E|Zz|*f&)CiK zUeNB{gC~uX1*8-(kMP89j`tPHarJU!&psz2QXaitgCOJKMYMb1iB}FlO`iH-X(QO~ zBy|ES@?Dw6r+7!oF=>F!`Bni#qxjIi2KBM-5y_+CmDho4jR*#fmdZ3OQ2@=j5Ori} zjX=*SjcsNKuJqzoVlQtJ-pS~B`NR_K_l;Q9znaV5=gTwZPRsX{vP)4!u#vU-=jjlp zYw2m{*5?V)l3IzIO10%#iLS_tsW_};je4w|{bOWwEm^<}lU-nU2OIR7}xqaC>MRGsif#}Jr$$K$lBq0#% zZDqdOo~bp?bR3JelLU#Nt5?H#$%;2bXPhSvKHRee1Uj&PfW-OG=P~b%(WU)yTjYD! zLoE$nBU+|5ClVx&wFNxd-ad9AAAN8)^#n=Mk#>HfbEBj7yoE??dz4n!tZgV)b|9*R zinHgjtjk%N4G{7y0)Vs(*~MH{?FT-~RJfniuYC&sff}Fkw5YY*Md2^$Ymrz0sy&F~ z294<{O#{rcrPcm@gF{NIm#w8AxUqR}>)cGOG%gN83*9Dt-t<~pPi&pF?C}rJ@tXN$ sn=0KWgqg$jR*4;6-9LKU#Cew(N$G#1jtMXsI{U;Jz)f^3bPzHB0ix4g$N&HU diff --git a/projects/globalnav/src/lib/toolbar-logo.svg b/projects/globalnav/src/lib/toolbar-logo.svg new file mode 100644 index 0000000..68bc419 --- /dev/null +++ b/projects/globalnav/src/lib/toolbar-logo.svg @@ -0,0 +1 @@ +Artboard 2 From 0c9c56a7b52942a014186da6827a59604142337a Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 18:26:44 -0500 Subject: [PATCH 122/163] pass the idToken to the backend instead of the token --- .../shared/src/lib/google-button/google-button.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/shared/src/lib/google-button/google-button.component.ts b/projects/shared/src/lib/google-button/google-button.component.ts index bcf2df7..1802682 100644 --- a/projects/shared/src/lib/google-button/google-button.component.ts +++ b/projects/shared/src/lib/google-button/google-button.component.ts @@ -20,7 +20,7 @@ export class GoogleButtonComponent { const platformProvider = GoogleLoginProvider.PROVIDER_ID; this.authService.signIn(platformProvider).then( (userData) => { - this.googleToken.emit({platform: 'Google', token: userData.token}); + this.googleToken.emit({platform: 'Google', token: userData.idToken}); } ); } From fe955c5e15c9383eeb4ecb50b3162119e2d0e34a Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 18:35:57 -0500 Subject: [PATCH 123/163] minor refactoring --- .../federated-login/federated-login.component.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/projects/sso/src/app/login/federated-login/federated-login.component.ts b/projects/sso/src/app/login/federated-login/federated-login.component.ts index 39026fd..d9c83b4 100644 --- a/projects/sso/src/app/login/federated-login/federated-login.component.ts +++ b/projects/sso/src/app/login/federated-login/federated-login.component.ts @@ -9,9 +9,9 @@ const noDelay = 0; const tenSeconds = 10000; @Component({ - selector: 'sso-federated-login', - templateUrl: './federated-login.component.html', - styleUrls: ['./federated-login.component.scss'] + selector: 'sso-federated-login', + templateUrl: './federated-login.component.html', + styleUrls: ['./federated-login.component.scss'] }) export class FederatedLoginComponent implements OnInit { public githubIcon = faGithub; @@ -19,13 +19,15 @@ export class FederatedLoginComponent implements OnInit { constructor( private errorSnackBar: MatSnackBar, private ssoService: AppService - ) { } + ) { + } - ngOnInit() { } + ngOnInit() { + } validateFederatedLogin(loginToken: FederatedLoginToken) { this.ssoService.validateFederatedLogin(loginToken).subscribe( - (response) => { this.ssoService.navigateToRedirectURI(noDelay); }, + () => { this.ssoService.navigateToRedirectURI(noDelay); }, (response) => { this.onAuthFailure(response); } ); } From 4e50f9be3c659162fd9db9254e403cfc93fd73c9 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 19:15:40 -0500 Subject: [PATCH 124/163] added a "$" in front of the membership dollar amounts --- .../membership-options/membership-options.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/modules/profile/membership-options/membership-options.component.html b/projects/account/src/app/modules/profile/membership-options/membership-options.component.html index f3c4315..8b5efc8 100644 --- a/projects/account/src/app/modules/profile/membership-options/membership-options.component.html +++ b/projects/account/src/app/modules/profile/membership-options/membership-options.component.html @@ -9,7 +9,7 @@ [value]="membership.type" >

{{membership.type}}

-

{{membership.rate}} USD

+

${{membership.rate}} USD

Maybe Later

From 4e58633e3ae9ef1e28196e67540b86642c36ecfe Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 19:27:04 -0500 Subject: [PATCH 125/163] refactored directory structure --- .../agreements/agreements.component.html | 0 .../agreements/agreements.component.scss | 2 +- .../cards}/agreements/agreements.component.ts | 2 +- .../cards}/delete/delete.component.html | 0 .../cards}/delete/delete.component.scss | 0 .../cards}/delete/delete.component.ts | 0 .../cards}/login/login.component.html | 0 .../cards}/login/login.component.scss | 6 ++-- .../cards}/login/login.component.ts | 2 +- .../membership/membership.component.html | 0 .../membership/membership.component.scss | 4 +-- .../cards}/membership/membership.component.ts | 8 ++--- .../membership-options.component.html | 0 .../membership-options.component.scss | 0 .../membership-options.component.ts | 6 ++-- .../agreement-step.component.html | 0 .../agreement-step.component.scss | 4 +-- .../agreement-step.component.ts | 2 +- .../authentication-step.component.html | 0 .../authentication-step.component.scss | 2 +- .../authentication-step.component.ts | 0 .../views}/done-step/done-step.component.html | 0 .../views}/done-step/done-step.component.scss | 4 +-- .../views}/done-step/done-step.component.ts | 0 .../views}/payment/payment.component.html | 0 .../views}/payment/payment.component.scss | 4 +-- .../views}/payment/payment.component.ts | 2 +- .../payment/verify-card-dialog.component.html | 0 .../payment/verify-card-dialog.component.scss | 0 .../payment/verify-card-dialog.component.ts | 0 .../support-step/support-step.component.html | 0 .../support-step/support-step.component.scss | 4 +-- .../support-step/support-step.component.ts | 6 ++-- .../username-step.component.html | 0 .../username-step.component.scss | 4 +-- .../username-step/username-step.component.ts | 0 .../{ => pages}/edit/edit.component.html | 0 .../{ => pages}/edit/edit.component.scss | 0 .../{ => pages}/edit/edit.component.ts | 6 ++-- .../{ => pages}/new/new.component.html | 0 .../{ => pages}/new/new.component.scss | 4 +-- .../profile/{ => pages}/new/new.component.ts | 4 +-- .../modules/profile/profile-routing.module.ts | 4 +-- .../src/app/modules/profile/profile.module.ts | 30 +++++++++---------- 44 files changed, 55 insertions(+), 55 deletions(-) rename projects/account/src/app/modules/profile/{edit => components/cards}/agreements/agreements.component.html (100%) rename projects/account/src/app/modules/profile/{edit => components/cards}/agreements/agreements.component.scss (87%) rename projects/account/src/app/modules/profile/{edit => components/cards}/agreements/agreements.component.ts (83%) rename projects/account/src/app/modules/profile/{edit => components/cards}/delete/delete.component.html (100%) rename projects/account/src/app/modules/profile/{edit => components/cards}/delete/delete.component.scss (100%) rename projects/account/src/app/modules/profile/{edit => components/cards}/delete/delete.component.ts (100%) rename projects/account/src/app/modules/profile/{edit => components/cards}/login/login.component.html (100%) rename projects/account/src/app/modules/profile/{edit => components/cards}/login/login.component.scss (69%) rename projects/account/src/app/modules/profile/{edit => components/cards}/login/login.component.ts (79%) rename projects/account/src/app/modules/profile/{edit => components/cards}/membership/membership.component.html (100%) rename projects/account/src/app/modules/profile/{edit => components/cards}/membership/membership.component.scss (71%) rename projects/account/src/app/modules/profile/{edit => components/cards}/membership/membership.component.ts (88%) rename projects/account/src/app/modules/profile/{ => components/controls}/membership-options/membership-options.component.html (100%) rename projects/account/src/app/modules/profile/{ => components/controls}/membership-options/membership-options.component.scss (100%) rename projects/account/src/app/modules/profile/{ => components/controls}/membership-options/membership-options.component.ts (87%) rename projects/account/src/app/modules/profile/{new => components/views}/agreement-step/agreement-step.component.html (100%) rename projects/account/src/app/modules/profile/{new => components/views}/agreement-step/agreement-step.component.scss (78%) rename projects/account/src/app/modules/profile/{new => components/views}/agreement-step/agreement-step.component.ts (95%) rename projects/account/src/app/modules/profile/{new => components/views}/authentication-step/authentication-step.component.html (100%) rename projects/account/src/app/modules/profile/{new => components/views}/authentication-step/authentication-step.component.scss (84%) rename projects/account/src/app/modules/profile/{new => components/views}/authentication-step/authentication-step.component.ts (100%) rename projects/account/src/app/modules/profile/{new => components/views}/done-step/done-step.component.html (100%) rename projects/account/src/app/modules/profile/{new => components/views}/done-step/done-step.component.scss (60%) rename projects/account/src/app/modules/profile/{new => components/views}/done-step/done-step.component.ts (100%) rename projects/account/src/app/modules/profile/{ => components/views}/payment/payment.component.html (100%) rename projects/account/src/app/modules/profile/{ => components/views}/payment/payment.component.scss (83%) rename projects/account/src/app/modules/profile/{ => components/views}/payment/payment.component.ts (97%) rename projects/account/src/app/modules/profile/{ => components/views}/payment/verify-card-dialog.component.html (100%) rename projects/account/src/app/modules/profile/{ => components/views}/payment/verify-card-dialog.component.scss (100%) rename projects/account/src/app/modules/profile/{ => components/views}/payment/verify-card-dialog.component.ts (100%) rename projects/account/src/app/modules/profile/{new => components/views}/support-step/support-step.component.html (100%) rename projects/account/src/app/modules/profile/{new => components/views}/support-step/support-step.component.scss (62%) rename projects/account/src/app/modules/profile/{new => components/views}/support-step/support-step.component.ts (95%) rename projects/account/src/app/modules/profile/{new => components/views}/username-step/username-step.component.html (100%) rename projects/account/src/app/modules/profile/{new => components/views}/username-step/username-step.component.scss (67%) rename projects/account/src/app/modules/profile/{new => components/views}/username-step/username-step.component.ts (100%) rename projects/account/src/app/modules/profile/{ => pages}/edit/edit.component.html (100%) rename projects/account/src/app/modules/profile/{ => pages}/edit/edit.component.scss (100%) rename projects/account/src/app/modules/profile/{ => pages}/edit/edit.component.ts (77%) rename projects/account/src/app/modules/profile/{ => pages}/new/new.component.html (100%) rename projects/account/src/app/modules/profile/{ => pages}/new/new.component.scss (63%) rename projects/account/src/app/modules/profile/{ => pages}/new/new.component.ts (97%) diff --git a/projects/account/src/app/modules/profile/edit/agreements/agreements.component.html b/projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.html similarity index 100% rename from projects/account/src/app/modules/profile/edit/agreements/agreements.component.html rename to projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.html diff --git a/projects/account/src/app/modules/profile/edit/agreements/agreements.component.scss b/projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.scss similarity index 87% rename from projects/account/src/app/modules/profile/edit/agreements/agreements.component.scss rename to projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.scss index e7b9d82..5fe1579 100644 --- a/projects/account/src/app/modules/profile/edit/agreements/agreements.component.scss +++ b/projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.scss @@ -1,4 +1,4 @@ -@import "components/cards"; +@import "../../../../../../../../../src/stylesheets/components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/modules/profile/edit/agreements/agreements.component.ts b/projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.ts similarity index 83% rename from projects/account/src/app/modules/profile/edit/agreements/agreements.component.ts rename to projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.ts index df93b54..14227f1 100644 --- a/projects/account/src/app/modules/profile/edit/agreements/agreements.component.ts +++ b/projects/account/src/app/modules/profile/components/cards/agreements/agreements.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import { Account } from '@account/models/account.model'; +import { Account } from '../../../../../shared/models/account.model'; @Component({ selector: 'account-agreements-edit', diff --git a/projects/account/src/app/modules/profile/edit/delete/delete.component.html b/projects/account/src/app/modules/profile/components/cards/delete/delete.component.html similarity index 100% rename from projects/account/src/app/modules/profile/edit/delete/delete.component.html rename to projects/account/src/app/modules/profile/components/cards/delete/delete.component.html diff --git a/projects/account/src/app/modules/profile/edit/delete/delete.component.scss b/projects/account/src/app/modules/profile/components/cards/delete/delete.component.scss similarity index 100% rename from projects/account/src/app/modules/profile/edit/delete/delete.component.scss rename to projects/account/src/app/modules/profile/components/cards/delete/delete.component.scss diff --git a/projects/account/src/app/modules/profile/edit/delete/delete.component.ts b/projects/account/src/app/modules/profile/components/cards/delete/delete.component.ts similarity index 100% rename from projects/account/src/app/modules/profile/edit/delete/delete.component.ts rename to projects/account/src/app/modules/profile/components/cards/delete/delete.component.ts diff --git a/projects/account/src/app/modules/profile/edit/login/login.component.html b/projects/account/src/app/modules/profile/components/cards/login/login.component.html similarity index 100% rename from projects/account/src/app/modules/profile/edit/login/login.component.html rename to projects/account/src/app/modules/profile/components/cards/login/login.component.html diff --git a/projects/account/src/app/modules/profile/edit/login/login.component.scss b/projects/account/src/app/modules/profile/components/cards/login/login.component.scss similarity index 69% rename from projects/account/src/app/modules/profile/edit/login/login.component.scss rename to projects/account/src/app/modules/profile/components/cards/login/login.component.scss index b9f193d..c0ff9b3 100644 --- a/projects/account/src/app/modules/profile/edit/login/login.component.scss +++ b/projects/account/src/app/modules/profile/components/cards/login/login.component.scss @@ -1,7 +1,7 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "components/buttons"; -@import "components/cards"; +@import "../../../../../../../../../src/stylesheets/components/buttons"; +@import "../../../../../../../../../src/stylesheets/components/cards"; mat-card { diff --git a/projects/account/src/app/modules/profile/edit/login/login.component.ts b/projects/account/src/app/modules/profile/components/cards/login/login.component.ts similarity index 79% rename from projects/account/src/app/modules/profile/edit/login/login.component.ts rename to projects/account/src/app/modules/profile/components/cards/login/login.component.ts index 79793d1..d93601c 100644 --- a/projects/account/src/app/modules/profile/edit/login/login.component.ts +++ b/projects/account/src/app/modules/profile/components/cards/login/login.component.ts @@ -1,6 +1,6 @@ import { Component, Input } from '@angular/core'; -import { Account } from '@account/models/account.model'; +import { Account } from '../../../../../shared/models/account.model'; @Component({ selector: 'account-login-edit', diff --git a/projects/account/src/app/modules/profile/edit/membership/membership.component.html b/projects/account/src/app/modules/profile/components/cards/membership/membership.component.html similarity index 100% rename from projects/account/src/app/modules/profile/edit/membership/membership.component.html rename to projects/account/src/app/modules/profile/components/cards/membership/membership.component.html diff --git a/projects/account/src/app/modules/profile/edit/membership/membership.component.scss b/projects/account/src/app/modules/profile/components/cards/membership/membership.component.scss similarity index 71% rename from projects/account/src/app/modules/profile/edit/membership/membership.component.scss rename to projects/account/src/app/modules/profile/components/cards/membership/membership.component.scss index 4fb7044..8d4b038 100644 --- a/projects/account/src/app/modules/profile/edit/membership/membership.component.scss +++ b/projects/account/src/app/modules/profile/components/cards/membership/membership.component.scss @@ -1,5 +1,5 @@ -@import "../../../../../../../../src/stylesheets/components/buttons"; -@import "../../../../../../../../src/stylesheets/components/cards"; +@import "../../../../../../../../../src/stylesheets/components/buttons"; +@import "../../../../../../../../../src/stylesheets/components/cards"; mat-card { @include section-card; diff --git a/projects/account/src/app/modules/profile/edit/membership/membership.component.ts b/projects/account/src/app/modules/profile/components/cards/membership/membership.component.ts similarity index 88% rename from projects/account/src/app/modules/profile/edit/membership/membership.component.ts rename to projects/account/src/app/modules/profile/components/cards/membership/membership.component.ts index 173bcc0..4c82721 100644 --- a/projects/account/src/app/modules/profile/edit/membership/membership.component.ts +++ b/projects/account/src/app/modules/profile/components/cards/membership/membership.component.ts @@ -3,10 +3,10 @@ import { MediaChange, MediaObserver } from '@angular/flex-layout'; import { MatBottomSheet } from '@angular/material'; import { Subscription } from 'rxjs'; -import { AccountMembership } from '../../../../shared/models/account-membership.model'; -import { MembershipType } from '../../../../shared/models/membership.model'; -import { ProfileService } from '../../../../core/http/profile.service'; -import { PaymentComponent } from '../../payment/payment.component'; +import { AccountMembership } from '../../../../../shared/models/account-membership.model'; +import { MembershipType } from '../../../../../shared/models/membership.model'; +import { ProfileService } from '../../../../../core/http/profile.service'; +import { PaymentComponent } from '../../views/payment/payment.component'; @Component({ selector: 'account-membership-edit', diff --git a/projects/account/src/app/modules/profile/membership-options/membership-options.component.html b/projects/account/src/app/modules/profile/components/controls/membership-options/membership-options.component.html similarity index 100% rename from projects/account/src/app/modules/profile/membership-options/membership-options.component.html rename to projects/account/src/app/modules/profile/components/controls/membership-options/membership-options.component.html diff --git a/projects/account/src/app/modules/profile/membership-options/membership-options.component.scss b/projects/account/src/app/modules/profile/components/controls/membership-options/membership-options.component.scss similarity index 100% rename from projects/account/src/app/modules/profile/membership-options/membership-options.component.scss rename to projects/account/src/app/modules/profile/components/controls/membership-options/membership-options.component.scss diff --git a/projects/account/src/app/modules/profile/membership-options/membership-options.component.ts b/projects/account/src/app/modules/profile/components/controls/membership-options/membership-options.component.ts similarity index 87% rename from projects/account/src/app/modules/profile/membership-options/membership-options.component.ts rename to projects/account/src/app/modules/profile/components/controls/membership-options/membership-options.component.ts index 49f8a1b..f1e1954 100644 --- a/projects/account/src/app/modules/profile/membership-options/membership-options.component.ts +++ b/projects/account/src/app/modules/profile/components/controls/membership-options/membership-options.component.ts @@ -4,9 +4,9 @@ import { MatButtonToggleChange } from '@angular/material'; import { Subscription } from 'rxjs'; -import { AccountMembership } from '@account/models/account-membership.model'; -import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '@account/http/profile.service'; +import { AccountMembership } from '../../../../../shared/models/account-membership.model'; +import { MembershipType } from '../../../../../shared/models/membership.model'; +import { ProfileService } from '../../../../../core/http/profile.service'; @Component({ diff --git a/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.html b/projects/account/src/app/modules/profile/components/views/agreement-step/agreement-step.component.html similarity index 100% rename from projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.html rename to projects/account/src/app/modules/profile/components/views/agreement-step/agreement-step.component.html diff --git a/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.scss b/projects/account/src/app/modules/profile/components/views/agreement-step/agreement-step.component.scss similarity index 78% rename from projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.scss rename to projects/account/src/app/modules/profile/components/views/agreement-step/agreement-step.component.scss index 980a6a5..773171a 100644 --- a/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.scss +++ b/projects/account/src/app/modules/profile/components/views/agreement-step/agreement-step.component.scss @@ -1,6 +1,6 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "components/buttons"; +@import "../../../../../../../../../src/stylesheets/components/buttons"; h2 { margin-left: 16px; diff --git a/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.ts b/projects/account/src/app/modules/profile/components/views/agreement-step/agreement-step.component.ts similarity index 95% rename from projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.ts rename to projects/account/src/app/modules/profile/components/views/agreement-step/agreement-step.component.ts index e2b8bfc..2a684a9 100644 --- a/projects/account/src/app/modules/profile/new/agreement-step/agreement-step.component.ts +++ b/projects/account/src/app/modules/profile/components/views/agreement-step/agreement-step.component.ts @@ -4,7 +4,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; -import { ProfileService } from '@account/http/profile.service'; +import { ProfileService } from '../../../../../core/http/profile.service'; @Component({ diff --git a/projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.html b/projects/account/src/app/modules/profile/components/views/authentication-step/authentication-step.component.html similarity index 100% rename from projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.html rename to projects/account/src/app/modules/profile/components/views/authentication-step/authentication-step.component.html diff --git a/projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.scss b/projects/account/src/app/modules/profile/components/views/authentication-step/authentication-step.component.scss similarity index 84% rename from projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.scss rename to projects/account/src/app/modules/profile/components/views/authentication-step/authentication-step.component.scss index 2bd5b2e..82784a1 100644 --- a/projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.scss +++ b/projects/account/src/app/modules/profile/components/views/authentication-step/authentication-step.component.scss @@ -1,4 +1,4 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; .mat-h1 { diff --git a/projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.ts b/projects/account/src/app/modules/profile/components/views/authentication-step/authentication-step.component.ts similarity index 100% rename from projects/account/src/app/modules/profile/new/authentication-step/authentication-step.component.ts rename to projects/account/src/app/modules/profile/components/views/authentication-step/authentication-step.component.ts diff --git a/projects/account/src/app/modules/profile/new/done-step/done-step.component.html b/projects/account/src/app/modules/profile/components/views/done-step/done-step.component.html similarity index 100% rename from projects/account/src/app/modules/profile/new/done-step/done-step.component.html rename to projects/account/src/app/modules/profile/components/views/done-step/done-step.component.html diff --git a/projects/account/src/app/modules/profile/new/done-step/done-step.component.scss b/projects/account/src/app/modules/profile/components/views/done-step/done-step.component.scss similarity index 60% rename from projects/account/src/app/modules/profile/new/done-step/done-step.component.scss rename to projects/account/src/app/modules/profile/components/views/done-step/done-step.component.scss index 71d6db6..82a3806 100644 --- a/projects/account/src/app/modules/profile/new/done-step/done-step.component.scss +++ b/projects/account/src/app/modules/profile/components/views/done-step/done-step.component.scss @@ -1,5 +1,5 @@ -@import "~@angular/material/theming"; -@import "components/buttons"; +@import "../../../../../../../../../node_modules/@angular/material/theming"; +@import "../../../../../../../../../src/stylesheets/components/buttons"; mat-card { margin-left: auto; diff --git a/projects/account/src/app/modules/profile/new/done-step/done-step.component.ts b/projects/account/src/app/modules/profile/components/views/done-step/done-step.component.ts similarity index 100% rename from projects/account/src/app/modules/profile/new/done-step/done-step.component.ts rename to projects/account/src/app/modules/profile/components/views/done-step/done-step.component.ts diff --git a/projects/account/src/app/modules/profile/payment/payment.component.html b/projects/account/src/app/modules/profile/components/views/payment/payment.component.html similarity index 100% rename from projects/account/src/app/modules/profile/payment/payment.component.html rename to projects/account/src/app/modules/profile/components/views/payment/payment.component.html diff --git a/projects/account/src/app/modules/profile/payment/payment.component.scss b/projects/account/src/app/modules/profile/components/views/payment/payment.component.scss similarity index 83% rename from projects/account/src/app/modules/profile/payment/payment.component.scss rename to projects/account/src/app/modules/profile/components/views/payment/payment.component.scss index f367537..4660d16 100644 --- a/projects/account/src/app/modules/profile/payment/payment.component.scss +++ b/projects/account/src/app/modules/profile/components/views/payment/payment.component.scss @@ -1,6 +1,6 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "components/buttons"; +@import "../../../../../../../../../src/stylesheets/components/buttons"; mat-card { margin-right: auto; diff --git a/projects/account/src/app/modules/profile/payment/payment.component.ts b/projects/account/src/app/modules/profile/components/views/payment/payment.component.ts similarity index 97% rename from projects/account/src/app/modules/profile/payment/payment.component.ts rename to projects/account/src/app/modules/profile/components/views/payment/payment.component.ts index c7e7ba0..4964789 100644 --- a/projects/account/src/app/modules/profile/payment/payment.component.ts +++ b/projects/account/src/app/modules/profile/components/views/payment/payment.component.ts @@ -8,7 +8,7 @@ import { import { ElementOptions, StripeCardComponent, StripeService } from 'ngx-stripe'; -import { ProfileService } from '@account/http/profile.service'; +import { ProfileService } from '../../../../../core/http/profile.service'; import { VerifyCardDialogComponent } from './verify-card-dialog.component'; const twoSeconds = 2000; diff --git a/projects/account/src/app/modules/profile/payment/verify-card-dialog.component.html b/projects/account/src/app/modules/profile/components/views/payment/verify-card-dialog.component.html similarity index 100% rename from projects/account/src/app/modules/profile/payment/verify-card-dialog.component.html rename to projects/account/src/app/modules/profile/components/views/payment/verify-card-dialog.component.html diff --git a/projects/account/src/app/modules/profile/payment/verify-card-dialog.component.scss b/projects/account/src/app/modules/profile/components/views/payment/verify-card-dialog.component.scss similarity index 100% rename from projects/account/src/app/modules/profile/payment/verify-card-dialog.component.scss rename to projects/account/src/app/modules/profile/components/views/payment/verify-card-dialog.component.scss diff --git a/projects/account/src/app/modules/profile/payment/verify-card-dialog.component.ts b/projects/account/src/app/modules/profile/components/views/payment/verify-card-dialog.component.ts similarity index 100% rename from projects/account/src/app/modules/profile/payment/verify-card-dialog.component.ts rename to projects/account/src/app/modules/profile/components/views/payment/verify-card-dialog.component.ts diff --git a/projects/account/src/app/modules/profile/new/support-step/support-step.component.html b/projects/account/src/app/modules/profile/components/views/support-step/support-step.component.html similarity index 100% rename from projects/account/src/app/modules/profile/new/support-step/support-step.component.html rename to projects/account/src/app/modules/profile/components/views/support-step/support-step.component.html diff --git a/projects/account/src/app/modules/profile/new/support-step/support-step.component.scss b/projects/account/src/app/modules/profile/components/views/support-step/support-step.component.scss similarity index 62% rename from projects/account/src/app/modules/profile/new/support-step/support-step.component.scss rename to projects/account/src/app/modules/profile/components/views/support-step/support-step.component.scss index 71e5197..cf05f74 100644 --- a/projects/account/src/app/modules/profile/new/support-step/support-step.component.scss +++ b/projects/account/src/app/modules/profile/components/views/support-step/support-step.component.scss @@ -1,6 +1,6 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "components/buttons"; +@import "../../../../../../../../../src/stylesheets/components/buttons"; .mat-h2 { color: mat-color($mycroft-primary); diff --git a/projects/account/src/app/modules/profile/new/support-step/support-step.component.ts b/projects/account/src/app/modules/profile/components/views/support-step/support-step.component.ts similarity index 95% rename from projects/account/src/app/modules/profile/new/support-step/support-step.component.ts rename to projects/account/src/app/modules/profile/components/views/support-step/support-step.component.ts index a1ba6a3..8006034 100644 --- a/projects/account/src/app/modules/profile/new/support-step/support-step.component.ts +++ b/projects/account/src/app/modules/profile/components/views/support-step/support-step.component.ts @@ -2,9 +2,9 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { MatBottomSheet } from '@angular/material'; -import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '@account/http/profile.service'; -import { PaymentComponent } from '../../payment/payment.component'; +import { MembershipType } from '../../../../../shared/models/membership.model'; +import { ProfileService } from '../../../../../core/http/profile.service'; +import { PaymentComponent } from '../payment/payment.component'; @Component({ selector: 'account-support-step', diff --git a/projects/account/src/app/modules/profile/new/username-step/username-step.component.html b/projects/account/src/app/modules/profile/components/views/username-step/username-step.component.html similarity index 100% rename from projects/account/src/app/modules/profile/new/username-step/username-step.component.html rename to projects/account/src/app/modules/profile/components/views/username-step/username-step.component.html diff --git a/projects/account/src/app/modules/profile/new/username-step/username-step.component.scss b/projects/account/src/app/modules/profile/components/views/username-step/username-step.component.scss similarity index 67% rename from projects/account/src/app/modules/profile/new/username-step/username-step.component.scss rename to projects/account/src/app/modules/profile/components/views/username-step/username-step.component.scss index 18a827b..d1e3cee 100644 --- a/projects/account/src/app/modules/profile/new/username-step/username-step.component.scss +++ b/projects/account/src/app/modules/profile/components/views/username-step/username-step.component.scss @@ -1,6 +1,6 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "components/buttons"; +@import "../../../../../../../../../src/stylesheets/components/buttons"; .mat-h2 { color: mat-color($mycroft-primary); diff --git a/projects/account/src/app/modules/profile/new/username-step/username-step.component.ts b/projects/account/src/app/modules/profile/components/views/username-step/username-step.component.ts similarity index 100% rename from projects/account/src/app/modules/profile/new/username-step/username-step.component.ts rename to projects/account/src/app/modules/profile/components/views/username-step/username-step.component.ts diff --git a/projects/account/src/app/modules/profile/edit/edit.component.html b/projects/account/src/app/modules/profile/pages/edit/edit.component.html similarity index 100% rename from projects/account/src/app/modules/profile/edit/edit.component.html rename to projects/account/src/app/modules/profile/pages/edit/edit.component.html diff --git a/projects/account/src/app/modules/profile/edit/edit.component.scss b/projects/account/src/app/modules/profile/pages/edit/edit.component.scss similarity index 100% rename from projects/account/src/app/modules/profile/edit/edit.component.scss rename to projects/account/src/app/modules/profile/pages/edit/edit.component.scss diff --git a/projects/account/src/app/modules/profile/edit/edit.component.ts b/projects/account/src/app/modules/profile/pages/edit/edit.component.ts similarity index 77% rename from projects/account/src/app/modules/profile/edit/edit.component.ts rename to projects/account/src/app/modules/profile/pages/edit/edit.component.ts index c54e11b..d4290dd 100644 --- a/projects/account/src/app/modules/profile/edit/edit.component.ts +++ b/projects/account/src/app/modules/profile/pages/edit/edit.component.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { Account } from '@account/models/account.model'; -import { MembershipType } from '@account/models/membership.model'; -import { ProfileService } from '@account/http/profile.service'; +import { Account } from '../../../../shared/models/account.model'; +import { MembershipType } from '../../../../shared/models/membership.model'; +import { ProfileService } from '../../../../core/http/profile.service'; @Component({ selector: 'account-profile-edit', diff --git a/projects/account/src/app/modules/profile/new/new.component.html b/projects/account/src/app/modules/profile/pages/new/new.component.html similarity index 100% rename from projects/account/src/app/modules/profile/new/new.component.html rename to projects/account/src/app/modules/profile/pages/new/new.component.html diff --git a/projects/account/src/app/modules/profile/new/new.component.scss b/projects/account/src/app/modules/profile/pages/new/new.component.scss similarity index 63% rename from projects/account/src/app/modules/profile/new/new.component.scss rename to projects/account/src/app/modules/profile/pages/new/new.component.scss index fefff6e..659b3bf 100644 --- a/projects/account/src/app/modules/profile/new/new.component.scss +++ b/projects/account/src/app/modules/profile/pages/new/new.component.scss @@ -1,6 +1,6 @@ -@import "~@angular/material/theming"; +@import "../../../../../../../../node_modules/@angular/material/theming"; @import "mycroft-colors"; -@import "components/buttons"; +@import "../../../../../../../../src/stylesheets/components/buttons"; button { @include action-button-primary; diff --git a/projects/account/src/app/modules/profile/new/new.component.ts b/projects/account/src/app/modules/profile/pages/new/new.component.ts similarity index 97% rename from projects/account/src/app/modules/profile/new/new.component.ts rename to projects/account/src/app/modules/profile/pages/new/new.component.ts index 3a1a8c5..546834b 100644 --- a/projects/account/src/app/modules/profile/new/new.component.ts +++ b/projects/account/src/app/modules/profile/pages/new/new.component.ts @@ -12,12 +12,12 @@ import { ActivatedRoute } from '@angular/router'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; import { Subscription } from 'rxjs'; -import { MembershipType } from '@account/models/membership.model'; +import { MembershipType } from '../../../../shared/models/membership.model'; import { navigateToLogin, ProfileService, storeRedirect -} from '@account/http/profile.service'; +} from '../../../../core/http/profile.service'; const noDelay = 0; diff --git a/projects/account/src/app/modules/profile/profile-routing.module.ts b/projects/account/src/app/modules/profile/profile-routing.module.ts index 0c45e58..23e6be1 100644 --- a/projects/account/src/app/modules/profile/profile-routing.module.ts +++ b/projects/account/src/app/modules/profile/profile-routing.module.ts @@ -3,8 +3,8 @@ import { RouterModule, Routes } from '@angular/router'; import { AccountResolverService } from '../../core/guards/account-resolver.service'; import { MembershipResolverService } from '../../core/guards/membership-resolver.service'; -import { EditComponent } from './edit/edit.component'; -import { NewComponent } from './new/new.component'; +import { EditComponent } from './pages/edit/edit.component'; +import { NewComponent } from './pages/new/new.component'; const profileRoutes: Routes = [ { diff --git a/projects/account/src/app/modules/profile/profile.module.ts b/projects/account/src/app/modules/profile/profile.module.ts index f45c154..dddb441 100644 --- a/projects/account/src/app/modules/profile/profile.module.ts +++ b/projects/account/src/app/modules/profile/profile.module.ts @@ -19,24 +19,24 @@ import { import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { NgxStripeModule } from 'ngx-stripe'; -import { AgreementsComponent } from './edit/agreements/agreements.component'; -import { AgreementStepComponent } from './new/agreement-step/agreement-step.component'; -import { AuthenticationStepComponent } from './new/authentication-step/authentication-step.component'; -import { DeleteComponent } from './edit/delete/delete.component'; -import { DoneStepComponent } from './new/done-step/done-step.component'; -import { EditComponent } from './edit/edit.component'; +import { AgreementsComponent } from './components/cards/agreements/agreements.component'; +import { AgreementStepComponent } from './components/views/agreement-step/agreement-step.component'; +import { AuthenticationStepComponent } from './components/views/authentication-step/authentication-step.component'; +import { DeleteComponent } from './components/cards/delete/delete.component'; +import { DoneStepComponent } from './components/views/done-step/done-step.component'; +import { EditComponent } from './pages/edit/edit.component'; import { environment} from '../../../environments/environment'; -import { LoginComponent } from './edit/login/login.component'; -import { MembershipComponent } from './edit/membership/membership.component'; -import { MembershipOptionsComponent } from './membership-options/membership-options.component'; -import { NewComponent } from './new/new.component'; -import { PaymentComponent } from './payment/payment.component'; -import { ProfileService } from '../../core/http/profile.service'; +import { LoginComponent } from './components/cards/login/login.component'; +import { MembershipComponent } from './components/cards/membership/membership.component'; +import { MembershipOptionsComponent } from './components/controls/membership-options/membership-options.component'; +import { NewComponent } from './pages/new/new.component'; +import { PaymentComponent } from './components/views/payment/payment.component'; +import { ProfileService } from '@account/http/profile.service'; import { ProfileRoutingModule } from './profile-routing.module'; import { SharedModule } from 'shared'; -import { SupportStepComponent } from './new/support-step/support-step.component'; -import { UsernameStepComponent } from './new/username-step/username-step.component'; -import { VerifyCardDialogComponent } from './payment/verify-card-dialog.component'; +import { SupportStepComponent } from './components/views/support-step/support-step.component'; +import { UsernameStepComponent } from './components/views/username-step/username-step.component'; +import { VerifyCardDialogComponent } from './components/views/payment/verify-card-dialog.component'; @NgModule({ declarations: [ From bd3fac7ee8e118a90987bcd22183f8544b05efae Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 19:28:18 -0500 Subject: [PATCH 126/163] moved settings service into http directory --- projects/account/src/app/{skill => core/http}/skill.service.ts | 0 .../src/app/skill/setting-field/setting-field.component.ts | 2 +- .../src/app/skill/setting-section/setting-section.component.ts | 2 +- .../account/src/app/skill/skill-panel/skill-panel.component.ts | 2 +- .../src/app/skill/skill-setting/skill-settings.component.ts | 2 +- projects/account/src/app/skill/skill.component.ts | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename projects/account/src/app/{skill => core/http}/skill.service.ts (100%) diff --git a/projects/account/src/app/skill/skill.service.ts b/projects/account/src/app/core/http/skill.service.ts similarity index 100% rename from projects/account/src/app/skill/skill.service.ts rename to projects/account/src/app/core/http/skill.service.ts diff --git a/projects/account/src/app/skill/setting-field/setting-field.component.ts b/projects/account/src/app/skill/setting-field/setting-field.component.ts index 5ccf1a8..f59574f 100644 --- a/projects/account/src/app/skill/setting-field/setting-field.component.ts +++ b/projects/account/src/app/skill/setting-field/setting-field.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { MatCheckboxChange } from '@angular/material'; -import { SettingField, SettingChange } from '../skill.service'; +import { SettingField, SettingChange } from '../../core/http/skill.service'; @Component({ selector: 'account-skill-setting-field', diff --git a/projects/account/src/app/skill/setting-section/setting-section.component.ts b/projects/account/src/app/skill/setting-section/setting-section.component.ts index c134dea..2ad29bc 100644 --- a/projects/account/src/app/skill/setting-section/setting-section.component.ts +++ b/projects/account/src/app/skill/setting-section/setting-section.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { SettingChange, SettingSection } from '../skill.service'; +import { SettingChange, SettingSection } from '../../core/http/skill.service'; @Component({ selector: 'account-skill-setting-section', diff --git a/projects/account/src/app/skill/skill-panel/skill-panel.component.ts b/projects/account/src/app/skill/skill-panel/skill-panel.component.ts index 4116f88..222d55f 100644 --- a/projects/account/src/app/skill/skill-panel/skill-panel.component.ts +++ b/projects/account/src/app/skill/skill-panel/skill-panel.component.ts @@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { faCog } from '@fortawesome/free-solid-svg-icons'; -import { Skill } from '../skill.service'; +import { Skill } from '../../core/http/skill.service'; @Component({ selector: 'account-skill-panel', diff --git a/projects/account/src/app/skill/skill-setting/skill-settings.component.ts b/projects/account/src/app/skill/skill-setting/skill-settings.component.ts index 4268e68..6689cd3 100644 --- a/projects/account/src/app/skill/skill-setting/skill-settings.component.ts +++ b/projects/account/src/app/skill/skill-setting/skill-settings.component.ts @@ -5,7 +5,7 @@ import { Skill, SkillSettings, SkillService, -} from '../skill.service'; +} from '../../core/http/skill.service'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; diff --git a/projects/account/src/app/skill/skill.component.ts b/projects/account/src/app/skill/skill.component.ts index fbebe83..cd60de3 100644 --- a/projects/account/src/app/skill/skill.component.ts +++ b/projects/account/src/app/skill/skill.component.ts @@ -4,7 +4,7 @@ import { environment } from '../../environments/environment'; import { Skill, SkillService, -} from './skill.service'; +} from '../core/http/skill.service'; import { Observable } from 'rxjs'; export interface WebApps { From 40c44f33068f5a5bb231933bf20820b0861be2aa Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 19:43:34 -0500 Subject: [PATCH 127/163] moved models in the skills service to the models directory --- .../src/app/core/http/skill.service.ts | 39 ++----------------- .../app/shared/models/setting-change.model.ts | 4 ++ .../app/shared/models/setting-field.model.ts | 12 ++++++ .../shared/models/setting-section.model.ts | 6 +++ .../shared/models/settings-display.model.ts | 5 +++ .../app/shared/models/skill-settings.model.ts | 7 ++++ .../src/app/shared/models/skill.model.ts | 5 +++ .../setting-field/setting-field.component.ts | 3 +- .../setting-section.component.ts | 3 +- .../skill-panel/skill-panel.component.ts | 2 +- .../skill-setting/skill-settings.component.ts | 12 +++--- .../account/src/app/skill/skill.component.ts | 10 ++--- 12 files changed, 56 insertions(+), 52 deletions(-) create mode 100644 projects/account/src/app/shared/models/setting-change.model.ts create mode 100644 projects/account/src/app/shared/models/setting-field.model.ts create mode 100644 projects/account/src/app/shared/models/setting-section.model.ts create mode 100644 projects/account/src/app/shared/models/settings-display.model.ts create mode 100644 projects/account/src/app/shared/models/skill-settings.model.ts create mode 100644 projects/account/src/app/shared/models/skill.model.ts diff --git a/projects/account/src/app/core/http/skill.service.ts b/projects/account/src/app/core/http/skill.service.ts index a9411b6..fffce8e 100644 --- a/projects/account/src/app/core/http/skill.service.ts +++ b/projects/account/src/app/core/http/skill.service.ts @@ -2,45 +2,12 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; +import { Skill } from '@account/models/skill.model'; +import { SkillSettings } from '@account/models/skill-settings.model'; + const accountSkillUrl = '/api/skills'; const accountDeviceCountUrl = '/api/device-count'; -export interface SelectOptions { - display: string; - value: string; -} -export interface Skill { - id: string; - name: string; - hasSettings: boolean; -} - -export interface SettingField { - name: string; - type: string; - label: string; - options?: SelectOptions[]; - value?: string; -} - -export interface SettingSection { - name: string; - fields: SettingField[]; -} - -export interface SettingsDisplay { - sections: SettingSection[]; -} -export interface SkillSettings { - settingsDisplay: SettingsDisplay; - settingsValues: any; - devices: string[]; -} - -export interface SettingChange { - name: string; - value: string; -} @Injectable({ providedIn: 'root' diff --git a/projects/account/src/app/shared/models/setting-change.model.ts b/projects/account/src/app/shared/models/setting-change.model.ts new file mode 100644 index 0000000..ea9a802 --- /dev/null +++ b/projects/account/src/app/shared/models/setting-change.model.ts @@ -0,0 +1,4 @@ +export interface SettingChange { + name: string; + value: string; +} diff --git a/projects/account/src/app/shared/models/setting-field.model.ts b/projects/account/src/app/shared/models/setting-field.model.ts new file mode 100644 index 0000000..b857411 --- /dev/null +++ b/projects/account/src/app/shared/models/setting-field.model.ts @@ -0,0 +1,12 @@ +export interface SelectOptions { + display: string; + value: string; +} + +export interface SettingField { + name: string; + type: string; + label: string; + options?: SelectOptions[]; + value?: string; +} diff --git a/projects/account/src/app/shared/models/setting-section.model.ts b/projects/account/src/app/shared/models/setting-section.model.ts new file mode 100644 index 0000000..d0c8a93 --- /dev/null +++ b/projects/account/src/app/shared/models/setting-section.model.ts @@ -0,0 +1,6 @@ +import { SettingField } from '@account/models/setting-field.model'; + +export interface SettingSection { + name: string; + fields: SettingField[]; +} diff --git a/projects/account/src/app/shared/models/settings-display.model.ts b/projects/account/src/app/shared/models/settings-display.model.ts new file mode 100644 index 0000000..6716ce5 --- /dev/null +++ b/projects/account/src/app/shared/models/settings-display.model.ts @@ -0,0 +1,5 @@ +import {SettingSection } from '@account/models/setting-section.model'; + +export interface SettingsDisplay { + sections: SettingSection[]; +} diff --git a/projects/account/src/app/shared/models/skill-settings.model.ts b/projects/account/src/app/shared/models/skill-settings.model.ts new file mode 100644 index 0000000..2a432a8 --- /dev/null +++ b/projects/account/src/app/shared/models/skill-settings.model.ts @@ -0,0 +1,7 @@ +import { SettingsDisplay } from '@account/models/settings-display.model'; + +export interface SkillSettings { + settingsDisplay: SettingsDisplay; + settingsValues: any; + devices: string[]; +} diff --git a/projects/account/src/app/shared/models/skill.model.ts b/projects/account/src/app/shared/models/skill.model.ts new file mode 100644 index 0000000..55d571a --- /dev/null +++ b/projects/account/src/app/shared/models/skill.model.ts @@ -0,0 +1,5 @@ +export interface Skill { + id: string; + name: string; + hasSettings: boolean; +} diff --git a/projects/account/src/app/skill/setting-field/setting-field.component.ts b/projects/account/src/app/skill/setting-field/setting-field.component.ts index f59574f..85ccd0d 100644 --- a/projects/account/src/app/skill/setting-field/setting-field.component.ts +++ b/projects/account/src/app/skill/setting-field/setting-field.component.ts @@ -1,7 +1,8 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { MatCheckboxChange } from '@angular/material'; -import { SettingField, SettingChange } from '../../core/http/skill.service'; +import { SettingField } from '@account/models/setting-field.model'; +import { SettingChange } from '@account/models/setting-change.model'; @Component({ selector: 'account-skill-setting-field', diff --git a/projects/account/src/app/skill/setting-section/setting-section.component.ts b/projects/account/src/app/skill/setting-section/setting-section.component.ts index 2ad29bc..b6b85e9 100644 --- a/projects/account/src/app/skill/setting-section/setting-section.component.ts +++ b/projects/account/src/app/skill/setting-section/setting-section.component.ts @@ -1,6 +1,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { SettingChange, SettingSection } from '../../core/http/skill.service'; +import { SettingChange } from '@account/models/setting-change.model'; +import { SettingSection } from '@account/models/setting-section.model'; @Component({ selector: 'account-skill-setting-section', diff --git a/projects/account/src/app/skill/skill-panel/skill-panel.component.ts b/projects/account/src/app/skill/skill-panel/skill-panel.component.ts index 222d55f..2947429 100644 --- a/projects/account/src/app/skill/skill-panel/skill-panel.component.ts +++ b/projects/account/src/app/skill/skill-panel/skill-panel.component.ts @@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { faCog } from '@fortawesome/free-solid-svg-icons'; -import { Skill } from '../../core/http/skill.service'; +import { Skill } from '@account/models/skill.model'; @Component({ selector: 'account-skill-panel', diff --git a/projects/account/src/app/skill/skill-setting/skill-settings.component.ts b/projects/account/src/app/skill/skill-setting/skill-settings.component.ts index 6689cd3..0086c6b 100644 --- a/projects/account/src/app/skill/skill-setting/skill-settings.component.ts +++ b/projects/account/src/app/skill/skill-setting/skill-settings.component.ts @@ -1,14 +1,12 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; - -import { - SettingChange, - Skill, - SkillSettings, - SkillService, -} from '../../core/http/skill.service'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; +import { SettingChange } from '@account/models/setting-change.model'; +import { Skill } from '@account/models/skill.model'; +import { SkillSettings } from '@account/models/skill-settings.model'; +import { SkillService } from '@account/http/skill.service'; + @Component({ selector: 'account-skill-settings', templateUrl: './skill-settings.component.html', diff --git a/projects/account/src/app/skill/skill.component.ts b/projects/account/src/app/skill/skill.component.ts index cd60de3..2618ade 100644 --- a/projects/account/src/app/skill/skill.component.ts +++ b/projects/account/src/app/skill/skill.component.ts @@ -1,11 +1,9 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { Observable } from 'rxjs'; import { environment } from '../../environments/environment'; -import { - Skill, - SkillService, -} from '../core/http/skill.service'; -import { Observable } from 'rxjs'; +import { Skill } from '@account/models/skill.model'; +import { SkillService } from '@account/http/skill.service'; export interface WebApps { account: string; From a3bd84df6748a4383eeba0dbf665c553ac684e8c Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 25 Mar 2019 19:47:48 -0500 Subject: [PATCH 128/163] moved skill module into the modules directory --- projects/account/src/app/app.module.ts | 2 +- .../skill/setting-field/setting-field.component.html | 0 .../skill/setting-field/setting-field.component.scss | 2 +- .../skill/setting-field/setting-field.component.ts | 2 +- .../skill/setting-section/setting-section.component.html | 0 .../skill/setting-section/setting-section.component.scss | 0 .../skill/setting-section/setting-section.component.ts | 0 .../{ => modules}/skill/skill-panel/skill-panel.component.html | 0 .../{ => modules}/skill/skill-panel/skill-panel.component.scss | 2 +- .../{ => modules}/skill/skill-panel/skill-panel.component.ts | 0 .../account/src/app/{ => modules}/skill/skill-routing.module.ts | 0 .../skill/skill-setting/skill-settings.component.html | 0 .../skill/skill-setting/skill-settings.component.scss | 2 +- .../skill/skill-setting/skill-settings.component.ts | 0 .../account/src/app/{ => modules}/skill/skill.component.html | 0 .../account/src/app/{ => modules}/skill/skill.component.scss | 0 projects/account/src/app/{ => modules}/skill/skill.component.ts | 2 +- projects/account/src/app/{ => modules}/skill/skill.module.ts | 0 18 files changed, 6 insertions(+), 6 deletions(-) rename projects/account/src/app/{ => modules}/skill/setting-field/setting-field.component.html (100%) rename projects/account/src/app/{ => modules}/skill/setting-field/setting-field.component.scss (72%) rename projects/account/src/app/{ => modules}/skill/setting-field/setting-field.component.ts (95%) rename projects/account/src/app/{ => modules}/skill/setting-section/setting-section.component.html (100%) rename projects/account/src/app/{ => modules}/skill/setting-section/setting-section.component.scss (100%) rename projects/account/src/app/{ => modules}/skill/setting-section/setting-section.component.ts (100%) rename projects/account/src/app/{ => modules}/skill/skill-panel/skill-panel.component.html (100%) rename projects/account/src/app/{ => modules}/skill/skill-panel/skill-panel.component.scss (93%) rename projects/account/src/app/{ => modules}/skill/skill-panel/skill-panel.component.ts (100%) rename projects/account/src/app/{ => modules}/skill/skill-routing.module.ts (100%) rename projects/account/src/app/{ => modules}/skill/skill-setting/skill-settings.component.html (100%) rename projects/account/src/app/{ => modules}/skill/skill-setting/skill-settings.component.scss (90%) rename projects/account/src/app/{ => modules}/skill/skill-setting/skill-settings.component.ts (100%) rename projects/account/src/app/{ => modules}/skill/skill.component.html (100%) rename projects/account/src/app/{ => modules}/skill/skill.component.scss (100%) rename projects/account/src/app/{ => modules}/skill/skill.component.ts (96%) rename projects/account/src/app/{ => modules}/skill/skill.module.ts (100%) diff --git a/projects/account/src/app/app.module.ts b/projects/account/src/app/app.module.ts index 3fcf0fe..a600805 100644 --- a/projects/account/src/app/app.module.ts +++ b/projects/account/src/app/app.module.ts @@ -11,7 +11,7 @@ import { PageNotFoundModule } from 'page-not-found'; import { DeviceModule } from './modules/device/device.module'; import { ProfileModule } from './modules/profile/profile.module'; import { SharedModule } from 'shared'; -import { SkillModule } from './skill/skill.module'; +import { SkillModule } from './modules/skill/skill.module'; @NgModule( { diff --git a/projects/account/src/app/skill/setting-field/setting-field.component.html b/projects/account/src/app/modules/skill/setting-field/setting-field.component.html similarity index 100% rename from projects/account/src/app/skill/setting-field/setting-field.component.html rename to projects/account/src/app/modules/skill/setting-field/setting-field.component.html diff --git a/projects/account/src/app/skill/setting-field/setting-field.component.scss b/projects/account/src/app/modules/skill/setting-field/setting-field.component.scss similarity index 72% rename from projects/account/src/app/skill/setting-field/setting-field.component.scss rename to projects/account/src/app/modules/skill/setting-field/setting-field.component.scss index e8506a2..d94d26c 100644 --- a/projects/account/src/app/skill/setting-field/setting-field.component.scss +++ b/projects/account/src/app/modules/skill/setting-field/setting-field.component.scss @@ -1,4 +1,4 @@ -@import "~src/stylesheets/components/buttons"; +@import "components/buttons"; mat-checkbox { margin-top: 8px diff --git a/projects/account/src/app/skill/setting-field/setting-field.component.ts b/projects/account/src/app/modules/skill/setting-field/setting-field.component.ts similarity index 95% rename from projects/account/src/app/skill/setting-field/setting-field.component.ts rename to projects/account/src/app/modules/skill/setting-field/setting-field.component.ts index 85ccd0d..42a9a19 100644 --- a/projects/account/src/app/skill/setting-field/setting-field.component.ts +++ b/projects/account/src/app/modules/skill/setting-field/setting-field.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { MatCheckboxChange } from '@angular/material'; import { SettingField } from '@account/models/setting-field.model'; -import { SettingChange } from '@account/models/setting-change.model'; +import { SettingChange } from '@acount/models/setting-change.model'; @Component({ selector: 'account-skill-setting-field', diff --git a/projects/account/src/app/skill/setting-section/setting-section.component.html b/projects/account/src/app/modules/skill/setting-section/setting-section.component.html similarity index 100% rename from projects/account/src/app/skill/setting-section/setting-section.component.html rename to projects/account/src/app/modules/skill/setting-section/setting-section.component.html diff --git a/projects/account/src/app/skill/setting-section/setting-section.component.scss b/projects/account/src/app/modules/skill/setting-section/setting-section.component.scss similarity index 100% rename from projects/account/src/app/skill/setting-section/setting-section.component.scss rename to projects/account/src/app/modules/skill/setting-section/setting-section.component.scss diff --git a/projects/account/src/app/skill/setting-section/setting-section.component.ts b/projects/account/src/app/modules/skill/setting-section/setting-section.component.ts similarity index 100% rename from projects/account/src/app/skill/setting-section/setting-section.component.ts rename to projects/account/src/app/modules/skill/setting-section/setting-section.component.ts diff --git a/projects/account/src/app/skill/skill-panel/skill-panel.component.html b/projects/account/src/app/modules/skill/skill-panel/skill-panel.component.html similarity index 100% rename from projects/account/src/app/skill/skill-panel/skill-panel.component.html rename to projects/account/src/app/modules/skill/skill-panel/skill-panel.component.html diff --git a/projects/account/src/app/skill/skill-panel/skill-panel.component.scss b/projects/account/src/app/modules/skill/skill-panel/skill-panel.component.scss similarity index 93% rename from projects/account/src/app/skill/skill-panel/skill-panel.component.scss rename to projects/account/src/app/modules/skill/skill-panel/skill-panel.component.scss index 95e8009..57a854f 100644 --- a/projects/account/src/app/skill/skill-panel/skill-panel.component.scss +++ b/projects/account/src/app/modules/skill/skill-panel/skill-panel.component.scss @@ -1,6 +1,6 @@ @import "~@angular/material/theming"; @import "mycroft-colors"; -@import "~src/stylesheets/components/buttons"; +@import "components/buttons"; mat-expansion-panel { border-radius: 10px; diff --git a/projects/account/src/app/skill/skill-panel/skill-panel.component.ts b/projects/account/src/app/modules/skill/skill-panel/skill-panel.component.ts similarity index 100% rename from projects/account/src/app/skill/skill-panel/skill-panel.component.ts rename to projects/account/src/app/modules/skill/skill-panel/skill-panel.component.ts diff --git a/projects/account/src/app/skill/skill-routing.module.ts b/projects/account/src/app/modules/skill/skill-routing.module.ts similarity index 100% rename from projects/account/src/app/skill/skill-routing.module.ts rename to projects/account/src/app/modules/skill/skill-routing.module.ts diff --git a/projects/account/src/app/skill/skill-setting/skill-settings.component.html b/projects/account/src/app/modules/skill/skill-setting/skill-settings.component.html similarity index 100% rename from projects/account/src/app/skill/skill-setting/skill-settings.component.html rename to projects/account/src/app/modules/skill/skill-setting/skill-settings.component.html diff --git a/projects/account/src/app/skill/skill-setting/skill-settings.component.scss b/projects/account/src/app/modules/skill/skill-setting/skill-settings.component.scss similarity index 90% rename from projects/account/src/app/skill/skill-setting/skill-settings.component.scss rename to projects/account/src/app/modules/skill/skill-setting/skill-settings.component.scss index 644548d..216d6df 100644 --- a/projects/account/src/app/skill/skill-setting/skill-settings.component.scss +++ b/projects/account/src/app/modules/skill/skill-setting/skill-settings.component.scss @@ -1,6 +1,6 @@ @import "~@angular/material/theming"; @import "mycroft-colors"; -@import "~src/stylesheets/components/buttons"; +@import "components/buttons"; .mat-action-row { padding-right: 0; diff --git a/projects/account/src/app/skill/skill-setting/skill-settings.component.ts b/projects/account/src/app/modules/skill/skill-setting/skill-settings.component.ts similarity index 100% rename from projects/account/src/app/skill/skill-setting/skill-settings.component.ts rename to projects/account/src/app/modules/skill/skill-setting/skill-settings.component.ts diff --git a/projects/account/src/app/skill/skill.component.html b/projects/account/src/app/modules/skill/skill.component.html similarity index 100% rename from projects/account/src/app/skill/skill.component.html rename to projects/account/src/app/modules/skill/skill.component.html diff --git a/projects/account/src/app/skill/skill.component.scss b/projects/account/src/app/modules/skill/skill.component.scss similarity index 100% rename from projects/account/src/app/skill/skill.component.scss rename to projects/account/src/app/modules/skill/skill.component.scss diff --git a/projects/account/src/app/skill/skill.component.ts b/projects/account/src/app/modules/skill/skill.component.ts similarity index 96% rename from projects/account/src/app/skill/skill.component.ts rename to projects/account/src/app/modules/skill/skill.component.ts index 2618ade..bd54dd9 100644 --- a/projects/account/src/app/skill/skill.component.ts +++ b/projects/account/src/app/modules/skill/skill.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; -import { environment } from '../../environments/environment'; +import { environment } from '../../../environments/environment'; import { Skill } from '@account/models/skill.model'; import { SkillService } from '@account/http/skill.service'; diff --git a/projects/account/src/app/skill/skill.module.ts b/projects/account/src/app/modules/skill/skill.module.ts similarity index 100% rename from projects/account/src/app/skill/skill.module.ts rename to projects/account/src/app/modules/skill/skill.module.ts From 546303a94cb199c076c1a075b9ff7ed59e0551d2 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 26 Mar 2019 10:35:51 -0500 Subject: [PATCH 129/163] fixed a typo --- .../app/modules/skill/setting-field/setting-field.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/modules/skill/setting-field/setting-field.component.ts b/projects/account/src/app/modules/skill/setting-field/setting-field.component.ts index 42a9a19..85ccd0d 100644 --- a/projects/account/src/app/modules/skill/setting-field/setting-field.component.ts +++ b/projects/account/src/app/modules/skill/setting-field/setting-field.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { MatCheckboxChange } from '@angular/material'; import { SettingField } from '@account/models/setting-field.model'; -import { SettingChange } from '@acount/models/setting-change.model'; +import { SettingChange } from '@account/models/setting-change.model'; @Component({ selector: 'account-skill-setting-field', From 95ba2eb88d5e6a8ca53a40c386c4a36eb0449bdd Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 26 Mar 2019 10:36:03 -0500 Subject: [PATCH 130/163] refactored some imports --- .../src/app/modules/profile/pages/edit/edit.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/account/src/app/modules/profile/pages/edit/edit.component.ts b/projects/account/src/app/modules/profile/pages/edit/edit.component.ts index d4290dd..c54e11b 100644 --- a/projects/account/src/app/modules/profile/pages/edit/edit.component.ts +++ b/projects/account/src/app/modules/profile/pages/edit/edit.component.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { Account } from '../../../../shared/models/account.model'; -import { MembershipType } from '../../../../shared/models/membership.model'; -import { ProfileService } from '../../../../core/http/profile.service'; +import { Account } from '@account/models/account.model'; +import { MembershipType } from '@account/models/membership.model'; +import { ProfileService } from '@account/http/profile.service'; @Component({ selector: 'account-profile-edit', From dbae142ae883a371c29c5f8481e6ab40d8b1d7c0 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 26 Mar 2019 14:25:52 -0500 Subject: [PATCH 131/163] added a shortcut for the account project --- tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index ec9ad54..bb47431 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -36,6 +36,9 @@ "shared/*": [ "dist/shared/*" ], + "@account/*": [ + "projects/account/src/*" + ], "@account/http/*": [ "projects/account/src/app/core/http/*" ], From df342fe288f0fc8acf37459bab7435224e6be24e Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 26 Mar 2019 14:27:53 -0500 Subject: [PATCH 132/163] added code to support account delete functionality --- .../src/app/core/http/profile.service.ts | 32 +++++++++-------- .../delete-confirm.component.html | 21 +++++++++++ .../delete-confirm.component.scss | 11 ++++++ .../delete-confirm.component.ts | 35 +++++++++++++++++++ .../src/app/modules/profile/profile.module.ts | 5 ++- 5 files changed, 89 insertions(+), 15 deletions(-) create mode 100644 projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.html create mode 100644 projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.scss create mode 100644 projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.ts diff --git a/projects/account/src/app/core/http/profile.service.ts b/projects/account/src/app/core/http/profile.service.ts index aa5f7b4..a611d23 100644 --- a/projects/account/src/app/core/http/profile.service.ts +++ b/projects/account/src/app/core/http/profile.service.ts @@ -4,19 +4,19 @@ import { FormGroup } from '@angular/forms'; import { MatSnackBar } from '@angular/material'; import { Observable, Subject, throwError } from 'rxjs'; -import { catchError } from 'rxjs/operators'; +import { catchError, tap } from 'rxjs/operators'; +import { Account } from '@account/models/account.model'; +import { AccountMembership } from '@account/models/account-membership.model'; +import { Agreement } from '@account/models/agreement.model'; import { environment } from '../../../environments/environment'; -import { Account } from '../../shared/models/account.model'; -import { AccountMembership } from '../../shared/models/account-membership.model'; -import { Agreement } from '../../shared/models/agreement.model'; -import { MembershipType } from '../../shared/models/membership.model'; +import { MembershipType } from '@account/models/membership.model'; // URLs for the http requests -const accountUrl = '/api/account'; -const agreementUrl = '/api/agreement/'; -const membershipTypesUrl = '/api/memberships'; +const ACCOUNT_URL = '/api/account'; +const AGREEMENT_URL = '/api/agreement/'; +const MEMBERSHIP_URL = '/api/memberships'; const fiveSeconds = 5000; @@ -87,8 +87,8 @@ export class ProfileService { 'Something bad happened; please try again later.'); } - addAccount(newAcctForm: FormGroup) { - return this.http.post(accountUrl, newAcctForm.value).pipe( + addAccount(newAcctForm: FormGroup) { + return this.http.post(ACCOUNT_URL, newAcctForm.value).pipe( catchError(this.handle400Error) ); } @@ -97,7 +97,7 @@ export class ProfileService { * API call to retrieve account info to display. */ getAccount(): Observable { - return this.http.get(accountUrl).pipe( + return this.http.get(ACCOUNT_URL).pipe( catchError(this.handleError) ); } @@ -109,19 +109,23 @@ export class ProfileService { } else { url_suffix = 'privacy-policy'; } - return this.http.get(agreementUrl + url_suffix); + return this.http.get(AGREEMENT_URL + url_suffix); } getMembershipTypes(): Observable { - return this.http.get(membershipTypesUrl); + return this.http.get(MEMBERSHIP_URL); } updateAccount(accountChanges: any) { - return this.http.patch(accountUrl, {accountChanges}).pipe( + return this.http.patch(ACCOUNT_URL, {accountChanges}).pipe( catchError(this.handleError) ); } + deleteAccount() { + return this.http.delete(ACCOUNT_URL); + } + setSelectedMembershipType(accountMembership: AccountMembership, membershipTypes: MembershipType[]) { let selectedMembership: MembershipType; if (accountMembership) { diff --git a/projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.html b/projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.html new file mode 100644 index 0000000..36fd839 --- /dev/null +++ b/projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.html @@ -0,0 +1,21 @@ + +

Are you sure?

+

+ You know how this goes. You click a button, we make sure you meant to do it. + Deleting your account is nasty business with no "undo" button. +

+

+ We'd hate to lose you so we hope you are seeing this as a result of an unintended mouse + click (those buttons can be touchy!). If so, click the "cancel" button below to continue + enjoying your Mycroft experience. +

+

+ If you really do want to delete your account, that's a bummer. We hope to see you back some + time. Click the "confirm" button below and all data related to your account will + be sent to the great bit bucket in the sky. +

+
+ + + + diff --git a/projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.scss b/projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.scss new file mode 100644 index 0000000..81ca91b --- /dev/null +++ b/projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.scss @@ -0,0 +1,11 @@ +@import "~@angular/material/theming"; +@import "mycroft-colors"; +@import "components/buttons"; + +.mat-h2 { + color: mat-color($mycroft-warn); +} + +#confirm-button { + @include action-button-warn; +} diff --git a/projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.ts b/projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.ts new file mode 100644 index 0000000..5fcdd56 --- /dev/null +++ b/projects/account/src/app/modules/profile/components/modals/delete-confirm/delete-confirm.component.ts @@ -0,0 +1,35 @@ +import { Component, OnInit } from '@angular/core'; +import { MatDialogRef } from '@angular/material'; + +import { environment } from '@account/environments/environment'; +import { ProfileService } from '@account/http/profile.service'; + +@Component({ + selector: 'account-delete-confirm', + templateUrl: './delete-confirm.component.html', + styleUrls: ['./delete-confirm.component.scss'] +}) +export class DeleteConfirmComponent implements OnInit { + + constructor( + public confirmDialogRef: MatDialogRef, + private profileService: ProfileService + ) { + } + + ngOnInit() { + } + + onCancel(): void { + this.confirmDialogRef.close(); + } + + onConfirm(): void { + this.profileService.deleteAccount().subscribe( + () => { + this.confirmDialogRef.close(); + window.location.href = environment.mycroftUrls.singleSignOn + '/login?redirect=' + environment.mycroftUrls.account; + } + ); + } +} diff --git a/projects/account/src/app/modules/profile/profile.module.ts b/projects/account/src/app/modules/profile/profile.module.ts index dddb441..952f654 100644 --- a/projects/account/src/app/modules/profile/profile.module.ts +++ b/projects/account/src/app/modules/profile/profile.module.ts @@ -37,6 +37,7 @@ import { SharedModule } from 'shared'; import { SupportStepComponent } from './components/views/support-step/support-step.component'; import { UsernameStepComponent } from './components/views/username-step/username-step.component'; import { VerifyCardDialogComponent } from './components/views/payment/verify-card-dialog.component'; +import { DeleteConfirmComponent } from './components/modals/delete-confirm/delete-confirm.component'; @NgModule({ declarations: [ @@ -58,9 +59,11 @@ import { VerifyCardDialogComponent } from './components/views/payment/verify-car // Stuff used in both edit and add components MembershipOptionsComponent, PaymentComponent, - VerifyCardDialogComponent + VerifyCardDialogComponent, + DeleteConfirmComponent ], entryComponents: [ + DeleteConfirmComponent, NewComponent, EditComponent, PaymentComponent, From e9cd98af88951f6f26c1e769633a837f1b06eaec Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 26 Mar 2019 19:00:20 -0500 Subject: [PATCH 133/163] changed how membership changes are communicated to the backend and fixed a couple of bugs related to that process --- .../src/app/core/http/profile.service.ts | 2 +- .../cards/membership/membership.component.ts | 20 +++++++++++-------- .../views/payment/payment.component.ts | 12 +++++------ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/projects/account/src/app/core/http/profile.service.ts b/projects/account/src/app/core/http/profile.service.ts index a611d23..475bd38 100644 --- a/projects/account/src/app/core/http/profile.service.ts +++ b/projects/account/src/app/core/http/profile.service.ts @@ -117,7 +117,7 @@ export class ProfileService { } updateAccount(accountChanges: any) { - return this.http.patch(ACCOUNT_URL, {accountChanges}).pipe( + return this.http.patch(ACCOUNT_URL, accountChanges).pipe( catchError(this.handleError) ); } diff --git a/projects/account/src/app/modules/profile/components/cards/membership/membership.component.ts b/projects/account/src/app/modules/profile/components/cards/membership/membership.component.ts index 4c82721..a5c748f 100644 --- a/projects/account/src/app/modules/profile/components/cards/membership/membership.component.ts +++ b/projects/account/src/app/modules/profile/components/cards/membership/membership.component.ts @@ -3,9 +3,9 @@ import { MediaChange, MediaObserver } from '@angular/flex-layout'; import { MatBottomSheet } from '@angular/material'; import { Subscription } from 'rxjs'; -import { AccountMembership } from '../../../../../shared/models/account-membership.model'; -import { MembershipType } from '../../../../../shared/models/membership.model'; -import { ProfileService } from '../../../../../core/http/profile.service'; +import { AccountMembership } from '@account/models/account-membership.model'; +import { MembershipType } from '@account/models/membership.model'; +import { ProfileService } from '@account/http/profile.service'; import { PaymentComponent } from '../../views/payment/payment.component'; @Component({ @@ -42,20 +42,24 @@ export class MembershipComponent implements OnDestroy { if (selectedMembership) { if (this.accountMembership) { // We have the user's credit card info but they decide to change plans - this.profileService.updateAccount({support: {membership: membershipType}}); + this.profileService.updateAccount( + {membership: {paymentMethod: 'Stripe', newMembership: false, membershipType: membershipType}} + ); } else { // No credit card info. Go to payment screen to collect - this.openBottomSheet(); + this.openBottomSheet(membershipType); } } else { // Membership termination - this.profileService.updateAccount({support: {membership: null}}); + this.profileService.updateAccount( + {membership: {paymentMethod: 'Stripe', newMembership: false, membershipType: null}} + ); } } - openBottomSheet() { + openBottomSheet(membershipType: string) { const bottomSheetConfig = { - data: {newAccount: false}, + data: {newAccount: false, membershipType: membershipType}, disableClose: true, restoreFocus: true }; diff --git a/projects/account/src/app/modules/profile/components/views/payment/payment.component.ts b/projects/account/src/app/modules/profile/components/views/payment/payment.component.ts index 4964789..3691bef 100644 --- a/projects/account/src/app/modules/profile/components/views/payment/payment.component.ts +++ b/projects/account/src/app/modules/profile/components/views/payment/payment.component.ts @@ -8,7 +8,7 @@ import { import { ElementOptions, StripeCardComponent, StripeService } from 'ngx-stripe'; -import { ProfileService } from '../../../../../core/http/profile.service'; +import { ProfileService } from '@account/http/profile.service'; import { VerifyCardDialogComponent } from './verify-card-dialog.component'; const twoSeconds = 2000; @@ -32,7 +32,6 @@ export class PaymentComponent implements OnInit { } } }; - private membershipType: string; private dialogRef: MatDialogRef; constructor( @@ -57,7 +56,7 @@ export class PaymentComponent implements OnInit { if (configData.newAccount) { this.showStripeSuccess(result.token.id); } else { - this.updateAccount(result.token.id); + this.updateAccount(configData.membershipType, result.token.id); } } else if (result.error) { this.showStripeError(result.error.message); @@ -73,10 +72,11 @@ export class PaymentComponent implements OnInit { ); } - updateAccount(stripeToken: string) { + updateAccount(membershipType: string, stripeToken: string) { const newMembership = { - support: { - membership: this.membershipType, + membership: { + newMembership: true, + membershipType: membershipType, paymentMethod: 'Stripe', paymentToken: stripeToken } From 54f47fdea883d46ac9e71e6bb8640c7804c3f86b Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 26 Mar 2019 19:02:27 -0500 Subject: [PATCH 134/163] changed the delete card to show the "are you sure" dialog. --- .../cards/delete/delete.component.html | 2 +- .../cards/delete/delete.component.ts | 27 ++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/projects/account/src/app/modules/profile/components/cards/delete/delete.component.html b/projects/account/src/app/modules/profile/components/cards/delete/delete.component.html index 764301d..29cfddd 100644 --- a/projects/account/src/app/modules/profile/components/cards/delete/delete.component.html +++ b/projects/account/src/app/modules/profile/components/cards/delete/delete.component.html @@ -7,6 +7,6 @@
{{paragraph}}
- +
diff --git a/projects/account/src/app/modules/profile/components/cards/delete/delete.component.ts b/projects/account/src/app/modules/profile/components/cards/delete/delete.component.ts index 89c0592..823176e 100644 --- a/projects/account/src/app/modules/profile/components/cards/delete/delete.component.ts +++ b/projects/account/src/app/modules/profile/components/cards/delete/delete.component.ts @@ -1,20 +1,27 @@ import { Component, OnInit } from '@angular/core'; +import { MatDialog } from '@angular/material'; + +import { DeleteConfirmComponent } from '../../modals/delete-confirm/delete-confirm.component'; @Component({ - selector: 'account-delete', - templateUrl: './delete.component.html', - styleUrls: ['./delete.component.scss'] + selector: 'account-delete', + templateUrl: './delete.component.html', + styleUrls: ['./delete.component.scss'] }) export class DeleteComponent implements OnInit { public deleteWarning: string[]; - constructor() { } + constructor(public confirmDialog: MatDialog) { } - ngOnInit() { - this.deleteWarning = [ - 'Pressing the button below will delete your account and all data related to it from Mycroft servers.', - 'It cannot be undone.' - ]; - } + ngOnInit() { + this.deleteWarning = [ + 'Pressing the button below will delete your account and all data related to it from Mycroft servers.', + 'It cannot be undone.' + ]; + } + + confirmDelete(): void { + this.confirmDialog.open(DeleteConfirmComponent, {minWidth: '320px', maxWidth: '400px'}); + } } From 8ddd7b5691e8f406fa2f56f10da9c348e350cf51 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 26 Mar 2019 23:00:54 -0500 Subject: [PATCH 135/163] fixed a url --- projects/globalnav/src/lib/globalnav.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/globalnav/src/lib/globalnav.component.ts b/projects/globalnav/src/lib/globalnav.component.ts index 0a74e3c..d1de460 100644 --- a/projects/globalnav/src/lib/globalnav.component.ts +++ b/projects/globalnav/src/lib/globalnav.component.ts @@ -53,7 +53,7 @@ export class GlobalnavComponent implements OnInit { this.footerItems = [ {text: 'Contact Us', url: this.mycroftUrls.wordPress + '/contact'}, - {text: 'Media Kit', url: this.mycroftUrls.wordPress + '/mediaObserver'}, + {text: 'Media Kit', url: this.mycroftUrls.wordPress + '/media'}, {text: 'Privacy Policy', url: this.mycroftUrls.account + '/#/privacy-policy'}, {text: 'Terms of Use', url: this.mycroftUrls.account + '/#/agreement-step'} ]; From 8d8bc85a3af09ebeee4722042e6647b6bf505991 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 26 Mar 2019 23:02:42 -0500 Subject: [PATCH 136/163] comment out the device edit and remove buttons until the logic behind them can be implemented --- .../view/device-list/device-list.component.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/projects/account/src/app/modules/device/components/view/device-list/device-list.component.html b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.html index e2153d5..7df14b1 100644 --- a/projects/account/src/app/modules/device/components/view/device-list/device-list.component.html +++ b/projects/account/src/app/modules/device/components/view/device-list/device-list.component.html @@ -11,13 +11,13 @@ {{device.name}} - - - - + + + + + + + +
From d4e6fae70fffdb666ba1c0876f565b8502c69b28 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 29 Mar 2019 12:08:31 -0500 Subject: [PATCH 137/163] minor changes so that the marketplace will work with the API that has been updated to the new architecture --- projects/market/src/app/app.component.html | 5 +-- .../install-button.component.ts | 12 +++--- .../market/src/app/skills/install.service.ts | 40 ++++++++++--------- .../skill-detail-body.component.scss | 11 ++--- .../skill-detail-header.component.scss | 11 +---- .../skill-detail/skill-detail.component.scss | 3 ++ .../skill-detail/skill-detail.component.ts | 4 +- .../skill-card-header.component.html | 2 +- .../skill-card/skill-card-header.component.ts | 2 +- .../skill-card/skill-card.component.html | 2 +- .../skill-card/skill-card.component.ts | 4 +- .../skill-summary.component.scss | 4 +- .../src/app/skills/skills-routing.module.ts | 2 +- .../market/src/app/skills/skills.service.ts | 21 ++++++---- 14 files changed, 60 insertions(+), 63 deletions(-) diff --git a/projects/market/src/app/app.component.html b/projects/market/src/app/app.component.html index 247b98d..f43c258 100644 --- a/projects/market/src/app/app.component.html +++ b/projects/market/src/app/app.component.html @@ -1,7 +1,4 @@ - +
diff --git a/projects/market/src/app/skills/skill-summary/skill-card/skill-card-header.component.ts b/projects/market/src/app/skills/skill-summary/skill-card/skill-card-header.component.ts index 69cd1b6..3a5d541 100644 --- a/projects/market/src/app/skills/skill-summary/skill-card/skill-card-header.component.ts +++ b/projects/market/src/app/skills/skill-summary/skill-card/skill-card-header.component.ts @@ -26,7 +26,7 @@ export class SkillCardHeaderComponent implements OnInit { this.installService.installStatuses.subscribe( (installStatuses) => { const installStatus = this.installService.getSkillInstallStatus( - this.skill.name, + this.skill.id, this.skill.isSystemSkill, installStatuses ); diff --git a/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.html b/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.html index 6760396..ac1854c 100644 --- a/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.html +++ b/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.html @@ -1,7 +1,7 @@ -
+
{{skill.title ? skill.title : ' '}} diff --git a/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.ts b/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.ts index c77dffd..8769118 100644 --- a/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.ts +++ b/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.ts @@ -37,8 +37,8 @@ export class SkillCardComponent implements OnInit { showStatusNotifications(statusChange: string[]) { let notificationMessage: string; - const [skillName, notificationStatus] = statusChange; - if (this.skill.name === skillName) { + const [skillId, notificationStatus] = statusChange; + if (this.skill.id === skillId) { switch (notificationStatus) { case ('installed'): { notificationMessage = 'The ' + this.skill.title + ' skill has ' + diff --git a/projects/market/src/app/skills/skill-summary/skill-summary.component.scss b/projects/market/src/app/skills/skill-summary/skill-summary.component.scss index 7c4d98c..a33a294 100644 --- a/projects/market/src/app/skills/skill-summary/skill-summary.component.scss +++ b/projects/market/src/app/skills/skill-summary/skill-summary.component.scss @@ -2,12 +2,10 @@ @import 'mycroft-colors'; #skill-category { - //background-color: $market-background; - mat-toolbar { - //background-color: $market-background; color: mat-color($mycroft-accent, A700); font-size: xx-large; + font-weight: bold; margin-top: 20px; padding-left: 10px; diff --git a/projects/market/src/app/skills/skills-routing.module.ts b/projects/market/src/app/skills/skills-routing.module.ts index cfbb66e..e4e7a65 100644 --- a/projects/market/src/app/skills/skills-routing.module.ts +++ b/projects/market/src/app/skills/skills-routing.module.ts @@ -6,7 +6,7 @@ import { SkillDetailComponent } from './skill-detail/skill-detail.component'; const routes: Routes = [ { path: 'skills', component: SkillSummaryComponent }, - { path: 'skill/:skillName', component: SkillDetailComponent} + { path: 'skills/:skillId', component: SkillDetailComponent} ]; @NgModule({ diff --git a/projects/market/src/app/skills/skills.service.ts b/projects/market/src/app/skills/skills.service.ts index 4bd6421..1ce2470 100644 --- a/projects/market/src/app/skills/skills.service.ts +++ b/projects/market/src/app/skills/skills.service.ts @@ -11,7 +11,7 @@ export interface AvailableSkill { isMycroftMade: boolean; isSystemSkill: boolean; marketCategory: string; - name: string; + id: string; summary: string; title: string; trigger: string; @@ -22,14 +22,19 @@ export interface SkillCredits { github_id: string; } +export interface Icon { + icon: string; + color: string; +} + export interface SkillDetail { categories: string[]; credits: SkillCredits[]; description: string; - icon: Object; + icon: Icon; iconImage: string; isSystemSkill: boolean; - name: string; + id: string; repositoryUrl: string; summary: string; title: string; @@ -40,8 +45,8 @@ export interface SkillDetail { worksOnPicroft: boolean; } -const availableSkillsUrl = '/api/skill/available'; -const skillUrl = '/api/skill/detail/'; +const availableSkillsUrl = '/api/skills/available'; +const skillUrl = '/api/skills/'; const searchQuery = '?search='; @Injectable() @@ -96,10 +101,10 @@ export class SkillsService { /** * API call to retrieve detailed information about a specified skill. * - * @param skillName: name of the skill to retrieve + * @param skillId: ID of the skill to retrieve */ - getSkillById(skillName: string): Observable { - return this.http.get(skillUrl + skillName); + getSkillById(skillId: string): Observable { + return this.http.get(skillUrl + skillId); } /** From 9a7999e27bacda68c92b826a734cd987be7bb968 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 29 Mar 2019 12:11:31 -0500 Subject: [PATCH 138/163] add marketplace to jenkinsfile --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index a6a4e75..b3f3edc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,6 +15,7 @@ pipeline { sh 'ng build --project globalnav' sh 'ng build --project page-not-found' sh 'ng build --project account --configuration development' + sh 'ng build --project market --configuration development' sh 'ng build --project sso --configuration development' } } @@ -31,6 +32,7 @@ pipeline { sh 'ng build --project globalnav' sh 'ng build --project page-not-found' sh 'ng build --project account --configuration test' + sh 'ng build --project market --configuration test' sh 'ng build --project sso --configuration test' } } @@ -55,6 +57,13 @@ pipeline { sh 'scp -r dist/globalnav root@198.199.90.118:/var/www/' sh 'scp -r dist/page-not-found root@198.199.90.118:/var/www/' sh 'scp -r dist/sso root@198.199.90.118:/var/www/' + + // Deploy single sign on application and its associated libraries + echo 'Deploying single sign on application...' + sh 'scp -r dist/shared root@198.211.106.110:/var/www/' + sh 'scp -r dist/globalnav root@198.211.106.110:/var/www/' + sh 'scp -r dist/page-not-found root@198.211.106.110:/var/www/' + sh 'scp -r dist/market root@198.211.106.110:/var/www/' } } } From fc9ae40b8375f0d54e328e62af0e048fabaf0dc4 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 29 Mar 2019 12:14:21 -0500 Subject: [PATCH 139/163] changed compile options for the marketplace test environment to improve performance --- angular.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/angular.json b/angular.json index fb47d9a..f3fe3c8 100644 --- a/angular.json +++ b/angular.json @@ -230,7 +230,15 @@ "with": "projects/market/src/environments/environment.test.ts" } ], - "outputHashing": "all" + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true }, "development": { "fileReplacements": [ From dfb72aef6575ec8b832a5b548aa7bf98a0d35ce5 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 29 Mar 2019 12:29:50 -0500 Subject: [PATCH 140/163] default redirect URI to the account dashboard if none is found in local storage --- .../src/app/modules/profile/pages/new/new.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/modules/profile/pages/new/new.component.ts b/projects/account/src/app/modules/profile/pages/new/new.component.ts index 546834b..3a1a8c5 100644 --- a/projects/account/src/app/modules/profile/pages/new/new.component.ts +++ b/projects/account/src/app/modules/profile/pages/new/new.component.ts @@ -12,12 +12,12 @@ import { ActivatedRoute } from '@angular/router'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; import { Subscription } from 'rxjs'; -import { MembershipType } from '../../../../shared/models/membership.model'; +import { MembershipType } from '@account/models/membership.model'; import { navigateToLogin, ProfileService, storeRedirect -} from '../../../../core/http/profile.service'; +} from '@account/http/profile.service'; const noDelay = 0; From 277843642c1831385ff5dd7440f005006b569bc9 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 29 Mar 2019 12:31:14 -0500 Subject: [PATCH 141/163] minor refactor --- projects/account/src/app/core/http/profile.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/account/src/app/core/http/profile.service.ts b/projects/account/src/app/core/http/profile.service.ts index 475bd38..7f2026a 100644 --- a/projects/account/src/app/core/http/profile.service.ts +++ b/projects/account/src/app/core/http/profile.service.ts @@ -29,11 +29,14 @@ export function storeRedirect() { } export function navigateToLogin(delay: number): void { - const redirectURI = localStorage.getItem('redirect'); + let redirectURI = localStorage.getItem('redirect'); + if (!redirectURI) { + redirectURI = environment.mycroftUrls.account; + localStorage.removeItem('redirect'); + } const singleSignOnURI = environment.mycroftUrls.singleSignOn + '/login?redirect=' + redirectURI; - localStorage.removeItem('redirect'); setTimeout(() => { window.location.assign(singleSignOnURI); }, delay); } From 6f7567374e82acf8e1e646380434c59e6495153a Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 29 Mar 2019 12:32:03 -0500 Subject: [PATCH 142/163] minor bug fix --- projects/account/src/app/core/http/profile.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/core/http/profile.service.ts b/projects/account/src/app/core/http/profile.service.ts index 7f2026a..e8e722b 100644 --- a/projects/account/src/app/core/http/profile.service.ts +++ b/projects/account/src/app/core/http/profile.service.ts @@ -30,9 +30,9 @@ export function storeRedirect() { export function navigateToLogin(delay: number): void { let redirectURI = localStorage.getItem('redirect'); + localStorage.removeItem('redirect'); if (!redirectURI) { redirectURI = environment.mycroftUrls.account; - localStorage.removeItem('redirect'); } const singleSignOnURI = environment.mycroftUrls.singleSignOn + '/login?redirect=' + From 0d7bed55779ae92634ca34b611d965b94021254c Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Fri, 29 Mar 2019 12:37:36 -0500 Subject: [PATCH 143/163] removed local page not found component in favor of the library --- .../page-not-found/page-not-found.component.html | 1 - .../page-not-found/page-not-found.component.scss | 0 .../page-not-found/page-not-found.component.ts | 15 --------------- 3 files changed, 16 deletions(-) delete mode 100644 projects/market/src/app/page-not-found/page-not-found.component.html delete mode 100644 projects/market/src/app/page-not-found/page-not-found.component.scss delete mode 100644 projects/market/src/app/page-not-found/page-not-found.component.ts diff --git a/projects/market/src/app/page-not-found/page-not-found.component.html b/projects/market/src/app/page-not-found/page-not-found.component.html deleted file mode 100644 index 6c581c4..0000000 --- a/projects/market/src/app/page-not-found/page-not-found.component.html +++ /dev/null @@ -1 +0,0 @@ -

Page not found

\ No newline at end of file diff --git a/projects/market/src/app/page-not-found/page-not-found.component.scss b/projects/market/src/app/page-not-found/page-not-found.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/projects/market/src/app/page-not-found/page-not-found.component.ts b/projects/market/src/app/page-not-found/page-not-found.component.ts deleted file mode 100644 index e51c647..0000000 --- a/projects/market/src/app/page-not-found/page-not-found.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'market-page-not-found', - templateUrl: './page-not-found.component.html', - styleUrls: ['./page-not-found.component.scss'] -}) -export class PageNotFoundComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} From ea5b8eccc486b25a52ee24e91e8a2b3a82278e9d Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 1 Apr 2019 20:03:18 -0500 Subject: [PATCH 144/163] implement password reset --- projects/sso/src/app/app-routing.module.ts | 2 + projects/sso/src/app/app.module.ts | 4 +- projects/sso/src/app/app.service.ts | 29 ++++++++- .../app/background/background.component.html | 8 --- .../app/background/background.component.scss | 34 ---------- .../app/background/background.component.ts | 14 ---- .../src/app/background/background.module.ts | 10 --- .../change-password.component.html | 49 ++++++++++++++ .../change-password.component.scss | 38 +++++++++++ .../change-password.component.ts | 64 +++++++++++++++++++ .../change-password/change-password.module.ts | 36 +++++++++++ .../internal-login.component.html | 4 +- .../internal-login.component.scss | 14 ++-- .../internal-login.component.ts | 36 +++++++++-- .../password-reset.component.html | 21 ++++++ .../password-reset.component.scss | 17 +++++ .../password-reset.component.ts | 24 +++++++ projects/sso/src/app/login/login.module.ts | 13 +++- 18 files changed, 329 insertions(+), 88 deletions(-) delete mode 100644 projects/sso/src/app/background/background.component.html delete mode 100644 projects/sso/src/app/background/background.component.scss delete mode 100644 projects/sso/src/app/background/background.component.ts delete mode 100644 projects/sso/src/app/background/background.module.ts create mode 100644 projects/sso/src/app/change-password/change-password.component.html create mode 100644 projects/sso/src/app/change-password/change-password.component.scss create mode 100644 projects/sso/src/app/change-password/change-password.component.ts create mode 100644 projects/sso/src/app/change-password/change-password.module.ts create mode 100644 projects/sso/src/app/login/internal-login/password-reset/password-reset.component.html create mode 100644 projects/sso/src/app/login/internal-login/password-reset/password-reset.component.scss create mode 100644 projects/sso/src/app/login/internal-login/password-reset/password-reset.component.ts diff --git a/projects/sso/src/app/app-routing.module.ts b/projects/sso/src/app/app-routing.module.ts index fee4d78..141fb52 100644 --- a/projects/sso/src/app/app-routing.module.ts +++ b/projects/sso/src/app/app-routing.module.ts @@ -1,6 +1,7 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; +import { ChangePasswordComponent } from './change-password/change-password.component'; import { LoginComponent } from './login/login.component'; import { LogoutComponent } from './logout/logout.component'; import { PageNotFoundComponent } from 'page-not-found'; @@ -8,6 +9,7 @@ import { PageNotFoundComponent } from 'page-not-found'; const routes: Routes = [ { path: 'login', component: LoginComponent }, { path: 'logout', component: LogoutComponent }, + { path: 'change-password', component: ChangePasswordComponent}, { path: '', redirectTo: '/login', pathMatch: 'full' }, { path: '**', component: PageNotFoundComponent } ]; diff --git a/projects/sso/src/app/app.module.ts b/projects/sso/src/app/app.module.ts index 19402c8..aa79c3b 100644 --- a/projects/sso/src/app/app.module.ts +++ b/projects/sso/src/app/app.module.ts @@ -5,7 +5,7 @@ import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; -import { BackgroundModule } from './background/background.module'; +import { ChangePasswordModule } from './change-password/change-password.module'; import { GlobalnavModule } from 'globalnav'; import { LoginModule } from './login/login.module'; import { LogoutModule } from './logout/logout.module'; @@ -15,8 +15,8 @@ import { PageNotFoundModule } from 'page-not-found'; declarations: [ AppComponent ], imports: [ BrowserModule, - BackgroundModule, BrowserAnimationsModule, + ChangePasswordModule, FlexLayoutModule, GlobalnavModule, LoginModule, diff --git a/projects/sso/src/app/app.service.ts b/projects/sso/src/app/app.service.ts index fc80168..f1bb8f4 100644 --- a/projects/sso/src/app/app.service.ts +++ b/projects/sso/src/app/app.service.ts @@ -2,7 +2,8 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders} from '@angular/common/http'; import { Observable } from 'rxjs'; -import { FormGroup } from '@angular/forms'; +import { AbstractControl, FormGroup } from '@angular/forms'; +import { environment } from '../environments/environment'; export interface AuthResponse { expiration: number; @@ -20,12 +21,21 @@ export interface SocialLoginData { const internalAuthUrl = '/api/internal-login'; const federatedAuthUrl = '/api/validate-federated'; const logoutUrl = '/api/logout'; +const changePasswordUrl = '/api/password-change'; +const resetPasswordUrl = '/api/password-reset'; +const validateTokenUrl = '/api/validate-token'; export interface FederatedLoginToken { platform: string; token: string; } +export interface PasswordChangeAccount { + accountId: string; + tokenExpired: boolean; + tokenInvalid: boolean; +} + export function storeRedirect() { localStorage.setItem( 'redirect', @@ -39,8 +49,11 @@ export class AppService { constructor(private http: HttpClient) { } navigateToRedirectURI(delay: number): void { - const redirectURI = localStorage.getItem('redirect'); + let redirectURI = localStorage.getItem('redirect'); localStorage.removeItem('redirect'); + if (!redirectURI) { + redirectURI = environment.mycroftUrls.account; + } setTimeout(() => { window.location.assign(redirectURI); }, delay); } @@ -71,4 +84,16 @@ export class AppService { return this.http.get(logoutUrl); } + resetPassword(emailAddress: AbstractControl): Observable { + return this.http.post(resetPasswordUrl, {emailAddress: emailAddress.value}); + } + + validateResetToken(token) { + return this.http.post(validateTokenUrl, {token: token}); + } + + changePassword(accountId: string, passwordControl: AbstractControl) { + const codedPassword = btoa(passwordControl.value); + return this.http.put(changePasswordUrl, {accountId: accountId, password: codedPassword}); + } } diff --git a/projects/sso/src/app/background/background.component.html b/projects/sso/src/app/background/background.component.html deleted file mode 100644 index 7f549a3..0000000 --- a/projects/sso/src/app/background/background.component.html +++ /dev/null @@ -1,8 +0,0 @@ -
-
-
- -
-
-
-
diff --git a/projects/sso/src/app/background/background.component.scss b/projects/sso/src/app/background/background.component.scss deleted file mode 100644 index 9000f35..0000000 --- a/projects/sso/src/app/background/background.component.scss +++ /dev/null @@ -1,34 +0,0 @@ -@import "~@angular/material/theming"; -@import "mycroft-colors"; - -/* Split the screen in half */ -@mixin half-screen { - height: 50%; - left: 0; - overflow-x: hidden; - padding-top: 20px; - position: fixed; - width: 100%; - z-index: -1; -} - -/* Top Half */ -#top-half { - @include half-screen; - top: 0; - background-color: mat-color($mycroft-primary); -} - -/* Bottom Half */ -#bottom-half { - @include half-screen; - bottom: 0; - background-color: #e5e5e5; -} - -img { - margin-top: 3vh; - margin-left: 32px; - margin-right: 32px; - max-width: 600px; -} diff --git a/projects/sso/src/app/background/background.component.ts b/projects/sso/src/app/background/background.component.ts deleted file mode 100644 index 614767b..0000000 --- a/projects/sso/src/app/background/background.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'sso-background', - templateUrl: './background.component.html', - styleUrls: ['./background.component.scss'] -}) -export class BackgroundComponent implements OnInit { - - constructor() { } - - ngOnInit() { } - -} diff --git a/projects/sso/src/app/background/background.module.ts b/projects/sso/src/app/background/background.module.ts deleted file mode 100644 index 8071069..0000000 --- a/projects/sso/src/app/background/background.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { BackgroundComponent } from './background.component'; - -@NgModule({ - declarations: [ BackgroundComponent ], - exports: [ BackgroundComponent ], - imports: [ CommonModule ], -}) -export class BackgroundModule { } diff --git a/projects/sso/src/app/change-password/change-password.component.html b/projects/sso/src/app/change-password/change-password.component.html new file mode 100644 index 0000000..fdd1519 --- /dev/null +++ b/projects/sso/src/app/change-password/change-password.component.html @@ -0,0 +1,49 @@ + + + Change your password + + + New Password + + + Password is required + + +
+ +
+
+
+ + + Your request expired... + + Password reset requests expire one hour after they are issued. You can still reset your + password. Just issue a new request by clicking the button below. + + + + + + + + We looked everywhere... + + Sorry, but we could not find the account associated with this password + reset request. You can submit another request by clicking the button below. + + + + + +
diff --git a/projects/sso/src/app/change-password/change-password.component.scss b/projects/sso/src/app/change-password/change-password.component.scss new file mode 100644 index 0000000..dafc5e2 --- /dev/null +++ b/projects/sso/src/app/change-password/change-password.component.scss @@ -0,0 +1,38 @@ +@import "~@angular/material/theming"; +@import 'mycroft-colors'; +@import "components/buttons"; + +mat-card { + margin-bottom: 8px; + margin-left: auto; + margin-right: auto; + max-width: 500px; + min-width: 320px; + + mat-card-title { + color: mat-color($mycroft-primary); + padding: 16px; + } + + mat-card-content { + padding: 16px; + + mat-form-field { + width: 320px; + } + } + + mat-card-actions { + padding: 16px; + + button { + @include action-button-primary; + margin-bottom: 16px; + } + } + + button { + @include action-button-primary; + margin-top: 16px; + } +} diff --git a/projects/sso/src/app/change-password/change-password.component.ts b/projects/sso/src/app/change-password/change-password.component.ts new file mode 100644 index 0000000..86758e6 --- /dev/null +++ b/projects/sso/src/app/change-password/change-password.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { FormControl, Validators } from '@angular/forms'; +import { MatDialog, MatSnackBar, MatSnackBarConfig } from '@angular/material'; +import { Observable } from 'rxjs'; + +import { AppService, PasswordChangeAccount } from '../app.service'; +import { PasswordResetComponent } from '../login/internal-login/password-reset/password-reset.component'; + +const fiveSeconds = 5000; + +@Component({ + selector: 'sso-change-password', + templateUrl: './change-password.component.html', + styleUrls: ['./change-password.component.scss'] +}) +export class ChangePasswordComponent implements OnInit { + public account$: Observable; + public emailControl = new FormControl(null, [Validators.required, Validators.email]); + public passwordControl = new FormControl(null, [Validators.required]); + + constructor( + private route: ActivatedRoute, + private authService: AppService, + private snackBar: MatSnackBar, + private dialog: MatDialog, + private router: Router + ) { + } + + ngOnInit() { + const resetToken = this.route.snapshot.queryParams['token']; + this.account$ = this.authService.validateResetToken(resetToken); + console.log(this.emailControl.valid); + } + + onChangePassword(accountId: string) { + this.authService.changePassword(accountId, this.passwordControl).subscribe( + () => { this.router.navigate(['login']); } + ); + } + + onPasswordReset() { + const dialogRef = this.dialog.open( + PasswordResetComponent, + {width: '320px', data: this.emailControl} + ); + dialogRef.afterClosed().subscribe( + () => { this.resetPassword(); } + ); + } + + resetPassword() { + const successMessage = 'Password reset instructions sent'; + const errorMessage = 'An error occurred sending the instructions email'; + const snackbarConfig = new MatSnackBarConfig(); + snackbarConfig.duration = fiveSeconds; + snackbarConfig.panelClass = 'mycroft-no-action-snackbar'; + this.authService.resetPassword(this.emailControl).subscribe( + () => { this.snackBar.open(successMessage, null, snackbarConfig); }, + () => { this.snackBar.open(errorMessage, null, snackbarConfig); } + ); + } +} diff --git a/projects/sso/src/app/change-password/change-password.module.ts b/projects/sso/src/app/change-password/change-password.module.ts new file mode 100644 index 0000000..dd17e3e --- /dev/null +++ b/projects/sso/src/app/change-password/change-password.module.ts @@ -0,0 +1,36 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FlexLayoutModule } from '@angular/flex-layout'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { + MatButtonModule, + MatCardModule, + MatInputModule, + MatFormFieldModule, + MatSnackBarModule +} from '@angular/material'; + + +import { ChangePasswordComponent } from './change-password.component'; +import { PasswordResetComponent } from '../login/internal-login/password-reset/password-reset.component'; + +@NgModule({ + declarations: [ + ChangePasswordComponent + ], + entryComponents: [ + PasswordResetComponent + ], + imports: [ + CommonModule, + FlexLayoutModule, + FormsModule, + MatButtonModule, + MatCardModule, + MatFormFieldModule, + MatInputModule, + MatSnackBarModule, + ReactiveFormsModule + ] +}) +export class ChangePasswordModule { } diff --git a/projects/sso/src/app/login/internal-login/internal-login.component.html b/projects/sso/src/app/login/internal-login/internal-login.component.html index 2e53a90..70ae921 100644 --- a/projects/sso/src/app/login/internal-login/internal-login.component.html +++ b/projects/sso/src/app/login/internal-login/internal-login.component.html @@ -17,5 +17,7 @@ - Forgot password? +
+ +
diff --git a/projects/sso/src/app/login/internal-login/internal-login.component.scss b/projects/sso/src/app/login/internal-login/internal-login.component.scss index ae8a0a5..509bf9a 100644 --- a/projects/sso/src/app/login/internal-login/internal-login.component.scss +++ b/projects/sso/src/app/login/internal-login/internal-login.component.scss @@ -12,17 +12,13 @@ form { button { @include action-button-primary; - margin-bottom: 8px; margin-top: 8px; text-align: center; } - a { - color: mat-color($mycroft-primary); - margin-left: auto; - margin-right: auto; - margin-bottom: 0px; - text-decoration: none; - } - +} + +button { + color: mat-color($mycroft-primary); + margin-bottom: 0; } diff --git a/projects/sso/src/app/login/internal-login/internal-login.component.ts b/projects/sso/src/app/login/internal-login/internal-login.component.ts index dac10ca..0325faf 100644 --- a/projects/sso/src/app/login/internal-login/internal-login.component.ts +++ b/projects/sso/src/app/login/internal-login/internal-login.component.ts @@ -1,11 +1,12 @@ import { Component, OnInit } from '@angular/core'; import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MatSnackBar } from '@angular/material'; +import { MatDialog, MatSnackBar, MatSnackBarConfig } from '@angular/material'; import { AppService } from '../../app.service'; +import { PasswordResetComponent } from './password-reset/password-reset.component'; const noDelay = 0; -const tenSeconds = 10000; +const fiveSeconds = 5000; @Component({ selector: 'sso-internal-login', @@ -19,8 +20,9 @@ export class InternalLoginComponent implements OnInit { constructor( private authService: AppService, - private errorSnackbar: MatSnackBar, - private formBuilder: FormBuilder + private snackBar: MatSnackBar, + private formBuilder: FormBuilder, + public dialog: MatDialog ) { } ngOnInit() { @@ -45,11 +47,33 @@ export class InternalLoginComponent implements OnInit { onAuthFailure(authorizeUserResponse): void { if (authorizeUserResponse.status === 401) { - this.errorSnackbar.open( + this.snackBar.open( 'Authentication error, please try again', null, - {panelClass: 'mycroft-no-action-snackbar', duration: tenSeconds} + {panelClass: 'mycroft-no-action-snackbar', duration: fiveSeconds} ); } } + + onPasswordReset() { + const dialogRef = this.dialog.open( + PasswordResetComponent, + {width: '320px', data: this.loginForm.controls['email']} + ); + dialogRef.afterClosed().subscribe( + () => { this.resetPassword(); } + ); + } + + resetPassword() { + const successMessage = 'Password reset instructions sent'; + const errorMessage = 'An error occurred sending the instructions email'; + const snackbarConfig = new MatSnackBarConfig(); + snackbarConfig.duration = fiveSeconds; + snackbarConfig.panelClass = 'mycroft-no-action-snackbar'; + this.authService.resetPassword(this.loginForm.controls['email']).subscribe( + () => { this.snackBar.open(successMessage, null, snackbarConfig); }, + () => { this.snackBar.open(errorMessage, null, snackbarConfig); } + ); + } } diff --git a/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.html b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.html new file mode 100644 index 0000000..e6bfafd --- /dev/null +++ b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.html @@ -0,0 +1,21 @@ +

Reset Your Password

+
+

+ A message containing password reset instructions will be sent to the email address entered below: +

+ + Email + + + Must be a valid email address + + + Email is required + + +
+
+ +
diff --git a/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.scss b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.scss new file mode 100644 index 0000000..2b4b6c8 --- /dev/null +++ b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.scss @@ -0,0 +1,17 @@ +@import "~@angular/material/theming"; +@import 'mycroft-colors'; +@import "components/buttons"; + + +h2 { + color: mat-color($mycroft-primary); +} + +mat-form-field { + min-width: 270px; +} + +button { + @include action-button-primary; + margin-top: 8px; +} diff --git a/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.ts b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.ts new file mode 100644 index 0000000..51c9e7a --- /dev/null +++ b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.ts @@ -0,0 +1,24 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; +import { FormControl } from '@angular/forms'; + +@Component({ + selector: 'sso-password-reset', + templateUrl: './password-reset.component.html', + styleUrls: ['./password-reset.component.scss'] +}) +export class PasswordResetComponent implements OnInit { + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public dialogData: FormControl + ) { } + + ngOnInit() { + } + + onSubmit() { + this.dialogRef.close(); + } + +} diff --git a/projects/sso/src/app/login/login.module.ts b/projects/sso/src/app/login/login.module.ts index 4c10874..f8858f9 100644 --- a/projects/sso/src/app/login/login.module.ts +++ b/projects/sso/src/app/login/login.module.ts @@ -7,6 +7,7 @@ import { MatButtonModule, MatCardModule, MatCheckboxModule, + MatDialogModule, MatDividerModule, MatFormFieldModule, MatInputModule, @@ -20,15 +21,22 @@ import { FederatedLoginComponent } from './federated-login/federated-login.compo import { InternalLoginComponent } from './internal-login/internal-login.component'; import { LoginComponent } from './login.component'; import { SharedModule } from 'shared'; +import { PasswordResetComponent } from './internal-login/password-reset/password-reset.component'; @NgModule({ declarations: [ FederatedLoginComponent, InternalLoginComponent, + LoginComponent, + PasswordResetComponent + ], + entryComponents: [ + LoginComponent, + PasswordResetComponent + ], + exports: [ LoginComponent ], - entryComponents: [ LoginComponent ], - exports: [ LoginComponent ], imports: [ CommonModule, FlexLayoutModule, @@ -38,6 +46,7 @@ import { SharedModule } from 'shared'; MatButtonModule, MatCardModule, MatCheckboxModule, + MatDialogModule, MatDividerModule, MatFormFieldModule, MatInputModule, From b7af0834040fb81d7cef1bc0fd35dcfd9afa22e7 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 1 Apr 2019 20:12:10 -0500 Subject: [PATCH 145/163] minor refactor --- src/styles.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/styles.scss b/src/styles.scss index d8c14c0..2cea184 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -3,7 +3,6 @@ margin: 3vmin; } - .mycroft-snackbar { width: 500px; } From 114c508f6bf97739b9cf188beeea954a878a8b81 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 1 Apr 2019 20:12:32 -0500 Subject: [PATCH 146/163] fixed a bad color --- src/stylesheets/components/_text.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stylesheets/components/_text.scss b/src/stylesheets/components/_text.scss index 368b53b..8f4df94 100644 --- a/src/stylesheets/components/_text.scss +++ b/src/stylesheets/components/_text.scss @@ -8,7 +8,7 @@ } @mixin skill-trigger { - background-color: mat-color($mycroft-accent, A700); + background-color: mat-color($mycroft-primary, 50); border-radius: 4px; color: mat-color($mycroft-accent); font-weight: normal; From 542bfb328149bd70d769c2383fb9f2dd4fcee074 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 1 Apr 2019 20:18:51 -0500 Subject: [PATCH 147/163] comment out the advanced options code until the button at the bottom of the card can be implemented --- .../preferences/preferences.component.html | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/projects/account/src/app/modules/device/components/view/preferences/preferences.component.html b/projects/account/src/app/modules/device/components/view/preferences/preferences.component.html index 0f1f023..3239c2f 100644 --- a/projects/account/src/app/modules/device/components/view/preferences/preferences.component.html +++ b/projects/account/src/app/modules/device/components/view/preferences/preferences.component.html @@ -30,14 +30,14 @@ - - - Advanced Settings - -
-
-

{{paragraph}}

-
- -
-
+ + + + + + + + + + + From 9cb3b2134689583c9ed5f409f52078823ee9ba59 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 12:29:25 -0500 Subject: [PATCH 148/163] change skill title to skill display name --- .../skill-detail-header/skill-detail-header.component.html | 2 +- .../skills/skill-summary/skill-card/skill-card.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/market/src/app/skills/skill-detail/skill-detail-header/skill-detail-header.component.html b/projects/market/src/app/skills/skill-detail/skill-detail-header/skill-detail-header.component.html index a81d3a8..d141106 100644 --- a/projects/market/src/app/skills/skill-detail/skill-detail-header/skill-detail-header.component.html +++ b/projects/market/src/app/skills/skill-detail/skill-detail-header/skill-detail-header.component.html @@ -13,7 +13,7 @@ >
-

{{skill.title}}

+

{{skill.display_name}}

diff --git a/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.html b/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.html index ac1854c..918a695 100644 --- a/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.html +++ b/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.html @@ -4,7 +4,7 @@
- {{skill.title ? skill.title : ' '}} + {{skill.displayName ? skill.displayName : ' '}}
From d92096a2cb23b75d125db8aa2a7c3dfe517d31ce Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 12:33:54 -0500 Subject: [PATCH 149/163] fixed a couple of typos --- .../skill-detail-header/skill-detail-header.component.html | 2 +- projects/market/src/app/skills/skills.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/market/src/app/skills/skill-detail/skill-detail-header/skill-detail-header.component.html b/projects/market/src/app/skills/skill-detail/skill-detail-header/skill-detail-header.component.html index d141106..c2617d2 100644 --- a/projects/market/src/app/skills/skill-detail/skill-detail-header/skill-detail-header.component.html +++ b/projects/market/src/app/skills/skill-detail/skill-detail-header/skill-detail-header.component.html @@ -13,7 +13,7 @@ >
-

{{skill.display_name}}

+

{{skill.displayName}}

diff --git a/projects/market/src/app/skills/skills.service.ts b/projects/market/src/app/skills/skills.service.ts index 1ce2470..309d31d 100644 --- a/projects/market/src/app/skills/skills.service.ts +++ b/projects/market/src/app/skills/skills.service.ts @@ -6,6 +6,7 @@ import { Subject } from 'rxjs/internal/Subject'; import { tap } from 'rxjs/operators'; export interface AvailableSkill { + displayName: string; icon: Object; iconImage: string; isMycroftMade: boolean; @@ -13,7 +14,6 @@ export interface AvailableSkill { marketCategory: string; id: string; summary: string; - title: string; trigger: string; } @@ -28,6 +28,7 @@ export interface Icon { } export interface SkillDetail { + displayName: string; categories: string[]; credits: SkillCredits[]; description: string; @@ -37,7 +38,6 @@ export interface SkillDetail { id: string; repositoryUrl: string; summary: string; - title: string; triggers: string; worksOnKDE: boolean; worksOnMarkOne: boolean; From 341ce635fef812ca79d240f956f2dff5f8412118 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 12:40:30 -0500 Subject: [PATCH 150/163] new urls for the privacy policy and terms of use on the wordpress site. --- projects/globalnav/src/lib/globalnav.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/globalnav/src/lib/globalnav.component.ts b/projects/globalnav/src/lib/globalnav.component.ts index d1de460..f294997 100644 --- a/projects/globalnav/src/lib/globalnav.component.ts +++ b/projects/globalnav/src/lib/globalnav.component.ts @@ -54,8 +54,8 @@ export class GlobalnavComponent implements OnInit { this.footerItems = [ {text: 'Contact Us', url: this.mycroftUrls.wordPress + '/contact'}, {text: 'Media Kit', url: this.mycroftUrls.wordPress + '/media'}, - {text: 'Privacy Policy', url: this.mycroftUrls.account + '/#/privacy-policy'}, - {text: 'Terms of Use', url: this.mycroftUrls.account + '/#/agreement-step'} + {text: 'Privacy Policy', url: this.mycroftUrls.wordPress + '/embed-privacy-policy'}, + {text: 'Terms of Use', url: this.mycroftUrls.account + '/embed-terms-of-use'} ]; } From 71a353d68e242220e9b48b37bcb494fe8d38f593 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 12:43:42 -0500 Subject: [PATCH 151/163] change skill title to skill display name --- .../app/skills/install-button/install-button.component.ts | 4 ++-- .../skill-summary/skill-card/skill-card.component.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/market/src/app/skills/install-button/install-button.component.ts b/projects/market/src/app/skills/install-button/install-button.component.ts index 754ffee..a913eca 100644 --- a/projects/market/src/app/skills/install-button/install-button.component.ts +++ b/projects/market/src/app/skills/install-button/install-button.component.ts @@ -84,7 +84,7 @@ export class InstallButtonComponent implements OnInit { this.installService.applyInstallStatusChanges(); this.installService.checkInstallationsInProgress(); this.installSnackbar.open( - 'The ' + this.skill.title + ' skill is being added ' + + 'The ' + this.skill.displayName + ' skill is being added ' + 'to your devices. Please allow up to two minutes for ' + 'installation to complete before using the skill.', null, @@ -135,7 +135,7 @@ export class InstallButtonComponent implements OnInit { this.installService.applyInstallStatusChanges(); this.installService.checkInstallationsInProgress(); this.installSnackbar.open( - 'The ' + this.skill.title + ' skill is ' + + 'The ' + this.skill.displayName + ' skill is ' + 'uninstalling. Please allow up to a minute for the skill to be ' + 'removed from devices.', null, diff --git a/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.ts b/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.ts index 8769118..f822375 100644 --- a/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.ts +++ b/projects/market/src/app/skills/skill-summary/skill-card/skill-card.component.ts @@ -41,26 +41,26 @@ export class SkillCardComponent implements OnInit { if (this.skill.id === skillId) { switch (notificationStatus) { case ('installed'): { - notificationMessage = 'The ' + this.skill.title + ' skill has ' + + notificationMessage = 'The ' + this.skill.displayName + ' skill has ' + 'been added to all your devices.'; this.showInstallStatusNotification(notificationMessage); break; } case ('uninstalled'): { - notificationMessage = 'The ' + this.skill.title + ' skill has ' + + notificationMessage = 'The ' + this.skill.displayName + ' skill has ' + 'been removed from all your devices.'; this.showInstallStatusNotification(notificationMessage); break; } case ('install failed'): { - notificationMessage = 'The ' + this.skill.title + ' failed to ' + + notificationMessage = 'The ' + this.skill.displayName + ' failed to ' + 'install to one or more of your devices. Install will be ' + 'retried until successful'; this.showInstallStatusNotification(notificationMessage); break; } case ('uninstall failed'): { - notificationMessage = 'The ' + this.skill.title + ' failed to ' + + notificationMessage = 'The ' + this.skill.displayName + ' failed to ' + 'uninstall from one or more of your devices. Uninstall ' + 'will be retried until successful'; this.showInstallStatusNotification(notificationMessage); From 8aee0e47b147b82c454e2266ca714311368f0302 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 12:51:44 -0500 Subject: [PATCH 152/163] url fix --- projects/globalnav/src/lib/globalnav.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/globalnav/src/lib/globalnav.component.ts b/projects/globalnav/src/lib/globalnav.component.ts index f294997..cd21893 100644 --- a/projects/globalnav/src/lib/globalnav.component.ts +++ b/projects/globalnav/src/lib/globalnav.component.ts @@ -55,7 +55,7 @@ export class GlobalnavComponent implements OnInit { {text: 'Contact Us', url: this.mycroftUrls.wordPress + '/contact'}, {text: 'Media Kit', url: this.mycroftUrls.wordPress + '/media'}, {text: 'Privacy Policy', url: this.mycroftUrls.wordPress + '/embed-privacy-policy'}, - {text: 'Terms of Use', url: this.mycroftUrls.account + '/embed-terms-of-use'} + {text: 'Terms of Use', url: this.mycroftUrls.wordPress + '/embed-terms-of-use'} ]; } From 7166f06c171d5678b8b846f3e6ee59100cf304e1 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 13:41:11 -0500 Subject: [PATCH 153/163] more suitable text for the payment dialog --- .../profile/components/views/payment/payment.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/modules/profile/components/views/payment/payment.component.html b/projects/account/src/app/modules/profile/components/views/payment/payment.component.html index 313b94a..bcd02e8 100644 --- a/projects/account/src/app/modules/profile/components/views/payment/payment.component.html +++ b/projects/account/src/app/modules/profile/components/views/payment/payment.component.html @@ -1,7 +1,7 @@ Thank you for supporting Mycroft! - This is a blurb saying how much we appreciate your support! + Your membership directly helps to improve Mycroft technology and user experience.

Please enter your payment information below

From 6d6408b6b6fbd213e38347f0477913680e1215e4 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 14:06:59 -0500 Subject: [PATCH 154/163] changed navigation to open any page not included in selene in a new tab. --- .../src/lib/footer/footer.component.html | 4 +-- .../globalnav/src/lib/globalnav.component.ts | 34 +++++++++---------- .../globalnav/src/lib/globalnav.service.ts | 1 + .../src/lib/nav-item/nav-item.component.html | 2 +- .../src/lib/nav-item/nav-item.component.ts | 1 + .../primary-nav-item.component.ts | 2 +- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/projects/globalnav/src/lib/footer/footer.component.html b/projects/globalnav/src/lib/footer/footer.component.html index 3deacc3..0be5264 100644 --- a/projects/globalnav/src/lib/footer/footer.component.html +++ b/projects/globalnav/src/lib/footer/footer.component.html @@ -1,14 +1,14 @@
- +
diff --git a/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.scss b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.scss index 2b4b6c8..cce5be8 100644 --- a/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.scss +++ b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.scss @@ -11,7 +11,11 @@ mat-form-field { min-width: 270px; } -button { +#cancel-button { + margin-top: 8px; +} + +#submit-button { @include action-button-primary; margin-top: 8px; } diff --git a/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.ts b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.ts index 51c9e7a..773f881 100644 --- a/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.ts +++ b/projects/sso/src/app/login/internal-login/password-reset/password-reset.component.ts @@ -17,7 +17,7 @@ export class PasswordResetComponent implements OnInit { ngOnInit() { } - onSubmit() { + onCancelClick() { this.dialogRef.close(); } From e647cb8cdf90f4ec1640ec337e3f768544fb5cb4 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 17:03:18 -0500 Subject: [PATCH 156/163] disable the github button and change sso to use the shared button --- .../src/lib/github-button/github-button.component.html | 2 +- .../app/login/federated-login/federated-login.component.html | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/projects/shared/src/lib/github-button/github-button.component.html b/projects/shared/src/lib/github-button/github-button.component.html index 38ac1a2..de49bba 100644 --- a/projects/shared/src/lib/github-button/github-button.component.html +++ b/projects/shared/src/lib/github-button/github-button.component.html @@ -1,4 +1,4 @@ - diff --git a/projects/sso/src/app/login/federated-login/federated-login.component.html b/projects/sso/src/app/login/federated-login/federated-login.component.html index 3564835..e56dd8a 100644 --- a/projects/sso/src/app/login/federated-login/federated-login.component.html +++ b/projects/sso/src/app/login/federated-login/federated-login.component.html @@ -1,8 +1,5 @@
- +
From 5ef212b11c61620e9779015aca6c03f274ad5247 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 19:55:56 -0500 Subject: [PATCH 157/163] make the github button more presentable when disabled --- .../shared/src/lib/github-button/github-button.component.html | 2 +- .../shared/src/lib/github-button/github-button.component.scss | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/shared/src/lib/github-button/github-button.component.html b/projects/shared/src/lib/github-button/github-button.component.html index de49bba..3afc012 100644 --- a/projects/shared/src/lib/github-button/github-button.component.html +++ b/projects/shared/src/lib/github-button/github-button.component.html @@ -1,4 +1,4 @@ diff --git a/projects/shared/src/lib/github-button/github-button.component.scss b/projects/shared/src/lib/github-button/github-button.component.scss index 7817899..7d13ea4 100644 --- a/projects/shared/src/lib/github-button/github-button.component.scss +++ b/projects/shared/src/lib/github-button/github-button.component.scss @@ -8,6 +8,9 @@ button { text-align: left; width: 280px; + &:disabled { + background-color: #c0c5cb; + } fa-icon { margin-right: 16px; font-size: 24px; From 41d0ee70cc8bb90fee5569498d33b85b56e1662a Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 19:58:24 -0500 Subject: [PATCH 158/163] hide the wake word and text to speech taggers until then can be implemented in angular --- projects/globalnav/src/lib/globalnav.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/globalnav/src/lib/globalnav.component.ts b/projects/globalnav/src/lib/globalnav.component.ts index 26b4454..de0613a 100644 --- a/projects/globalnav/src/lib/globalnav.component.ts +++ b/projects/globalnav/src/lib/globalnav.component.ts @@ -94,8 +94,9 @@ export class GlobalnavComponent implements OnInit { children: [ {text: 'Source Code', url: 'https://github.com/MycroftAI', target: '_blank'}, {text: 'Translate', url: this.mycroftUrls.translate, target: '_blank'}, - {text: 'Wake Word', url: this.mycroftUrls.account + '/#/precise', target: '_blank'}, - {text: 'Speech to Text', url: this.mycroftUrls.account + '/#/deepspeech', target: '_blank'}, + // TODO: uncomment these lines of code when the tools are converted to angular + // {text: 'Wake Word', url: this.mycroftUrls.account + '/#/precise', target: '_blank'}, + // {text: 'Speech to Text', url: this.mycroftUrls.account + '/#/deepspeech', target: '_blank'}, {text: 'Text to Speech', url: this.mycroftUrls.mimic, target: '_blank'} ], icon: faLightbulb, From 9b761aa6eace0d3e5c628836640a6be6e473d037 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 22:48:08 -0500 Subject: [PATCH 159/163] increase logo size --- projects/globalnav/src/lib/globalnav.component.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/globalnav/src/lib/globalnav.component.scss b/projects/globalnav/src/lib/globalnav.component.scss index 3409e13..c62ace7 100644 --- a/projects/globalnav/src/lib/globalnav.component.scss +++ b/projects/globalnav/src/lib/globalnav.component.scss @@ -16,8 +16,8 @@ mat-toolbar { // libraries do not support static assets yet. .mycroft-logo { background: url("toolbar-logo.svg") no-repeat; - height: 25px; - width: 125px; + height: 40px; + width: 180px; } } From 50706d2855020fbb616888f1cc05acdc9a8d8370 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 22:48:22 -0500 Subject: [PATCH 160/163] fix typo --- projects/account/src/environments/environment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/environments/environment.ts b/projects/account/src/environments/environment.ts index 14c40c2..8fd0fc5 100644 --- a/projects/account/src/environments/environment.ts +++ b/projects/account/src/environments/environment.ts @@ -9,7 +9,7 @@ export const environment = { chat: 'https://chat.mycroft.ai', forum: 'https://community.mycroft.ai', marketplace: 'http://localhost:4202', - mimic: 'http://mimic.mycroft,ai', + mimic: 'http://mimic.mycroft.ai', singleSignOn: 'https://sso.mycroft.test', translate: 'https://translate-test.mycroft.ai', wordPress: 'https://test.mycroft.ai' From f00e8f9ac842a410de13b7fc99559ec15c04b033 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 22:50:37 -0500 Subject: [PATCH 161/163] replaced iframe pointing to wordpress to native angular for a better user experience --- .../dashboard/dashboard.component.html | 79 ++++++++++++++++--- .../dashboard/dashboard.component.scss | 43 ++++++++++ .../modules/dashboard/dashboard.component.ts | 11 ++- .../app/modules/dashboard/dashboard.module.ts | 10 ++- 4 files changed, 129 insertions(+), 14 deletions(-) diff --git a/projects/account/src/app/modules/dashboard/dashboard.component.html b/projects/account/src/app/modules/dashboard/dashboard.component.html index 9c9da91..9eb6c30 100644 --- a/projects/account/src/app/modules/dashboard/dashboard.component.html +++ b/projects/account/src/app/modules/dashboard/dashboard.component.html @@ -1,12 +1,67 @@ - - +
+ + + + + Mycroft likes you + +

+ Your support makes a big difference. Thanks to you and other Mycroft supporters, + we can continue building upon the Mycroft experience. It is also motivating + knowing there is a community of people who believe in the same things we do. +

+

+ We keep brainstorming and working on benefits to offer you as a supporter. + For now, you can change your Mycroft’s voice to a higher quality one. +

+
+ +
CHECK OUT PREMIUM VOICES + + + + + + + + Become a Member + +

+ For less than one cup of coffee a month, you can help support our server costs, + hosting, and ongoing development. All of which all improve Mycroft's performance + and user experience. +

+

+ Your membership also gets you exclusive access to premium voices, + along with new features that are being prepared for the second half of 2019. +

+
+ + MONTHLY MEMBERSHIP $1.99 + YEARLY MEMBERSHIP $19.99 + +
+ + + + + + Install New Skills + +

+ Your device comes with a set of pre-installed skills like Timers and Wikipedia. + To change the settings of your skills, for instance the sound of your alarm, + go to Skill Settings. +

+

+ Our open source community extends the functionality of Mycroft. Their efforts have + produced skills like Fairytalez or ISS Tracker. To install new skills, + visit the Marketplace. +

+
+ + SKILL MARKETPLACE + SKILL SETTINGS + +
+
diff --git a/projects/account/src/app/modules/dashboard/dashboard.component.scss b/projects/account/src/app/modules/dashboard/dashboard.component.scss index 0f48fb3..9f3db3b 100644 --- a/projects/account/src/app/modules/dashboard/dashboard.component.scss +++ b/projects/account/src/app/modules/dashboard/dashboard.component.scss @@ -1,5 +1,48 @@ +@import "~@angular/material/theming"; +@import "mycroft-colors"; +@import "components/buttons"; iframe { min-width: 350px; width: 100%; height: 100vh; } + +#dashboard { + max-width: 1200px; + margin-left: auto; + margin-right: auto; +} +mat-card { + min-height: 540px; + margin: 16px; + max-width: 540px; + min-width: 300px; + + fa-icon { + font-size: 60px; + color: mat-color($mycroft-primary) + } + + mat-card-title { + font-size: 40px; + font-weight: bolder; + padding: 16px; + } + + mat-card-content { + padding: 16px; + + .mat-body { + font-size: 16px; + } + } + + mat-card-actions { + padding: 16px; + + a { + @include action-button-primary; + margin: 8px; + } + } +} diff --git a/projects/account/src/app/modules/dashboard/dashboard.component.ts b/projects/account/src/app/modules/dashboard/dashboard.component.ts index 5268166..74b8fc4 100644 --- a/projects/account/src/app/modules/dashboard/dashboard.component.ts +++ b/projects/account/src/app/modules/dashboard/dashboard.component.ts @@ -1,7 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { Account } from '../../shared/models/account.model'; +import { faAward, faDownload } from '@fortawesome/free-solid-svg-icons'; + +import { Account } from '@account/models/account.model'; +import { environment } from '@account/environments/environment'; @Component({ selector: 'account-dashboard', @@ -10,6 +13,12 @@ import { Account } from '../../shared/models/account.model'; }) export class DashboardComponent implements OnInit { public account: Account; + public awardIcon = faAward; + public downloadIcon = faDownload; + public marketplaceUrl = environment.mycroftUrls.marketplace; + public settingsUrl = environment.mycroftUrls.account + '/skills'; + public voicesUrl = environment.mycroftUrls.mimic; + public accountUrl = environment.mycroftUrls.account + '/profile'; constructor(private route: ActivatedRoute) { } diff --git a/projects/account/src/app/modules/dashboard/dashboard.module.ts b/projects/account/src/app/modules/dashboard/dashboard.module.ts index 0d940b3..fdea932 100644 --- a/projects/account/src/app/modules/dashboard/dashboard.module.ts +++ b/projects/account/src/app/modules/dashboard/dashboard.module.ts @@ -1,5 +1,9 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { FlexLayoutModule } from '@angular/flex-layout'; +import { MatButtonModule, MatCardModule } from '@angular/material'; + +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { DashboardComponent } from './dashboard.component'; @@ -11,7 +15,11 @@ import { DashboardComponent } from './dashboard.component'; DashboardComponent, ], imports: [ - CommonModule + CommonModule, + FlexLayoutModule, + FontAwesomeModule, + MatButtonModule, + MatCardModule ] }) export class DashboardModule { } From 3e6b1f0e27d8733befa804c53aec24d0bcaee645 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 22:52:12 -0500 Subject: [PATCH 162/163] fixed verbiage --- .../account/src/app/modules/dashboard/dashboard.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/modules/dashboard/dashboard.component.html b/projects/account/src/app/modules/dashboard/dashboard.component.html index 9eb6c30..76861a9 100644 --- a/projects/account/src/app/modules/dashboard/dashboard.component.html +++ b/projects/account/src/app/modules/dashboard/dashboard.component.html @@ -55,7 +55,7 @@

Our open source community extends the functionality of Mycroft. Their efforts have - produced skills like Fairytalez or ISS Tracker. To install new skills, + produced skills like Fairytalez and ISS Tracker. To install new skills, visit the Marketplace.

From b8ee3b1c1c2be7913717c0015843712b6380aef1 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Tue, 2 Apr 2019 22:53:14 -0500 Subject: [PATCH 163/163] fixed wrong icon --- .../account/src/app/modules/dashboard/dashboard.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/account/src/app/modules/dashboard/dashboard.component.html b/projects/account/src/app/modules/dashboard/dashboard.component.html index 76861a9..c9a9a1c 100644 --- a/projects/account/src/app/modules/dashboard/dashboard.component.html +++ b/projects/account/src/app/modules/dashboard/dashboard.component.html @@ -22,7 +22,7 @@ - + Become a Member