Skip to content

Commit a03780c

Browse files
committed
[grid] Avoiding Nodes to move around in the UI
[skip ci]
1 parent 3797357 commit a03780c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

javascript/grid-ui/src/screens/Overview/Overview.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import Loading from '../../components/Loading/Loading'
3636
import Error from '../../components/Error/Error'
3737
import StereotypeInfo from '../../models/stereotype-info'
3838
import browserVersion from '../../util/browser-version'
39-
import Capabilities from "../../models/capabilities";
39+
import Capabilities from '../../models/capabilities'
4040

4141
const useStyles = (theme: Theme): StyleRules => createStyles(
4242
{
@@ -129,12 +129,12 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
129129
const message = 'There has been an error while loading the Nodes from the Grid.'
130130
return (
131131
<Grid container spacing={3}>
132-
<Error message={message} errorMessage={error} />
132+
<Error message={message} errorMessage={error}/>
133133
</Grid>
134134
)
135135
}
136136

137-
const nodes = data.nodesInfo.nodes.map((node) => {
137+
const unSortedNodes = data.nodesInfo.nodes.map((node) => {
138138
const osInfo: OsInfo = {
139139
name: node.osInfo.name,
140140
version: node.osInfo.version,
@@ -170,6 +170,7 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
170170
return newNode
171171
})
172172

173+
const nodes = unSortedNodes.sort((a, b) => (a.id < b.id ? -1 : 1))
173174
if (nodes.length === 0) {
174175
const shortMessage = 'The Grid has no registered Nodes yet.'
175176
return (

0 commit comments

Comments
 (0)