How to use the ember-get-config.PREPRINTS function in ember-get-config

To help you get started, we’ve selected a few ember-get-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CenterForOpenScience / ember-osf-preprints / app / services / theme.js View on Github external
* Detects preprint provider and allows you to inject that
 * provider's theme into parts of your application
 *
 * @class theme
 * @extends Service
 */
export default Service.extend({
    store: service(),
    session: service(),
    headTagsService: service('head-tags'),

    // If we're using a provider domain
    isDomain: window.isProviderDomain,

    // The id of the current provider
    id: config.PREPRINTS.defaultProvider,

    currentLocation: null,

    // The provider object
    provider: computed('id', function() {
        const id = this.get('id');
        const store = this.get('store');

        // Check if redirect is enabled for the current provider
        if (!window.isProviderDomain && this.get('isProvider')) {
            store.findRecord('preprint-provider', id)
                .then(this._getproviderDomain.bind(this));
        }

        return store.findRecord('preprint-provider', id);
    }),
github CenterForOpenScience / ember-osf-preprints / app / controllers / submit.js View on Github external
savePreprint() {
            // Creates a preprint.
            let model = this.get('model');

            let provider = this.get('store').peekRecord('preprint-provider', config.PREPRINTS.provider);

            model.set('primaryFile', this.get('selectedFile'));
            model.set('node', this.get('node'));
            model.set('provider', provider);
            model.set('isPublished', true);

            this.set('savingPreprint', true);
            if (model.get('doi') === '') {
                model.set('doi', null);
            }
            return model.save()
                .then(() => this.transitionToRoute('content', model));
        },
    }
github CenterForOpenScience / ember-osf-preprints / app / routes / provider.js View on Github external
_getPageNotFound() {
        const slug = this.get('slug');
        this.set('theme.id', config.PREPRINTS.defaultProvider);

        if (slug.length === 5) {
            this.transitionTo('content', slug);
        } else {
            this.replaceWith('page-not-found');
        }
    },
});