Merge pull request #1338 from cywio/reorder-websites

Add ability to reorder websites on dashboard
This commit is contained in:
Mike Cao 2022-08-03 18:05:42 -05:00 committed by GitHub
commit 4de1858950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 238 additions and 19 deletions

View file

@ -78,3 +78,14 @@ export function stringToColor(str) {
}
return color;
}
export function orderByWebsiteMap(websites, orderMap) {
if (!websites) return [];
let ordered = [...websites];
for (let website of websites) {
ordered[orderMap[website.website_uuid]] = website;
}
return ordered;
}