Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ All notable changes to this project will be documented in this file.
- Added command to migrate config.json files.
- Fix data fetching bug
- Refactored screen layout commands.
- Moved list components (search and checkboxes) around

### NB! Prior to 3.x the project was split into separate repositories

Expand Down
9 changes: 7 additions & 2 deletions assets/admin/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ body {
height: 100vh;
height: -webkit-fill-available;
max-height: 100vh;
// overflow-x: auto;
// overflow-y: hidden; // TODO: Why was this added?
}

// To make multicomponent look like bootstrap for now
Expand Down Expand Up @@ -143,3 +141,10 @@ body {
right: 0;
margin: 2em;
}

.delete-search-button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-color: var(--bs-border-color);
background-color: var(--bs-tertiary-bg);
}
92 changes: 44 additions & 48 deletions assets/admin/components/util/list/list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,15 @@ function List({

return (
<>
<Row className="my-2">
<Col>
{displaySearch && (
<SearchBox value={searchParams} onChange={onSearch} />
)}
</Col>
<>
{enableScreenStatus && (
<Col md="auto">
<div className="my-2">
<Row>
<Col>
{displaySearch && (
<SearchBox value={searchParams} onChange={onSearch} />
)}
</Col>
<Col className="d-flex justify-content-end">
{enableScreenStatus && (
<Select
onChange={onScreenStatus}
name="screenStatus"
Expand Down Expand Up @@ -281,41 +281,7 @@ function List({
]}
value={screenStatusParam}
/>
</Col>
)}
{displayPublished && publishedParams && (
<Col md="auto">
<>
<FormCheckbox
label={t("published")}
onChange={onIsPublished}
name="published"
value={publishedParams === "published"}
/>
<FormCheckbox
label={t("not-published")}
name="not-published"
onChange={onIsPublished}
value={publishedParams === "not-published"}
/>
</>
</Col>
)}
{createdByParams && showCreatedByFilter && (
<Col md="auto">
<>
<FormCheckbox
label={t("my-content")}
name="current-user"
onChange={onIsCreatedByChange}
value={createdByParams === "current-user"}
/>
</>
</Col>
)}
</>
<Col md="auto" className="d-flex justify-content-end">
<>
)}
{handleDelete && (
<Button
variant="danger"
Expand All @@ -327,7 +293,7 @@ function List({
accept: deleteHandler,
})
}
className="me-3"
className="mx-2"
>
{t("delete-button")}
</Button>
Expand All @@ -342,10 +308,40 @@ function List({
{t("deselect-all")}
</Button>
)}
</Col>
</Row>
<Row className="my-3">
<>
{createdByParams && showCreatedByFilter && (
<div className="d-flex flex-row">
<FormCheckbox
label={t("my-content")}
name="current-user"
onChange={onIsCreatedByChange}
value={createdByParams === "current-user"}
/>
{displayPublished && publishedParams && (
<>
<FormCheckbox
formGroupClasses="mx-4"
label={t("published")}
onChange={onIsPublished}
name="published"
value={publishedParams === "published"}
/>
<FormCheckbox
label={t("not-published")}
name="not-published"
onChange={onIsPublished}
value={publishedParams === "not-published"}
/>
</>
)}
</div>
)}
</>
</Col>
</Row>
<Row />
</Row>
</div>
<Table data={data} columns={columns} isFetching={isFetching} />
{!isFetching && (
<Pagination
Expand Down
4 changes: 2 additions & 2 deletions assets/admin/components/util/search-box/search-box.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function SearchBox({ onChange, value = "", showLabel = false }) {
autoFocus
placeholder={t("placeholder")}
id="search-field"
aria-label="search-box-aria-label"
aria-label={t("search-box-aria-label")}
role="search"
name="search"
value={value ?? ""}
Expand All @@ -37,7 +37,7 @@ function SearchBox({ onChange, value = "", showLabel = false }) {
/>
<div className="input-group-append">
<button
className="btn btn-outline-secondary"
className="btn btn-outline-secondary delete-search-button"
type="button"
onClick={() => onChange("")}
>
Expand Down