From acdda231c40d29d1e09ae01a69e2e1ecd34055e4 Mon Sep 17 00:00:00 2001 From: pionnegru Date: Tue, 7 Jan 2020 20:28:35 +0200 Subject: [PATCH] user menu options components --- src/app/components/common/common.module.ts | 20 +++++++-- .../language-picker.component.ts | 39 ++++++++++++++++ .../common/logout/logout.component.ts | 44 +++++++++++++++++++ 3 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 src/app/components/common/language-picker/language-picker.component.ts create mode 100644 src/app/components/common/logout/logout.component.ts diff --git a/src/app/components/common/common.module.ts b/src/app/components/common/common.module.ts index 17ac4f12f..a1c972395 100644 --- a/src/app/components/common/common.module.ts +++ b/src/app/components/common/common.module.ts @@ -30,6 +30,8 @@ import { NgModule } from '@angular/core'; import { GenericErrorModule } from '@alfresco/aca-shared'; import { LocationLinkComponent } from './location-link/location-link.component'; import { ToggleSharedComponent } from './toggle-shared/toggle-shared.component'; +import { LanguagePickerComponent } from './language-picker/language-picker.component'; +import { LogoutComponent } from './logout/logout.component'; @NgModule({ imports: [ @@ -38,13 +40,25 @@ import { ToggleSharedComponent } from './toggle-shared/toggle-shared.component'; ExtensionsModule, GenericErrorModule ], - declarations: [LocationLinkComponent, ToggleSharedComponent], + declarations: [ + LocationLinkComponent, + ToggleSharedComponent, + LanguagePickerComponent, + LogoutComponent + ], exports: [ ExtensionsModule, LocationLinkComponent, GenericErrorModule, - ToggleSharedComponent + ToggleSharedComponent, + LanguagePickerComponent, + LogoutComponent ], - entryComponents: [LocationLinkComponent, ToggleSharedComponent] + entryComponents: [ + LocationLinkComponent, + ToggleSharedComponent, + LanguagePickerComponent, + LogoutComponent + ] }) export class AppCommonModule {} diff --git a/src/app/components/common/language-picker/language-picker.component.ts b/src/app/components/common/language-picker/language-picker.component.ts new file mode 100644 index 000000000..2cf2db380 --- /dev/null +++ b/src/app/components/common/language-picker/language-picker.component.ts @@ -0,0 +1,39 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { Component } from '@angular/core'; + +@Component({ + selector: 'aca-language-picker', + template: ` + + + + + ` +}) +export class LanguagePickerComponent {} diff --git a/src/app/components/common/logout/logout.component.ts b/src/app/components/common/logout/logout.component.ts new file mode 100644 index 000000000..619193a3b --- /dev/null +++ b/src/app/components/common/logout/logout.component.ts @@ -0,0 +1,44 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { Component } from '@angular/core'; +import { Store } from '@ngrx/store'; +import { AppStore, SetSelectedNodesAction } from '@alfresco/aca-shared/store'; + +@Component({ + selector: 'aca-logout', + template: ` + + ` +}) +export class LogoutComponent { + constructor(private store: Store) {} + + onLogoutEvent() { + this.store.dispatch(new SetSelectedNodesAction([])); + } +}