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

updated citizensidebar #1353

Merged
merged 1 commit into from
Sep 4, 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
2 changes: 1 addition & 1 deletion micro-ui/web/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@egovernments/digit-ui-components": "0.0.2-beta.31",
"@egovernments/digit-ui-libraries": "1.8.2-beta.7",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-module-core": "1.8.2-beta.17",
"@egovernments/digit-ui-module-core": "1.8.2-beta.18",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.39",
"@egovernments/digit-ui-module-open-payment":"0.0.1",
"@egovernments/digit-ui-module-hrms": "1.8.1-beta.1",
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-module-pgr": "1.8.1-beta.1",
"@egovernments/digit-ui-module-dss": "1.8.1",
"@egovernments/digit-ui-module-core": "1.8.2-beta.17",
"@egovernments/digit-ui-module-core": "1.8.2-beta.18",
"@egovernments/digit-ui-module-common": "1.8.0",
"@egovernments/digit-ui-module-hrms": "1.8.0",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.39",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-core",
"version": "1.8.2-beta.17",
"version": "1.8.2-beta.18",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const EmployeeHome = ({ modules, additionalComponent }) => {
<>
<div className="employee-app-container digit-home-employee-app">
<div className="ground-container moduleCardWrapper gridModuleWrapper digit-home-moduleCardWrapper">
{modules.map(({ code }, index) => {
{modules?.map(({ code }, index) => {
const Card =
Digit.ComponentRegistryService.getComponent(`${code}Card`) ||
(() => <React.Fragment />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Profile = ({ info, stateName, t }) => {
{}
);

if (usersResponse && usersResponse.user && usersResponse.user.length) {
if (usersResponse && usersResponse.user && usersResponse?.user?.length) {
const userDetails = usersResponse.user[0];
const thumbs = userDetails?.photo?.split(",");
setProfilePic(thumbs?.at(0));
Expand Down Expand Up @@ -127,7 +127,7 @@ export const CitizenSideBar = ({
const uuid = user?.info?.uuid;
if (uuid) {
const usersResponse = await Digit.UserService.userSearch(tenant, { uuid: [uuid] }, {});
if (usersResponse && usersResponse.user && usersResponse.user.length) {
if (usersResponse && usersResponse.user && usersResponse?.user?.length) {
const userDetails = usersResponse.user[0];
const thumbs = userDetails?.photo?.split(",");
setProfilePic(thumbs?.at(0));
Expand Down Expand Up @@ -234,7 +234,7 @@ export const CitizenSideBar = ({
}
});
const keys = Object.keys(configEmployeeSideBar);
for (let i = 0; i < keys.length; i++) {
for (let i = 0; i < keys?.length; i++) {
const getSingleDisplayName = configEmployeeSideBar[
keys[i]
][0]?.displayName
Expand Down Expand Up @@ -294,7 +294,7 @@ export const CitizenSideBar = ({
menuItems = menuItems.filter((ele) => ele.element === "LANGUAGE");
}

menuItems = menuItems.map((item) => ({
menuItems = menuItems?.map((item) => ({
...item,
label: item?.text || item?.moduleName || "",
icon: item?.icon ? item?.icon : undefined
Expand Down Expand Up @@ -329,28 +329,28 @@ export const CitizenSideBar = ({
}
};

const transformedMenuItems = menuItems.map((item) => {
const transformedMenuItems = menuItems?.map((item) => {
if (item?.type === "dynamic") {
return {
...item,
children: item.links.map((link) => ({
children: item?.links?.map((link) => ({
...link,
label: link?.displayName,
icon: link.leftIcon,
icon: link?.leftIcon,
})),
};
} else {
return item;
}
});

const transformedSelectedCityData = selectCityData.map((city) => ({
const transformedSelectedCityData = selectCityData?.map((city) => ({
...city,
type: "custom",
key:"city"
}));

const transformedLanguageData = languages.map((language) => ({
const transformedLanguageData = languages?.map((language) => ({
...language,
type: "custom",
key:"language"
Expand All @@ -360,13 +360,13 @@ export const CitizenSideBar = ({
{
label:city,
value:city,
children: transformedSelectedCityData.length>0 ? transformedSelectedCityData : undefined,
children: transformedSelectedCityData?.length>0 ? transformedSelectedCityData : undefined,
type:"custom",
key:"city"
},
{
label: t("Language"),
children: transformedLanguageData.length>0 ? transformedLanguageData: undefined,
children: transformedLanguageData?.length>0 ? transformedLanguageData: undefined,
type:"custom",
key:"language"
},
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.7",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-module-core": "1.8.2-beta.17",
"@egovernments/digit-ui-module-core": "1.8.2-beta.18",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.39",
"@egovernments/digit-ui-module-open-payment":"0.0.1",
"@egovernments/digit-ui-module-hrms": "1.8.1-beta.1",
Expand Down