Skip to content
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

Summary screen2 #1433

Merged
merged 3 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.0-alpha.6/dist/index.css" />

<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.34/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.70-campaign/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.71-campaign/dist/index.css" />

<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.50-microplan/dist/index.css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-css",
"version": "1.0.70-campaign",
"version": "1.0.71-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
@@ -0,0 +1,99 @@
.search-tabs-container {
display: flex;
justify-content: space-between;
background-color: #eee;

.search-tab-head {
padding: 10px 35px;
font-weight: 700;
font-size: 1rem;
border: 1px solid #d6d5d4;
border-radius: 0.5rem 0.5rem 0 0;
}

.search-tab-head-selected {
padding: 10px 35px;
color: rgb(244, 119, 56);
background-color: #fff;
border: 1px solid #f47738;
border-radius: 0.5rem 0.5rem 0 0;
border-bottom: 4px solid rgb(244, 119, 56);
font-weight: 700;
font-size: 1.125rem;
margin-bottom: -1rem;
}

.search-tab-head-selected:focus {
outline: 0;
}
}

/* Parent container */
.dm-parent-container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem 1rem;
background-color: #fff;
margin: 0.5rem 0;
}

/* Uploaded file container (left side) */
.dm-uploaded-file-container-sub {
display: flex;
align-items: center;
cursor: pointer;
}

.dm-icon {
margin-right: 0.5rem; /* Space between icon and filename */
}

.dm-file-name {
color: #505a5f;
font-weight: 700;
font-size: 0.875rem; /* Smaller text size */
}

/* Actions container (right side) */
.dm-actions-container {
display: flex;
align-items: center;
gap: 0.75rem; /* Space between edit and delete buttons */
}

/* Edit container */
.dm-campaign-preview-edit-container {
display: flex;
align-items: center;
cursor: pointer;
}

.dm-campaign-preview-edit-container span {
/*margin-right: 0.25rem;*/
font-size: 0.875rem;
font-weight: 500;
color: #dc5a32; /* Orange color for the text */
}

/* Button styles */
.dm-workbench-download-template-btn {
border: 1px solid #dc5a32; /* Orange border */
background-color: transparent;
color: #dc5a32; /* Orange text */
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.875rem; /* Small font size */
font-weight: 500;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}

/* Hover effect for the button */
.dm-hover:hover {
background-color: #fbe9e6;
border-color: #dc5a32;
}

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@
@import "tailwindcss/utilities";

@import "./components/microplanning.scss";
@import "./components/microplan.scss";

@import "./pages/employee/index.scss";
@import "./pages/employee/campaign.scss";
@import "./pages/employee/formulaConfig.scss";


Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.formula-label-field{
display: flex;
gap:1.5rem;
}
.equals-icon {
font-family: 'Roboto Condensed'; /* Set font family */
font-size: 2.5rem; /* Set font size to 2.5rem */
font-weight: 700; /* Set font weight */
line-height: 2.93rem; /* Set line height to 2.93rem */
text-align: left; /* Align text to the left */

width: 1.31rem; /* Set width to 1.31rem */
height: 2.38rem; /* Set height to 2.38rem */
gap: 0; /* Set gap to 0rem */
opacity: 100; /* Set opacity to 0 */
}

.formula-label-field > span {
width: 20rem;
font-size: 1.2rem;
margin-right: 2rem;
font-weight: bold;
}

