Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Update your Financial Profile] Disable RSSD ID, changes order of UFP elements #967

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ import type {
import type { InstitutionDetailsApiType } from 'types/formTypes';
import { formatFederalRegulator } from 'utils/formatting';
import { FormSectionWrapper } from '../../../components/FormSectionWrapper';
import { DisplayField } from '../ViewInstitutionProfile/DisplayField';
import {
DisplayField,
NOT_APPLICABLE,
} from '../ViewInstitutionProfile/DisplayField';
import InstitutionDataLabels, { InstitutionHelperText } from '../formHelpers';
import TypesFinancialInstitutionSection from './TypesFinancialInstitutionSection';
import { processRssdId } from './processRssdId';
import type { UpdateInstitutionType } from './types';

const taxID = 'tax_id';
const rssdID = 'rssd_id';
// const rssdID = 'rssd_id';

function FieldFederalPrudentialRegulator({
data,
Expand All @@ -33,6 +35,7 @@ function FieldFederalPrudentialRegulator({
<DisplayField
label='Federal prudential regulator'
value={formatFederalRegulator(data)}
fallbackValue={NOT_APPLICABLE}
/>
<input
hidden
Expand Down Expand Up @@ -64,18 +67,20 @@ function UpdateIdentifyingInformation({
watch: UseFormWatch<UpdateInstitutionType>;
}): JSXElement {
// setValueAs leaves displayed value out of sync with saved value
const rssdIdValue = watch(rssdID);
// const rssdIdValue = watch(rssdID);

return (
<FormSectionWrapper>
<SectionIntro heading='Update your financial institution identifying information'>
If your financial institution has a Research, Statistics, Supervision,
Discount Identification (RSSD ID) number, provide it here and we will
pull your Federal Taxpayer Identification Number (TIN) and Federal
prudential regulator from NIC. If not, provide your TIN.
If your financial institution does not have an RSSD ID, provide your TIN
below. If your financial institution has an RSSD ID number and “Not
applicable” is shown below, contact your primary federal regulator,
state regulator, or reserve bank to link your LEI to your RSSD ID in
NIC. Once updated in NIC, we will populate the data in our system
accordingly.
</SectionIntro>
<WellContainer className='u-mt30'>
<InputEntry
{/* <InputEntry
id={rssdID}
label={InstitutionDataLabels.rssd}
helperText={InstitutionHelperText.rssd}
Expand All @@ -85,7 +90,8 @@ function UpdateIdentifyingInformation({
value={rssdIdValue}
errorMessage={formErrors[rssdID]?.message}
showError
/>
/> */}

<InputEntry
id={taxID}
label={InstitutionDataLabels.tin}
Expand All @@ -94,12 +100,17 @@ function UpdateIdentifyingInformation({
errorMessage={formErrors[taxID]?.message}
showError
/>
<DisplayField
label={InstitutionDataLabels.rssd}
value={data.rssd_id}
fallbackValue='Not Applicable'
/>
<FieldFederalPrudentialRegulator {...{ register, data }} />
</WellContainer>
<SectionIntro className='mb-[1.875rem] mt-[2.8125rem]'>
Select all applicable types of financial institutions from the list
below. If the enumerated types do not appropriately describe your
institution, or if you wish to add additional types, select
financial institution, or if you wish to add additional types, select
&quot;Other&quot; and add your entry to the text field. Separate
multiple entries with a comma.
</SectionIntro>
Expand Down
1 change: 1 addition & 0 deletions src/pages/Filing/ViewInstitutionProfile/DisplayField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ReactNode } from 'react';
import './DisplayField.less';

export const NOT_AVAILABLE = 'Not available';
export const NOT_APPLICABLE = 'Not applicable';

export interface DisplayFieldProperties {
label?: ReactNode;
Expand Down
1 change: 1 addition & 0 deletions src/types/formTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const institutionDetailsApiTypeSchema = z.object({
}),
z.string().regex(/^\d+$|^$/, { message: IdZodSchemaErrors.rssd_idRegex }),
])
.nullable()
.optional(),
primary_federal_regulator: z.object({
id: z.string().nullable(),
Expand Down
7 changes: 5 additions & 2 deletions src/utils/formatting.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { NOT_AVAILABLE } from 'pages/Filing/ViewInstitutionProfile/DisplayField';
import {
NOT_APPLICABLE,
NOT_AVAILABLE,
} from 'pages/Filing/ViewInstitutionProfile/DisplayField';
import type { DomainType, InstitutionDetailsApiType } from 'types/formTypes';

export const buildEmailDomainString = (
Expand All @@ -19,4 +22,4 @@ export const formatFederalRegulator = (
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
data.primary_federal_regulator
? `${data.primary_federal_regulator.name} (${data.primary_federal_regulator.id})`
: NOT_AVAILABLE;
: NOT_APPLICABLE;