Skip to content

Convert APIKeyForm to a function component and connect to Redux #2307

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

Merged
merged 4 commits into from
Mar 29, 2024

Conversation

lindapaiste
Copy link
Collaborator

Fixes a //TODO and also fixes a mistake that I made in the existing code for the AccountView. I should be passing through arguments to the action creators on those dispatch calls. As a result of that mistake, the ApiKeyForm doesn't work. Which is fine because the feature flag UI_ACCESS_TOKEN_ENABLED is false so we never show the form. But we should fix it.

<APIKeyForm
// TODO: it makes more sense to connect the APIKeyForm component directly -Linda
apiKeys={apiKeys}
createApiKey={() => dispatch(createApiKey)}
removeApiKey={() => dispatch(removeApiKey)}
t={t}
/>

Changes:

  • Remove some API key logic from the parent AccountView.
  • Convert APIKeyForm to a function component.
  • APIKeyForm manages its own Redux state with useSelector and useDispatch.
    It looks like a lot more changes when viewing the diff due to the changed indentation level.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

Copy link
Contributor

@PiyushChandra17 PiyushChandra17 left a comment

Choose a reason for hiding this comment

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

Nice Done

Copy link
Collaborator

@raclim raclim left a comment

Choose a reason for hiding this comment

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

Going to get this one in too! Thanks so much for noting and addressing this so quickly at the time!

@raclim raclim merged commit 795ae09 into processing:develop Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants