amalia/15-apr-26 #9

Merged
amaliadwiy merged 4 commits from amalia/15-apr-26 into main 2026-04-15 15:25:56 +08:00
39 changed files with 964 additions and 244 deletions
Showing only changes of commit 16ea551b4c - Show all commits

View File

@@ -68,6 +68,12 @@ function AppErrorsPage() {
fetch(API_URLS.getBugs(page, search, app, status)).then((r) => r.json()),
})
// Fetch apps for the dropdown
const { data: appsList } = useQuery({
queryKey: ['apps-list'],
queryFn: () => fetch('/api/apps').then((r) => r.json()),
})
// Create Bug Modal Logic
const [opened, { open, close }] = useDisclosure(false)
const [isSubmitting, setIsSubmitting] = useState(false)
@@ -344,12 +350,11 @@ function AppErrorsPage() {
<SimpleGrid cols={2}>
<Select
label="Application"
data={[
{ value: 'desa-plus', label: 'Desa+' },
{ value: 'hipmi', label: 'Hipmi' },
]}
data={appsList?.map((a: any) => ({ value: a.id, label: a.name })) || []}
value={createForm.app}
onChange={(val) => setCreateForm({ ...createForm, app: val as any })}
placeholder="Select application"
disabled={!appsList}
/>
<Select
label="Source"

View File

@@ -66,6 +66,12 @@ function ListErrorsPage() {
fetch(API_URLS.getBugs(page, search, app, status)).then((r) => r.json()),
})
// Fetch apps for the dropdown
const { data: appsList } = useQuery({
queryKey: ['apps-list'],
queryFn: () => fetch('/api/apps').then((r) => r.json()),
})
// Create Bug Modal Logic
const [opened, { open, close }] = useDisclosure(false)
const [isSubmitting, setIsSubmitting] = useState(false)
@@ -353,12 +359,11 @@ function ListErrorsPage() {
<SimpleGrid cols={2}>
<Select
label="Application"
data={[
{ value: 'desa-plus', label: 'Desa+' },
{ value: 'hipmi', label: 'Hipmi' },
]}
data={appsList?.map((a: any) => ({ value: a.id, label: a.name })) || []}
value={createForm.app}
onChange={(val) => setCreateForm({ ...createForm, app: val as any })}
placeholder="Select application"
disabled={!appsList}
/>
<Select
label="Source"
@@ -451,12 +456,12 @@ function ListErrorsPage() {
placeholder="Application"
data={[
{ value: 'all', label: 'All Applications' },
{ value: 'desa-plus', label: 'Desa+' },
{ value: 'hipmi', label: 'Hipmi' },
...(appsList?.map((a: any) => ({ value: a.id, label: a.name })) || []),
]}
value={app}
onChange={(val) => setApp(val || 'all')}
radius="md"
disabled={!appsList}
/>
<Select
placeholder="Status"