diff --git a/app/components/challenge-workspace-buttons.js b/app/components/challenge-workspace-buttons.js index fc5b5eac8..2020c67b3 100644 --- a/app/components/challenge-workspace-buttons.js +++ b/app/components/challenge-workspace-buttons.js @@ -1,5 +1,6 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; +import { changeWarningVisibility } from '../utils/blocks'; const VERSION_DEL_FORMATO_DE_ARCHIVO = 2; @@ -10,6 +11,7 @@ export default Component.extend({ xml: null, store: service(), deleteDialogIsOpen: false, + warningsDisabled: true, platform: service(), intl: service(), @@ -88,6 +90,11 @@ export default Component.extend({ this.fileInput().click(); }, + changeWarningVisibility() { + changeWarningVisibility(!this.get('warningsDisabled')) + this.set('warningsDisabled', !this.get('warningsDisabled')) + }, + guardarSolucion() { let activityName = this.get("actividad.nombre"); let fileName = `${activityName}.spbq`; diff --git a/app/templates/components/challenge-workspace-buttons.hbs b/app/templates/components/challenge-workspace-buttons.hbs index bf99798bf..d2a014b36 100644 --- a/app/templates/components/challenge-workspace-buttons.hbs +++ b/app/templates/components/challenge-workspace-buttons.hbs @@ -2,6 +2,7 @@ + diff --git a/app/utils/blocks.js b/app/utils/blocks.js index ba8418429..4a9076397 100644 --- a/app/utils/blocks.js +++ b/app/utils/blocks.js @@ -190,6 +190,10 @@ export function addError(block, message, index) { addWarningToBlock(block, '★', message, index, 'red') } +export function changeWarningVisibility(visible) { + Blockly.getMainWorkspace().getAllBlocks().forEach(b => b.warning && b.warning.setVisible(visible)) +} + function textWasChanged(fieldName, event) { return event.element === 'field' && event.name === fieldName && (event.oldValue !== event.newValue) } diff --git a/translations/components/en-us.yaml b/translations/components/en-us.yaml index c9ef93964..664fc8695 100644 --- a/translations/components/en-us.yaml +++ b/translations/components/en-us.yaml @@ -58,6 +58,9 @@ challengeWorkspaceButtons: notASolution: This file does not have a Pilas Bloques solution. wrongActivity: 'Be careful! The file indicates that it is from another challenge ({activity}). It will be loaded anyways, but it could fail.' oldVersion: 'Be careful! The file indicates that it is from an older version. It will be loaded anyways, but we suggest that you solve the challenge again and save the solution in a new file.' + warnings: + disable: 'Disable warnings' + enable: 'Enable warnings' footer: version: 'Version:' problem: Any problem with this exercise? diff --git a/translations/components/es-ar.yaml b/translations/components/es-ar.yaml index bebae12be..29f6f8bd1 100644 --- a/translations/components/es-ar.yaml +++ b/translations/components/es-ar.yaml @@ -58,6 +58,9 @@ challengeWorkspaceButtons: notASolution: Este archivo no tiene una solución de Pilas Bloques. wrongActivity: '¡Cuidado! El archivo indica que es para otra actividad ({activity}). Se cargará de todas formas, pero puede fallar.' oldVersion: '¡Cuidado! El archivo indica que es de una versión anterior. Se cargará de todas formas, pero te sugerimos que resuelvas nuevamente el ejercicio y guardes un nuevo archivo.' + warnings: + disable: 'Desactivar advertencias' + enable: 'Activar advertencias' footer: version: 'Versión:' problem: ¿Algún problema con este ejercicio? diff --git a/translations/components/pt-br.yaml b/translations/components/pt-br.yaml index dabd09b7d..1332713c4 100644 --- a/translations/components/pt-br.yaml +++ b/translations/components/pt-br.yaml @@ -58,6 +58,9 @@ challengeWorkspaceButtons: notASolution: Este arquivo não tem uma solução da Pilas Blocos. wrongActivity: Cuidado! O arquivo indica que é para outra atividade ({activity}). Será carregado de cualquer forma, mas pode falhar. oldVersion: Cuidado! O arquivo indica que é de uma versão anterior. Será carregado de qualquer forma, mas sugerimos que resolva novamente o exercício e guarde um novo arquivo. + warnings: + disable: 'Desativar avisos' + enable: 'Ativar avisos' footer: version: 'Versão:' problem: Problemas com este exercício?