Skip to content

Commit 1c485ed

Browse files
committed
Merge branch 'develop-1.6.1'
2 parents e1eb972 + 6c6147f commit 1c485ed

12 files changed

Lines changed: 290 additions & 45 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24+
25+
# Local Netlify folder
26+
.netlify

extras/log_headers.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Usage: node extras/log_headers.js
2+
3+
const http = require('http');
4+
5+
const server = http.createServer((req, res) => {
6+
console.log(req.headers);
7+
res.end();
8+
});
9+
10+
server.listen(8000);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "c2lc-coding-environment",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"private": true,
55
"dependencies": {
66
"bootstrap": "4.6.1",
@@ -36,10 +36,11 @@
3636
"eslintConfig": {
3737
"extends": "react-app",
3838
"ignorePatterns": [
39+
"build/",
40+
"extras/log_headers.js",
3941
"flow-typed/npm",
4042
"node_modules/",
41-
"src/vendor/",
42-
"build/"
43+
"src/vendor/"
4344
],
4445
"rules": {
4546
"indent": [

public/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@
2020
Learn how to configure a non-root public URL by running `npm run build`.
2121
-->
2222
<title>Weavly</title>
23+
24+
<!-- Matomo -->
25+
<script>
26+
var _paq = window._paq = window._paq || [];
27+
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
28+
_paq.push(['disableBrowserFeatureDetection']);
29+
_paq.push(['trackPageView']);
30+
(function() {
31+
var u="https://analytics.inclusivedesign.ca/";
32+
_paq.push(['setTrackerUrl', u+'matomo.php']);
33+
_paq.push(['setSiteId', '24']);
34+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
35+
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
36+
})();
37+
</script>
38+
<!-- End Matomo Code -->
39+
2340
</head>
2441
<body>
2542
<noscript>You need to enable JavaScript to run this app.</noscript>

src/App.js

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import CharacterState from './CharacterState';
1111
import CharacterStateSerializer from './CharacterStateSerializer';
1212
import CharacterPositionController from './CharacterPositionController';
1313
import CommandPaletteCommand from './CommandPaletteCommand';
14+
import CookieNotification from './CookieNotification';
1415
import C2lcURLParams from './C2lcURLParams';
1516
import DashConnectionErrorModal from './DashConnectionErrorModal';
1617
import DashDriver from './DashDriver';
@@ -111,13 +112,15 @@ export type AppState = {
111112
disallowedActions: ActionToggleRegister,
112113
keyBindingsEnabled: boolean,
113114
keyboardInputSchemeName: KeyboardInputSchemeName,
115+
showCookieNotification: boolean,
114116
showKeyboardModal: boolean,
115117
showSoundOptionsModal: boolean,
116118
showThemeSelectorModal: boolean,
117119
showWorldSelector: boolean,
118120
showShareModal: boolean,
119121
showActionsSimplificationMenu: boolean,
120122
showPrivacyModal: boolean,
123+
focusOnClosePrivacyModalSelector: string,
121124
startingX: number,
122125
startingY: number,
123126
startingDirection: number
@@ -146,7 +149,7 @@ export class App extends React.Component<AppProps, AppState> {
146149
constructor(props: any) {
147150
super(props);
148151

149-
this.version = '1.6';
152+
this.version = '1.6.1';
150153

151154
this.appContext = {
152155
bluetoothApiIsAvailable: FeatureDetection.bluetoothApiIsAvailable()
@@ -406,6 +409,9 @@ export class App extends React.Component<AppProps, AppState> {
406409
}
407410
);
408411

412+
// Cookie Notification
413+
const showCookieNotification = !(window.localStorage.getItem('c2lc-hasDismissedCookieNotification'));
414+
409415
// Initialize startingX, startingY, and startingDirection to the world starting position
410416
const startingX = getWorldProperties(this.defaultWorld).startingX;
411417
const startingY = getWorldProperties(this.defaultWorld).startingY;
@@ -434,13 +440,15 @@ export class App extends React.Component<AppProps, AppState> {
434440
runningState: 'stopped',
435441
disallowedActions: {},
436442
keyBindingsEnabled: false,
443+
showCookieNotification: showCookieNotification,
437444
showKeyboardModal: false,
438445
showSoundOptionsModal: false,
439446
showThemeSelectorModal: false,
440447
showWorldSelector: false,
441448
showShareModal: false,
442449
showActionsSimplificationMenu: false,
443450
showPrivacyModal: false,
451+
focusOnClosePrivacyModalSelector: '',
444452
startingX: startingX,
445453
startingY: startingY,
446454
startingDirection: startingDirection,
@@ -529,6 +537,20 @@ export class App extends React.Component<AppProps, AppState> {
529537

530538
// Handlers
531539

540+
handleCookieNotificationDismiss = () => {
541+
window.localStorage.setItem('c2lc-hasDismissedCookieNotification', true);
542+
this.setState({
543+
showCookieNotification: false
544+
});
545+
};
546+
547+
handleCookieNotificationLearnMore = () => {
548+
this.setState({
549+
showPrivacyModal: true,
550+
focusOnClosePrivacyModalSelector: '.CookieNotification__learnMoreButton'
551+
});
552+
};
553+
532554
handleProgramSequenceChange = (programSequence: ProgramSequence) => {
533555
this.setState({
534556
programSequence: programSequence
@@ -1349,7 +1371,10 @@ export class App extends React.Component<AppProps, AppState> {
13491371
}
13501372

13511373
handleClickPrivacyButton = () => {
1352-
this.setState({ showPrivacyModal: true });
1374+
this.setState({
1375+
showPrivacyModal: true,
1376+
focusOnClosePrivacyModalSelector: '.App__PrivacyModal__toggle-button'
1377+
});
13531378
}
13541379

13551380
handleClosePrivacyModal = () => {
@@ -1365,6 +1390,14 @@ export class App extends React.Component<AppProps, AppState> {
13651390
role='main'
13661391
onClick={this.handleRootClick}
13671392
onKeyDown={this.handleRootKeyDown}>
1393+
<div className='App__notificationArea'>
1394+
{this.state.showCookieNotification &&
1395+
<CookieNotification
1396+
onDismiss={this.handleCookieNotificationDismiss}
1397+
onLearnMore={this.handleCookieNotificationLearnMore}
1398+
/>
1399+
}
1400+
</div>
13681401
<header className='App__header'>
13691402
<div className='App__header-row'>
13701403
<h1 className='App__logo-container'>
@@ -1657,6 +1690,7 @@ export class App extends React.Component<AppProps, AppState> {
16571690
/>
16581691
<PrivacyModal
16591692
show={this.state.showPrivacyModal}
1693+
focusOnCloseSelector={this.state.focusOnClosePrivacyModalSelector}
16601694
onClose={this.handleClosePrivacyModal}
16611695
/>
16621696
</React.Fragment>

src/App.scss

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ body {
1313
box-sizing: border-box;
1414
display: grid;
1515
grid-template-columns: 1fr min-content minmax(auto, calc(#{$c2lc-scene-border-width} + #{$c2lc-scene-border-width} + #{$c2lc-scene-row-header-width} + #{$c2lc-scene-width} + #{$c2lc-scene-space-for-scrollbar} + #{$c2lc-app-scene-container-margin-right})) min-content 1fr;
16-
grid-template-rows: auto auto 1fr 4.6rem;
17-
row-gap: 0.25rem;
16+
grid-template-rows: auto auto auto 1fr 4.6rem;
17+
row-gap: 0;
1818
height: 100vh;
1919
overflow: auto;
2020
// On mobile Safari, limit the height of the App to the browser content
@@ -23,13 +23,20 @@ body {
2323
max-height: -webkit-fill-available;
2424
}
2525

26+
.App__notificationArea {
27+
grid-column-start: 1;
28+
grid-column-end: 6;
29+
grid-row-start: 1;
30+
grid-row-end: 2;
31+
}
32+
2633
.App__header {
2734
background-color: #FFF;
2835
grid-column-start: 2;
2936
grid-column-end: 3;
30-
grid-row-start: 1;
31-
grid-row-end: 2;
32-
margin: 0.5rem 0.25rem 0.5rem 0.5rem;
37+
grid-row-start: 2;
38+
grid-row-end: 3;
39+
margin: 0.5rem 0.25rem 0.75rem 0.5rem;
3340
}
3441

3542
.App__header-row {
@@ -96,7 +103,7 @@ body {
96103
background-color: inherit;
97104
border: 1px solid transparent;
98105
border-radius: 2px;
99-
font-size: 14.14px;
106+
font-size: 0.8rem;
100107
outline: none;
101108
text-decoration: underline;
102109

@@ -120,10 +127,11 @@ body {
120127
position: relative;
121128
margin-top: 0.25rem;
122129
margin-right: $c2lc-app-scene-container-margin-right;
130+
margin-bottom: 0.25rem;
123131
grid-column-start: 3;
124132
grid-column-end: 4;
125-
grid-row-start: 1;
126-
grid-row-end: 3;
133+
grid-row-start: 2;
134+
grid-row-end: 4;
127135
min-height: 12rem;
128136
min-width: 19.5rem;
129137
}
@@ -136,11 +144,12 @@ body {
136144
display: grid;
137145
grid-column-start: 4;
138146
grid-column-end: 5;
139-
grid-row-start: 1;
140-
grid-row-end: 3;
147+
grid-row-start: 2;
148+
grid-row-end: 4;
141149
border-radius: 3px;
142150
margin-right: 0.5rem;
143151
margin-top: 0.25rem;
152+
margin-bottom: 0.25rem;
144153
grid-template-rows: 1fr min-content min-content;
145154
background-color: #CCE6E2;
146155
}
@@ -175,11 +184,11 @@ body {
175184
border: 2px solid #CCE6E2;
176185
border-radius: 0.2rem;
177186
text-align: center;
178-
margin: 0 0.25rem 0 0.5rem;
187+
margin: 0 0.25rem 0.25rem 0.5rem;
179188
grid-column-start: 2;
180189
grid-column-end: 3;
181-
grid-row-start: 2;
182-
grid-row-end: 4;
190+
grid-row-start: 3;
191+
grid-row-end: 5;
183192
display: flex;
184193
flex-direction: column;
185194
grid-template-rows: min-content min-content auto;
@@ -270,28 +279,29 @@ body {
270279

271280
.App__program-block-editor {
272281
margin-right: 0.5rem;
282+
margin-bottom: 0.25rem;
273283
grid-column-start: 3;
274284
grid-column-end: 5;
275-
grid-row-start: 3;
276-
grid-row-end: 4;
285+
grid-row-start: 4;
286+
grid-row-end: 5;
277287
height: auto;
278288
}
279289

280290
.App__playAndShare-background {
281291
background-color: #67717E;
282292
grid-column-start: 1;
283293
grid-column-end: 6;
284-
grid-row-start: 4;
285-
grid-row-end: 5;
294+
grid-row-start: 5;
295+
grid-row-end: 6;
286296
box-shadow: inset 0px 7px 3px -3px rgba(0, 0, 0, 0.25);
287297
}
288298

289299
.App__playAndShare-container {
290300
padding: 0 1rem;
291301
grid-column-start: 2;
292302
grid-column-end: 5;
293-
grid-row-start: 4;
294-
grid-row-end: 5;
303+
grid-row-start: 5;
304+
grid-row-end: 6;
295305
display: grid;
296306
grid-template-columns: 1fr 1fr;
297307
}

src/CookieNotification.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// @flow
2+
3+
import React from 'react';
4+
import { FormattedMessage, injectIntl } from 'react-intl';
5+
import './CookieNotification.scss';
6+
7+
type CookieNotificationProps = {
8+
onDismiss: () => void,
9+
onLearnMore: () => void
10+
};
11+
12+
class CookieNotification extends React.Component<CookieNotificationProps, {}> {
13+
render() {
14+
return (
15+
<div className='CookieNotification'>
16+
<div className='CookieNotification__message'>
17+
<FormattedMessage id='CookieNotification.message'/>
18+
</div>
19+
<div>
20+
<button className='CookieNotification__button' onClick={this.props.onDismiss}>
21+
<FormattedMessage id='CookieNotification.dismiss'/>
22+
</button>
23+
<button
24+
className='CookieNotification__button CookieNotification__button--margin-left CookieNotification__learnMoreButton'
25+
onClick={this.props.onLearnMore}
26+
>
27+
<FormattedMessage id='CookieNotification.learnMore'/>
28+
</button>
29+
</div>
30+
</div>
31+
);
32+
}
33+
}
34+
35+
export default injectIntl(CookieNotification);

0 commit comments

Comments
 (0)