jenkins-bot has submitted this change and it was merged.

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, 19 insertions(+), 3 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 09f5a62..4d6c85a 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -587,6 +587,8 @@
                        'specialBooksources' => urldecode( 
SpecialPage::getTitleFor( 'Booksources' )->getPrefixedURL() ),
                        'restbaseUrl' => $coreConfig->get( 
'VisualEditorRestbaseURL' ),
                        'fullRestbaseUrl' => $coreConfig->get( 
'VisualEditorFullRestbaseURL' ),
+                       'feedbackApiUrl' =>  $veConfig->get( 
'VisualEditorFeedbackAPIURL' ),
+                       'feedbackTitle' =>  $veConfig->get( 
'VisualEditorFeedbackTitle' ),
                );
 
                return true;
diff --git a/extension.json b/extension.json
index b10c0b8..3919800 100644
--- a/extension.json
+++ b/extension.json
@@ -29,6 +29,8 @@
                },
                "VisualEditorRestbaseURL": false,
                "VisualEditorFullRestbaseURL": false,
+               "VisualEditorFeedbackAPIURL": false,
+               "VisualEditorFeedbackTitle": 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..339c460 100644
--- a/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
+++ b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
@@ -179,14 +179,26 @@
        this.popup.toggle( false );
        if ( !this.feedbackPromise ) {
                this.feedbackPromise = mw.loader.using( 'mediawiki.feedback' 
).then( function () {
+                       var feedbackConfig, veConfig;
+
                        // This can't be constructed until the editor has 
loaded as it uses special messages
-                       return new mw.Feedback( {
-                               title: new mw.Title( ve.msg( 
'visualeditor-feedback-link' ) ),
+                       feedbackConfig = {
                                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 and set the title
+                       veConfig = mw.config.get( 'wgVisualEditorConfig' );
+                       if ( veConfig.feedbackApiUrl ) {
+                               feedbackConfig.apiUrl = veConfig.feedbackApiUrl;
+                               feedbackConfig.title = new mw.Title( 
veConfig.feedbackTitle );
+                       } else {
+                               feedbackConfig.title = new mw.Title( ve.msg( 
'visualeditor-feedback-link' ) );
+                       }
+
+                       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: merged
Gerrit-Change-Id: Id48729c89db208714f67fec1eabafe577a834b51
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Jforrester <[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

Reply via email to