-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat(xcontrols): add actions #1288
feat(xcontrols): add actions #1288
Conversation
Co-authored-by: Ana Fernández Ostio <[email protected]>
EMP-2056 Co-Authored-By: Matías García Gimeno <[email protected]>
…eature/EMP-2056/create-store-module
- EMP-2056 * Added type to Store module * Remove getters from store * change State type (ExperienceControlsState) Co-Authored-By: Matías García Gimeno <[email protected]>
….com/empathyco/x into feature/EMP-2056/create-store-module
* EMP-2059 Co-Authored-By: Matías García Gimeno <[email protected]>
...components/src/x-modules/experience-controls/store/actions/fetch-and-save-controls.action.ts
Show resolved
Hide resolved
any | ||
>({ | ||
fetch({ dispatch }, request) { | ||
return dispatch('fetchControls', request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you have the full adapter here you won't just receive the controls but also the events to emit. This should be called fetchExperienceControlsResponse
...components/src/x-modules/experience-controls/store/actions/fetch-and-save-controls.action.ts
Outdated
Show resolved
Hide resolved
* @param request - To be done. | ||
* @returns To be done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a TODO
to change with the adapter.
packages/x-components/src/x-modules/experience-controls/store/actions/fetch-controls.action.ts
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/experience-controls/store/types.ts
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/experience-controls/store/types.ts
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/experience-controls/events.types.ts
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/experience-controls/wiring.ts
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/experience-controls/store/types.ts
Outdated
Show resolved
Hide resolved
onSuccess({ commit }, controls) { | ||
commit('setControls', controls); | ||
commit('setEvents', {}); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still doesn't take into account that the object returned by the success of the fetch will be similar to { controls, events }
onSuccess({ commit }, controls) { | |
commit('setControls', controls); | |
commit('setEvents', {}); | |
} | |
}); | |
onSuccess({ commit }, experienceControlsResponse) { | |
commit('setControls', experienceControlsResponse.controls); | |
commit('setEvents', experienceControlsResponse.events); | |
} | |
}); |
- EMP-2059 Co-Authored-By: Matías García Gimeno <[email protected]>
6534e8f
into
feature/EMP-1944-create-config-module-xcontrols
Pull request template
We have created some actions to obtain the experience controls service configuration, sending a request to it.
Motivation and context
Type of change
What is the destination branch of this PR?
Main
How has this been tested?
Tests performed according to testing guidelines:
Checklist: