Skip to content

Commit

Permalink
limit length of text in channel tile (#451)
Browse files Browse the repository at this point in the history
* fix associate orderer modal (#449)
* update release notes
---------
Signed-off-by: David Huffman <[email protected]>
  • Loading branch information
dshuffma-ibm authored Apr 13, 2023
1 parent 63681d1 commit a4381bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion packages/apollo/src/components/Channels/Channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class ChannelComponent extends Component {
return (
<div className="ibp-channel-tile-stats">
<div className="ibp-channels-orderer">
<div>{channel.orderers ? channel.orderers.map(orderer => (orderer.cluster_name ? orderer.cluster_name : orderer.name)).join(', ') : ''}</div>
<div>{channel.orderers ? channel.orderers.map(orderer => (orderer.cluster_name ? orderer.cluster_name : limit_len(orderer.name))).join(', ') : ''}</div>
</div>
<ItemTileLabels
certificateWarning={channel.cert_warning}
Expand All @@ -444,6 +444,14 @@ class ChannelComponent extends Component {
/>
</div>
);

// limit length of the orderer id on tile
function limit_len(str) {
if (typeof str === 'string' && str.length > 42) {
return str.substring(0, 42) + '...';
}
return str;
}
}

// build the channel tiles for orderers
Expand Down Expand Up @@ -794,6 +802,7 @@ class ChannelComponent extends Component {
{
header: 'ordering_service_title',
custom: channel => {
// this section only fires if te table layout (aka list) button was selected, we default to the other layout, the tile layout
return (
<div>
{channel.orderers.map((orderer, i) => (
Expand Down
4 changes: 2 additions & 2 deletions packages/athena/public/releaseNotes.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"version": "1.0.5-11",
"date": "11 April 2023",
"version": "1.0.5-13",
"date": "13 April 2023",
"description": [
{
"title": "Bug & security fixes",
Expand Down

0 comments on commit a4381bc

Please sign in to comment.