Skip to content

Commit

Permalink
Merge branch 'rc' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
pazdera committed Oct 25, 2017
2 parents 065ea11 + f6f97a9 commit a836413
Show file tree
Hide file tree
Showing 22 changed files with 61 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
"target": {
"id": "block_1"
},
"value": "sounds"
"value": "Sounds"
}
}
},
Expand Down Expand Up @@ -536,7 +536,7 @@
"target": {
"id": "block_4"
},
"value": "sounds"
"value": "Sounds"
}
}
},
Expand Down Expand Up @@ -771,7 +771,7 @@
"target": {
"id": "block_7"
},
"value": "sounds"
"value": "Sounds"
}
}
},
Expand Down
10 changes: 5 additions & 5 deletions app/assets/stories/locales/en-US/motion_guitar_2/steps.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
"target": {
"id": "block_2"
},
"value": "acoustic guitar"
"value": "Acoustic Guitar"
}
}
}
Expand Down Expand Up @@ -521,7 +521,7 @@
"target": {
"id": "block_5"
},
"value": "acoustic guitar"
"value": "Acoustic Guitar"
}
}
}
Expand Down Expand Up @@ -795,7 +795,7 @@
"target": {
"id": "block_8"
},
"value": "acoustic guitar"
"value": "Acoustic Guitar"
}
}
}
Expand Down Expand Up @@ -1069,7 +1069,7 @@
"target": {
"id": "block_11"
},
"value": "acoustic guitar"
"value": "Acoustic Guitar"
}
}
}
Expand Down Expand Up @@ -1338,7 +1338,7 @@
"target": {
"id": "block_14"
},
"value": "acoustic guitar"
"value": "Acoustic Guitar"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stories/locales/en-US/motion_mixingdesk/steps.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
"target": {
"id": "block_1"
},
"value": "loops"
"value": "Loops"
}
}
}
Expand Down Expand Up @@ -443,7 +443,7 @@
"target": {
"id": "block_3"
},
"value": "loops"
"value": "Loops"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@
"target": {
"id": "block_16"
},
"value": "sounds"
"value": "Sounds"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@
"target": {
"id": "block_5"
},
"value": "sounds"
"value": "Sounds"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
"target": {
"id": "block_1"
},
"value": "loops"
"value": "Loops"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@
"target": {
"id": "block_10"
},
"value": "sounds"
"value": "Sounds"
}
}
}
Expand Down Expand Up @@ -1192,7 +1192,7 @@
"target": {
"id": "block_13"
},
"value": "sounds"
"value": "Sounds"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stories/locales/en-US/parade/parade.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
"target": {
"id": "block_3"
},
"value": "loops"
"value": "Loops"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
"target": {
"id": "block_20"
},
"value": "sounds"
"value": "Sounds"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@
"target": {
"id": "block_12"
},
"value": "sounds"
"value": "Sounds"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stories/locales/en-US/scratch_dj/scratch_dj.json
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
"target": {
"id": "block_6"
},
"value": "loops"
"value": "Loops"
}
}
},
Expand Down Expand Up @@ -822,7 +822,7 @@
"target": {
"id": "block_10"
},
"value": "sounds"
"value": "Sounds"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"target": {
"id": "block_2"
},
"value": "kano"
"value": "Kano"
}
}
},
Expand Down Expand Up @@ -394,4 +394,4 @@
},
"mode": "normal",
"defaultApp": "{\"parts\":[{\"id\":\"part_0\",\"name\":\"Speaker\",\"type\":\"speaker\",\"tagName\":\"kano-part-speaker\",\"userStyle\":{},\"userProperties\":{},\"position\":{\"x\":225,\"y\":1000},\"partType\":\"hardware\",\"configPanel\":\"disabled\"}], \"background\":{\"name\":\"My app\",\"userStyle\":{\"background\":\"url('/assets/speaker_background.png')\"}}}"
}
}
2 changes: 1 addition & 1 deletion app/assets/stories/locales/en-US/speaker_sound/steps.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"target": {
"id": "block_1"
},
"value": "sounds"
"value": "Sounds"
}
}
},
Expand Down
3 changes: 0 additions & 3 deletions app/elements/kano-app-challenge/kano-app-challenge.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@
//tell UI and validator separately that step has finished
this.$.ui.finishStep();
Kano.Behaviors.ChallengeBehavior.nextStep.call(this);
},
hintUsed () {
this.set('hints.used', this.hints.used + 1);
}
});
</script>
19 changes: 1 addition & 18 deletions app/elements/kano-app-challenge/kano-challenge-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@
type: Boolean,
value: false
},
hints: {
type: Object,
value: () => {
return {
total: 0,
used: 0
};
},
notify: true
},
sceneVariables: Object
},
forceReloadStep () {
Expand All @@ -54,11 +44,6 @@
// Deep clone the step to not change the original step when updating the ids
selectedStep = JSON.parse(JSON.stringify(selectedStep));

// Update stats if step includes optional hint
if (selectedStep['set-state'] && selectedStep['set-state'].hints && selectedStep['set-state'].hints.enabled === false) {
this.set('hints.total', this.hints.total + 1);
}

if (selectedStep.banner && selectedStep.banner.text) {
selectedStep.banner.text = this._processMarkdown(selectedStep.banner.text);
}
Expand Down Expand Up @@ -170,9 +155,7 @@
if (this.step === this.steps.length - 1) {
this.set('selectedStep.isLast', true);
this.set('done', true);
this.fire('scene-done', {
hints: this.hints
});
this.fire('scene-done');
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@
<h2>[[localize('CHALLENGE_COMPLETED','Challenge Completed')]]</h2>
<div class="small-text">
[[compliment]] <span hidden$="{{!xp}}">[[localize('XP_EARNED', "You've just earned")]] {{xp}} [[localize('XP','XP')]].</span>
<!-- FIXME Hint count disabled for release -->
<!-- <div hidden$="[[!hints.total]]">
[[hintSummary]]
</div> -->
</div>
<button class="next" on-tap="close">[[localize('GOT_IT','GOT IT')]]</button>
</div>
Expand All @@ -133,17 +129,9 @@ <h2>[[localize('CHALLENGE_COMPLETED','Challenge Completed')]]</h2>
observer: 'openedChanged',
notify: true
},
hints: {
type: Object,
value: null
},
compliment: {
type: String,
value: 'Nice work!'
},
hintSummary: {
type: String,
value: null
}
},
ready () {
Expand Down Expand Up @@ -174,8 +162,6 @@ <h2>[[localize('CHALLENGE_COMPLETED','Challenge Completed')]]</h2>
};
},
open () {
// FIXME Hint count disabled for release
// this.computeHintSummary();
this.$.modal.open();
this.previouslyOpened = true;
},
Expand All @@ -190,19 +176,6 @@ <h2>[[localize('CHALLENGE_COMPLETED','Challenge Completed')]]</h2>
},
computeImageClass (xp) {
return xp ? 'xp-num' : 'star';
},
computeHintSummary () {
if (!this.hints.total) {
return;
}
if (this.hints.used === 1) {
this.hintSummary = `You used a hint. Think you can complete it without?`;
} else if (this.hints.used) {
this.hintSummary = `You used ${this.hints.used} of ${this.hints.total} hints. Think you can complete it without any hints?`;
} else {
this.compliment = 'Congratulations!';
this.hintSummary = 'You finished the challenge without using any hints!';
}
}
});
</script>
15 changes: 1 addition & 14 deletions app/elements/kano-scene-editor/kano-scene-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@
step="{{currentStep}}"
started="[[scene.started]]"
idle="[[story.paused]]"
hint-stats="{{hintStats}}"
selected-step="{{selectedStep}}"
state="{{state}}"
scene-variables="{{sceneVariables}}"
on-save="saveApp"
on-save-to-storage="saveToStorage"
on-load="loadApp"
hints="{{hints}}">
on-load="loadApp">
<kano-app-editor id="editor"
added-parts="{{addedParts}}"
parts="[[parts]]"
Expand Down Expand Up @@ -156,10 +154,6 @@
type: Object,
computed: '_computeSceneVariables(categories)'
},
hintStats: {
type: Object,
notify: true
},
state: {
type: Object,
value: () => {
Expand Down Expand Up @@ -308,7 +302,6 @@
this.set('banner', null);
this.computeBanner(this.selectedStep);
this.set('state.hints', { enabled: true });
this.$.challenge.hintUsed();
},
_pauseAndShare (e) {
this.running = false;
Expand Down Expand Up @@ -382,8 +375,6 @@
},
_sceneChanged () {
this._loadVariables();
//async for correct data-binding with child element
this.async(this.resetHints, 0);
},
_loadVariables () {
let workspace = this.$.editor.getBlocklyWorkspace();
Expand Down Expand Up @@ -413,10 +404,6 @@
}
return (currentStep + 1) / scene.steps.length;
},
resetHints () {
this.set('hints.total', 0);
this.set('hints.used', 0);
},
ready () {
this.remix = false;
this.code = {};
Expand Down
6 changes: 6 additions & 0 deletions app/scripts/kano/make-apps/files/cache.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
if (!cachedPromise) {
cachedPromise = this.load(Kano.MakeApps.Files.types[type], url);
this.set(url, cachedPromise);
cachedPromise.catch((err) => {
if (err) {
// Invalidate the cache in case the request failed
this.set(url, null);
}
});
}
return cachedPromise;
},
Expand Down
Loading

0 comments on commit a836413

Please sign in to comment.