-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort the nodes table #987
base: staging
Are you sure you want to change the base?
Sort the nodes table #987
Conversation
{node.io_latency_ms && node.io_latency_ms > 1} | ||
</td> | ||
</tr> | ||
) | ||
|
||
const compareSemanticVersions = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add tests for this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests have now been added that cover the compareSemanticVersions, via sorting the Version column.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see this function tested separately and cover all cases. similar to this:
explorer/src/containers/shared/test/utils.test.ts
Lines 13 to 33 in 1e808ad
it('isEarlierVersion compare versions correctly', () => { | |
expect(isEarlierVersion('1.6.2', 'N/A')).toEqual(false) | |
expect(isEarlierVersion('N/A', '0.9.4')).toEqual(true) | |
expect(isEarlierVersion('N/A', 'N/A')).toEqual(false) | |
expect(isEarlierVersion('1.9.4', '1.9.4')).toEqual(false) | |
expect(isEarlierVersion('0.9.2', '1.8.4')).toEqual(true) | |
expect(isEarlierVersion('1.8.2', '1.9.4')).toEqual(true) | |
expect(isEarlierVersion('1.9.2', '1.9.4')).toEqual(true) | |
expect(isEarlierVersion('1.9.2', '1.9.2-b1')).toEqual(false) | |
expect(isEarlierVersion('1.9.2', '1.9.2-rc2')).toEqual(false) | |
expect(isEarlierVersion('1.9.4-b2', '1.9.4-rc1')).toEqual(true) | |
expect(isEarlierVersion('1.9.4-b1', '1.9.4-b2')).toEqual(true) | |
expect(isEarlierVersion('1.9.4-rc1', '1.9.4-rc2')).toEqual(true) | |
expect(isEarlierVersion('1.6.2', '0.9.4')).toEqual(false) | |
expect(isEarlierVersion('1.9.4', '1.8.6')).toEqual(false) | |
expect(isEarlierVersion('1.9.4', '1.9.2-rc5')).toEqual(false) | |
expect(isEarlierVersion('1.8.0-rc1', '1.8.0')).toEqual(true) | |
expect(isEarlierVersion('1.9.4-rc1', '1.9.4-b3')).toEqual(false) | |
expect(isEarlierVersion('1.9.4-b2', '1.9.4-b1')).toEqual(false) | |
expect(isEarlierVersion('1.9.4-rc2', '1.9.4-rc1')).toEqual(false) | |
}) |
Also, could you add an image to the description showing how the arrow would look like? Thanks! |
screen shots added |
{t('node_pubkey')} | ||
</a> | ||
</th> | ||
<th className={getClassNamesFor('ip', 'ip')}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe can create a reusable component like NodeTableHeader
and just call <NodeTableHeader title='ip'>
for instance
Add sorting to the nodes table.
Context of Change
Much needed ability to sort the tables of nodes via the headers.
Type of Change