Commit Graph

10 Commits

Author SHA1 Message Date
Lu Liu
7d4e182c75
Extend Wikidata extension to support arbitrary Wikibase instances (#2810)
Closes #1640. All Wikibase-dependent parameters, which were previously hard-coded for Wikidata, are now described in a JSON manifest. The manifest is currently constructed by hand, but, in the future, will hopefully be published by each Wikibase instance at a standard location.

* setup the manifest framework

* add dependency mechanism to scrutinizers & update tests

* add json creators to constraint entities

* adapt the backend (units tests are to be updated)

* remove the call to prepareDependencies() in the constructor

* update code according to review feedback

* update scrutinizers tests

* fix typo & update ConstraintsV1

* log if a scrutinizer is skipped

* update versioning handling in the backend

* correct the order of "actual" and "expected" for assertEquals method

* use regex to check manifest versions

* 1. add wikibase-manager.js, wikibase-dialog.js, etc.
2. move dialog/schema-alignment-dialog.js -> schema-alignment.js
3. remove unused schema-alignment-dialog.html
4. change most mentions of "Wikidata" to "Wikibase"

* support saving cookies for different Wikibases & fix LoginCommandTest

* fix schema related tests

* removed unused WikibaseCredentials

* include MediaWiki API endpoint in the schema

* fetch language codes for different Wikibases

* fix lgtm-bot alerts

* keep a connection map (MediaWiki API endpoint => Connection) in ConnectionManager

* simplify the constraint configurations of the manifest and remove lots of unnecessary code.

* add slash to the end of mediawiki.root

* add manifest schema and use ajv to validate the manifest

* remove JSONP support (Wikibase manifest host should support CORS)

* save manifests on manifest update

* add unit tests for Manifest

* include the exception in logger.error() method to make it easier to debug

* include the message of ManifestException when calling respondError

* test multiple connections

* test no manifest & test invalid manifest

* adapt manage-account-dialog.js to support multiple Wikibase connections

* update instance/subclass of related translations

* beautify import-schema-dialog.html

* use "${lang}" variable in the reconciliation service endpoint of the manifest

* adapt schema-alignment.js after introducing "${lang}" variable in the reconciliation service endpoint

* use WikibaseManager.getSelectedWikibaseApi() in SchemaAlignment._getPropertyType

* replace more mentions of "Wikidata" to "Wikibase"

* use WikibaseManager.getSelectedWikibaseApi() in previewrenderer.js

* support fetching language codes of different Wikibases in the frontend

* skip EditInspector if missing 'property_constraint_pid' in the manifest

* improve unit tests for fetching lang codes

* skip scrutinizers depending on fetcher if 'property_constraint_pid' is missing in the manifest

* make sure the schema alignment panel is set up before rendering

* fix preview bug

* add getters of "instance of" and "subclass of" to the Manifest interface and use them in NewItemScrutinizer

* fix hardcode for Wikidata in WbItemVariable

* rename 'entity_prefix' to 'site_iri' and move it from 'manifest.wikibase.properties' to 'manifest.wikibase'

* include oauth configurations in the manifest & support logging in with owner-only consumer for Wikibases with the OAuth extension

* correct schema fallback logic

* select default wikibase according to the saved schema

* include maxlag in the manifest

* [backend] move maxlag setting from preferences to request parameter

* support setting maxlag when uploading edits

* rename "Manage Wikibase" to "Select Wikibase instance" and localize it

* fix manifest updating bug

* include EditGroups in the manifest

* add the reconciliation service from the manifest to standard services if it's not present yet when adding a new manifest

* update according to review feedback

1. use inherited color variable
2. rename 'gridwroks' to 'openrefine'
3. remove unnecessary 'async: true'
4. add 'format: url' validation to urls to the schema

* rename 'wikibasePrefix' to 'siteIri'
2020-08-22 11:58:56 -04:00
Allan Nordhøy
e6197b8224
Translated using Weblate (Norwegian Bokmål)
Currently translated at 82.4% (169 of 205 strings)

Translation: OpenRefine/wikidata
Translate-URL: https://hosted.weblate.org/projects/openrefine/wikidata/nb_NO/
2020-08-15 00:32:54 +02:00
Allan Nordhøy
e0edbca1da
Translated using Weblate (Norwegian Bokmål)
Currently translated at 81.2% (165 of 203 strings)

Translation: OpenRefine/wikidata
Translate-URL: https://hosted.weblate.org/projects/openrefine/wikidata/nb_NO/
2020-07-17 12:41:52 +02:00
Lu Liu
335e81a26c OAuth support for the Wikidata extension (#2661)
Closes #1612 

Merges @afkbrb work to finish @wetneb protype, including:
* adding support for OAuth in addition to basic auth
* supporting registration of single user Wikidata OAuth consumers.
* adding extensive tests
* cleaning up the login dialog

This depends on the next release of the Wikidata Toolkit, but we're currently publishing our own snapshot that includes the necessary changes (thanks @wetneb!)

Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
2020-06-18 23:51:22 -04:00
Allan Nordhøy
4781a1515a
Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (150 of 150 strings)

Translation: OpenRefine/wikidata
Translate-URL: https://hosted.weblate.org/projects/openrefine/wikidata/nb_NO/
2019-03-14 03:03:59 +01:00
Antonin Delpeuch
375839bb22 Update translation files for new format 2018-11-21 15:25:58 +00:00
Jon Harald Søby
5cc95bc28a
Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (147 of 147 strings)

Translation: OpenRefine/wikidata
Translate-URL: https://hosted.weblate.org/projects/openrefine/wikidata/nb_NO/
2018-11-19 10:51:39 +01:00
Allan Nordhøy
a04a3856a7
Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.2% (137 of 147 strings)

Translation: OpenRefine/wikidata
Translate-URL: https://hosted.weblate.org/projects/openrefine/wikidata/nb_NO/
2018-11-18 12:07:53 +01:00
Jon Harald Søby
3d16438c37
Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (147 of 147 strings)

Translation: OpenRefine/wikidata
Translate-URL: https://hosted.weblate.org/projects/openrefine/wikidata/nb_NO/
2018-11-17 09:56:52 +01:00
Jon Harald Søby
4e0e669378
Added translation using Weblate (Norwegian Bokmål) 2018-11-17 00:53:15 +01:00