Anna Ho 1 рік тому
джерело
коміт
ddb8be84df
7 змінених файлів з 128 додано та 6 видалено
  1. +18
    -0
      src/layout/MainLayout/Header/HeaderContent/Profile/ProfileTab.js
  2. +1
    -1
      src/pages/PublicNoticeSearch_GLD/DataGrid.js
  3. +1
    -1
      src/pages/PublicNoticeSearch_GLD/SearchForm.js
  4. +84
    -0
      src/pages/_Test/Mail/index.js
  5. +0
    -4
      src/pages/pnspsUserDetailPage_Individual/UserInformationCard_Individual.js
  6. +21
    -0
      src/routes/_TestRoutes.js
  7. +3
    -0
      src/routes/index.js

+ 18
- 0
src/layout/MainLayout/Header/HeaderContent/Profile/ProfileTab.js Переглянути файл

@@ -4,6 +4,7 @@ import { useState } from 'react';
// material-ui
import { useTheme } from '@mui/material/styles';
import { List, ListItemButton, ListItemIcon, ListItemText } from '@mui/material';
import {useNavigate} from "react-router-dom";

// assets
import { EditOutlined, ProfileOutlined, LogoutOutlined, UserOutlined, WalletOutlined } from '@ant-design/icons';
@@ -13,9 +14,14 @@ import { EditOutlined, ProfileOutlined, LogoutOutlined, UserOutlined, WalletOutl
const ProfileTab = ({ handleLogout }) => {
const theme = useTheme();

const navigate = useNavigate()

const [selectedIndex, setSelectedIndex] = useState(0);
const handleListItemClick = (event, index) => {
setSelectedIndex(index);
if(index==999){
navigate('/test/sendMail');
}
};

return (
@@ -45,6 +51,18 @@ const ProfileTab = ({ handleLogout }) => {
</ListItemIcon>
<ListItemText primary="Billing" />
</ListItemButton>
{
JSON.parse(localStorage.getItem('userData')).fullenName=="2fi"?
<ListItemButton selected={selectedIndex === 4} onClick={(event) => handleListItemClick(event, 999)}>
<ListItemIcon>
<WalletOutlined />
</ListItemIcon>
<ListItemText primary="TestMail" />
</ListItemButton>
:<></>
}

<ListItemButton selected={selectedIndex === 2} onClick={handleLogout}>
<ListItemIcon>
<LogoutOutlined />


+ 1
- 1
src/pages/PublicNoticeSearch_GLD/DataGrid.js Переглянути файл

@@ -55,7 +55,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
contact = "Phone No.: " + phone?.countryCode + " " + phone?.phoneNumber
}

if (faxNo) {
if (faxNo && faxNo?.faxNumber) {
if (contact != "")
contact = contact + ", "
contact = contact + "Fax No.:" + faxNo?.countryCode + " " + faxNo?.faxNumber


+ 1
- 1
src/pages/PublicNoticeSearch_GLD/SearchForm.js Переглянути файл

@@ -126,7 +126,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria }) =
fullWidth
{...register("contact")}
id="contact"
label="Conact Person"
label="Contact Person"
defaultValue={searchCriteria.contact}
InputLabelProps={{
shrink: true


+ 84
- 0
src/pages/_Test/Mail/index.js Переглянути файл

@@ -0,0 +1,84 @@
// material-ui
import {
Grid,
Typography,
Button,
Stack,
TextField
} from '@mui/material';

import { useFormik } from 'formik';
import * as React from "react";
import * as yup from 'yup';
import * as HttpUtils from "utils/HttpUtils";
import {apiPath} from "auth/utils";


// ==============================|| DASHBOARD - DEFAULT ||============================== //



const Mail = () => {

const formik = useFormik({
enableReinitialize:true,
initialValues:{},
validationSchema:yup.object().shape({
email: yup.string().max(255).required('請輸入e-Mail')
}),
onSubmit:values=>{
HttpUtils.post({
url: apiPath+"/test/send-mail",
params: {
email: values.email,
},
onSuccess: function(){
}
});
}
});

return (
!JSON.parse(localStorage.getItem('userData')).fullenName=="2fi" ?
<Grid container >
<Typography variant="h1">Ooops! Seem go wrong page...</Typography>
</Grid>
:
<Grid container spacing={1}>
<Grid item xs={12}>
<Typography variant="h3" style={{ padding: 8}}>Test Send e-Mail</Typography>
</Grid>
{/*col 2*/}
<form onSubmit={formik.handleSubmit} style={{width:'100%', padding: 64}}>
<Grid item xs={12} mt={1} >
<Stack direction="row" justifyContent="flex-end" alignItems="center">
<TextField
fullWidth
id="email"
name="email"
type="email"
placeholder="email"
label="eMail"
/>
</Stack>
</Grid>
<Button
variant="contained"
type="submit"
sx={{
textTransform: 'capitalize',
alignItems: 'end',
width: 200
}}>
Test Send e-Mail
</Button>
</form>
</Grid>
);
};


export default Mail;

+ 0
- 4
src/pages/pnspsUserDetailPage_Individual/UserInformationCard_Individual.js Переглянути файл

@@ -235,10 +235,6 @@ const UserInformationCard_Individual = ({formData, loadDataFun}) => {
dataList: ComboData.idDocType,
filterOptions:(options) => options,
getOptionLabel:(item) => item?typeof item==='string'?item:(item["type"]?item["type"]+"-"+item["label"]:""):"",
// getOptionSelected: (option, value) => option.label === value.label,
// isOptionEqualToValue:(option, newValue) => {
// return option.type === newValue;
// },
onInputChange:(event, newValue, setInputValue)=>{
if(newValue == null){
setInputValue("");


+ 21
- 0
src/routes/_TestRoutes.js Переглянути файл

@@ -0,0 +1,21 @@
import { lazy } from 'react';
import Loadable from 'components/Loadable';
const MainLayout = Loadable(lazy(() => import('layout/MainLayout')));

// render - dashboard
const TestMail = Loadable(lazy(() => import('pages/_Test/Mail')));
// ==============================|| MAIN ROUTING ||============================== //

const TestRoutes = {
path: '/',
element: <MainLayout />,
children: [
{
path: 'test/sendMail',
element: <TestMail/>
},
]
};


export default TestRoutes;

+ 3
- 0
src/routes/index.js Переглянути файл

@@ -3,6 +3,7 @@ import LoginRoutes from './LoginRoutes'
import MainRoutes from './MainRoutes'
import PublicUserRoutes from './PublicUserRoutes'
import GLDUserRoutes from './GLDUserRoutes'
import TestRoutes from './_TestRoutes'
import {useRoutes} from 'react-router-dom'
import {isUserLoggedIn,
// isAdminLoggedIn,
@@ -54,5 +55,7 @@ console.log();
path: '*',
element: <Navigate to="/dashboard"/>
},
isUserLoggedIn()&&isGLDLoggedIn()&&JSON.parse(localStorage.getItem('userData')).fullenName=="2fi" ?TestRoutes:{},

]);
}

Завантаження…
Відмінити
Зберегти