From 8311dcc33fde2871598810fdf3316756047ef1ff Mon Sep 17 00:00:00 2001 From: Freddy Montes Date: Mon, 7 Oct 2019 09:48:30 -0600 Subject: [PATCH] Unpersonalize as limited user (#1214) We are allowing a limited user to unpersonalize a page (even when is locked by admin user) for now. --- .../dot-edit-page-view-as-controller.component.ts | 10 +--------- .../services/dot-page-state/dot-page-state.service.ts | 5 ++++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/app/portlets/dot-edit-page/content/components/dot-edit-page-view-as-controller/dot-edit-page-view-as-controller.component.ts b/src/app/portlets/dot-edit-page/content/components/dot-edit-page-view-as-controller/dot-edit-page-view-as-controller.component.ts index 8901082be1..c37a92c217 100644 --- a/src/app/portlets/dot-edit-page/content/components/dot-edit-page-view-as-controller/dot-edit-page-view-as-controller.component.ts +++ b/src/app/portlets/dot-edit-page/content/components/dot-edit-page-view-as-controller/dot-edit-page-view-as-controller.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { DotPersona } from '@models/dot-persona/dot-persona.model'; import { DotLanguage } from '@models/dot-language/dot-language.model'; import { DotDevice } from '@models/dot-device/dot-device.model'; @@ -10,7 +10,6 @@ import { DotPersonalizeService } from '@services/dot-personalize/dot-personalize import { take } from 'rxjs/operators'; import { DotAlertConfirmService } from '@services/dot-alert-confirm'; import { DotPageRenderState, DotPageMode } from '@portlets/dot-edit-page/shared/models'; -import { DotPersonaSelectorComponent } from '@components/dot-persona-selector/dot-persona-selector.component'; @Component({ selector: 'dot-edit-page-view-as-controller', @@ -18,8 +17,6 @@ import { DotPersonaSelectorComponent } from '@components/dot-persona-selector/do styleUrls: ['./dot-edit-page-view-as-controller.component.scss'] }) export class DotEditPageViewAsControllerComponent implements OnInit { - @ViewChild('personaSelector') personaSelector: DotPersonaSelectorComponent; - isEnterpriseLicense$: Observable; messages: { [key: string]: string } = {}; @@ -102,11 +99,6 @@ export class DotEditPageViewAsControllerComponent implements OnInit { }, false ); - - this.personaSelector.updatePersonaInCurrentList({ - ...persona, - personalized: false - }); }); } }); diff --git a/src/app/portlets/dot-edit-page/content/services/dot-page-state/dot-page-state.service.ts b/src/app/portlets/dot-edit-page/content/services/dot-page-state/dot-page-state.service.ts index a753188d24..1de35564e8 100644 --- a/src/app/portlets/dot-edit-page/content/services/dot-page-state/dot-page-state.service.ts +++ b/src/app/portlets/dot-edit-page/content/services/dot-page-state/dot-page-state.service.ts @@ -111,7 +111,10 @@ export class DotPageStateService { */ setLock(options: DotPageRenderOptions, lock: boolean = null): void { this.getLockMode(this.currentState.page.inode, lock) - .pipe(take(1)) + .pipe( + take(1), + catchError(() => of(null)) + ) .subscribe(() => { this.get(options); });