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

Modal scroll & height #1133

Merged
merged 3 commits into from
Oct 14, 2022
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
2 changes: 1 addition & 1 deletion app/components/import-custom-challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default Component.extend({
const challengeJson = await this._getChallengeJson(entries)
const sceneImages = await this._getSceneImages(entries)
const challengeCover = await this._imageContentToURL(entries[`${assetsPath}/splashChallenge.png`]);
challengeJson.challengeCover = challengeCover
challengeJson.customCover = challengeCover
challengeJson.imagesToPreload = sceneImages.map(image => image.url)
//Currently it is not possible to define scenes in the json itself, like in the desafios.js file, but it can be made possible by replacing this line with "challengeJson.escena = challengeJson.sceneConstructor || `new CustomScene(...)"
challengeJson.escena = `new CustomScene({grid:{spec:${JSON.stringify(challengeJson.grid)}}, images:${JSON.stringify(sceneImages)}})`
Expand Down
5 changes: 0 additions & 5 deletions app/components/scene-details.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import Component from '@ember/component';
import { computed } from '@ember/object';

export default Component.extend({

initialized: false,
exerciseCover: computed('model', function () {
return this.model.challengeCover || `imagenes/desafios/${this.model.nombreImagen}`
}),

actions: {

setTab(tabId) {
Expand Down
5 changes: 3 additions & 2 deletions app/models/desafio.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default Model.extend({

nombre: attr('string'),
imagen: attr('string'),
customCover: attr('string'),
deshabilitado: attr('boolean'),
escena: attr('string'),
hasAutomaticGrading: attr('boolean', { defaultValue: true }),
Expand All @@ -35,8 +36,8 @@ export default Model.extend({
expectations: attr(),
shouldShowMultipleScenarioHelp: attr('boolean', {defaultValue: false}),

nombreImagen: computed('imagen', 'nombre', function () {
return `${this.imagen || this.nombre || 'proximamente'}.png`;
coverSrc: computed('imagen', 'nombre', 'customCover', function () {
return this.customCover || `imagenes/desafios/${ this.imagen || this.nombre || 'proximamente'}.png`;
}),

initialWorkspace: computed("solucionInicial", function () {
Expand Down
12 changes: 7 additions & 5 deletions app/styles/expectation-modal.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@

.expectationsModal {
text-align: center;
}

.expectationResults {
.goal {
margin-top: 1em;
Expand All @@ -23,4 +18,11 @@
.control {
color: var(--theme-control-color);
}
}

.expectationModal {
p {
text-align: center;
padding-left: 1em;
}
}
4 changes: 2 additions & 2 deletions app/templates/components/challenge-link.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{#if challenge.deshabilitado}}
<img class='grayscale semi-transparente' src='images/desafios/{{challenge.nombreImagen}}'>
<img class='grayscale semi-transparente' src={{challenge.coverSrc}}>
<div class="ribbon right gray semi-transparente"><a>{{t "components.challengeLink.soon"}}</a></div>
{{else}}
<Link @href={{href-to "desafio" challenge (query-params codigo="")}} @openOnNewTab={{false}}>
<img class='desafio-img' src='imagenes/desafios/{{challenge.nombreImagen}}'>
<img class='desafio-img' src={{challenge.coverSrc}}>
</Link>
{{/if}}

Expand Down
8 changes: 4 additions & 4 deletions app/templates/components/expectation-modal.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Modal @title={{t (compute (action textTag "title"))}} @onClose={{onClose}}>
<div class='expectationsModal'>
<img src="imagenes/libros/primer-ciclo.png" />
<p>{{t (compute (action textTag "description"))}}</p>
</div>
<PaperCard class="details-card flex layout-row expectationModal">
<img class="exercise-cover" alt="{{challenge.titulo}}" src="{{challenge.coverSrc}}">
<p>{{t (compute (action textTag "description"))}}</p>
</PaperCard>

{{#if (compute (action shouldShowScoredExpectations))}}
<ScoredExpectations
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/scene-details.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Spinner/>
{{else}}
<div class="layout-row">
<img class="exercise-cover" alt="{{model.titulo}}" src={{exerciseCover}}>
<img class="exercise-cover" alt="{{model.titulo}}" src="{{model.coverSrc}}">
<div class="flex-grow">
<div class="layout-row">
<div class="tab layout-column">
Expand Down
2 changes: 1 addition & 1 deletion translations/components/es-ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ finishedExerciseModal:
description: Revisá tu solución e intentá cumplir con todos los objetivos.
allPassed:
title: ¡Lo lograste!
description: ''
description: 'Cumpliste todos los objetivos.'
nonScoredExpectations:
title: ¡Lo lograste!
description: 'Repasá todos estos objetivos para asegurarte que tu solución sea de calidad:'
Expand Down