Skip to content
Open
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"lic_direct": "npx @adsk/adsk-npm-license-puller --path . --app-name 'splash-screen' --verbose --about-box ./license_output/about-box_direct.html --about-box-type desktop --year $(date \"+%Y\") --paos ./license_output/paos_direct.csv",
"lic_transitive": "npx @adsk/adsk-npm-license-puller --path . --app-name 'splash-screen' --verbose --about-box ./license_output/about-box_transitive.html --about-box-type desktop --transitive --year $(date \"+%Y\") --paos ./license_output/paos_transitive.csv",
"generate_license": "npm run lic_direct && npm run lic_transitive",
"test:unit": "NODE_ENV=test jest tests/App.test.js",
"test:unit": "NODE_ENV=test jest tests/App.test.js tests/Toast.test.js",
"test:e2e": "playwright test tests/e2e.test.js",
"eject": "react-scripts eject"
},
Expand Down
8 changes: 8 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
}

.bottomMenu {
height: auto;
}

.bottomMenuHeader {
height: 50%;
}

.bottomMenuContent {
height: auto;
}

.welcomeRow {
margin-top: 20px !important;
}
Expand Down
37 changes: 15 additions & 22 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Col from 'react-bootstrap/Col';

import Dynamic from './Dynamic';
import Static from './Static';
import Toast from './Toast';
import { base64DynamoLogo, base64DynamoBackground } from './encodedImages';

import './App.css';
Expand All @@ -14,6 +15,8 @@ class App extends React.Component {
constructor() {
super();
this.setBackgroundImage();
const noWebView = typeof chrome === 'undefined' || typeof chrome.webview === 'undefined';
this.isDebugMode = noWebView && new URLSearchParams(window.location.search).has('debug');
this.state = {
isChecked: false,
welcomeToDynamoTitle: 'Welcome to Dynamo!',
Expand Down Expand Up @@ -41,15 +44,20 @@ class App extends React.Component {

componentDidMount() {
document.addEventListener('keydown', this.handleKeyDown);
//TODO : As alternative we can receive the event from the Childs like the Static component

// Debug mode: auto-show Static when running outside Dynamo (no WebView2)
if (this.isDebugMode) {
console.log('[SplashScreen] Debug mode: no WebView2 detected, auto-loading Static');
this.setLoadingDone();
}
}

render() {
return (
<Container fluid>
<Row>
<Col className='menuOptions px-4' >
<Row className='bottomMenu'>
<Row className='bottomMenu bottomMenuHeader'>
<Col>
<Row>
<div>
Expand All @@ -61,24 +69,16 @@ class App extends React.Component {
{this.state.welcomeToDynamoTitle}
</div>
</Row>

</Col>
</Row>
<Row className='bottomMenu'>
<Row className='bottomMenu bottomMenuContent'>
<Col>
{
this.state.loadingDone ?
<Static
signInStatus={this.state.signInStatus}
signInTitle={this.state.signInTitle}
signInTooltip={this.state.signInTooltip}
signingInTitle={this.state.signingInTitle}
signOutTitle={this.state.signOutTitle}
signOutTooltip={this.state.signOutTooltip}
welcomeToDynamoTitle={this.state.welcomeToDynamoTitle}
launchTitle={this.state.launchTitle}
showScreenAgainLabel={this.state.showScreenAgainLabel}
importSettingsTitle={this.state.importSettingsTitle}
importSettingsTooltipDescription={this.state.importSettingsTooltipDescription}
labels={this.state.labels}
onCheckedChange={this.handleCheckedChange}
/> : <Dynamic />
}
Expand All @@ -90,6 +90,7 @@ class App extends React.Component {
<img className='screenBackground' alt='' src={base64DynamoBackground}></img>
</Col>
</Row>
<Toast />
</Container>
);
}
Expand All @@ -98,15 +99,7 @@ class App extends React.Component {
setLabels(labels) {
this.setState({
welcomeToDynamoTitle: labels.welcomeToDynamoTitle,
launchTitle: labels.launchTitle,
showScreenAgainLabel: labels.showScreenAgainLabel,
importSettingsTitle: labels.importSettingsTitle,
importSettingsTooltipDescription: labels.importSettingsTooltipDescription,
signInTitle: labels.signInTitle,
signInTooltip: labels.signInTooltip,
signingInTitle: labels.signingInTitle,
signOutTitle: labels.signOutTitle,
signOutTooltip: labels.signOutTooltip
labels: labels
});
}

Expand Down
57 changes: 56 additions & 1 deletion src/Static.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,59 @@ input[type="file"] {

.loadingTimeFooter {
font-size: 9px;
}
}

/* Import settings row */
.importSettingsRow {
display: grid !important;
align-items: center;
}

.importSettingsRow label {
width: 100%;
display: block;
}

.importSettingsRowWithReset {
grid-template-columns: 1fr 24px;
column-gap: 8px;
}

.importSettingsRowWithReset label {
min-width: 0;
width: 100%;
}

/* Reset button next to import settings */
.resetButtonNextToImport {
position: static;
width: 24px !important;
height: 24px;
padding: 0;
box-sizing: border-box;
line-height: 0;
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 2px;
cursor: pointer;
display: grid;
align-items: center;
justify-content: center;
color: white;
transition: all 0.2s ease;
}

.resetButtonNextToImport:hover {
border-color: rgba(255, 255, 255, 0.6);
box-shadow: 0px 0px 2px rgba(255, 255, 255, 0.5);
}

.resetButtonNextToImport:active {
box-shadow: 0px 0px 2px rgba(56, 171, 223, 0.65);
}

.resetButtonNextToImport svg {
width: 16px;
height: 16px;
display: block;
}
Loading
Loading