Uploaded image for project: 'Magnolia Frontend Helpers'
  1. Magnolia Frontend Helpers
  2. MGNLFE-284

Angular sometimes does not show green bars

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.3.0
    • None
    • None
    • None

      With test data from MGNLFE-272, Angular code sometime does not show green bars with pages have areas only.

      On version 1.2.2 of angular editor: error messages in the browser console

      ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading '@path')
      TypeError: Cannot read properties of undefined (reading '@path')
          at magnolia-angular-editor.js:243:109
          at _ZoneDelegate.invoke (zone.js:409:30) 

      in editable-area.component.ts

      updateComment(content: object): void {
        this.editorContext.inEditorAsync().then((inEditor) => {
          if (inEditor) {
            if (this.editorContext.templateAnnotations && this.editorContext.templateAnnotations[content['@path']]) { 

      On the latest code of angular editor: nothing is shown https://git.magnolia-cms.com/projects/MODULES/repos/frontend-helpers/pull-requests/150/overview?commentId=99169

       

      The issue also happens with a new page from Angular: Standard page.

       

      The steps to reproduce:

      1. Create a new page from Angular: Standard page
      2. Edit the page few times (normally, second or third time) => no green bars 

       

      We also can replace by the code bellow to reproduce the issue always

      const contentObservable = this.http
                  .get(`${ENVIRONMENT.restUrlBase}${spaRootNodePath}${magnoliaContext.search}`).subscribe(content=>{
                      console.log('content');
                      console.log(content);
                    this.content = content;
                    const templateAnnotationObservable = this.http
                           .get(`${ENVIRONMENT.templateAnnotationsBase}${spaRootNodePath}`).subscribe(templateAnnotations=>{
                               console.log('templateAnnotation');
                               console.log(templateAnnotations);
                          this.editorContext.setTemplateAnnotations(templateAnnotations);
                        });
                  }); 

        Acceptance criteria

          1.
          Implement Sub-task Completed Phong Le Quoc
          2.
          Review Sub-task Closed Dai Ha
          3.
          PiQA Sub-task Closed Rishab Dhar
          4.
          QA Sub-task Completed Unassigned

              plequoc Phong Le Quoc
              plequoc Phong Le Quoc
              DeveloperX
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 2d 4.5h
                    2d 4.5h