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

fixed css and summary rerendering issue #1609

Merged
merged 1 commit into from
Oct 22, 2024
Merged
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 @@ -138,49 +138,49 @@ const Wrapper = ({ boundaryOptions, setShowPopUp, alreadyQueuedSelectedState, on
{t((hierarchyType + "_" + boundaryType).toUpperCase())}
<span className="mandatory-span">*</span>
</CardLabel>
<MultiSelectDropdown
t={t}
props={{ className: "selecting-boundaries-dropdown" }}
options={Object.entries(popUpOption)
.filter(([key]) => key.startsWith(boundaryType))
.flatMap(([key, value]) =>
Object.entries(value || {})
.filter(([subkey, item]) => {
const itemCode = item?.split(".")?.[0];
if (frozenData?.length > 0) {
const isFrozen = frozenData.some((frozenOption) => {
return (
frozenOption.code === subkey && frozenOption.type === boundaryType
);
});
return frozenType === "filter" ? !isFrozen : true; // Filter or include based on frozenType
}
return true;
})
.map(([subkey, item]) => ({
code: item?.split(".")?.[0],
name: item?.split(".")?.[0],
options: [
{
code: subkey,
name: subkey,
type: boundaryType,
parent: `${item?.split(".")?.[0]}`,
},
],
}))
)}
onSelect={(value) => {
handleSelected(value);
}}
selected={dummySelected}
optionsKey={"code"}
addCategorySelectAllCheck={true}
addSelectAllCheck={true}
selectedNumber={dummySelected?.length}
variant="nestedmultiselect"
frozenData={frozenData}
/>
<div style={{ width: "100%" }}>
<MultiSelectDropdown
t={t}
props={{ className: "selecting-boundaries-dropdown" }}
options={Object.entries(popUpOption)
.filter(([key]) => key.startsWith(boundaryType))
.flatMap(([key, value]) =>
Object.entries(value || {})
.filter(([subkey, item]) => {
const itemCode = item?.split(".")?.[0];
if (frozenData?.length > 0) {
const isFrozen = frozenData.some((frozenOption) => {
return frozenOption.code === subkey && frozenOption.type === boundaryType;
});
return frozenType === "filter" ? !isFrozen : true; // Filter or include based on frozenType
}
return true;
})
.map(([subkey, item]) => ({
code: item?.split(".")?.[0],
name: item?.split(".")?.[0],
options: [
{
code: subkey,
name: subkey,
type: boundaryType,
parent: `${item?.split(".")?.[0]}`,
},
],
}))
)}
onSelect={(value) => {
handleSelected(value);
}}
selected={dummySelected}
optionsKey={"code"}
addCategorySelectAllCheck={true}
addSelectAllCheck={true}
selectedNumber={dummySelected?.length}
variant="nestedmultiselect"
frozenData={frozenData}
/>
</div>
</LabelFieldPair>

{Object.entries(
Expand Down Expand Up @@ -209,36 +209,36 @@ const Wrapper = ({ boundaryOptions, setShowPopUp, alreadyQueuedSelectedState, on
})}
</div>
{frozenData.length === 0 && (
<Button
label={t("Clear All")}
onClick={() => {
const updatedDummySelected = dummySelected.filter((item) => item?.propsData?.[1]?.parent !== parent);
setDummySelected(updatedDummySelected);
}}
// onClick={handleClearAll}
variation=""
style={{
height: "2rem",
minWidth: "4.188rem",
minHeight: "2rem",
padding: "0.5rem",
justifyContent: "center",
alignItems: "center",
borderRadius: "0.25rem",
border: "1px solid #C84C0E",
background: background,
marginTop: "1rem",
}}
textStyles={{
height: "auto",
fontSize: "0.875rem",
fontWeight: "400",
width: "100%",
lineHeight: "16px",
color: primaryIconColor,
}}
/>
)}
<Button
label={t("HCM_CLEAR_ALL")}
onClick={() => {
const updatedDummySelected = dummySelected.filter((item) => item?.propsData?.[1]?.parent !== parent);
setDummySelected(updatedDummySelected);
}}
// onClick={handleClearAll}
variation=""
style={{
height: "2rem",
minWidth: "4.188rem",
minHeight: "2rem",
padding: "0.5rem",
justifyContent: "center",
alignItems: "center",
borderRadius: "0.25rem",
border: "1px solid #C84C0E",
background: background,
marginTop: "1rem",
}}
textStyles={{
height: "auto",
fontSize: "0.875rem",
fontWeight: "400",
width: "100%",
lineHeight: "16px",
color: primaryIconColor,
}}
/>
)}
</div>
))}
</PopUp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1497,13 +1497,27 @@ const SetupCampaign = ({ hierarchyType, hierarchyData }) => {
function onActionSelect(action) {
setDisplayMenu(false);
switch (action) {
case "UPDATE_DATES":
case "HCM_UPDATE_DATES":
history.push(`/${window.contextPath}/employee/campaign/update-dates-boundary?id=${id}`, {
name: draftData?.campaignName,
projectId: draftData?.projectId,
data: draftData,
});
break;
case "HCM_CONFIGURE_APP":
history.push(`/${window.contextPath}/employee/campaign/checklist/search?name=${draftData?.campaignName}&campaignId=${draftData?.id}`, {
name: draftData?.campaignName,
projectId: draftData?.projectId,
data: draftData,
});
break;
case "HCM_UPDATE_CAMPAIGN":
history.push( `/${window.contextPath}/employee/campaign/update-campaign?key=1&parentId=${draftData?.id}`, {
name: draftData?.campaignName,
projectId: draftData?.projectId,
data: draftData,
});
break;
default:
break;
}
Expand Down Expand Up @@ -1552,8 +1566,9 @@ const SetupCampaign = ({ hierarchyType, hierarchyData }) => {
{displayMenu ? (
<Menu
options={[
"UPDATE_DATES",
// "CONFIGURE_APP"
"HCM_UPDATE_DATES",
"HCM_CONFIGURE_APP",
"HCM_UPDATE_CAMPAIGN",
]}
t={t}
onSelect={onActionSelect}
Expand Down