Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-6628 Update sign in button tool tip on sign in/sign out #50

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dynamods/splash-screen",
"version": "1.0.16",
"version": "1.0.17",
"description": "Splash Screen maintained by Dynamo Team@Autodesk",
"author": "Autodesk Inc.",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class App extends React.Component {

handleCheckedChange = (checked) => {
this.setState({isChecked: checked});
}
};

setBackgroundImage() {
let backgroundImage = '#base64BackgroundImage';
Expand Down Expand Up @@ -139,4 +139,5 @@ class App extends React.Component {
}
}
}

export default App;
35 changes: 24 additions & 11 deletions src/Static.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Static extends React.Component {
window.setTotalLoadingTime = this.setTotalLoadingTime.bind(this);
window.setEnableSignInButton = this.setEnableSignInButton.bind(this);
window.handleSignInStateChange = this.handleSignInStateChange.bind(this);
this.handleChange = this.handleChange.bind(this)
this.handleChange = this.handleChange.bind(this);
}

componentDidMount() {
Expand All @@ -45,7 +45,7 @@ class Static extends React.Component {
//Every time the checkbox is clicked, this method is called
handleChange() {
checked = !checked;
this.props.onCheckedChange(checked);
this.props.onCheckedChange(checked);
}

render() {
Expand Down Expand Up @@ -132,7 +132,8 @@ class Static extends React.Component {
let status = await chrome.webview.hostObjects.scriptObject.SignOut();
this.setState({
signInStatus: !status,
signInTitle: this.props.signInTitle
signInTitle: this.props.signInTitle,
signInTooltip: this.props.signInTooltip
});
}
else {
Expand All @@ -147,10 +148,16 @@ class Static extends React.Component {
btn.classList.remove('disableButton');
btn.disabled = false;
if (status) {
this.setState({ signInTitle: this.props.signOutTitle });
this.setState({
signInTitle: this.props.signOutTitle,
signInTooltip: this.props.signOutTooltip
});
}
else {
this.setState({ signInTitle: this.props.signInTitle });
this.setState({
signInTitle: this.props.signInTitle,
signInTooltip: this.props.signInTooltip
});
}
}
}
Expand Down Expand Up @@ -208,16 +215,21 @@ class Static extends React.Component {

//Handles changes to auth status on splash screen
handleSignInStateChange(auth) {
let btn = document.getElementById('btnSignIn');

this.setState({
signInStatus: auth.status === 'True'
});

if (auth.status === 'True') {
btn.innerHTML = this.props.signOutTitle;
} else {
btn.innerHTML = this.props.signInTitle;
this.setState({
signInTitle: this.props.signOutTitle,
signInTooltip: this.props.signOutTooltip
});
}
else {
this.setState({
signInTitle: this.props.signInTitle,
signInTooltip: this.props.signInTooltip
});
}
}

Expand Down Expand Up @@ -253,7 +265,8 @@ Static.propTypes = {
showScreenAgainLabel: PropTypes.string,
signInStatus: PropTypes.bool,
importSettingsTitle: PropTypes.string,
importSettingsTooltipDescription: PropTypes.string
importSettingsTooltipDescription: PropTypes.string,
onCheckedChange: PropTypes.func
};

export default Static;
Loading