Skip to content

Commit

Permalink
Remove Q&A by rates flag (#2938)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLin0991 authored Nov 18, 2024
1 parent 97376e2 commit a844dcf
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 197 deletions.
7 changes: 0 additions & 7 deletions services/app-api/src/common-code/featureFlags/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ const featureFlags = {
flag: 'rate-edit-unlock',
defaultValue: false,
},
/**
* Enables Q&A by rates feature
*/
QA_BY_RATES: {
flag: 'qa-by-rates',
defaultValue: false,
},
/**
* Enables submission approvals, withdraws, and reviews features
*/
Expand Down
7 changes: 0 additions & 7 deletions services/app-web/src/common-code/featureFlags/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ const featureFlags = {
flag: 'rate-edit-unlock',
defaultValue: false,
},
/**
* Enables Q&A by rates feature
*/
QA_BY_RATES: {
flag: 'qa-by-rates',
defaultValue: false
},
/**
* Enables submission approvals, withdraws, and reviews features
*/
Expand Down
79 changes: 26 additions & 53 deletions services/app-web/src/pages/App/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ const StateUserRoutes = ({
featureFlags.RATE_EDIT_UNLOCK.defaultValue
)

const showQAbyRates: boolean = ldClient?.variation(
featureFlags.QA_BY_RATES.flag,
featureFlags.QA_BY_RATES.defaultValue
)

return (
<AuthenticatedRouteWrapper>
<Routes>
Expand Down Expand Up @@ -156,22 +151,16 @@ const StateUserRoutes = ({
path={RoutesRecord.SUBMISSIONS_EDIT_TOP_LEVEL}
element={<StateSubmissionForm />}
/>
{showQAbyRates && (
<>
<Route
path={
RoutesRecord.SUBMISSIONS_RATE_QUESTIONS_AND_ANSWERS
}
element={<RateQuestionResponse />}
/>
<Route
path={
RoutesRecord.SUBMISSIONS_UPLOAD_RATE_RESPONSE
}
element={<UploadRateResponse />}
/>
</>
)}
<Route
path={
RoutesRecord.SUBMISSIONS_RATE_QUESTIONS_AND_ANSWERS
}
element={<RateQuestionResponse />}
/>
<Route
path={RoutesRecord.SUBMISSIONS_UPLOAD_RATE_RESPONSE}
element={<UploadRateResponse />}
/>
</Route>
<Route
path={RoutesRecord.SUBMISSIONS_REVISION}
Expand All @@ -198,11 +187,6 @@ const CMSUserRoutes = ({
setAlert?: React.Dispatch<React.ReactElement>
stageName?: string
}): React.ReactElement => {
const ldClient = useLDClient()
const showQAbyRates: boolean = ldClient?.variation(
featureFlags.QA_BY_RATES.flag,
featureFlags.QA_BY_RATES.defaultValue
)
return (
<AuthenticatedRouteWrapper>
<Routes>
Expand Down Expand Up @@ -246,37 +230,26 @@ const CMSUserRoutes = ({
/>
</Route>

{showQAbyRates ? (
<>
<Route element={<RateSummarySideNav />}>
<Route
path={RoutesRecord.RATES_SUMMARY}
element={<RateSummary />}
/>
<Route
path={
RoutesRecord.RATES_SUMMARY_QUESTIONS_AND_ANSWERS
}
element={<RateQuestionResponse />}
/>
<Route
path={RoutesRecord.RATES_UPLOAD_QUESTION}
element={<UploadRateQuestions />}
/>
{/*This route will cause the RateSummarySideNav to redirect to rate summary Q&A page*/}
<Route
path={
RoutesRecord.SUBMISSIONS_RATE_QUESTIONS_AND_ANSWERS
}
/>
</Route>
</>
) : (
<Route element={<RateSummarySideNav />}>
<Route
path={RoutesRecord.RATES_SUMMARY}
element={<RateSummary />}
/>
)}
<Route
path={RoutesRecord.RATES_SUMMARY_QUESTIONS_AND_ANSWERS}
element={<RateQuestionResponse />}
/>
<Route
path={RoutesRecord.RATES_UPLOAD_QUESTION}
element={<UploadRateQuestions />}
/>
{/*This route will cause the RateSummarySideNav to redirect to rate summary Q&A page*/}
<Route
path={
RoutesRecord.SUBMISSIONS_RATE_QUESTIONS_AND_ANSWERS
}
/>
</Route>

<Route
path={RoutesRecord.SUBMISSIONS_MCCRSID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ describe('ContractQuestionResponse', () => {
routerProvider: {
route: '/submissions/test-contract-id/question-and-answers',
},
featureFlags: {
'qa-by-rates': true,
},
}
)

Expand Down Expand Up @@ -183,9 +180,6 @@ describe('ContractQuestionResponse', () => {
routerProvider: {
route: '/submissions/15/question-and-answers',
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down Expand Up @@ -219,9 +213,6 @@ describe('ContractQuestionResponse', () => {
routerProvider: {
route: '/submissions/15/question-and-answers',
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down Expand Up @@ -295,9 +286,6 @@ describe('ContractQuestionResponse', () => {
routerProvider: {
route: `/submissions/test-contract-id/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down Expand Up @@ -338,9 +326,6 @@ describe('ContractQuestionResponse', () => {
routerProvider: {
route: `/submissions/test-contract-id/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down Expand Up @@ -450,9 +435,6 @@ describe('ContractQuestionResponse', () => {
routerProvider: {
route: `/submissions/test-contract-id/question-and-answers?submit=question`,
},
featureFlags: {
'qa-by-rates': true,
},
}
)

Expand All @@ -479,9 +461,6 @@ describe('ContractQuestionResponse', () => {
routerProvider: {
route: `/submissions/not-real/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand All @@ -504,9 +483,6 @@ describe('ContractQuestionResponse', () => {
routerProvider: {
route: `/submissions/${contract.id}/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand All @@ -531,9 +507,6 @@ describe('ContractQuestionResponse', () => {
routerProvider: {
route: `/submissions/${contract.id}/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: '/submissions/15/rates/second-rate/question-and-answers',
},
featureFlags: {
'qa-by-rates': true,
},
})

// Wait for sidebar nav to exist.
Expand Down Expand Up @@ -131,9 +128,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: '/submissions/15/rates/test-rate-id/question-and-answers',
},
featureFlags: {
'qa-by-rates': true,
},
}
)

Expand Down Expand Up @@ -251,9 +245,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: '/submissions/15/rates/second-rate/question-and-answers',
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down Expand Up @@ -287,9 +278,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: '/submissions/15/rates/second-rate/question-and-answers',
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down Expand Up @@ -353,9 +341,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: `/rates/test-rate-id/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down Expand Up @@ -389,9 +374,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: `/rates/test-rate-id/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down Expand Up @@ -492,9 +474,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: `/rates/test-rate-id/question-and-answers?submit=question`,
},
featureFlags: {
'qa-by-rates': true,
},
}
)

Expand All @@ -521,9 +500,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: `/rates/not-real/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand All @@ -546,9 +522,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: `/rates/${rate.id}/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand All @@ -573,9 +546,6 @@ describe('RateQuestionResponse', () => {
routerProvider: {
route: `/rates/${rate.id}/question-and-answers`,
},
featureFlags: {
'qa-by-rates': true,
},
})

await waitFor(() => {
Expand Down
27 changes: 0 additions & 27 deletions services/app-web/src/pages/RateSummary/RateSummary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,33 +149,6 @@ describe('RateSummary', () => {
expect(error).toHaveBeenCalled()
})
})

it('renders back to dashboard link for CMS users', async () => {
renderWithProviders(wrapInRoutes(<RateSummary />), {
apolloProvider: {
mocks: [
fetchCurrentUserMock({
user: mockUser(),
statusCode: 200,
}),
fetchRateMockSuccess({ id: '7a' }),
],
},
routerProvider: {
route: '/rates/7a',
},
})

const backLink = await screen.findByRole('link', {
name: /Back to dashboard/,
})
expect(backLink).toBeInTheDocument()

expect(backLink).toHaveAttribute(
'href',
'/dashboard/rate-reviews'
)
})
}
)

Expand Down
Loading

0 comments on commit a844dcf

Please sign in to comment.