Disable "Share feedback..." links by default

Will still be enabled on WMF wikis for now.

Bug: T322494
Change-Id: Ic0b79fdf459d4949d7604f5a213cb1851ca30901
This commit is contained in:
Ed Sanders 2022-11-07 12:42:30 +00:00 committed by Bartosz Dziewoński
parent 9227fedbf6
commit b4eb7fc9ad
3 changed files with 24 additions and 15 deletions

View file

@ -59,7 +59,8 @@
"config": {
"enable": "DiscussionToolsEnable",
"replyIndentation": "DiscussionToolsReplyIndentation",
"switchTime": "DiscussionToolsTimestampFormatSwitchTime"
"switchTime": "DiscussionToolsTimestampFormatSwitchTime",
"showFeedbackLinks": "DiscussionToolsShowFeedbackLinks"
}
},
"ReplyLinksController.js",
@ -543,6 +544,10 @@
"value": "invisible",
"description": "Reply indentation syntax to use: 'invisible' (use `<dl><dd>` tags to output `:` in wikitext) or 'bullet' (use `<ul><li>` tags to output `*` in wikitext)."
},
"DiscussionToolsShowFeedbackLinks": {
"value": false,
"description": "Show 'Share feedback...' links in the footer of reply tool and new topic tool."
},
"DiscussionToolsTimestampFormatSwitchTime": {
"value": "2022-07-12",
"description": "Date on which the internal timestamp format has changed (T304595), in ISO 8601 format."

View file

@ -79,5 +79,6 @@ module.exports = {
HeadingItem: require( './HeadingItem.js' ),
CommentItem: require( './CommentItem.js' ),
utils: require( './utils.js' ),
config: require( './config.json' ),
logger: require( './logger.js' )
};

View file

@ -5,7 +5,8 @@ var controller = require( 'ext.discussionTools.init' ).controller,
ModeTabOptionWidget = require( './ModeTabOptionWidget.js' ),
licenseMessages = require( './licenseMessages.json' ),
featuresEnabled = mw.config.get( 'wgDiscussionToolsFeaturesEnabled' ) || {},
enable2017Wikitext = featuresEnabled.sourcemodetoolbar;
enable2017Wikitext = featuresEnabled.sourcemodetoolbar,
dtConf = require( 'ext.discussionTools.init' ).config;
require( './AbandonCommentDialog.js' );
require( './AbandonTopicDialog.js' );
@ -189,19 +190,21 @@ function ReplyWidget( commentController, commentDetails, config ) {
)
);
}
$footerLinks.append(
$( '<li>' ).append(
$( '<a>' )
.attr( {
href: this.isNewTopic ?
mw.msg( 'discussiontools-replywidget-feedback-link-newtopic' ) :
mw.msg( 'discussiontools-replywidget-feedback-link' ),
target: '_blank',
rel: 'noopener'
} )
.text( mw.msg( 'discussiontools-replywidget-feedback' ) )
)
);
if ( dtConf.showFeedbackLinks ) {
$footerLinks.append(
$( '<li>' ).append(
$( '<a>' )
.attr( {
href: this.isNewTopic ?
mw.msg( 'discussiontools-replywidget-feedback-link-newtopic' ) :
mw.msg( 'discussiontools-replywidget-feedback-link' ),
target: '_blank',
rel: 'noopener'
} )
.text( mw.msg( 'discussiontools-replywidget-feedback' ) )
)
);
}
this.$footer.append(
$( '<p>' ).addClass( 'plainlinks' ).html(
this.isNewTopic ? licenseMessages.newtopic : licenseMessages.reply