-
Notifications
You must be signed in to change notification settings - Fork 47
Console v0.5 #2965
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
base: master
Are you sure you want to change the base?
Console v0.5 #2965
Changes from all commits
0cb1fa4
3cd151a
45c5ffe
230df89
6e9194d
ad486aa
a0cc3f4
ff44c55
2bcee17
3f516d6
747151d
c671b13
d3672b5
5272fef
4ffc60e
4bdcd7b
218abb2
468c4e9
f42593c
218a4ae
046c25a
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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "@egovernments/digit-ui-health-css", | ||
| "version": "0.3.9", | ||
| "version": "0.3.11", | ||
| "license": "MIT", | ||
| "main": "dist/index.css", | ||
| "author": "Jagankumar <[email protected]>", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import React from "react"; | |
| import { useTranslation } from "react-i18next"; | ||
| import { useHistory } from "react-router-dom"; | ||
|
|
||
| const ViewDetailComponent = ({ headingName, desc, buttonLabel, navLink , type , icon , disabled,isDraftCampaign }) => { | ||
| const ViewDetailComponent = ({ headingName, desc, buttonLabel, navLink, type, icon, disabled, isDraftCampaign }) => { | ||
| const { t } = useTranslation(); | ||
| const history = useHistory(); | ||
|
|
||
|
|
@@ -12,19 +12,24 @@ const ViewDetailComponent = ({ headingName, desc, buttonLabel, navLink , type , | |
| <div className="details-heading"> | ||
| <div className="icon-heading"> | ||
| {icon} | ||
| <HeaderComponent className={"detail-header"} styles={{ | ||
| color: disabled ? "#C5C5C5" : "#004b5e", // same gray for disabled header | ||
| }}>{headingName}</HeaderComponent> | ||
| <HeaderComponent | ||
| className={"detail-header"} | ||
| styles={{ | ||
| color: disabled ? "#C5C5C5" : "#004b5e", // same gray for disabled header | ||
| }} | ||
| > | ||
| {headingName} | ||
| </HeaderComponent> | ||
|
Comment on lines
+15
to
+22
Contributor
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) Prefer theme tokens or classNames over inline color for disabled headings Inline hex (#C5C5C5 / #004b5e) bypasses theming. Recommend mapping disabled state to a class or using theme tokens so designs remain consistent across themes. Example: -<HeaderComponent
- className={"detail-header"}
- styles={{
- color: disabled ? "#C5C5C5" : "#004b5e",
- }}
->
+<HeaderComponent
+ className={clsx("detail-header", { "is-disabled": disabled })}
+>And style .detail-header.is-disabled via your theme.
🤖 Prompt for AI Agents |
||
| </div> | ||
| <Button | ||
| label={buttonLabel} | ||
| onClick={() => { | ||
| history.push(`/${window.contextPath}/employee/campaign/${navLink}`,{isDraftCampaign : isDraftCampaign}); | ||
| history.push(`/${window.contextPath}/employee/campaign/${navLink}`, { isDraftCampaign: isDraftCampaign }); | ||
|
Contributor
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. 💡 Verification agent 🧩 Analysis chainHarden route construction; avoid accidental double slashes and undefined contextPath If navLink includes a leading slash or window.contextPath is undefined, the final URL may be inconsistent. Proposed safeguard: - history.push(`/${window.contextPath}/employee/campaign/${navLink}`, { isDraftCampaign: isDraftCampaign });
+ const base = `/${window?.contextPath || ""}/employee/campaign`;
+ const path = `${base}/${String(navLink || "").replace(/^\/+/, "")}`;
+ history.push(path, { isDraftCampaign });Run a quick scan to ensure similar route building is consistent across Campaign Manager: 🏁 Script executed: #!/bin/bash
# Scan for history.push calls constructing routes with window.contextPath in Campaign Manager module
rg -nP --type=ts --type=tsx --type=js --type=jsx -C2 'history\.push\(\s*`/\$\{?window\.contextPath\}?/employee/campaign' health/micro-ui/web/micro-ui-internals/packages/modules/campaign-managerLength of output: 223 🏁 Script executed: #!/bin/bash
# Re-scan for history.push calls constructing routes with window.contextPath using glob patterns
rg -n -C2 'history\.push\(\s*`/\\$\\{?window\.contextPath\}?/employee/campaign' -g '*.js' -g '*.jsx' -g '*.ts' -g '*.tsx' health/micro-ui/web/micro-ui-internals/packages/modules/campaign-managerLength of output: 372 🏁 Script executed: #!/bin/bash
# 1. Find all usages of window.contextPath in Campaign Manager
rg -n "window\.contextPath" --glob '*.js' --glob '*.jsx' health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager
# 2. Find all occurrences of employee/campaign routes in Campaign Manager
rg -n "employee/campaign" --glob '*.js' --glob '*.jsx' health/micro-ui/web/micro-ui-internals/packages/modules/campaign-managerLength of output: 49471 Harden and centralize campaign‐route construction Our scan uncovered dozens of call sites in the Campaign Manager module where routes are built via Relying on ad-hoc template strings risks accidental double-slashes (if
Example utility (e.g. export function buildCampaignPath(
navLink,
contextPath = typeof window !== "undefined" ? window.contextPath : ""
) {
const base = `/${contextPath || ""}/employee/campaign`;
return `${base}/${String(navLink || "").replace(/^\/+/, "")}`;
}Then, in ViewDetailComponent.js: --- a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CreateCampaignComponents/ViewDetailComponent.js
+++ b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CreateCampaignComponents/ViewDetailComponent.js
@@ 27
- history.push(`/${window.contextPath}/employee/campaign/${navLink}`, { isDraftCampaign: isDraftCampaign });
+ history.push(buildCampaignPath(navLink), { isDraftCampaign });• Apply this helper here to harden the patch. 🤖 Prompt for AI Agents |
||
| }} | ||
| variation={type} | ||
| style={{ width: '19rem' }} | ||
| isDisabled = {disabled} | ||
| title = {buttonLabel} | ||
| style={{ width: "19rem" }} | ||
| isDisabled={disabled} | ||
| title={buttonLabel} | ||
|
Comment on lines
+30
to
+32
Contributor
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) Button accessibility: title duplicates label title={buttonLabel} is redundant since the Button already exposes an accessible name via label. Consider dropping title to avoid duplicate announcements on some ATs. 🤖 Prompt for AI Agents |
||
| /> | ||
| </div> | ||
| <div className="details-desc">{desc}</div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,97 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import React, { useState, Fragment, useEffect } from "react"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { TextInput, Dropdown, RadioButtons, Button, FieldV1, Switch, Loader } from "@egovernments/digit-ui-components"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { useTranslation } from "react-i18next"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const FiltersRenderer = ({ cField, drawerState, setDrawerState, t, disabled }) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const [localSelectedSchema, setLocalSelectedSchema] = useState(null); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const [localActiveOptions, setLocalActiveOptions] = useState([]); // store codes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Fetch MDMS data based on selected schema | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const { isLoading, data: mdmsOptions = [] } = Digit.Hooks.useCustomMDMS( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Digit.ULBService.getCurrentTenantId(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| localSelectedSchema?.moduleName, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| localSelectedSchema?.masterName ? [{ name: localSelectedSchema.masterName }] : [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enabled: !!localSelectedSchema?.moduleName && !!localSelectedSchema?.masterName, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| select: (data) => data?.[localSelectedSchema?.moduleName]?.[localSelectedSchema.masterName] || [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { schemaCode: "FILTERSDROPDOWNLIST" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // When MDMS options load, set default active | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (mdmsOptions.length > 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const defaultActive = mdmsOptions.filter((opt) => opt.active).map((opt) => opt.code); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setLocalActiveOptions(defaultActive); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Also initialize enums in drawerState with these active objects | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const activeObjects = mdmsOptions.filter((item) => defaultActive.includes(item.code)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setDrawerState((prev) => ({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...prev, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enums: activeObjects, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| })); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, [mdmsOptions]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Handle toggle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const handleToggle = (code, checked) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setLocalActiveOptions((prev) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let updated = [...prev]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (checked) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!updated.includes(code)) updated.push(code); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| updated = updated.filter((c) => c !== code); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Map updated codes to full objects | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const activeObjects = mdmsOptions.filter((item) => updated.includes(item.code)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Update drawerState.enums directly | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setDrawerState((prev) => ({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...prev, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enums: activeObjects, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| })); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return updated; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {/* Dropdown for selecting schema */} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Dropdown | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| variant={""} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| t={t} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disabled={disabled} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| option={cField?.mdmsOptions || []} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| optionKey={"schemaCode"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| selected={localSelectedSchema || {}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| select={(value) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setLocalSelectedSchema(value); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setLocalActiveOptions([]); // reset active when schema changes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setDrawerState((prev) => ({ ...prev, enums: [] })); // reset enums | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+60
to
+72
Contributor
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. Dropdown uses prop “disable”, not “disabled” — current control won’t disable The shared Dropdown component checks props.disable, so passing disabled has no effect. Update to disable to ensure the dropdown can be disabled. - <Dropdown
+ <Dropdown
variant={""}
t={t}
- disabled={disabled}
+ disable={disabled}
option={cField?.mdmsOptions || []}
optionKey={"schemaCode"}
selected={localSelectedSchema || {}}
select={(value) => {
setLocalSelectedSchema(value);
setLocalActiveOptions([]); // reset active when schema changes
setDrawerState((prev) => ({ ...prev, enums: [] })); // reset enums
}}
/>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {isLoading && <Loader/>} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {!isLoading && mdmsOptions.length > 0 && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div style={{ marginTop: "1rem", display: "flex", flexDirection: "column", gap: "0.5rem" }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {mdmsOptions.map((opt) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const isActive = localActiveOptions.includes(opt.code); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Switch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key={opt.code} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label={t(opt.name)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isCheckedInitially={isActive} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onToggle={(checked) => handleToggle(opt.code, checked)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disable={false} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shapeOnOff | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| })} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export default FiltersRenderer; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ import React, { useState, useMemo, Fragment, useEffect } from "react"; | |||||||
| import { useTranslation } from "react-i18next"; | ||||||||
| import { useLocation, useHistory } from "react-router-dom"; | ||||||||
| import { Wrapper } from "./SelectingBoundaryComponent"; | ||||||||
| import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader,Chip } from "@egovernments/digit-ui-components"; | ||||||||
| import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader, PopUp, Button, Chip } from "@egovernments/digit-ui-components"; | ||||||||
|
Contributor
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. CardText used but not imported — will crash at runtime You render inside PopUp, but it isn’t imported. Either import CardText or replace it with the already-imported TextBlock. Apply this minimal fix: -import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader, PopUp, Button, Chip } from "@egovernments/digit-ui-components";
+import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader, PopUp, Button, Chip, CardText } from "@egovernments/digit-ui-components";📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||
| import { CONSOLE_MDMS_MODULENAME } from "../Module"; | ||||||||
| import TagComponent from "./TagComponent"; | ||||||||
|
|
||||||||
|
|
@@ -78,7 +78,7 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => { | |||||||
| }, | ||||||||
| }; | ||||||||
|
|
||||||||
| const { data: campaignData, isFetching } = Digit.Hooks.useCustomAPIHook(reqCriteria); | ||||||||
| const { data: campaignData, isFetching } = Digit.Hooks.useCustomAPIHook(reqCriteria); | ||||||||
|
|
||||||||
|
Comment on lines
+81
to
82
Contributor
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) Hook result aliasing: remove unused isFetching or use for loader You destructure isFetching but never use it. Either wire it into your loading state or drop it to keep the file clean. 🤖 Prompt for AI Agents |
||||||||
| useEffect(() => { | ||||||||
| onSelect("boundaryType", { selectedData: selectedData, boundaryData: boundaryOptions, updateBoundary: !restrictSelection }); | ||||||||
|
|
@@ -107,9 +107,9 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => { | |||||||
| setBoundaryOptions(sessionData?.boundaryData || {}); | ||||||||
| } | ||||||||
| setTimeout(() => setIsLoading(false), 10); | ||||||||
| }, [props?.props?.sessionData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType , campaignData]); | ||||||||
| }, [props?.props?.sessionData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType, campaignData]); | ||||||||
|
|
||||||||
| useEffect(() => { | ||||||||
| useEffect(() => { | ||||||||
| if ( | ||||||||
| props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_BOUNDARY_DATA?.uploadBoundary?.uploadedFile?.length > 0 || | ||||||||
| props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_FACILITY_DATA?.uploadFacility?.uploadedFile?.length > 0 || | ||||||||
|
|
@@ -157,7 +157,7 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => { | |||||||
| CampaignDetails: { | ||||||||
| tenantId: tenantId, | ||||||||
| campaignId: queryParams?.id, | ||||||||
| } | ||||||||
| }, | ||||||||
| }, | ||||||||
| }; | ||||||||
| const mutation = Digit.Hooks.useCustomAPIMutationHook(Template); | ||||||||
|
|
@@ -167,7 +167,7 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => { | |||||||
| {}, | ||||||||
| { | ||||||||
| onSuccess: async (result) => { | ||||||||
| history.push(`/${window?.contextPath}/employee/campaign/my-campaign-new`) | ||||||||
| history.push(`/${window?.contextPath}/employee/campaign/my-campaign-new`); | ||||||||
| }, | ||||||||
| onError: (error, result) => { | ||||||||
| const errorCode = error?.response?.data?.Errors?.[0]?.code; | ||||||||
|
|
@@ -184,20 +184,17 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => { | |||||||
| return ( | ||||||||
| <> | ||||||||
| <div className="container-full"> | ||||||||
|
|
||||||||
| <div className="card-container-delivery"> | ||||||||
| <Card> | ||||||||
| <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}> | ||||||||
| <TagComponent campaignName={campaignName} /> | ||||||||
| { | ||||||||
| isDraftCampaign ? ( | ||||||||
| <div className="digit-tag-container" style={{margin:"0rem"}}> | ||||||||
| <Chip text={`${t(`CANCEL_CAMPAIGN`)}`} onClick={handleCancelClick} hideClose={false} /> | ||||||||
| </div> | ||||||||
| ) : null | ||||||||
| } | ||||||||
| {isDraftCampaign ? ( | ||||||||
| <div className="digit-tag-container" style={{ margin: "0rem" }}> | ||||||||
| <Chip text={`${t(`CANCEL_CAMPAIGN`)}`} onClick={handleCancelClick} hideClose={false} /> | ||||||||
| </div> | ||||||||
| ) : null} | ||||||||
|
Comment on lines
+191
to
+195
Contributor
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) Chip semantics: hideClose={false} exposes a close icon for a destructive action For destructive “Cancel Campaign,” consider using a Button with explicit variant=“secondary”/“tertiary” and an icon that communicates intent, or set hideClose={true} to avoid implying a dismiss-only affordance. 🤖 Prompt for AI Agents |
||||||||
| </div> | ||||||||
| <HeaderComponent className = "select-boundary">{t(`CAMPAIGN_SELECT_BOUNDARY`)}</HeaderComponent> | ||||||||
| <HeaderComponent className="select-boundary">{t(`CAMPAIGN_SELECT_BOUNDARY`)}</HeaderComponent> | ||||||||
| <p className="dates-description">{t(`CAMPAIGN_SELECT_BOUNDARIES_DESCRIPTION`)}</p> | ||||||||
| <Wrapper | ||||||||
| hierarchyType={hierarchyType} | ||||||||
|
|
||||||||
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.
🧹 Nitpick (assertive)
Avoid compounding vertical rhythm: margin inside a bordered row conflicts with parent gaps
You add margin-bottom: 2rem on .digit-dss-insight-card within .digit-dss-card-item-border, but .digit-dss-card-body-stacked already uses gap: 2rem (Line 715), which can double the spacing. Prefer spacing on the container or suppress the extra margin for the last item.
Minimal fix to avoid double-spacing:
.digit-dss-card-item-border { border-bottom: 0.063rem solid theme(digitv2.lightTheme.divider); - .digit-dss-insight-card { - margin-bottom: 2rem !important; - } + .digit-dss-insight-card { + margin-bottom: 2rem; + } + .digit-dss-insight-card:last-child { + margin-bottom: 0; + } }Alternatively, replace child margin with container padding-bottom, which generally composes better with flex gaps.
📝 Committable suggestion
🤖 Prompt for AI Agents