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

Refactor FacilityConfig and Facility fetching out of core into the plugins that need it #12708

Closed
5 tasks
Tracked by #11722
rtibbles opened this issue Oct 8, 2024 · 0 comments · Fixed by #13014
Closed
5 tasks
Tracked by #11722
Assignees
Labels

Comments

@rtibbles
Copy link
Member

rtibbles commented Oct 8, 2024

The getFacilities and getFacilityConfig actions (defined here: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/assets/src/state/modules/core/actions.js#L212) are used in the coach, device, facility, and user_auth plugins.

The state is defined here: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/assets/src/state/modules/core/index.js#L16

The two mutations are defined here: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/assets/src/state/modules/core/mutations.js#L2

And two getters are defined here: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/assets/src/state/modules/core/getters.js#L4

  • Create a useFacilities composable in kolibri-common that has module level state, to allow for easy replacement of the current actions, state, and getters where they are used.
  • Replace all references to the actions, state, getters, and mutations, to use the composable instead.
  • Create a useFacilities composable mock for testing purposes.
  • Update all frontend tests should to use the mock for the new useFacilities composable.
  • Once all references to these two actions and their associated state have been migrated (e.g. https://github.com/search?q=repo%3Alearningequality%2Fkolibri%20getFacilities&type=code) - the actions, state, and mutations should be deleted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants