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 #25917: Template Builder file containers were saving with Identifier instead of Path #25920

Conversation

zJaaal
Copy link
Contributor

@zJaaal zJaaal commented Aug 28, 2023

🤖 Generated by Copilot at 0ffbb8f

Summary

📁🛠️🧪

The pull request adds support for file containers in the template builder. File containers are containers defined by a file path instead of an identifier. The pull request modifies several files to handle file containers consistently and adds tests and mock data for the new functionality.

To build templates with file containers
We need some new code maintainers
They added DotContainer
And getContainerReference
And mocked some data for the trainers

Walkthrough

  • Updated the import path for DotPipesModule to use the correct alias (link)
  • Added the DotMessagePipe as a provider for the DotPaletteContentTypeModule to translate content type labels (link)
  • Imported the getContainerReference function from gridstack-utils.ts to the template builder store (link)
  • Used the getContainerReference function to handle file containers in the store state (link, link, link, link, link)
  • Added the getContainerReference function to the gridstack-utils.ts file to return the identifier or path of a container based on its source (link, link)
  • Added the source and path properties to the container mocks in the dot-containers.mock.ts file (link)
  • Modified the addContainer function in the template-builder.store.spec.ts file to accept a container parameter (link)
  • Added the mockFileContainer variable to the template-builder.store.spec.ts file to test file containers (link)
  • Added test cases for adding file containers to the sidebar and to specific boxes in the template-builder.store.spec.ts file (link, link)
  • Added a test suite for the getContainerReference function in the gridstack-utils.spec.ts file (link, link)

Screenshots

Original

Screen.Recording.2023-08-28.at.4.17.11.PM.mov

Updated

Screen.Recording.2023-08-28.at.4.19.50.PM.mov

@zJaaal zJaaal linked an issue Aug 28, 2023 that may be closed by this pull request
@zJaaal zJaaal requested review from fmontes, rjvelazco, manuelrojas and hmoreras and removed request for fmontes August 28, 2023 19:29
@zJaaal zJaaal requested a review from fmontes August 28, 2023 20:40
@dotcms-sonarqube
Copy link

@fmontes fmontes merged commit 0975c71 into master Aug 29, 2023
18 of 19 checks passed
@fmontes fmontes deleted the issue-25917-template-builder-file-containers-are-not-getting-saved-correctly branch August 29, 2023 14:24
fmontes pushed a commit that referenced this pull request Aug 31, 2023
…ier 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
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.

Template Builder: File containers are not getting saved correctly
4 participants