upd: list app
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user