[ANALYTICS-116] Show analytics in an IUX slot Created: 15/Jan/20 Updated: 21/Jan/21 Resolved: 19/Feb/20 |
|
| Status: | Closed |
| Project: | Analytics |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.1 |
| Type: | Story | Priority: | Major |
| Reporter: | Antti Hietala | Assignee: | Oanh Thai Hoang |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 3d 7h | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| 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)
|
||||
| Documentation update required: |
Yes
|
||||
| Date of First Response: | |||||
| Epic Link: | Analytics IUX slot | ||||
| Sprint: | Add-Ons 31 | ||||
| Story Points: | 5 | ||||
| Description |
|
Show page performance metrics from Google Analytics in the horizontal IUX slot above the workbench in the Pages app.
Acceptance criteria
Fallbacks
Data
|
| Comments |
| Comment by Antti Hietala [ 21/Jan/20 ] |
|
Tips from mdivilek: Any view implementing UiFrameworkView could be inserted into the slot. Implement a new view for displaying the data, which would benefit from value context and can switch displayed data whenever selected item changes. Example for displaying page node name: package info.magnolia.ui.framework.app.extension; import info.magnolia.ui.contentapp.browser.context.ValueContext; import info.magnolia.ui.framework.ConfiguredViewDefinition; import info.magnolia.ui.framework.UiFrameworkView; import javax.inject.Inject; import javax.jcr.Node; import com.machinezoo.noexception.Exceptions; import com.vaadin.ui.Composite; import com.vaadin.ui.Label; /** * Complex data view :). */ public class DataView extends Composite implements UiFrameworkView { @Inject public DataView(ValueContext<Node> valueContext) { Label pageTitle = new Label(); valueContext.observe(() -> { Node node = valueContext.getSingleOrThrow(); pageTitle.setValue(Exceptions.wrap().get(node::getName)); }); setCompositionRoot(pageTitle); } private static class Definition extends ConfiguredViewDefinition<DataView> { public Definition() { setImplementationClass(DataView.class); } } } This is the part which triggers update when selection changes (valueContext.observe …)
valueContext.observe(() -> {
Node node = valueContext.getSingleOrThrow();
pageTitle.setValue(Exceptions.wrap().get(node::getName));
});
|
| Comment by Julie Legendre [ 25/Feb/20 ] |
|
Thank you Oanh, I've created |