diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 0500d58..847564e 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -95,10 +95,10 @@ function Header(props) { Users (Individual)
  • - Users (Organization) + Users (Organisation)
  • - Organization + Organisation
  • User Group diff --git a/src/pages/OrganizationDetailPage/OrganizationCard.js b/src/pages/OrganizationDetailPage/OrganizationCard.js index 2d4af82..7dcf8b1 100644 --- a/src/pages/OrganizationDetailPage/OrganizationCard.js +++ b/src/pages/OrganizationDetailPage/OrganizationCard.js @@ -201,7 +201,7 @@ const OrganizationCard = ({ userData, loadDataFun, id }) => { - Organization Details + Organisation Details diff --git a/src/pages/OrganizationDetailPage/index.js b/src/pages/OrganizationDetailPage/index.js index a617e79..8be47cf 100644 --- a/src/pages/OrganizationDetailPage/index.js +++ b/src/pages/OrganizationDetailPage/index.js @@ -77,7 +77,7 @@ const OrganizationDetailPage = () => {
    - Maintain Organization + Maintain Organisation
    diff --git a/src/pages/OrganizationDetailPage_FromUser/index.js b/src/pages/OrganizationDetailPage_FromUser/index.js index a7784f3..57f3bd5 100644 --- a/src/pages/OrganizationDetailPage_FromUser/index.js +++ b/src/pages/OrganizationDetailPage_FromUser/index.js @@ -66,7 +66,7 @@ const OrganizationDetailPage_FromUser = () => { : - Organization (Create From User) + Organisation (Create From User) {/*col 1*/} diff --git a/src/pages/OrganizationSearchPage/index.js b/src/pages/OrganizationSearchPage/index.js index eb1a25b..3995a76 100644 --- a/src/pages/OrganizationSearchPage/index.js +++ b/src/pages/OrganizationSearchPage/index.js @@ -70,7 +70,7 @@ const OrganizationSearchPage = () => {
    - View Organization + View Organisation
    diff --git a/src/pages/Proof/Search_GLD/SearchForm.js b/src/pages/Proof/Search_GLD/SearchForm.js index b953ae1..4bbb7b6 100644 --- a/src/pages/Proof/Search_GLD/SearchForm.js +++ b/src/pages/Proof/Search_GLD/SearchForm.js @@ -264,7 +264,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss }} renderInput={(params) => ( { - 目標期數: + 目標期數: { - 稿件檔案 ({"檔案大小應<10MB"}): + 稿件檔案 ({"檔案大小應<10MB"}): 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(} 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 ? - + : ( } }); } 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*/}
    - Organization User Details + Organisation User Details @@ -297,7 +297,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => {FieldUtils.getComboField({ - label: "Organization:", + label: "Organisation:", valueName: "orgId", disabled: (!editMode), dataList: orgData, @@ -466,7 +466,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => : null @@ -475,7 +475,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => - Organization + Organisation diff --git a/src/pages/User/DetailsPage_Organization/index.js b/src/pages/User/DetailsPage_Organization/index.js index df96f6a..0b124a8 100644 --- a/src/pages/User/DetailsPage_Organization/index.js +++ b/src/pages/User/DetailsPage_Organization/index.js @@ -133,7 +133,7 @@ const UserMaintainPage_Organization = () => {
    - Maintain Organization User + Maintain Organisation User
    diff --git a/src/pages/User/SearchPage_Organization/index.js b/src/pages/User/SearchPage_Organization/index.js index 7200ad8..98f9553 100644 --- a/src/pages/User/SearchPage_Organization/index.js +++ b/src/pages/User/SearchPage_Organization/index.js @@ -72,7 +72,7 @@ const UserSearchPage_Organization = () => {
    - View Organization User + View Organisation User
    diff --git a/src/utils/CommonFunction.js b/src/utils/CommonFunction.js index aef31ea..4ac4443 100644 --- a/src/utils/CommonFunction.js +++ b/src/utils/CommonFunction.js @@ -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 (