[MGNLPN-84] Persona switcher should include an Anonymous option Created: 28/Apr/14  Updated: 08/May/14  Resolved: 05/May/14

Status: Closed
Project: Magnolia Personalization
Component/s: Integration
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Neutral
Reporter: Roman Kovařík Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: quickwin
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLPN-99 In preview app: Persona switcher arro... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Personalisation
Sprint: 5.3 Sprint 6

 Description   

It must be possible to select no persona - in other words an "Anonymous" persona.
This Anonymous option should not be add-able or removable via configuration.



 Comments   
Comment by Roman Kovařík [ 05/May/14 ]

Commit:
https://git.magnolia-cms.com/gitweb/?p=enterprise/p13n.git;a=commitdiff;h=83f3e99430847800404adab81f10eeec2e792009

Comment by Christopher Zimmermann [ 07/May/14 ]

Small thing: in PersonaSwitcherField#getAnonymousPersona, I think its nicer to use a constant for "personas" workspace.

More important:
When you first open the Preview app with no personas - the switcher should have the Anonymous user displayed.

It looks like you attempted to do this in PersonaSwitcherFieldFactory#createFieldComponent with
switcher.setValue(anonymous) and personaSwitcher.setValue(anonymous), but this was not working for me. For some reason the ValueChangeLister in that method is called with a null value.

I experimented a little - one possible implementation could be in PagePreviewSubApp#start, after the check

previewLocation.hasAdditionalParameters()

To add something along the lines of this in order to add a default for the previewItem:

if (null == previewItem.getItemProperty("persona")){
            final Property<String> property = new DefaultProperty<String>(String.class, "/");
            previewItem.addItemProperty("persona",property);
        }

But I guess you would want to query the config for the proper property instead of hardcoding "persona".

Comment by Christopher Zimmermann [ 07/May/14 ]

Marking as reviewed after adding this followup ticket.

Comment by Philip Mundt [ 07/May/14 ]

Upon integration the issue with the default selection was solved by:

switcher.setNullSelectionAllowed(true);
switcher.setNullSelectionItemId(anonymous);

Also set visibility of anonymous to private.

Generated at Mon Feb 12 06:34:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.