Merge pull request #84 from MycroftAI/feature/improve-menu

Add account menu to sidenav
feature/add-device-navigation^2
Chris Veilleux 2022-07-29 12:03:44 -05:00 committed by GitHub
commit 302e235326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 1 deletions

View File

@ -264,6 +264,9 @@
"configurations": {
"production": {
"browserTarget": "market:build:production"
},
"development": {
"browserTarget": "market:build:development"
}
}
},
@ -448,6 +451,9 @@
"configurations": {
"production": {
"browserTarget": "sso:build:production"
},
"development": {
"browserTarget": "sso:build:development"
}
}
},
@ -660,6 +666,9 @@
"configurations": {
"production": {
"browserTarget": "account:build:production"
},
"development": {
"browserTarget": "account:build:development"
}
}
},
@ -856,6 +865,9 @@
"configurations": {
"production": {
"browserTarget": "precise:build:production"
},
"development": {
"browserTarget": "precise:build:development"
}
}
},

View File

@ -19,7 +19,7 @@ and limitations under the License.
export const environment = {
production: false,
mycroftUrls: {
account: 'https://home-test.mycroft.ai',
account: 'https://account.mycroft.test',
chat: 'https://chat.mycroft.ai',
forum: 'https://community.mycroft.ai',
marketplace: 'https://market.mycroft.test',

View File

@ -26,6 +26,7 @@ import {
faRocket,
faRss,
faStore,
faUser,
faUsers
} from '@fortawesome/free-solid-svg-icons';
@ -61,6 +62,7 @@ export class GlobalnavComponent implements OnInit {
buildNavigationItems(): void {
this.navigationItems = [
this.defineAccountNav(),
this.defineAboutNav(),
this.defineGetStartedNav(),
this.defineBlogNav(),
@ -143,4 +145,25 @@ export class GlobalnavComponent implements OnInit {
text: 'Marketplace'
};
}
private defineAccountNav(): PrimaryNavItem {
const accountMenu = {
children: null,
icon: faUser,
text: 'My Mycroft',
url: null
};
if (this.isLoggedIn) {
accountMenu.children = [
{text: 'Dashboard', url: this.mycroftUrls.account + '/dashboard', target: '_self'},
{text: 'Devices', url: this.mycroftUrls.account + '/devices', target: '_self'},
{text: 'Skills', url: this.mycroftUrls.account + '/skills', target: '_self'},
{text: 'Personal Data', url: this.mycroftUrls.account + '/personal-data', target: '_self'},
{text: 'Profile', url: this.mycroftUrls.account + '/profile', target: '_self'}
];
} else {
accountMenu.url = this.mycroftUrls.account;
}
return accountMenu;
}
}