-
Notifications
You must be signed in to change notification settings - Fork 21
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
BUGFIX/HCMPRE-1634: fix for versions #149 #158 #2031
Changes from all commits
4a5ac8f
04ab210
39d584b
5cc1b9e
8617dae
f707980
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ | |
<meta name="theme-color" content="#00bcd1" /> | ||
<title>DIGIT</title> | ||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.3/dist/index.css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.42/dist/index.css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.2.2/dist/index.css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.43/dist/index.css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.2.3/dist/index.css" /> | ||
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Consider adding integrity hashes for CDN resources While using unpkg.com CDN is common, it's recommended to add integrity hashes to prevent potential security risks from CDN compromises. Example implementation: <link rel="stylesheet"
href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.43/dist/index.css"
integrity="sha384-[calculated-hash]"
crossorigin="anonymous" /> |
||
|
||
|
||
<!-- added below css for hcm-workbench module inclusion--> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ const MicroplanSearch = () => { | |
const [tabData, setTabData] = useState( | ||
TabSearchconfig?.TabSearchconfig?.map((configItem, index) => ({ key: index, label: configItem.label, active: index === 0 ? true : false })) | ||
); // setting number of tab component and making first index enable as default | ||
const [key,setKey] = useState(0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Consider extracting tab management logic into a custom hook. Both Example implementation: // useTabManagement.js
const useTabManagement = (initialConfig) => {
const [tabChangeCounter, setTabChangeCounter] = useState(0);
const [tabData, setTabData] = useState(
initialConfig?.map((configItem, index) => ({
key: index,
label: configItem.label,
active: index === 0
}))
);
const handleTabChange = (tabIndex) => {
setTabData((prev) =>
prev.map((tab, index) => ({ ...tab, active: index === tabIndex }))
);
setTabChangeCounter((prev) => prev + 1);
const url = new URL(window.location.href);
url.searchParams.set("tabId", `${tabIndex}`);
window.history.replaceState({}, "", url);
};
return {
tabChangeCounter,
tabData,
handleTabChange
};
}; This would simplify both components and eliminate code duplication. Also applies to: 32-32, 35-35 |
||
useEffect(() => { | ||
// Set default values when component mounts | ||
setDefaultValues(defaultSearchValues); | ||
|
@@ -28,10 +29,10 @@ const MicroplanSearch = () => { | |
const url = new URL(window.location.href); | ||
url.searchParams.set("tabId", `${n}`); | ||
window.history.replaceState({}, "", url); | ||
|
||
setKey(prev => prev+1) | ||
}; | ||
return ( | ||
<React.Fragment> | ||
<React.Fragment key={key}> | ||
|
||
<Header styles={{ fontSize: "32px" }}>{ t(`SEARCH_${config?.label}`) }</Header> | ||
<div className="inbox-search-wrapper"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,18 +20,18 @@ const MyMicroplans = () => { | |
// Set default values when component mounts | ||
setDefaultValues(defaultSearchValues); | ||
}, []); | ||
|
||
const [key,setKey] = useState(0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Consider using a more descriptive name for the key state variable. The -const [key, setKey] = useState(0);
+const [tabChangeCounter, setTabChangeCounter] = useState(0);
-setKey((prev)=>prev+1);
+setTabChangeCounter((prev)=>prev+1);
-<React.Fragment key={key}>
+<React.Fragment key={tabChangeCounter}> Also applies to: 31-31, 34-34 |
||
const onTabChange = (n) => { | ||
|
||
setTabData((prev) => prev.map((i, c) => ({ ...i, active: c === n ? true : false }))); //setting tab enable which is being clicked | ||
// setConfig(TabSearchconfig?.TabSearchconfig?.[n]);// as per tab number filtering the config | ||
const url = new URL(window.location.href); | ||
url.searchParams.set("tabId", `${n}`); | ||
window.history.replaceState({}, "", url); | ||
|
||
setKey((prev)=>prev+1); | ||
}; | ||
return ( | ||
<React.Fragment> | ||
<React.Fragment key={key}> | ||
|
||
<Header styles={{ fontSize: "32px" }}>{t("MY_MICROPLANS_HEADING")}</Header> | ||
<div className="inbox-search-wrapper"> | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,7 +8,7 @@ | |||||||||||||
href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap" | ||||||||||||||
rel="stylesheet" type="text/css" /> | ||||||||||||||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.3/dist/index.css" /> | ||||||||||||||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.42/dist/index.css" /> | ||||||||||||||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.43/dist/index.css" /> | ||||||||||||||
<!-- added below css for hcm-workbench module inclusion--> | ||||||||||||||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.2.2/dist/index.css" /> | ||||||||||||||
Comment on lines
+11
to
13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Version inconsistency detected between files The version of
This inconsistency could lead to UI discrepancies between environments. Apply this update to maintain consistency: - <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.2.2/dist/index.css" />
+ <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.2.3/dist/index.css" /> 📝 Committable suggestion
Suggested change
|
||||||||||||||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Switch to stable version 0.0.2-1 instead of beta
The package has a stable version 0.0.2-1 available which should be used instead of the beta version 0.0.2-beta.43 to ensure production stability. Update the CSS import URL to:
🔗 Analysis chain
Verify beta version stability in production
Using beta version (
0.0.2-beta.43
) in production could pose stability risks. Consider:🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 181