/* styles.css */
.header-comp-blue {
margin-top: 0; /* Set margin-top to 0 */
font-size: 2rem; /* Set font size to 1.5rem */
color: #0B4B66 !important; /* Set text color */
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import CampaignDetails from "./components/CampaignDetails";
import { ProviderContext } from "./utils/context";
import BoundarySelection from "./components/BoundarySelection";
import HypothesisWrapper from "./components/HypothesisWrapper";
import DataMgmtTable from "./components/DataMgmtTable";
import FileComponent from "./components/FileComponent";
import HeaderComp from "./components/HeaderComp";
import HeaderPlusThreeInput from "./components/HeaderPlusThreeInput";
import ThreeInputComp from "./components/ThreeInputComp";
import SummaryScreen from "./pages/employee/SummaryScreen";

export const MicroplanModule = ({ stateCode, userType, tenants }) => {
const { path, url } = useRouteMatch();
Expand Down Expand Up @@ -49,6 +55,13 @@ const componentsToRegister = {
MicroplanDetails,
BoundarySelection,
HypothesisWrapper,
DataMgmtTable,
FileComponent,
HeaderComp,
HeaderPlusThreeInput,
ThreeInputComp,
SummaryScreen


};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { EditIcon } from "@egovernments/digit-ui-react-components";
import { DeleteIconv2 } from "@egovernments/digit-ui-react-components";
import { FileIcon } from "@egovernments/digit-ui-react-components";
import { Button } from "@egovernments/digit-ui-react-components";
import { Card } from "@egovernments/digit-ui-react-components";
import { CardSubHeader } from "@egovernments/digit-ui-react-components";
import { InboxSearchComposer } from "@egovernments/digit-ui-react-components";

import { Table } from '@egovernments/digit-ui-react-components';


const DataMgmtTable = ({ file, index, handleFileDelete, handleRedirect, setShowPreview }) => {


const { t } = useTranslation();
const columns = [
{ Header: 'Vehicle type', accessor: 'vehicleType' },
{ Header: 'Manufacturer', accessor: 'manufacturer' },
{ Header: 'Model', accessor: 'model' },
{ Header: 'Capacity(in Bales)', accessor: 'cap' },

];

const data = [
{ vehicleType: 'Truck', manufacturer: "Draft", model: 'Household',cap:"70" },
{ vehicleType: 'Motorcycle', manufacturer: "Draft", model: 'Household',cap:"2" },
{ vehicleType: 'Motorcycle', manufacturer: "Draft", model: 'Household', cap:"2" },
];
return (
<div>

{/* Second card */}


<div className="view-composer-header-section">
<CardSubHeader style={{ marginTop: 0, fontSize: "1.5rem", color: " #0B4B66", marginBottom: "0rem" }}>Vehicles</CardSubHeader>
</div>
<Table
columns={columns} data={data}
getCellProps={(cellInfo) => {
return {
style: {
padding: "20px 18px",
fontSize: "16px",
whiteSpace: "normal",
},
};
}}
t={t}
/>

</div>
);
};

export default DataMgmtTable;
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { EditIcon } from "@egovernments/digit-ui-react-components";
import { DeleteIconv2 } from "@egovernments/digit-ui-react-components";
import { FileIcon } from "@egovernments/digit-ui-react-components";
import { Button } from "@egovernments/digit-ui-react-components";
import { Card } from "@egovernments/digit-ui-react-components";
import { CardSubHeader } from "@egovernments/digit-ui-react-components";
import { InboxSearchComposer } from "@egovernments/digit-ui-react-components";
import { Table } from '@egovernments/digit-ui-react-components';

const FileComponent = ({ title,fileName,editHandler,deleteHandler}) => {
const {t}=useTranslation();
return (
<div>

{/* First card */}
<div className="view-composer-header-section">
<CardSubHeader style={{ marginTop: 0, fontSize: "1.5rem", color: " #0B4B66", marginBottom: "0rem" }}>{title}</CardSubHeader>

</div>
<Card>
<div className="dm-parent-container">
{/* Left side: File Icon */}
<div
className="dm-uploaded-file-container-sub"
onClick={() => setShowPreview(true)}
>
<FileIcon className="dm-icon" />
<div>{fileName}</div>
</div>

{/* Right side: Edit and Delete Buttons */}
<div className="dm-actions-container">
{/* Edit Icon and Button */}
<div className="dm-campaign-preview-edit-container" onClick={() => handleRedirect(1)}>
{/* <span>{t("CAMPAIGN_EDIT")}</span> */}
<Button
label={t("WBH_EDIT")}
variation="secondary"
icon={<EditIcon styles={{ height: "1.25rem", width: "2.5rem" }} />}
type="button"
className="dm-workbench-download-template-btn dm-hover"
onButtonClick={(e) => {
editHandler();
}}
/>
</div>

{/* Delete Button */}
<Button
label={t("WBH_DELETE")}
variation="secondary"
icon={<DeleteIconv2 styles={{ height: "1.25rem", width: "2.5rem" }} />}
type="button"
className="dm-workbench-download-template-btn dm-hover"
onButtonClick={(e) => {
deleteHandler();
}}
/>
</div>
</div>
</Card>

</div>
);
};

export default FileComponent;

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import { Card } from '@egovernments/digit-ui-react-components';
import { Header } from '@egovernments/digit-ui-react-components';
import { useTranslation } from 'react-i18next';
const HeaderComp = ({ title,styles = {} }) => {
// Define default styles
const {t}=useTranslation();
const defaultStyles = {
marginTop: 0,
fontSize: "1.5rem",
color: "#0B4B66",
};

// Merge default styles with the custom styles passed as a prop
const mergedStyles = { ...defaultStyles, ...styles };



return (
<div>
{/* Apply the merged styles */}
<Header className="header-comp-blue" style={mergedStyles}>
{t(title)}
</Header>
</div>
);
};

export default HeaderComp;
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';
import ThreeInputComp from './ThreeInputComp';
import HeaderComp from './HeaderComp';
import { useTranslation } from 'react-i18next';

const HeaderPlusThreeInput = ({ title, threeInputArr }) => {
const { t } = useTranslation();


return (
<div>
<HeaderComp title={t(title)} />

{
threeInputArr.map((arr) => {


return (
<ThreeInputComp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name component properly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to FormulaSectionComp.js

output={arr[0]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just send all this data in one prop and access accordingly in compnent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be more readable and structured , so we know what we are sending

input1={arr[1]}
input2={arr[2]}
input3={arr[3]}
/>
);
})
}

</div>
);
};

export default HeaderPlusThreeInput;
Loading