Skip to content

Commit

Permalink
Merge pull request #49 from neuromotion/develop
Browse files Browse the repository at this point in the history
provocation toggle
  • Loading branch information
fernandogelin authored Apr 24, 2020
2 parents dbd8b74 + fa8671e commit 73190ae
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 11 deletions.
5 changes: 4 additions & 1 deletion app/routes/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ export default Route.extend({

actions: {
updateName(val) {
this.settings.set('userName', val)
this.settings.set('userName', val);
},
toggleMode() {
this.settings.toggleProperty('isDark');
},
toggleProvocation() {
this.settings.toggleProperty('showProvocation');
}
}
});
7 changes: 7 additions & 0 deletions app/routes/tasks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import Route from '@ember/routing/route';
import {storageFor} from 'ember-local-storage';

export default Route.extend({
settings: storageFor('settings'),

setupController(controller) {
this._super(...arguments);
controller.set('settings', this.settings.content);
}
});
3 changes: 2 additions & 1 deletion app/storages/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Storage.reopenClass({
return {
isDark: true,
userName: 'Fer',
fontSize: 1
fontSize: 1,
showProvocation: false
};
}
});
Expand Down
8 changes: 8 additions & 0 deletions app/styles/components/_settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ input[type=checkbox] {
input {
@extend .text-dark;
}

.on-label {
margin-left: 1rem;
}

.x-toggle-component {
justify-content: flex-start;
}
25 changes: 23 additions & 2 deletions app/templates/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,31 @@
<div>
<label class="p-4">
<p class="h4">{{t "content.settings.set-theme"}}</p>
{{input type="checkbox" checked=model.isDark change=(action (route-action "toggleMode"))}}
{{t "content.settings.dark-mode"}}
<XToggle
@onLabel='Dark'
@offLabel='Light'
@showLabels={{true}}
@theme='material'
@value={{model.isDark}}
@onToggle={{action (route-action "toggleMode")}}
/>
</label>
</div>
<div>
<label class="p-4">
<p class="h4">{{t "content.settings.show-provocation"}}</p>
<XToggle
@onLabel='Show'
@offLabel='Hide'
@showLabels={{true}}
@theme='material'
@value={{model.showProvocation}}
@onToggle={{action (route-action "toggleProvocation")}}
/>
</label>
</div>


</Content>

{{outlet}}
4 changes: 3 additions & 1 deletion app/templates/tasks.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<LaunchTask @taskName="beads" />
<LaunchTask @taskName="msit" />
<LaunchTask @taskName="resting" />
<LaunchTask @taskName="provocation" />
{{#if settings.showProvocation}}
<LaunchTask @taskName="provocation" />
{{/if}}
</div>

</Content>
Expand Down
5 changes: 5 additions & 0 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ module.exports = function(environment) {
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
ENV['ember-a11y-testing'] = {
componentOptions: {
turnAuditOff: true
}
}
}

if (environment === 'test') {
Expand Down
2 changes: 1 addition & 1 deletion electron-app/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 electron-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rcps-ember",
"productName": "rcps-ember",
"version": "1.1.3",
"version": "1.1.4",
"description": "App to check status of INS, and turn recording on/off",
"main": "src/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion electron-app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ app.on('ready', () => {
mainWindow = new BrowserWindow({
width: 1000,
height: 900,
frame: false,
frame: true,
webPreferences: {
nodeIntegration: true
}
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Up @@ -2,7 +2,7 @@
"name": "rcps-ember",
"procuctName": "My RC+S",
"description": "App to check status of INS, and turn recording on/off",
"version": "1.1.3",
"version": "1.1.4",
"private": true,
"author": {
"name": "Brown CCV",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/en-se/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"dark-mode": "Dark mode",
"set-theme": "Set theme",
"language": "Change language",
"set-user": "Set user name"
"set-user": "Set user name",
"show-provocation": "Provocation Task Launcher"
},
"record": {
"on-demand-recording": "On demand recording",
Expand Down

0 comments on commit 73190ae

Please sign in to comment.