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

[DO NOT MERGE] Credential Engine launch #2415

Open
wants to merge 999 commits into
base: main
Choose a base branch
from
Open

Conversation

ChelseaKR
Copy link
Collaborator

No description provided.

@ChelseaKR ChelseaKR force-pushed the credential-engine branch from 196d379 to c609043 Compare May 10, 2024 22:25
denish-fearless and others added 30 commits January 6, 2025 14:15
- Updated `getProviderData` in `CredentialEngineUtils.ts` to:
  - Handle cases where `ceterms:ownedBy` is missing.
  - Check for incomplete or invalid provider records (e.g., `{"errors":["Couldn't find Resource"]}`).
  - Return `null` for missing providers with appropriate warnings.

- Adjusted `transformCertificateToTraining` in `searchTrainings.ts`:
  - Added null checks for `provider`.
  - Fallback to default values when `provider` is missing.

- Modified `findTrainingsBy.ts`:
  - Ensured safe access to `provider` fields using null checks.
  - Updated `Training` type to allow `provider` to be nullable.

- Enhanced TypeScript types:
  - Updated `Training` and `Provider` interfaces to handle nullable `provider`.

- Frontend adjustments:
  - Ensured components like `TrainingPage.tsx` and `TrainingResultCard.tsx` handle missing provider data gracefully.
  - Added default text ("Provider not available") for missing provider information.

- Added warnings and logs for missing or invalid provider data.

- Resolved TypeScript compilation errors due to nullable `provider` fields.

This update ensures robust handling of scenarios where provider data is incomplete or missing, improving both backend and frontend stability.
- Updated `getProviderData` in `CredentialEngineUtils.ts` to:
  - Handle cases where `ceterms:ownedBy` is missing.
  - Check for incomplete or invalid provider records (e.g., `{"errors":["Couldn't find Resource"]}`).
  - Return `null` for missing providers with appropriate warnings.

- Adjusted `transformCertificateToTraining` in `searchTrainings.ts`:
  - Added null checks for `provider`.
  - Fallback to default values when `provider` is missing.

- Modified `findTrainingsBy.ts`:
  - Ensured safe access to `provider` fields using null checks.
  - Updated `Training` type to allow `provider` to be nullable.

- Enhanced TypeScript types:
  - Updated `Training` and `Provider` interfaces to handle nullable `provider`.

- Frontend adjustments:
  - Ensured components like `TrainingPage.tsx` and `TrainingResultCard.tsx` handle missing provider data gracefully.
  - Added default text ("Provider not available") for missing provider information.

- Added warnings and logs for missing or invalid provider data.

- Resolved TypeScript compilation errors due to nullable `provider` fields.

This update ensures robust handling of scenarios where provider data is incomplete or missing, improving both backend and frontend stability.
…onal-provider

fix: Handle missing provider data gracefully across backend and frontend
NJWE-2550: Implemented language filter
…earch API calls and larger batch sizes

- Refactored fetchAllCertsInBatches to execute batch requests concurrently.
- Increased default batch size to 50 to minimize the number of API calls.
- Combined all fetched results efficiently for reduced latency.
- Improved scalability and performance of certificate fetching.
sending whitespace instead of "+" to search the entire query in the backend
- Added caching for provider data using NodeCache to reduce redundant API calls.
- Fixed type mismatches in the Provider interface:
  - Updated the `addresses` property in the Provider interface to `Address[]`.
  - Ensured the `getAddress` function returns the correct structure, including the `@type` field.
- Simplified mapping logic in `getProviderData` to directly use the output of `getAddress`.
- Refactored related utilities to ensure compatibility with updated types.

This improves performance by leveraging caching and resolves compilation errors caused by type inconsistencies.
- Replaced static import of `p-limit` with dynamic `import()` to ensure compatibility with AWS CommonJS(?) environment.
- Updated `processInBatches` function to dynamically load `p-limit` only when needed.
- This change ensures the code works seamlessly in both local (ES module) and AWS (CommonJS) environments.
implemented support services filter
…ntains matches for learning opportunity profile ceterms:name an ceterms:description
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.

4 participants