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

added fixes for sort, view summary issue, no results in dropdown #1916

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -822,8 +822,18 @@ const MultiSelectDropdown = ({
const Menu = () => {
const optionsToRender = variant === "nestedmultiselect" ? flattenedOptions : filteredOptions;

if (!optionsToRender) {
return null;
if (!optionsToRender || optionsToRender?.length === 0) {
return (
<div
className={`digit-multiselectdropodwn-menuitem ${
variant ? variant : ""
} unsuccessfulresults`}
key={"-1"}
onClick={() => {}}
>
{<span> {t("NO_RESULTS_FOUND")}</span>}
</div>
Swathi-eGov marked this conversation as resolved.
Show resolved Hide resolved
);
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const PopInboxTable = ({ ...props }) => {
) : (
t("ES_COMMON_NA")
),
sortable: true,
sortable: false,
width: "180px",
},
...(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Loader, TooltipWrapper } from "@egovernments/digit-ui-components";
import { InfoBannerIcon } from "@egovernments/digit-ui-react-components";

import { InfoOutline } from "@egovernments/digit-ui-svg-components";
Swathi-eGov marked this conversation as resolved.
Show resolved Hide resolved

const VillageHierarchyTooltipWrapper = ({ boundaryCode,placement="right",wrapperClassName}) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -119,7 +119,7 @@ const VillageHierarchyTooltipWrapper = ({ boundaryCode,placement="right",wrapper
description={tooltipContent}
wrapperClassName={wrapperClassName || ""}
>
<InfoBannerIcon fill={"#C84C0E"} />
<InfoOutline fill={"#C84C0E"} width={"20px"} height={"20px"} />
</TooltipWrapper>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const facilityMappingConfig = (projectType, disabledAction) => {
},
fields: [
{
label: "MICROPLAN_FACILITY_NAME",
label: "MICROPLAN_FACILITY_NAME_LABEL",
type: "text",
isMandatory: false,
disable: false,
Expand All @@ -54,7 +54,7 @@ const facilityMappingConfig = (projectType, disabledAction) => {
},
},
{
label: "MICROPLAN_FACILITY_TYPE",
label: "MICROPLAN_FACILITY_TYPE_LABEL",
type: "dropdown",
isMandatory: false,
disable: false,
Expand All @@ -68,7 +68,7 @@ const facilityMappingConfig = (projectType, disabledAction) => {
},
},
{
label: "CORE_COMMON_STATUS",
label: "CORE_COMMON_STATUS_LABEL",
type: "dropdown",
isMandatory: false,
disable: false,
Expand All @@ -82,7 +82,7 @@ const facilityMappingConfig = (projectType, disabledAction) => {
},
},
{
label: "MICROPLAN_RESIDING_VILLAGE",
label: "MICROPLAN_RESIDING_VILLAGE_LABEL",
type: "apidropdown",
isMandatory: false,
disable: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ const PlanInbox = () => {
return {
name: t(i?.question),
cell: (row) => row?.[`securityDetail_${i?.question}`] || t("ES_COMMON_NA"),
sortable: true,
sortable: false,
width: "180px",
};
});
Expand All @@ -530,6 +530,13 @@ const PlanInbox = () => {
),
// cell: (row) => t(row?.village) || "NA",
sortable: true,
sortFunction: (rowA, rowB) => {
const villageA = t(rowA?.village).toLowerCase();
const villageB = t(rowB?.village).toLowerCase();
if (villageA < villageB) return -1;
if (villageA > villageB) return 1;
return 0;
},
nipunarora-eGov marked this conversation as resolved.
Show resolved Hide resolved
width: "180px",
},
{
Expand Down Expand Up @@ -562,24 +569,45 @@ const PlanInbox = () => {
) : (
t("ES_COMMON_NA")
),
sortable: true,
sortable: false,
width: "180px",
},
{
name: t(`HCM_MICROPLAN_SERVING_FACILITY`),
cell: (row) => t(row?.servingFacility) || "NA",
sortFunction: (rowA, rowB) => {
const facilityA = t(rowA?.servingFacility).toLowerCase();
const facilityB = t(rowB?.servingFacility).toLowerCase();
if (facilityA < facilityB) return -1;
if (facilityA > facilityB) return 1;
return 0;
},
sortable: true,
width: "180px",
},
{
name: t(`HCM_MICROPLAN_VILLAGE_ROAD_CONDITION_LABEL`),
cell: (row) => t(row?.villageRoadCondition) || "NA",
sortFunction: (rowA, rowB) => {
const villageRoadConditionA = t(rowA?.villageRoadCondition).toLowerCase();
const villageRoadConditionB = t(rowB?.villageRoadCondition).toLowerCase();
if (villageRoadConditionA < villageRoadConditionB) return -1;
if (villageRoadConditionA > villageRoadConditionB) return 1;
return 0;
},
sortable: true,
width: "180px",
},
{
name: t(`HCM_MICROPLAN_VILLAGE_TERRAIN_LABEL`),
cell: (row) => t(row?.villageTerrain) || "NA",
sortFunction: (rowA, rowB) => {
const villageTerrainA = t(rowA?.villageTerrain).toLowerCase();
const villageTerrainB = t(rowB?.villageTerrain).toLowerCase();
if (villageTerrainA < villageTerrainB) return -1;
if (villageTerrainA > villageTerrainB) return 1;
return 0;
},
sortable: true,
width: "180px",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,13 @@ const SetupMicroplan = ({ hierarchyType, hierarchyData }) => {
<ActionBar
style={{ zIndex: "19" }}
setactionFieldsToRight
actionFields={[<Button label={t("GO_BACK_TO_MY_MICROPLAN")} onClick={() => history.goBack()} />]}
actionFields={[
<Button
label={t("GO_BACK_TO_MY_MICROPLAN")}
// onClick={() => history.goBack()}
onClick={() => history.push(`/${window.contextPath}/employee/microplan/microplan-search`)}
Swathi-eGov marked this conversation as resolved.
Show resolved Hide resolved
/>,
]}
Swathi-eGov marked this conversation as resolved.
Show resolved Hide resolved
/>
) : null}
{showToast && (
Expand Down