server/bo_client/config/environment.js
author Chloe Laisne <chloe.laisne@gmail.com>
Mon, 26 Sep 2016 20:54:58 +0200
changeset 299 2c16302b06f7
parent 263 3deace9204de
child 456 3a32d2f57429
permissions -rw-r--r--
Remove autocomplete component
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
/* jshint node: true */
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
module.exports = function(environment) {
263
3deace9204de pass bo_client to ember 2.8, adjust for the hack around the aupac-typeahead bug in 2.8 (c.f. https://github.com/aupac/ember-aupac-typeahead/issues/23)
ymh <ymh.work@gmail.com>
parents: 137
diff changeset
     4
  var rootURL = '/';
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
  var ENV = {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
    modulePrefix: 'bo-client',
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
     7
    podModulePrefix: 'bo-client/pods',
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
    environment: environment,
263
3deace9204de pass bo_client to ember 2.8, adjust for the hack around the aupac-typeahead bug in 2.8 (c.f. https://github.com/aupac/ember-aupac-typeahead/issues/23)
ymh <ymh.work@gmail.com>
parents: 137
diff changeset
     9
    rootURL: rootURL,
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    locationType: 'auto',
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    11
    i18n : {
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    12
      defaultLocale: 'fr'
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    13
    },
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
    EmberENV: {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
      FEATURES: {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
        // Here you can enable experimental features on an ember canary build
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
        // e.g. 'with-controller': true
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
      }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
    },
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
    APP: {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
      // Here you can pass flags/options to your application instance
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
      // when it is created
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    24
      'bo-doc-viaf-autocomplete' : {
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    25
          viafQueryUrl: "http://viaf.org/viaf/AutoSuggest?query=",
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    26
          viafBaseUrl: "http://viaf.org/viaf/",
135
66c1d31e2f97 first steps to add subject editing
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    27
      },
66c1d31e2f97 first steps to add subject editing
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    28
      'bo-doc-bnf-autocomplete' : {
263
3deace9204de pass bo_client to ember 2.8, adjust for the hack around the aupac-typeahead bug in 2.8 (c.f. https://github.com/aupac/ember-aupac-typeahead/issues/23)
ymh <ymh.work@gmail.com>
parents: 137
diff changeset
    29
          bnfQueryUrl: rootURL + "proxy/bnf/?term=",
135
66c1d31e2f97 first steps to add subject editing
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    30
          bnfBaseUrl: "http://data.bnf.fr/",
263
3deace9204de pass bo_client to ember 2.8, adjust for the hack around the aupac-typeahead bug in 2.8 (c.f. https://github.com/aupac/ember-aupac-typeahead/issues/23)
ymh <ymh.work@gmail.com>
parents: 137
diff changeset
    31
          bnfSparqlUrl: rootURL + "proxy/bnf-sparql"
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    32
      }
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    33
    },
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
  };
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
  if (environment === 'development') {
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    37
    ENV.APP.LOG_RESOLVER = true;
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    38
    ENV.APP.LOG_ACTIVE_GENERATION = true;
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    39
    ENV.APP.LOG_TRANSITIONS = true;
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    40
    ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    41
    ENV.APP.LOG_VIEW_LOOKUPS = true;
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    42
    ENV.contentSecurityPolicy = {
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    43
      'default-src': "'none'",
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    44
      'script-src': "'self'",
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    45
      'font-src': "'self'",
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    46
      'connect-src': "'self' *",
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    47
      'img-src': "'self'",
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    48
      'style-src': "'self' *",
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    49
      'media-src': "'self'"
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents: 20
diff changeset
    50
    };
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
  }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
  if (environment === 'test') {
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
    // Testem prefers this...
263
3deace9204de pass bo_client to ember 2.8, adjust for the hack around the aupac-typeahead bug in 2.8 (c.f. https://github.com/aupac/ember-aupac-typeahead/issues/23)
ymh <ymh.work@gmail.com>
parents: 137
diff changeset
    55
    ENV.rootURL = '/';
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
    ENV.locationType = 'none';
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
    // keep test console output quieter
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
    ENV.APP.LOG_ACTIVE_GENERATION = false;
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
    ENV.APP.LOG_VIEW_LOOKUPS = false;
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
    ENV.APP.rootElement = '#ember-testing';
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
  }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
  if (environment === 'production') {
20
a9b98b16b053 add contributor list + edition pane
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    66
    ENV.locationType = 'hash';
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
  }
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
  return ENV;
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
};