Skip to content

Commit ea3b5e4

Browse files
ironAiken2agatha197
authored andcommitted
fix(FR-2646): align RoleDetailDrawer queries with updated schema (#6882)
Resolves [FR-2646](https://lablup.atlassian.net/browse/FR-2646) — GraphQL schema update broke `RoleDetailDrawer`. ## Summary The backend schema update changed `RoleAssignmentFilter.roleId` from `UUID` to `UUIDFilter`. This: 1. Broke TypeScript compile in `RoleDetailDrawer.tsx` (`error TS2559`). 2. Introduced a latent runtime failure in `RoleAssignmentTab.tsx` refetch path (TypeScript missed it because `GraphQLFilter` is typed `[key: string]: any`). 3. Surfaced a related server-side validation error when loading the role detail drawer: `Fields "adminRole" conflict because they have differing arguments.` — caused by `RoleScopeTabFragment` and the parent query both calling `adminRole(id: …)` at the top level. ## Changes - **`data/schema.graphql`** — sync with backend 26.4.3+ (`RoleAssignmentFilter.roleId` → `UUIDFilter`, plus new `projectId`/`createdUserId`/`imageId`/`modelVfolderId` filter fields on unrelated inputs). - **`react/src/components/RoleDetailDrawer.tsx`** — wrap `roleId` in `{ equals: localRoleId }` so it conforms to the new `UUIDFilter` type. - **`react/src/components/RoleAssignmentTab.tsx`** — same wrap in the refetch path. - **`react/src/components/RoleScopeTab.tsx`** — alias the inner `adminRole(id: $roleId)` to `scopeRole: adminRole(id: $roleId)` so the server validator stops flagging it as conflicting with the outer `adminRole(id: $id)` call. Two data-access sites (`data.adminRole` → `data.scopeRole`) updated accordingly. ## Verification - `bash scripts/verify.sh` → `=== ALL PASS ===` - Relay compile regenerates `RoleDetailDrawerQuery` with the two calls differentiated: outer `adminRole(id: $id)` and inner `scopeRole: adminRole(id: $id)`. - Role detail drawer opens without the `"Fields adminRole conflict"` validation error from the backend. ## Checklist - [x] Documentation: N/A (bug fix, no user-facing behavior change) - [x] Minimum required manager version: needs manager exposing the updated schema (26.4.3+) - [x] Specific setting for review: open any role in `/rbac` and verify the detail drawer loads - [x] Minimum requirements to check during review: TypeScript passes; role detail drawer loads without GraphQL validation error - [x] Test case(s): existing `e2e/rbac/rbac-role-detail.spec.ts` (currently `test.fixme`d pending separate work) exercises this flow [FR-2646]: https://lablup.atlassian.net/browse/FR-2646?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 476ff80 commit ea3b5e4

0 file changed

File tree

    0 commit comments

    Comments
     (0)