feat: sort entities on Domain result

This commit is contained in:
Maël Gangloff
2024-07-27 17:19:25 +02:00
parent eaab8ce1b2
commit f8f9aeb416
8 changed files with 20 additions and 24 deletions

View File

@@ -156,7 +156,10 @@ export default function DomainSearchPage() {
<List
className="demo-loadmore-list"
itemLayout="horizontal"
dataSource={domain.entities}
dataSource={domain.entities.sort((e1, e2) => {
const p = (r: string[]) => r.includes('registrant') ? 4 : r.includes('administrative') ? 3 : r.includes('billing') ? 2 : 1
return p(e2.roles) - p(e1.roles)
})}
renderItem={(e) => {
const jCard = vCard.fromJSON(e.entity.jCard)
let name = ''

View File

@@ -2,6 +2,6 @@ import React from "react";
export default function EntitySearchPage() {
return <p>
Entity Search Page
Not implemented
</p>
}

View File

@@ -2,6 +2,6 @@ import React from "react";
export default function NameserverSearchPage() {
return <p>
NS Search Page
Not implemented
</p>
}