fix(striker-ui): remove custom sort comparator for network ifaces

main
Tsu-ba-me 1 year ago
parent 8846a09a2c
commit ade881f0d3
  1. 2
      striker-ui/components/NetworkInitForm.tsx
  2. 11
      striker-ui/lib/sumstring.ts

@ -52,7 +52,6 @@ import { InnerPanel, InnerPanelHeader } from './Panels';
import periodicFetch from '../lib/fetchers/periodicFetch'; import periodicFetch from '../lib/fetchers/periodicFetch';
import SelectWithLabel from './SelectWithLabel'; import SelectWithLabel from './SelectWithLabel';
import Spinner from './Spinner'; import Spinner from './Spinner';
import sumstring from '../lib/sumstring';
import { createTestInputFunction, testNotBlank } from '../lib/test_input'; import { createTestInputFunction, testNotBlank } from '../lib/test_input';
import { BodyText, MonoText, SmallText } from './Text'; import { BodyText, MonoText, SmallText } from './Text';
@ -238,7 +237,6 @@ const createNetworkInterfaceTableColumns = (
<SmallText text={value} /> <SmallText text={value} />
</MUIBox> </MUIBox>
), ),
sortComparator: (v1, v2) => sumstring(v1) - sumstring(v2),
}, },
{ {
field: 'networkInterfaceMACAddress', field: 'networkInterfaceMACAddress',

@ -1,11 +0,0 @@
const sumstring = (value: string): number => {
let sum = 0;
for (let index = 0; index < value.length; index += 1) {
sum += value.codePointAt(index) || 0;
}
return sum;
};
export default sumstring;
Loading…
Cancel
Save