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: Template Builder fixing wrong classes deletion #25928

Merged

Conversation

zJaaal
Copy link
Contributor

@zJaaal zJaaal commented Aug 29, 2023

🤖 Generated by Copilot at ae71fb8

Summary

🐛🧪♻️

This pull request improves the functionality and testing of the AddStyleClassesDialog component, which allows users to add style classes to a template. It fixes bugs in the component template and the storybook component, refactors the store class to use a common method for creating style class objects, and adds the id property to the StyleClassModel interface and the related unit tests.

We are the masters of the template
We create and destroy with style
We fix the bugs that haunt the code
We pass the class with the event

Walkthrough

  • Fix bug where deleted class object was not passed to store onUnselect event handler (link, link, link, link)
  • Add id property to StyleClassModel interface and use uuid module to generate unique ids for style classes (link, link, link, link)
  • Use buildStyleClass method to create StyleClassModel objects in store methods (link, link, link, link)
  • Replace removeLastClass method with removeClass method in store and update unit tests accordingly (link, link)
  • Include id property in expected arrays in store unit tests (link, link, link, link, link, link)
  • Import FormsModule module in template-builder.component.stories.ts for autocomplete component (link, link)

Screenshots

Screen.Recording.2023-08-29.at.11.16.43.AM.mov

@zJaaal zJaaal linked an issue Aug 29, 2023 that may be closed by this pull request
@dotcms-sonarqube
Copy link

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

@fmontes fmontes merged commit e894bb1 into master Aug 29, 2023
9 of 12 checks passed
@fmontes fmontes deleted the issue-25926-templater-builder-fixing-wrong-classes-deletion branch August 29, 2023 17:19
fmontes pushed a commit that referenced this pull request Aug 31, 2023
* dev (add style classes module): refactor to support remove any class

* fix (template builder story): console error due to missing import
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
4 participants