Skip to content

Commit

Permalink
Merge pull request #555 from Sinharitik589/feature/#548-new-email-edi…
Browse files Browse the repository at this point in the history
…tor-page

Feature/#548 new email editor page
  • Loading branch information
salahlalami committed Sep 19, 2023
2 parents 9ffdfa2 + a16cc6f commit 6f846ed
Show file tree
Hide file tree
Showing 22 changed files with 831 additions and 40 deletions.
14 changes: 14 additions & 0 deletions controllers/coreControllers/emailController/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const createCRUDController = require('@/controllers/middlewaresControllers/createCRUDController');
const crudController = createCRUDController('Email');

const emailMethods = {
create:crudController.create,
read: crudController.read,
update: crudController.update,
list: crudController.list,
listAll: crudController.listAll,
filter: crudController.filter,
search: crudController.search,
};

module.exports = emailMethods;
192 changes: 192 additions & 0 deletions frontend/package-lock.json

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

11 changes: 6 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
},
"dependencies": {
"@ant-design/icons": "4.7.0",
"@craco/craco": "5.5.0",
"antd": "4.17.4",
"axios": "0.27.2",
"craco-alias": "3.0.1",
"craco-less": "1.17.1",
"cross-env": "7.0.3",
"currency.js": "2.0.4",
"dayjs": "1.10.4",
"framer-motion": "4.1.13",
Expand All @@ -18,6 +22,7 @@
"react-error-boundary": "3.1.3",
"react-helmet": "6.1.0",
"react-portal": "4.2.1",
"react-quill": "^2.0.0",
"react-redux": "7.2.8",
"react-router-dom": "5.2.0",
"react-scripts": "4.0.3",
Expand All @@ -26,11 +31,7 @@
"redux-logger": "3.0.6",
"redux-thunk": "2.4.1",
"reselect": "4.1.5",
"web-vitals": "1.0.1",
"@craco/craco": "5.5.0",
"craco-alias": "3.0.1",
"craco-less": "1.17.1",
"cross-env": "7.0.3"
"web-vitals": "1.0.1"
},
"scripts": {
"start": "craco start",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/Navigation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const SIDEBAR_MENU = [

const SETTINGS_SUBMENU = [
{ key: '/settings', title: 'General Settings' },
{ key: '/email', title: 'Email templates' },
{ key: '/payment/mode', title: 'Payment Mode' },
{ key: '/settings/advanced', title: 'Advanced Settings' },
];
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Menu } from 'antd';

import {
EyeOutlined,
EditOutlined,
DeleteOutlined,
FilePdfOutlined,
CreditCardOutlined,
} from '@ant-design/icons';
import { useSelector, useDispatch } from 'react-redux';
import { erp } from '@/redux/erp/actions';
import { selectItemById } from '@/redux/erp/selectors';
import { useErpContext } from '@/context/erp';

import { DOWNLOAD_BASE_URL } from '@/config/serverApiConfig';
import uniqueId from '@/utils/uinqueId';
import { useHistory } from 'react-router-dom';

export default function DataTableDropMenu({ row, entity }) {
const dispatch = useDispatch();
const history = useHistory();
const { erpContextAction } = useErpContext();
const { recordPanel, modal } = erpContextAction;
const item = useSelector(selectItemById(row._id));
function Read() {
dispatch(erp.currentItem({ data: item }));
// readPanel.open();
history.push(`/email/read/${row._id}`);
}

function Edit() {
dispatch(erp.currentAction({ actionType: 'update', data: item }));
// updatePanel.open();
history.push(`/email/update/${row._id}`);
}
return (
<Menu style={{ minWidth: 130 }}>
<Menu.Item key={`${uniqueId()}`} icon={<EyeOutlined />} onClick={Read}>
Show
</Menu.Item>
<Menu.Item key={`${uniqueId()}`} icon={<EditOutlined />} onClick={Edit}>
Edit
</Menu.Item>
</Menu>
);
}
11 changes: 11 additions & 0 deletions frontend/src/modules/EmailModule/EmailDataTableModule/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ErpLayout } from '@/layout';
import ErpPanel from '@/modules/ErpPanelModule';
import DataTableDropMenu from './components/DataTableDropMenu';

export default function EmailDataTableModule({ config }) {
return (
<ErpLayout>
<ErpPanel config={config} DataTableDropMenu={DataTableDropMenu}></ErpPanel>
</ErpLayout>
);
}

0 comments on commit 6f846ed

Please sign in to comment.