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) Implement config utils in the modules with config #1321

Merged
merged 9 commits into from
Oct 12, 2023

Conversation

annacv
Copy link
Contributor

@annacv annacv commented Oct 11, 2023

EMP-2328

BREAKING CHANGES:

  • setTaggingConfig mutation has been renamed/replaced by setConfig
  • setFacetsConfig mutation has been renamed/replaced by setConfig
  • setPageSize mutation has been renamed/replaced by setConfig

Pull request template

A new store util has been created. This PR uses this config store util in the modules that have a config, no matter if they are actually doing it.

Motivation and context

The aim of this task is to enable modifying the module's config from outside them (e.g., via the experience controls module).

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?

  • Main
  • Other. Specify:

How has this been tested?

  • My changes generate no new warnings.
  • Existing unit tests pass locally with my changes.

@annacv annacv requested a review from a team as a code owner October 11, 2023 09:27
@annacv annacv changed the title Feature/emp 2328 implement config utils (feat) Implement config utils in the modules with config Oct 11, 2023
Comment on lines 43 to 48
/**
* Sets the {@link EmpathizeState.config } config.
*
* @param config - The new config.
*/
setConfig(config: EmpathizeConfig): void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type already exists in the config-store.utils.ts. You have to import the mutations type and make the mutations extend that type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, regarding this, if we extend the mutations we shouldn't need to declare them here, so we could remove setConfig & mergeConfig types from here. If this is okay, why are we keeping setQuery mutation types in modules if we are extending QueryMutations??

@@ -14,7 +15,8 @@ export const empathizeXStoreModule: EmpathizeXStoreModule = {
mutations: {
setIsOpen(state, isOpen) {
state.isOpen = isOpen;
}
},
setConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're missing the mergeConfig mutation.

BREAKING CHANGE: setTaggingConfig mutation has been renamed/replaced by setConfig

EMP-2328
BREAKING CHANGE: setFacetsConfig mutation has been renamed/replaced by setConfig

EMP-2328
BREAKING CHANGE: setPageSize mutation has been renamed/replaced by setConfig

EMP-2328
@annacv annacv force-pushed the feature/EMP-2328-Implement-config-utils branch from 0df2737 to 9a39dc5 Compare October 11, 2023 14:58
@CachedaCodes CachedaCodes merged commit 393d758 into main Oct 12, 2023
4 checks passed
CachedaCodes added a commit that referenced this pull request Oct 12, 2023
@CachedaCodes CachedaCodes deleted the feature/EMP-2328-Implement-config-utils branch October 12, 2023 09:51
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.

2 participants