Skip to content

Commit

Permalink
[EASI-4412] related reqs table (#2728)
Browse files Browse the repository at this point in the history
* Contract number portion when no contract numbers

* starting on table

* beginning on types for table

* (no verify) working on getting `relatedIntakes` and `relatedTRBRequests` in the gen types - couldn't figure that out yet

* (no verify) working on types and updated query to regen(no verify) working on types and updated query to regen(no verify) working on types and updated query to regen(no verify) working on types and updated query to regen(no verify) working on types and updated query to regen(no verify) working on types and updated query to regen(no verify) working on types and updated query to regen(no verify) working on types and updated query to regen(no verify) working on types and updated query to regen

* add relatedIntakes and relatedTRBrequest fields to TRB type as well

* (no verify) building out table data

* (no verify) progress on table including columns and skeleton of table

* (no verify) debugging eslint issue, but making good progress on table

* (no verify) remove unused, will get table eslint issues figured out

* (no verify) testing eslint

* phew! eslint fix and doc

* fix mapping and text display

* add mapping for system intake decision state

* format date

* implicit return

* naming, cleanup

* change taks list to admin routes

* starting on tests...

* still trying to figure out these mocks

* still tinkering with some tests

* tests run!

* remove unused

* update usage and types

* one more basic render test. starting on role-based tests

* working on mock store for testing

* whoops - fix mock store passage

* test for different roles

* add some mock data

* update format of negative tests

* use screen

* rename function, fix up link conditionals

* fix spacing, tests

* unused

* whoops - lint

* clean up margins

* add ff
  • Loading branch information
samoddball committed Aug 8, 2024
1 parent fba612b commit c62d624
Show file tree
Hide file tree
Showing 32 changed files with 1,297 additions and 62 deletions.
6 changes: 5 additions & 1 deletion src/components/NavigationBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export const navLinks = (
{
link: '/',
label:
isUserSet && user.isTrbAdmin(userGroups, flags) ? 'adminHome' : 'home',
isUserSet &&
(user.isTrbAdmin(userGroups, flags) ||
user.isITGovAdmin(userGroups, flags))
? 'adminHome'
: 'home',
isEnabled: true
},
{
Expand Down
39 changes: 37 additions & 2 deletions src/data/mock/systemIntake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ import {
SystemIntakeStatusAdmin,
SystemIntakeStatusRequester,
SystemIntakeStep,
SystemIntakeTRBFollowUp
SystemIntakeTRBFollowUp,
TRBRequestStatus
} from 'types/graphql-global-types';
import { MockedQuery } from 'types/util';

Expand Down Expand Up @@ -272,7 +273,9 @@ export const emptySystemIntake: SystemIntake = {
}
]
}
]
],
relatedIntakes: [],
relatedTRBRequests: []
};

export const systemIntake: SystemIntake = {
Expand Down Expand Up @@ -397,6 +400,38 @@ export const systemIntake: SystemIntake = {
}
]
}
],
relatedIntakes: [
{
__typename: 'SystemIntake',
id: '1',
requestName: 'related intake 1',
contractNumbers: [
{ __typename: 'SystemIntakeContractNumber', contractNumber: '1' },
{ __typename: 'SystemIntakeContractNumber', contractNumber: '2' }
],
decisionState: SystemIntakeDecisionState.NO_DECISION,
submittedAt: new Date().toString()
}
],
relatedTRBRequests: [
{
__typename: 'TRBRequest',
id: '2',
name: 'related trb 1',
contractNumbers: [
{
__typename: 'TRBRequestContractNumber',
contractNumber: '1'
},
{
__typename: 'TRBRequestContractNumber',
contractNumber: '2'
}
],
status: TRBRequestStatus.FOLLOW_UP_REQUESTED,
createdAt: new Date().toString()
}
]
};

Expand Down
4 changes: 3 additions & 1 deletion src/data/mock/trbRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ export const trbRequest: GetTrbRequest['trbRequest'] = {
fundingSources: null,
submittedAt: null,
__typename: 'TRBRequestForm'
}
},
relatedTRBRequests: [],
relatedIntakes: []
};

