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

Centralize Credential Fetching and Parsing in CredentialsContext #485

Closed
gkatrakazas opened this issue Dec 4, 2024 · 0 comments · Fixed by #495
Closed

Centralize Credential Fetching and Parsing in CredentialsContext #485

gkatrakazas opened this issue Dec 4, 2024 · 0 comments · Fixed by #495
Labels
enhancement For suggesting improvements to existing features

Comments

@gkatrakazas
Copy link
Member

The current implementation involves fetching and parsing credential data in multiple components, leading to:

  1. Code Redundancy: Several components independently fetch and parse credentials, duplicating logic and increasing maintenance effort.
  2. Inconsistent State Management: The handling of credentials can become inconsistent across the app due to scattered logic.
  3. Reduced Readability: Parsing credentials directly within components adds complexity and makes them harder to read and maintain.

Proposed Solution

1. Use CredentialsContext Across Components

  • Replace individual fetch and parse calls in components with data from CredentialsContext.
  • Simplify components by focusing only on rendering and logic specific to their purpose.

2. Centralize Credential Parsing in CredentialsContext

  • Move all parsing logic to CredentialsContext to ensure consistency.
  • Expose parsed credentials or utility functions for parsing through the context.

3. Add Utility Methods in CredentialsContext

Provide reusable methods such as:

  • getParsedCredential(credentialId)
  • getCredentialById(credentialId)
  • getAllParsedCredentials()
@gkatrakazas gkatrakazas added the enhancement For suggesting improvements to existing features label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For suggesting improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant