return this.get('globalStore').rawRequest({ url: '', }).then((/*xhr*/) => { // Auth token still good return resolve('Auth Succeeded'); }, (/* err */) => { // Auth token expired return reject('Auth Failed'); }); }, detect() { const globalStore = get(this,'globalStore'); return hash({ providers: globalStore.request({url: '/v3-public/authProviders'}), firstSetting: globalStore.request({url: `settings/${C.SETTING.FIRST_LOGIN}`}), }).then(({providers, firstSetting}) => { if ( providers && get(providers,'length') ) { set(this, 'providers', providers); if (get(providers, 'length') === 1) { set(this, 'provider', get(providers, 'firstObject.id')); } } else { set(this, 'providers', []); } set(this, 'firstLogin', (firstSetting.value+'') === 'true'); return this.loadMe(); }).catch((err) => { next(() => {
import Route from '@ember/routing/route'; import RSVP from 'rsvp'; export default Route.extend({ titleToken: 'Sources', model () { let jobOpening = this.modelFor('account.job-opening'); return RSVP.hash({ jobOpening, job: jobOpening.get('job'), automatic: this.store.findAll('applicant-source'), manual: this.store.findAll('manual-applicant-source') }); }, setupController (controller, model) { if (!model.jobOpening.get('description') && !model.jobOpening.get('title')) { model.jobOpening.setProperties({ description: model.job.get('description'), title: model.job.get('title') }); } controller.setProperties({ model: model.jobOpening, sources: { manual: model.manual, automatic: model.automatic }
config: injectService(), settings: injectService(), titleToken: 'Settings - General', classNames: ['settings-view-general'], beforeModel() { this._super(...arguments); return this.get('session.user') .then(this.transitionAuthor()) .then(this.transitionEditor()); }, model() { return RSVP.hash({ settings: this.get('settings').reload(), availableTimezones: this.get('config.availableTimezones') }); }, setupController(controller, models) { controller.set('model', models.settings); controller.set('themes', this.get('store').peekAll('theme')); controller.set('availableTimezones', models.availableTimezones); }, actions: { save() { return this.get('controller').send('save'); }, reloadSettings() {
import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { get } from '@ember/object'; import { hash } from 'rsvp'; export default Route.extend({ globalStore: service(), roleTemplateService: service('roleTemplate'), model() { const gs = get(this, 'globalStore'); const pid = this.paramsFor('authenticated.project'); return hash({ project: gs.find('project', pid.project_id, { forceReload: true }), roles: get(this, 'roleTemplateService').get('allFilteredRoleTemplates'), roleBindings: gs.findAll('projectRoleTemplateBinding'), }); } });
import Route from '@ember/routing/route'; import { get } from '@ember/object'; import { hash } from 'rsvp'; export default Route.extend({ async model() { const wallet = this.modelFor('wallets'); const account = this.modelFor('wallets.accounts'); const history = await this.store.query('history', { account: get(account, 'id'), count: 100, }); return hash({ wallet, account, history, }); }, });
apps.forEach((app) => { let extInfo = get(app, 'externalIdInfo'); if ( extInfo && extInfo.templateId ) { deps.push(this.fetchTemplate(extInfo.templateId, false)); } }); return allSettled(deps); }, fetchUnScopedCatalogs() { return hash({ projectCatalogs: this.fetchCatalogs('projectCatalog'), clusterCatalogs: this.fetchCatalogs('clusterCatalog'), globalCatalogs: this.fetchCatalogs('catalog') }); }, fetchCatalogs(catalogs = 'catalog', opts) { return get(this, 'globalStore').findAll(catalogs, opts); }, getTemplateFromCache(id) { return get(this, 'globalStore').getById('template', id); }, getVersionFromCache(id) { return get(this, 'globalStore').getById('templateversion', id); },
import Route from '@ember/routing/route'; export default Route.extend({ model(params) { const store = get(this, 'store'); const dependencies = { namespacedcertificates: store.findAll('namespacedcertificate'), certificates: store.findAll('certificate'), }; if (params.ingressId) { dependencies['existingIngress'] = store.find('ingress', params.ingressId); } return hash(dependencies).then((hash) => { let ingress; if (hash.existingIngress) { if (`${ params.upgrade }` === 'true') { ingress = hash.existingIngress.clone(); hash.existing = hash.existingIngress; } else { ingress = hash.existingIngress.cloneForNew(); } delete hash.existingIngress; } else { ingress = store.createRecord({ type: 'ingress', name: '', rules: [],
titleToken: 'Settings - General', classNames: ['settings-view-general'], config: injectService(), beforeModel() { this._super(...arguments); return this.get('session.user') .then(this.transitionAuthor()) .then(this.transitionEditor()); }, model() { return RSVP.hash({ settings: this.store.queryRecord('setting', {type: 'blog,theme,private'}), availableTimezones: this.get('config.availableTimezones') }); }, setupController(controller, models) { controller.set('model', models.settings); controller.set('availableTimezones', models.availableTimezones); }, actions: { save() { this.get('controller').send('save'); } } });
// TODO: replace with a synchronous settings service querySettings() { return this.store.queryRecord('setting', {type: 'blog,theme,private'}); }, beforeModel() { this._super(...arguments); return this.get('session.user') .then(this.transitionAuthor()) .then(this.transitionEditor()); }, model() { return RSVP.hash({ settings: this.querySettings(), availableTimezones: this.get('config.availableTimezones') }); }, setupController(controller, models) { controller.set('model', models.settings); controller.set('availableTimezones', models.availableTimezones); }, actions: { save() { return this.get('controller').send('save'); }, reloadSettings() { return this.querySettings((settings) => {
return hash({ config: {}, perfil: perfil, institucion: institucion, partidoActual: partidoActual, perfilInformacionGeneralConfiguracion: spreadsheet .fetchConfig('perfil-informacion-general-configuracion'), perfiles: this.modelFor('application').perfiles, documentosDisponibles: spreadsheet .fetch('documentos-disponibles') .then((documentos) => { return A(documentos) .filterBy('profile', perfil.get('id')); }), datosTablaGradacion: spreadsheet .fetch('tabla-gradacion') .then((registros) => { return A(registros) .filterBy('profile', perfil.get('id')) .filter((e) => e.aspecto !== 'Total'); }), totalPuntajeGradacion: spreadsheet .fetch('tabla-gradacion') .then((registros) => { return A(registros) .filterBy('profile', perfil.get('id')) .filter((e) => e.aspecto !== 'Total' && e.aspecto !== 'Cualidades Éticas y de Probidad') .reduce((previousValue, item) => previousValue + parseInt(item.puntaje), 0); }), perfilFuncionalidades: spreadsheet .fetchConfig('perfil-funcionalidades') .then((links) => { return A(links) .filter((link) => { if (link.link) { return true; } if (!_routing.hasRoute(link.route)) { throw new Error(`Route not recognized: ${link.route}`); } return true; }); }) });