Merge pull request 'amalia/13-jan-26' (#109) from amalia/13-jan-26 into main

Reviewed-on: http://wibugit.wibudev.com/wibu/jenna-mcp/pulls/109
This commit is contained in:
2026-01-13 17:18:01 +08:00
5 changed files with 22 additions and 15 deletions

View File

@@ -207,7 +207,7 @@ export default function DesaSetting({
</Table.Tr> </Table.Tr>
</Table.Thead> </Table.Thead>
<Table.Tbody> <Table.Tbody>
{list?.map((v: any) => ( {list.length > 0 && list?.map((v: any) => (
<Table.Tr key={v.id}> <Table.Tr key={v.id}>
<Table.Td>{v.name}</Table.Td> <Table.Td>{v.name}</Table.Td>
<Table.Td> <Table.Td>

View File

@@ -4,19 +4,17 @@ import {
Button, Button,
Divider, Divider,
Flex, Flex,
Grid,
Group, Group,
Input,
List, List,
Modal, Modal,
Stack, Stack,
Table, Table,
Text, Text,
Title, Title,
Tooltip, Tooltip
} from "@mantine/core"; } from "@mantine/core";
import { useDisclosure, useShallowEffect } from "@mantine/hooks"; import { useDisclosure, useShallowEffect } from "@mantine/hooks";
import { IconEdit, IconEye, IconPlus, IconTrash } from "@tabler/icons-react"; import { IconEye, IconTrash } from "@tabler/icons-react";
import type { JsonValue } from "generated/prisma/runtime/library"; import type { JsonValue } from "generated/prisma/runtime/library";
import { useState } from "react"; import { useState } from "react";
import useSWR from "swr"; import useSWR from "swr";
@@ -625,7 +623,7 @@ export default function KategoriPelayananSurat({
</Table.Tr> </Table.Tr>
</Table.Thead> </Table.Thead>
<Table.Tbody> <Table.Tbody>
{list?.map((v: any) => ( {list.length > 0 && list?.map((v: any) => (
<Table.Tr key={v.id}> <Table.Tr key={v.id}>
<Table.Td>{v.name}</Table.Td> <Table.Td>{v.name}</Table.Td>
<Table.Td> <Table.Td>

View File

@@ -73,7 +73,7 @@ export default function DashboardLayout() {
<AppShell <AppShell
padding="lg" padding="lg"
navbar={{ navbar={{
width: 260, width: 300,
breakpoint: "sm", breakpoint: "sm",
collapsed: { mobile: !opened, desktop: !opened }, collapsed: { mobile: !opened, desktop: !opened },
}} }}
@@ -215,8 +215,6 @@ function NavigationDashboard() {
const location = useLocation(); const location = useLocation();
const [permissions, setPermissions] = useState<JsonValue[]>([]); const [permissions, setPermissions] = useState<JsonValue[]>([]);
console.log(location)
useEffect(() => { useEffect(() => {
async function fetchPermissions() { async function fetchPermissions() {
const { data } = await apiFetch.api.user.find.get(); const { data } = await apiFetch.api.user.find.get();
@@ -292,14 +290,19 @@ function NavigationDashboard() {
.map((item) => ( .map((item) => (
<NavLink <NavLink
key={item.path} key={item.path}
active={isActive(item.path as keyof typeof clientRoute)} active={isActive(item.path as keyof typeof clientRoute) ||
(location.pathname == "/scr/dashboard/pelayanan-surat/detail-pelayanan" && item.path == "/scr/dashboard/pelayanan-surat/list-pelayanan") ||
(location.pathname == "/scr/dashboard/pengaduan/detail" && item.path == "/scr/dashboard/pengaduan/list") ||
(location.pathname == "/scr/dashboard/warga/detail-warga" && item.path == "/scr/dashboard/warga/list-warga")}
leftSection={item.icon} leftSection={item.icon}
label={ label={
<Flex align="center" gap={6}> <Flex align="center" gap={6}>
<Text fw={500}>{item.label}</Text> <Text fw={500}>{item.label}</Text>
{(isActive(item.path as keyof typeof clientRoute) || {(
isActive(item.path as keyof typeof clientRoute) ||
(location.pathname == "/scr/dashboard/pelayanan-surat/detail-pelayanan" && item.path == "/scr/dashboard/pelayanan-surat/list-pelayanan") || (location.pathname == "/scr/dashboard/pelayanan-surat/detail-pelayanan" && item.path == "/scr/dashboard/pelayanan-surat/list-pelayanan") ||
(location.pathname == "/scr/dashboard/pengaduan/detail" && item.path == "/scr/dashboard/pengaduan/list") (location.pathname == "/scr/dashboard/pengaduan/detail" && item.path == "/scr/dashboard/pengaduan/list") ||
(location.pathname == "/scr/dashboard/warga/detail-warga" && item.path == "/scr/dashboard/warga/list-warga")
) )
&& ( && (
<Badge <Badge
@@ -319,7 +322,10 @@ function NavigationDashboard() {
navigate(clientRoutes[item.path as keyof typeof clientRoute]) navigate(clientRoutes[item.path as keyof typeof clientRoute])
} }
style={{ style={{
backgroundColor: isActive(item.path as keyof typeof clientRoute) backgroundColor: isActive(item.path as keyof typeof clientRoute) ||
(location.pathname == "/scr/dashboard/pelayanan-surat/detail-pelayanan" && item.path == "/scr/dashboard/pelayanan-surat/list-pelayanan") ||
(location.pathname == "/scr/dashboard/pengaduan/detail" && item.path == "/scr/dashboard/pengaduan/list") ||
(location.pathname == "/scr/dashboard/warga/detail-warga" && item.path == "/scr/dashboard/warga/list-warga")
? "rgba(0,255,200,0.1)" ? "rgba(0,255,200,0.1)"
: "transparent", : "transparent",
borderRadius: "8px", borderRadius: "8px",

View File

@@ -275,6 +275,7 @@ function DetailDataPengajuan({
} }
useShallowEffect(() => { useShallowEffect(() => {
console.log('jalan', viewImg)
if (viewImg) { if (viewImg) {
setOpenedPreviewFile(true); setOpenedPreviewFile(true);
} }
@@ -374,6 +375,7 @@ function DetailDataPengajuan({
open={openedPreviewFile && !_.isEmpty(viewImg.file)} open={openedPreviewFile && !_.isEmpty(viewImg.file)}
onClose={() => { onClose={() => {
setOpenedPreviewFile(false); setOpenedPreviewFile(false);
setViewImg({ file: "", folder: "" })
}} }}
folder={viewImg.folder} folder={viewImg.folder}
fileName={viewImg.file} fileName={viewImg.file}

View File

@@ -18,12 +18,13 @@ import {
import type { JsonValue } from "generated/prisma/runtime/library"; import type { JsonValue } from "generated/prisma/runtime/library";
import _ from "lodash"; import _ from "lodash";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useLocation } from "react-router-dom"; import { useLocation, useNavigate } from "react-router-dom";
export default function DetailSettingPage() { export default function DetailSettingPage() {
const { search } = useLocation(); const { search } = useLocation();
const query = new URLSearchParams(search); const query = new URLSearchParams(search);
const type = query.get("type"); const type = query.get("type");
const navigate = useNavigate();
const [permissions, setPermissions] = useState<JsonValue[]>([]); const [permissions, setPermissions] = useState<JsonValue[]>([]);
const dataMenu = [ const dataMenu = [
{ title: "Dashboard", link: "/scr/dashboard/dashboard-home", active: false }, { title: "Dashboard", link: "/scr/dashboard/dashboard-home", active: false },
@@ -114,7 +115,7 @@ export default function DetailSettingPage() {
.map((item) => ( .map((item) => (
<NavLink <NavLink
key={item.key} key={item.key}
href={"?type=" + item.path} onClick={()=>{navigate("?type=" + item.path)}}
label={item.label} label={item.label}
leftSection={item.icon} leftSection={item.icon}
active={ active={