export const getTrbRequestQuery: MockedQuery<
Expand Down
16 changes: 15 additions & 1 deletion src/i18n/en-US/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,21 @@ const admin = {
'EASi cannot display any additional information or related requests because this IT Governance request is not currently linked to a system, service, or contract. If this is an error, please use the button below to link the request.',
newSystemAlert:
'This request is for a completely new system, service, or contract and may not have other requests related to it. If this is an error, please use the button below to link the request to a system, service, or contract.',
linkSystem: 'Link this request to a system, service, or contract'
linkSystem: 'Link this request to a system, service, or contract',
noContractNumber: 'No contract number listed',
relatedRequests: 'Related requests',
tableColumns: {
projectTitle: 'Project title',
process: 'Process',
contractNumber: 'Contract number',
status: 'Status',
submissionDate: 'Submission date'
},
relatedRequestsTable: {
id: 'related-requests-table',
title: 'Related requests',
empty: 'There are no additional requests linked to this system'
}
};

export default admin;
9 changes: 9 additions & 0 deletions src/i18n/en-US/articles/governanceReviewTeam.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
SystemIntakeActionType,
SystemIntakeDecisionState,
SystemIntakeStatusAdmin,
SystemIntakeStatusRequester
} from 'types/graphql-global-types';
Expand Down Expand Up @@ -85,6 +86,13 @@ 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 @@ -311,6 +319,7 @@ const governanceReviewTeam = {
},
systemIntakeStatusAdmin,
systemIntakeStatusRequester,
systemIntakeDecisionState,
adminLeads: {
assignModal: {
header: 'Choose an Admin Lead for {{-requestName}}',
Expand Down
18 changes: 18 additions & 0 deletions src/queries/GetSystemIntakeQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,24 @@ export const SystemIntake = gql`
assigneeLastName
}
}
relatedTRBRequests {
id
name
contractNumbers {
contractNumber
}
status
createdAt
}
relatedIntakes {
id
requestName
contractNumbers {
contractNumber
}
decisionState
submittedAt
}
}
`;

Expand Down
29 changes: 29 additions & 0 deletions src/queries/GetSystemIntakeRelatedRequestsQuery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { gql } from '@apollo/client';

const GetSystemIntakeRelatedRequestsQuery = gql`
query GetSystemIntakeRelatedRequests($systemIntakeID: UUID!) {
systemIntake(id: $systemIntakeID) {
id
relatedIntakes {
id
requestName
contractNumbers {
contractNumber
}
decisionState
submittedAt
}
relatedTRBRequests {
id
name
contractNumbers {
contractNumber
}
status
createdAt
}
}
}
`;

export default GetSystemIntakeRelatedRequestsQuery;
18 changes: 18 additions & 0 deletions src/queries/TrbRequestFormFieldsFragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,23 @@ export default gql`
}
createdAt
}
relatedTRBRequests {
id
name
contractNumbers {
contractNumber
}
status
createdAt
}
relatedIntakes {
id
requestName
contractNumbers {
contractNumber
}
decisionState
submittedAt
}
}
`;
44 changes: 43 additions & 1 deletion src/queries/types/CreateTrbRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @generated
// This file was automatically generated and should not be edited.

import { TRBRequestType, TRBRequestState, TRBFormStatus, TRBFeedbackStatus, TRBConsultPrepStatus, TRBAttendConsultStatus, TRBAdviceLetterStatus, TRBWhereInProcessOption, TRBCollabGroupOption, TRBSubjectAreaOption, TRBFeedbackAction } from "./../../types/graphql-global-types";
import { TRBRequestType, TRBRequestState, TRBFormStatus, TRBFeedbackStatus, TRBConsultPrepStatus, TRBAttendConsultStatus, TRBAdviceLetterStatus, TRBWhereInProcessOption, TRBCollabGroupOption, TRBSubjectAreaOption, TRBFeedbackAction, TRBRequestStatus, SystemIntakeDecisionState } from "./../../types/graphql-global-types";

// ====================================================
// GraphQL mutation operation: CreateTrbRequest
Expand Down Expand Up @@ -77,6 +77,40 @@ export interface CreateTrbRequest_createTRBRequest_feedback {
createdAt: Time;
}

export interface CreateTrbRequest_createTRBRequest_relatedTRBRequests_contractNumbers {
__typename: "TRBRequestContractNumber";
contractNumber: string;
}

export interface CreateTrbRequest_createTRBRequest_relatedTRBRequests {
__typename: "TRBRequest";
id: UUID;
name: string | null;
/**
* Linked contract numbers
*/
contractNumbers: CreateTrbRequest_createTRBRequest_relatedTRBRequests_contractNumbers[];
status: TRBRequestStatus;
createdAt: Time;
}

export interface CreateTrbRequest_createTRBRequest_relatedIntakes_contractNumbers {
__typename: "SystemIntakeContractNumber";
contractNumber: string;
}

export interface CreateTrbRequest_createTRBRequest_relatedIntakes {
__typename: "SystemIntake";
id: UUID;
requestName: string | null;
/**
* Linked contract numbers
*/
contractNumbers: CreateTrbRequest_createTRBRequest_relatedIntakes_contractNumbers[];
decisionState: SystemIntakeDecisionState;
submittedAt: Time | null;
}

export interface CreateTrbRequest_createTRBRequest {
__typename: "TRBRequest";
id: UUID;
Expand All @@ -86,6 +120,14 @@ export interface CreateTrbRequest_createTRBRequest {
taskStatuses: CreateTrbRequest_createTRBRequest_taskStatuses;
form: CreateTrbRequest_createTRBRequest_form;
feedback: CreateTrbRequest_createTRBRequest_feedback[];
/**
* Other TRB Requests that share a CEDAR System or Contract Number
*/
relatedTRBRequests: CreateTrbRequest_createTRBRequest_relatedTRBRequests[];
/**
* System Intakes that share a CEDAR System or Contract Number
*/
relatedIntakes: CreateTrbRequest_createTRBRequest_relatedIntakes[];
}

export interface CreateTrbRequest {
Expand Down
44 changes: 43 additions & 1 deletion src/queries/types/GetSystemIntake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @generated
// This file was automatically generated and should not be edited.

import { GovernanceRequestFeedbackTargetForm, GovernanceRequestFeedbackType, SystemIntakeLCIDStatus, SystemIntakeRequestType, SystemIntakeStatusAdmin, SystemIntakeStatusRequester, SystemIntakeDocumentCommonType, SystemIntakeDocumentStatus, SystemIntakeState, SystemIntakeDecisionState, SystemIntakeTRBFollowUp, SystemIntakeFormState, RequestRelationType } from "./../../types/graphql-global-types";
import { GovernanceRequestFeedbackTargetForm, GovernanceRequestFeedbackType, SystemIntakeLCIDStatus, SystemIntakeRequestType, SystemIntakeStatusAdmin, SystemIntakeStatusRequester, SystemIntakeDocumentCommonType, SystemIntakeDocumentStatus, SystemIntakeState, SystemIntakeDecisionState, SystemIntakeTRBFollowUp, SystemIntakeFormState, RequestRelationType, TRBRequestStatus } from "./../../types/graphql-global-types";

// ====================================================
// GraphQL query operation: GetSystemIntake
Expand Down Expand Up @@ -147,6 +147,40 @@ export interface GetSystemIntake_systemIntake_systems {
businessOwnerRoles: GetSystemIntake_systemIntake_systems_businessOwnerRoles[];
}

export interface GetSystemIntake_systemIntake_relatedTRBRequests_contractNumbers {
__typename: "TRBRequestContractNumber";
contractNumber: string;
}

export interface GetSystemIntake_systemIntake_relatedTRBRequests {
__typename: "TRBRequest";
id: UUID;
name: string | null;
/**
* Linked contract numbers
*/
contractNumbers: GetSystemIntake_systemIntake_relatedTRBRequests_contractNumbers[];
status: TRBRequestStatus;
createdAt: Time;
}

export interface GetSystemIntake_systemIntake_relatedIntakes_contractNumbers {
__typename: "SystemIntakeContractNumber";
contractNumber: string;
}

export interface GetSystemIntake_systemIntake_relatedIntakes {
__typename: "SystemIntake";
id: UUID;
requestName: string | null;
/**
* Linked contract numbers
*/
contractNumbers: GetSystemIntake_systemIntake_relatedIntakes_contractNumbers[];
decisionState: SystemIntakeDecisionState;
submittedAt: Time | null;
}

export interface GetSystemIntake_systemIntake {
__typename: "SystemIntake";
id: UUID;
Expand Down Expand Up @@ -208,6 +242,14 @@ export interface GetSystemIntake_systemIntake {
* Linked systems
*/
systems: GetSystemIntake_systemIntake_systems[];
/**
* TRB Requests that share a CEDAR System or Contract Number
*/
relatedTRBRequests: GetSystemIntake_systemIntake_relatedTRBRequests[];
/**
* Other System Intakes that share a CEDAR System or Contract Number
*/
relatedIntakes: GetSystemIntake_systemIntake_relatedIntakes[];
}

export interface GetSystemIntake {
Expand Down
Loading

0 comments on commit c62d624

Please sign in to comment.