| @@ -4,6 +4,7 @@ import { useState } from 'react'; | |||||
| // material-ui | // material-ui | ||||
| import { useTheme } from '@mui/material/styles'; | import { useTheme } from '@mui/material/styles'; | ||||
| import { List, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'; | import { List, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'; | ||||
| import {useNavigate} from "react-router-dom"; | |||||
| // assets | // assets | ||||
| import { EditOutlined, ProfileOutlined, LogoutOutlined, UserOutlined, WalletOutlined } from '@ant-design/icons'; | import { EditOutlined, ProfileOutlined, LogoutOutlined, UserOutlined, WalletOutlined } from '@ant-design/icons'; | ||||
| @@ -13,9 +14,14 @@ import { EditOutlined, ProfileOutlined, LogoutOutlined, UserOutlined, WalletOutl | |||||
| const ProfileTab = ({ handleLogout }) => { | const ProfileTab = ({ handleLogout }) => { | ||||
| const theme = useTheme(); | const theme = useTheme(); | ||||
| const navigate = useNavigate() | |||||
| const [selectedIndex, setSelectedIndex] = useState(0); | const [selectedIndex, setSelectedIndex] = useState(0); | ||||
| const handleListItemClick = (event, index) => { | const handleListItemClick = (event, index) => { | ||||
| setSelectedIndex(index); | setSelectedIndex(index); | ||||
| if(index==999){ | |||||
| navigate('/test/sendMail'); | |||||
| } | |||||
| }; | }; | ||||
| return ( | return ( | ||||
| @@ -45,6 +51,18 @@ const ProfileTab = ({ handleLogout }) => { | |||||
| </ListItemIcon> | </ListItemIcon> | ||||
| <ListItemText primary="Billing" /> | <ListItemText primary="Billing" /> | ||||
| </ListItemButton> | </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}> | <ListItemButton selected={selectedIndex === 2} onClick={handleLogout}> | ||||
| <ListItemIcon> | <ListItemIcon> | ||||
| <LogoutOutlined /> | <LogoutOutlined /> | ||||
| @@ -55,7 +55,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
| contact = "Phone No.: " + phone?.countryCode + " " + phone?.phoneNumber | contact = "Phone No.: " + phone?.countryCode + " " + phone?.phoneNumber | ||||
| } | } | ||||
| if (faxNo) { | |||||
| if (faxNo && faxNo?.faxNumber) { | |||||
| if (contact != "") | if (contact != "") | ||||
| contact = contact + ", " | contact = contact + ", " | ||||
| contact = contact + "Fax No.:" + faxNo?.countryCode + " " + faxNo?.faxNumber | contact = contact + "Fax No.:" + faxNo?.countryCode + " " + faxNo?.faxNumber | ||||
| @@ -126,7 +126,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria }) = | |||||
| fullWidth | fullWidth | ||||
| {...register("contact")} | {...register("contact")} | ||||
| id="contact" | id="contact" | ||||
| label="Conact Person" | |||||
| label="Contact Person" | |||||
| defaultValue={searchCriteria.contact} | defaultValue={searchCriteria.contact} | ||||
| InputLabelProps={{ | InputLabelProps={{ | ||||
| shrink: true | shrink: true | ||||
| @@ -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; | |||||
| @@ -235,10 +235,6 @@ const UserInformationCard_Individual = ({formData, loadDataFun}) => { | |||||
| dataList: ComboData.idDocType, | dataList: ComboData.idDocType, | ||||
| filterOptions:(options) => options, | filterOptions:(options) => options, | ||||
| getOptionLabel:(item) => item?typeof item==='string'?item:(item["type"]?item["type"]+"-"+item["label"]:""):"", | 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)=>{ | onInputChange:(event, newValue, setInputValue)=>{ | ||||
| if(newValue == null){ | if(newValue == null){ | ||||
| setInputValue(""); | setInputValue(""); | ||||
| @@ -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,6 +3,7 @@ import LoginRoutes from './LoginRoutes' | |||||
| import MainRoutes from './MainRoutes' | import MainRoutes from './MainRoutes' | ||||
| import PublicUserRoutes from './PublicUserRoutes' | import PublicUserRoutes from './PublicUserRoutes' | ||||
| import GLDUserRoutes from './GLDUserRoutes' | import GLDUserRoutes from './GLDUserRoutes' | ||||
| import TestRoutes from './_TestRoutes' | |||||
| import {useRoutes} from 'react-router-dom' | import {useRoutes} from 'react-router-dom' | ||||
| import {isUserLoggedIn, | import {isUserLoggedIn, | ||||
| // isAdminLoggedIn, | // isAdminLoggedIn, | ||||
| @@ -54,5 +55,7 @@ console.log(); | |||||
| path: '*', | path: '*', | ||||
| element: <Navigate to="/dashboard"/> | element: <Navigate to="/dashboard"/> | ||||
| }, | }, | ||||
| isUserLoggedIn()&&isGLDLoggedIn()&&JSON.parse(localStorage.getItem('userData')).fullenName=="2fi" ?TestRoutes:{}, | |||||
| ]); | ]); | ||||
| } | } | ||||