Skip to content

Commit

Permalink
Unpersonalize as limited user (#1214)
Browse files Browse the repository at this point in the history
We are allowing a limited user to unpersonalize a page (even when is locked by admin user) for now.
  • Loading branch information
fmontes authored Oct 7, 2019
1 parent 10c2d8c commit 8311dcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -10,16 +10,13 @@ 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',
templateUrl: './dot-edit-page-view-as-controller.component.html',
styleUrls: ['./dot-edit-page-view-as-controller.component.scss']
})
export class DotEditPageViewAsControllerComponent implements OnInit {
@ViewChild('personaSelector') personaSelector: DotPersonaSelectorComponent;

isEnterpriseLicense$: Observable<boolean>;
messages: { [key: string]: string } = {};

Expand Down Expand Up @@ -102,11 +99,6 @@ export class DotEditPageViewAsControllerComponent implements OnInit {
},
false
);

this.personaSelector.updatePersonaInCurrentList({
...persona,
personalized: false
});
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 8311dcc

Please sign in to comment.