Skip to content

Commit

Permalink
Fix : Fixed Workbench landing screen (#158)
Browse files Browse the repository at this point in the history
* Fix : Fixed Workbench landing screen

* Incremented digit-ui-module-core version

* Incremented  version of core module
  • Loading branch information
ashish-egov authored Feb 23, 2024
1 parent 43d8b31 commit c969475
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 43 deletions.
8 changes: 4 additions & 4 deletions micro-ui/web/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.1-beta.1",
"@egovernments/digit-ui-module-workbench": "1.0.1-beta.1",
"@egovernments/digit-ui-module-core": "1.8.1-beta.3",
"@egovernments/digit-ui-module-core": "1.8.1-beta.4",
"@egovernments/digit-ui-module-hrms": "1.8.0",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.1",
"@egovernments/digit-ui-react-components": "1.8.1-beta.2",
Expand Down Expand Up @@ -47,12 +47,12 @@
"npm-run-all": "4.1.5",
"prettier": "2.1.2"
},
"resolutions": {
"resolutions": {
"**/babel-loader": "8.2.2",
"**/@babel/core": "7.14.0",
"**/@babel/preset-env": "7.14.0",
"**/@babel/plugin-transform-modules-commonjs": "7.14.0",
"**/polished":"4.2.2"
"**/polished": "4.2.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -80,4 +80,4 @@
"last 1 safari version"
]
}
}
}
4 changes: 2 additions & 2 deletions micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@egovernments/digit-ui-libraries": "1.8.1-beta.1",
"@egovernments/digit-ui-module-workbench": "1.0.1-beta.1",
"@egovernments/digit-ui-module-dss": "1.8.0",
"@egovernments/digit-ui-module-core": "1.8.1-beta.3",
"@egovernments/digit-ui-module-core": "1.8.1-beta.4",
"@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.1",
Expand All @@ -37,4 +37,4 @@
"last 1 safari version"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ and add its related functions
### Changelog

