Skip to content

Commit

Permalink
Popup for userAccess boundary area and toast message for assign unass…
Browse files Browse the repository at this point in the history
…ign (#1831)

* Changed localization

* Loc

* Changes for popup in userAccess

* changes
  • Loading branch information
abishekTa-egov authored Nov 14, 2024
1 parent 1ca8f46 commit 4c1e42f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
onSuccess: async (result) => {
setSelectedRows([]);
updateDetails(newDetails);
if(facilityAssignedStatus){
setShowToast({ key: "success", label: `${ t("UNASSIGNED_SUCESS")} ${details?.additionalDetails?.facilityName}`, transitionTime: 5000 });


}else{
setShowToast({ key: "success", label: `${ t("ASSIGNED_SUCESS")} ${details?.additionalDetails?.facilityName}`, transitionTime: 5000 });
}
},
onError: async (result) => {
// setDownloadError(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function UserAccess({ category, setData, nationalRoles }) {
const queryClient = useQueryClient();
const [showPopUp, setShowPopUp] = useState(null);
const [chipPopUp, setChipPopUp] = useState(null);
const [chipPopUpRowId, setChipPopUpRowId] = useState(null);
const [showToast, setShowToast] = useState(null);
const [currentPage, setCurrentPage] = useState(1);
const [rowsPerPage, setRowsPerPage] = useState(5);
Expand Down Expand Up @@ -172,7 +173,7 @@ function UserAccess({ category, setData, nationalRoles }) {
{row.jurisdiction.length > 2 && (
<Button
label={`+${row.jurisdiction.length - 2} ${t("ES_MORE")}`}
onClick={() => setChipPopUp(true)}
onClick={() => setChipPopUpRowId(row.id)}
variation="link"
style={{
height: "2rem",
Expand All @@ -193,7 +194,9 @@ function UserAccess({ category, setData, nationalRoles }) {
/>
)}

{chipPopUp && <Wrapper setShowPopUp={setChipPopUp} alreadyQueuedSelectedState={row.jurisdiction} />}
{chipPopUpRowId === row.id && (
<Wrapper setShowPopUp={setChipPopUpRowId} alreadyQueuedSelectedState={row.jurisdiction} />
)}
</>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const defaultSearchValues = {
defaultValues: defaultSearchValues, // Set default values for search fields
fields: [
{
label: "Name of the microplan",
label: "MP_NAME_OF_MICROPLAN_OPEN_MICROPLANS",
isMandatory: false,
key: "microplanName",
type: "text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const defaultSearchValues = {
defaultValues: defaultSearchValues, // Set default values for search fields
fields: [
{
label: "Name of the microplan",
label: "MP_NAME_OF_MICROPLAN_MY_MICROPLANS",
isMandatory: false,
key: "microplanName",
type: "text",
Expand Down

0 comments on commit 4c1e42f

Please sign in to comment.