Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-24851

Update the Editing UI based on the server side validation

    Details

    • Epic Name:
      UI Server Validation

      Description

      Some validation can not be fully made in the browser. In this case, the UI displayed to the editor should be updated based on the validation result provided by the server side API when the creation/saving of a draft fails.

      Now that EZP-24853 is solved we can improve UI to take data added to REST response this into account and update editing form to inline show which fields does not validate.

        Issue Links

          Issues in Epic

            Activity

            Hide
            Sweta Pandey added a comment -

            Issues with error message:
            1.No proper error message is displayed when user tries to upload hero image less than 620px.It shows error message as "Error occurred while publishing an article".

            2. When a user is logged in as Journalist and try to access user roles
            The error message displayed is " Failed to load the location /api/ezp/v2/content/locations/1/5 "

            3. When journalist/ editor try to delete an author, the error message displayed is :
            User does not have access to 'read' 'content' with: contentId '303'

            4.When journalist try to create/edit an author, the error message displayed is :
            An error occurred while publishing the draft.

            Expected result:
            1.When journalist try to upload hero image less than 620px, proper message that 'Upload hero image with width more than or equal to 620 px " should be displayed.
            2. When journalist try to access user role, proper error message that he is not allowed to access user role should be displayed
            3. When journalist/ editor try to delete an author, proper error message that he is not allowed to delete should be displayed.
            4. When journalist try to create author ,proper error message that he is not allowed to create/edit author should be displayed.

            User with access to admin should see proper error message.

            Show
            Sweta Pandey added a comment - Issues with error message: 1.No proper error message is displayed when user tries to upload hero image less than 620px.It shows error message as "Error occurred while publishing an article". 2. When a user is logged in as Journalist and try to access user roles The error message displayed is " Failed to load the location /api/ezp/v2/content/locations/1/5 " 3. When journalist/ editor try to delete an author, the error message displayed is : User does not have access to 'read' 'content' with: contentId '303' 4.When journalist try to create/edit an author, the error message displayed is : An error occurred while publishing the draft. Expected result: 1.When journalist try to upload hero image less than 620px, proper message that 'Upload hero image with width more than or equal to 620 px " should be displayed. 2. When journalist try to access user role, proper error message that he is not allowed to access user role should be displayed 3. When journalist/ editor try to delete an author, proper error message that he is not allowed to delete should be displayed. 4. When journalist try to create author ,proper error message that he is not allowed to create/edit author should be displayed. User with access to admin should see proper error message.
            Hide
            Damien Pobel added a comment -

            Sweta Pandey your comment is partly related to this issue.

            For the 1, even if it's a business rule specific to your project that's indeed the same issue (that said, at the moment, there should be a JavaScript counter part to this server side validation).

            2 is completely unrelated to this, can you open a improvement for that.

            3 is also completely unrelated to this story but I wonder how an editor that can not see a User, can then try to remove it ?

            4 same as 2, that's unrelated to this, but we can maybe improve the message, can you open the corresponding improvement request ?

            Show
            Damien Pobel added a comment - Sweta Pandey your comment is partly related to this issue. For the 1, even if it's a business rule specific to your project that's indeed the same issue (that said, at the moment, there should be a JavaScript counter part to this server side validation). 2 is completely unrelated to this, can you open a improvement for that. 3 is also completely unrelated to this story but I wonder how an editor that can not see a User, can then try to remove it ? 4 same as 2, that's unrelated to this, but we can maybe improve the message, can you open the corresponding improvement request ?
            Hide
            Damien Pobel added a comment -

            Rough plan:

            • analyze what was done in EZP-24845 and add spec to use that in PlatformUI
            • take FieldType per FieldType
            Show
            Damien Pobel added a comment - Rough plan: analyze what was done in EZP-24845 and add spec to use that in PlatformUI take FieldType per FieldType
            Hide
            Damien Pobel added a comment -

            Alright, it seems like it's not too complicated if we except that the REST spec was not updated with this change. I created and added EZP-26239 to this EPIC for that. I also created EZP-26240 for the main implementation. But I'm pretty sure we'll have some special cases, we'll see after EZP-26240.

            Besides this, there's one question, according to the PR of EZP-24853, several errors can be reported by the API but the current validation system for each field edit view is able to only report one message (and UI wise it's hard to report more than that, the place is very limited for error reporting). So in case of multiple errors, is it ok to just concatenate error messages as if there was only one error ? (ping Roland Benedetti)

            Show
            Damien Pobel added a comment - Alright, it seems like it's not too complicated if we except that the REST spec was not updated with this change. I created and added EZP-26239 to this EPIC for that. I also created EZP-26240 for the main implementation. But I'm pretty sure we'll have some special cases, we'll see after EZP-26240 . Besides this, there's one question, according to the PR of EZP-24853 , several errors can be reported by the API but the current validation system for each field edit view is able to only report one message (and UI wise it's hard to report more than that, the place is very limited for error reporting). So in case of multiple errors, is it ok to just concatenate error messages as if there was only one error ? (ping Roland Benedetti )
            Hide
            St├ęphane Diot added a comment -

            @docTeam : added a comment in EZP-26240: Update the editing UI with server side validation that should help you for the user guide.

            Show
            St├ęphane Diot added a comment - @docTeam : added a comment in EZP-26240 : Update the editing UI with server side validation that should help you for the user guide.

              People

              • Assignee:
                Unassigned
                Reporter:
                Damien Pobel
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: