diff --git a/src/short-urls/helpers/ShortUrlsRowMenu.js b/src/short-urls/helpers/ShortUrlsRowMenu.js index e8921d04..29d67d43 100644 --- a/src/short-urls/helpers/ShortUrlsRowMenu.js +++ b/src/short-urls/helpers/ShortUrlsRowMenu.js @@ -46,6 +46,7 @@ const ShortUrlsRowMenu = ( const { onCopyToClipboard, shortUrl, selectedServer } = this.props; const completeShortUrl = shortUrl && shortUrl.shortUrl ? shortUrl.shortUrl : ''; const currentServerVersion = selectedServer ? selectedServer.version : ''; + const showEditMetaBtn = !isEmpty(currentServerVersion) && compareVersions(currentServerVersion, '>=', '1.18.0'); const showPreviewBtn = !isEmpty(currentServerVersion) && compareVersions(currentServerVersion, '<', '2.0.0'); const toggleModal = (prop) => () => this.setState((prevState) => ({ [prop]: !prevState[prop] })); const toggleQrCode = toggleModal('isQrModalOpen'); @@ -69,10 +70,14 @@ const ShortUrlsRowMenu = ( - - Edit metadata - - + {showEditMetaBtn && ( + + + Edit metadata + + + + )} Delete short URL diff --git a/test/short-urls/helpers/ShortUrlsRowMenu.test.js b/test/short-urls/helpers/ShortUrlsRowMenu.test.js index 1deb8430..362d61e5 100644 --- a/test/short-urls/helpers/ShortUrlsRowMenu.test.js +++ b/test/short-urls/helpers/ShortUrlsRowMenu.test.js @@ -47,6 +47,11 @@ describe('', () => { }); each([ + [ '1.17.0', 6, 2 ], + [ '1.17.2', 6, 2 ], + [ '1.18.0', 7, 2 ], + [ '1.18.1', 7, 2 ], + [ '1.19.0', 7, 2 ], [ '1.20.3', 7, 2 ], [ '1.21.0', 7, 2 ], [ '1.21.1', 7, 2 ],