Skip to content

Commit

Permalink
[EASI-4467] trb related requests table (#2755)
Browse files Browse the repository at this point in the history
* working on conditional fetch logic

* attempt at hook - will clean up if POC works

* remove system intake related requests flag from code - trb table done

* clean up imports

* add  types

* tests for trb table

* use RequestType - fix imports

* update to new gql style

* use correct status field

* fix sort

* `useQuery` with more than one type
Remove useRelatedRequests

---------

Co-authored-by: adamodd <adam.suharja@oddball.io>
  • Loading branch information
samoddball and adamodd committed Aug 13, 2024
1 parent 5f34ced commit 17aa217
Show file tree
Hide file tree
Showing 13 changed files with 651 additions and 159 deletions.
2 changes: 1 addition & 1 deletion pkg/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/graph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2852,7 +2852,7 @@ enum SystemIntakeMeetingState {
}

"""
This represents the statuses that and admin would see as a representation of a system intake. Note, there is no status for a brand new request, because and Admin doesn't see the request until it is in progress.
This represents the statuses that an admin would see as a representation of a system intake. Note, there is no status for a brand new request, because an Admin doesn't see the request until it is in progress.
"""
enum SystemIntakeStatusAdmin {
INITIAL_REQUEST_FORM_IN_PROGRESS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { gql } from '@apollo/client';

const GetSystemIntakeRelatedRequestsQuery = gql`
export default gql(/* GraphQL */ `
query GetSystemIntakeRelatedRequests($systemIntakeID: UUID!) {
systemIntake(id: $systemIntakeID) {
id
Expand All @@ -10,7 +10,8 @@ const GetSystemIntakeRelatedRequestsQuery = gql`
contractNumbers {
contractNumber
}
decisionState
statusAdmin
statusRequester
submittedAt
}
relatedTRBRequests {
Expand All @@ -24,6 +25,4 @@ const GetSystemIntakeRelatedRequestsQuery = gql`
}
}
}
`;

export default GetSystemIntakeRelatedRequestsQuery;
`);
28 changes: 28 additions & 0 deletions src/gql/apolloGQL/trb/GetTRBRequestRelatedRequests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { gql } from '@apollo/client';

export default gql(/* GraphQL */ `
query GetTRBRequestRelatedRequests($trbRequestID: UUID!) {
trbRequest(id: $trbRequestID) {
id
relatedIntakes {
id
requestName
contractNumbers {
contractNumber
}
statusAdmin
statusRequester
submittedAt
}
relatedTRBRequests {
id
name
contractNumbers {
contractNumber
}
status
createdAt
}
}
}
`);
136 changes: 135 additions & 1 deletion src/gql/gen/graphql.ts

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions src/i18n/en-US/articles/governanceReviewTeam.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
SystemIntakeActionType,
SystemIntakeDecisionState,
SystemIntakeStatusAdmin,
SystemIntakeStatusRequester
} from 'types/graphql-global-types';
Expand Down Expand Up @@ -86,13 +85,6 @@ const systemIntakeStatusRequester: Record<
NOT_GOVERNANCE: 'Not an IT Governance request'
};

const systemIntakeDecisionState: Record<SystemIntakeDecisionState, string> = {
LCID_ISSUED: 'LCID Issued',
NOT_APPROVED: 'Not Approved',
NOT_GOVERNANCE: 'Not Governance',
NO_DECISION: 'No Decision'
};

const governanceReviewTeam = {
title: 'Prepare for the Governance Review Team meeting',
description:
Expand Down Expand Up @@ -319,7 +311,6 @@ const governanceReviewTeam = {
},
systemIntakeStatusAdmin,
systemIntakeStatusRequester,
systemIntakeDecisionState,
adminLeads: {
assignModal: {
header: 'Choose an Admin Lead for {{-requestName}}',
Expand Down
65 changes: 0 additions & 65 deletions src/queries/types/GetSystemIntakeRelatedRequests.ts

This file was deleted.

8 changes: 1 addition & 7 deletions src/types/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ export type Flags = {
atoProcessList: boolean;
downgradeGovTeam: boolean;
downgradeTrbAdmin: boolean;
systemIntakeRelatedRequests: boolean;
systemProfileHiddenFields: boolean;
systemWorkspace: boolean;
systemWorkspaceRequestsCard: boolean;
trbRelatedRequests: boolean;
grbReviewTab: boolean;
showAtoColumn: boolean;
};

export type FlagsState = {
flags: Flags;
isLoaded: boolean;
error?: string;
};
2 changes: 1 addition & 1 deletion src/types/graphql-global-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export enum SystemIntakeState {
}

/**
* This represents the statuses that and admin would see as a representation of a system intake. Note, there is no status for a brand new request, because and Admin doesn't see the request until it is in progress.
* This represents the statuses that an admin would see as a representation of a system intake. Note, there is no status for a brand new request, because an Admin doesn't see the request until it is in progress.
*/
export enum SystemIntakeStatusAdmin {
CLOSED = "CLOSED",
Expand Down
Loading

0 comments on commit 17aa217

Please sign in to comment.