Skip to content

Commit 5740f8e

Browse files
committed
fix: submissions page — remove export CSV, fix detail dialog layout
- Remove Export CSV button and exportSubmissions API call - Submission detail dialog: left-aligned content, grid layout for meta fields (80px label / 1fr value) and data rows (140px / 1fr) with zebra striping and neutral100 background on meta section
1 parent 2b4aaeb commit 5740f8e

1 file changed

Lines changed: 58 additions & 36 deletions

File tree

admin/src/pages/SubmissionsPage.tsx

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function SubmissionsPage() {
9393
<SingleSelect
9494
aria-label="Filter by status"
9595
value={statusFilter}
96-
onChange={(val: string) => setStatusFilter(val)}
96+
onChange={(val) => setStatusFilter(String(val))}
9797
placeholder="All statuses"
9898
size="S"
9999
>
@@ -102,16 +102,6 @@ export function SubmissionsPage() {
102102
<SingleSelectOption value="read">Read</SingleSelectOption>
103103
<SingleSelectOption value="archived">Archived</SingleSelectOption>
104104
</SingleSelect>
105-
<Button
106-
variant="secondary"
107-
size="S"
108-
onClick={() => window.open(
109-
`/strapi-plugin-form-builder-cms/submissions/${formId}/export?format=csv`,
110-
'_blank'
111-
)}
112-
>
113-
Export CSV
114-
</Button>
115105
</Flex>
116106
</Flex>
117107

@@ -177,31 +167,63 @@ export function SubmissionsPage() {
177167
<Dialog.Content>
178168
<Dialog.Header>Submission #{selected.id}</Dialog.Header>
179169
<Dialog.Body>
180-
<Flex direction="column" gap={2}>
181-
<Flex gap={2}>
182-
<Typography fontWeight="bold">Status:</Typography>
183-
<Badge>{selected.status}</Badge>
184-
</Flex>
185-
<Flex gap={2}>
186-
<Typography fontWeight="bold">Date:</Typography>
187-
<Typography>{new Date(selected.createdAt).toLocaleString()}</Typography>
188-
</Flex>
189-
<Flex gap={2}>
190-
<Typography fontWeight="bold">IP:</Typography>
191-
<Typography>{selected.ipAddress || '—'}</Typography>
192-
</Flex>
193-
<Box marginTop={3}>
194-
<Typography variant="beta" marginBottom={2}>Data</Typography>
195-
{dataFields.map((f) => (
196-
<Flex key={f.id} gap={2} marginBottom={1}>
197-
<Typography fontWeight="semiBold" style={{ minWidth: 120 }}>
198-
{f.label}:
199-
</Typography>
200-
<Typography>{String(selected.data?.[f.name] ?? '—')}</Typography>
201-
</Flex>
202-
))}
203-
</Box>
204-
</Flex>
170+
<div style={{ textAlign: 'left' }}>
171+
{/* Meta */}
172+
<div style={{
173+
display: 'grid',
174+
gridTemplateColumns: '80px 1fr',
175+
rowGap: 10,
176+
columnGap: 16,
177+
background: 'var(--strapi-neutral-100)',
178+
borderRadius: 6,
179+
padding: '12px 16px',
180+
marginBottom: 16,
181+
}}>
182+
<Typography variant="pi" fontWeight="semiBold" textColor="neutral500">Status</Typography>
183+
<Badge variant={statusColor[selected.status]}>{selected.status.toUpperCase()}</Badge>
184+
185+
<Typography variant="pi" fontWeight="semiBold" textColor="neutral500">Date</Typography>
186+
<Typography variant="pi">{new Date(selected.createdAt).toLocaleString()}</Typography>
187+
188+
<Typography variant="pi" fontWeight="semiBold" textColor="neutral500">IP</Typography>
189+
<Typography variant="pi">{selected.ipAddress || '—'}</Typography>
190+
</div>
191+
192+
{/* Submitted data */}
193+
<Typography variant="sigma" textColor="neutral400" style={{ display: 'block', marginBottom: 8 }}>
194+
SUBMITTED DATA
195+
</Typography>
196+
<div style={{
197+
border: '1px solid var(--strapi-neutral-200)',
198+
borderRadius: 6,
199+
overflow: 'hidden',
200+
}}>
201+
{dataFields.length === 0 ? (
202+
<Typography variant="pi" textColor="neutral500" style={{ padding: '12px 16px', display: 'block' }}>
203+
No data fields.
204+
</Typography>
205+
) : dataFields.map((f, i) => {
206+
const val = String(selected.data?.[f.name] ?? '');
207+
return (
208+
<div key={f.id} style={{
209+
display: 'grid',
210+
gridTemplateColumns: '140px 1fr',
211+
columnGap: 16,
212+
padding: '10px 16px',
213+
background: i % 2 === 0 ? '#fff' : 'var(--strapi-neutral-100)',
214+
alignItems: 'start',
215+
}}>
216+
<Typography variant="pi" fontWeight="semiBold" textColor="neutral600" style={{ whiteSpace: 'nowrap' }}>
217+
{f.label}
218+
</Typography>
219+
<Typography variant="pi" textColor={val ? 'neutral800' : 'neutral400'}>
220+
{val || '—'}
221+
</Typography>
222+
</div>
223+
);
224+
})}
225+
</div>
226+
</div>
205227
</Dialog.Body>
206228
<Dialog.Footer>
207229
<Dialog.Cancel>

0 commit comments

Comments
 (0)