```bash
1.8.1-beta.4 Added a null check for homescreen landing issue
1.8.1-beta.3 User profile back button fixes for mobile view
1.8.1-beta.2 User profile Save and change password button fixes for mobile view
1.8.1-beta.1 Republished after merging with Master due to version issues.
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.1-beta.3",
"version": "1.8.1-beta.4",
"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 @@ -21,14 +21,18 @@ import { set } from "lodash";
import { useHistory, useLocation, Link } from "react-router-dom";
import { useTranslation } from "react-i18next";

const DIGIT_UI_CONTEXTS = ["digit-ui", "works-ui", "workbench-ui", "health-ui", "sanitation-ui", "core-ui","mgramseva-web"];
const DIGIT_UI_CONTEXTS = ["digit-ui", "works-ui", "workbench-ui", "health-ui", "sanitation-ui", "core-ui", "mgramseva-web"];

// Function to recursively get the key of a nested object based on a parent key
const getKey = (obj, parent) => {
if (typeof obj !== 'object' || obj === null) {
// If obj is not an object or is null, return null
return null;
}
// Use Object.keys to get an array of keys in the object
const key = Object.keys(obj).map((key) =>
const key = Object.keys(obj).map((key) =>
// Check if the object has an 'item' property with a 'path' property
obj[key]?.item?.path?.split(parent ? `${parent}.${key}` : `.${key}`) ||
obj[key]?.item?.path?.split(parent ? `${parent}.${key}` : `.${key}`) ||
// If not, recursively call getKey on the nested object
getKey(obj[key], key)
);
Expand All @@ -41,9 +45,9 @@ const findKey = (key = "") => {
// Split the key string into an array using dot as a separator
const newSplitedList = key?.split(".");
// Check if the key string ends with a dot
return key?.endsWith?.(".") ?
return key?.endsWith?.(".") ?
// If it ends with a dot, return the first element of the array
newSplitedList[0] :
newSplitedList[0] :
// If not, return the last element of the array
newSplitedList[newSplitedList?.length - 1];
};
Expand Down Expand Up @@ -128,21 +132,21 @@ const Sidebar = ({ data }) => {
}
const renderSidebarItems = (items, parentKey = null, flag = true, level = 0) => {
/* added the logic to sort the side bar items based on the ordernumber */
const keysArray = Object.values(items)
.sort((x, y) => {
if (x?.item && y?.item) {
return x?.item?.orderNumber - y?.item?.orderNumber;
} else {
if (x?.[0] < y?.[0]) {
return -1;
}
if (x?.[0] > y?.[0]) {
return 1;
const keysArray = Object.values(items)
.sort((x, y) => {
if (x?.item && y?.item) {
return x?.item?.orderNumber - y?.item?.orderNumber;
} else {
if (x?.[0] < y?.[0]) {
return -1;
}
if (x?.[0] > y?.[0]) {
return 1;
}
return 0;
}
return 0;
}
})
.map((x) => (x?.item?.path && findKey(x?.item?.path)) || findKey(getKey(x)?.[0]));
})
.map((x) => (x?.item?.path && findKey(x?.item?.path)) || findKey(getKey(x)?.[0]));

return (
<div className={`submenu-container level-${level}`}>
Expand Down Expand Up @@ -173,21 +177,21 @@ const Sidebar = ({ data }) => {
style={{ display: "flex", flexDirection: "column", alignItems: "flex-start" }}
>
<div
className={`actions ${isChildActive && level===1? `selected-action-level-1` :isParentActive? `default-${level} active` : `default-${level}`}`}
className={`actions ${isChildActive && level === 1 ? `selected-action-level-1` : isParentActive ? `default-${level} active` : `default-${level}`}`}
// className={`actions`}

onClick={(e) => {
toggleSidebar(key);
setSelectedParent((prevItem)=> {
if(prevItem===itemKey ){
setSelectedParent((prevItem) => {
if (prevItem === itemKey) {
return null
}
else return itemKey
else return itemKey

});
const itemToHighlight = e.target.innerText
setSelectedChildLevelOne((prevItem)=>{
if(prevItem===itemToHighlight || isSubItemOpen){
setSelectedChildLevelOne((prevItem) => {
if (prevItem === itemToHighlight || isSubItemOpen) {
return null
}
else return itemToHighlight
Expand All @@ -212,7 +216,7 @@ const Sidebar = ({ data }) => {
</ReactTooltip>
)}
</div>
<div style={{ position: "relative", marginLeft: "auto" }} className={`arrow ${isSubItemOpen && subNav ? "" : ""} ${isChildActive && level===1? "selected-arrow" : ""} `}>
<div style={{ position: "relative", marginLeft: "auto" }} className={`arrow ${isSubItemOpen && subNav ? "" : ""} ${isChildActive && level === 1 ? "selected-arrow" : ""} `}>
{isSubItemOpen ? <ArrowVectorDown height="28px" width="28px" /> : <ArrowForward />}
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@egovernments/digit-ui-libraries": "1.8.1-beta.1",
"@egovernments/digit-ui-module-workbench": "1.0.1-beta.1",
"@egovernments/digit-ui-module-dss": "1.8.0",
"@egovernments/digit-ui-module-core": "1.8.1-beta.3",
"@egovernments/digit-ui-module-core": "1.8.1-beta.4",
"@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.1",
Expand Down Expand Up @@ -55,12 +55,12 @@
"npm-run-all": "4.1.5",
"prettier": "2.1.2"
},
"resolutions": {
"resolutions": {
"**/babel-loader": "8.2.2",
"**/@babel/core": "7.14.0",
"**/@babel/preset-env": "7.14.0",
"**/@babel/plugin-transform-modules-commonjs": "7.14.0",
"**/polished":"4.2.2"
"**/polished": "4.2.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -88,4 +88,4 @@
"last 1 safari version"
]
}
}
}
8 changes: 4 additions & 4 deletions micro-ui/web/workbench/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.1-beta.1",
"@egovernments/digit-ui-module-workbench": "1.0.1-beta.1",
"@egovernments/digit-ui-module-core": "1.8.1-beta.3",
"@egovernments/digit-ui-module-core": "1.8.1-beta.4",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.1",
"@egovernments/digit-ui-react-components": "1.8.1-beta.2",
"babel-loader": "8.1.0",
Expand Down Expand Up @@ -45,12 +45,12 @@
"npm-run-all": "4.1.5",
"prettier": "2.1.2"
},
"resolutions": {
"resolutions": {
"**/babel-loader": "8.2.2",
"**/@babel/core": "7.14.0",
"**/@babel/preset-env": "7.14.0",
"**/@babel/plugin-transform-modules-commonjs": "7.14.0",
"**/polished":"4.2.2"
"**/polished": "4.2.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -78,4 +78,4 @@
"last 1 safari version"
]
}
}
}

0 comments on commit c969475

Please sign in to comment.