[MGNLFE-45] Incorrect behaviour in inEditor() helper Created: 04/May/20 Updated: 19/May/20 Resolved: 19/May/20 |
|
| Status: | Closed |
| Project: | Magnolia Frontend Helpers |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.0.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Christopher Zimmermann | Assignee: | Canh Nguyen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 2d 7h | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| 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: | SPA Editor |
| Sprint: | HL & LD 2 |
| Story Points: | 3 |
| Description |
|
inEditor() should only return true when in the actual editing view. It is consistant cmsfn, it is more natural for developers to use in their apps, and it will fix the problem that the greenbars are rendered in the Page Editor Preview. Notes The helper functions exposed in react-editor and angular-editor, inEditor() and inEditorPreview() should peform the same function to our our freemarker templating functions cmsfn. But the behaviour is different. if (EditorContextHelper.inEditor && !EditorContextHelper.inEditorPreview(){ //call templateDefinitions }
Acceptance Criteria
Previous ticket description: Preview in Admincentral shows green bars in React in 1.0.1 With react-editor 1.0.1, the adminCentral Preview also renders 'green bars', but it should not. Note, this only happens if an Area is selected in the pageEditor, and then you switch to the Preview. Potential root causes: 1. EmbeddableArea now calls the refresh() command: I'm not sure why the area needs to call the refresh() command, I would think that it is up to the app itself to make these calls. 2. Currently any call to the mgnlRefresh() function must first check if the page is in Preview mode, because the inEditor() command returns true whether in preview mode or not. (see attached image)
|