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

hook scaffolding #14340

Merged
merged 7 commits into from
Jun 3, 2024
Merged

hook scaffolding #14340

merged 7 commits into from
Jun 3, 2024

Conversation

jpandersen87
Copy link
Collaborator

@jpandersen87 jpandersen87 commented May 8, 2024

Fixes: #14341,#8366,#8379,#8378,#8375,#8373,#8371,#8368

This PR scaffolds the (hopefully) remaining hooks to migrate to react-query.

  • Filtering logic was moved to a dedicated function in utils/filters.
  • authorizedFetch was folded into the Session Context and now allows manual urls in addition to the endpointconfig object.
  • The organization settings list page uses the new hook.
  • Cleanup of folder structure for api hooks
  • Cleanup of mocks for hooks
  • Import path updates from cleanup

@jpandersen87 jpandersen87 self-assigned this May 8, 2024
@jpandersen87 jpandersen87 added the frontend Work Type label to flag work related to the front-end websites label May 8, 2024
Copy link

github-actions bot commented May 8, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@penny-lischer penny-lischer added the experience Team label to flag issues owned by the Experience Team label May 9, 2024
options,
endpointConfig,
}: StaticAuthorizedFetchProps) {
if (options.segments && !endpointConfig)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to log any of these potential errors to Azure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At the moment i'm expecting our custom error boundary to handle emitting these to telemetry.

@@ -5,6 +5,7 @@ import {
UserClaims,
} from "@okta/okta-auth-js";
import { useOktaAuth } from "@okta/okta-react";
import axios, { AxiosError } from "axios";
Copy link
Collaborator

@etanb etanb May 20, 2024

Choose a reason for hiding this comment

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

I understand this might be out of the scope of this PR, but we do use both fetch and axios in our project. Is it time that we hard cut to one or the other?

For example in: AdminOrgEdit.tsx AdminLastMileFailuresTable.tsx EditSenderSettings.tsx

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Axios is currently the pattern (for context, established even before me), which is why it is continuing to be used. Getting everything in the project moved to using these new hooks will naturally align the project in one direction.

Copy link
Collaborator

@penny-lischer penny-lischer left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@etanb etanb left a comment

Choose a reason for hiding this comment

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

Small comment about commenting, but 👍

Copy link

sonarcloud bot commented Jun 3, 2024

@jpandersen87 jpandersen87 merged commit 7640e75 into master Jun 3, 2024
17 checks passed
@jpandersen87 jpandersen87 deleted the experience/hook-scaffolding branch June 3, 2024 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experience Team label to flag issues owned by the Experience Team frontend Work Type label to flag work related to the front-end websites
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Scaffold/template Remaining Hooks
3 participants