Skip to content
Snippets Groups Projects
Commit 7975ab48 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[ivette] re-order properties

parent 90b5e08f
No related branches found
No related tags found
No related merge requests found
...@@ -53,20 +53,34 @@ interface Property { ...@@ -53,20 +53,34 @@ interface Property {
const bySource = const bySource =
Compare.byFields<SourceLoc>({ file: Compare.alpha, line: Compare.primitive }); Compare.byFields<SourceLoc>({ file: Compare.alpha, line: Compare.primitive });
const byProperty = const byStatus =
Compare.byFields<Property>({ Compare.byRank(
function: Compare.defined(Compare.alpha), 'inconsistent',
source: bySource, 'invalid',
kind: Compare.primitive, 'invalid_under_hyp',
status: Compare.primitive, 'unknown',
kinstr: Compare.primitive, 'valid_under_hyp',
key: Compare.primitive, 'valid',
}); 'invalid_but_dead',
'unknown_but_dead',
'valid_but_dead',
'never_tried',
'considered_valid',
);
const byProperty: Compare.ByFields<Property> = {
status: byStatus,
function: Compare.defined(Compare.alpha),
source: bySource,
kind: Compare.primitive,
key: Compare.primitive,
kinstr: Compare.primitive,
};
class PropertyModel extends ArrayModel<Property> { class PropertyModel extends ArrayModel<Property> {
constructor() { constructor() {
super('key'); super('key');
this.setNaturalOrder(byProperty); this.setOrderingByFields(byProperty);
} }
} }
...@@ -86,7 +100,6 @@ const RenderTable = () => { ...@@ -86,7 +100,6 @@ const RenderTable = () => {
}, [model, items]); }, [model, items]);
// Callbacks // Callbacks
const getStatus = React.useCallback( const getStatus = React.useCallback(
({ status: st }: Property) => (statusDict[st] ?? { label: st }), ({ status: st }: Property) => (statusDict[st] ?? { label: st }),
[statusDict], [statusDict],
...@@ -104,6 +117,7 @@ const RenderTable = () => { ...@@ -104,6 +117,7 @@ const RenderTable = () => {
return ( return (
<Table<string, Property> <Table<string, Property>
model={model} model={model}
sorting={model}
selection={selection} selection={selection}
onSelection={onSelection} onSelection={onSelection}
> >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment