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

Added oauth section to app details page. #104

Merged

Conversation

Charlesthebird
Copy link
Collaborator

@Charlesthebird Charlesthebird commented Sep 23, 2024

This PR:

  • Adds the ability to create + delete OAuth clients from the App details page.
  • Updates the isAdmin check so that the new isAdmin property in the /me endpoint is preferred (it also still works with the old method of checking the isAdmin property in the decoded access token).
  • Renames the VITE_APIS_IMAGE_URL property to VITE_BANNER_IMAGE_URL, and now uses that, if it exists, as a fallback. This is now how users can customize the banner images on the apps + subscriptions + teams + apis pages.

Here is a video of adding + deleting oauth clients:

Screen.Recording.2024-09-24.at.2.39.08.PM.mov

BOT NOTES:
resolves https://github.com/solo-io/solo-projects/issues/6886
resolves https://github.com/solo-io/solo-projects/issues/6953

Signed-off-by: Nicholas Bucher <[email protected]>
…to check for isAdmin prop.

Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
@solo-changelog-bot
Copy link

@Charlesthebird Charlesthebird marked this pull request as ready for review September 24, 2024 18:48
Signed-off-by: Nicholas Bucher <[email protected]>
Copy link
Contributor

@Worfle Worfle left a comment

Choose a reason for hiding this comment

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

Looks mostly good

});
}
}}
additionalContentTop={
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit surprised this isn't more standardized. This isn't really a 1-off is it?

Copy link
Collaborator Author

@Charlesthebird Charlesthebird Sep 24, 2024

Choose a reason for hiding this comment

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

The ViewCreatedItemModal is being used in the Authorization section and the API Keys section. I wanted to not have 2 components doing the same thing, so that's why I added this additionalContentTop in and made it generic.

}) => {
di(useDeleteOAuthMutation);
const { trigger: deleteOAuth } = useDeleteOAuthMutation(appId);
const onConfirm = async (e?: FormEvent) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to above, I wonder that this isn't a standardized call as well (preventDefault, action, close)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This whole component and a few others should be a ConfirmDeleteModal. As for the form event function being standardized/abstracted, I don't think I'd be against it, but I'd rather revisit that later.

return bgImageURL;
}
if (!!bannerImageURL) {
return bannerImageURL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does React react to a change in a file that is imported? I'd believe it, but it doesn't seem intuitive

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I see this is actually importing a variable from that file. Still, it feels like importing it would break the normal tracking.

Again, totally believe it, but it feels very weird.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm fairly confident that this would result in the imports (both the Banner, and the bannerImageURL - which definitely could be named better) not causing any additional re-renders after the first render. So it would be the same as if the deps array was: [bgImageURL].

However, to be clearer and to not run into any React weirdness, I'll update it to just use [bgImageURL].

Signed-off-by: Nicholas Bucher <[email protected]>
@Charlesthebird Charlesthebird merged commit 7783111 into gg-portal-1.18-features Sep 24, 2024
2 checks passed
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