diff --git a/packages/pn-pa-webapp/src/components/NewNotification/PreliminaryInformations.tsx b/packages/pn-pa-webapp/src/components/NewNotification/PreliminaryInformations.tsx index e74105ae13..275cbd666f 100644 --- a/packages/pn-pa-webapp/src/components/NewNotification/PreliminaryInformations.tsx +++ b/packages/pn-pa-webapp/src/components/NewNotification/PreliminaryInformations.tsx @@ -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 @@ -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')}`) @@ -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) || diff --git a/packages/pn-pa-webapp/src/redux/auth/reducers.ts b/packages/pn-pa-webapp/src/redux/auth/reducers.ts index a7794bb095..eb7a536125 100644 --- a/packages/pn-pa-webapp/src/redux/auth/reducers.ts +++ b/packages/pn-pa-webapp/src/redux/auth/reducers.ts @@ -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;