jenkins-bot has submitted this change and it was merged. Change subject: Pass repoApiUrl option to ValueView experts ......................................................................
Pass repoApiUrl option to ValueView experts This does not have any effect until https://github.com/wmde/ValueView/pull/182 is merged and released. Change-Id: I3bbc6244a6189d0d2a20322e1280291c4199d796 --- M composer.json M repo/resources/wikibase.ui.entityViewInit.js M view/resources/wikibase/view/ViewFactory.js M view/resources/wikibase/wikibase.ValueViewBuilder.js 4 files changed, 29 insertions(+), 9 deletions(-) Approvals: Jonas Kress (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index 0dd0c67..3fce256 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "data-values/data-types": "~0.5.0", "data-values/serialization": "~1.0", "data-values/javascript": "~0.6.0|~0.7.0", - "data-values/value-view": "~0.15.1", + "data-values/value-view": "~0.15.3", "wikibase/data-model": "~4.0", "wikibase/data-model-javascript": "^1.0.2", diff --git a/repo/resources/wikibase.ui.entityViewInit.js b/repo/resources/wikibase.ui.entityViewInit.js index baed7ed..be9a524 100644 --- a/repo/resources/wikibase.ui.entityViewInit.js +++ b/repo/resources/wikibase.ui.entityViewInit.js @@ -140,9 +140,10 @@ * @throws {Error} if no widget to render the entity exists. */ function createEntityView( entity, $entityview ) { - var repoConfig = mw.config.get( 'wbRepo' ); - var mwApi = wb.api.getLocationAgnosticMwApi( repoConfig.url + repoConfig.scriptPath + '/api.php' ); - var repoApi = new wb.api.RepoApi( mwApi ), + var repoConfig = mw.config.get( 'wbRepo' ), + repoApiUrl = repoConfig.url + repoConfig.scriptPath + '/api.php', + mwApi = wb.api.getLocationAgnosticMwApi( repoApiUrl ), + repoApi = new wb.api.RepoApi( mwApi ), userLanguages = getUserLanguages(), entityStore = buildEntityStore( repoApi, userLanguages[0] ), revisionStore = new wb.RevisionStore( mw.config.get( 'wgCurRevisionId' ) ), @@ -165,7 +166,8 @@ } }, getParserStore( repoApi ), - userLanguages + userLanguages, + repoApiUrl ); var entityView = viewFactory.getEntityView( entity, $entityview ); diff --git a/view/resources/wikibase/view/ViewFactory.js b/view/resources/wikibase/view/ViewFactory.js index 248d512..9113628 100644 --- a/view/resources/wikibase/view/ViewFactory.js +++ b/view/resources/wikibase/view/ViewFactory.js @@ -34,6 +34,7 @@ * @param {string[]} userLanguages An array of language codes, the first being the UI language * Required for showing the user interface in the correct language and for showing terms * in all languages requested by the user. + * @param {string|null} [vocabularyLookupApiUrl=null] */ var SELF = MODULE.ViewFactory = function ViewFactory( contentLanguages, @@ -44,7 +45,8 @@ formatterStore, messageProvider, parserStore, - userLanguages + userLanguages, + vocabularyLookupApiUrl ) { this._contentLanguages = contentLanguages; this._dataTypeStore = dataTypeStore; @@ -56,6 +58,7 @@ this._parserStore = parserStore; // Maybe make userLanguages an argument to getEntityView instead of to the constructor this._userLanguages = userLanguages; + this._vocabularyLookupApiUrl = vocabularyLookupApiUrl || null; }; /** @@ -113,6 +116,12 @@ SELF.prototype._userLanguages = null; /** + * @property {string|null} + * @private + **/ + SELF.prototype._vocabularyLookupApiUrl = null; + + /** * Construct a suitable view for the given entity on the given DOM element * * @param {wikibase.datamodel.Entity} entity @@ -146,7 +155,8 @@ this._parserStore, this._userLanguages && this._userLanguages[0], this._messageProvider, - this._contentLanguages + this._contentLanguages, + this._vocabularyLookupApiUrl ); }; diff --git a/view/resources/wikibase/wikibase.ValueViewBuilder.js b/view/resources/wikibase/wikibase.ValueViewBuilder.js index b777d42..21c7486 100644 --- a/view/resources/wikibase/wikibase.ValueViewBuilder.js +++ b/view/resources/wikibase/wikibase.ValueViewBuilder.js @@ -14,9 +14,16 @@ * @param {string} language * @param {util.MessageProvider} messageProvider * @param {util.ContentLanguages} contentLanguages + * @param {string|null} [vocabularyLookupApiUrl=null] */ var SELF = wb.ValueViewBuilder = function WbValueViewBuilder( - expertStore, formatterStore, parserStore, language, messageProvider, contentLanguages + expertStore, + formatterStore, + parserStore, + language, + messageProvider, + contentLanguages, + vocabularyLookupApiUrl ) { this._baseOptions = { expertStore: expertStore, @@ -24,7 +31,8 @@ parserStore: parserStore, language: language, messageProvider: messageProvider, - contentLanguages: contentLanguages + contentLanguages: contentLanguages, + vocabularyLookupApiUrl: vocabularyLookupApiUrl || null }; }; -- To view, visit https://gerrit.wikimedia.org/r/233948 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3bbc6244a6189d0d2a20322e1280291c4199d796 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]> Gerrit-Reviewer: Daniel Kinzler <[email protected]> Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]> Gerrit-Reviewer: Legoktm <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
