Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #25926 Reimplement the autocomplete component #25935

Merged
merged 9 commits into from
Aug 30, 2023

Conversation

fmontes
Copy link
Member

@fmontes fmontes commented Aug 29, 2023

Proposed Changes

🤖 Generated by Copilot at f57b4d1

Summary

♻️✨🧪

Refactored the add-style-classes-dialog component to use a JSON file and a p-autoComplete element to display and select the style classes. Removed the store logic and some redundant styles and attributes from the component. Added a new service and a spec file for fetching the style classes from the JSON file.

We're breaking free from the store of doom
We're fetching data from the JSON tomb
We're simplifying the p-autoComplete
We're adding style to the template elite

Walkthrough

  • Simplified the HTML template of the add-style-classes-dialog component to make it more user-friendly and consistent with the design mockups (link)
  • Removed the store logic and the unnecessary lifecycle hooks from the TS file of the add-style-classes-dialog component and used the JsonClassesService instead to fetch the style classes from a JSON file (link, link, link)
  • Added the JsonClassesService and its spec files to implement the service logic and the unit testing for the component (link, link)
  • Cleaned up the SCSS file of the add-style-classes-dialog component by removing the unused styles (link)
  • Removed the DotAddStyleClassesDialogStore import and provider from the template-builder module (link, link)
  • Deleted the DotAddStyleClassesDialogStore and its spec files as they are no longer needed (link, link)

Checklist

  • Tests
  • Translations
  • Security Implications Contemplated (add notes if applicable)

Additional Info

** any additional useful context or info **

Screenshots

dotCMS._.class.selector.in.template.mp4

@fmontes fmontes linked an issue Aug 29, 2023 that may be closed by this pull request
Comment on lines 292 to 293
'dot.template.builder.autocomplete.has.suggestions': 'Add the message for suggestions case',
'dot.template.builder.autocomplete.no.suggestions': 'Add the message for no suggestions case'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this messages for the story and also add the missing ones

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use this object in the test for the messages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed for tests... overkill

@dotcms-sonarqube
Copy link

dotcms-sonarqube bot commented Aug 30, 2023

SonarQube Quality Gate

Quality Gate failed

Failed condition 0.0% 0.0% Coverage on New Code (is less than 80%)

See analysis details on SonarQube

@dotcms-sonarqube
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@fmontes fmontes merged commit 86dd5d1 into master Aug 30, 2023
28 of 33 checks passed
@fmontes fmontes deleted the issue-25926-fix-class-selector branch August 30, 2023 22:48
fmontes added a commit that referenced this pull request Aug 31, 2023
* Reimplement the autocomplete component

* dev (add styles autocomplete): enhance functionality

* Fix filtering and styling.

* Fix the filtering and language messages

* Add tests for JsonClassesService

* Test are not running

* fix (add styles dialog): now tests are running

* Fix tests

* Update mocks

---------

Co-authored-by: Jalinson Diaz <zjaaaldev@gmail.com>
fmontes added a commit that referenced this pull request Aug 31, 2023
* Fix #25917: Template Builder file containers were saving with Identifier instead of Path (#25920)

* dev (gridstack utils): add getContainerReference

* dev (template builder store): implement getContainerReference

* fix (palette content type module): add DotMessagePipe import

* feedback (template builder): moved getContainerReference from utils to box component

* feedback (template builder box test): enhance testing

* fix (containers mock): fix merge errors

* Fix #25937: Template Builder Enhancing error and request handling (#25942)

* fix (template save and publish): enhancing error and request handling

* feedback (dot templates service): delete old save and publish

* fix (gridstack utils): EMPTY_ROWS_VALUE was being modified by reference

* Fix #25926: Template Builder fixing wrong classes deletion (#25928)

* dev (add style classes module): refactor to support remove any class

* fix (template builder story): console error due to missing import

* Fix #25926 Reimplement the autocomplete component (#25935)

* Reimplement the autocomplete component

* dev (add styles autocomplete): enhance functionality

* Fix filtering and styling.

* Fix the filtering and language messages

* Add tests for JsonClassesService

* Test are not running

* fix (add styles dialog): now tests are running

* Fix tests

* Update mocks

---------

Co-authored-by: Jalinson Diaz <zjaaaldev@gmail.com>

* Fix #25926 Templater Builder: Fixing link target

* Fixing test (#25911)

---------

Co-authored-by: Jalinson Diaz <zjaaaldev@gmail.com>
Co-authored-by: Rafael Velazco <rjvelazco21@gmail.com>
Co-authored-by: Manuel Rojas <manuel.rojas.21@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Templater Builder: Fixing Wrong Classes Deletion
3 participants