Skip to content

Commit

Permalink
fixes-> cyclenumber issue, hover issue, dropdown height issue, (#656)
Browse files Browse the repository at this point in the history
* fixes-> cyclenumber issue, hover issue, dropdown height issue,

* css

---------

Co-authored-by: nabeelmd-eGov <nabeel.md@egovernments.com>
  • Loading branch information
nabeelmd-eGov and nabeelmd-eGov committed May 21, 2024
1 parent 9c705ef commit 77399e0
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.1-beta.10/dist/index.css" />

<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.2-coreui.14/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.40-campaign/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.41-campaign/dist/index.css" />
<!-- added below css for hcm-workbench module inclusion-->

<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.5.41/dist/index.css" /> -->
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/packages/css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-css",
"version": "1.0.40-campaign",
"version": "1.0.41-campaign",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <jagan.kumar@egov.org.in>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,11 @@ input[type="date"]::-webkit-calendar-picker-indicator {
}
}
}
.selecting-boundaries-dropdown{
.digit-multiselectdropdown-server{
max-height: 15rem;
}
}
.hover{
cursor: pointer;
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const AddProductField = ({ onSelect }) => {
<Button
variation="secondary"
label={t(`CAMPAIGN_ADD_MORE_PRODUCT_BUTTON`)}
// className={"add-rule-btn"}
className={"hover"}
icon={<AddIcon styles={{ height: "1.5rem", width: "1.5rem" }} fill={PRIMARY_COLOR} />}
onButtonClick={addMoreField}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const BulkUpload = ({ multiple = true, onSubmit, fileData, onFileDelete, onFileD
variation="secondary"
icon={<DownloadIcon styles={{ height: "1.25rem", width: "1.25rem" }} fill={PRIMARY_COLOR} />}
type="button"
className="workbench-download-template-btn"
className="workbench-download-template-btn hover"
onButtonClick={(e) => {
e.stopPropagation();
handleFileDownload(e, fileUrl);
Expand All @@ -154,7 +154,7 @@ const BulkUpload = ({ multiple = true, onSubmit, fileData, onFileDelete, onFileD
variation="secondary"
icon={<DeleteIconv2 styles={{ height: "1.25rem", width: "2.5rem" }} fill={PRIMARY_COLOR} />}
type="button"
className="workbench-download-template-btn"
className="workbench-download-template-btn hover"
onButtonClick={(e) => {
e.stopPropagation();
handleFileDelete(file, index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ const CampaignSummary = () => {
variation="secondary"
icon={<DownloadIcon styles={{ height: "1.25rem", width: "1.25rem" }} fill={PRIMARY_COLOR} />}
type="button"
className="campaign-download-template-btn"
className="campaign-download-template-btn hover"
onButtonClick={downloadUserCred}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Tabs = ({ deliveryData, onTabChange }) => {
<button
key={index}
type="button"
className={`campaign-sub-tab-head ${_.active === true ? "active" : ""}`}
className={`campaign-sub-tab-head ${_.active === true ? "active" : ""} hover`}
onClick={() => onTabChange(_.deliveryIndex, index)}
>
{t(`CAMPAIGN_DELIVERY`)} {index + 1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ function SelectingBoundaries({ onSelect, formData, ...props }) {
</CardLabel>
<div className="digit-field">
<MultiSelectDropdown
props={{ className: "selecting-boundaries-dropdown" }}
t={t}
options={boundaryData[boundary?.boundaryType]?.map((item) => item?.boundaryTypeData?.TenantBoundary?.[0]?.boundary)?.flat() || []}
optionsKey={"code"}
Expand All @@ -347,6 +348,7 @@ function SelectingBoundaries({ onSelect, formData, ...props }) {
<div className="digit-field">
<MultiSelectDropdown
t={t}
props={{ className: "selecting-boundaries-dropdown" }}
options={
boundaryData[boundary?.boundaryType]?.map((item) => ({
code: item?.parentCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ function CycleConfiguration({ onSelect, formData, control, ...props }) {

const updateCycle = (d) => {
if (d === 0 || d > 5) return;
if (Number(d?.target?.value) === 0 || Number(d?.target?.value) > 5) return;
// if (d?.target?.value.trim() === "") return;
dispatch({ type: "UPDATE_CYCLE", payload: d?.target?.value ? Number(d?.target?.value) : d?.target?.value === "" ? d.target.value : d });
};

const updateDelivery = (d) => {
if (d === 0 || d > 5) return;
if (Number(d?.target?.value) === 0 || Number(d?.target?.value) > 5) return;
// if (d?.target?.value.trim() === "") return;
dispatch({ type: "UPDATE_DELIVERY", payload: d?.target?.value ? Number(d?.target?.value) : d });
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ const AddAttributeWrapper = ({ deliveryRuleIndex, delivery, deliveryRules, setDe
<Button
variation="secondary"
label={t(`CAMPAIGN_ADD_MORE_ATTRIBUTE_TEXT`)}
className="add-attribute"
className="add-attribute hover"
icon={<AddIcon styles={{ height: "1.5rem", width: "1.5rem" }} fill={PRIMARY_COLOR} width="20" height="20" />}
onButtonClick={addMoreAttribute}
/>
Expand Down Expand Up @@ -611,8 +611,17 @@ const AddDeliveryRule = ({ targetedData, deliveryRules, setDeliveryRules, index,
</p>
{deliveryRules.length !== 1 && (
<div
className="hover"
onClick={() => onDelete()}
style={{ fontWeight: "600", fontSize: "1rem", color: PRIMARY_COLOR, display: "flex", gap: "0.5rem", alignItems: "center" }}
style={{
fontWeight: "600",
fontSize: "1rem",
color: PRIMARY_COLOR,
display: "flex",
gap: "0.5rem",
alignItems: "center",
cursor: "pointer",
}}
>
<DustbinIcon /> {t(`CAMPAIGN_DELETE_CONDITION_LABEL`)}
</div>
Expand Down Expand Up @@ -644,7 +653,7 @@ const AddDeliveryRule = ({ targetedData, deliveryRules, setDeliveryRules, index,
</div>
<Button
variation="secondary"
className={"add-product-btn"}
className={"add-product-btn hover"}
label={t(`CAMPAIGN_ADD_PRODUCTS_BUTTON_TEXT`)}
icon={<SVG.AppRegistration />}
onButtonClick={() => setShowModal(true)}
Expand Down Expand Up @@ -742,7 +751,7 @@ const AddDeliveryRuleWrapper = ({}) => {
<Button
variation="secondary"
label={t(`CAMPAIGN_ADD_MORE_DELIVERY_BUTTON`)}
className={"add-rule-btn"}
className={"add-rule-btn hover"}
icon={<AddIcon styles={{ height: "1.5rem", width: "1.5rem" }} fill={PRIMARY_COLOR} />}
onButtonClick={addMoreDelivery}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ function AddProducts({ stref, selectedDelivery, showToast, closeToast }) {

const incrementC = (data, value) => {
if (value?.target?.value.trim() === "") return;
if (value?.target?.value.trim() === 0 || value?.target?.value.trim() > 10 ) return;
if (value === 0) return;
if (value > 10) return;
setProducts((prevState) => {
Expand Down Expand Up @@ -244,7 +245,7 @@ function AddProducts({ stref, selectedDelivery, showToast, closeToast }) {
<Button
variation="secondary"
label={t(`CAMPAIGN_PRODUCTS_MODAL_SECONDARY_ACTION`)}
className={"add-rule-btn"}
className={"add-rule-btn hover"}
icon={<AddIcon fill={PRIMARY_COLOR} styles={{ height: "1.5rem", width: "1.5rem" }} />}
onButtonClick={add}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const Tabs = ({ onTabChange }) => {
<button
key={index}
type="button"
className={`campaign-tab-head ${_.active === true ? "active" : ""}`}
className={`campaign-tab-head ${_.active === true ? "active" : ""} hover`}
onClick={() => onTabChange(_.cycleIndex, index)}
>
<p style={{ margin: 0, position: "relative", top: "-0.1rem" }}>
Expand Down Expand Up @@ -173,7 +173,7 @@ const SubTabs = ({ onSubTabChange }) => {
<button
key={index}
type="button"
className={`campaign-sub-tab-head ${_.active === true ? "active" : ""}`}
className={`campaign-sub-tab-head ${_.active === true ? "active" : ""} hover`}
onClick={() => onSubTabChange(_.deliveryIndex, index)}
>
{t(`CAMPAIGN_DELIVERY`)} {index + 1}
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.1-beta.10/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.2-coreui.14/dist/index.css" />
<!-- added below css for hcm-workbench module inclusion-->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.40-campaign/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.41-campaign/dist/index.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
<title>DIGIT</title>
Expand Down

0 comments on commit 77399e0

Please sign in to comment.