Add reset order button to website settings

This commit is contained in:
Chris Walsh 2022-07-23 23:07:53 -07:00
parent ef4bf8282a
commit 76bdb6b1d6
No known key found for this signature in database
GPG Key ID: 28EE0CCA6032019E
3 changed files with 22 additions and 3 deletions

View File

@ -182,6 +182,13 @@ export default function WebsiteSettings() {
});
}
function resetWebsiteOrder() {
setDashboard({
...store,
websiteOrdering: {},
});
}
if (!data) {
return null;
}
@ -207,9 +214,14 @@ export default function WebsiteSettings() {
<div>
<FormattedMessage id="label.websites" defaultMessage="Websites" />
</div>
<Button icon={<Plus />} size="small" onClick={() => setAddWebsite(true)}>
<FormattedMessage id="label.add-website" defaultMessage="Add website" />
</Button>
<div className={styles.headerButtons}>
<Button size="small" onClick={() => resetWebsiteOrder()}>
<FormattedMessage id="label.reset-order" defaultMessage="Reset order" />
</Button>
<Button icon={<Plus />} size="small" onClick={() => setAddWebsite(true)}>
<FormattedMessage id="label.add-website" defaultMessage="Add website" />
</Button>
</div>
</PageHeader>
<Table
columns={user.is_admin ? adminColumns : columns}

View File

@ -11,3 +11,9 @@
.detailLink {
width: 100%;
}
.headerButtons {
display: flex;
justify-content: flex-end;
gap: 10px;
}

View File

@ -47,6 +47,7 @@
"label.refresh": "Refresh",
"label.required": "Required",
"label.reset": "Reset",
"label.reset-order": "Reset order",
"label.reset-website": "Reset statistics",
"label.save": "Save",
"label.settings": "Settings",