Skip to content

Commit

Permalink
🔖 New release 2.2.0 (#570)
Browse files Browse the repository at this point in the history
* feat: new payment invoice module

* fix edit btn on read page

* fix amount showing balance

* cleaning consoles and unused var

* changing the amount input

* constraint added on tax feild

* create offer frontend feature

* create lead frontend feature

* revert frontend .env

* revert frontend .env

* revert offer model, create offer document

* feature:#548 craeted new email editor page :backend init

* feature:#548 craeted new email editor page :frontend init

* feature:#548 created new email editor page :frontend init

* feature:#548 created new email editor page :changes made

* feature:#548 created new email editor page :changes made

* feat: Create new component multi step select async (#469)

* feat: Create new component multi step select async

* feat: refactor multi-step select  component to get its initial values dynamic

* feat: made the multi step component more flexible

---------

Co-authored-by: Maruf <thesharifi.maruf@gmail.com>

* Feat: Create New Redux Settings Store (#556)

* 💄 Improve UI of Settings Menu

* ⚡️ improve settings performance

* 🔧 Setup Redux Settings

---------

Co-authored-by: Salah Eddine Lalami <50052356+idurar@users.noreply.github.com>

* move backend to separate folder (#557)

Co-authored-by: Salah Eddine Lalami <50052356+idurar@users.noreply.github.com>

* update getting started in readme.md w.r.t recent folder structure change (#564)

* 🐛 Fixing redirection to no found (#565)

Co-authored-by: Salah Eddine Lalami <50052356+idurar@users.noreply.github.com>

* 🚀 Settings Page : user can update (#559)

* 💩 working on Dynamic Form

* 🎨 layout and files Settings improved

* ✨ New Settings Module

* 🗃️ redux updateMany settings done

* 🚀 Settings Module Done

---------

Co-authored-by: Salah Eddine Lalami <50052356+idurar@users.noreply.github.com>

* 🐛 fix bug caused by settings loading

* 🚨 Fix Settings & persist in Local storage (#569)

* 🚨 Fix Settings & persist in Local storage

* 🔇 remove logs

---------

Co-authored-by: Salah Eddine Lalami <50052356+idurar@users.noreply.github.com>

---------

Co-authored-by: polymahh <otman.elkantaoui@gmail.com>
Co-authored-by: Ovilash Moitra <96794196+OvilashMoitra@users.noreply.github.com>
Co-authored-by: Erando Putra <ando.putra@live.com>
Co-authored-by: Erando Putra <38315094+Ando22@users.noreply.github.com>
Co-authored-by: ritik kumar <sinharitik589>
Co-authored-by: Maruf Sharifi <116145571+themarufsharifi@users.noreply.github.com>
Co-authored-by: Maruf <thesharifi.maruf@gmail.com>
Co-authored-by: Salah Eddine Lalami <50052356+idurar@users.noreply.github.com>
Co-authored-by: sagar-joshi <42578673+sagar-joshi@users.noreply.github.com>
  • Loading branch information
9 people committed Sep 25, 2023
1 parent 0cdf79d commit d46c17c
Show file tree
Hide file tree
Showing 48 changed files with 706 additions and 325 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ cd idurar-erp-crm

#### Step 3: Create the Environment File

- Create a file named .variables.env in the root directory.
- Create a file named .variables.env in the /backend directory.
- Copy all variables from tmp.variables.env .
- Paste the copied variables inside .variables.env.
This file will store environment variables for the project to run.
Expand All @@ -74,7 +74,7 @@ Replace "your-mongodb-uri" with the actual URI of your MongoDB database.

#### Step 5: Install Backend Dependencies

In your terminal, navigate to the root directory of the project and run the following command to install the backend dependencies:
In your terminal, navigate to the /backend directory of the project and run the following command to install the backend dependencies:

```bash
npm install
Expand All @@ -84,7 +84,7 @@ This command will install all the required packages specified in the package.jso

#### Step 6: Run Setup Script

While still in the root directory of the project, execute the following command to run the setup script:
While still in the /backend directory of the project, execute the following command to run the setup script:

```bash
node setup/setup.js
Expand Down
File renamed without changes.
31 changes: 22 additions & 9 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"npm": "8.5.5"
},
"dependencies": {
"@ant-design/icons": "4.7.0",
"@ant-design/icons": "^4.8.1",
"@craco/craco": "5.5.0",
"antd": "4.17.4",
"axios": "0.27.2",
Expand All @@ -17,6 +17,7 @@
"framer-motion": "4.1.13",
"history": "4.10.1",
"hoist-non-react-statics": "3.3.2",
"just-compare": "^2.3.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-error-boundary": "3.1.3",
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/app/HeaderContent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import uniqueId from '@/utils/uinqueId';
export default function HeaderContent() {
const dispatch = useDispatch();
const { SubMenu } = Menu;



const profileDropdown = (
<div className="profileDropdown whiteBox shadow" style={{ minWidth: '200px' }}>
Expand Down Expand Up @@ -86,7 +84,7 @@ export default function HeaderContent() {

<Avatar icon={<AppstoreOutlined />} />

<Dropdown overlay={<Notifications/>} trigger={['click']} placement="bottomRight">
<Dropdown overlay={<Notifications />} trigger={['click']} placement="bottomRight">
{/* <Badge dot> */}
<Avatar icon={<BellOutlined />} />

Expand Down
4 changes: 3 additions & 1 deletion frontend/src/app/Navigation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const SIDEBAR_MENU = [

const SETTINGS_SUBMENU = [
{ key: '/settings', title: 'General Settings' },
{ key: '/email', title: 'Email templates' },

{ key: '/email', title: 'Email templates' },

{ key: '/payment/mode', title: 'Payment Mode' },
{ key: '/settings/advanced', title: 'Advanced Settings' },
];
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/app/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React, { useEffect, useLayoutEffect } from 'react';

import Router from '@/router';

Expand All @@ -10,7 +9,7 @@ import Navigation from '@/app/Navigation';

import { useSelector, useDispatch } from 'react-redux';
import { selectAuth } from '@/redux/auth/selectors';
import { settings } from '@/redux/settings/actions';

import HeaderContent from '@/app/HeaderContent';
// import { useNetworkState } from "react-use";

Expand All @@ -29,9 +28,8 @@ function App() {
// }
const dispatch = useDispatch();

useLayoutEffect(() => {
dispatch(settings.list({ entity: 'setting' }));
}, []);



const { isLoggedIn } = useSelector(selectAuth);

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/UpdateForm/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export default function UpdateForm({ config, formElements }) {
const [form] = Form.useForm();

const onSubmit = (fieldsValue) => {
console.log('🚀 ~ file: index.jsx ~ line 34 ~ onSubmit ~ current._id', current._id);
console.log('🚀 ~ file: index.jsx:34 ~ onSubmit ~ fieldsValue:', fieldsValue);

const id = current._id;
dispatch(crud.update({ entity, id, jsonData: fieldsValue }));
};
Expand Down
15 changes: 8 additions & 7 deletions frontend/src/forms/DynamicForm/index.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Input, Form, Checkbox, Select } from 'antd';
import { Input, Form, Checkbox, Select, InputNumber } from 'antd';
import { DatePicker } from '@/components/CustomAntd';
// mapping of our components
const componentMapping = {
input: Input,
number: InputNumber,
password: Input.Password,
checkbox: Checkbox,
date: DatePicker,
};

function DynamicForm({ fields }) {
Expand All @@ -22,29 +22,30 @@ function FormElement({
fieldType,
label,
name,
inputType = {},
isMultiSelect = false,
selectOptions = [],
required = false,
fieldProps = {},
message = 'Field is required!',
}) {
// dinamically select a component from componentMapping object
const { Option } = Select;
const Component = componentMapping[fieldType];

return (
<Form.Item label={label} name={name} rules={[{ required, message }, inputType]}>
<Form.Item label={label} name={name} rules={[{ required, message }]}>
if (fieldType === "select")
{
<Select>
<Select {...fieldProps}>
{selectOptions.map((optionField) => (
<Option key={optionField.key} value={optionField.key}>
{optionField.value}
</Option>
))}
</Select>
}
else if(fieldType === "date"){<DatePicker format={'DD/MM/YYYY'} />}
else {<Component />}
else if(fieldType === "date"){<DatePicker format={'DD/MM/YYYY'} {...fieldProps} />}
else {<Component {...fieldProps} />}
</Form.Item>
);
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/layout/SettingsLayout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export default function SettingsLayout({
lg={{ span: 18 }}
>
<div className="whiteBox shadow" style={{ minHeight: '480px' }}>
<Row className="pad30" gutter={[0, 0]}>

<Row className="pad40" gutter={[0, 0]}>

<Col span={24}>{children}</Col>
</Row>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tag, Divider, Row, Col, Spin,Tooltip } from 'antd';
import { Tag, Divider, Row, Col, Spin, Tooltip } from 'antd';

export default function AnalyticSummaryCard({
title,
Expand Down Expand Up @@ -66,7 +66,6 @@ export default function AnalyticSummaryCard({
}}
>
{tagContent ? tagContent : '$0.00'}

</Tag>
</Tooltip>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { useState, useEffect } from 'react';
import { Divider,Typography , Button, PageHeader} from 'antd';
import {
EditOutlined,
CloseCircleOutlined,
} from '@ant-design/icons';

import { Divider, Typography, Button, PageHeader } from 'antd';
import { EditOutlined, CloseCircleOutlined } from '@ant-design/icons';

import { useSelector, useDispatch } from 'react-redux';
import { erp } from '@/redux/erp/actions';
Expand All @@ -15,7 +13,10 @@ import { selectCurrentItem } from '@/redux/erp/selectors';

import { useHistory } from 'react-router-dom/cjs/react-router-dom.min';

const {Title,Paragraph} = Typography;

const { Title, Paragraph } = Typography;



export default function ReadItem({ config, selectedItem }) {
const { entity, ENTITY_NAME } = config;
Expand All @@ -28,12 +29,14 @@ export default function ReadItem({ config, selectedItem }) {
const { readPanel, updatePanel } = erpContextAction;

const resetErp = {
emailName:'',
emailKey:'',
emailSubject:'',
emailBody:'',
emailVariables:[],
_id:'',

emailName: '',
emailKey: '',
emailSubject: '',
emailBody: '',
emailVariables: [],
_id: '',

};

const [currentErp, setCurrentErp] = useState(selectedItem ?? resetErp);
Expand Down Expand Up @@ -88,15 +91,15 @@ export default function ReadItem({ config, selectedItem }) {
style={{
padding: '20px 0px',
}}
>
</PageHeader>

></PageHeader>
<Divider dashed />
<div>

<Title level={3}>Subject</Title>
<Paragraph>{currentErp.emailSubject}</Paragraph>
<Title level={3}>Body</Title>
<div dangerouslySetInnerHTML={{__html:currentErp.emailBody}}/>
<Title level={3}>Subject</Title>
<Paragraph>{currentErp.emailSubject}</Paragraph>
<Title level={3}>Body</Title>
<div dangerouslySetInnerHTML={{ __html: currentErp.emailBody }} />

</div>
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
import React, { useState, useEffect, useRef } from 'react';
import { Form, Input, InputNumber, Button, Select, Divider, Row, Col , Typography, Tag } from 'antd';
import { Form, Input, InputNumber, Button, Select, Divider, Row, Col, Typography, Tag } from 'antd';
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css';
import { PlusOutlined } from '@ant-design/icons';


const {Paragraph} = Typography;
const { Paragraph } = Typography;

export default function EmailForm({ current = null }) {
const [body, setBody] = useState(current?.emailBody);

const [body,setBody] = useState(current?.emailBody);

const displayLabels = (labels=[]) => <>{labels.map(
label=><Tag onClick={() => setBody(body)} color='blue' >{label}</Tag>
)}</>
const displayLabels = (labels = []) => (
<>
{labels.map((label) => (
<Tag onClick={() => setBody(body)} color="blue">
{label}
</Tag>
))}
</>
);

const setBodyValue = (value) => {
setBody(value);
current.emailBody = value;
}
};

return (
<>
<Form.Item label="Available Variables">
{displayLabels(current?.emailVariables)}
</Form.Item>
<Form.Item label="Available Variables">{displayLabels(current?.emailVariables)}</Form.Item>
<Form.Item label="Subject" name="emailSubject">
<Input />
</Form.Item>
<Form.Item label="Body" name="emailBody">
<ReactQuill theme="snow" value={body} onChange={setBodyValue}/>
<ReactQuill theme="snow" value={body} onChange={setBodyValue} />
</Form.Item>
<Paragraph type='success'>To write a variable name use the convention {`{{variable}}`} for e.g. name - {`{{name}}`}</Paragraph>
<Col className='gutter-row' span={5}>
<Paragraph type="success">
To write a variable name use the convention {`{{variable}}`} for e.g. name - {`{{name}}`}
</Paragraph>
<Col className="gutter-row" span={5}>
<Form.Item>
<Button type="primary" htmlType="submit" icon={<PlusOutlined />} block>
Update Email template
</Button>
</Form.Item>
</Form.Item>
</Col>
</>
);
Expand Down

0 comments on commit d46c17c

Please sign in to comment.