Selaa lähdekoodia

update staff

tags/Baseline_30082024_FRONTEND_UAT
cyril.tsui 1 vuosi sitten
vanhempi
commit
14ad911bb4
1 muutettua tiedostoa jossa 12 lisäystä ja 0 poistoa
  1. +12
    -0
      src/components/EditStaff/EditStaff.tsx

+ 12
- 0
src/components/EditStaff/EditStaff.tsx Näytä tiedosto

@@ -148,6 +148,7 @@ const EditStaff: React.FC = async () => {
label: t(`Staff Name`), label: t(`Staff Name`),
type: "text", type: "text",
value: data[key] ?? "", value: data[key] ?? "",
required: true,
}; };
case "company": case "company":
return { return {
@@ -156,6 +157,7 @@ const EditStaff: React.FC = async () => {
type: "combo-Obj", type: "combo-Obj",
options: companyCombo, options: companyCombo,
value: data[key].id ?? "", value: data[key].id ?? "",
required: true,
}; };
case "team": case "team":
return { return {
@@ -172,6 +174,7 @@ const EditStaff: React.FC = async () => {
type: "combo-Obj", type: "combo-Obj",
options: departmentCombo, options: departmentCombo,
value: data[key]?.id ?? "", value: data[key]?.id ?? "",
required: true,
// later check // later check
}; };
case "grade": case "grade":
@@ -197,6 +200,7 @@ const EditStaff: React.FC = async () => {
type: "combo-Obj", type: "combo-Obj",
options: positionCombo, options: positionCombo,
value: data[key].id ?? "", value: data[key].id ?? "",
required: true,
}; };
case "salary": case "salary":
return { return {
@@ -205,6 +209,7 @@ const EditStaff: React.FC = async () => {
type: "combo-Obj", type: "combo-Obj",
options: salaryCombo, options: salaryCombo,
value: data[key] !== null ? data[key].id ?? "" : "", value: data[key] !== null ? data[key].id ?? "" : "",
required: true,
}; };
// case "hourlyRate": // case "hourlyRate":
// return { // return {
@@ -222,6 +227,7 @@ const EditStaff: React.FC = async () => {
type: "combo-Obj", type: "combo-Obj",
options: employTypeCombo, options: employTypeCombo,
value: data[key] ?? "", value: data[key] ?? "",
required: true,
}; };
case "email": case "email":
return { return {
@@ -231,6 +237,7 @@ const EditStaff: React.FC = async () => {
value: data[key] ?? "", value: data[key] ?? "",
pattern: "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$", pattern: "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$",
message: t("input matching format"), message: t("input matching format"),
required: true,
}; };
case "phone1": case "phone1":
return { return {
@@ -240,6 +247,7 @@ const EditStaff: React.FC = async () => {
// pattern: "^\\d{8}$", // pattern: "^\\d{8}$",
message: t("input correct phone no."), message: t("input correct phone no."),
value: data[key] ?? "", value: data[key] ?? "",
required: true,
}; };
case "phone2": case "phone2":
return { return {
@@ -264,6 +272,7 @@ const EditStaff: React.FC = async () => {
label: t(`Emergency Contact Name`), label: t(`Emergency Contact Name`),
type: "text", type: "text",
value: data[key] ?? "", value: data[key] ?? "",
required: true,
} as Field; } as Field;
case "emergContactPhone": case "emergContactPhone":
return { return {
@@ -273,6 +282,7 @@ const EditStaff: React.FC = async () => {
// pattern: "^\\d{8}$", // pattern: "^\\d{8}$",
message: t("input correct phone no."), message: t("input correct phone no."),
value: data[key] ?? "", value: data[key] ?? "",
required: true,
} as Field; } as Field;
case "joinDate": case "joinDate":
return { return {
@@ -280,6 +290,7 @@ const EditStaff: React.FC = async () => {
label: t(`Join Date`), label: t(`Join Date`),
type: "multiDate", type: "multiDate",
value: data[key] ?? "", value: data[key] ?? "",
required: true,
} as Field; } as Field;
case "joinPosition": case "joinPosition":
return { return {
@@ -288,6 +299,7 @@ const EditStaff: React.FC = async () => {
type: "combo-Obj", type: "combo-Obj",
options: positionCombo, options: positionCombo,
value: data[key].id ?? "", value: data[key].id ?? "",
required: true,
} as Field; } as Field;
case "departDate": case "departDate":
return { return {


Ladataan…
Peruuta
Tallenna