import Component from '../lib/component.js'; import store from '../store/index.js'; /** * @classdesc UI component for the sets of environments. */ export default class EnvsSet extends Component{ /** * @constructor */ constructor() { super({ store, element: document.querySelector('#getting-started-tab'), eventName: 'envsSetChange' }); } /** * Renders the sets of environments and adds event listeners to the different elements. */ render(){ let dict = window.lang_dict[store.state.language]['envsSets']; this.element.querySelector('#baseSetText').innerHTML = dict['baseSetText']; this.element.querySelector('#customSetText').innerHTML = dict['customSetText']; /* Base envs set */ let baseEnvs = this.element.querySelector('#baseEnvsSet'); baseEnvs.innerHTML = store.state.envsSets.baseEnvsSet.map(e => { // Creates a card for each environment in the base set return `
${e.description[store.state.language]['text']}
${dict['uploadCard']['text']}
${e.description.text}