-
-
Notifications
You must be signed in to change notification settings - Fork 202
fix(assetUsage): migrate asset usage table DEV-1013 #6269
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
base: dev-987-asset-usage-limit-offset-pagination
Are you sure you want to change the base?
fix(assetUsage): migrate asset usage table DEV-1013 #6269
Conversation
…dev-1013-mirgrate-to-universal-table
@duvld you forgot to add task id in PR title :) |
errorMessageDisplay: t('There was an error fetching asset usage data.'), | ||
}) | ||
return { | ||
status: 200 as const, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the story here? Pre-defining the response status seems strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my other comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple comments, but it's looking good so far.
const queryResult = useQuery({ | ||
queryKey: [QueryKeys.assetUsage, pagination.limit, pagination.offset, orgQuery.data, orgQuery.data?.id, order], | ||
queryFn: () => getOrgAssetUsage(pagination.limit, pagination.offset, orgQuery.data ? orgQuery.data.id : '', order), | ||
placeholderData: keepPreviousData, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to migrate to custom react-queries 👌 But let's migrate straight Orval's react-query!
See useOrganizationsServiceUsageRetrieve
, or useOrganizationsServiceUsageSummary
that just got merged into main
. Afterwards the whole of assetUsage.api.ts
could be deleted.
P.S. #6307 also uses Orval's react-query response in UniversalTable
errorMessageDisplay: t('There was an error fetching asset usage data.'), | ||
}) | ||
return { | ||
status: 200 as const, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my other comment
🗒️ Checklist
<type>(<scope>)<!>: <title> DEV-1234
Front end
and/orBack end
orworkflow
📣 Summary
Use the new table component to display asset usage data. Fixes old pagination issues
💭 Notes
Modeled after how access logs uses the universal table. Removes
uid
from theAssetWithUsage
type as it is not actually expected as a response from backend--updated logic accordingly👀 Preview steps