Loading js-apps/frontend/src/js/containers/sandbox/try-it.js +14 −3 Original line number Diff line number Diff line Loading @@ -23,13 +23,22 @@ class TryIt extends Component { constructor(props) { super(props); this.baseTryIt = HOST_PATH + '/' + this.props.sandboxName + '/'; this.state = { renderUpdate: 0, clipboardClicked: false }; } copyToClipboard(copyText) { /* Copy the text inside the text field */ navigator.clipboard.writeText(copyText); /* Alert the copied text */ alert('Copied the text: ' + copyText); /* setting a local state that will last few render for the icon image to swap */ this.setState({ renderUpdate: 0, clipboardClicked: true }); } render() { Loading Loading @@ -91,6 +100,8 @@ class TryIt extends Component { let runningOn = this.props.edgeAppsMap.edgeApps[index].mepName; let appId = (hideApplicationId === true) ? '' : 'application id: ' + this.props.edgeAppsMap.edgeApps[index].id; let clipboardIcon = (this.state.clipboardClicked === true && this.state.renderUpdate < 5) ? 'assignment_turned_in' : 'assignment'; this.state.renderUpdate++; return ( <> Loading Loading @@ -133,7 +144,7 @@ class TryIt extends Component { <GridCell span={2}> <IconButton title="Copy to clipboard" icon="content_copy" icon={clipboardIcon} iconOptions={{ size: 'large', id: 'user-icon' }} style={styles.icon} onClick={() => this.copyToClipboard(tryItMecApp)} Loading Loading
js-apps/frontend/src/js/containers/sandbox/try-it.js +14 −3 Original line number Diff line number Diff line Loading @@ -23,13 +23,22 @@ class TryIt extends Component { constructor(props) { super(props); this.baseTryIt = HOST_PATH + '/' + this.props.sandboxName + '/'; this.state = { renderUpdate: 0, clipboardClicked: false }; } copyToClipboard(copyText) { /* Copy the text inside the text field */ navigator.clipboard.writeText(copyText); /* Alert the copied text */ alert('Copied the text: ' + copyText); /* setting a local state that will last few render for the icon image to swap */ this.setState({ renderUpdate: 0, clipboardClicked: true }); } render() { Loading Loading @@ -91,6 +100,8 @@ class TryIt extends Component { let runningOn = this.props.edgeAppsMap.edgeApps[index].mepName; let appId = (hideApplicationId === true) ? '' : 'application id: ' + this.props.edgeAppsMap.edgeApps[index].id; let clipboardIcon = (this.state.clipboardClicked === true && this.state.renderUpdate < 5) ? 'assignment_turned_in' : 'assignment'; this.state.renderUpdate++; return ( <> Loading Loading @@ -133,7 +144,7 @@ class TryIt extends Component { <GridCell span={2}> <IconButton title="Copy to clipboard" icon="content_copy" icon={clipboardIcon} iconOptions={{ size: 'large', id: 'user-icon' }} style={styles.icon} onClick={() => this.copyToClipboard(tryItMecApp)} Loading