add details page for "All" to be be able to get the generated feed url

This commit is contained in:
Athou
2022-08-15 09:28:03 +02:00
parent 448feedace
commit 6f26c54b62
3 changed files with 25 additions and 19 deletions

View File

@@ -69,6 +69,7 @@ export function CategoryDetailsPage() {
})
}, [setValues, category])
const editable = id !== Constants.categoryIds.all
if (!category) return <Loader />
return (
<Container>
@@ -102,26 +103,34 @@ export function CategoryDetailsPage() {
</Box>
</Input.Wrapper>
<TextInput label={t`Name`} {...form.getInputProps("name")} required />
<CategorySelect label={t`Parent Category`} {...form.getInputProps("parentId")} clearable />
<NumberInput label={t`Position`} {...form.getInputProps("position")} required min={0} />
{editable && (
<>
<TextInput label={t`Name`} {...form.getInputProps("name")} required />
<CategorySelect label={t`Parent Category`} {...form.getInputProps("parentId")} clearable />
<NumberInput label={t`Position`} {...form.getInputProps("position")} required min={0} />
</>
)}
<Group>
<Button variant="default" onClick={() => dispatch(redirectToSelectedSource())}>
<Trans>Cancel</Trans>
</Button>
<Button type="submit" leftIcon={<TbDeviceFloppy size={16} />} loading={modifyCategory.loading}>
<Trans>Save</Trans>
</Button>
<Divider orientation="vertical" />
<Button
color="red"
leftIcon={<TbTrash size={16} />}
onClick={() => openDeleteCategoryModal()}
loading={deleteCategory.loading}
>
<Trans>Delete</Trans>
</Button>
{editable && (
<>
<Button type="submit" leftIcon={<TbDeviceFloppy size={16} />} loading={modifyCategory.loading}>
<Trans>Save</Trans>
</Button>
<Divider orientation="vertical" />
<Button
color="red"
leftIcon={<TbTrash size={16} />}
onClick={() => openDeleteCategoryModal()}
loading={deleteCategory.loading}
>
<Trans>Delete</Trans>
</Button>
</>
)}
</Group>
</Stack>
</form>