Skip to content

Commit

Permalink
Merge pull request #687 from odisha-muktasoft/estimate-actionbar-fix
Browse files Browse the repository at this point in the history
fixed actionbar issue, mobile number alignmet issue
  • Loading branch information
Tulika-eGov authored Oct 4, 2024
2 parents 21c79e3 + ef9ab2f commit 8893c51
Show file tree
Hide file tree
Showing 19 changed files with 141 additions and 60 deletions.
6 changes: 3 additions & 3 deletions frontend/micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"@egovernments/digit-ui-module-dss": "1.5.52",
"@egovernments/digit-ui-module-attendencemgmt": "0.4.9",
"@egovernments/digit-ui-module-contracts": "0.4.8",
"@egovernments/digit-ui-module-measurement":"0.2.7",
"@egovernments/digit-ui-module-estimate": "0.4.12",
"@egovernments/digit-ui-module-masters": "0.4.11",
"@egovernments/digit-ui-module-measurement":"0.2.8",
"@egovernments/digit-ui-module-estimate": "0.4.13",
"@egovernments/digit-ui-module-masters": "0.4.12",
"@egovernments/digit-ui-module-project": "0.4.8",
"@egovernments/digit-ui-module-expenditure": "0.4.6",
"@egovernments/digit-ui-customisation-mukta": "0.2.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-works-css",
"version": "0.2.49",
"version": "0.2.50",
"license": "MIT",
"author": "Jagankumar <[email protected]>",
"main": "dist/index.css",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,35 @@
&.label{
margin-top: 0.565rem;
}
}
}

@media (max-width: 30rem){
.digit-action-bar-wrap{
height: fit-content;
}
}

.digit-action-bar-wrap{
.digit-action-bar-fields{
.action-bar-individual-action-field{
button{
min-width: 14rem;
}
}
}
}

.viewstatement-viewamount-wrapper,
.totalEstimateAmoutCrad{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}

