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

feat(xcontrols): add actions #1288

Conversation

mgg709
Copy link

@mgg709 mgg709 commented Sep 15, 2023

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

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that causes existing functionality to not work as expected)
  • Change requires a documentation update

What is the destination branch of this PR?

How has this been tested?

Tests performed according to testing guidelines:

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review on my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • [] I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

@mgg709 mgg709 requested a review from a team as a code owner September 15, 2023 09:55
any
>({
fetch({ dispatch }, request) {
return dispatch('fetchControls', request);
Copy link
Contributor

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

Comment on lines 8 to 9
* @param request - To be done.
* @returns To be done.
Copy link
Contributor

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.

@mgg709 mgg709 requested a review from CachedaCodes September 19, 2023 09:00
Comment on lines 13 to 17
onSuccess({ commit }, controls) {
commit('setControls', controls);
commit('setEvents', {});
}
});
Copy link
Contributor

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 }

Suggested change
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]>
@mgg709 mgg709 requested a review from CachedaCodes September 20, 2023 07:39
@CachedaCodes CachedaCodes merged commit 6534e8f into feature/EMP-1944-create-config-module-xcontrols Sep 20, 2023
@CachedaCodes CachedaCodes deleted the feature/EMP-2059-create-actions branch September 20, 2023 09:46
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.

3 participants