Commit Graph

37 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
afkbrb
cdb02004fd improve frontend 2020-06-18 23:51:22 -04: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
Ekta Mishra
7a7ba57d91
Grabbing cursor added while adding items for creating wikidata schema (#2491)
Closes #2484
2020-03-28 19:10:04 +01:00
Antonin Delpeuch
30c0108241 Change override term UI to use checkbox 2019-06-13 10:56:06 +01:00
Antonin Delpeuch
a7482ff0d2 Add ability to copy references. Closes #1912. 2019-02-19 21:55:27 +00:00
Antonin Delpeuch
825c4ad213 Add importer UI for Wikibase schema 2018-11-01 15:01:08 +00:00
Antonin Delpeuch
97e16d6e8e Add number of edits in preview and upload dialog 2018-04-28 11:25:49 +02:00
Antonin Delpeuch
68d9f448c6 Style tweaks to the Wikidata schema UI 2018-04-28 10:55:15 +02:00
Antonin Delpeuch
adfa60ef14 Fix scrolling in Wikidata schema 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
cb81da0923 Fix display of column variables in the schema 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
30defdd2c4 Add save and discard buttons on the Wikidata schema 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
02f908b827 Fix appearance of inputs in Firefox for Wikidata schema 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
d8d7e82be1 Restore preview tab 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
41eb14f3c0 Move the schema and issues to their own tabs in the main UI 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
81a18777cb Replace QS preview by visual preview of the edits 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
2779eb97da Add colors to signal when a suggest input has been validated or not 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
a4ece8ef6a Prettify the schema UI 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
2b8ef7a9ae Improve rendering of suggest fields in Firefox 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
3a58c6824d Prettify the UI and add a token to the edit summaries 2018-04-27 09:17:33 +02:00
Antonin Delpeuch
975c3529cb Add UI support for quantity values and tidy up interface 2018-04-27 09:17:32 +02:00
Antonin Delpeuch
6cb4386e64 Tweak the schema alignment UI 2018-04-27 09:17:32 +02:00
Antonin Delpeuch
9513807a83 Display issues in perform edits dialog 2018-04-27 09:17:32 +02:00
Antonin Delpeuch
8b1869414d Improve styling of schema alignment dialog 2018-04-27 09:17:32 +02:00
Antonin Delpeuch
7518d194f0 Display the number of issues in the tab header 2018-04-27 09:17:32 +02:00
Antonin Delpeuch
63d488d74f Add properties to format scrutinizer 2018-04-27 09:17:32 +02:00
Antonin Delpeuch
af4df335de Draft of warnings UI 2018-04-27 09:17:31 +02:00
Antonin Delpeuch
989263d212 Improve Wikidata login screen 2018-04-27 09:17:31 +02:00
Antonin Delpeuch
9f955c40ae Add support for names and descriptions 2018-04-27 09:17:30 +02:00
Antonin Delpeuch
07e2a8d982 Add support for monolingual text in Wikibase schema 2018-04-27 09:17:30 +02:00
Antonin Delpeuch
ddceec4d27 Cleanup and UI tweaks 2018-04-27 09:17:30 +02:00
Antonin Delpeuch
8f4d998e21 Support for Wikidata editing from OpenRefine 2018-04-27 09:17:30 +02:00
Antonin Delpeuch
67e5bcd504 Some UI cleanup for the schema alignment interface 2018-04-27 09:17:30 +02:00
Antonin Delpeuch
23355eb472 Add reference support in Wikibase schema editor 2018-04-27 09:17:30 +02:00
Antonin Delpeuch
66b3ddf76b Add support for qualifiers 2018-04-27 09:17:30 +02:00
Antonin Delpeuch
e38aeb7ba5 JSON serialization of schema to model 2018-04-27 09:17:30 +02:00
Antonin Delpeuch
82930da4db First draft of the schema alignment dialog 2018-04-27 09:17:30 +02:00