.viewstatement-viewamount-wrapper-create{
display: flex;
align-items: center;
flex-direction: row-reverse;
justify-content: space-between;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-estimate",
"version": "0.4.12",
"version": "0.4.13",
"description": "Estimate Module UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ const CreateEstimate = ({ props }) => {
onOptionSelect={(option) => {
onActionSelect(option);
}}
></Button>,
></Button>
]}
setactionFieldsToRight={true}
className={"new-actionbar"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,19 @@ export const createEstimateConfig = () => {
{
"head": "",
"subHead": "",
"sectionClassName":"viewstatement-viewamount-wrapper-create",
"navLink": "Work Details",
"body": [
{
"type": "component",
"component": "TotalEstAmount",
"withoutLabel": true,
"key": "totalEstimatedAmount"
"key": "totalEstimatedAmount",
"props":{
style:{
marginTop:"0px"
}
}
},
{
"type": "component",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-masters",
"version": "0.4.11",
"version": "0.4.12",
"description": "Masters Module UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { useHistory, useLocation } from 'react-router-dom';
import { Header, SubmitBar } from '@egovernments/digit-ui-react-components';
import ApplicationDetails from '../../../../../templates/ApplicationDetails';
import { Toast,ActionBar } from '@egovernments/digit-ui-components';
import { Toast,ActionBar,Button } from '@egovernments/digit-ui-components';

const ViewWageSeeker = () => {
const { t } = useTranslation()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-measurement",
"version": "0.2.7",
"version": "0.2.8",
"description": "Measurement Module UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button, CardLabelError, CardSectionHeader, CloseSvg } from "@egovernments/digit-ui-react-components";
import { CardLabelError, CardSectionHeader, CloseSvg } from "@egovernments/digit-ui-react-components";
import { Button } from "@egovernments/digit-ui-components";
import React, { useReducer, Fragment, useState } from "react";
import { useTranslation } from "react-i18next";
import MeasureRow from "./MeasureRow";
Expand Down Expand Up @@ -231,8 +232,9 @@ const MeasureCard = React.memo(({ columns, fields = [], register, setValue, tabl
{(mode == "CREATEALL" || mode == "CREATERE") && (
<Button
className={"outline-btn"}
variation={"secondary"}
label={t("MB_ADD_ROW")}
onButtonClick={() => {
onClick={() => {
dispatch({
type: "ADD_ROW",
state: {
Expand All @@ -255,15 +257,17 @@ const MeasureCard = React.memo(({ columns, fields = [], register, setValue, tabl
)}
{!(mode.includes("VIEW")) && <Button
className={"outline-btn clear-button"}
variation={"secondary"}
label={t("MB_CLEAR")}
onButtonClick={() => {
onClick={() => {
dispatch({ type: "CLEAR_STATE" });
}}
/>}
{!(mode.includes("VIEW")) && <Button
variation={"secondary"}
className={"outline-btn done-button"}
label={t("MB_DONE")}
onButtonClick={() => {
onClick={() => {
// check for deduction and set accordingly
const totalQuantity = state?.reduce((total, item) => item?.isDeduction == true ? total - parseFloat(item.noOfunit) : total + parseFloat(item.noOfunit), 0);
if(mode === "CREATE" && (totalQuantity < 0 || totalQuantity > tableData[tableIndex]?.approvedQuantity - tableData[tableIndex]?.consumedQ))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export const data = (contract, estimateDetails, measurement, allMeasurements, th
props: {mode: "VIEWES", detail : {...estimateDetails, value:measurement?.additionalDetails?.totalAmount} }
}
],
sectionClassName:"viewstatement-viewamount-wrapper"
},
{
sections : [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ const CreateMeasurement = ({ props }) => {
showMultipleCardsWithoutNavs={true}
onFormValueChange={onFormValueChange}
noBreakLine={true}
fieldPairNoMargin={true}
/>
{showToast?.display && <Toast type={showToast?.type} label={errorMessage} isDleteBtn={true} onClose={closeToast} />}
<ActionBar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import PropTypes from "prop-types";
import {TextInput} from "@egovernments/digit-ui-components";

const MobileNumber = (props) => {
const user_type = Digit.SessionStorage.get("userType");
Expand All @@ -14,35 +15,38 @@ const MobileNumber = (props) => {

return (
<React.Fragment>
<div className="field-container">
{!props.hideSpan ? (
<span style={{ maxWidth: "50px", marginTop: "unset",border:"1px solid #464646",borderRight:"none", ...props.labelStyle }} className="citizen-card-input citizen-card-input--front">
+91
</span>
) : null}
<div className={`text-input ${user_type === "employee"? "" : "text-mobile-input-width"} ${props.className}`}>
<input
<div className={`digit-mobile-number-container ${props?.className ? props?.className : ""}`} style={props?.style}>
<div
className={`digit-text-input-field ${user_type === "employee" ? "" : "digit-text-mobile-input-width"} ${props.className ? props.className : ""}`}
>
<TextInput
type={"text"}
name={props.name}
id={props.id}
className={`${user_type ? "employee-card-input" : "citizen-card-input"} ${props.disable && "disabled"} focus-visible ${props.errorStyle && "employee-card-input-error"}`}
className={props?.className}
placeholder={props.placeholder}
onChange={onChange}
ref={props.inputRef}
inputRef={props.inputRef}
value={props.value}
style={{ ...props.style }}
// defaultValue={props.defaultValue || ""}
minLength={props.minlength}
minlength={props.minlength}
maxLength={props.maxlength}
max={props.max}
pattern={props.pattern}
min={props.min}
readOnly={props.disable}
nonEditable={props?.nonEditable}
title={props.title}
step={props.step}
autoFocus={props.autoFocus}
onBlur={props.onBlur}
autoComplete="off"
isMandatory={props.isMandatory}
disabled={props.disable}
hideSpan={props.hideSpan}
variant={props?.variant}
populators={
!props.hideSpan ? {prefix:"+91"} :{}
}
userType={user_type}
/>
</div>
</div>
Expand All @@ -56,8 +60,22 @@ MobileNumber.propTypes = {
name: PropTypes.string,
placeholder: PropTypes.string,
onChange: PropTypes.func,
ref: PropTypes.func,
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.instanceOf(Element) })]),
value: PropTypes.any,
className: PropTypes.string,
style: PropTypes.object,
maxLength: PropTypes.number,
minlength: PropTypes.number,
max: PropTypes.number,
pattern: PropTypes.string,
min: PropTypes.number,
disable: PropTypes.bool,
errorStyle: PropTypes.bool,
hideSpan: PropTypes.bool,
title: PropTypes.string,
step: PropTypes.string,
autoFocus: PropTypes.bool,
onBlur: PropTypes.func,
};

MobileNumber.defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import CardText from "../atoms/CardText";
import CardSubHeader from "../atoms/CardSubHeader";
import CardLabelDesc from "../atoms/CardLabelDesc";
import CardLabelError from "../atoms/CardLabelError";
import ActionBar from "../atoms/ActionBar";
import SubmitBar from "../atoms/SubmitBar";
import LinkButton from "../atoms/LinkButton";
import ApiDropdown from "../molecules/ApiDropdown";
import { useTranslation } from "react-i18next";
Expand All @@ -29,6 +27,9 @@ import WrapperComponent from "../atoms/WrapperComponent";
// import TextInput from "../atoms/TextInput";
// import CardLabelError from "../atoms/CardLabelError";
// import CardSectionHeader from "../atoms/CardSectionHeader";
// import ActionBar from "../atoms/ActionBar";
// import SubmitBar from "../atoms/SubmitBar";

import {
CustomDropdown,
Toast,
Expand All @@ -40,7 +41,9 @@ import {
ErrorMessage,
StringManipulator,
Header,
TextBlock
TextBlock,
ActionBar,
SubmitBar
} from "@egovernments/digit-ui-components";

const wrapperStyles = {
Expand Down Expand Up @@ -915,7 +918,11 @@ export const FormComposer = (props) => {
{props?.showMultipleCardsInNavs ? (
props?.config?.map((section, index, array) => {
return section.navLink ? (
<Card style={section.navLink !== activeLink ? getCardStyles(false) : getCardStyles()} noCardStyle={props.noCardStyle}>
<Card
className={`${section?.sectionClassName}`}
style={section.navLink !== activeLink ? getCardStyles(false) : getCardStyles()}
noCardStyle={props.noCardStyle}
>
{renderFormFields(props, section, index, array, section?.sectionFormCategory)}
</Card>
) : null;
Expand All @@ -936,10 +943,14 @@ export const FormComposer = (props) => {
</HorizontalNav>
)}
{!props.submitInForm && props.label && (
<ActionBar>
<SubmitBar label={t(props.label)} submit="submit" disabled={isDisabled} />
{props.onSkip && props.showSkip && <LinkButton style={props?.skipStyle} label={t(`CS_SKIP_CONTINUE`)} onClick={props.onSkip} />}
</ActionBar>
<ActionBar
actionFields={[
<SubmitBar label={t(props.label)} submit="submit" disabled={isDisabled} />,
props.onSkip && props.showSkip && <LinkButton style={props?.skipStyle} label={t(`CS_SKIP_CONTINUE`)} onClick={props.onSkip} />,
]}
setactionFieldsToRight={true}
className={"new-actionbar"}
/>
)}
{showErrorToast && <Toast type={"error"} label={t("ES_COMMON_PLEASE_ENTER_ALL_MANDATORY_FIELDS")} isDleteBtn={true} onClose={closeToast} />}
</form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from "react";
import { useTranslation } from "react-i18next";
import LabelFieldPair from "../atoms/LabelFieldPair";
import CardLabel from "../atoms/CardLabel";
import CardLabelError from "../atoms/CardLabelError";
import CitizenInfoLabel from "../atoms/CitizenInfoLabel";
import Header from "../atoms/Header";
import { Loader } from "../atoms/Loader";
import MultiUploadWrapper from "../molecules/MultiUploadWrapper";
import TextInput from "../atoms/TextInput";
import { InfoCard, StringManipulator, ErrorMessage } from "@egovernments/digit-ui-components";
// import TextInput from "../atoms/TextInput";
// import CitizenInfoLabel from "../atoms/CitizenInfoLabel";
// import Header from "../atoms/Header";
// import LabelFieldPair from "../atoms/LabelFieldPair";
// import CardLabel from "../atoms/CardLabel";
import { InfoCard, StringManipulator, ErrorMessage,TextInput ,Header,TextBlock,LabelFieldPair} from "@egovernments/digit-ui-components";

const UploadFileComposer = ({ module, config, Controller, control, register, formData, errors, localePrefix, customClass, customErrorMsg }) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -64,7 +64,10 @@ const UploadFileComposer = ({ module, config, Controller, control, register, for
// if(isLoading) return <Loader />
return (
<React.Fragment>
<Header styles={{ fontSize: "24px", marginTop: "40px" }}>{t("WORKS_RELEVANT_DOCUMENTS")}</Header>
{/* <Header styles={{ fontSize: "24px", marginTop: "40px" }}>{t("WORKS_RELEVANT_DOCUMENTS")}</Header> */}

<TextBlock subHeader={t("WORKS_RELEVANT_DOCUMENTS")} subHeaderClasName={`uploadfile-composer-header create-header`}></TextBlock>

{docConfig?.bannerLabel && (
<InfoCard
populators={{
Expand All @@ -80,14 +83,19 @@ const UploadFileComposer = ({ module, config, Controller, control, register, for
{docConfig?.documents?.map((item, index) => {
if (!item?.active) return;
return (
<LabelFieldPair key={index} style={{ alignItems: item?.showTextInput ? "flex-start" : "center" }}>
<LabelFieldPair key={index}>
{item.code && (
<CardLabel className="bolder" style={{ marginTop: item?.showTextInput ? "10px" : "" }}>
{t(`${localePrefix}_${item?.code}`)} {item?.isMandatory ? " * " : null}
</CardLabel>
// <CardLabel className="bolder" style={{ marginTop: item?.showTextInput ? "10px" : "" }}>
// {t(`${localePrefix}_${item?.code}`)} {item?.isMandatory ? " * " : null}
// </CardLabel>
<Header className={`label`}>
<div className={`label-container`}>
<div className={`label-styles`}>{t(`${localePrefix}_${item?.code}`)}</div>
<div style={{ color: "#B91900" }}>{item?.isMandatory ? " * " : null}</div>
</div>
</Header>
)}

<div className="field">
<div className="digit-field">
{item?.showTextInput && (
<div>
<Controller
Expand All @@ -99,6 +107,7 @@ const UploadFileComposer = ({ module, config, Controller, control, register, for
onChange={onChange}
inputRef={register({ minLength: 2 })}
errorStyle={errors?.[`${config.name}`]?.[`${item?.name}_name`]}
className={"uploadfile-composer-textfield"}
/>
)}
name={`${config?.name}.${item?.name}_name`}
Expand All @@ -113,7 +122,7 @@ const UploadFileComposer = ({ module, config, Controller, control, register, for
) : null}
</div>
)}
<div style={{ marginBottom: "24px" }}>
<div>
<Controller
render={({ value = [], onChange }) => {
function getFileStoreData(filesData) {
Expand Down
Loading

0 comments on commit 8893c51

Please sign in to comment.