Jforrester has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/258199

Change subject: Let the feedback tool be configured for a remote wiki
......................................................................

Let the feedback tool be configured for a remote wiki

Bug: T92661
Change-Id: Id48729c89db208714f67fec1eabafe577a834b51
---
M VisualEditor.hooks.php
M extension.json
M modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
3 files changed, 14 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/99/258199/1

diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 09f5a62..a1d2eae 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -587,6 +587,7 @@
                        'specialBooksources' => urldecode( 
SpecialPage::getTitleFor( 'Booksources' )->getPrefixedURL() ),
                        'restbaseUrl' => $coreConfig->get( 
'VisualEditorRestbaseURL' ),
                        'fullRestbaseUrl' => $coreConfig->get( 
'VisualEditorFullRestbaseURL' ),
+                       'feedbackUrl' =>  $veConfig->get( 
'VisualEditorFeedbackURL' ),
                );
 
                return true;
diff --git a/extension.json b/extension.json
index 009b578..e5de77e 100644
--- a/extension.json
+++ b/extension.json
@@ -29,6 +29,7 @@
                },
                "VisualEditorRestbaseURL": false,
                "VisualEditorFullRestbaseURL": false,
+               "VisualEditorFeedbackURL": false,
                "VisualEditorSerializationCacheTimeout": 3600,
                "VisualEditorUseChangeTagging": true,
                "VisualEditorSupportedSkins": [
diff --git a/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js 
b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
index c58e0d1..c65f3bb 100644
--- a/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
+++ b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
@@ -179,14 +179,24 @@
        this.popup.toggle( false );
        if ( !this.feedbackPromise ) {
                this.feedbackPromise = mw.loader.using( 'mediawiki.feedback' 
).then( function () {
+                       var feedbackConfig, veConfigFeedbackUrl;
+
                        // This can't be constructed until the editor has 
loaded as it uses special messages
-                       return new mw.Feedback( {
+                       feedbackConfig = {
                                title: new mw.Title( ve.msg( 
'visualeditor-feedback-link' ) ),
                                bugsLink: new mw.Uri( 
'https://phabricator.wikimedia.org/maniphest/task/create/?projects=VisualEditor'
 ),
                                bugsListLink: new mw.Uri( 
'https://phabricator.wikimedia.org/maniphest/query/eSHgNozkIsuv/' ),
                                showUseragentCheckbox: true,
                                useragentCheckboxMandatory: true
-                       } );
+                       };
+
+                       // If so configured, tell mw.feedback that we're 
posting to a remote wiki
+                       veConfigFeedbackUrl = mw.config.get( 
'wgVisualEditorConfig' ).feedbackUrl;
+                       if ( veConfigFeedbackUrl ) {
+                               feedbackConfig.apiUrl = veConfigFeedbackUrl;
+                       }
+
+                       return new mw.Feedback( feedbackConfig );
                } );
        }
        this.feedbackPromise.done( function ( feedback ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/258199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id48729c89db208714f67fec1eabafe577a834b51
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to