diff --git a/src/layout/MainLayout/Header/HeaderContent/Profile/ProfileTab.js b/src/layout/MainLayout/Header/HeaderContent/Profile/ProfileTab.js index 95a3fd6..76ed658 100644 --- a/src/layout/MainLayout/Header/HeaderContent/Profile/ProfileTab.js +++ b/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 }) => { + { + JSON.parse(localStorage.getItem('userData')).fullenName=="2fi"? + handleListItemClick(event, 999)}> + + + + + + :<> + } + + diff --git a/src/pages/PublicNoticeSearch_GLD/DataGrid.js b/src/pages/PublicNoticeSearch_GLD/DataGrid.js index 7518662..1593cf1 100644 --- a/src/pages/PublicNoticeSearch_GLD/DataGrid.js +++ b/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 diff --git a/src/pages/PublicNoticeSearch_GLD/SearchForm.js b/src/pages/PublicNoticeSearch_GLD/SearchForm.js index 501bec6..8caf19a 100644 --- a/src/pages/PublicNoticeSearch_GLD/SearchForm.js +++ b/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 diff --git a/src/pages/_Test/Mail/index.js b/src/pages/_Test/Mail/index.js new file mode 100644 index 0000000..806df59 --- /dev/null +++ b/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" ? + + Ooops! Seem go wrong page... + + : + + + Test Send e-Mail + + + + {/*col 2*/} +
+ + + + + + +
+
+ ); +}; + + +export default Mail; diff --git a/src/pages/pnspsUserDetailPage_Individual/UserInformationCard_Individual.js b/src/pages/pnspsUserDetailPage_Individual/UserInformationCard_Individual.js index df20eb4..68f67fb 100644 --- a/src/pages/pnspsUserDetailPage_Individual/UserInformationCard_Individual.js +++ b/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(""); diff --git a/src/routes/_TestRoutes.js b/src/routes/_TestRoutes.js new file mode 100644 index 0000000..ac066c8 --- /dev/null +++ b/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: , + children: [ + { + path: 'test/sendMail', + element: + }, + ] +}; + + +export default TestRoutes; diff --git a/src/routes/index.js b/src/routes/index.js index 58d3dbc..5024fa2 100644 --- a/src/routes/index.js +++ b/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: }, + isUserLoggedIn()&&isGLDLoggedIn()&&JSON.parse(localStorage.getItem('userData')).fullenName=="2fi" ?TestRoutes:{}, + ]); }