Skip to content

Commit 0a0314d

Browse files
author
Alberto Iannaccone
committed
board select dialog: show variant text when no board is found
1 parent 141d118 commit 0a0314d

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

Diff for: arduino-ide-extension/src/browser/boards/boards-config.tsx

+24-14
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,18 @@ export class BoardsConfig extends React.Component<
299299
}
300300
}
301301

302+
const boardsList = Array.from(distinctBoards.values()).map((board) => (
303+
<Item<BoardWithPackage>
304+
key={toKey(board)}
305+
item={board}
306+
label={board.name}
307+
details={board.details}
308+
selected={board.selected}
309+
onClick={this.selectBoard}
310+
missing={board.missing}
311+
/>
312+
));
313+
302314
return (
303315
<React.Fragment>
304316
<div className="search">
@@ -315,19 +327,17 @@ export class BoardsConfig extends React.Component<
315327
/>
316328
<i className="fa fa-search"></i>
317329
</div>
318-
<div className="boards list">
319-
{Array.from(distinctBoards.values()).map((board) => (
320-
<Item<BoardWithPackage>
321-
key={toKey(board)}
322-
item={board}
323-
label={board.name}
324-
details={board.details}
325-
selected={board.selected}
326-
onClick={this.selectBoard}
327-
missing={board.missing}
328-
/>
329-
))}
330-
</div>
330+
{boardsList.length > 0 ? (
331+
<div className="boards list">{boardsList}</div>
332+
) : (
333+
<div className="no-result">
334+
{nls.localize(
335+
'arduino/board/noBoardsFound',
336+
'No boards found for "{0}"',
337+
query
338+
)}
339+
</div>
340+
)}
331341
</React.Fragment>
332342
);
333343
}
@@ -342,7 +352,7 @@ export class BoardsConfig extends React.Component<
342352
);
343353
}
344354
return !ports.length ? (
345-
<div className="loading noselect">
355+
<div className="no-result">
346356
{nls.localize('arduino/board/noPortsDiscovered', 'No ports discovered')}
347357
</div>
348358
) : (

Diff for: arduino-ide-extension/src/browser/style/boards-config-dialog.css

+8
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,11 @@ div#select-board-dialog .selectBoardContainer .list .item.selected i {
295295
display: none;
296296
}
297297
}
298+
299+
#select-board-dialog .no-result {
300+
text-transform: uppercase;
301+
height: 100%;
302+
user-select: none;
303+
padding: 10px 5px;
304+
overflow-wrap: break-word;
305+
}

Diff for: i18n/en.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"getBoardInfo": "Get Board Info",
1616
"inSketchbook": " (in Sketchbook)",
1717
"installNow": "The \"{0} {1}\" core has to be installed for the currently selected \"{2}\" board. Do you want to install it now?",
18+
"noBoardsFound": "No boards found for \"{0}\"",
1819
"noFQBN": "The FQBN is not available for the selected board \"{0}\". Do you have the corresponding core installed?",
1920
"noPortsDiscovered": "No ports discovered",
2021
"noPortsSelected": "No ports selected for board: '{0}'.",

0 commit comments

Comments
 (0)