@@ -772,7 +788,9 @@ export default function FormImageUpdate() {
-
+
@@ -812,7 +830,9 @@ export default function FormImageUpdate() {
rel="noopener noreferrer"
className="text-blue-500 text-sm"
>
- {t("view-file", { defaultValue: "View File" })}
+ {t("view-file", {
+ defaultValue: "View File",
+ })}
@@ -830,7 +850,9 @@ export default function FormImageUpdate() {
}
className="form-checkbox"
/>
- {t("all", { defaultValue: "All" })}
+
+ {t("all", { defaultValue: "All" })}
+
@@ -980,7 +1002,9 @@ export default function FormImageUpdate() {
-
+
{options.map((option: Option) => (
-
{t("suggestion-box", { defaultValue: "Suggestion Box" })} (0)
+
+ {t("suggestion-box", { defaultValue: "Suggestion Box" })} (0)
+
{t("information", { defaultValue: "Information" })}:
@@ -1014,9 +1040,11 @@ export default function FormImageUpdate() {
-
+
+
+
diff --git a/components/form/content/teks-detail-form.tsx b/components/form/content/teks-detail-form.tsx
index 19804d13..1c72861b 100644
--- a/components/form/content/teks-detail-form.tsx
+++ b/components/form/content/teks-detail-form.tsx
@@ -18,10 +18,6 @@ import {
SelectValue,
} from "@/components/ui/select";
import { Checkbox } from "@/components/ui/checkbox";
-import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
-
-import { register } from "module";
-import { Switch } from "@/components/ui/switch";
import Cookies from "js-cookie";
import {
createMedia,
@@ -119,13 +115,13 @@ export default function FormTeksDetail() {
const userId = getCookiesDecrypt("uie");
const userLevelId = getCookiesDecrypt("ulie");
const roleId = getCookiesDecrypt("urie");
-
+ const userLevelName = Cookies.get("state");
+ const userLevelNumber = getCookiesDecrypt("ulne");
const [modalOpen, setModalOpen] = useState(false);
const { id } = useParams() as { id: string };
console.log(id);
const editor = useRef(null);
type ImageSchema = z.infer
;
-
const [selectedFiles, setSelectedFiles] = useState([]);
const taskId = Cookies.get("taskId");
const scheduleId = Cookies.get("scheduleId");
@@ -472,16 +468,23 @@ export default function FormTeksDetail() {
{/* Show the category from details if it doesn't exist in categories list */}
- {detail && !categories.find(cat => String(cat.id) === String(detail.category.id)) && (
-
- {detail.category.name}
-
- )}
+ {detail &&
+ !categories.find(
+ (cat) =>
+ String(cat.id) === String(detail.category.id)
+ ) && (
+
+ {detail.category.name}
+
+ )}
{categories.map((category) => (
-
+
{category.name}
))}
@@ -873,7 +876,11 @@ export default function FormTeksDetail() {
- {Number(detail?.needApprovalFromLevel) == Number(userLevelId) ? (
+ {Number(detail?.needApprovalFromLevel) == Number(userLevelId) ||
+ (detail?.needApprovalFromLevel && Number(userLevelNumber) == 1) ||
+ (detail?.isInternationalMedia == true &&
+ detail?.isForwardFromNational == true &&
+ Number(detail?.statusId) == 1) ? (
Number(detail?.uploadedById) == Number(userId) ? (
""
) : (
diff --git a/components/form/content/teks-form.tsx b/components/form/content/teks-form.tsx
index fb6004dc..9f8dbb3f 100644
--- a/components/form/content/teks-form.tsx
+++ b/components/form/content/teks-form.tsx
@@ -1492,9 +1492,11 @@ export default function FormTeks() {
-
+
+
+