Skip to content

Commit

Permalink
update dependency and build
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmacdonald committed Oct 2, 2018
1 parent 65dfcfc commit 33c1209
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
33 changes: 18 additions & 15 deletions build/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ window.Drupal = window.Drupal || {};
var cwrc = require('cwrc-tei-entities-lookup');
cwrc.setEntityRoot('https://commons.cwrc.ca');
cwrc.setSearchRoot(Drupal.settings.CWRCWriter.cwrcDialogs.cwrcApiUrl);
cwrc.setProjectLogoRoot(Drupal.settings.CWRCWriter.cwrcDialogs.projectLogoRoot);
cwrc.setProjectLookupURI(Drupal.settings.CWRCWriter.cwrcDialogs.projectLookupUrl);
cwrc.setProjectLookupConfig({
projectLookupUrl: Drupal.settings.CWRCWriter.cwrcDialogs.projectLookupUrl,
projectLogoRoot: Drupal.settings.CWRCWriter.cwrcDialogs.projectLogoRoot,
cwrcProjectId: Drupal.settings.CWRCWriter.cwrcDialogs.cwrcProjectId
});

var viaf = require('viaf-entity-lookup');
var dbpedia = require('dbpedia-entity-lookup');
Expand Down Expand Up @@ -4914,16 +4917,19 @@ function getSearchRoot() {
}

var projectLogoRoot = '';
function setProjectLogoRoot(url) {
projectLogoRoot = url;
}
function getProjectLogoRoot() {
return projectLogoRoot;
}

var cwrcProjectId = '';
function setCWRCProjectId(id) {
cwrcProjectId = id;
/**
* Set all the properties necessary for the project lookup, then perform the lookup
* @param {Object} config
* @param {String} projectLogoRoot The root directory that project logos are located in
* @param {String} projectLookupUrl The actual url for the lookup
* @param {String} cwrcProjectId The ID assigned to the CWRC Commons project
* @returns {Object} The projects (namespace and logo)
*/
function setProjectLookupConfig(config) {
projectLogoRoot = config.projectLogoRoot;
cwrcProjectId = config.cwrcProjectId;
return doProjectLookup(config.projectLookupUrl);
}

var projects = {};
Expand Down Expand Up @@ -5079,10 +5085,7 @@ module.exports = {
setSearchRoot: setSearchRoot,
getSearchRoot: getSearchRoot,

getProjectLogoRoot: getProjectLogoRoot,
setProjectLogoRoot: setProjectLogoRoot,
setCWRCProjectId: setCWRCProjectId,
setProjectLookupURI: doProjectLookup,
setProjectLookupConfig: setProjectLookupConfig,

findPerson: findPerson,
findPlace: findPlace,
Expand Down
3 changes: 2 additions & 1 deletion includes/utilities.inc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ function islandora_cwrc_writer_default_config() {
'entityFormsRootUrl' => file_create_url($base_url.'/sites/default/libraries/cwrc-entity-management-forms-static/build/'),
'entityFormsCollectionUrl' => file_create_url($base_url.'/islandora/object/islandora%3Aroot'),
'projectLogoRoot' => file_create_url($base_url.'/sites/default/files'),
'projectLookupUrl' => file_create_url($base_url.'/projects/json-lookup')
'projectLookupUrl' => file_create_url($base_url.'/projects/json-lookup'),
'cwrcProjectId' => 'islandora:a61217d0-9cc6-4535-bebc-853bd670adfc'
),
// This associative array of schema documents requires the PID of the schema
// object to be used as each entries key.
Expand Down
7 changes: 5 additions & 2 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ window.Drupal = window.Drupal || {};
let cwrc = require('cwrc-tei-entities-lookup');
cwrc.setEntityRoot('https://commons.cwrc.ca');
cwrc.setSearchRoot(Drupal.settings.CWRCWriter.cwrcDialogs.cwrcApiUrl);
cwrc.setProjectLogoRoot(Drupal.settings.CWRCWriter.cwrcDialogs.projectLogoRoot);
cwrc.setProjectLookupURI(Drupal.settings.CWRCWriter.cwrcDialogs.projectLookupUrl);
cwrc.setProjectLookupConfig({
projectLookupUrl: Drupal.settings.CWRCWriter.cwrcDialogs.projectLookupUrl,
projectLogoRoot: Drupal.settings.CWRCWriter.cwrcDialogs.projectLogoRoot,
cwrcProjectId: Drupal.settings.CWRCWriter.cwrcDialogs.cwrcProjectId
});

let viaf = require('viaf-entity-lookup');
let dbpedia = require('dbpedia-entity-lookup');
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"dependencies": {
"cwrc-public-entity-dialogs": "^1.9.1",
"cwrc-tei-entities-lookup": "^1.2.2",
"cwrc-tei-entities-lookup": "^1.2.3",
"cwrc-writer-base": "^2.19.14",
"dbpedia-entity-lookup": "^0.3.0",
"geonames-entity-lookup": "^1.1.5",
Expand Down

0 comments on commit 33c1209

Please sign in to comment.