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

feat: display version in UI #99

Merged
merged 4 commits into from
Sep 26, 2024
Merged

feat: display version in UI #99

merged 4 commits into from
Sep 26, 2024

Conversation

gruyaume
Copy link
Collaborator

@gruyaume gruyaume commented Sep 25, 2024

Description

Display the Notary version in the UI leveraging the new /status endpoint.

Fixes #66

Screenshot

image

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that validate the behaviour of the software
  • I validated that new and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@gruyaume gruyaume requested a review from a team as a code owner September 25, 2024 19:34
@gruyaume gruyaume merged commit 5464d0b into main Sep 26, 2024
13 checks passed
@gruyaume gruyaume deleted the dev-version-ui branch September 26, 2024 11:33
Copy link
Contributor

@kayra1 kayra1 left a comment

Choose a reason for hiding this comment

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

oh its already merged

Comment on lines +19 to +25
useEffect(() => {
const fetchStatus = async () => {
const statusData = await getStatus();
setStatus(statusData);
};
fetchStatus();
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would usually avoid useEffect when making queries because there are a ton of pitfalls. Here for example we will be refetching the version every time this component redraws since there is no dependencies listed.

We should use react-query, which honestly is way simpler to use and understand:

const queryClient = useQueryClient()
const query = useQuery({ queryKey: [], queryFn: getStatus })
const version = query.data?.version

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.

Users should know which Notary version they are running
3 participants