| @@ -95,10 +95,10 @@ function Header(props) { | |||
| <Link className="indUser" to='/indUser'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Users (Individual)</Typography></Link> | |||
| </li> | |||
| <li> | |||
| <Link className="orgUser" to='/orgUser'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Users (Organization)</Typography></Link> | |||
| <Link className="orgUser" to='/orgUser'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Users (Organisation)</Typography></Link> | |||
| </li> | |||
| <li> | |||
| <Link className="org" to='/org'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Organization</Typography></Link> | |||
| <Link className="org" to='/org'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Organisation</Typography></Link> | |||
| </li> | |||
| <li> | |||
| <Link className="usergroupSearchview" to='/usergroupSearchview'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>User Group</Typography></Link> | |||
| @@ -201,7 +201,7 @@ const OrganizationCard = ({ userData, loadDataFun, id }) => { | |||
| <Grid container spacing={1}> | |||
| <Grid item xs={12}> | |||
| <Typography variant="h4" sx={{mb: 2, mr: 3, borderBottom: "1px solid black" }}> | |||
| Organization Details | |||
| Organisation Details | |||
| </Typography> | |||
| </Grid> | |||
| <Grid item lg={4} > | |||
| @@ -77,7 +77,7 @@ const OrganizationDetailPage = () => { | |||
| <Grid item xs={12}> | |||
| <div style={BackgroundHead}> | |||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||
| <Typography ml={15} color='#FFF' variant="h4">Maintain Organization</Typography> | |||
| <Typography ml={15} color='#FFF' variant="h4">Maintain Organisation</Typography> | |||
| </Stack> | |||
| </div> | |||
| </Grid> | |||
| @@ -66,7 +66,7 @@ const OrganizationDetailPage_FromUser = () => { | |||
| : | |||
| <Grid container rowSpacing={4.5} columnSpacing={2.75}> | |||
| <Grid item xs={12} sx={{mb: -2.25}}> | |||
| <Typography variant="h5">Organization (Create From User)</Typography> | |||
| <Typography variant="h5">Organisation (Create From User)</Typography> | |||
| </Grid> | |||
| {/*col 1*/} | |||
| <Grid item xs={12} > | |||
| @@ -70,7 +70,7 @@ const OrganizationSearchPage = () => { | |||
| <Grid item xs={12}> | |||
| <div style={BackgroundHead}> | |||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||
| <Typography ml={15} color='#FFF' variant="h4">View Organization</Typography> | |||
| <Typography ml={15} color='#FFF' variant="h4">View Organisation</Typography> | |||
| </Stack> | |||
| </div> | |||
| </Grid> | |||
| @@ -264,7 +264,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||
| }} | |||
| renderInput={(params) => ( | |||
| <TextField {...params} | |||
| label="Organization" | |||
| label="Organisation" | |||
| InputLabelProps={{ | |||
| shrink: true | |||
| }} | |||
| @@ -169,7 +169,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||
| <Grid container alignItems={"center"}> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| 目標期數: | |||
| <Typography variant="h5">目標期數:</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} md={6} lg={6}> | |||
| <RadioGroup | |||
| @@ -192,7 +192,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||
| <Grid container direction="row" justifyContent="flex-start" alignItems="center"> | |||
| <Grid item xs={12} md={3} lg={3} | |||
| sx={{ display: 'flex', alignItems: 'center' }}> | |||
| 稿件檔案 ({"檔案大小應<10MB"}): | |||
| <Typography variant="h5">稿件檔案 ({"檔案大小應<10MB"}):</Typography> | |||
| </Grid> | |||
| <Grid item xs={12} md={3} lg={3}> | |||
| <input | |||
| @@ -7,7 +7,7 @@ import * as FormatUtils from "utils/FormatUtils"; | |||
| import { | |||
| Radio, | |||
| FormControlLabel | |||
| FormControlLabel | |||
| } from '@mui/material'; | |||
| import Loadable from 'components/Loadable'; | |||
| @@ -19,19 +19,19 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor | |||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
| const ApplyForm = () => { | |||
| const [userData, setUserData] = React.useState([]); | |||
| const [selections, setSelection] = React.useState([]); | |||
| const [userData, setUserData] = React.useState(null); | |||
| const [selections, setSelection] = React.useState([]); | |||
| const [isLoading, setLoding] = React.useState(true); | |||
| React.useEffect(()=>{ | |||
| React.useEffect(() => { | |||
| loadUserData(); | |||
| },[]); | |||
| }, []); | |||
| const loadUserData = ()=>{ | |||
| const loadUserData = () => { | |||
| setLoding(true); | |||
| HttpUtils.get({ | |||
| url: `${UrlUtils.GET_PUBLIC_NOTICE_getApplyUser}`, | |||
| onSuccess: function(response){ | |||
| onSuccess: function (response) { | |||
| response["tel_countryCode"] = response?.contactTelNo?.countryCode; | |||
| response["phoneNumber"] = response?.contactTelNo?.phoneNumber; | |||
| response["fax_countryCode"] = response?.contactFaxNo?.countryCode; | |||
| @@ -45,26 +45,26 @@ const ApplyForm = () => { | |||
| selection.push(<FormControlLabel value={data.id} control={<Radio />} label={label} />); | |||
| } | |||
| setSelection(selection); | |||
| console.log(response.issueId) | |||
| setUserData(response); | |||
| } | |||
| }); | |||
| }; | |||
| function getIssueLabel(data){ | |||
| return data.year | |||
| +" Vol. "+FormatUtils.zeroPad(data.volume,3) | |||
| +", No. "+FormatUtils.zeroPad(data.issueNo,2) | |||
| +", "+DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||
| function getIssueLabel(data) { | |||
| return data.year | |||
| + " Vol. " + FormatUtils.zeroPad(data.volume, 3) | |||
| + ", No. " + FormatUtils.zeroPad(data.issueNo, 2) | |||
| + ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)"); | |||
| } | |||
| React.useEffect(() => { | |||
| setLoding(false); | |||
| if (userData !== null) setLoding(false); | |||
| }, [userData]); | |||
| return ( | |||
| isLoading ? | |||
| <LoadingComponent/> | |||
| <LoadingComponent /> | |||
| : | |||
| <PublicNoticeApplyForm | |||
| loadedData={userData} | |||
| @@ -236,7 +236,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||
| }} | |||
| renderInput={(params) => ( | |||
| <TextField {...params} | |||
| label="Organization" | |||
| label="Organisation" | |||
| InputLabelProps={{ | |||
| shrink: true | |||
| }} | |||
| @@ -126,7 +126,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||
| } | |||
| }); | |||
| } else { | |||
| setWarningText("Please select Organization before active this account.") | |||
| setWarningText("Please select Organisation before active this account.") | |||
| setIsWarningPopUp(true); | |||
| } | |||
| @@ -235,7 +235,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||
| {/*end top button*/} | |||
| <div style={{ paddingLeft: 24, paddingRight: 24 }}> | |||
| <Typography variant="h4" sx={{ mt: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}> | |||
| Organization User Details | |||
| Organisation User Details | |||
| </Typography> | |||
| <Grid container spacing={1}> | |||
| <Grid item lg={4}> | |||
| @@ -297,7 +297,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||
| <Grid item lg={4}> | |||
| {FieldUtils.getComboField({ | |||
| label: "Organization:", | |||
| label: "Organisation:", | |||
| valueName: "orgId", | |||
| disabled: (!editMode), | |||
| dataList: orgData, | |||
| @@ -466,7 +466,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||
| <Button variant="contained" | |||
| onClick={createOrgClick} | |||
| > | |||
| <Typography variant="h5">Create Organization</Typography> | |||
| <Typography variant="h5">Create Organisation</Typography> | |||
| </Button> | |||
| </Grid> | |||
| : null | |||
| @@ -475,7 +475,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||
| </Grid> | |||
| <Grid item lg={12} > | |||
| <Typography variant="h4" sx={{ mt: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}> | |||
| Organization | |||
| Organisation | |||
| </Typography> | |||
| </Grid> | |||
| <Grid item lg={4}> | |||
| @@ -133,7 +133,7 @@ const UserMaintainPage_Organization = () => { | |||
| <Grid item xs={12}> | |||
| <div style={BackgroundHead}> | |||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||
| <Typography ml={15} color='#FFF' variant="h4">Maintain Organization User</Typography> | |||
| <Typography ml={15} color='#FFF' variant="h4">Maintain Organisation User</Typography> | |||
| </Stack> | |||
| </div> | |||
| </Grid> | |||
| @@ -72,7 +72,7 @@ const UserSearchPage_Organization = () => { | |||
| <Grid item xs={12}> | |||
| <div style={BackgroundHead}> | |||
| <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||
| <Typography ml={15} color='#FFF' variant="h4">View Organization User</Typography> | |||
| <Typography ml={15} color='#FFF' variant="h4">View Organisation User</Typography> | |||
| </Stack> | |||
| </div> | |||
| </Grid> | |||
| @@ -3,27 +3,27 @@ import DialogTitle from "@mui/material/DialogTitle"; | |||
| import DialogContent from "@mui/material/DialogContent"; | |||
| import DialogContentText from "@mui/material/DialogContentText"; | |||
| import DialogActions from "@mui/material/DialogActions"; | |||
| import {Button} from "@mui/material"; | |||
| import { Button } from "@mui/material"; | |||
| import Dialog from "@mui/material/Dialog"; | |||
| import * as React from "react"; | |||
| import { toast } from "react-toastify"; | |||
| export function getDeletedRecordWithRefList(referenceList, updatedList){ | |||
| return referenceList.filter(x => !updatedList.includes(x)) ; | |||
| export function getDeletedRecordWithRefList(referenceList, updatedList) { | |||
| return referenceList.filter(x => !updatedList.includes(x)); | |||
| } | |||
| export function getIdList(input){ | |||
| export function getIdList(input) { | |||
| const output = input.map(function (obj) { | |||
| return obj.id; | |||
| }); | |||
| return output; | |||
| } | |||
| export function getObjectById(list, id){ | |||
| export function getObjectById(list, id) { | |||
| const obj = list.find((element) => { | |||
| return element.id === id; | |||
| }); | |||
| return obj === undefined || Object.keys(obj).length <= 0? null : obj | |||
| return obj === undefined || Object.keys(obj).length <= 0 ? null : obj | |||
| } | |||
| export function removeObjectWithId(arr, id) { | |||
| @@ -34,7 +34,7 @@ export function removeObjectWithId(arr, id) { | |||
| } | |||
| export function getDateString(queryDateArray) { | |||
| return( | |||
| return ( | |||
| queryDateArray[0] | |||
| + "-" + | |||
| queryDateArray[1] | |||
| @@ -60,7 +60,8 @@ export const notifySaveSuccess = () => { | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| }) | |||
| }; | |||
| export const notifyCreateSuccess = () => { | |||
| const userType = JSON.parse(localStorage.getItem("userData")).type | |||
| @@ -73,108 +74,130 @@ export const notifyCreateSuccess = () => { | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| }) | |||
| }; | |||
| export const notifyVerifySuccess = () => { | |||
| const userType = JSON.parse(localStorage.getItem("userData")).type | |||
| toast.success(userType === "GLD" ? 'Verify success!' : "驗證成功!", { | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| }) | |||
| }; | |||
| export const notifyDeleteSuccess = () => { | |||
| const userType = JSON.parse(localStorage.getItem("userData")).type | |||
| toast.success(userType === "GLD" ? 'Delete success!' : "刪除成功!", { | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| }) | |||
| }; | |||
| export const notifyLockSuccess = () => { | |||
| toast.success('Lock success!', { | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| }) | |||
| }; | |||
| export const notifyUnlockSuccess = () => { | |||
| toast.success('Unlock success!', { | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| }) | |||
| }; | |||
| export const notifyActiveSuccess = () => { | |||
| toast.success('Active success!', { | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| }) | |||
| }; | |||
| export const notifyDownloadSuccess = () => { | |||
| const userType = JSON.parse(localStorage.getItem("userData")).type | |||
| toast.success(userType === "GLD" ? 'Download success!' : "下載成功!", { | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| }) | |||
| }; | |||
| export const notifyActionSuccess = (actionMsg) => { | |||
| toast.success(`${actionMsg}`, { | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| }) | |||
| }; | |||
| export const notifyActionError = (actionMsg) => { | |||
| toast.error(`${actionMsg}`, { | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| })}; | |||
| export function prettyJson(json){ | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| }) | |||
| }; | |||
| export const notifyActionWarning = (actionMsg) => { | |||
| toast.warn(`${actionMsg}`, { | |||
| position: "bottom-right", | |||
| autoClose: 5000, | |||
| hideProgressBar: false, | |||
| closeOnClick: true, | |||
| pauseOnHover: true, | |||
| draggable: true, | |||
| progress: undefined, | |||
| theme: "light", | |||
| }) | |||
| } | |||
| export function prettyJson(json) { | |||
| console.log(json); | |||
| console.log(JSON.stringify(json, null, 2)); | |||
| return ( | |||
| @@ -183,11 +206,11 @@ export function prettyJson(json){ | |||
| } | |||
| export function GeneralConfirmWindow({ | |||
| isWindowOpen, | |||
| title, | |||
| content, | |||
| onNormalClose, | |||
| onConfirmClose}){ | |||
| isWindowOpen, | |||
| title, | |||
| content, | |||
| onNormalClose, | |||
| onConfirmClose }) { | |||
| return ( | |||
| <Dialog | |||
| open={isWindowOpen} | |||