Skip to content

Commit

Permalink
feat(PN-10623): use rootParent in senderDenomination
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahDonvito committed Apr 19, 2024
1 parent 2b2aaba commit a4f6182
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const PreliminaryInformations = ({ notification, onConfirm }: Props) => {
);

const senderDenomination = useAppSelector((state: RootState) =>
state.userState.user.organization.parentDescription
? state.userState.user.organization.parentDescription +
state.userState.user.organization.rootParent?.description
? state.userState.user.organization.rootParent?.description +
' - ' +
state.userState.user.organization.name
: state.userState.user.organization.name
Expand Down Expand Up @@ -85,7 +85,6 @@ const PreliminaryInformations = ({ notification, onConfirm }: Props) => {
const validationSchema = yup.object({
paProtocolNumber: requiredStringFieldValidation(tc, 256),
subject: requiredStringFieldValidation(tc, 134, 10),
// senderDenomination: requiredStringFieldValidation(tc, 80),
senderDenomination: yup
.string()
.required(`${t('sender-denomination')} ${tc('required')}`)
Expand Down Expand Up @@ -184,7 +183,7 @@ const PreliminaryInformations = ({ notification, onConfirm }: Props) => {
!isLessThan80Chars(formik.values.senderDenomination) &&
Boolean(formik.errors.senderDenomination)
}
disabled={isLessThan80Chars(notification.senderDenomination)}
disabled={isLessThan80Chars(senderDenomination)}
helperText={
(!isLessThan80Chars(formik.values.senderDenomination) &&
formik.errors.senderDenomination) ||
Expand Down
8 changes: 4 additions & 4 deletions packages/pn-pa-webapp/src/redux/auth/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ const userSlice = createSlice({
});
builder.addCase(getInstitutions.fulfilled, (state, action) => {
state.institutions = action.payload;
const currentInstitutionParentName = state.institutions.find(
(e) => e.id === state.user.organization.id
)?.parentName;
state.user.organization.parentDescription = currentInstitutionParentName;
// const currentInstitutionParentName = state.institutions.find(
// (e) => e.id === state.user.organization.id
// )?.parentName;
// state.user.organization.parentDescription = currentInstitutionParentName;
});
builder.addCase(getProductsOfInstitution.fulfilled, (state, action) => {
state.productsOfInstitution = action.payload;
Expand Down

0 comments on commit a4f6182

Please sign in to comment.