From d480911c685c108c5ca88a0f5fef596def828f2a Mon Sep 17 00:00:00 2001 From: Aabishkar KC Date: Thu, 18 Jan 2024 15:05:59 -0500 Subject: [PATCH] DYN-6628 Add Sign in/Sign out button tooltip (#48) --- package-lock.json | 4 ++-- package.json | 2 +- src/App.js | 19 +++++++++++-------- src/Static.js | 41 ++++++++++++++++++++++++++--------------- 4 files changed, 40 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4980661..37bfc40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dynamods/splash-screen", - "version": "1.0.14", + "version": "1.0.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@dynamods/splash-screen", - "version": "1.0.14", + "version": "1.0.15", "license": "MIT", "dependencies": { "bootstrap": "^5.2.1", diff --git a/package.json b/package.json index 5bfcdd5..45ed551 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dynamods/splash-screen", - "version": "1.0.14", + "version": "1.0.15", "description": "Splash Screen maintained by Dynamo Team@Autodesk", "author": "Autodesk Inc.", "license": "MIT", diff --git a/src/App.js b/src/App.js index cd6e11c..e734009 100644 --- a/src/App.js +++ b/src/App.js @@ -22,7 +22,6 @@ class App extends React.Component { //This is a reference to the DOM of the project that will be called in Dynamo to set the title of the splash screen (Defined by 'Welcome to Dynamo!' by default) window.setLabels = this.setLabels.bind(this); - window.setLoadingDone = this.setLoadingDone.bind(this); window.setSignInStatus = this.setSignInStatus.bind(this); } @@ -39,11 +38,11 @@ class App extends React.Component { //TODO : As alternative we can receive the event from the Childs like the Static component } - handleKeyDown = (e) => { - if (e.key === 'Escape'){ - if (this.state.loadingDone){ - this.closeDynamo() - } + handleKeyDown = (e) => { + if (e.key === 'Escape') { + if (this.state.loadingDone) { + this.closeDynamo(); + } } }; @@ -73,8 +72,10 @@ class App extends React.Component { - - + {this.state.signInTooltip} + }> + + @@ -89,19 +94,21 @@ class Static extends React.Component { + +
{this.state.loadingTime} @@ -183,12 +190,12 @@ class Static extends React.Component { setEnableSignInButton(enableSignInButton) { let btn = document.getElementById('btnSignIn'); - if (enableSignInButton.enable === 'True'){ + if (enableSignInButton.enable === 'True') { btn.classList.remove('disableButton'); btn.disabled = false; - }else{ + } else { btn.classList.add('disableButton'); - btn.disabled = true; + btn.disabled = true; } } @@ -197,13 +204,13 @@ class Static extends React.Component { let btn = document.getElementById('btnSignIn'); this.setState({ - signInStatus:auth.status === 'True' + signInStatus: auth.status === 'True' }); - if (auth.status === 'True'){ - btn.innerHTML = this.props.signOutTitle - }else{ - btn.innerHTML = this.props.signInTitle + if (auth.status === 'True') { + btn.innerHTML = this.props.signOutTitle; + } else { + btn.innerHTML = this.props.signInTitle; } } @@ -215,7 +222,7 @@ class Static extends React.Component { handleKeyDown = (e) => { if (e.key === 'Enter') { // We check explicitly the lblImportSettings control due to it's a label that wraps inputs, it's no necessary for the launch and signing buttons because they receive the focus ready to are hit with the Enter key - if (document.activeElement.id === 'lblImportSettings'){ + if (document.activeElement.id === 'lblImportSettings') { document.getElementById('inputImportSettings').click(); } } @@ -224,18 +231,22 @@ class Static extends React.Component { Static.defaultProps = { signInTitle: 'Sign In', + signInTooltip: 'Sign in to access online services that integrate with your desktop software.', signingInTitle: 'Signing In', signOutTitle: 'Sign Out', + signOutTooltip: 'Signing out of Dynamo will sign you out of all Autodesk desktop products.', launchTitle: 'Launch Dynamo', showScreenAgainLabel: 'Don\'t show this screen again', importSettingsTitle: 'Import Settings', - importSettingsTooltipDescription: 'You can import custom settings here, which will overwrite your current settings. If you\'d like to preserve a copy of your current settings, export them before importing new settings. Settings not shown in the Preferences panel will be applied once Dynamo and any host program restarts.' + importSettingsTooltipDescription: 'You can import custom settings here, which will overwrite your current settings. If you\'d like to preserve a copy of your current settings, export them before importing new settings. Settings not shown in the Preferences panel will be applied once Dynamo and any host program restarts.' }; Static.propTypes = { signInTitle: PropTypes.string, + signInTooltip: PropTypes.string, signingInTitle: PropTypes.string, signOutTitle: PropTypes.string, + signOutTooltip: PropTypes.string, launchTitle: PropTypes.string, showScreenAgainLabel: PropTypes.string, signInStatus: PropTypes.bool,