Skip to content

Commit

Permalink
[grid] Avoiding Nodes to move around in the UI
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
diemol committed Sep 16, 2021
1 parent 3797357 commit a03780c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions javascript/grid-ui/src/screens/Overview/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import Loading from '../../components/Loading/Loading'
import Error from '../../components/Error/Error'
import StereotypeInfo from '../../models/stereotype-info'
import browserVersion from '../../util/browser-version'
import Capabilities from "../../models/capabilities";
import Capabilities from '../../models/capabilities'

const useStyles = (theme: Theme): StyleRules => createStyles(
{
Expand Down Expand Up @@ -129,12 +129,12 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
const message = 'There has been an error while loading the Nodes from the Grid.'
return (
<Grid container spacing={3}>
<Error message={message} errorMessage={error} />
<Error message={message} errorMessage={error}/>
</Grid>
)
}

const nodes = data.nodesInfo.nodes.map((node) => {
const unSortedNodes = data.nodesInfo.nodes.map((node) => {
const osInfo: OsInfo = {
name: node.osInfo.name,
version: node.osInfo.version,
Expand Down Expand Up @@ -170,6 +170,7 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
return newNode
})

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

0 comments on commit a03780c

Please sign in to comment.