From b2e1c01dea6424029e99fca2a165ea9d8a38d89f Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 10 Dec 2024 15:07:02 +0000 Subject: [PATCH] rep defect 2 --- components/case/representation/index.js | 37 ++++++++++++++----------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/components/case/representation/index.js b/components/case/representation/index.js index d5fb1106..b79aba93 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -92,6 +92,13 @@ let MakeRepresentation = (props) => { let questionnaireCount = updateQuestionnaireCount(); + const isLPA = + props.props.accountDetails.accountDetails[ + "pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue" + ] == "LPA" + ? true + : false; + const setRepFileName = (values) => { //console.log("---------------\n", values); if ( @@ -177,28 +184,26 @@ let MakeRepresentation = (props) => { "_-_" + repType + "_-_" + - values.lastname.replace( - /[\s~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|_+=-]/g, - "" - ) + - "_" + - values.firstname.replace( - /[\s~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|_+=-]/g, - "" - ), + (isLPA + ? values.onBehalfOfLPA.replace( + /[\s~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|_+=-]/g, + "" + ) + : values.lastname.replace( + /[\s~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|_+=-]/g, + "" + ) + + "_" + + values.firstname.replace( + /[\s~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|_+=-]/g, + "" + )), }); } return values; }; - const isLPA = - props.props.accountDetails.accountDetails[ - "pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue" - ] == "LPA" - ? true - : false; - isLPA && setRepresentationCapacity("lpa"); currentType == "searchResultsObj"