dotCMS / core

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

Refactor message key system #18533

Closed fmontes closed 4 years ago

fmontes commented 4 years ago

The current approach is giving too much problem:

  1. Pull the message on components level is slow and too much work
  2. The current approach leave us with some messages not loading on time
  3. The app feels slow because the component loads and after the message keys loads (also page reflow)
  4. Hard to implement (load each message key on ngOnInit) and unit testing same

Describe the solution you'd like

Load all the messages on app load and use them everywhere without having to fetch them each time.

Technical Approach

  1. Create an endpoint to load all the messages keys
  2. Load all of the message keys on app loads
  3. Use a directive to use the message keys in the components

Additional context

Add any other context or screenshots about the feature request here.

Acceptance Criteria

  1. No empty message keys
  2. Work in all the supported browsers (don't forget IE11 and iPad)
  3. Multilanguage
  4. Unit test
fmontes commented 4 years ago

Localstorage or IndexedDB?

https://www.npmjs.com/package/ngx-indexed-db

bryanboza commented 4 years ago

We need to create the postman test for this endpoint.

erickgonzalez commented 4 years ago

@bryanboza https://github.com/dotCMS/core/pull/18548/files#diff-d5790ed39b300539e2ca28c68f4ed541R1159-R1355 I created postman for the endpoint

bryanboza commented 4 years ago

If you change the language of the system to anyone different to the default, and then try to use the login as feature, we are changing automatically the language to the default one instead allow continue navigating with the selected

To recreate

bryanboza commented 4 years ago

Fixed, the problem reported in the last comment was moved to a new card #18794