Skip to content

Commit

Permalink
remove mccrs-record-number flag, delete button and blank entry valida…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
pearl-truss committed Oct 25, 2023
1 parent ba5e2e4 commit 7130786
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 93 deletions.
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 @@ -41,13 +41,6 @@ const featureFlags = {
flag: 'cms-questions',
defaultValue: false,
},
/**
* Enables CMS users to add, view, edit and delete MC-CRS record numbers
*/
MCCRS_RECORD_NUMBER: {
flag: 'mccrs-record-number',
defaultValue: false,
},
/**
* Enables packages with shared rates dropdown on rate details page. This was an early version of rates across subs functionality.
*/
Expand Down
9 changes: 2 additions & 7 deletions services/app-web/src/pages/App/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ const CMSUserRoutes = ({
featureFlags.RATE_REVIEWS_DASHBOARD.defaultValue
)

const showMCCRSRecordNumber = ldClient?.variation(
featureFlags.MCCRS_RECORD_NUMBER.flag,
featureFlags.MCCRS_RECORD_NUMBER.defaultValue
)

return (
<AuthenticatedRouteWrapper authMode={authMode} setAlert={setAlert}>
<Routes>
Expand Down Expand Up @@ -212,12 +207,12 @@ const CMSUserRoutes = ({
path={RoutesRecord.SUBMISSIONS_SUMMARY}
element={<SubmissionSummary />}
/>
{showMCCRSRecordNumber && (
{
<Route
path={RoutesRecord.SUBMISSIONS_MCCRSID}
element={<MccrsId />}
/>
)}
}
</Route>

<Route
Expand Down
12 changes: 1 addition & 11 deletions services/app-web/src/pages/MccrsId/MccrsId.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,12 @@ div[class^='usa-hint'] span {
}

ul[class^='usa-button-group'] {
justify-content: space-between;
justify-content: end;
li[class^='usa-button-group__item'] {
margin-top: 0;
button {
margin-top: 16px;
margin-bottom: 44px;
}
&:first-of-type {
button[class^='usa-button'] {
display: none;
visibility: hidden;
color: $theme-color-error-darker;
box-shadow: inset 0 0 0 2px $theme-color-error-darker;
}
}
&:last-of-type {
margin-right: .25rem;
}
}
Expand Down
49 changes: 1 addition & 48 deletions services/app-web/src/pages/MccrsId/MccrsId.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@ import {
fetchStateHealthPlanPackageWithQuestionsMockSuccess,
mockValidCMSUser,
} from '../../testHelpers/apolloMocks'
import {
ldUseClientSpy,
renderWithProviders,
} from '../../testHelpers/jestHelpers'
import { renderWithProviders } from '../../testHelpers/jestHelpers'
import { MccrsId } from './MccrsId'

describe('MCCRSID', () => {
beforeEach(() => {
ldUseClientSpy({ 'mccrs-record-number': true })
})
afterEach(() => {
jest.resetAllMocks()
})
Expand Down Expand Up @@ -89,47 +83,6 @@ describe('MCCRSID', () => {
expect(await screen.findByTestId('textInput')).toBeInTheDocument()
})

it('cannot continue without providing a MCCRS ID', async () => {
renderWithProviders(
<Routes>
<Route element={<SubmissionSideNav />}>
<Route
path={RoutesRecord.SUBMISSIONS_MCCRSID}
element={<MccrsId />}
/>
</Route>
</Routes>,
{
apolloProvider: {
mocks: [
fetchCurrentUserMock({
user: mockValidCMSUser(),
statusCode: 200,
}),
fetchStateHealthPlanPackageWithQuestionsMockSuccess({
id: '15',
}),
],
},
routerProvider: {
route: '/submissions/15/mccrs-record-number',
},
}
)
const continueButton = await screen.findByRole('button', {
name: 'Save MC-CRS number',
})
continueButton.click()
await waitFor(() => {
expect(
screen.getAllByText(
'You must enter a record number or delete this field.'
)
).toHaveLength(1)
expect(continueButton).toHaveAttribute('aria-disabled', 'true')
})
})

it('cannot continue with MCCRS ID with non number input', async () => {
renderWithProviders(
<Routes>
Expand Down
10 changes: 0 additions & 10 deletions services/app-web/src/pages/MccrsId/MccrsId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,6 @@ export const MccrsId = (): React.ReactElement => {
/>
</fieldset>
<ButtonGroup type="default">
<ActionButton
type="button"
variant="outline"
secondary
data-testid="page-actions-left-secondary"
onClick={() => console.info('delete')}
>
Delete Number
</ActionButton>

<ActionButton
type="submit"
variant="default"
Expand Down
4 changes: 1 addition & 3 deletions services/app-web/src/pages/MccrsId/MccrsIdSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import * as Yup from 'yup'

export const MccrsIdFormSchema = () => {
return Yup.object().shape({
mccrsId: Yup.number()
.required('You must enter a record number or delete this field.')
.typeError('You must enter a number'),
mccrsId: Yup.number().typeError('You must enter a number'),
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { testS3Client } from '../../testHelpers/s3Helpers'
describe('SubmissionSummary', () => {
beforeEach(() => {
ldUseClientSpy({ 'cms-questions': false })
ldUseClientSpy({ 'mccrs-record-number': true })
})
afterEach(() => {
jest.resetAllMocks()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ export const SubmissionSummary = (): React.ReactElement => {
featureFlags.CMS_QUESTIONS.defaultValue
)

const showMCCRSRecordNumber = ldClient?.variation(
featureFlags.MCCRS_RECORD_NUMBER.flag,
featureFlags.MCCRS_RECORD_NUMBER.defaultValue
)

const { pkg, currentRevision, packageData, user, documentDates } =
useOutletContext<SideNavOutletContextType>()

Expand Down Expand Up @@ -167,7 +162,7 @@ export const SubmissionSummary = (): React.ReactElement => {

<SubmissionTypeSummarySection
subHeaderComponent={
isCMSUser && showMCCRSRecordNumber ? (
isCMSUser ? (
<div className={styles.subHeader}>
{pkg.mccrsID && (
<span>
Expand Down

0 comments on commit 7130786

Please sign in to comment.