Refactor MeasuresPage to use Relay fragments
Replace the client-side grouped-by-category view (fetching 500 items) with a flat table using server-side filtering and cursor-based pagination. Colocate GraphQL queries, fragments, and mutations in the component file per console CLAUDE.md conventions. Backend changes add a category filter to the measure list endpoints (GraphQL, MCP) and a new measureCategories field on Organization. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -7,18 +7,7 @@ import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
|
||||
export const measuresQuery = graphql`
|
||||
query MeasureGraphListQuery($organizationId: ID!) {
|
||||
organization: node(id: $organizationId) @required(action: THROW) {
|
||||
__typename
|
||||
... on Organization {
|
||||
id
|
||||
canCreateMeasure: permission(action: "core:measure:create")
|
||||
...MeasuresPageFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const MeasureConnectionKey = "MeasuresPage_measures";
|
||||
|
||||
const deleteMeasureMutation = graphql`
|
||||
mutation MeasureGraphDeleteMutation(
|
||||
@@ -31,8 +20,6 @@ const deleteMeasureMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const MeasureConnectionKey = "MeasuresGraphListQuery__measures";
|
||||
|
||||
export function useDeleteMeasureMutation() {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user