diff --git a/client/src/components/pipelines/launch/dialogs/MetadataBrowser.js b/client/src/components/pipelines/launch/dialogs/MetadataBrowser.js index 1d150ff071..d7a56ae8f9 100644 --- a/client/src/components/pipelines/launch/dialogs/MetadataBrowser.js +++ b/client/src/components/pipelines/launch/dialogs/MetadataBrowser.js @@ -117,7 +117,7 @@ export default class MetadataBrowser extends React.Component { selectedMetadataClassEntity = this.state.selectedMetadataClassEntity[0].name; folderId = this.state.selectedMetadataClassEntity[0].parent.parentId; } - const entitiesIds = this.state.selectedMetadata.map(metadata => metadata.rowKey.value); + const entitiesIds = this.state.selectedMetadata.slice(); const metadataLibraryLocation = { folderId: this.state.folderId, metadataClassName: this.state.metadataClassName @@ -375,7 +375,15 @@ export default class MetadataBrowser extends React.Component { }; onSelectMetadataItems = (items) => { - const selectedMetadata = items || []; + const selectedMetadata = (items || []).map((o) => { + if (typeof o === 'number') { + return o; + } + if (typeof o === 'object' && o.rowKey) { + return Number(o.rowKey.value); + } + return undefined; + }).filter(Boolean); this.setState({selectedMetadata}); }; diff --git a/client/src/components/runs/logs/Log.js b/client/src/components/runs/logs/Log.js index 9c77c1ef77..ad10cb609e 100644 --- a/client/src/components/runs/logs/Log.js +++ b/client/src/components/runs/logs/Log.js @@ -465,7 +465,8 @@ class Logs extends localization.LocalizedReactComponent { ); - } else if (runParameter.name === CP_CAP_LIMIT_MOUNTS) { + } + if (runParameter.name === CP_CAP_LIMIT_MOUNTS) { const values = (valueSelector() || '').split(',').map(v => v.trim()); const isNone = /^none$/i.test(valueSelector()); return ( @@ -486,59 +487,82 @@ class Logs extends localization.LocalizedReactComponent { ); - } else { - let values = (valueSelector() || '').split(',').map(v => v.trim()); - if (values.length === 1) { + } + if (/^metadata$/i.test(runParameter.type)) { + const [metadataFolder, metadataClassName, itemsStr] = (valueSelector() || '').split(':'); + if (metadataFolder && metadataClassName && itemsStr) { + const itemsCount = itemsStr.split(/[,;]/).length; return ( {runParameter.name}: - {values[0]} - - ); - } else if (values.length <= MAX_PARAMETER_VALUES_TO_DISPLAY + 1) { - return ( - - - {runParameter.name}: - - - - - ); - } else { - return ( - - - {runParameter.name}: - - - + + {metadataClassName} ({itemsCount}) + ); } + return ( + + {runParameter.name}: + {valueSelector()} + + ); } + let values = (valueSelector() || '').split(',').map(v => v.trim()); + if (values.length === 1) { + return ( + + {runParameter.name}: + {values[0]} + + ); + } + if (values.length <= MAX_PARAMETER_VALUES_TO_DISPLAY + 1) { + return ( + + + {runParameter.name}: + + + + + + ); + } + return ( + + + {runParameter.name}: + + + + + + ); }; @computed