dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
852 stars 467 forks source link

[Templates] : The 'Template' dropdown in Page Properties is not displaying the expected Custom Template value #29034

Closed jcastro-dotcms closed 1 month ago

jcastro-dotcms commented 3 months ago

Parent Issue

No response

Problem Statement

The Template dropdown in the Page Properties modal is NOT displaying the correct value when a custom Template is generated. When you update the page's layout, it displays System Template (System Host) instead.

If you check the contentlet table in the database, in the contentlet_as_json column, the Template data points to a custom Template. This means there might be a problem at UI level. This will confuse users as they will think their HTML Page is using the System Template, which is not correct.

Steps to Reproduce

  1. Create a test HTML Page using the Default Template.
  2. Add a test Rich Text to the page.
  3. Click the LAYOUT button and add a new row above or below the existing one. Click the CONTENT button.
  4. Finally, click the PROPERTIES button, You'll see that the value of the Template dropdown is System Template (System Host)

Acceptance Criteria

The Template dropdown must indicate that the current Template is actually a Custom Template, just like it used to.

dotCMS Version

Latest master.

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

This issue might be related to:

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

jdotcms commented 3 months ago

I will take a look

nollymar commented 1 month ago

This issue is happening after the changes applied on this PR.

I could identified that the /api/v1/templates endpoint is called multiple times and the last call removes the Custom Page Layout from the dropdown list. After removing these lines , the issue gets fixed. However, when you select the File Template Advanced example, the dropdown breaks again.

Other findings:

I suggest to clean up the logic in the complete custom field to avoid unnecessary calls that might be affecting the field's behavior.

nollymar commented 1 month ago

Internal QA: Failed.

There is a small issue:

This issue happens in both, the new and old page editors. I have attached a video with the steps.

https://github.com/user-attachments/assets/930d66f8-8971-4341-ac63-74ce46d6e53c

rjvelazco commented 1 month ago

We are going to address this issue for the UVE here but for the old Edit Page is going to be in a separate ticket https://github.com/dotCMS/core/issues/29697, @nollymar

zJaaal commented 1 month ago

IQA Passed

Now the Template field is populating correctly

Docker Image: [dotcms/dotcms:trunk_36f72e4]

Screenshot

https://github.com/user-attachments/assets/62b932b8-dc34-49b4-a0d7-b6f0de29512e

bryanboza commented 1 month ago

We lost the notification when you apply some change here:

https://github.com/user-attachments/assets/0b4f52ce-9e8b-49ba-9979-1275583ac93a

rjvelazco commented 1 month ago

@bryanboza I updated the QA server with the latest trunk image dotcms/dotcms:trunk_2f3045b [dotcms/dotcms Tags] and I'm not able to reproduce the issue in any supported Browser. I used the System Template, Default Template, and a Custom Page Template to test the issue. Let me know the image, starter, and the template you used

I noticed you are testing in the old page editor in your local environment and in the UVE editor on the QA server.

If this is not happening in the QA: Server/UVE we should not add the Needs Work label

Videos

Default Template

https://github.com/user-attachments/assets/43843449-aa23-4c80-9a2c-bd4a6f0f5144

System Template

https://github.com/user-attachments/assets/ba71abe9-94c4-4f3c-ba98-b57bc12ad7a0

bryanboza commented 1 month ago

ok, this is something related to the new edit mode, tested in the last trunk with the new edit mode and this is working as expected.