[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-codfw.php: Repool db2047
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380687 ) Change subject: db-codfw.php: Repool db2047 .. db-codfw.php: Repool db2047 db2047 crashed due to temperature issues. The rack looks fine and so do the PDU and their temperature graphs. Going to repool this host and if it happens again we will really need to look into this as the rack might have issues or the hardware itself Bug: T176573 Change-Id: Ie3fe4074b72c00ea4bda3f8d76c0b9c719006b8f --- M wmf-config/db-codfw.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Marostegui: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php index 7fba7b5..910749a 100644 --- a/wmf-config/db-codfw.php +++ b/wmf-config/db-codfw.php @@ -159,7 +159,7 @@ 's7' => [ 'db2029' => 0, # B6 2.9TB 96GB, master 'db2040' => 200, # C6 2.9TB 160GB, rc, log - # 'db2047' => 400, # C6 2.9TB 160GB, crashed T176573 + 'db2047' => 400, # C6 2.9TB 160GB, 'db2054' => 200, # D6 2.9TB 160GB, dump (inactive), vslow 'db2061' => 200, # D6 3.3TB 160GB, api 'db2068' => 300, # D6 3.3TB 160GB -- To view, visit https://gerrit.wikimedia.org/r/380687 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie3fe4074b72c00ea4bda3f8d76c0b9c719006b8f Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MarosteguiGerrit-Reviewer: Jcrespo Gerrit-Reviewer: Marostegui Gerrit-Reviewer: Urbanecm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Deal with mw.Api's insanely inconsistent rejection parameters
Catrope has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380688 ) Change subject: Deal with mw.Api's insanely inconsistent rejection parameters .. Deal with mw.Api's insanely inconsistent rejection parameters See T176704 for the gory details. This code should be able to extract a reasonable error message from all five (!!) different ways mw.Api requests can communicate failure. Unfortunately, we don't actually use the error message anywhere currently. Change-Id: I2df016676b9831ebabec9ef0a3ccc65888d1e3f9 --- M modules/mw.cx.TargetArticle.js 1 file changed, 47 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/88/380688/1 diff --git a/modules/mw.cx.TargetArticle.js b/modules/mw.cx.TargetArticle.js index b188f7a..f2277dc 100644 --- a/modules/mw.cx.TargetArticle.js +++ b/modules/mw.cx.TargetArticle.js @@ -57,10 +57,11 @@ /** * Publish success handler - * @param {Object} response Response object from the publishing api + * @param {Object} response Response object from the publishing api + * @param {Object} jqXHR * @return {null|jQuery.Promise} */ -mw.cx.TargetArticle.prototype.publishSuccess = function ( response ) { +mw.cx.TargetArticle.prototype.publishSuccess = function ( response, jqXHR ) { var publishResult = response.cxpublish; if ( publishResult.result === 'success' ) { return this.publishComplete(); @@ -73,7 +74,7 @@ } // Any other failure - return this.publishFail( publishResult ); + return this.publishFail( '', publishResult, publishResult, jqXHR ); }; /** @@ -86,21 +87,28 @@ /** * Publish failure handler - * @param {Object} jqXHR - * @param {string} status Text status message - * @param {Object|null} data API response data + * + * The mystery parameter could be a string explaining the error, or an object with textStatus, + * exception and jqXHR keys (but jqXHR can be missing), or equal to data. If data is + * present, jqXHR is also present. See T176704. + * + * @param {string} errorCode + * @param {string|Object} mystery String, or obj with textStatus+exception+[jqXHR], or data + * @param {Object} [data] Data returned by api.php + * @param {Object} [jqXHR] jQuery XHR object */ -mw.cx.TargetArticle.prototype.publishFail = function ( jqXHR, status, data ) { +mw.cx.TargetArticle.prototype.publishFail = function ( errorCode, mystery, data, jqXHR ) { + debugger; var editError, editResult; - // Handle empty response if ( !data ) { - this.showErrorEmpty(); - return; - } + if ( errorCode === 'ok-but-empty' ) { + this.showErrorEmpty(); + return; + } - if ( data.exception instanceof Error ) { - data.exception = data.exception.toString(); + this.showErrorException( mystery ); + return; } editResult = data.edit; @@ -108,12 +116,13 @@ // Handle spam blacklist error (either from core or from Extension:SpamBlacklist) // {"result":"error","edit":{"spamblacklist":"facebook.com","result":"Failure"}} if ( editResult.spamblacklist ) { - this.showErrorSpamBlacklist( data.edit ); + this.showErrorSpamBlacklist( editResult ); return; } // Handle abusefilter errors. if ( editResult.code && editResult.code.indexOf( 'abusefilter' ) === 0 ) { this.showErrorAbuseFilter( editResult.info, editResult.warning ); + return; } } @@ -149,7 +158,7 @@ } // Handle (other) unknown and/or unrecoverable errors - this.showErrorUnknown( editResult, data ); + this.showErrorUnknown( editResult, data, jqXHR ); // TODO: Event logging the publishing error }; @@ -272,19 +281,40 @@ }; /** + * Show an error based on an exception+textStatus object + * @param {Object} failObj Object from the rejection params of mw.Api, with exception and textStatus + */ +mw.cx.TargetArticle.prototype.showErrorException = function ( failObj ) { + var errorMsg = failObj.exception || failObj.textStatus; + if ( errorMsg instanceof Error ) { + errorMsg = errorMsg.toString(); + } + if ( errorMsg ) { + this.showPublishError( + $( document.createTextNode( errorMsg ) ), + false // prevents reapply + ); + this.emit( 'publishErrorUnknown', errorMsg ); + } else { + this.showErrorUnknown( null, null, failObj.jqXHR ); + } +}; + +/** * Handle unknown publish error * * @method * @param
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-codfw.php: Repool db2047
Marostegui has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380687 ) Change subject: db-codfw.php: Repool db2047 .. db-codfw.php: Repool db2047 db2047 crashed due to temperature issues. The rack looks fine and so do the PDU and their temperature graphs. Going to repool this host and if it happens again we will really need to look into this as the rack might have issues or the hardware itself Bug: T176573 Change-Id: Ie3fe4074b72c00ea4bda3f8d76c0b9c719006b8f --- M wmf-config/db-codfw.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/87/380687/1 diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php index 7fba7b5..910749a 100644 --- a/wmf-config/db-codfw.php +++ b/wmf-config/db-codfw.php @@ -159,7 +159,7 @@ 's7' => [ 'db2029' => 0, # B6 2.9TB 96GB, master 'db2040' => 200, # C6 2.9TB 160GB, rc, log - # 'db2047' => 400, # C6 2.9TB 160GB, crashed T176573 + 'db2047' => 400, # C6 2.9TB 160GB, 'db2054' => 200, # D6 2.9TB 160GB, dump (inactive), vslow 'db2061' => 200, # D6 3.3TB 160GB, api 'db2068' => 300, # D6 3.3TB 160GB -- To view, visit https://gerrit.wikimedia.org/r/380687 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3fe4074b72c00ea4bda3f8d76c0b9c719006b8f Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Marostegui___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad.php: Removed old db1055 comment
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380686 ) Change subject: db-eqiad.php: Removed old db1055 comment .. db-eqiad.php: Removed old db1055 comment Change-Id: I6cfa02af6530bbf14cf340a30ef8479973131bd4 --- M wmf-config/db-eqiad.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Marostegui: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php index f2ad5c4..72d4dbc 100644 --- a/wmf-config/db-eqiad.php +++ b/wmf-config/db-eqiad.php @@ -104,7 +104,7 @@ 'db1052' => 0, # B3 2.8TB 96GB, master 'db1067' => 0, # D1 2.8TB 160GB, old master 'db1051' => 1, # B3 2.8TB 96GB, watchlist, recentchanges, contributions, logpager - 'db1055' => 1, # C2 2.8TB 96GB, watchlist, recentchanges, contributions, logpager # low weight + 'db1055' => 1, # C2 2.8TB 96GB, watchlist, recentchanges, contributions, logpager 'db1065' => 0, # D1 2.8TB 160GB, vslow, dump, master for sanitarium 'db1066' => 10, # D1 2.8TB 160GB, api 'db1072' => 50, # B2 2.8TB 160GB, api -- To view, visit https://gerrit.wikimedia.org/r/380686 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6cfa02af6530bbf14cf340a30ef8479973131bd4 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MarosteguiGerrit-Reviewer: Jcrespo Gerrit-Reviewer: Marostegui Gerrit-Reviewer: Urbanecm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad.php: Removed old db1055 comment
Marostegui has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380686 ) Change subject: db-eqiad.php: Removed old db1055 comment .. db-eqiad.php: Removed old db1055 comment Change-Id: I6cfa02af6530bbf14cf340a30ef8479973131bd4 --- M wmf-config/db-eqiad.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/86/380686/1 diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php index f2ad5c4..72d4dbc 100644 --- a/wmf-config/db-eqiad.php +++ b/wmf-config/db-eqiad.php @@ -104,7 +104,7 @@ 'db1052' => 0, # B3 2.8TB 96GB, master 'db1067' => 0, # D1 2.8TB 160GB, old master 'db1051' => 1, # B3 2.8TB 96GB, watchlist, recentchanges, contributions, logpager - 'db1055' => 1, # C2 2.8TB 96GB, watchlist, recentchanges, contributions, logpager # low weight + 'db1055' => 1, # C2 2.8TB 96GB, watchlist, recentchanges, contributions, logpager 'db1065' => 0, # D1 2.8TB 160GB, vslow, dump, master for sanitarium 'db1066' => 10, # D1 2.8TB 160GB, api 'db1072' => 50, # B2 2.8TB 160GB, api -- To view, visit https://gerrit.wikimedia.org/r/380686 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6cfa02af6530bbf14cf340a30ef8479973131bd4 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Marostegui___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: toolforge: Remove /usr/bin/sql
BryanDavis has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380685 ) Change subject: toolforge: Remove /usr/bin/sql .. toolforge: Remove /usr/bin/sql The misctools debian package created from labs/toollabs.git contains a rewrite of /usr/bin/sql to python3 that was added by Tim Landsheidt in 695c7fb, but we have not stopped overwriting it with the older bash version. Bug: T176688 Change-Id: I91cdc62ff27546351f593a83f090aa2dede0d736 --- D modules/toollabs/files/sql M modules/toollabs/manifests/exec_environ.pp 2 files changed, 0 insertions(+), 128 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/85/380685/1 diff --git a/modules/toollabs/files/sql b/modules/toollabs/files/sql deleted file mode 100755 index 65f5314..000 --- a/modules/toollabs/files/sql +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash - -# this tool allow you to connect quickly to sql database -# it should work for all newbies - -verbose=0 - -function Log { -if [ $verbose -eq 1 ];then - echo "$1" -fi -} - -if [ $# -lt 1 ];then -echo "Usage: \"sql [-vh]\" type sql --help for more help" -exit 0 -fi - -if [ "$1" = "-h" ] || [ "$1" == "--help" ];then -echo "Usage: sql [_p] [-vh] [command(s)]" - echo - echo "This tool allows you to easily open a connection to sql database without having to provide the credentials or a database host server" - echo "Example: sql frwiki_p" - echo - echo "Parameters:" - echo " -v: verbose - produce various information about the resolution of db" - echo - echo "Report bugs to phabricator: https://phabricator.wikimedia.org; - exit 0 -fi - -for i -do - if [ "$i" = "-v" ] || [ "$i" = "--verbose" ] - then - verbose=1 - fi -done - -if [ ! -f ~/replica.my.cnf ] && [ ! -f ~/.my.cnf ] -then - Log "WARNING: There is no configuration file for mysql to use, you will probably be unable to access the database" -fi - -param="" -# check if the user has a replica file -if [ -f ~/replica.my.cnf ];then -param=" --defaults-file=~/replica.my.cnf" -else -if [ ! -f ~/.my.cnf ];then -param=" -p" -fi -fi - -server="enwiki.labsdb" -db="enwiki_p" - -case "$1" in -"en" | "enwiki" | "enwiki_p") -server="enwiki.labsdb" -db="enwiki_p" -;; -"de" | "dewiki" | "dewiki_p") -server="dewiki.labsdb" -db="dewiki_p" -;; -"fr" | "frwiki" | "frwiki_p") -server="frwiki.labsdb" -db="frwiki_p" -;; -"cs" | "cswiki" | "cswiki_p") -server="cswiki.labsdb" -db="cswiki_p" -;; -"commons" | "commonswiki" | "commonswiki_p") -server="commonswiki.labsdb" -db="commonswiki_p" -;; -"wikidata" | "wikidatawiki" | "wikidatawiki_p") -server="wikidatawiki.labsdb" -db="wikidatawiki_p" -;; -"meta" | "meta_p") -# Not to confuse with metawiki[_p] -# https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/Help#Metadata_database -server="s7.labsdb" -db="meta_p" -;; -"local") -server=tools-db -db="" -if [ -f ~/.my.cnf ];then - param="" -fi - ;; - *) - # we don't know what the database is so we check if it exist first - Log "This database name is not known by sql script, fallback to dblist resolution" - db="${1%_p}_p" - server="${db%_p}.labsdb" - if getent hosts -- "$server" > /dev/null - then - Log "Resolved to $server $db" - else - echo "Could not find requested database" -if [ "$db" != "$1" ]; then -echo 'Make sure to ask for a db in format of _p' -fi - exit 1 - fi - ;; -esac - -shift -Log "Connecting to $server" -if [ $# -lt 1 ]; then - exec mysql $param -h $server $db "$@" -else - echo "$@" | mysql $param -h $server $db -fi diff --git a/modules/toollabs/manifests/exec_environ.pp b/modules/toollabs/manifests/exec_environ.pp index f33c47a..53c73cb 100644 --- a/modules/toollabs/manifests/exec_environ.pp +++ b/modules/toollabs/manifests/exec_environ.pp @@ -401,14 +401,6 @@ ensure => latest, } -file { '/usr/bin/sql': -ensure => file, -owner => 'root', -group => 'root', -mode => '0755', -source => 'puppet:///modules/toollabs/sql', -} - sysctl::parameters { 'tool labs': values => { 'vm.overcommit_memory' => 2, -- To view, visit https://gerrit.wikimedia.org/r/380685 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91cdc62ff27546351f593a83f090aa2dede0d736 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BryanDavis
[MediaWiki-commits] [Gerrit] labs/toollabs[master]: sql: Update to allow connecting to new cluster
BryanDavis has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380684 ) Change subject: sql: Update to allow connecting to new cluster .. sql: Update to allow connecting to new cluster Update the python port of /usr/bin/sql to add: * --cluster argument for selecting analytics, web, or labsdb hosts * Simplify legacy alias support * Add additional aliases for connecting to tools.db.svc.eqiad.wmflabs * Arbitrary style changes that I couldn't help myself from making Bug: T176688 Change-Id: I5d432bb3e0565cc2a7b729b6ba7306cbcc4cec9b --- M debian/changelog M misctools/sql 2 files changed, 78 insertions(+), 46 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs refs/changes/84/380684/1 diff --git a/debian/changelog b/debian/changelog index 6c073c3..99b8010 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +toollabs (1.22) trusty; urgency=medium + + * misctools: update sql command + + -- Bryan DavisMon, 26 Sep 2017 04:47:19 + + toollabs (1.21) trusty; urgency=medium * jsub: remove support for release=precise diff --git a/misctools/sql b/misctools/sql index 9621886..b3dd580 100755 --- a/misctools/sql +++ b/misctools/sql @@ -1,6 +1,7 @@ -#!/usr/bin/python3 +#!/usr/bin/python3 -Es # # Copyright (C) 2017 Tim Landscheidt +# Copyright (C) 2017 Wikimedia Foundation and contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,72 +23,97 @@ import socket import sys -parser = argparse.ArgumentParser(description='Connect to or run SQL query ' + - 'on replica or Tools database server', - epilog='Report bugs to Phabricator: ' + - 'https://phabricator.wikimedia.org') -parser.add_argument('-v', '--verbose', action='store_true', default=False, -help='show debugging information') -parser.add_argument('dbname', metavar='DATABASE NAME|WIKI NAME', -help='for example commonswiki_p or enwiki') -parser.add_argument('sqlquery', metavar='SQL QUERY', nargs=argparse.REMAINDER, -help='SQL query; multiple words will be joined by spaces') +logger = logging.getLogger(__name__) + +ALIASES = { +'commons': 'commonswiki_p', +'cs': 'cswiki_p', +'de': 'dewiki_p', +'en': 'enwiki_p', +'fr': 'frwiki_p', +'wikidata': 'wikidatawiki_p', +'meta': 'meta_p', +} + +parser = argparse.ArgumentParser( +description=( +'Connect to or run SQL query ' +'on replica or Tools database server'), +epilog=( +'Report bugs to Phabricator: ' +'https://phabricator.wikimedia.org') +) +parser.add_argument( +'-v', '--verbose', action='count', default=0, dest='loglevel', +help='increase logging verbosity') +parser.add_argument( +'--cluster', default='labsdb', +choices=['analytics', 'web', 'labsdb'], +help='cluster to connect to') +parser.add_argument( +'dbname', metavar='DATABASE', +help='for example commonswiki_p or enwiki') +parser.add_argument( +'sqlquery', metavar='...', nargs=argparse.REMAINDER, +help='SQL query; multiple arguments will be joined by spaces') args = parser.parse_args() -# Set up logging. -logging.basicConfig(stream=sys.stderr, -format='%(message)s', -level=logging.DEBUG if args.verbose else logging.WARN) +logging.basicConfig( +stream=sys.stderr, +format='%(message)s', +level=max(logging.DEBUG, logging.WARNING - (10 * args.loglevel))) + +if args.cluster == 'labsdb': +domain = 'labsdb' +else: +domain = '{}.db.svc.eqiad.wmflabs'.format(args.cluster) exec_args = ['mysql'] -if os.path.isfile(os.path.expanduser('~/replica.my.cnf')): -exec_args += ['--defaults-file=' + os.path.expanduser('~/replica.my.cnf')] -elif not(os.path.isfile(os.path.expanduser('~/.my.cnf'))): -exec_args += ['-p'] -logging.warn('There is no configuration file for mysql to use, ' + - 'you will probably be unable to access the database') +replica_cnf = os.path.expanduser('~/replica.my.cnf') +if os.path.isfile(replica_cnf): +exec_args.append('--defaults-file={}'.format(replica_cnf)) +elif not os.path.isfile(os.path.expanduser('~/.my.cnf')): +exec_args.append('-p') +logger.warn( +'There is no configuration file for mysql to use, ' + +'you will probably be unable to access the database') -# These aliases have historically been supported; no new ones should -# be added here. -if args.dbname in ['commons', 'cs', 'de', 'en', 'fr', 'wikidata']: -server = args.dbname + 'wiki.labsdb' -db = args.dbname + 'wiki_p' -elif args.dbname in ['meta', 'meta_p']: -#
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Use OOUI button widgets on CX dashboard
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379232 ) Change subject: Use OOUI button widgets on CX dashboard .. Use OOUI button widgets on CX dashboard - Use OOUI for 'Start translation' button. - Use OOUI for 'Discard translation' dialog. Change-Id: I8cc92ddcc7207af18bf2fe4194297e26361668ba --- M modules/dashboard/ext.cx.translationlist.js M modules/dashboard/styles/ext.cx.translationlist.less M modules/source/ext.cx.source.selector.js 3 files changed, 43 insertions(+), 41 deletions(-) Approvals: jenkins-bot: Verified Santhosh: Looks good to me, approved diff --git a/modules/dashboard/ext.cx.translationlist.js b/modules/dashboard/ext.cx.translationlist.js index ef515e0..9fc87be 100644 --- a/modules/dashboard/ext.cx.translationlist.js +++ b/modules/dashboard/ext.cx.translationlist.js @@ -526,15 +526,18 @@ } else { this.$confirmationDialog = $( '' ) .addClass( 'cx-draft-discard-dialog' ); - $cancelButton = $( '' ) - .addClass( 'mw-ui-button mw-ui-quiet cx-draft-discard-dialog__cancel' ) - .text( mw.msg( 'cx-draft-cancel-button-label' ) ); - $discardButton = $( '' ) - .addClass( 'mw-ui-button mw-ui-destructive cx-draft-discard-dialog__discard' ) - .text( mw.msg( 'cx-draft-discard-button-label' ) ); + $cancelButton = new OO.ui.ButtonWidget( { + classes: [ 'cx-draft-discard-dialog__cancel' ], + label: mw.msg( 'cx-draft-cancel-button-label' ) + } ).$element; + $discardButton = new OO.ui.ButtonWidget( { + classes: [ 'cx-draft-discard-dialog__discard' ], + flags: [ 'primary', 'destructive' ], + label: mw.msg( 'cx-draft-discard-button-label' ) + } ).$element; $actions = $( '' ) .addClass( 'cx-draft-discard-dialog__actions' ) - .append( $discardButton, $cancelButton ); + .append( $cancelButton, $discardButton ); $message = $( '' ) .addClass( 'cx-draft-discard-dialog__message' ) .text( mw.msg( 'cx-draft-discard-confirmation-message' ) ); diff --git a/modules/dashboard/styles/ext.cx.translationlist.less b/modules/dashboard/styles/ext.cx.translationlist.less index b872a73..ecf6cf3 100644 --- a/modules/dashboard/styles/ext.cx.translationlist.less +++ b/modules/dashboard/styles/ext.cx.translationlist.less @@ -186,19 +186,22 @@ .cx-draft-discard-dialog { .mw-ui-item; - color: #222; + background-color: #fff; + color: @colorGray2; + position: fixed; - min-width: 500px; + top: 50%; + left: 50%; + .transform( translate( -50%, -50% ) ); + z-index: 1000; + + min-width: 400px; max-width: 600px; - background: #fff; - border: 1px solid #c8ccd1; + border: 1px solid @colorGray12; border-bottom-width: 3px; border-radius: @borderRadius; padding: 0; - top: 30%; - left: 30%; - box-shadow: 0 5px 10px rgba( 0, 0, 0, 0.2 ); - z-index: 1000; + .box-shadow( 0 5px 10px rgba( 0, 0, 0, 0.2 ) ); &__message { padding: 25px; @@ -209,11 +212,7 @@ .mw-ui-one-whole; padding: 20px; - - button { - float: right; - padding-right: 20px; - } + text-align: right; } } diff --git a/modules/source/ext.cx.source.selector.js b/modules/source/ext.cx.source.selector.js index 3ebea70..beb0458 100644 --- a/modules/source/ext.cx.source.selector.js +++ b/modules/source/ext.cx.source.selector.js @@ -54,7 +54,7 @@ this.$messageBar = null; this.$targetTitleInput = null; this.overlay = null; - this.$translateFromButton = null; + this.translateFromButton = null; this.narrowLimit = 700; this.isNarrowScreenSize = false; this.validator = new mw.cx.ContentTranslationValidator( this.siteMapper ); @@ -392,7 +392,7 @@ this.$trigger.click( this.show.bind( this ) ); this.sourcePageSelector.on( 'change', function () { - self.$translateFromButton.prop( 'disabled', false ); + self.translateFromButton.setDisabled( false ); // Hide any previous errors.
[MediaWiki-commits] [Gerrit] mediawiki...cxserver[master]: [BREAKING CHANGE] Return full HTML document in segmentedContent
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378823 ) Change subject: [BREAKING CHANGE] Return full HTML document in segmentedContent .. [BREAKING CHANGE] Return full HTML document in segmentedContent This endpoint only returned the previously, using hacky code to do so. However, the full document is valuable for VisualEditor, especially because of the tag. Instead of stripping the HTML on the server, send the full HTML to the client so it has a chance to look at the header data before extracting the body. Depends-On: Id6235710eaec77f8d9b3eef8abf6c5f838d9b2d4 Change-Id: I8367f9f27642a38104d7999c4f32b9bc7a3bc412 --- M lib/pageloader/PageLoader.js 1 file changed, 1 insertion(+), 22 deletions(-) Approvals: Esanders: Looks good to me, but someone else must approve jenkins-bot: Verified Santhosh: Looks good to me, approved diff --git a/lib/pageloader/PageLoader.js b/lib/pageloader/PageLoader.js index dde851a..9c7ed10 100644 --- a/lib/pageloader/PageLoader.js +++ b/lib/pageloader/PageLoader.js @@ -2,27 +2,6 @@ var apiUtil = require( '../api-util' ); -/** - * Cheap body extraction. - * - * This is safe as we know that the HTML we are receiving from Parsoid is - * serialized as XML. - * Restbase does not support body only retrieval of content. - * See https://phabricator.wikimedia.org/T95199 - * - * @param {string} html - * @return {string} body of the html passed, wrapped in tag. - */ -function cheapBodyInnerHTML( html ) { - var match = /]*>([\s\S]*)<\/body>/.exec( html ); - - if ( !match ) { - throw new Error( 'No HTML body found!' ); - } else { - return '' + match[ 1 ] + ''; - } -} - function PageLoader( app ) { this.app = app; this.log = app.logger.log || function () {}; @@ -60,7 +39,7 @@ return apiUtil.restApiGet( this.app, domain, path, restReq ).then( function ( response ) { return { - body: cheapBodyInnerHTML( response.body ), + body: response.body, // Restbase returns revision ID in etag header. // Example: // ETag: "123456/c4e494da-ee8f-11e4-83a1-8b80de1cde5f" -- To view, visit https://gerrit.wikimedia.org/r/378823 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8367f9f27642a38104d7999c4f32b9bc7a3bc412 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/cxserver Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: Esanders Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: Santhosh Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Phalanx[master]: Archive Extension:Phalanx
SamanthaNguyen has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380587 ) Change subject: Archive Extension:Phalanx .. Archive Extension:Phalanx Bug: T176665 Change-Id: Ibdcd25dd424160536a4b597371c075e378676170 --- A ARCHIVED D Phalanx.alias.php D Phalanx.class.php D Phalanx.php D PhalanxAjax.class.php D PhalanxHelper.class.php D SpecialPhalanx.body.php D SpecialPhalanxStats.body.php D blocks/ContentBlock.class.php D blocks/QuestionTitleBlock.class.php D blocks/RecentQuestionsBlock.class.php D blocks/TitleBlock.class.php D blocks/UserBlock.class.php D blocks/UserCookieBlock.class.php D blocks/WikiCreationBlock.class.php D css/Phalanx.css D i18n/ar.json D i18n/ast.json D i18n/az.json D i18n/ba.json D i18n/bg.json D i18n/br.json D i18n/bs.json D i18n/ce.json D i18n/cs.json D i18n/cu.json D i18n/de-formal.json D i18n/de.json D i18n/diq.json D i18n/en.json D i18n/eo.json D i18n/es.json D i18n/et.json D i18n/eu.json D i18n/fa.json D i18n/fi.json D i18n/fr.json D i18n/fy.json D i18n/gl.json D i18n/he.json D i18n/hsb.json D i18n/hu.json D i18n/ia.json D i18n/id.json D i18n/it.json D i18n/ja.json D i18n/ka.json D i18n/km.json D i18n/ko.json D i18n/krc.json D i18n/ksh.json D i18n/ku-latn.json D i18n/lb.json D i18n/lki.json D i18n/lzh.json D i18n/mk.json D i18n/ml.json D i18n/ms.json D i18n/nb.json D i18n/nds-nl.json D i18n/nl.json D i18n/oc.json D i18n/om.json D i18n/os.json D i18n/pfl.json D i18n/pl.json D i18n/pms.json D i18n/ps.json D i18n/pt-br.json D i18n/pt.json D i18n/qqq.json D i18n/ro.json D i18n/roa-tara.json D i18n/ru.json D i18n/saz.json D i18n/si.json D i18n/sq.json D i18n/sr-ec.json D i18n/sr-el.json D i18n/sv.json D i18n/ta.json D i18n/te.json D i18n/tl.json D i18n/tt-cyrl.json D i18n/ug-arab.json D i18n/uk.json D i18n/uz.json D i18n/zh-hans.json D i18n/zh-hant.json D js/Phalanx.js D maintenance/clearPhalanxCache.php D maintenance/rebuildPhalanxCache.php D schema.sql D templates/phalanx.tmpl.php 94 files changed, 2 insertions(+), 7,480 deletions(-) Approvals: SamanthaNguyen: Verified; Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/380587 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibdcd25dd424160536a4b597371c075e378676170 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Phalanx Gerrit-Branch: master Gerrit-Owner: MarcoAurelioGerrit-Reviewer: MarcoAurelio Gerrit-Reviewer: SamanthaNguyen Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Fix rendering of unknown errors
Catrope has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380683 ) Change subject: Fix rendering of unknown errors .. Fix rendering of unknown errors Unknown errors in the publishing process caused JS errors because this.showErrorUnknown() was called, but the method was named saveErrorUnknown. Rename it to "show" for consistency with the rest of the class. Also fix the name of the event in the doc comment. Change-Id: Idbb9f95b68defbc0f6b501aad3bb65f9b842c920 --- M modules/mw.cx.TargetArticle.js 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/83/380683/1 diff --git a/modules/mw.cx.TargetArticle.js b/modules/mw.cx.TargetArticle.js index 7d65135..b188f7a 100644 --- a/modules/mw.cx.TargetArticle.js +++ b/modules/mw.cx.TargetArticle.js @@ -277,9 +277,9 @@ * @method * @param {Object} editResult * @param {Object|null} data API response data - * @fires saveErrorUnknown + * @fires publishErrorUnknown */ -mw.cx.TargetArticle.prototype.saveErrorUnknown = function ( editResult, data ) { +mw.cx.TargetArticle.prototype.showErrorUnknown = function ( editResult, data ) { var errorMsg = ( editResult && editResult.info ) || ( data && data.error && data.error.info ), errorCode = ( editResult && editResult.code ) || ( data && data.error && data.error.code ), unknown = 'Unknown error'; -- To view, visit https://gerrit.wikimedia.org/r/380683 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idbb9f95b68defbc0f6b501aad3bb65f9b842c920 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Catrope___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Update CodeMirror library to 5.30.0
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380678 ) Change subject: Update CodeMirror library to 5.30.0 .. Update CodeMirror library to 5.30.0 Bug: T176685 Change-Id: I551b3b335be9b9ec05625482a14c32cc994f8df1 --- M resources/lib/codemirror/AUTHORS M resources/lib/codemirror/CHANGELOG.md M resources/lib/codemirror/README.md M resources/lib/codemirror/addon/edit/closebrackets.js M resources/lib/codemirror/addon/hint/show-hint.js M resources/lib/codemirror/addon/lint/css-lint.js M resources/lib/codemirror/addon/lint/lint.js M resources/lib/codemirror/addon/mode/simple.js M resources/lib/codemirror/addon/search/search.js M resources/lib/codemirror/addon/selection/mark-selection.js M resources/lib/codemirror/addon/tern/tern.js M resources/lib/codemirror/lib/codemirror.js M resources/lib/codemirror/mode/gfm/gfm.js M resources/lib/codemirror/mode/javascript/javascript.js M resources/lib/codemirror/mode/markdown/markdown.js M resources/lib/codemirror/mode/meta.js M resources/lib/codemirror/mode/ruby/ruby.js M resources/lib/codemirror/mode/soy/soy.js M resources/lib/codemirror/mode/sql/sql.js M resources/lib/codemirror/mode/vue/vue.js 20 files changed, 469 insertions(+), 239 deletions(-) Approvals: jenkins-bot: Verified Kaldari: Looks good to me, approved diff --git a/resources/lib/codemirror/AUTHORS b/resources/lib/codemirror/AUTHORS index 280dea2..1264357 100644 --- a/resources/lib/codemirror/AUTHORS +++ b/resources/lib/codemirror/AUTHORS @@ -68,6 +68,7 @@ Anton Kovalyov Apollo Zhu AQNOUCH Mohammed +Aram Shatakhtsyan areos Arnab Bose Arsène von Wyss @@ -155,6 +156,7 @@ Daniel KJ Daniel Neel Daniel Parnell +Daniel Thwaites Danila Malyutin Danny Yoo darealshinji @@ -213,7 +215,9 @@ Forbes Lindesay Ford_Lawnmower Forrest Oliphant +Franco Catena Frank Wiegand +Fredrik Borg Gabriel Gheorghian Gabriel Horner Gabriel Nahmias @@ -255,6 +259,7 @@ Hocdoc Hugues Malphettes Ian Beck +Ian Davies Ian Dickinson Ian Wehrman Ian Wetherbee @@ -376,6 +381,7 @@ LM lochel Lorenzo Stoakes +Louis Mauchet Luca Fabbri Luciano Longo Lu Fangjian @@ -660,6 +666,7 @@ wenli Wes Cossick Wesley Wiser +Weston Ruter Will Binns-Smith Will Dean William Jamieson diff --git a/resources/lib/codemirror/CHANGELOG.md b/resources/lib/codemirror/CHANGELOG.md index 6cc7ed7..ff7d6e2 100644 --- a/resources/lib/codemirror/CHANGELOG.md +++ b/resources/lib/codemirror/CHANGELOG.md @@ -1,3 +1,27 @@ +## 5.30.0 (2017-09-20) + +### Bug fixes + +Fixed a number of issues with drawing right-to-left selections and mouse selection in bidirectional text. + +[search addon](http://codemirror.net/demo/search/): Fix crash when restarting search after doing empty search. + +[mark-selection addon](http://cm/doc/manual.html#addon_mark-selection): Fix off-by-one bug. + +[tern addon](http://codemirror.net/demo/tern.html): Fix bad request made when editing at the bottom of a large document. + +[javascript mode](http://codemirror.net/mode/javascript/): Improve parsing in a number of corner cases. + +[markdown mode](http://codemirror.net/mode/markdown/): Fix crash when a sub-mode doesn't support indentation, allow uppercase X in task lists. + +[gfm mode](http://codemirror.net/mode/gfm/): Don't highlight SHA1 'hashes' without numbers to avoid false positives. + +[soy mode](http://codemirror.net/mode/soy/): Support injected data and `@param` in comments. + +### New features + +[simple mode addon](http://codemirror.net/demo/simplemode.html): Allow groups in regexps when `token` isn't an array. + ## 5.29.0 (2017-08-24) ### Bug fixes @@ -54,7 +78,7 @@ ### Bug fixes -Fix crash in the [simple mode](http://codemirror.net/demo/simplemode.html) addon. +Fix crash in the [simple mode](http://codemirror.net/demo/simplemode.html)< addon. ## 5.27.0 (2017-06-22) diff --git a/resources/lib/codemirror/README.md b/resources/lib/codemirror/README.md index 3328e3b..a3a351b 100644 --- a/resources/lib/codemirror/README.md +++ b/resources/lib/codemirror/README.md @@ -7,7 +7,8 @@ CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with over 100 language modes and various addons that implement more advanced -editing functionality. +editing functionality. Every language comes with fully-featured code +and syntax highlighting to help with reading and editing complex code. A rich programming API and a CSS theming system are available for customizing CodeMirror to fit your application, and extending it with diff --git a/resources/lib/codemirror/addon/edit/closebrackets.js b/resources/lib/codemirror/addon/edit/closebrackets.js index 01fdd96..36aec0d 100644 --- a/resources/lib/codemirror/addon/edit/closebrackets.js +++ b/resources/lib/codemirror/addon/edit/closebrackets.js @@ -23,6 +23,7 @@ cm.state.closeBrackets = null; } if
[MediaWiki-commits] [Gerrit] analytics/reportupdater-queries[master]: Add draft creation config and query
Nuria has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379441 ) Change subject: Add draft creation config and query .. Add draft creation config and query SQL query to count the number of page creations in the Draft (118) namespace on English Wikipedia, and updated configuration file. Bug: T176375 Change-Id: I22f3fcb2945596228b1b5e3c61bcf70d1d50dc50 --- M page-creation/config.yaml A page-creation/pagecreations_draft.sql 2 files changed, 14 insertions(+), 0 deletions(-) Approvals: Nuria: Verified; Looks good to me, approved diff --git a/page-creation/config.yaml b/page-creation/config.yaml index dc14b73..b3e268c 100644 --- a/page-creation/config.yaml +++ b/page-creation/config.yaml @@ -62,3 +62,10 @@ lag: 3600 # this can wait an hour explode_by: wiki_db: enwiki + +pagecreations_draft: +granularity: days +starts: 2017-07-21 +lag: 3600 # this can wait an hour +explode_by: +wiki_db: enwiki diff --git a/page-creation/pagecreations_draft.sql b/page-creation/pagecreations_draft.sql new file mode 100644 index 000..8367e3e --- /dev/null +++ b/page-creation/pagecreations_draft.sql @@ -0,0 +1,7 @@ +SELECT DATE('{from_timestamp}') AS date, +COUNT(*) AS {wiki_db} +FROM mediawiki_page_create_2 +WHERE `database`='{wiki_db}' +AND page_namespace = 118 +AND rev_timestamp >= STR_TO_DATE('{from_timestamp}', '%Y%m%d%H%i%s') +AND rev_timestamp < STR_TO_DATE('{to_timestamp}', '%Y%m%d%H%i%s') -- To view, visit https://gerrit.wikimedia.org/r/379441 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22f3fcb2945596228b1b5e3c61bcf70d1d50dc50 Gerrit-PatchSet: 1 Gerrit-Project: analytics/reportupdater-queries Gerrit-Branch: master Gerrit-Owner: NettromGerrit-Reviewer: Milimetric Gerrit-Reviewer: Nuria ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21022 - Parameterize variables in SQL query
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380682 ) Change subject: CRM-21022 - Parameterize variables in SQL query .. CRM-21022 - Parameterize variables in SQL query https://github.com/civicrm/civicrm-core/pull/11002 Change-Id: I80709653a756f88c52c5350f67467876cbb69350 --- M CRM/Report/Page/InstanceList.php 1 file changed, 14 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/82/380682/1 diff --git a/CRM/Report/Page/InstanceList.php b/CRM/Report/Page/InstanceList.php index fa4e74e..663baa8 100644 --- a/CRM/Report/Page/InstanceList.php +++ b/CRM/Report/Page/InstanceList.php @@ -85,8 +85,11 @@ public function info() { $report = ''; +$queryParams = array(); + if ($this->ovID) { - $report .= " AND v.id = {$this->ovID} "; + $report .= " AND v.id = %1 "; + $queryParams[1] = array($this->ovID, 'Integer'); } if ($this->compID) { @@ -95,7 +98,8 @@ $this->_compName = 'Contact'; } else { -$report .= " AND v.component_id = {$this->compID} "; +$report .= " AND v.component_id = %2 "; +$queryParams[2] = array($this->compID, 'Integer'); $cmpName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Component', $this->compID, 'name', 'id' ); @@ -106,10 +110,12 @@ } } elseif ($this->grouping) { - $report .= " AND v.grouping = '{$this->grouping}' "; + $report .= " AND v.grouping = %3 "; + $queryParams[3] = array($this->grouping, 'String'); } elseif ($this->myReports) { - $report .= " AND inst.owner_id = " . CRM_Core_Session::getLoggedInContactID(); + $report .= " AND inst.owner_id = %4 "; + $queryParams[4] = array(CRM_Core_Session::getLoggedInContactID(), 'Integer'); } $sql = " @@ -129,12 +135,11 @@ ON v.component_id = comp.id WHERE v.is_active = 1 {$report} -AND inst.domain_id = %1 - ORDER BY v.weight"; +AND inst.domain_id = %9 + ORDER BY v.weight ASC, inst.title ASC"; +$queryParams[9] = array(CRM_Core_Config::domainID(), 'Integer'); -$dao = CRM_Core_DAO::executeQuery($sql, array( - 1 => array(CRM_Core_Config::domainID(), 'Integer'), -)); +$dao = CRM_Core_DAO::executeQuery($sql, $queryParams); $config = CRM_Core_Config::singleton(); $rows = array(); -- To view, visit https://gerrit.wikimedia.org/r/380682 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I80709653a756f88c52c5350f67467876cbb69350 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-20906 Validate the extension key is of general standard
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380681 ) Change subject: CRM-20906 Validate the extension key is of general standard .. CRM-20906 Validate the extension key is of general standard https://github.com/civicrm/civicrm-core/pull/10994 (squashed, included upstream typo :-) Change-Id: I9e13847a4f5cabc4f6f3fcec5d813fef4468bb44 --- M CRM/Admin/Form/Extensions.php M CRM/Utils/Rule.php M CRM/Utils/Type.php 3 files changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/81/380681/1 diff --git a/CRM/Admin/Form/Extensions.php b/CRM/Admin/Form/Extensions.php index 2373bcb..7f273cb 100644 --- a/CRM/Admin/Form/Extensions.php +++ b/CRM/Admin/Form/Extensions.php @@ -45,7 +45,9 @@ $this->_key = CRM_Utils_Request::retrieve('key', 'String', $this, FALSE, 0 ); - +if (!CRM_Utils_Type::validate($this->_key, 'ExtensionKey')) { + throw new CRM_Core_Exception('Extension Key does not match expected standard'); +} $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1=browse'); $session->pushUserContext($url); diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 3baca20..93af34d 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -908,4 +908,15 @@ } } + /** + * @param string $key Extension Key to check + * @return bool + */ + public static function checkExtesnionKeyIsValid($key = NULL) { +if (!empty($key) && !preg_match('/^[0-9a-zA-Z._-]+$/', $key)) { + return FALSE; +} +return TRUE; + } + } diff --git a/CRM/Utils/Type.php b/CRM/Utils/Type.php index 43b920f..fbe1c93 100644 --- a/CRM/Utils/Type.php +++ b/CRM/Utils/Type.php @@ -466,6 +466,12 @@ } break; + case 'ExtensionKey': +if (CRM_Utils_Rule::checkExtesnionKeyIsValid($data)) { + return $data; +} +break; + default: CRM_Core_Error::fatal("Cannot recognize $type for $data"); break; -- To view, visit https://gerrit.wikimedia.org/r/380681 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e13847a4f5cabc4f6f3fcec5d813fef4468bb44 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21123 Ensure that the selectedChild on message templates...
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380679 ) Change subject: CRM-21123 Ensure that the selectedChild on message templates is one of allowed types .. CRM-21123 Ensure that the selectedChild on message templates is one of allowed types https://github.com/civicrm/civicrm-core/pull/10993 Change-Id: Idccadcd7571fa22706b4e039bdc0fec381b1cdfa --- M CRM/Admin/Page/MessageTemplates.php 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/79/380679/1 diff --git a/CRM/Admin/Page/MessageTemplates.php b/CRM/Admin/Page/MessageTemplates.php index d94ffc0..b9b99b4 100644 --- a/CRM/Admin/Page/MessageTemplates.php +++ b/CRM/Admin/Page/MessageTemplates.php @@ -199,9 +199,10 @@ CRM_Core_BAO_MessageTemplate::revert($id); } - -$this->assign('selectedChild', CRM_Utils_Request::retrieve('selectedChild', 'String', $this)); - +$selectedChild = CRM_Utils_Request::retrieve('selectedChild', 'String', $this); +if (in_array($selectedChild, array('user', 'workflow'))) { + $this->assign('selectedChild', $selectedChild); +} return parent::run($args, $pageArgs, $sort); } -- To view, visit https://gerrit.wikimedia.org/r/380679 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idccadcd7571fa22706b4e039bdc0fec381b1cdfa Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-20895 - Encode display of search criteria
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380680 ) Change subject: CRM-20895 - Encode display of search criteria .. CRM-20895 - Encode display of search criteria https://github.com/civicrm/civicrm-core/pull/11001 Change-Id: I056c53b6108841ec356819ba931598ed88d2ddfc --- M templates/CRM/common/displaySearchCriteria.tpl 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/80/380680/1 diff --git a/templates/CRM/common/displaySearchCriteria.tpl b/templates/CRM/common/displaySearchCriteria.tpl index a8f5065..2258bfd 100644 --- a/templates/CRM/common/displaySearchCriteria.tpl +++ b/templates/CRM/common/displaySearchCriteria.tpl @@ -31,7 +31,7 @@ {foreach from=$orClauses name=criteria item=item} -{$item} +{$item|escape} {if !$smarty.foreach.criteria.last} ...{ts}AND{/ts}... {/if} @@ -52,10 +52,10 @@ {else} {foreach from=$orClauses name=criteria item=item} -{$item} +{$item|escape} {if !$smarty.foreach.criteria.last} {if $operator} - ...{$operator}... + ...{$operator|escape}... {else} ...{ts}AND{/ts}... {/if} -- To view, visit https://gerrit.wikimedia.org/r/380680 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I056c53b6108841ec356819ba931598ed88d2ddfc Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Update CodeMirror library to 5.30.0
Pastakhov has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380678 ) Change subject: Update CodeMirror library to 5.30.0 .. Update CodeMirror library to 5.30.0 Bug: T176685 Change-Id: I551b3b335be9b9ec05625482a14c32cc994f8df1 --- M resources/lib/codemirror/AUTHORS M resources/lib/codemirror/CHANGELOG.md M resources/lib/codemirror/README.md M resources/lib/codemirror/addon/edit/closebrackets.js M resources/lib/codemirror/addon/hint/show-hint.js M resources/lib/codemirror/addon/lint/css-lint.js M resources/lib/codemirror/addon/lint/lint.js M resources/lib/codemirror/addon/mode/simple.js M resources/lib/codemirror/addon/search/search.js M resources/lib/codemirror/addon/selection/mark-selection.js M resources/lib/codemirror/addon/tern/tern.js M resources/lib/codemirror/lib/codemirror.js M resources/lib/codemirror/mode/gfm/gfm.js M resources/lib/codemirror/mode/javascript/javascript.js M resources/lib/codemirror/mode/markdown/markdown.js M resources/lib/codemirror/mode/meta.js M resources/lib/codemirror/mode/ruby/ruby.js M resources/lib/codemirror/mode/soy/soy.js M resources/lib/codemirror/mode/sql/sql.js M resources/lib/codemirror/mode/vue/vue.js 20 files changed, 469 insertions(+), 239 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeMirror refs/changes/78/380678/1 diff --git a/resources/lib/codemirror/AUTHORS b/resources/lib/codemirror/AUTHORS index 280dea2..1264357 100644 --- a/resources/lib/codemirror/AUTHORS +++ b/resources/lib/codemirror/AUTHORS @@ -68,6 +68,7 @@ Anton Kovalyov Apollo Zhu AQNOUCH Mohammed +Aram Shatakhtsyan areos Arnab Bose Arsène von Wyss @@ -155,6 +156,7 @@ Daniel KJ Daniel Neel Daniel Parnell +Daniel Thwaites Danila Malyutin Danny Yoo darealshinji @@ -213,7 +215,9 @@ Forbes Lindesay Ford_Lawnmower Forrest Oliphant +Franco Catena Frank Wiegand +Fredrik Borg Gabriel Gheorghian Gabriel Horner Gabriel Nahmias @@ -255,6 +259,7 @@ Hocdoc Hugues Malphettes Ian Beck +Ian Davies Ian Dickinson Ian Wehrman Ian Wetherbee @@ -376,6 +381,7 @@ LM lochel Lorenzo Stoakes +Louis Mauchet Luca Fabbri Luciano Longo Lu Fangjian @@ -660,6 +666,7 @@ wenli Wes Cossick Wesley Wiser +Weston Ruter Will Binns-Smith Will Dean William Jamieson diff --git a/resources/lib/codemirror/CHANGELOG.md b/resources/lib/codemirror/CHANGELOG.md index 6cc7ed7..ff7d6e2 100644 --- a/resources/lib/codemirror/CHANGELOG.md +++ b/resources/lib/codemirror/CHANGELOG.md @@ -1,3 +1,27 @@ +## 5.30.0 (2017-09-20) + +### Bug fixes + +Fixed a number of issues with drawing right-to-left selections and mouse selection in bidirectional text. + +[search addon](http://codemirror.net/demo/search/): Fix crash when restarting search after doing empty search. + +[mark-selection addon](http://cm/doc/manual.html#addon_mark-selection): Fix off-by-one bug. + +[tern addon](http://codemirror.net/demo/tern.html): Fix bad request made when editing at the bottom of a large document. + +[javascript mode](http://codemirror.net/mode/javascript/): Improve parsing in a number of corner cases. + +[markdown mode](http://codemirror.net/mode/markdown/): Fix crash when a sub-mode doesn't support indentation, allow uppercase X in task lists. + +[gfm mode](http://codemirror.net/mode/gfm/): Don't highlight SHA1 'hashes' without numbers to avoid false positives. + +[soy mode](http://codemirror.net/mode/soy/): Support injected data and `@param` in comments. + +### New features + +[simple mode addon](http://codemirror.net/demo/simplemode.html): Allow groups in regexps when `token` isn't an array. + ## 5.29.0 (2017-08-24) ### Bug fixes @@ -54,7 +78,7 @@ ### Bug fixes -Fix crash in the [simple mode](http://codemirror.net/demo/simplemode.html) addon. +Fix crash in the [simple mode](http://codemirror.net/demo/simplemode.html)< addon. ## 5.27.0 (2017-06-22) diff --git a/resources/lib/codemirror/README.md b/resources/lib/codemirror/README.md index 3328e3b..a3a351b 100644 --- a/resources/lib/codemirror/README.md +++ b/resources/lib/codemirror/README.md @@ -7,7 +7,8 @@ CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with over 100 language modes and various addons that implement more advanced -editing functionality. +editing functionality. Every language comes with fully-featured code +and syntax highlighting to help with reading and editing complex code. A rich programming API and a CSS theming system are available for customizing CodeMirror to fit your application, and extending it with diff --git a/resources/lib/codemirror/addon/edit/closebrackets.js b/resources/lib/codemirror/addon/edit/closebrackets.js index 01fdd96..36aec0d 100644 --- a/resources/lib/codemirror/addon/edit/closebrackets.js +++ b/resources/lib/codemirror/addon/edit/closebrackets.js @@ -23,6 +23,7 @@ cm.state.closeBrackets = null;
[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-20907 Ensure that contact_type is valid in deduperules
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380677 ) Change subject: CRM-20907 Ensure that contact_type is valid in deduperules .. CRM-20907 Ensure that contact_type is valid in deduperules https://github.com/civicrm/civicrm-core/pull/10992 (squashed 2 into 1) Change-Id: Ife2c109c58241ede6b17de61cf13aaf7770bfd27 --- M CRM/Contact/Form/DedupeRules.php 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/77/380677/1 diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php index 82e2faf..59715a9 100644 --- a/CRM/Contact/Form/DedupeRules.php +++ b/CRM/Contact/Form/DedupeRules.php @@ -58,7 +58,14 @@ } $this->_options = CRM_Core_SelectValues::getDedupeRuleTypes(); $this->_rgid = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0); -$this->_contactType = CRM_Utils_Request::retrieve('contact_type', 'String', $this, FALSE, 0); +$contactTypes = civicrm_api3('Contact', 'getOptions', array('field' => "contact_type")); +$contactType = CRM_Utils_Request::retrieve('contact_type', 'String', $this, FALSE, 0); +if (in_array($contactType, $contactTypes['values'])) { + $this->_contactType = $contactTypes['values'][$contactType]; +} +elseif (!empty($contactType)) { + throw new CRM_Core_Exception('Contact Type is Not valid'); +} if ($this->_rgid) { $rgDao = new CRM_Dedupe_DAO_RuleGroup(); $rgDao->id = $this->_rgid; -- To view, visit https://gerrit.wikimedia.org/r/380677 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife2c109c58241ede6b17de61cf13aaf7770bfd27 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21014 Ensure that preimum name is EOU
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380676 ) Change subject: CRM-21014 Ensure that preimum name is EOU .. CRM-21014 Ensure that preimum name is EOU https://github.com/civicrm/civicrm-core/pull/10989 (have done these slightly out of order to changes to Premium Block already resolved in in earlier version Change-Id: I26d989282e73f4a2ee9814bb27794f4c29f906aa --- M templates/CRM/Contribute/Page/Premium.tpl 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/76/380676/1 diff --git a/templates/CRM/Contribute/Page/Premium.tpl b/templates/CRM/Contribute/Page/Premium.tpl index ce44089..7f0037b 100644 --- a/templates/CRM/Contribute/Page/Premium.tpl +++ b/templates/CRM/Contribute/Page/Premium.tpl @@ -37,13 +37,13 @@ {ts}SKU{/ts} {ts}Market Value{/ts} {ts}Min Contribution{/ts} - {ts}Financial Type{/ts} +{ts}Financial Type{/ts} {ts}Order{/ts} {foreach from=$rows item=row} - {$row.product_name} + {$row.product_name|escape:'html'} {$row.sku} {$row.price } {$row.min_contribution} -- To view, visit https://gerrit.wikimedia.org/r/380676 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I26d989282e73f4a2ee9814bb27794f4c29f906aa Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: abbreviate configuration as "config"
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380675 ) Change subject: Chore: abbreviate configuration as "config" .. Chore: abbreviate configuration as "config" Change-Id: Ic93de118aaff7ba76d4818c5b78a8d9a4b51204a --- M docs/development.md M src/common/pages/about.tsx M src/common/routers/route.ts R src/server/config.ts M src/server/index.tsx M webpack.config.ts 6 files changed, 26 insertions(+), 30 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/75/380675/1 diff --git a/docs/development.md b/docs/development.md index d7e34ef..f5aa109 100644 --- a/docs/development.md +++ b/docs/development.md @@ -129,6 +129,7 @@ Marvin uses the following abbreviations: +- Configuration => config - Parameters => params - Properties => props - Utilities => utils @@ -151,7 +152,7 @@ ## Environment variables -See [configuration](../src/server/configuration.ts). +See [configuration](../src/server/config.ts). ## Continuous integration diff --git a/src/common/pages/about.tsx b/src/common/pages/about.tsx index af73f3f..51efa42 100644 --- a/src/common/pages/about.tsx +++ b/src/common/pages/about.tsx @@ -20,9 +20,9 @@ componentDidMount() { // todo: figure out a common way across entry points for defining // configuration variables that common code could consume. The server has -// server specific vars in configuration.ts and this here for example are -// used only on DOM capable envs (componentDidMount will only fire on DOM -// capable environments). It would be ideal if we had a common place with +// server specific vars in config.ts and this here for example are used only +// on DOM capable envs (componentDidMount will only fire on DOM capable +// environments). It would be ideal if we had a common place with // configuration for common code. We need to also take into account UglifyJS // and the dead code elimination when using DefinePlugin, so that we can // leverage it to remove dev-only code in production builds diff --git a/src/common/routers/route.ts b/src/common/routers/route.ts index d05786d..fdfe631 100644 --- a/src/common/routers/route.ts +++ b/src/common/routers/route.ts @@ -23,10 +23,7 @@ requestProps?: (params: Params) => Promise; } -export interface RouteConfiguration< - Params extends RouteParams = {}, - Props = void -> { +export interface RouteConfig { path: string; importModule: () => Promise>; chunkName: string; @@ -34,7 +31,7 @@ } export interface Route - extends RouteConfiguration { + extends RouteConfig { status: number; /** Generates a URL from parameters. */ @@ -48,7 +45,7 @@ importModule, chunkName, status = 200 -}: RouteConfiguration ): Route => ({ +}: RouteConfig ): Route => ({ path, importModule, chunkName, diff --git a/src/server/configuration.ts b/src/server/config.ts similarity index 100% rename from src/server/configuration.ts rename to src/server/config.ts diff --git a/src/server/index.tsx b/src/server/index.tsx index cebf7ed..cc1551b 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -23,7 +23,7 @@ SERVER_PORT, SERVER_URL, WEBPACK_DEV_SERVER_URL -} from "./configuration"; +} from "./config"; import HTMLPage from "./components/html-page"; // The asset manifest built or the webpack-dev-server URL (which has no diff --git a/webpack.config.ts b/webpack.config.ts index c965af2..8fafd79 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -7,7 +7,7 @@ VERBOSE, WEBPACK_DEV_SERVER_PORT, WEBPACK_DEV_SERVER_URL -} from "./src/server/configuration"; +} from "./src/server/config"; const pkg = require("./package.json"); @@ -37,7 +37,7 @@ const PREACT = PRODUCTION ? "preact" : "preact/debug"; -const configuration: webpack.Configuration = { +const config: webpack.Configuration = { // Bundled outputs and their source inputs. For each entry, the source input // and any dependencies are compiled together into one chunk file output // except where split by the CommonsChunkPlugin. @@ -77,7 +77,7 @@ output: { // The filesystem base destination directory for the client entry point // chunk files given as an absolute path. All outputs specified in -// `configuration.entry` will be generated here. +// `config.entry` will be generated here. path: PATHS.public.output, // The base web request path for chunk files to appear in the asset @@ -87,7 +87,7 @@ // server. publicPath: PRODUCTION ? "/public/" : `${WEBPACK_DEV_SERVER_URL}/public/`, -// `configuration.entry` chunk filenames. e.g.: +// `config.entry` chunk filenames. e.g.: // // { // ... @@ -98,10 +98,9 @@ // ... // } // -// The property names
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: restructure Router.ParsedRoute construction
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380674 ) Change subject: Chore: restructure Router.ParsedRoute construction .. Chore: restructure Router.ParsedRoute construction Focus on the unit instead of the whole by refactoring parseRoutes() to parseRoute(). Change-Id: I0f42bb1fd47bdda2a8e87047a2d35224802d5b2b --- M src/common/routers/router.ts 1 file changed, 9 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/74/380674/1 diff --git a/src/common/routers/router.ts b/src/common/routers/router.ts index 308e1de..5d07135 100644 --- a/src/common/routers/router.ts +++ b/src/common/routers/router.ts @@ -18,15 +18,14 @@ regularExpression: RegExp; } -const parseRoutes = (routes: AnyRoute[]) => - routes.map((route: AnyRoute): ParsedRoute => { -const paramNames: pathToRegExp.Key[] = []; -return { - ...route, - paramNames, - regularExpression: pathToRegExp(route.path, paramNames) -}; - }); +const parseRoute = (route: AnyRoute): ParsedRoute => { + const paramNames: pathToRegExp.Key[] = []; + return { +...route, +paramNames, +regularExpression: pathToRegExp(route.path, paramNames) + }; +}; // This method is tightly coupled with Route.path and the parameters supplied to // PageModule.requestProps. Route.path must use names that match the typing for @@ -69,7 +68,7 @@ } export const newRouter = (routes: AnyRoute[]): Router => { - const parsedRoutes: ParsedRoute[] = parseRoutes(routes); + const parsedRoutes: ParsedRoute[] = routes.map(route => parseRoute(route)); return { route(url) { -- To view, visit https://gerrit.wikimedia.org/r/380674 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0f42bb1fd47bdda2a8e87047a2d35224802d5b2b Gerrit-PatchSet: 1 Gerrit-Project: marvin Gerrit-Branch: master Gerrit-Owner: NiedzielskiGerrit-Reviewer: Sniedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Add number of languages to message group stats table
Omidfi has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380673 ) Change subject: Add number of languages to message group stats table .. Add number of languages to message group stats table State directly how many languages are shown in the total row of group stats table. Bug: T129835 Change-Id: I1c9b4e7ed2f7baa8a3a0539dd131e6851269f7ca --- M i18n/core/en.json M i18n/core/qqq.json M specials/SpecialMessageGroupStats.php 3 files changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/73/380673/1 diff --git a/i18n/core/en.json b/i18n/core/en.json index 3dae9de..1068fcb 100644 --- a/i18n/core/en.json +++ b/i18n/core/en.json @@ -186,7 +186,7 @@ "translate-mgs-noempty": "Do not display languages which do not have any translations", "translate-mgs-submit": "Show statistics", "translate-mgs-column-language": "Language", - "translate-mgs-totals": "All languages together", + "translate-mgs-totals": "All $1 languages together", "translate-mgs-invalid-group": "The specified group $1 does not exist.", "translate-mgs-nothing": "Nothing to show for requested statistics.", "supportedlanguages": "Supported languages", diff --git a/i18n/core/qqq.json b/i18n/core/qqq.json index 4f48156..9358dbf 100644 --- a/i18n/core/qqq.json +++ b/i18n/core/qqq.json @@ -218,7 +218,7 @@ "translate-mgs-noempty": "Option in [[Special:MessageGroupStats]]", "translate-mgs-submit": "Submit button text", "translate-mgs-column-language": "{{Identical|Language}}", - "translate-mgs-totals": "This is used in [[Special:MessageGroupStats]]", + "translate-mgs-totals": "This is used in [[Special:MessageGroupStats]]. Parameters: \n* $1 - total number of shown languages", "translate-mgs-invalid-group": "Used as error message. Parameters:\n* $1 - target message group name", "translate-mgs-nothing": "Error message shown on Special:LanguageStats and Special:MessageGroupStats.", "supportedlanguages": "{{doc-special|SupportedLanguages}}\n{{Identical|Supported language}}", diff --git a/specials/SpecialMessageGroupStats.php b/specials/SpecialMessageGroupStats.php index 2ae2123..7e567f4 100644 --- a/specials/SpecialMessageGroupStats.php +++ b/specials/SpecialMessageGroupStats.php @@ -143,7 +143,7 @@ } /** -* Overwriten from SpecialLanguageStats +* Overwritten from SpecialLanguageStats * * @return string */ @@ -160,6 +160,7 @@ MessageGroupStats::setTimeLimit( $this->timelimit ); $cache = MessageGroupStats::forGroup( $this->target ); +$this->numberOfShownLanguages = 0; $languages = array_keys( TranslateUtils::getLanguageNames( $this->getLanguage()->getCode() ) ); @@ -178,7 +179,7 @@ $out .= Html::closeElement( 'tbody' ); $out .= Html::openElement( 'tfoot' ); - $out .= $table->makeTotalRow( $this->msg( 'translate-mgs-totals' ), $this->totals ); + $out .= $table->makeTotalRow( $this->msg( 'translate-mgs-totals' , $this->numberOfShownLanguages), $this->totals ); $out .= Html::closeElement( 'tfoot' ); $out .= Html::closeElement( 'table' ); @@ -251,7 +252,7 @@ $extra = []; } } - +$this->numberOfShownLanguages += 1; $this->totals = MessageGroupStats::multiAdd( $this->totals, $stats ); $out = "\t" . Html::openElement( 'tr' ); -- To view, visit https://gerrit.wikimedia.org/r/380673 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c9b4e7ed2f7baa8a3a0539dd131e6851269f7ca Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Omidfi___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21059 Upgrade Smarty to 2.6.30
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380672 ) Change subject: CRM-21059 Upgrade Smarty to 2.6.30 .. CRM-21059 Upgrade Smarty to 2.6.30 https://github.com/civicrm/civicrm-packages/pull/194 Change-Id: I040d342061aa0886741d6133b448cd02fdd937b8 --- M packages/Smarty/Config_File.class.php M packages/Smarty/Smarty.class.php M packages/Smarty/Smarty_Compiler.class.php M packages/Smarty/internals/core.assemble_plugin_filepath.php M packages/Smarty/plugins/function.math.php 5 files changed, 86 insertions(+), 62 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/72/380672/1 diff --git a/packages/Smarty/Config_File.class.php b/packages/Smarty/Config_File.class.php index 5f2913b..491fa84 100644 --- a/packages/Smarty/Config_File.class.php +++ b/packages/Smarty/Config_File.class.php @@ -19,7 +19,7 @@ * * For questions, help, comments, discussion, etc., please join the * Smarty mailing list. Send a blank e-mail to - * smarty-discussion-subscr...@googlegroups.com + * smarty-discussion-subscr...@googlegroups.com * * @link http://www.smarty.net/ * @version 2.6.25-dev @@ -29,7 +29,7 @@ * @package Smarty */ -/* $Id: Config_File.class.php 3149 2009-05-23 20:59:25Z monte.ohrt $ */ +/* $Id$ */ /** * Config file reading class @@ -73,7 +73,7 @@ * * @param string $config_path (optional) path to the config files */ -function __construct($config_path = NULL) +public function __construct($config_path = NULL) { if (isset($config_path)) $this->set_path($config_path); @@ -301,7 +301,7 @@ $vars = array(); continue; } -} else { +} else { $section_name = $match[1]; } if (!isset($config_data['sections'][$section_name])) diff --git a/packages/Smarty/Smarty.class.php b/packages/Smarty/Smarty.class.php index 7118c55..8890c45 100644 --- a/packages/Smarty/Smarty.class.php +++ b/packages/Smarty/Smarty.class.php @@ -27,10 +27,10 @@ * @author Monte Ohrt * @author Andrei Zmievski* @package Smarty - * @version 2.6.27 + * @version 2.6.30 */ -/* $Id: Smarty.class.php 4660 2012-09-24 20:05:15Z uwe.t...@googlemail.com $ */ +/* $Id$ */ /** * DIR_SEP isn't used anymore, but third party apps might @@ -465,7 +465,7 @@ * * @var string */ -var $_version = '2.6.27'; +var $_version = '2.6.30'; /** * current template inclusion depth @@ -562,11 +562,17 @@ */ var $_cache_including = false; +/** + * plugin filepath cache + * + * @var array + */ +var $_filepaths_cache = array(); /**#@-*/ /** * The class constructor. */ -function __construct() +public function __construct() { $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); @@ -1511,10 +1517,8 @@ */ function _get_compile_path($resource_name) { -$compilePath = $this->_get_auto_filename( $this->compile_dir, - $resource_name, - $this->_compile_id ); -$compilePath .= '.php'; +$compilePath = $this->_get_auto_filename($this->compile_dir, $resource_name, + $this->_compile_id) . '.php'; //for 'string:' resource smarty might going to fail to create //compile file, so make sure we should have valid path, CRM-5890 @@ -1542,9 +1546,9 @@ smarty_core_create_dir_structure( array('dir' => $dirname ), $this ); } -$isValid = false; +$isValid = FALSE; if ( $fd = @fopen( $compilePath, 'wb') ) { -$isValid = true; +$isValid = TRUE; @fclose( $fd ); @unlink($compilePath); } diff --git a/packages/Smarty/Smarty_Compiler.class.php b/packages/Smarty/Smarty_Compiler.class.php index fa4e782..8eaf758 100644 --- a/packages/Smarty/Smarty_Compiler.class.php +++ b/packages/Smarty/Smarty_Compiler.class.php @@ -26,7 +26,7 @@ * @package Smarty */ -/* $Id: Smarty_Compiler.class.php 3163 2009-06-17 14:39:24Z monte.ohrt $ */ +/* $Id$ */ /** * Template compiling class @@ -78,7 +78,7 @@ /** * The class constructor. */ -function __construct() +public function __construct() { // matches double quoted strings: // "foobar" diff --git a/packages/Smarty/internals/core.assemble_plugin_filepath.php b/packages/Smarty/internals/core.assemble_plugin_filepath.php index 690d3dd..22c0248 100644 ---
[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21006 Ensure that Buttons are correctly displayed
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380670 ) Change subject: CRM-21006 Ensure that Buttons are correctly displayed .. CRM-21006 Ensure that Buttons are correctly displayed https://github.com/civicrm/civicrm-core/pull/10990 Change-Id: If03b9ffb54fa1e56e056d9858adc64195276f475 --- M templates/CRM/Contribute/Form/Contribution/ThankYou.tpl M templates/CRM/Event/Form/Registration/ThankYou.tpl M templates/CRM/Event/Page/EventInfo.tpl M templates/CRM/Event/Page/ManageEvent.tpl M templates/CRM/PCP/Page/PCPInfo.tpl 5 files changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/70/380670/1 diff --git a/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl b/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl index a79b990..04c48c5 100644 --- a/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl +++ b/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl @@ -39,13 +39,13 @@ {* Show link to Tell a Friend (CRM-2153) *} {if $friendText} - {$friendText} + {$friendText} {if !$linkText}{/if} {/if} {* Add button for donor to create their own Personal Campaign page *} {if $linkText} - {$linkText} + {$linkText} {/if} diff --git a/templates/CRM/Event/Form/Registration/ThankYou.tpl b/templates/CRM/Event/Form/Registration/ThankYou.tpl index db1cfd3..9d0d70f 100644 --- a/templates/CRM/Event/Form/Registration/ThankYou.tpl +++ b/templates/CRM/Event/Form/Registration/ThankYou.tpl @@ -42,14 +42,14 @@ {* Show link to Tell a Friend (CRM-2153) *} {if $friendText} - {$friendText} + {$friendText} {/if} {* Add button for donor to create their own Personal Campaign page *} {if $pcpLink} - {$pcpLinkText} + {$pcpLinkText} {/if} diff --git a/templates/CRM/Event/Page/EventInfo.tpl b/templates/CRM/Event/Page/EventInfo.tpl index fbc3a43..d19625c 100644 --- a/templates/CRM/Event/Page/EventInfo.tpl +++ b/templates/CRM/Event/Page/EventInfo.tpl @@ -96,7 +96,7 @@ {crmRegion name="event-page-eventinfo-actionlinks-top"} {if $allowRegistration} -{$registerText} +{$registerText} {/if} {/crmRegion} @@ -227,7 +227,7 @@ {crmRegion name="event-page-eventinfo-actionlinks-bottom"} {if $allowRegistration} -{$registerText} +{$registerText} {/if} {/crmRegion} diff --git a/templates/CRM/Event/Page/ManageEvent.tpl b/templates/CRM/Event/Page/ManageEvent.tpl index dafc1ae..eb12957 100644 --- a/templates/CRM/Event/Page/ManageEvent.tpl +++ b/templates/CRM/Event/Page/ManageEvent.tpl @@ -98,10 +98,10 @@ {assign var="fld" value=$v.field} {if NOT $row.$fld}{assign var="status" value="disabled"}{else}{assign var="status" value="enabled"}{/if} {if $k eq 'reminder'} -{$v.title} {else} -{$v.title} {/if} {/foreach} diff --git a/templates/CRM/PCP/Page/PCPInfo.tpl b/templates/CRM/PCP/Page/PCPInfo.tpl index 8cb3f78..bb82ef1 100644 --- a/templates/CRM/PCP/Page/PCPInfo.tpl +++ b/templates/CRM/PCP/Page/PCPInfo.tpl @@ -41,7 +41,7 @@ {foreach from = $links key = k item = v} - {$v.name} + {$v.name} {$hints.$k} -- To view, visit https://gerrit.wikimedia.org/r/380670 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If03b9ffb54fa1e56e056d9858adc64195276f475 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21006 - Escape all title and alt attributes
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380671 ) Change subject: CRM-21006 - Escape all title and alt attributes .. CRM-21006 - Escape all title and alt attributes https://github.com/civicrm/civicrm-core/pull/10990 This commit opportunistically adds HTML output encoding to all Smarty variables any time they appear within an HTML `title` or `alt` attribute. Why? Because this helps us prevent XSS and is very very unlikely to cause any unwanted side effects. Code locations found by searching the `templates` directory for: (title|alt)=(['"])((?!\2).)*\{\$((?!(\|(escape|crmDate))|\}).)+\}((?!\2).)*\2 Change-Id: Icffa15ceb585343023a3509f280387d138653e61 --- M templates/CRM/Activity/Form/ActivityLinks.tpl M templates/CRM/Admin/Page/Admin.tpl M templates/CRM/Admin/Page/ConfigTaskList.tpl M templates/CRM/Contact/Form/Edit/Tagtree.tpl M templates/CRM/Contact/Page/Inline/Actions.tpl M templates/CRM/Contact/Page/View/Summary.tpl M templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl M templates/CRM/Dashlet/Page/Blog.tpl M templates/CRM/Event/Page/DashBoard.tpl M templates/CRM/Friend/Form.tpl M templates/CRM/Report/Form/Contact/Detail.tpl M templates/CRM/Report/Form/Fields.tpl M templates/CRM/Report/Form/Layout/Overlay.tpl M templates/CRM/Report/Page/InstanceList.tpl M templates/CRM/Tag/Form/Tagtree.tpl M templates/CRM/common/TabHeader.tpl 16 files changed, 39 insertions(+), 39 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/71/380671/1 diff --git a/templates/CRM/Activity/Form/ActivityLinks.tpl b/templates/CRM/Activity/Form/ActivityLinks.tpl index d1f2359..a3b2332 100644 --- a/templates/CRM/Activity/Form/ActivityLinks.tpl +++ b/templates/CRM/Activity/Form/ActivityLinks.tpl @@ -68,10 +68,10 @@ {if $hookLinks} {foreach from=$hookLinks item=link} - {if $link.img} - + {/if} {$link.name} diff --git a/templates/CRM/Admin/Page/Admin.tpl b/templates/CRM/Admin/Page/Admin.tpl index 7144059..0a00fa7 100644 --- a/templates/CRM/Admin/Page/Admin.tpl +++ b/templates/CRM/Admin/Page/Admin.tpl @@ -72,7 +72,7 @@ {foreach from=$group.fields item=panelItem key=panelName name=groupLoop} - + {$panelItem.title} diff --git a/templates/CRM/Admin/Page/ConfigTaskList.tpl b/templates/CRM/Admin/Page/ConfigTaskList.tpl index 752eb04..0c66542 100644 --- a/templates/CRM/Admin/Page/ConfigTaskList.tpl +++ b/templates/CRM/Admin/Page/ConfigTaskList.tpl @@ -35,15 +35,15 @@ {ts}Site Configuration and Registration{/ts} -{ts}Localization{/ts} +{ts}Localization{/ts} {ts}Localization settings include user language, default currency and available countries for address input.{/ts} -{ts}Organization Address and Contact Info{/ts} +{ts}Organization Address and Contact Info{/ts} {ts}Organization name, email address for system-generated emails, organization address{/ts} -{ts}Enable components{/ts} +{ts}Enable components{/ts} {ts}Enable the required CiviCRM components.(CiviContribute, CiviEvent etc.){/ts} @@ -55,27 +55,27 @@ {ts}Viewing and Editing Contacts{/ts} -{ts}Display Preferences{/ts} +{ts}Display Preferences{/ts} {ts}Configure screen and form elements for Viewing Contacts, Editing Contacts, Advanced Search, Contact Dashboard and WYSIWYG Editor.{/ts} -{ts}Address Settings{/ts} +{ts}Address Settings{/ts} {ts}Format addresses in mailing labels, input forms and screen display.{/ts} -{ts}Mapping and Geocoding{/ts} +{ts}Mapping and Geocoding{/ts} {ts}Configure a mapping provider (e.g. Google or Yahoo) to display maps for contact addresses and event locations.{/ts} -{ts}Search Settings{/ts} +{ts}Search Settings{/ts} {ts}Adjust search behaviors including wildcards, and data to include in quick search results. Adjusting search settings can improve performance for larger datasets.{/ts} -{ts}Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.){/ts} +{ts}Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.){/ts} {ts}Version reporting and alerts, reCAPTCHA configuration and attachments.{/ts} -{ts}Contact Types{/ts} +{ts}Contact Types{/ts} {ts}You can modify the names of the built-in contact types (Individual, Household, Organizations), and you can create or modify "contact subtypes" for more specific uses (e.g. Student, Parent, Team, etc.).{/ts} @@ -83,11 +83,11 @@
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Cache ChangesListSpecialPage::buildChangeTagList()
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380578 ) Change subject: RCFilters: Cache ChangesListSpecialPage::buildChangeTagList() .. RCFilters: Cache ChangesListSpecialPage::buildChangeTagList() Calling Message::parse() on 2 messages per tag (for 80+ tags) is fairly expensive. It takes about 400ms in production, but adding that to requests that normally take 150-400ms is a pretty big hit. Bug: T176652 Change-Id: I9114f69de8b18007735de3438809f5695e380738 --- M includes/specialpage/ChangesListSpecialPage.php 1 file changed, 49 insertions(+), 38 deletions(-) Approvals: Krinkle: Looks good to me, but someone else must approve Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index d7519d3..dc08dab 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -619,7 +619,7 @@ $out->addJsConfigVars( 'wgRCFiltersChangeTags', - $this->buildChangeTagList() + $this->getChangeTagList() ); $out->addJsConfigVars( 'StructuredChangeFiltersDisplayConfig', @@ -661,49 +661,60 @@ * * @return Array Tag data */ - protected function buildChangeTagList() { - $explicitlyDefinedTags = array_fill_keys( ChangeTags::listExplicitlyDefinedTags(), 0 ); - $softwareActivatedTags = array_fill_keys( ChangeTags::listSoftwareActivatedTags(), 0 ); + protected function getChangeTagList() { + $cache = ObjectCache::getMainWANInstance(); + $context = $this->getContext(); + return $cache->getWithSetCallback( + $cache->makeKey( 'changeslistspecialpage-changetags', $context->getLanguage()->getCode() ), + $cache::TTL_MINUTE * 10, + function () use ( $context ) { + $explicitlyDefinedTags = array_fill_keys( ChangeTags::listExplicitlyDefinedTags(), 0 ); + $softwareActivatedTags = array_fill_keys( ChangeTags::listSoftwareActivatedTags(), 0 ); - // Hit counts disabled for perf reasons, see T169997 - /* - $tagStats = ChangeTags::tagUsageStatistics(); - $tagHitCounts = array_merge( $explicitlyDefinedTags, $softwareActivatedTags, $tagStats ); + // Hit counts disabled for perf reasons, see T169997 + /* + $tagStats = ChangeTags::tagUsageStatistics(); + $tagHitCounts = array_merge( $explicitlyDefinedTags, $softwareActivatedTags, $tagStats ); - // Sort by hits - arsort( $tagHitCounts ); - */ - $tagHitCounts = array_merge( $explicitlyDefinedTags, $softwareActivatedTags ); + // Sort by hits + arsort( $tagHitCounts ); + */ + $tagHitCounts = array_merge( $explicitlyDefinedTags, $softwareActivatedTags ); - // Build the list and data - $result = []; - foreach ( $tagHitCounts as $tagName => $hits ) { - if ( - // Only get active tags - isset( $explicitlyDefinedTags[ $tagName ] ) || - isset( $softwareActivatedTags[ $tagName ] ) - ) { - // Parse description - $desc = ChangeTags::tagLongDescriptionMessage( $tagName, $this->getContext() ); + // Build the list and data + $result = []; + foreach ( $tagHitCounts as $tagName => $hits ) { + if ( + // Only get active tags + isset( $explicitlyDefinedTags[ $tagName ] ) || + isset( $softwareActivatedTags[ $tagName ] ) + ) { + // Parse description + $desc = ChangeTags::tagLongDescriptionMessage( $tagName, $context ); - $result[] = [ - 'name' => $tagName, - 'label' => Sanitizer::stripAllTags( -
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Fix test to meet php standard.
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380668 ) Change subject: Fix test to meet php standard. .. Fix test to meet php standard. Fixes 'Strict standards: Declaration of BaseWmfDrupalPhpUnitTestCase::onNotSuccessfulTest() should be compatible with PHPUnit_Framework_TestCase::onNotSuccessfulTest(Exception ) ' Change-Id: I498548a1505bce73a794ebe90063cec8a91a2a11 --- M sites/all/modules/wmf_common/tests/includes/BaseWmfDrupalPhpUnitTestCase.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/68/380668/1 diff --git a/sites/all/modules/wmf_common/tests/includes/BaseWmfDrupalPhpUnitTestCase.php b/sites/all/modules/wmf_common/tests/includes/BaseWmfDrupalPhpUnitTestCase.php index 09a9a38..3d0b0c1 100644 --- a/sites/all/modules/wmf_common/tests/includes/BaseWmfDrupalPhpUnitTestCase.php +++ b/sites/all/modules/wmf_common/tests/includes/BaseWmfDrupalPhpUnitTestCase.php @@ -197,7 +197,7 @@ ) ); } - public function onNotSuccessfulTest( $e ) { + public function onNotSuccessfulTest(Exception $e ) { if ( !PRINT_WATCHDOG_ON_TEST_FAIL ) { return; } -- To view, visit https://gerrit.wikimedia.org/r/380668 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I498548a1505bce73a794ebe90063cec8a91a2a11 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Fix scroll jump when adding new section
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379248 ) Change subject: Fix scroll jump when adding new section .. Fix scroll jump when adding new section Change-Id: I174e2b020dbbf5a0eb322a37326ceaf033eb5398 --- M modules/ui/mw.cx.ui.TranslationView.js 1 file changed, 9 insertions(+), 5 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ui/mw.cx.ui.TranslationView.js b/modules/ui/mw.cx.ui.TranslationView.js index 628f828..a6fb738 100644 --- a/modules/ui/mw.cx.ui.TranslationView.js +++ b/modules/ui/mw.cx.ui.TranslationView.js @@ -354,27 +354,31 @@ mw.cx.ui.TranslationView.prototype.gotPlaceholderTranslation = function ( placeholder, data ) { var pasteDoc, newCursorRange, docLen, fragmentRange, - modelSurface = this.getSurface().getModel(), + surfaceModel = this.getSurface().getModel(), cxid = placeholder.getModel().getAttribute( 'cxid' ), - fragment = modelSurface.getLinearFragment( placeholder.getModel().getOuterRange() ); + fragment = surfaceModel.getLinearFragment( placeholder.getModel().getOuterRange(), true /* noAutoSelect */ ); pasteDoc = ve.dm.converter.getModelFromDom( ve.createDocumentFromHtml( data ) ); docLen = pasteDoc.getInternalList().getListNode().getOuterRange().start; fragment.insertContent( [ { type: 'cxSection', attributes: { style: 'section', cxid: cxid } }, + // Put a temporary paragraph inside the section so the cursor has somewhere + // sensible to go, preventing scrollCursorIntoView from triggering a jump + { type: 'paragraph' }, + { type: '/paragraph' }, { type: '/cxSection' } ] ); fragment - .collapseToStart().adjustLinearSelection( 1, 1 ) + .collapseToStart().adjustLinearSelection( 1, 3 ) .insertDocument( pasteDoc, new ve.Range( 1, docLen - 1 ) ); fragmentRange = fragment.getSelection().getCoveringRange(); // Select first content offset within new content - newCursorRange = new ve.Range( modelSurface.getDocument().data.getNearestContentOffset( fragmentRange.start, 1 ) ); + newCursorRange = new ve.Range( surfaceModel.getDocument().data.getNearestContentOffset( fragmentRange.start, 1 ) ); if ( fragmentRange.containsRange( newCursorRange ) ) { - modelSurface.setLinearSelection( newCursorRange ); + surfaceModel.setLinearSelection( newCursorRange ); } }; -- To view, visit https://gerrit.wikimedia.org/r/379248 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I174e2b020dbbf5a0eb322a37326ceaf033eb5398 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: EsandersGerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Fix cursor position after extension loads
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/375617 ) Change subject: Fix cursor position after extension loads .. Fix cursor position after extension loads Bug: T174547 Change-Id: I8ce2c61884410c4ca47bd8cbc11d0902df7f1d4a --- M resources/ext.CodeMirror.js 1 file changed, 25 insertions(+), 8 deletions(-) Approvals: jenkins-bot: Verified Kaldari: Looks good to me, approved diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js index e58a5f3..732816a 100644 --- a/resources/ext.CodeMirror.js +++ b/resources/ext.CodeMirror.js @@ -324,23 +324,34 @@ * Enables or disables CodeMirror */ function switchCodeMirror() { - var scrollTop, + var selectionObj, + selectionStart, + selectionEnd, + scrollTop, + hasFocus, $textbox1 = $( '#wpTextbox1' ); if ( codeMirror ) { scrollTop = codeMirror.getScrollInfo().top; + selectionObj = codeMirror.doc.listSelections()[ 0 ]; + selectionStart = codeMirror.doc.indexFromPos( selectionObj.head ); + selectionEnd = codeMirror.doc.indexFromPos( selectionObj.anchor ); + hasFocus = codeMirror.hasFocus(); setCodeEditorPreference( false ); codeMirror.save(); codeMirror.toTextArea(); codeMirror = null; $.fn.textSelection = origTextSelection; + if ( hasFocus ) { + $textbox1.focus(); + } + $textbox1.prop( 'selectionStart', selectionStart ); + $textbox1.prop( 'selectionEnd', selectionEnd ); $textbox1.scrollTop( scrollTop ); } else { - scrollTop = $textbox1.scrollTop(); // eslint-disable-next-line no-use-before-define enableCodeMirror(); setCodeEditorPreference( true ); - codeMirror.scrollTo( 0, scrollTop ); } updateToolbarButton(); } @@ -351,13 +362,16 @@ function enableCodeMirror() { var config = mw.config.get( 'extCodeMirrorConfig' ); - if ( codeMirror ) { - return; - } - mw.loader.using( config.pluginModules, function () { var $codeMirror, - $textbox1 = $( '#wpTextbox1' ); + $textbox1 = $( '#wpTextbox1' ), + selectionStart = $textbox1.prop( 'selectionStart' ), + selectionEnd = $textbox1.prop( 'selectionEnd' ), + scrollTop = $textbox1.scrollTop(); + + if ( codeMirror ) { // Already loaded + return; + } codeMirror = CodeMirror.fromTextArea( $textbox1[ 0 ], { mwConfig: config, @@ -372,6 +386,9 @@ } ); $codeMirror = $( codeMirror.getWrapperElement() ); + codeMirror.doc.setSelection( codeMirror.doc.posFromIndex( selectionEnd ), codeMirror.doc.posFromIndex( selectionStart ) ); + codeMirror.scrollTo( null, scrollTop ); + // HACK: font size varies by browser (chrome/FF/IE) $codeMirror.css( { 'font-size': $textbox1.css( 'font-size' ), -- To view, visit https://gerrit.wikimedia.org/r/375617 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ce2c61884410c4ca47bd8cbc11d0902df7f1d4a Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/CodeMirror Gerrit-Branch: master Gerrit-Owner: PastakhovGerrit-Reviewer: Kaldari Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Fix toolbar initialization (fixes tool width)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379723 ) Change subject: Fix toolbar initialization (fixes tool width) .. Fix toolbar initialization (fixes tool width) * Initialize toolbar after setup * Don't initialize actions toolbar Change-Id: I7ab2cb29220efad8c6404595871f56b9e6f675f3 --- M modules/ui/mw.cx.ui.TranslationView.js 1 file changed, 2 insertions(+), 4 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified Objections: Nikerabbit: There's a problem with this change, please improve diff --git a/modules/ui/mw.cx.ui.TranslationView.js b/modules/ui/mw.cx.ui.TranslationView.js index 4317e7c..fad6cb4 100644 --- a/modules/ui/mw.cx.ui.TranslationView.js +++ b/modules/ui/mw.cx.ui.TranslationView.js @@ -131,6 +131,7 @@ this.publishButton = publishButton; this.publishSettings = publishSettings; this.getToolbar().$actions.append( this.publishSettings.$element, this.publishButton.$element ); + this.getToolbar().initialize(); }; mw.cx.ui.TranslationView.prototype.unbindHandlers = function () { @@ -253,10 +254,7 @@ }; mw.cx.ui.TranslationView.prototype.attachToolbar = function () { - var toolbar = this.getToolbar(); - this.header.$toolbar.append( toolbar.$element ); - toolbar.initialize(); - this.getActions().initialize(); + this.header.$toolbar.append( this.getToolbar().$element ); }; mw.cx.ui.TranslationView.prototype.onDocumentTransact = function () { -- To view, visit https://gerrit.wikimedia.org/r/379723 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7ab2cb29220efad8c6404595871f56b9e6f675f3 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: EsandersGerrit-Reviewer: Catrope Gerrit-Reviewer: Esanders Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: Santhosh Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Changes to group clean up based on feedback from Caitlin.
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380667 ) Change subject: Changes to group clean up based on feedback from Caitlin. .. Changes to group clean up based on feedback from Caitlin. In response to Caitlin's feedback I have assigned the groups she queried to her & removed from the delete list. They can then be followed up on outside this bulk process, with Caitlin denoted as the authority Bug: T174407 Change-Id: I2385a06632c761695e199397c5d56b7d04b8ce14 --- M sites/all/modules/wmf_civicrm/update_7545.php 1 file changed, 55 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/67/380667/1 diff --git a/sites/all/modules/wmf_civicrm/update_7545.php b/sites/all/modules/wmf_civicrm/update_7545.php index 4aecea8..25dbbab 100644 --- a/sites/all/modules/wmf_civicrm/update_7545.php +++ b/sites/all/modules/wmf_civicrm/update_7545.php @@ -24,7 +24,28 @@ 298 => 'Wikimedia board report recipients', ); + // These are all groups that Caitlin raised a query about. + // By assigning them to her we denote that she at least knows something about + // their possible future usefulness. + $groupsToAssignToCaitlin = array( +72 => 'WMF Advisory Board 09', +1 => 'WMF Staff', +273 => 'Attended London Event 2014', +276 => 'MG Year End Appeal 2014', +277 => 'Receives WMF Quarterly Report', +278 => 'Work Place Giving Donors 2014', +279 => 'TSmart Import US and 5000+', +280 => 'TSmart Import 50 - 150 miles of SF', +281 => 'TSmart Import 0 - 150 miles of LA', +187 => 'Do Not Email Ever', +18 => 'RHandlers Spreadsheet', +20 => 'Rebeccas Prospects', +160 => 'News from Wikimedia Email', +161 => 'News from Wikimedia Email Responded', + ); + $groupsToDelete = array( +// per email 30 => 'Do Not Trade', 33 => 'Organizations', 37 => 'People Opted-Out', @@ -38,7 +59,10 @@ 283 => 'Recent Worldpay donors 2', 284 => 'Incomplete JP Morgan import', 243 => 'FR2011 - Past Donors', - 1 => 'WMF Staff', +// Comment from Caitlin V: +// I don't need to keep these groups specifically, but I would like WMF Staff and former board members noted in Civi. Is a group or a tag the correct way to note that? (Staff has a tag right now) +// +// 1 => 'WMF Staff', 7 => 'Committees', 8 => 'Project Contacts', 11 => 'Vendors', @@ -56,7 +80,9 @@ 61 => 'Dexia Import Records', 64 => '07/08 $1k+ Donors', 71 => 'WMF Board Members 09', -72 => 'WMF Advisory Board 09', +// Comment from Caitlin V: +// I don't need to keep these groups specifically, but I would like WMF Staff and former board members noted in Civi. Is a group or a tag the correct way to note that? (Staff has a tag right now) +// 72 => 'WMF Advisory Board 09', 73 => 'Recurring Donors 09', 74 => 'Imported Moneybookers', 77 => 'Hyperlinked Benefactors Past', @@ -99,7 +125,9 @@ 175 => 'Harnisch Inside the Globe Attended', 176 => 'Harnisch Inside the Globe No-shows', 184 => 'Harnisch Inside the Globe Regrets Email', -187 => 'Do Not Email Ever', +// Comment from Caitlin +//This is a big group (32k). I looked at a sampling of them and none were marked in our current best practice ways (Communication Preferences - Privacy - Do Not Email). Is there way to update these records to the current best practice. +//187 => 'Do Not Email Ever', 194 => 'Focus Group Appeal (Usability)', 208 => '2010 Snail Mail Campaign', 209 => '2010 Fundraiser Donors', @@ -118,13 +146,15 @@ 259 => 'Annual Report Mail out 2014', 260 => 'TSmart Import', 271 => 'Office Visit - Interested In', -273 => 'Attended London Event 2014', -276 => 'MG Year End Appeal 2014', -277 => 'Receives WMF Quarterly Report', -278 => 'Work Place Giving Donors 2014', -279 => 'TSmart Import US and 5000+', -280 => 'TSmart Import 50 - 150 miles of SF', -281 => 'TSmart Import 0 - 150 miles of LA', +// Comment from Caitlin: +// These are relatively recent groups. Is the membership in this group noted in another way in Civi? Ie, If someone attended the 2014 London event, is that noted as an activity in their record? +//273 => 'Attended London Event 2014', +//276 => 'MG Year End Appeal 2014', +//277 => 'Receives WMF Quarterly Report', +//278 => 'Work Place Giving Donors 2014', +//279 => 'TSmart Import US and 5000+', +//280 => 'TSmart Import 50 - 150 miles of SF', +//281 => 'TSmart Import 0 - 150 miles of LA', 282 => 'Recent Worldpay donors', // Mailings related @@ -184,8 +214,10 @@ 193 => 'Fundraiser 2010 - Email 1', 101 => 'Recipient of 01/10 AR mailing (500.00-.99)', 102 => 'Recipient of 01/10 AR mailing (10,000+)', -160 => 'News from Wikimedia
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: rename endpoint to module
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380661 ) Change subject: Chore: rename endpoint to module .. Chore: rename endpoint to module Rename `Endpoint` to `PageModule` and `endpoint` to `module` to more closely model today's usage. Approximately: find src -type f| xargs -rd\\n sed -ri 's%Endpoint%Page^Cdule%g; s%endpoint%module%g' For Route.endpoint(), rename to importModule() since that's what it always does currently. Change-Id: I5a4fcb746339275d3edf1aa3625d49de55a165f0 --- M src/common/routers/api.ts M src/common/routers/route.ts M src/common/routers/router.test.ts M src/common/routers/router.ts 4 files changed, 25 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/61/380661/1 diff --git a/src/common/routers/api.ts b/src/common/routers/api.ts index f12bcec..873ae7c 100644 --- a/src/common/routers/api.ts +++ b/src/common/routers/api.ts @@ -4,26 +4,28 @@ export const home: Route = newRoute({ path: "/", - endpoint: () => import(/* webpackChunkName: "pages/home" */ "../pages/home"), + importModule: () => +import(/* webpackChunkName: "pages/home" */ "../pages/home"), chunkName: "pages/home" }); export const about: Route= newRoute({ path: "/about", - endpoint: () => + importModule: () => import(/* webpackChunkName: "pages/about" */ "../pages/about"), chunkName: "pages/about" }); export const wiki: Route = newRoute({ path: "/wiki/:title", - endpoint: () => import(/* webpackChunkName: "pages/wiki" */ "../pages/wiki"), + importModule: () => +import(/* webpackChunkName: "pages/wiki" */ "../pages/wiki"), chunkName: "pages/wiki" }); export const styleGuide: Route = newRoute({ path: "/dev/style-guide", - endpoint: () => + importModule: () => import(/* webpackChunkName: "pages/style-guide" */ "../pages/style-guide"), chunkName: "pages/style-guide" }); @@ -32,7 +34,7 @@ // `(.*)` is the new `*`. See // https://github.com/pillarjs/path-to-regexp/issues/37. path: "(.*)", - endpoint: () => + importModule: () => import(/* webpackChunkName: "pages/not-found" */ "../pages/not-found"), chunkName: "pages/not-found", status: 404 diff --git a/src/common/routers/route.ts b/src/common/routers/route.ts index c812356..639adcf 100644 --- a/src/common/routers/route.ts +++ b/src/common/routers/route.ts @@ -5,7 +5,13 @@ [name: string]: string; } -export interface Endpoint { +/** + * A file that exposes a Preact UI component and optionally a function to + * request properties needed to construct the component. Modules within the + * pages/ subdirectory should implicitly implement this interface or typing will + * fail in routers/api. + */ +export interface PageModule { /** A Preact view component. */ Component: AnyComponent ; @@ -18,7 +24,7 @@ export interface RouteConfiguration { path: string; - endpoint: () => Promise >; + importModule: () => Promise >; chunkName: string; status?: number; } @@ -35,12 +41,12 @@ export const newRoute = ({ path, - endpoint, + importModule, chunkName, status = 200 }: RouteConfiguration ): Route => ({ path, - endpoint, + importModule, chunkName, status, url: pathToRegExp.compile(path) diff --git a/src/common/routers/router.test.ts b/src/common/routers/router.test.ts index 23d552e..865f7bf 100644 --- a/src/common/routers/router.test.ts +++ b/src/common/routers/router.test.ts @@ -9,7 +9,7 @@ const routes = [ newRoute({ path: "/", -endpoint: () => Promise.resolve(HomeModule), +importModule: () => Promise.resolve(HomeModule), chunkName: "components/pages/home" }) ]; diff --git a/src/common/routers/router.ts b/src/common/routers/router.ts index 2446e10..2de064b 100644 --- a/src/common/routers/router.ts +++ b/src/common/routers/router.ts @@ -1,6 +1,6 @@ import * as pathToRegExp from "path-to-regexp"; import { AnyComponent } from "../components/preact-utils"; -import { AnyRoute, Endpoint, RouteParams } from "../../common/routers/route"; +import { AnyRoute, PageModule, RouteParams } from "../../common/routers/route"; export interface RouteResponse { chunkName: string; @@ -46,11 +46,11 @@ ); function requestInitialProps( - endpoint: Endpoint , + module: PageModule , params: RouteParams ): Promise { - if (endpoint.initialProps) { -return endpoint.initialProps(params); + if (module.initialProps) { +return module.initialProps(params); } return Promise.resolve({}); } @@ -60,11 +60,11 @@ url: string, params: RouteParams ): Promise > => - route.endpoint().then((endpoint: Endpoint ) => -
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: remove unused properties from RouteResponse
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380663 ) Change subject: Chore: remove unused properties from RouteResponse .. Chore: remove unused properties from RouteResponse - Remove extra properties on successful route responses until they're needed. - Rename Route.initialProps() to requestProps(): clarify that Route.initialProps() is likely a network request and may fail by renaming it to requestProps(). Change-Id: I4b3e11023e21268ed5f0380dd2efe7f94e179e68 --- M src/common/routers/route.ts M src/common/routers/router.ts 2 files changed, 8 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/63/380663/1 diff --git a/src/common/routers/route.ts b/src/common/routers/route.ts index 57fba9f..f1c6f9b 100644 --- a/src/common/routers/route.ts +++ b/src/common/routers/route.ts @@ -17,9 +17,10 @@ /** * A function that returns a Promise for the dependencies needed to construct - * the view component such as a remote resource. + * the view component such as a remote resource. This method will likely issue + * a network request. */ - initialProps?: (params: RouteParams) => Promise; + requestProps?: (params: RouteParams) => Promise; } export interface RouteConfiguration { diff --git a/src/common/routers/router.ts b/src/common/routers/router.ts index 8a563d8..ef1eee9 100644 --- a/src/common/routers/router.ts +++ b/src/common/routers/router.ts @@ -6,12 +6,7 @@ chunkName: string; status: number; Component: AnyComponent; - props: { -path: string; -url: string; -params: { [name: string]: string }; - }; - initialProps: any; + props: Props; } export interface Router { @@ -49,12 +44,11 @@ module: PageModule, params: RouteParams ): Promise { - return module.initialProps ? module.initialProps(params) : Promise.resolve(); + return module.requestProps ? module.requestProps(params) : Promise.resolve(); } const respond = ( route: ParsedRoute, - url: string, params: RouteParams ): Promise => route.importModule().then((module: PageModule) => @@ -62,13 +56,7 @@ chunkName: route.chunkName, status: route.status, Component: module.Component, - props: { -...props, -path: route.path, -url, -params - }, - initialProps: props + props })) ); @@ -80,9 +68,9 @@ for (const route of parsedRoutes) { const matches = route.regularExpression.exec(url); if (matches) { - const [url, ...paramValues] = matches; + const [, ...paramValues] = matches; const params = newRouteParams(route.paramNames, paramValues); - return respond(route, url, params); + return respond(route, params); } } return Promise.reject(new Error("No route matched.")); -- To view, visit https://gerrit.wikimedia.org/r/380663 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b3e11023e21268ed5f0380dd2efe7f94e179e68 Gerrit-PatchSet: 1 Gerrit-Project: marvin Gerrit-Branch: master Gerrit-Owner: Niedzielski Gerrit-Reviewer: Sniedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: improve typing of private Router function
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380666 ) Change subject: Chore: improve typing of private Router function .. Chore: improve typing of private Router function Change-Id: I77cc0d04264ec5a2933550091d3363f86b3f5fb1 --- M src/common/routers/router.ts 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/66/380666/1 diff --git a/src/common/routers/router.ts b/src/common/routers/router.ts index 12127d9..308e1de 100644 --- a/src/common/routers/router.ts +++ b/src/common/routers/router.ts @@ -51,21 +51,22 @@ return module.requestProps ? module.requestProps(params) : Promise.resolve(); } -const respond = ( +function respond( route: ParsedRoute, params: RouteParams -): Promise=> - route.importModule().then((module: PageModule) => +): Promise { + return route.importModule().then((module: PageModule ) => // The request for initial properties cannot be parallelized with the import // because the initial properties method is undefined until the import // completes. -requestProps(module, params).then((props: any) => ({ +requestProps(module, params).then((props: Props) => ({ chunkName: route.chunkName, status: route.status, Component: module.Component, props })) ); +} export const newRouter = (routes: AnyRoute[]): Router => { const parsedRoutes: ParsedRoute[] = parseRoutes(routes); -- To view, visit https://gerrit.wikimedia.org/r/380666 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77cc0d04264ec5a2933550091d3363f86b3f5fb1 Gerrit-PatchSet: 1 Gerrit-Project: marvin Gerrit-Branch: master Gerrit-Owner: Niedzielski Gerrit-Reviewer: Sniedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: remove NPM watch script
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380664 ) Change subject: Chore: remove NPM watch script .. Chore: remove NPM watch script The watch script no longer seems especially useful. Remove it. Change-Id: Id34ce0c39ffa63facacde4becd9162b30878e7b3 --- M package.json 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/64/380664/1 diff --git a/package.json b/package.json index d8604bd..81d2ed0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "scripts": { "--- PRIMARY ---": "# Frequent user scripts.", "start": "npm-run-all --silent clean --parallel start:\\*", -"watch": "run-p -s start:\\* test:watch", "build": "NODE_ENV=production npm-run-all --silent clean --parallel build:\\*", "format": "npm run -s lint -- --fix", "lint": "eslint --cache --max-warnings 0 --ext ts,tsx,js,json .", -- To view, visit https://gerrit.wikimedia.org/r/380664 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id34ce0c39ffa63facacde4becd9162b30878e7b3 Gerrit-PatchSet: 1 Gerrit-Project: marvin Gerrit-Branch: master Gerrit-Owner: NiedzielskiGerrit-Reviewer: Sniedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: push RouteParams typing into PageModule
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380665 ) Change subject: Chore: push RouteParams typing into PageModule .. Chore: push RouteParams typing into PageModule Require the specific RouteParams subtype needed in PageModule and RouteConfiguration. Also, rename Router's private requestInitialProps() function to just requestProps() for consistency. Change-Id: I25a8eeb5f7f243158d460b2d5a23fa7f58d2a6f5 --- M src/common/routers/api.ts M src/common/routers/route.ts M src/common/routers/router.ts 3 files changed, 22 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/65/380665/1 diff --git a/src/common/routers/api.ts b/src/common/routers/api.ts index b562789..1e0c83d 100644 --- a/src/common/routers/api.ts +++ b/src/common/routers/api.ts @@ -15,7 +15,7 @@ chunkName: "pages/about" }); -export const wiki: Route= newRoute({ +export const wiki: Route = newRoute({ path: "/wiki/:title", importModule: () => import(/* webpackChunkName: "pages/wiki" */ "../pages/wiki"), diff --git a/src/common/routers/route.ts b/src/common/routers/route.ts index f1c6f9b..d05786d 100644 --- a/src/common/routers/route.ts +++ b/src/common/routers/route.ts @@ -11,7 +11,7 @@ * pages/ subdirectory should implicitly implement this interface or typing will * fail in routers/api. */ -export interface PageModule { +export interface PageModule { /** A Preact view component. */ Component: AnyComponent ; @@ -20,18 +20,21 @@ * the view component such as a remote resource. This method will likely issue * a network request. */ - requestProps?: (params: RouteParams) => Promise; + requestProps?: (params: Params) => Promise; } -export interface RouteConfiguration { +export interface RouteConfiguration< + Params extends RouteParams = {}, + Props = void +> { path: string; - importModule: () => Promise ; + importModule: () => Promise >; chunkName: string; status?: number; } -export interface Route - extends RouteConfiguration { +export interface Route + extends RouteConfiguration { status: number; /** Generates a URL from parameters. */ @@ -45,7 +48,7 @@ importModule, chunkName, status = 200 -}: RouteConfiguration): Route => ({ +}: RouteConfiguration ): Route => ({ path, importModule, chunkName, diff --git a/src/common/routers/router.ts b/src/common/routers/router.ts index ef1eee9..12127d9 100644 --- a/src/common/routers/router.ts +++ b/src/common/routers/router.ts @@ -28,6 +28,10 @@ }; }); +// This method is tightly coupled with Route.path and the parameters supplied to +// PageModule.requestProps. Route.path must use names that match the typing for +// the parameters of PageModule.requestProps(). This method only associates the +// names of Route.path with the values found in the matched URL. const newRouteParams = ( paramNames: pathToRegExp.Key[], paramValues: string[] @@ -40,9 +44,9 @@ {} ); -function requestInitialProps( - module: PageModule, - params: RouteParams +function requestProps( + module: PageModule , + params: Params ): Promise { return module.requestProps ? module.requestProps(params) : Promise.resolve(); } @@ -52,7 +56,10 @@ params: RouteParams ): Promise => route.importModule().then((module: PageModule) => -requestInitialProps(module, params).then((props: any) => ({ +// The request for initial properties cannot be parallelized with the import +// because the initial properties method is undefined until the import +// completes. +requestProps(module, params).then((props: any) => ({ chunkName: route.chunkName, status: route.status, Component: module.Component, -- To view, visit https://gerrit.wikimedia.org/r/380665 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25a8eeb5f7f243158d460b2d5a23fa7f58d2a6f5 Gerrit-PatchSet: 1 Gerrit-Project: marvin Gerrit-Branch: master Gerrit-Owner: Niedzielski Gerrit-Reviewer: Sniedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: remove state typing from Route and RouteResponse
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380662 ) Change subject: Chore: remove state typing from Route and RouteResponse .. Chore: remove state typing from Route and RouteResponse Replace Route and RouteResponse's State generic type parameter with any. Neither has a dependency on or interactions with the Component's state so it seems simpler to avoid typing it. Change-Id: I5f1eb3c299be4893a071c83f475f9aceddf45178 --- M src/client/index.tsx M src/common/routers/api.ts M src/common/routers/route.ts M src/common/routers/router.ts M src/server/index.tsx 5 files changed, 21 insertions(+), 25 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/62/380662/1 diff --git a/src/client/index.tsx b/src/client/index.tsx index 554a266..821b62a 100644 --- a/src/client/index.tsx +++ b/src/client/index.tsx @@ -14,7 +14,7 @@ throw new Error('Missing element with "root" ID.'); } -const renderPageRoot = ({ Component, props }: RouteResponse) => { +const renderPageRoot = ({ Component, props }: RouteResponse) => { render( diff --git a/src/common/routers/api.ts b/src/common/routers/api.ts index 873ae7c..b562789 100644 --- a/src/common/routers/api.ts +++ b/src/common/routers/api.ts @@ -1,5 +1,4 @@ import { Props as WikiProps, Params as WikiParams } from "../pages/wiki"; -import { State as AboutState } from "../pages/about"; import { AnyRoute, Route, newRoute } from "./route"; export const home: Route = newRoute({ @@ -9,14 +8,14 @@ chunkName: "pages/home" }); -export const about: Route = newRoute({ +export const about: Route = newRoute({ path: "/about", importModule: () => import(/* webpackChunkName: "pages/about" */ "../pages/about"), chunkName: "pages/about" }); -export const wiki: Route = newRoute({ +export const wiki: Route = newRoute({ path: "/wiki/:title", importModule: () => import(/* webpackChunkName: "pages/wiki" */ "../pages/wiki"), diff --git a/src/common/routers/route.ts b/src/common/routers/route.ts index 639adcf..57fba9f 100644 --- a/src/common/routers/route.ts +++ b/src/common/routers/route.ts @@ -11,9 +11,9 @@ * pages/ subdirectory should implicitly implement this interface or typing will * fail in routers/api. */ -export interface PageModule { +export interface PageModule { /** A Preact view component. */ - Component: AnyComponent ; + Component: AnyComponent ; /** * A function that returns a Promise for the dependencies needed to construct @@ -22,29 +22,29 @@ initialProps?: (params: RouteParams) => Promise; } -export interface RouteConfiguration { +export interface RouteConfiguration { path: string; - importModule: () => Promise >; + importModule: () => Promise ; chunkName: string; status?: number; } -export interface Route - extends RouteConfiguration { +export interface Route + extends RouteConfiguration { status: number; /** Generates a URL from parameters. */ url: (params?: Params) => string; } -export type AnyRoute = Route ; +export type AnyRoute = Route ; -export const newRoute = ({ +export const newRoute = ({ path, importModule, chunkName, status = 200 -}: RouteConfiguration ): Route => ({ +}: RouteConfiguration): Route => ({ path, importModule, chunkName, diff --git a/src/common/routers/router.ts b/src/common/routers/router.ts index 2de064b..8a563d8 100644 --- a/src/common/routers/router.ts +++ b/src/common/routers/router.ts @@ -2,10 +2,10 @@ import { AnyComponent } from "../components/preact-utils"; import { AnyRoute, PageModule, RouteParams } from "../../common/routers/route"; -export interface RouteResponse { +export interface RouteResponse { chunkName: string; status: number; - Component: AnyComponent ; + Component: AnyComponent ; props: { path: string; url: string; @@ -15,7 +15,7 @@ } export interface Router { - route(url: string): Promise >; + route(url: string): Promise ; } interface ParsedRoute extends AnyRoute { @@ -46,21 +46,18 @@ ); function requestInitialProps( - module: PageModule , + module: PageModule, params: RouteParams -): Promise { - if (module.initialProps) { -return module.initialProps(params); - } - return Promise.resolve({}); +): Promise { + return module.initialProps ? module.initialProps(params) : Promise.resolve(); } const respond = ( route: ParsedRoute, url: string, params: RouteParams -): Promise > => - route.importModule().then((module:
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: rename parameters and properties to abbreviated forms
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380660 ) Change subject: Chore: rename parameters and properties to abbreviated forms .. Chore: rename parameters and properties to abbreviated forms Rename parameters and properties according to development guidelines: - Parameters to params. - Properties to props. Approximately: find src test -type f| xargs -rd\\n sed -ri 's%(P|p)(aram|rop)e(ter|rties|rty)%\1\2%g;' Change-Id: I9407c750aca9d0efe0bd796234fbbfb6f5554654 --- M src/common/routers/route.ts M src/common/routers/router.ts M src/server/assets/manifest.ts 3 files changed, 27 insertions(+), 38 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/60/380660/1 diff --git a/src/common/routers/route.ts b/src/common/routers/route.ts index e688a9e..c812356 100644 --- a/src/common/routers/route.ts +++ b/src/common/routers/route.ts @@ -13,7 +13,7 @@ * A function that returns a Promise for the dependencies needed to construct * the view component such as a remote resource. */ - initialProps?: (parameters: RouteParams) => Promise; + initialProps?: (params: RouteParams) => Promise; } export interface RouteConfiguration { @@ -23,22 +23,22 @@ status?: number; } -export interface Route +export interface Route extends RouteConfiguration{ status: number; /** Generates a URL from parameters. */ - url: (parameters?: Parameters) => string; + url: (params?: Params) => string; } export type AnyRoute = Route ; -export const newRoute = ({ +export const newRoute = ({ path, endpoint, chunkName, status = 200 -}: RouteConfiguration ): Route => ({ +}: RouteConfiguration ): Route => ({ path, endpoint, chunkName, diff --git a/src/common/routers/router.ts b/src/common/routers/router.ts index 9db0a75..2446e10 100644 --- a/src/common/routers/router.ts +++ b/src/common/routers/router.ts @@ -9,7 +9,7 @@ props: { path: string; url: string; -parameters: { [name: string]: string }; +params: { [name: string]: string }; }; initialProps: any; } @@ -19,42 +19,38 @@ } interface ParsedRoute extends AnyRoute { - parameterNames: pathToRegExp.Key[]; + paramNames: pathToRegExp.Key[]; regularExpression: RegExp; } const parseRoutes = (routes: AnyRoute[]) => routes.map((route: AnyRoute): ParsedRoute => { -const parameterNames: pathToRegExp.Key[] = []; +const paramNames: pathToRegExp.Key[] = []; return { ...route, - parameterNames, - regularExpression: pathToRegExp(route.path, parameterNames) + paramNames, + regularExpression: pathToRegExp(route.path, paramNames) }; }); -const newRouteParameters = ( - parameterNames: pathToRegExp.Key[], - parameterValues: string[] +const newRouteParams = ( + paramNames: pathToRegExp.Key[], + paramValues: string[] ): RouteParams => - parameterNames.reduce( -( - parameters: RouteParams, - parameterName: pathToRegExp.Key, - index: number -) => { - parameters[parameterName.name] = parameterValues[index]; - return parameters; + paramNames.reduce( +(params: RouteParams, paramName: pathToRegExp.Key, index: number) => { + params[paramName.name] = paramValues[index]; + return params; }, {} ); function requestInitialProps( endpoint: Endpoint , - parameters: RouteParams + params: RouteParams ): Promise { if (endpoint.initialProps) { -return endpoint.initialProps(parameters); +return endpoint.initialProps(params); } return Promise.resolve({}); } @@ -62,10 +58,10 @@ const respond = ( route: ParsedRoute, url: string, - parameters: RouteParams + params: RouteParams ): Promise > => route.endpoint().then((endpoint: Endpoint ) => -requestInitialProps(endpoint, parameters).then((props: any) => ({ +requestInitialProps(endpoint, params).then((props: any) => ({ chunkName: route.chunkName, status: route.status, Component: endpoint.Component, @@ -73,7 +69,7 @@ ...props, path: route.path, url, -parameters +params }, initialProps: props })) @@ -87,12 +83,9 @@ for (const route of parsedRoutes) { const matches = route.regularExpression.exec(url); if (matches) { - const [url, ...parameterValues] = matches; - const parameters = newRouteParameters( -route.parameterNames, -parameterValues - ); - return respond(route, url, parameters); + const [url, ...paramValues] = matches; + const params = newRouteParams(route.paramNames, paramValues); + return respond(route,
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Use converter to generate HTML from source for translation
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380558 ) Change subject: Use converter to generate HTML from source for translation .. Use converter to generate HTML from source for translation Allows us to request full clipboard mode which includes the full reference body. Change-Id: I0e7c17098c42232487651e9b7154ad8b0e39b369 --- M modules/ui/mw.cx.ui.TranslationView.js 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ui/mw.cx.ui.TranslationView.js b/modules/ui/mw.cx.ui.TranslationView.js index fd4e64a..edb690c 100644 --- a/modules/ui/mw.cx.ui.TranslationView.js +++ b/modules/ui/mw.cx.ui.TranslationView.js @@ -306,7 +306,9 @@ } sourceModel = this.sourceSurface.$element.find( '#' + sourceId ).data( 'view' ).getModel(); - sourceNode = sourceModel.getOriginalDomElements( sourceModel.getDocument().getStore() )[ 0 ]; + // Convert DOM to node, preserving full internal list + // Use clipboard mode to ensure reference body is outputted + sourceNode = ve.dm.converter.getDomFromNode( sourceModel, true ).body.children[ 0 ]; this.translate( restructure( sourceNode ).outerHTML ).done( this.gotPlaceholderTranslation.bind( this, placeholder ) ).fail( function () { -- To view, visit https://gerrit.wikimedia.org/r/380558 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e7c17098c42232487651e9b7154ad8b0e39b369 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: EsandersGerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380659 ) Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: I54250ca952af883e08db095ebd0073169e63a631 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Ejegg: Looks good to me, approved diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 4ce7f50..d5954ea 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 4ce7f50d003cedc5a9a9f01bd94899c86e7d1882 +Subproject commit d5954ea88186a371b6f4824d0c30f6b96ae57c16 -- To view, visit https://gerrit.wikimedia.org/r/380659 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54250ca952af883e08db095ebd0073169e63a631 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: EjeggGerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380658 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 3cc0a4eec PayPal country code mapping 51de6b768 Remove old transitional code 802cacd5e Add 'ingenico' to error form definitions ccbc88af2 Ingenico can't accept VEF anymore ed1174d3b Try out approvePayment 2ec4ccec4 Localisation updates from https://translatewiki.net. c57317a65 Localisation updates from https://translatewiki.net. 148578a46 Localisation updates from https://translatewiki.net. a01834425 Fix amount warnings Change-Id: I34b08bd281a72070525b2dd585999feaa91f0dab --- D tests/phpunit/Adapter/PayPal/PayPalExpressTest.php D tests/phpunit/AmountTest.php D tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_C2.testresponse 3 files changed, 0 insertions(+), 781 deletions(-) Approvals: jenkins-bot: Verified Ejegg: Looks good to me, approved diff --git a/tests/phpunit/Adapter/PayPal/PayPalExpressTest.php b/tests/phpunit/Adapter/PayPal/PayPalExpressTest.php deleted file mode 100644 index 54e7ebd..000 --- a/tests/phpunit/Adapter/PayPal/PayPalExpressTest.php +++ /dev/null @@ -1,515 +0,0 @@ -<<< HEAD (4ce7f5 Merge branch 'master' into deployment) -=== -providerConfigurationOverride = TestingProviderConfiguration::createForProvider( - 'paypal', $this->smashPigGlobalConfig - ); - $this->setMwGlobals( array( - 'wgDonationInterfaceCancelPage' => 'https://example.com/tryAgain.php', - 'wgPaypalExpressGatewayEnabled' => true, - 'wgDonationInterfaceThankYouPage' => 'https://example.org/wiki/Thank_You', - ) ); - } - - function testPaymentSetup() { - $init = array( - 'amount' => 1.55, - 'currency' => 'USD', - 'payment_method' => 'paypal', - 'utm_source' => 'CD1234_FR', - 'utm_medium' => 'sitenotice', - 'country' => 'US', - 'contribution_tracking_id' => strval( mt_rand() ), - 'language' => 'fr', - ); - $gateway = $this->getFreshGatewayObject( $init ); - $gateway::setDummyGatewayResponseCode( 'OK' ); - $result = $gateway->doPayment(); - $gateway->logPending(); // GatewayPage or the API calls this for redirects - $this->assertEquals( - 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout=EC-8US12345X1234567U', - $result->getRedirect(), - 'Wrong redirect for PayPal EC payment setup' - ); - $this->assertEquals( 1, count( $gateway->curled ), 'Should have made 1 API call' ); - $apiCall = $gateway->curled[0]; - $parsed = []; - parse_str( $apiCall, $parsed ); - $actualReturn = $parsed['RETURNURL']; - $parsedReturn = []; - parse_str( parse_url( $actualReturn, PHP_URL_QUERY ), $parsedReturn ); - $this->assertEquals( - [ - 'title' => 'Special:PaypalExpressGatewayResult', - 'order_id' => $init['contribution_tracking_id'] . '.1', - 'wmf_token' => $gateway->token_getSaltedSessionToken() - ], - $parsedReturn - ); - unset( $parsed['RETURNURL'] ); - $expected = [ - 'USER' => 'phpunittest...@wikimedia.org', - 'PWD' => '9876543210', - 'VERSION' => '204', - 'METHOD' => 'SetExpressCheckout', - 'CANCELURL' => 'https://example.com/tryAgain.php/fr', - 'REQCONFIRMSHIPPING' => '0', - 'NOSHIPPING' => '1', - 'LOCALECODE' => 'fr_US', - 'L_PAYMENTREQUEST_0_AMT0' => '1.55', - 'L_PAYMENTREQUEST_0_DESC0' => 'Donation to the Wikimedia Foundation', - 'PAYMENTREQUEST_0_AMT' => '1.55', - 'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD', - 'PAYMENTREQUEST_0_CUSTOM' => $init['contribution_tracking_id'], - 'PAYMENTREQUEST_0_DESC' => 'Donation to the Wikimedia Foundation', - 'PAYMENTREQUEST_0_INVNUM' => $init['contribution_tracking_id'] . '.1', - 'PAYMENTREQUEST_0_ITEMAMT' => '1.55', - 'PAYMENTREQUEST_0_PAYMENTACTION' => 'Sale', -
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380659 ) Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: I54250ca952af883e08db095ebd0073169e63a631 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/59/380659/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 4ce7f50..d5954ea 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 4ce7f50d003cedc5a9a9f01bd94899c86e7d1882 +Subproject commit d5954ea88186a371b6f4824d0c30f6b96ae57c16 -- To view, visit https://gerrit.wikimedia.org/r/380659 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54250ca952af883e08db095ebd0073169e63a631 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: Ejegg___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380658 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 3cc0a4eec PayPal country code mapping 51de6b768 Remove old transitional code 802cacd5e Add 'ingenico' to error form definitions ccbc88af2 Ingenico can't accept VEF anymore ed1174d3b Try out approvePayment 2ec4ccec4 Localisation updates from https://translatewiki.net. c57317a65 Localisation updates from https://translatewiki.net. 148578a46 Localisation updates from https://translatewiki.net. a01834425 Fix amount warnings Change-Id: I34b08bd281a72070525b2dd585999feaa91f0dab --- D tests/phpunit/Adapter/PayPal/PayPalExpressTest.php D tests/phpunit/AmountTest.php D tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_C2.testresponse 3 files changed, 0 insertions(+), 781 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/58/380658/1 diff --git a/tests/phpunit/Adapter/PayPal/PayPalExpressTest.php b/tests/phpunit/Adapter/PayPal/PayPalExpressTest.php deleted file mode 100644 index 54e7ebd..000 --- a/tests/phpunit/Adapter/PayPal/PayPalExpressTest.php +++ /dev/null @@ -1,515 +0,0 @@ -<<< HEAD (4ce7f5 Merge branch 'master' into deployment) -=== -providerConfigurationOverride = TestingProviderConfiguration::createForProvider( - 'paypal', $this->smashPigGlobalConfig - ); - $this->setMwGlobals( array( - 'wgDonationInterfaceCancelPage' => 'https://example.com/tryAgain.php', - 'wgPaypalExpressGatewayEnabled' => true, - 'wgDonationInterfaceThankYouPage' => 'https://example.org/wiki/Thank_You', - ) ); - } - - function testPaymentSetup() { - $init = array( - 'amount' => 1.55, - 'currency' => 'USD', - 'payment_method' => 'paypal', - 'utm_source' => 'CD1234_FR', - 'utm_medium' => 'sitenotice', - 'country' => 'US', - 'contribution_tracking_id' => strval( mt_rand() ), - 'language' => 'fr', - ); - $gateway = $this->getFreshGatewayObject( $init ); - $gateway::setDummyGatewayResponseCode( 'OK' ); - $result = $gateway->doPayment(); - $gateway->logPending(); // GatewayPage or the API calls this for redirects - $this->assertEquals( - 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout=EC-8US12345X1234567U', - $result->getRedirect(), - 'Wrong redirect for PayPal EC payment setup' - ); - $this->assertEquals( 1, count( $gateway->curled ), 'Should have made 1 API call' ); - $apiCall = $gateway->curled[0]; - $parsed = []; - parse_str( $apiCall, $parsed ); - $actualReturn = $parsed['RETURNURL']; - $parsedReturn = []; - parse_str( parse_url( $actualReturn, PHP_URL_QUERY ), $parsedReturn ); - $this->assertEquals( - [ - 'title' => 'Special:PaypalExpressGatewayResult', - 'order_id' => $init['contribution_tracking_id'] . '.1', - 'wmf_token' => $gateway->token_getSaltedSessionToken() - ], - $parsedReturn - ); - unset( $parsed['RETURNURL'] ); - $expected = [ - 'USER' => 'phpunittest...@wikimedia.org', - 'PWD' => '9876543210', - 'VERSION' => '204', - 'METHOD' => 'SetExpressCheckout', - 'CANCELURL' => 'https://example.com/tryAgain.php/fr', - 'REQCONFIRMSHIPPING' => '0', - 'NOSHIPPING' => '1', - 'LOCALECODE' => 'fr_US', - 'L_PAYMENTREQUEST_0_AMT0' => '1.55', - 'L_PAYMENTREQUEST_0_DESC0' => 'Donation to the Wikimedia Foundation', - 'PAYMENTREQUEST_0_AMT' => '1.55', - 'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD', - 'PAYMENTREQUEST_0_CUSTOM' => $init['contribution_tracking_id'], - 'PAYMENTREQUEST_0_DESC' => 'Donation to the Wikimedia Foundation', - 'PAYMENTREQUEST_0_INVNUM' => $init['contribution_tracking_id'] . '.1', - 'PAYMENTREQUEST_0_ITEMAMT' => '1.55', - 'PAYMENTREQUEST_0_PAYMENTACTION' => 'Sale', -
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SpecialPages: Reduce selector specificity
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379975 ) Change subject: SpecialPages: Reduce selector specificity .. SpecialPages: Reduce selector specificity Reducing unneeded selector specificity. Change-Id: I96b46b4e8b267c239c9a2cb73f65848c9fff9be1 --- M resources/src/mediawiki.special/mediawiki.special.css 1 file changed, 20 insertions(+), 20 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.special/mediawiki.special.css b/resources/src/mediawiki.special/mediawiki.special.css index ed7dc22..9ea8019 100644 --- a/resources/src/mediawiki.special/mediawiki.special.css +++ b/resources/src/mediawiki.special/mediawiki.special.css @@ -1,17 +1,17 @@ /* Special:AllMessages */ -#mw-allmessagestable .allmessages-customised td.am_default { +#mw-allmessagestable .allmessages-customised .am_default { background-color: #fcffc4; } -#mw-allmessagestable tr.allmessages-customised:hover td.am_default { +#mw-allmessagestable .allmessages-customised:hover .am_default { background-color: #faff90; } -#mw-allmessagestable td.am_actual { +#mw-allmessagestable .am_actual { background-color: #e2ffe2; } -#mw-allmessagestable tr.allmessages-customised:hover + tr.allmessages-customised td.am_actual { +#mw-allmessagestable .allmessages-customised:hover + .allmessages-customised .am_actual { background-color: #b1ffb1; } @@ -30,7 +30,7 @@ } /* Special:Block */ -p.mw-ipb-conveniencelinks { +.mw-ipb-conveniencelinks { font-size: 90%; text-align: right; } @@ -39,13 +39,13 @@ font-weight: bold; } -tr.mw-block-hideuser { +.mw-block-hideuser { font-weight: bold; } /* Special:BlockList */ -table.mw-blocklist span.mw-usertoollinks, -span.mw-blocklist-actions { +.mw-blocklist .mw-usertoollinks, +.mw-blocklist-actions { white-space: nowrap; font-size: 90%; } @@ -64,8 +64,8 @@ } /* Special:EmailUser */ -td#mw-emailuser-sender, -td#mw-emailuser-recipient { +#mw-emailuser-sender, +#mw-emailuser-recipient { font-weight: bold; } @@ -75,7 +75,7 @@ } /* Special:ListGroupRights */ -table.mw-listgrouprights-table tr { +.mw-listgrouprights-table tr { vertical-align: top; } .listgrouprights-revoked { @@ -83,7 +83,7 @@ } /* Special:RevisionDelete */ -p.mw-revdel-editreasons { +.mw-revdel-editreasons { font-size: 90%; text-align: right; } @@ -100,18 +100,18 @@ } /* Special:Statistics */ -td.mw-statistics-numbers { +.mw-statistics-numbers { text-align: right; } /* Special:ProtectedPages */ -table.mw-protectedpages span.mw-usertoollinks, -span.mw-protectedpages-length, -span.mw-protectedpages-actions { +.mw-protectedpages .mw-usertoollinks, +.mw-protectedpages-length, +.mw-protectedpages-actions { white-space: nowrap; font-size: 90%; } -span.mw-protectedpages-unknown { +.mw-protectedpages-unknown { color: #72777d; font-size: 90%; } @@ -120,11 +120,11 @@ .mw-userrights-disabled { color: #72777d; } -table.mw-userrights-groups * td, -table.mw-userrights-groups * th { +.mw-userrights-groups * td, +.mw-userrights-groups * th { padding-right: 1.5em; } -table.mw-userrights-groups * th { +.mw-userrights-groups * th { text-align: left; } -- To view, visit https://gerrit.wikimedia.org/r/379975 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I96b46b4e8b267c239c9a2cb73f65848c9fff9be1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: VolkerEGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Jack Phoenix Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Prtksxna Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: objectcache: Improve WANObjectCache test coverage
Krinkle has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380657 ) Change subject: objectcache: Improve WANObjectCache test coverage .. objectcache: Improve WANObjectCache test coverage class WANObjectCache: 62% -> 65% * doGetWithSetCallback: 98% -> 100% - Add case: Throw for invalid callback. * getWithSetCallback: 86% -> 100% - Cover case: Else branch for `$cur[self::VFLD_VERSION] === $version`. * getMulti: 91% -> 98% - Cover case: If branch for `$this->warmupCache`. * set: 93% -> 100% - Cover case: If branch for `lockTSE >= 0`. * reap: 84% -> 100% - Add case: Error when changeTTL() fails. Change-Id: I4844ab0ebdd4d3ec9acc9cd4500721b04cfda317 --- M tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php 1 file changed, 41 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/57/380657/1 diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php index c762aa7..fca6423 100644 --- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php +++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php @@ -260,9 +260,19 @@ } /** +* @covers WANObjectCache::getWithSetCallback() +* @covers WANObjectCache::doGetWithSetCallback() +*/ + public function testGetWithSetCallback_invalidCallback() { + $this->setExpectedException( InvalidArgumentException::class ); + $this->cache->getWithSetCallback( 'key', 30, 'invalid callback' ); + } + + /** * @dataProvider getMultiWithSetCallback_provider * @covers WANObjectCache::getMultiWithSetCallback() * @covers WANObjectCache::makeMultiKeys() +* @covers WANObjectCache::getMulti() * @param array $extOpts * @param bool $versioned */ @@ -618,6 +628,7 @@ /** * @covers WANObjectCache::getWithSetCallback() * @covers WANObjectCache::doGetWithSetCallback() +* @covers WANObjectCache::set() */ public function testLockTSESlow() { $cache = $this->cache; @@ -911,6 +922,8 @@ /** * @dataProvider getWithSetCallback_versions_provider +* @covers WANObjectCache::getWithSetCallback() +* @covers WANObjectCache::doGetWithSetCallback() * @param array $extOpts * @param bool $versioned */ @@ -1101,6 +1114,34 @@ } /** +* @covers WANObjectCache::reap() +*/ + public function testReap_fail() { + $backend = $this->getMockBuilder( EmptyBagOStuff::class ) + ->setMethods( [ 'get', 'changeTTL' ] )->getMock(); + $backend->expects( $this->once() )->method( 'get' ) + ->willReturn( [ + WANObjectCache::FLD_VERSION => WANObjectCache::VERSION, + WANObjectCache::FLD_VALUE => 'value', + WANObjectCache::FLD_TTL => 3600, + WANObjectCache::FLD_TIME => 300, + ] ); + $backend->expects( $this->once() )->method( 'changeTTL' ) + ->willReturn( false ); + + $wanCache = new WANObjectCache( [ + 'cache' => $backend, + 'pool' => 'testcache-hash', + 'relayer' => new EventRelayerNull( [] ) + ] ); + + $isStale = null; + $ret = $wanCache->reap( 'key', 360, $isStale ); + $this->assertTrue( $isStale, 'value was stale' ); + $this->assertFalse( $ret, 'changeTTL failed' ); + } + + /** * @covers WANObjectCache::set() */ public function testSetWithLag() { -- To view, visit https://gerrit.wikimedia.org/r/380657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4844ab0ebdd4d3ec9acc9cd4500721b04cfda317 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Cache regex check results
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/373918 ) Change subject: Cache regex check results .. Cache regex check results SparqlHelper::matchesRegularExpression is changed to be a wrapper around a new function containing the previous code, caching its result. This should hopefully reduce the number of requests to the query service. Currently, there are 1786 format constraints defined on Wikidata, for a total of 77,862,938 format constraint checks on statements. This was determined with a script that may be found in paste P5921, and does not include the statement count for the property P2093 (author name string), which cannot be counted on WDQS. According to SQID, there are 24,150,684 statements for that property [1], so the total count is approximately one hundred million format check results which might be cached. (However, most of these checks will probably never be performed since the corresponding items are rarely visited, and the set of checks that are performed frequently is likely much smaller.) To avoid putting arbitrary user input into the cache key, both regex and text are hashed. If desired, the hash for the regex can be “reversed” with a WDQS query like the following: SELECT ?property ?regex WHERE { ?property p:P2302 [ ps:P2302 wd:Q21502404; pq:P1793 ?regex ]. FILTER(SHA256(?regex) = "...") } When the property is known, the hash for the value can similarly be “reversed”, as long as the property doesn’t have too many statements and isn’t a “Commons link” property (those map to URIs on the query service). [1]: https://tools.wmflabs.org/sqid/#/view?id=P2093 Bug: T173696 Change-Id: Iaaac950b483aaff83aa13b9f1b7d5090cd6c627f --- M includes/ConstraintCheck/Helper/SparqlHelper.php M includes/ConstraintReportFactory.php M tests/phpunit/Helper/SparqlHelperTest.php 3 files changed, 103 insertions(+), 11 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved Krinkle: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/ConstraintCheck/Helper/SparqlHelper.php b/includes/ConstraintCheck/Helper/SparqlHelper.php index 13400b4..5bb6e48 100644 --- a/includes/ConstraintCheck/Helper/SparqlHelper.php +++ b/includes/ConstraintCheck/Helper/SparqlHelper.php @@ -6,6 +6,7 @@ use IBufferingStatsdDataFactory; use MediaWiki\MediaWikiServices; use MWHttpRequest; +use WANObjectCache; use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\EntityIdParsingException; use Wikibase\DataModel\Statement\Statement; @@ -43,6 +44,11 @@ private $entityIdParser; /** +* @var WANObjectCache +*/ + private $cache; + + /** * @var IBufferingStatsdDataFactory */ private $dataFactory; @@ -50,10 +56,12 @@ public function __construct( Config $config, RdfVocabulary $rdfVocabulary, - EntityIdParser $entityIdParser + EntityIdParser $entityIdParser, + WANObjectCache $cache ) { $this->config = $config; $this->entityIdParser = $entityIdParser; + $this->cache = $cache; $this->entityPrefix = $rdfVocabulary->getNamespaceUri( RdfVocabulary::NS_ENTITY ); $this->prefixes = <getWithSetCallback( + $this->cache->makeKey( + 'WikibaseQualityConstraints', // extension + 'regex', // action + 'WDQS-Java', // regex flavor + hash( 'sha256', $regex ), + hash( 'sha256', $text ) + ), + WANObjectCache::TTL_DAY, + function() use ( $text, $regex ) { + $this->dataFactory->increment( 'wikibase.quality.constraints.regex.cachemiss' ); + // convert to int because boolean false is interpreted as value not found + return (int)$this->matchesRegularExpressionWithSparql( $text, $regex ); + }, + [ + // avoid querying cache servers multiple times in a request + // (e. g. when checking format of a reference URL used multiple times on an entity) + 'pcTTL' => WANObjectCache::TTL_PROC_LONG, + ] + ); + } + + /** +* This function is only public for testing purposes; +* use matchesRegularExpression, which is equivalent but caches results. +* +* @param string $text +* @param string $regex +* @return boolean +* @throws
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: PayPal country code mapping
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379697 ) Change subject: PayPal country code mapping .. PayPal country code mapping Only unstaging, as we don't seem to send them country code for anything Bug: T176450 Change-Id: I97bf94742a0830776189f8097455ab2b74d740d0 --- M extension.json A paypal_gateway/PayPalCountry.php M paypal_gateway/express_checkout/config/transformers.yaml M tests/phpunit/Adapter/PayPal/PayPalExpressTest.php A tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_C2.testresponse 5 files changed, 45 insertions(+), 0 deletions(-) Approvals: Mepps: Looks good to me, but someone else must approve XenoRyet: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index 760c469..c434e14 100644 --- a/extension.json +++ b/extension.json @@ -146,6 +146,7 @@ "AstroPaySignature": "astropay_gateway/AstroPaySignature.php", "DummyFiscalNumber": "astropay_gateway/DummyFiscalNumber.php", "CleanupRecurringLength": "paypal_gateway/CleanupRecurringLength.php", + "PayPalCountry": "paypal_gateway/PayPalCountry.php", "PaypalExpressAdapter": "paypal_gateway/express_checkout/paypal_express.adapter.php", "PaypalExpressGateway": "paypal_gateway/express_checkout/paypal_express_gateway.body.php", "PaypalExpressGatewayResult": "paypal_gateway/express_checkout/paypal_express_resultswitcher.body.php", diff --git a/paypal_gateway/PayPalCountry.php b/paypal_gateway/PayPalCountry.php new file mode 100644 index 000..dd8f713 --- /dev/null +++ b/paypal_gateway/PayPalCountry.php @@ -0,0 +1,18 @@ +gatewayAdapter->shouldRectifyOrphan(); $this->assertEquals( $result, true, 'shouldRectifyOrphan returning false.' ); } + + /** +* We should take the country from the donor info response, and transform +* it into a real code if it's a PayPal bogon. +*/ + public function testUnstageCountry() { + $init = $this->getDonorTestData( 'US' ); + TestingPaypalExpressAdapter::setDummyGatewayResponseCode( [ 'C2', 'OK' ] ); + $init['contribution_tracking_id'] = '45931210'; + $init['gateway_session_id'] = mt_rand(); + $init['language'] = 'pt'; + $session = array( 'Donor' => $init ); + + $request = array( + 'token' => $init['gateway_session_id'], + 'PayerID' => 'ASdASDAS', + 'language' => $init['language'] // FIXME: mashing up request vars and other stuff in verifyFormOutput + ); + $this->setUpRequest( $request, $session ); + $gateway = $this->getFreshGatewayObject( $init ); + $gateway->processDonorReturn( $request ); + $savedCountry = $gateway->getData_Unstaged_Escaped( 'country' ); + $this->assertEquals( 'CN', $savedCountry ); + } } diff --git a/tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_C2.testresponse b/tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_C2.testresponse new file mode 100644 index 000..040a97d --- /dev/null +++ b/tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_C2.testresponse @@ -0,0 +1 @@ +TOKEN=EC%2d4V987654XA123456V=0=PaymentActionNotInitiated=2017%2d02%2d01T20%3a07%3a14Z=d70c9a334455e=Success=204=28806785=donor%40generous%2enet=8R297FE87CD8S=unverified=Fezziwig=Fowl=C2=Fezziwig%20Fowl=123%20Notta%20Way=Whoville=OR=97211=US=United%20States=PayPal=Confirmed=USD=1%2e55=1%2e55=0=0=0=45931210=Donation%20to%20the%20Wikimedia%20Foundation=45931210%2e1=http%3a%2f%2ffundraising%2ewikimedia%2eorg%2fIPNListener_Standalone%2ephp=0=0=false_QTY0=1_TAXAMT0=0_AMT0=1%2e55_DESC0=Donation%20to%20the%20Wikimedia%20Foundation_0_CURRENCYCODE=USD_0_AMT=1%2e55_0_ITEMAMT=1%2e55_0_SHIPPINGAMT=0_0_HANDLINGAMT=0_0_TAXAMT=0_0_CUSTOM=45931210_0_DESC=Donation%20to%20the%20Wikimedia%20Foundation_0_INVNUM=45931210%2e1_0_NOTIFYURL=http%3a%2f%2ffundraising%2ewikimedia%2eorg%2fIPNListener_Standalone%2ephp_0_INSURANCEAMT=0_0_SHIPDISCAMT=0_0_SELLERPAYPALACCOUNTID=receiver%40wikimedia%2eorg_0_INSURANCEOPTIONOFFERED=false_0_ADDRESSSTATUS=Confirmed_PAYMENTREQUEST_0_QTY0=1_PAYMENTREQUEST_0_TAXAMT0=0_PAYMENTREQUEST_0_AMT0=1%2e55_PAYMENTREQUEST_0_DESC0=Donation%20to%20the%20Wikimedia%20Foundation_0_ERRORCODE=0 -- To view, visit https://gerrit.wikimedia.org/r/379697 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I97bf94742a0830776189f8097455ab2b74d740d0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: AndyRussG
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Allow two-queue style insertion in MapCacheLRU
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379785 ) Change subject: Allow two-queue style insertion in MapCacheLRU .. Allow two-queue style insertion in MapCacheLRU Change-Id: I1cd98ea8965b51e43371efd990fb9302bb507928 --- M includes/libs/MapCacheLRU.php A tests/phpunit/includes/libs/MapCacheLRUTest.php 2 files changed, 156 insertions(+), 4 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/MapCacheLRU.php b/includes/libs/MapCacheLRU.php index c92769f..553315f 100644 --- a/includes/libs/MapCacheLRU.php +++ b/includes/libs/MapCacheLRU.php @@ -49,15 +49,44 @@ } /** +* @param array $values Key/value map in order of increasingly recent access +* @param int $maxKeys +* @return MapCacheLRU +* @since 1.30 +*/ + public static function newFromArray( array $values, $maxKeys ) { + $mapCache = new self( $maxKeys ); + $mapCache->cache = ( count( $values ) > $maxKeys ) + ? array_slice( $values, -$maxKeys, null, true ) + : $values; + + return $mapCache; + } + + /** +* @return array Key/value map in order of increasingly recent access +* @since 1.30 +*/ + public function toArray() { + return $this->cache; + } + + /** * Set a key/value pair. * This will prune the cache if it gets too large based on LRU. * If the item is already set, it will be pushed to the top of the cache. * +* To reduce evictions due to one-off use of many new keys, $rank can be +* set to have keys start at the top of a bottom fraction of the list. A value +* of 3/8 means values start at the top of the bottom 3/8s of the list and are +* moved to the top of the list when accessed a second time. +* * @param string $key * @param mixed $value +* @param float $rank Bottom fraction of the list where keys start off [Default: 1.0] * @return void */ - public function set( $key, $value ) { + public function set( $key, $value, $rank = 1.0 ) { if ( $this->has( $key ) ) { $this->ping( $key ); } elseif ( count( $this->cache ) >= $this->maxCacheKeys ) { @@ -65,7 +94,15 @@ $evictKey = key( $this->cache ); unset( $this->cache[$evictKey] ); } - $this->cache[$key] = $value; + + if ( $rank < 1.0 && $rank > 0 ) { + $offset = intval( $rank * count( $this->cache ) ); + $this->cache = array_slice( $this->cache, 0, $offset, true ) + + [ $key => $value ] + + array_slice( $this->cache, $offset, null, true ); + } else { + $this->cache[$key] = $value; + } } /** @@ -116,15 +153,16 @@ * @since 1.28 * @param string $key * @param callable $callback Callback that will produce the value +* @param float $rank Bottom fraction of the list where keys start off [Default: 1.0] * @return mixed The cached value if found or the result of $callback otherwise */ - public function getWithSetCallback( $key, callable $callback ) { + public function getWithSetCallback( $key, callable $callback, $rank = 1.0 ) { if ( $this->has( $key ) ) { $value = $this->get( $key ); } else { $value = call_user_func( $callback ); if ( $value !== false ) { - $this->set( $key, $value ); + $this->set( $key, $value, $rank ); } } diff --git a/tests/phpunit/includes/libs/MapCacheLRUTest.php b/tests/phpunit/includes/libs/MapCacheLRUTest.php new file mode 100644 index 000..60a5057 --- /dev/null +++ b/tests/phpunit/includes/libs/MapCacheLRUTest.php @@ -0,0 +1,114 @@ + 4, 'c' => 3, 'b' => 2, 'a' => 1 ]; + $cache = MapCacheLRU::newFromArray( $raw, 3 ); + + $this->assertSame( true, $cache->has( 'a' ) ); + $this->assertSame( true, $cache->has( 'b' ) ); + $this->assertSame( true, $cache->has( 'c' ) ); + $this->assertSame( 1, $cache->get( 'a' ) ); + $this->assertSame( 2, $cache->get( 'b' ) ); + $this->assertSame( 3, $cache->get( 'c' ) ); + + $this->assertSame( + [ 'a' => 1, 'b' => 2, 'c' => 3 ], + $cache->toArray() + ); +
[MediaWiki-commits] [Gerrit] operations/puppet[production]: install: let gerrit2001 use stretch installer
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380656 ) Change subject: install: let gerrit2001 use stretch installer .. install: let gerrit2001 use stretch installer Bug: T168562 Change-Id: If404cbcc20f2fc58e2bcafb10b726026fbd59256 --- M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Paladox: Looks good to me, but someone else must approve jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 index 3ebfe65..92fba3d 100644 --- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 +++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 @@ -2441,6 +2441,8 @@ host gerrit2001 { hardware ethernet 14:18:77:5B:0D:7E; fixed-address gerrit2001.wikimedia.org; +option pxelinux.pathprefix "stretch-installer/"; +filename "stretch-installer/debian-installer/amd64/pxelinux.0"; } host graphite1001 { -- To view, visit https://gerrit.wikimedia.org/r/380656 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If404cbcc20f2fc58e2bcafb10b726026fbd59256 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DzahnGerrit-Reviewer: Dzahn Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: install: let gerrit2001 use stretch installer
Dzahn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380656 ) Change subject: install: let gerrit2001 use stretch installer .. install: let gerrit2001 use stretch installer Bug: T168562 Change-Id: If404cbcc20f2fc58e2bcafb10b726026fbd59256 --- M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/56/380656/1 diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 index 3ebfe65..92fba3d 100644 --- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 +++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 @@ -2441,6 +2441,8 @@ host gerrit2001 { hardware ethernet 14:18:77:5B:0D:7E; fixed-address gerrit2001.wikimedia.org; +option pxelinux.pathprefix "stretch-installer/"; +filename "stretch-installer/debian-installer/amd64/pxelinux.0"; } host graphite1001 { -- To view, visit https://gerrit.wikimedia.org/r/380656 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If404cbcc20f2fc58e2bcafb10b726026fbd59256 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Give thumbor swift user r/w access to containers
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/376251 ) Change subject: Give thumbor swift user r/w access to containers .. Give thumbor swift user r/w access to containers readUsers and writeUsers are new optional values of the swift backend configuration. They allow giving read and/or write rights to additional users than the default swift user. Bug: T144479 Change-Id: I0f81a013ec994eee3f156a89f29f4fcfc37c42b7 --- M includes/libs/filebackend/SwiftFileBackend.php 1 file changed, 32 insertions(+), 14 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/filebackend/SwiftFileBackend.php b/includes/libs/filebackend/SwiftFileBackend.php index de5a103..4212ff5 100644 --- a/includes/libs/filebackend/SwiftFileBackend.php +++ b/includes/libs/filebackend/SwiftFileBackend.php @@ -50,6 +50,10 @@ protected $rgwS3AccessKey; /** @var string S3 authentication key (RADOS Gateway) */ protected $rgwS3SecretKey; + /** @var array Additional users (account:user) to open read permissions for */ + protected $readUsers; + /** @var array Additional users (account:user) to open write permissions for */ + protected $writeUsers; /** @var BagOStuff */ protected $srvCache; @@ -96,6 +100,8 @@ * This is used for generating expiring pre-authenticated URLs. * Only use this when using rgw and to work around * http://tracker.newdream.net/issues/3454. +* - readUsers : Swift users that should have read access (account:username) +* - writeUsers : Swift users that should have write access (account:username) */ public function __construct( array $config ) { parent::__construct( $config ); @@ -136,6 +142,12 @@ } else { $this->srvCache = new EmptyBagOStuff(); } + $this->readUsers = isset( $config['readUsers'] ) + ? $config['readUsers'] + : []; + $this->writeUsers = isset( $config['writeUsers'] ) + ? $config['writeUsers'] + : []; } public function getFeatures() { @@ -590,11 +602,13 @@ $stat = $this->getContainerStat( $fullCont ); if ( is_array( $stat ) ) { + $readUsers = array_merge( $this->readUsers, [ $this->swiftUser ] ); + $writeUsers = array_merge( $this->writeUsers, [ $this->swiftUser ] ); // Make container private to end-users... $status->merge( $this->setContainerAccess( $fullCont, - [ $this->swiftUser ], // read - [ $this->swiftUser ] // write + $readUsers, + $writeUsers ) ); } elseif ( $stat === false ) { $status->fatal( 'backend-fail-usable', $params['dir'] ); @@ -611,11 +625,14 @@ $stat = $this->getContainerStat( $fullCont ); if ( is_array( $stat ) ) { + $readUsers = array_merge( $this->readUsers, [ $this->swiftUser, '.r:*' ] ); + $writeUsers = array_merge( $this->writeUsers, [ $this->swiftUser ] ); + // Make container public to end-users... $status->merge( $this->setContainerAccess( $fullCont, - [ $this->swiftUser, '.r:*' ], // read - [ $this->swiftUser ] // write + $readUsers, + $writeUsers ) ); } elseif ( $stat === false ) { $status->fatal( 'backend-fail-usable', $params['dir'] ); @@ -1309,7 +1326,7 @@ * (lists are truncated to 1 item with no way to page), and is just a performance risk. * * @param string $container Resolved Swift container -* @param array $readGrps List of the possible criteria for a request to have +* @param array $readUsers List of the possible criteria for a request to have * access to read a container. Each item is one of the following formats: * - account:user: Grants access if the request is by the given user * - ".r:": Grants access if the request is from a referrer host that @@ -1317,12 +1334,12 @@ * Setting this to '*' effectively makes a container public. * -".rlistings:" :
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Log performance data
Catrope has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380655 ) Change subject: RCFilters: Log performance data .. RCFilters: Log performance data Just UI ready time and wgBackendResponseTime for now. Sanitizing responseStart and especially firstPaint cross-browser is too messy. NavigationTiming has code for it but that would need to be exposed somewhere. Bug: T176652 Change-Id: I6caf52fe8bc77fac0426d73549553301c5951c32 --- M resources/src/mediawiki.rcfilters/mw.rcfilters.init.js 1 file changed, 16 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/55/380655/1 diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js index 5ab32ea..73259f6 100644 --- a/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js +++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.init.js @@ -29,9 +29,7 @@ savedLinksListWidget = new mw.rcfilters.ui.SavedLinksListWidget( controller, savedQueriesModel, { $overlay: $overlay } ), - currentPage = mw.config.get( 'wgCanonicalNamespace' ) + - ':' + - mw.config.get( 'wgCanonicalSpecialPageName' ); + specialPage = mw.config.get( 'wgCanonicalSpecialPageName' ); // TODO: The changesListWrapperWidget should be able to initialize // after the model is ready. @@ -66,8 +64,8 @@ controller.replaceUrl(); - if ( currentPage === 'Special:Recentchanges' || - currentPage === 'Special:Recentchangeslinked' ) { + if ( specialPage === 'Recentchanges' || + specialPage === 'Recentchangeslinked' ) { $topLinks = $( '.mw-recentchanges-toplinks' ).detach(); rcTopSection = new mw.rcfilters.ui.RcTopSectionWidget( @@ -76,7 +74,7 @@ filtersWidget.setTopSection( rcTopSection.$element ); } // end Special:RC - if ( currentPage === 'Special:Watchlist' ) { + if ( specialPage === 'Watchlist' ) { $( '#contentSub, form#mw-watchlist-resetbutton' ).detach(); $watchlistDetails = $( '.watchlistDetails' ).detach().contents(); @@ -86,6 +84,18 @@ filtersWidget.setTopSection( wlTopSection.$element ); } // end Special:WL + // Log performance data + if ( window.performance && window.performance.now ) { + mw.track( + 'timing.MediaWiki.timing.structuredChangeFilters.ready.' + specialPage, + window.performance.now() + ); + mw.track( + 'timing.MediaWiki.timing.structuredChangeFilters.backendResponse.' + specialPage, + mw.config.get( 'wgBackendResponseTime' ) + ); + } + /** * Fired when initialization of the filtering interface for changes list is complete. * -- To view, visit https://gerrit.wikimedia.org/r/380655 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6caf52fe8bc77fac0426d73549553301c5951c32 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Catrope___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikispeech[master]: Add specialpage alias for WikispeechLexiconTool
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379997 ) Change subject: Add specialpage alias for WikispeechLexiconTool .. Add specialpage alias for WikispeechLexiconTool Follow-Up: I3a43633ae500af49d7ef3a05fef97ab2c55df0f4 Change-Id: I8406e4309a7040af2f62cf352c245a54c2b2e943 --- M Wikispeech.alias.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/Wikispeech.alias.php b/Wikispeech.alias.php index b0fc561..e2dbf56 100644 --- a/Wikispeech.alias.php +++ b/Wikispeech.alias.php @@ -9,4 +9,5 @@ /** English (English) */ $specialPageAliases['en'] = array( 'Wikispeech' => array( 'Wikispeech' ), + 'WikispeechLexiconTool' => array( 'WikispeechLexiconTool' ), ); -- To view, visit https://gerrit.wikimedia.org/r/379997 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8406e4309a7040af2f62cf352c245a54c2b2e943 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikispeech Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Jforrester Gerrit-Reviewer: Lokal Profil Gerrit-Reviewer: Sebastian Berlin (WMSE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Improve some parameter docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380325 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: Ie75e6f6c05217f8da32c70522d23275b70d95cee --- M ApiQueryVideoInfo.php M ApiTranscodeReset.php M ApiTranscodeStatus.php M SpecialOrphanedTimedText.php M SpecialTimedMediaHandler.php M TimedMediaHandler.hooks.php M TimedMediaHandler_body.php M TimedMediaIframeOutput.php M TimedMediaThumbnail.php M TimedMediaTransformOutput.php M TimedTextPage.php M TranscodeStatusTable.php M WebVideoTranscode/WebVideoTranscode.php M WebVideoTranscode/WebVideoTranscodeJob.php M handlers/FLACHandler/FLACHandler.php M handlers/ID3Handler/ID3Handler.php M handlers/Mp3Handler/Mp3Handler.php M handlers/Mp4Handler/Mp4Handler.php M handlers/OggHandler/OggHandler.php M handlers/TextHandler/TextHandler.php M handlers/WAVHandler/WAVHandler.php M handlers/WebMHandler/WebMHandler.php M phpcs.xml M tests/phpunit/TestOggHandler.php M tests/phpunit/TestTimedMediaHandler.php M tests/phpunit/TestTimedMediaTransformOutput.php M tests/phpunit/TestWebMHandler.php 27 files changed, 265 insertions(+), 244 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/ApiQueryVideoInfo.php b/ApiQueryVideoInfo.php index 72a17b3..0acf987 100644 --- a/ApiQueryVideoInfo.php +++ b/ApiQueryVideoInfo.php @@ -58,6 +58,7 @@ /** * @see ApiBase::getExamplesMessages() +* @return array */ protected function getExamplesMessages() { return [ diff --git a/ApiTranscodeReset.php b/ApiTranscodeReset.php index 9a0e05b..7fa1037 100644 --- a/ApiTranscodeReset.php +++ b/ApiTranscodeReset.php @@ -110,8 +110,8 @@ } /** -* @param $file -* @param $transcodeKey +* @param File $file +* @param string|bool $transcodeKey * @return int|string */ public static function checkTimeSinceLastRest( $file, $transcodeKey ) { @@ -137,7 +137,7 @@ } /** -* @param $state +* @param array $state * @return int|string */ public static function getStateResetTime( $state ) { @@ -218,6 +218,7 @@ /** * @see ApiBase::getExamplesMessages() +* @return array */ protected function getExamplesMessages() { // @codingStandardsIgnoreStart diff --git a/ApiTranscodeStatus.php b/ApiTranscodeStatus.php index 59a352a..88052ee 100644 --- a/ApiTranscodeStatus.php +++ b/ApiTranscodeStatus.php @@ -66,6 +66,7 @@ /** * @see ApiBase::getExamplesMessages() +* @return array */ protected function getExamplesMessages() { return [ diff --git a/SpecialOrphanedTimedText.php b/SpecialOrphanedTimedText.php index d651a74..00153f4 100644 --- a/SpecialOrphanedTimedText.php +++ b/SpecialOrphanedTimedText.php @@ -23,6 +23,7 @@ /** * This is alphabetical, so sort ascending. +* @return bool */ public function sortDescending() { return false; @@ -33,6 +34,7 @@ * * This query is actually almost cheap given the current * number of things in TimedText namespace. +* @return bool */ public function isExpensive() { return true; @@ -41,7 +43,7 @@ /** * Main execution function * -* @param $par String subpage +* @param string $par subpage */ public function execute( $par ) { global $wgEnableLocalTimedText; @@ -165,6 +167,7 @@ * * Given a title like "TimedText:Some bit here.webm.en.srt" * check to see if "File:Some bit here.webm" really exists (locally). +* @param Title $title * @return bool True if we should cross out the line. */ protected function existenceCheck( Title $title ) { @@ -205,8 +208,8 @@ /** * Preprocess result to do existence checks all at once. * -* @param $db Database -* @param $res ResultWraper +* @param Database $db +* @param ResultWraper $res */ public function preprocessResults( $db, $res ) { parent::preprocessResults( $db, $res ); diff --git a/SpecialTimedMediaHandler.php b/SpecialTimedMediaHandler.php index 99a3b67..22a2fb3 100644 --- a/SpecialTimedMediaHandler.php +++ b/SpecialTimedMediaHandler.php @@ -69,8 +69,8 @@ /** * @param OutputPage $out -* @param $state -* @param $states +* @param string $state +* @param array $states * @param bool $showTable */ private function renderState( $out, $state, $states, $showTable = true ) { diff --git a/TimedMediaHandler.hooks.php
[MediaWiki-commits] [Gerrit] mediawiki...FileImporter[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380651 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I62f4bd6d3d4d0059b701ab5078bfb193c16d84a8 --- M composer.json M src/Exceptions/SourceUrlException.php M src/Html/WikiTextEditor.php M src/Remote/MediaWiki/RemoteApiImportTitleChecker.php M src/Services/DuplicateFileRevisionChecker.php M src/Services/Importer.php M src/Services/WikiRevisionFactory.php M src/SpecialImportFile.php M tests/phan/config.php 9 files changed, 1 insertion(+), 12 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/composer.json b/composer.json index 6d8c82e..c5ef5fc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { diff --git a/src/Exceptions/SourceUrlException.php b/src/Exceptions/SourceUrlException.php index 1c10f88..c248c2d 100644 --- a/src/Exceptions/SourceUrlException.php +++ b/src/Exceptions/SourceUrlException.php @@ -2,8 +2,6 @@ namespace FileImporter\Exceptions; -use RuntimeException; - /** * Thrown in cases that the SourceUrl is not deemed to be acceptable. */ diff --git a/src/Html/WikiTextEditor.php b/src/Html/WikiTextEditor.php index b36339a..3353610 100644 --- a/src/Html/WikiTextEditor.php +++ b/src/Html/WikiTextEditor.php @@ -5,7 +5,6 @@ use EditPage; use Html; use SpecialPage; -use StringUtils; class WikiTextEditor { diff --git a/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php b/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php index 3da4012..9a6a047 100644 --- a/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php +++ b/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php @@ -6,7 +6,6 @@ use FileImporter\Exceptions\HttpRequestException; use FileImporter\Exceptions\ImportException; use FileImporter\Interfaces\ImportTitleChecker; -use FileImporter\Remote\MediaWiki\HttpApiLookup; use FileImporter\Services\Http\HttpRequestExecutor; class RemoteApiImportTitleChecker implements ImportTitleChecker { diff --git a/src/Services/DuplicateFileRevisionChecker.php b/src/Services/DuplicateFileRevisionChecker.php index 12ce292..9dc2de7 100644 --- a/src/Services/DuplicateFileRevisionChecker.php +++ b/src/Services/DuplicateFileRevisionChecker.php @@ -5,7 +5,6 @@ use File; use FileImporter\Data\FileRevision; use LocalRepo; -use Wikimedia\Assert\Assert; /** * Class that can be used to check if a FileRevision already exists on the current wiki. diff --git a/src/Services/Importer.php b/src/Services/Importer.php index c697504..4308c9e 100644 --- a/src/Services/Importer.php +++ b/src/Services/Importer.php @@ -12,7 +12,6 @@ use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; -use Revision; use RuntimeException; use Title; use User; diff --git a/src/Services/WikiRevisionFactory.php b/src/Services/WikiRevisionFactory.php index ae732e9..9844b4b 100644 --- a/src/Services/WikiRevisionFactory.php +++ b/src/Services/WikiRevisionFactory.php @@ -5,7 +5,6 @@ use Config; use FileImporter\Data\FileRevision; use FileImporter\Data\TextRevision; -use InvalidArgumentException; use Title; use WikiRevision; diff --git a/src/SpecialImportFile.php b/src/SpecialImportFile.php index 5da354b..7693731 100644 --- a/src/SpecialImportFile.php +++ b/src/SpecialImportFile.php @@ -17,7 +17,6 @@ use FileImporter\Html\ImportSuccessPage; use FileImporter\Html\InputFormPage; use FileImporter\Html\RecoverableTitleExceptionPage; -use FileImporter\Services\DuplicateFileRevisionChecker; use FileImporter\Services\Importer; use FileImporter\Services\ImportPlanFactory; use FileImporter\Services\SourceSiteLocator; @@ -27,7 +26,6 @@ use Message; use PermissionsError; use SpecialPage; -use StringUtils; use UploadBase; use User; use UserBlockedError; diff --git a/tests/phan/config.php b/tests/phan/config.php index 5d61e6d..7872155 100644 --- a/tests/phan/config.php +++ b/tests/phan/config.php @@ -1,7 +1,5 @@ https://gerrit.wikimedia.org/r/380651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62f4bd6d3d4d0059b701ab5078bfb193c16d84a8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FileImporter Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Addshore Gerrit-Reviewer: Andrew-WMDE Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Tobias Gritschacher
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Also set toplinks-collapsed class if no cookie
Catrope has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380654 ) Change subject: RCFilters: Also set toplinks-collapsed class if no cookie .. RCFilters: Also set toplinks-collapsed class if no cookie If the cookie was not set, the PHP code treated that as "expanded", but the JS code treated it as "collapsed". Fix the PHP code. Bug: T176380 Change-Id: Iff9b865bd20a571ade2ae619cbb5b3a70629003c --- M includes/specials/SpecialRecentchanges.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/54/380654/1 diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 34a7714..8c2dd56 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -658,7 +658,8 @@ if ( $this->isStructuredFilterUiEnabled() ) { // Check whether the widget is already collapsed or expanded $collapsedState = $this->getRequest()->getCookie( 'rcfilters-toplinks-collapsed-state' ); - $collapsedClass = $collapsedState === 'collapsed' ? 'mw-rcfilters-toplinks-collapsed' : ''; + // Note that an empty/unset cookie means collapsed, so check for !== 'expanded' + $collapsedClass = $collapsedState !== 'expanded' ? 'mw-rcfilters-toplinks-collapsed' : ''; $contentTitle = Html::rawElement( 'div', [ 'class' => 'mw-recentchanges-toplinks-title ' . $collapsedClass ], -- To view, visit https://gerrit.wikimedia.org/r/380654 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff9b865bd20a571ade2ae619cbb5b3a70629003c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Catrope___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...cumin[master]: OpenStack: limit grammar to not overlap the global one
Volans has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380653 ) Change subject: OpenStack: limit grammar to not overlap the global one .. OpenStack: limit grammar to not overlap the global one * In order to not overlap with the global grammar syntax for the aliases, limit the openstack grammar keys to lower case letters and at least length two carachters. Change-Id: I725943233c8396ebb2a2b0004064adb150b9905d --- M cumin/backends/openstack.py M cumin/tests/fixtures/backends/grammars/openstack_invalid.txt M cumin/tests/fixtures/backends/grammars/openstack_valid.txt 3 files changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/cumin refs/changes/53/380653/1 diff --git a/cumin/backends/openstack.py b/cumin/backends/openstack.py index c48bca5..2ee9426 100644 --- a/cumin/backends/openstack.py +++ b/cumin/backends/openstack.py @@ -34,8 +34,8 @@ quoted_string = pp.quotedString.copy().addParseAction(pp.removeQuotes) # Both single and double quotes are allowed # Key-value tokens: key:value -# All printables characters except the parentheses that are part of this or the global grammar -key = pp.Word(pp.alphanums + '-_.')('key') +# Lowercase key, all printable characters except the parentheses that are part of the global grammar for the value +key = pp.Word(pp.srange('[a-z0-9-_.]"'), min=2)('key') all_but_par = ''.join([c for c in pp.printables if c not in ('(', ')', '{', '}')]) value = (quoted_string | pp.Word(all_but_par))('value') item = pp.Combine(key + ':' + value) diff --git a/cumin/tests/fixtures/backends/grammars/openstack_invalid.txt b/cumin/tests/fixtures/backends/grammars/openstack_invalid.txt index 2c6cc72..4468c10 100644 --- a/cumin/tests/fixtures/backends/grammars/openstack_invalid.txt +++ b/cumin/tests/fixtures/backends/grammars/openstack_invalid.txt @@ -4,3 +4,8 @@ key:value :value "key":value key%:value +A:value +a:value +KEY:value +Key:value +kEy:value diff --git a/cumin/tests/fixtures/backends/grammars/openstack_valid.txt b/cumin/tests/fixtures/backends/grammars/openstack_valid.txt index f4b3d01..a4f7a76 100644 --- a/cumin/tests/fixtures/backends/grammars/openstack_valid.txt +++ b/cumin/tests/fixtures/backends/grammars/openstack_valid.txt @@ -8,3 +8,4 @@ project:"Project Name" project:project_name name:host1 project:"Project Name" name:host1 +ip:value -- To view, visit https://gerrit.wikimedia.org/r/380653 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I725943233c8396ebb2a2b0004064adb150b9905d Gerrit-PatchSet: 1 Gerrit-Project: operations/software/cumin Gerrit-Branch: master Gerrit-Owner: Volans___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ConfirmEdit[master]: Improve some parameter docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/376911 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: Idce2db0b489c19ec9b936cfc4ced3792e6f9711d --- M FancyCaptcha/ApiFancyCaptchaReload.php M FancyCaptcha/FancyCaptcha.class.php M MathCaptcha/MathCaptcha.class.php M QuestyCaptcha/QuestyCaptcha.class.php M ReCaptcha/ReCaptcha.class.php M ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.class.php M SimpleCaptcha/Captcha.php M includes/CaptchaStore.php M includes/ConfirmEditHooks.php M phpcs.xml 10 files changed, 81 insertions(+), 74 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/FancyCaptcha/ApiFancyCaptchaReload.php b/FancyCaptcha/ApiFancyCaptchaReload.php index d53d7ba..f3e0d11 100644 --- a/FancyCaptcha/ApiFancyCaptchaReload.php +++ b/FancyCaptcha/ApiFancyCaptchaReload.php @@ -23,6 +23,7 @@ /** * @see ApiBase::getExamplesMessages() +* @return array */ protected function getExamplesMessages() { return [ diff --git a/FancyCaptcha/FancyCaptcha.class.php b/FancyCaptcha/FancyCaptcha.class.php index a875254..c2477bf 100644 --- a/FancyCaptcha/FancyCaptcha.class.php +++ b/FancyCaptcha/FancyCaptcha.class.php @@ -81,7 +81,7 @@ } /** -* @param array $resultArr +* @param array &$resultArr */ function addCaptchaAPI( &$resultArr ) { $info = $this->pickImage(); @@ -198,9 +198,9 @@ } /** -* @param $directory string -* @param $levels integer -* @param $lockouts integer +* @param string $directory +* @param int $levels +* @param int &$lockouts * @return array|bool */ protected function pickImageDir( $directory, $levels, &$lockouts ) { @@ -251,8 +251,8 @@ } /** -* @param $directory string -* @param $lockouts integer +* @param string $directory +* @param int &$lockouts * @return array|bool */ protected function pickImageFromDir( $directory, &$lockouts ) { @@ -293,9 +293,9 @@ } /** -* @param $directory string -* @param $files array -* @param $lockouts integer +* @param string $directory +* @param array $files +* @param int &$lockouts * @return array|bool */ protected function pickImageFromList( $directory, array $files, &$lockouts ) { @@ -365,8 +365,8 @@ } /** -* @param $salt string -* @param $hash string +* @param string $salt +* @param string $hash * @return string */ public function imagePath( $salt, $hash ) { @@ -382,7 +382,7 @@ } /** -* @param $basename string +* @param string $basename * @return array (salt, hash) * @throws Exception */ @@ -440,7 +440,7 @@ /** * @param array $requests * @param array $fieldInfo -* @param array $formDescriptor +* @param array &$formDescriptor * @param string $action */ public function onAuthChangeFormFields( diff --git a/MathCaptcha/MathCaptcha.class.php b/MathCaptcha/MathCaptcha.class.php index 4ee178d..0c7dee0 100644 --- a/MathCaptcha/MathCaptcha.class.php +++ b/MathCaptcha/MathCaptcha.class.php @@ -15,7 +15,7 @@ } /** -* @param array $resultArr +* @param array &$resultArr */ function addCaptchaAPI( &$resultArr ) { list( $sum, $answer ) = $this->pickSum(); @@ -54,7 +54,10 @@ return [ 'html' => $form ]; } - /** Pick a random sum */ + /** +* Pick a random sum +* @return array +*/ function pickSum() { $a = mt_rand( 0, 100 ); $b = mt_rand( 0, 10 ); @@ -64,7 +67,11 @@ return [ $sum, $ans ]; } - /** Fetch the math */ + /** +* Fetch the math +* @param int $sum +* @return string +*/ function fetchMath( $sum ) { if ( class_exists( 'MathRenderer' ) ) { $math = MathRenderer::getRenderer( $sum, [], 'png' ); @@ -98,7 +105,7 @@ /** * @param array $requests * @param array $fieldInfo -* @param array $formDescriptor +* @param array &$formDescriptor * @param string $action */ public function onAuthChangeFormFields( array $requests, array $fieldInfo, diff --git a/QuestyCaptcha/QuestyCaptcha.class.php b/QuestyCaptcha/QuestyCaptcha.class.php index adc00bc..95da102 100644 --- a/QuestyCaptcha/QuestyCaptcha.class.php +++ b/QuestyCaptcha/QuestyCaptcha.class.php @@ -30,7 +30,7 @@
[MediaWiki-commits] [Gerrit] mediawiki...ParserMigration[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380647 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I131e3014a21f8122f9a9ca5c039d315f5a5d4f4d --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/composer.json b/composer.json index 7898723..d980e06 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380647 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I131e3014a21f8122f9a9ca5c039d315f5a5d4f4d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ParserMigration Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...FileExporter[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380646 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I3267a617969062741688cf18f807164e27fe7ff1 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/composer.json b/composer.json index 6d8c82e..c5ef5fc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380646 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3267a617969062741688cf18f807164e27fe7ff1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FileExporter Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Addshore Gerrit-Reviewer: Andrew-WMDE Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Tobias Gritschacher Gerrit-Reviewer: WMDE-Fisch Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380649 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: Ieb4bd4e4e413c95f6f25d6b14234c4f9412d76d6 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/composer.json b/composer.json index e4d469b..3ec375d 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb4bd4e4e413c95f6f25d6b14234c4f9412d76d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Timeless Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...QuickSurveys[master]: Improve some parameter docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/376901 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: I5bf2f9d977ec709bf4893a8c4d990ec4b3c8bd3f --- M includes/QuickSurveys.hooks.php M phpcs.xml 2 files changed, 8 insertions(+), 9 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/includes/QuickSurveys.hooks.php b/includes/QuickSurveys.hooks.php index fcd542b..855bfdc 100644 --- a/includes/QuickSurveys.hooks.php +++ b/includes/QuickSurveys.hooks.php @@ -18,7 +18,8 @@ * Register QUnit tests. * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules * -* @param array $files +* @param array &$modules +* @param ResourceLoader &$rl * @return bool */ public static function onResourceLoaderTestModules( &$modules, &$rl ) { @@ -53,7 +54,7 @@ * ResourceLoaderGetConfigVars hook handler for registering enabled surveys * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderGetConfigVars * -* @param array $vars +* @param array &$vars * @return bool */ public static function onResourceLoaderGetConfigVars( &$vars ) { @@ -73,8 +74,8 @@ * * @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay * -* @param OutputPage $out -* @param Skin $sk +* @param OutputPage &$out +* @param Skin &$sk * @return bool */ public static function onBeforePageDisplay( OutputPage &$out, Skin &$sk ) { @@ -150,7 +151,7 @@ * If the module has already been registered in * onResourceLoaderRegisterModules, then it is overwritten. * -* @param array $schemas The schemas currently registered with the EventLogging +* @param int[] &$schemas The schemas currently registered with the EventLogging * extension * @return bool Always true */ @@ -168,7 +169,7 @@ * Adds the path to the QuickSurveys PHPUnit tests to the set of enabled * extension's test suites. * -* @param array $paths The set of paths to other extension's PHPUnit test +* @param string[] &$paths The set of paths to other extension's PHPUnit test * suites * @return bool Always true */ diff --git a/phpcs.xml b/phpcs.xml index c239426..79c20a2 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,12 +1,10 @@ + - - - . -- To view, visit https://gerrit.wikimedia.org/r/376901 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5bf2f9d977ec709bf4893a8c4d990ec4b3c8bd3f Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/QuickSurveys Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: Umherirrender Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...FileAnnotations[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380644 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: Icd0ece7b181ea02208671fa0cc38b6da180e2dfd --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/composer.json b/composer.json index 7898723..d980e06 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380644 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icd0ece7b181ea02208671fa0cc38b6da180e2dfd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FileAnnotations Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...apex[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380648 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I776b14670db3b70afa28c41c8c2211066424b609 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/composer.json b/composer.json index e4d469b..3ec375d 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380648 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I776b14670db3b70afa28c41c8c2211066424b609 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/apex Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: WDCM Usage Dashboard - Crosstabs
GoranSMilovanovic has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380652 ) Change subject: WDCM Usage Dashboard - Crosstabs .. WDCM Usage Dashboard - Crosstabs Change-Id: I1ee02278bfa7cba91b79c0c9b7d873cda949cbf1 --- M WDCM_UsageDashboard/server.R M WDCM_UsageDashboard/ui.R 2 files changed, 253 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/WDCM refs/changes/52/380652/1 diff --git a/WDCM_UsageDashboard/server.R b/WDCM_UsageDashboard/server.R index 1f40e6a..57d4b41 100644 --- a/WDCM_UsageDashboard/server.R +++ b/WDCM_UsageDashboard/server.R @@ -151,6 +151,13 @@ totalCategories <- length(wdcmCategory$Category) totalProjectTypes <- length(wdcmProjectType$`Project Type`) +### --- prepare search constants for Tabs/Crosstabs +search_projectTypes <- paste("_", projectTypes, sep = "") +unzip_projectTypes <- lapply(projectTypes, function(x) { + wdcmProject$Project[which(wdcmProject$`Project Type` %in% x)] +}) +names(unzip_projectTypes) <- search_projectTypes + ### --- shinyServer shinyServer(function(input, output, session) { @@ -531,6 +538,178 @@ return(NULL) } }) + + ### -- + ### --- TABS AND CROSSTABS + ### -- + + ### --- SELECT: update select 'selectProject' + updateSelectizeInput(session, + 'selectProject', + choices = c(projects, paste("_", projectTypes, sep="")), + selected = projects[round(runif(5, 1, length(projects)))], + server = TRUE) + + ### --- SELECT: update select 'selectCategories' + updateSelectizeInput(session, + 'selectCategories', + choices = categories, + selected = categories[round(runif(3, 1, length(categories)))], + server = TRUE) + + # - OBSERVE: input$applySelection + observeEvent(input$applySelection, { + +### --- selected projects: +selectedProjects <- character() +wUnzip <- which(names(unzip_projectTypes) %in% isolate(input$selectProject)) +if (length(wUnzip > 0)) { + selectedProjects <- unname(do.call(c, unzip_projectTypes[wUnzip])) +} +wSel <- which(projects %in% isolate(input$selectProject)) +if (length(wSel > 0)) { + selectedProjects <- c(selectedProjects, projects[wSel]) +} +selectedProjects <- unique(selectedProjects) +output$testSelectedProjects <- renderText({ + paste(selectedProjects, collapse = ", ", sep = "") +}) + +### --- selected categories: +selectedCategories <- isolate(input$selectCategories) + + --- Chart: tabulations_projectsChart +output$tabulations_projectsChart <- renderPlot({ + # - Chart Frame for output$tabulations_projectsChart + plotFrame <- wdcmProjectCategory %>% +filter(Project %in% selectedProjects & Category %in% selectedCategories) %>% +group_by(Project) %>% +summarise(Usage = sum(Usage)) %>% +arrange(desc(Usage)) + # - top 25 projects: + if (dim(plotFrame)[1] > 25) { +plotFrame <- plotFrame[1:25, ] + } + plotFrame$Project <- factor(plotFrame$Project, + levels = plotFrame$Project[order(-plotFrame$Usage)]) + # - express labels as K, M: + plotFrame$Label <- sapply(plotFrame$Usage, function(x) { +if (x >= 1e+03 & x < 1e+06) { + out <- paste(round(x/1e+03, 1), "K", sep = "") +} else if (x > 1e+06) { + out <- paste(round(x/1e+06, 1), "M", sep = "") +} else { + out <- as.character(x) +} +return(out) + }) + # - Plot + ggplot(plotFrame, + aes(x = Project, y = Usage, label = Label)) + +geom_bar(stat = "identity", width = .6, fill = "#4c8cff") + +xlab('Projects') + ylab('Entity Usage') + +ylim(0, max(plotFrame$Usage) + .1*max(plotFrame$Usage)) + +scale_y_continuous(labels = comma) + +geom_label(size = 3, vjust = -.1) + +theme_minimal() + +theme(axis.text.x = element_text(angle = 90, size = 12, hjust = 1)) + +theme(axis.title.x = element_text(size = 12)) + +theme(axis.title.y = element_text(size = 12)) + +theme(plot.title = element_text(size = 15)) %>% +withProgress(message = 'Generating plot', + min = 0, + max = 1, + value = 1, {incProgress(amount = 0)}) +}) +# - Download Frame: tabulations_projectsChart +tabulations_projectsDownload_Frame <- reactive({ + plotFrame <- wdcmProjectCategory %>% +filter(Project %in% selectedProjects & Category %in% selectedCategories) %>% +group_by(Project) %>% +summarise(Usage = sum(Usage)) %>% +arrange(desc(Usage)) +
[MediaWiki-commits] [Gerrit] mediawiki...Thanks[master]: Improve some parameter docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380329 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: I5b84aec326dad863af152e0b53dbd9f8f66e40d2 --- M ApiFlowThank.php M ApiRevThank.php M ApiThank.php M Thanks.hooks.php M phpcs.xml 5 files changed, 29 insertions(+), 32 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/ApiFlowThank.php b/ApiFlowThank.php index 81867eb..0cc1d9a 100644 --- a/ApiFlowThank.php +++ b/ApiFlowThank.php @@ -188,6 +188,7 @@ /** * @see ApiBase::getExamplesMessages() +* @return array */ protected function getExamplesMessages() { return [ diff --git a/ApiRevThank.php b/ApiRevThank.php index 102da35..23475eb 100644 --- a/ApiRevThank.php +++ b/ApiRevThank.php @@ -128,6 +128,7 @@ /** * @see ApiBase::getExamplesMessages() +* @return array */ protected function getExamplesMessages() { return [ diff --git a/ApiThank.php b/ApiThank.php index fac762e..a294f5e 100644 --- a/ApiThank.php +++ b/ApiThank.php @@ -86,8 +86,8 @@ return 'csrf'; } - // Writes to the Echo database and sometimes log tables. public function isWriteMode() { + // Writes to the Echo database and sometimes log tables. return true; } } diff --git a/Thanks.hooks.php b/Thanks.hooks.php index cf8fe9b..a55c7fb 100644 --- a/Thanks.hooks.php +++ b/Thanks.hooks.php @@ -12,8 +12,8 @@ * ResourceLoaderTestModules hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules * -* @param array $testModules -* @param ResourceLoader $resourceLoader +* @param array &$testModules +* @param ResourceLoader &$resourceLoader * @return bool */ public static function onResourceLoaderTestModules( array &$testModules, @@ -36,9 +36,10 @@ /** * Handler for HistoryRevisionTools and DiffRevisionTools hooks. * Inserts 'thank' link into revision interface -* @param $rev Revision object to add the thank link for -* @param &$links array Links to add to the revision interface -* @param $oldRev Revision object of the "old" revision when viewing a diff +* @param Revision $rev Revision object to add the thank link for +* @param array &$links Links to add to the revision interface +* @param Revision $oldRev Revision object of the "old" revision when viewing a diff +* @param User $user * @return bool */ public static function insertThankLink( $rev, &$links, $oldRev = null, User $user ) { @@ -85,8 +86,8 @@ /** * Helper for self::insertThankLink * Creates either a thank link or thanked span based on users session -* @param $rev Revision object to generate the thank element for -* @param $recipient User who receives thanks notification +* @param Revision $rev Revision object to generate the thank element for +* @param User $recipient User who receives thanks notification * @return string */ protected static function generateThankElement( $rev, $recipient ) { @@ -120,9 +121,9 @@ /** * Handler for PageHistoryBeforeList hook. * @see http://www.mediawiki.org/wiki/Manual:Hooks/PageHistoryBeforeList -* @param &$page WikiPage|Article|ImagePage|CategoryPage|Page The page for which the history +* @param WikiPage|Article|ImagePage|CategoryPage|Page &$page The page for which the history * is loading. -* @param $context RequestContext object +* @param RequestContext $context RequestContext object * @return bool true in all cases */ public static function onPageHistoryBeforeList( &$page, $context ) { @@ -141,9 +142,9 @@ /** * Handler for DiffViewHeader hook. * @see http://www.mediawiki.org/wiki/Manual:Hooks/DiffViewHeader -* @param $diff DifferenceEngine -* @param $oldRev Revision object of the "old" revision (may be null/invalid) -* @param $newRev Revision object of the "new" revision +* @param DifferenceEngine $diff +* @param Revision $oldRev Revision object of the "old" revision (may be null/invalid) +* @param Revision $newRev Revision object of the "new" revision * @return bool true in all cases */ public static function onDiffViewHeader( $diff, $oldRev, $newRev ) { @@ -162,9 +163,9 @@ /** * Add Thanks events to Echo * -* @param $notifications array of Echo notifications -* @param $notificationCategories array of Echo notification
[MediaWiki-commits] [Gerrit] mediawiki...TrustedXFF[master]: Improve some parameter docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380326 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: Ib41737bbc9f1628f99e06b970fe73c1d0fc4ea9f --- M TrustedXFF.body.php M phpcs.xml 2 files changed, 5 insertions(+), 9 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/TrustedXFF.body.php b/TrustedXFF.body.php index d9a167f..445316a 100644 --- a/TrustedXFF.body.php +++ b/TrustedXFF.body.php @@ -32,8 +32,8 @@ private static $ipv6Set; /** -* @param string $ip -* @param bool $trusted +* @param string &$ip +* @param bool &$trusted * @return bool */ public static function onIsTrustedProxy( &$ip, &$trusted ) { diff --git a/phpcs.xml b/phpcs.xml index d3d5b4f..db9d9a0 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,11 +1,9 @@ - - - - + + @@ -19,7 +17,5 @@ . - - vendor - node_modules + -- To view, visit https://gerrit.wikimedia.org/r/380326 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib41737bbc9f1628f99e06b970fe73c1d0fc4ea9f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TrustedXFF Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...TorBlock[master]: Improve some parameter docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380328 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: Ic51c101917d6697ccaaccda9c3fc384d7453377b --- M ASN1Parser.php M includes/TorBlockHooks.php M phpcs.xml 3 files changed, 15 insertions(+), 19 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/ASN1Parser.php b/ASN1Parser.php index 17cd244..32488c5 100644 --- a/ASN1Parser.php +++ b/ASN1Parser.php @@ -39,7 +39,7 @@ // @codingStandardsIgnoreEnd /** -* @param $number int +* @param int $number * @return string */ public static function encodeLength( $number ) { @@ -54,7 +54,7 @@ } /** -* @param $buffer string +* @param string $buffer * @return array * @throws ASN1Exception */ @@ -147,7 +147,7 @@ } /** -* @param $decodedArray array +* @param array $decodedArray * @return array */ public static function prettyDecode( $decodedArray ) { @@ -158,8 +158,8 @@ } /** -* @param $value string -* @param $key string +* @param string &$value +* @param string $key */ protected static function prettyItem( &$value, $key ) { switch ( $key ) { @@ -175,8 +175,8 @@ } /** -* @param $tagId -* @param $contents +* @param int $tagId +* @param string $contents * @return string * @throws ASN1Exception */ diff --git a/includes/TorBlockHooks.php b/includes/TorBlockHooks.php index 6c777b4..9077e3a 100644 --- a/includes/TorBlockHooks.php +++ b/includes/TorBlockHooks.php @@ -79,8 +79,8 @@ * Check if a user is a Tor node and not whitelisted or allowed * to bypass tor blocks. * -* @param Title $title Title being acted upon -* @param User $user User performing the action +* @param Title &$title Title being acted upon +* @param User &$user User performing the action * @param string $action Action being performed * @param array &$result Will be filled with block status if blocked * @return bool @@ -147,7 +147,7 @@ * Set a variable for Extension:AbuseFilter indicating whether the * user is operating from a tor exit node or not. * -* @param array $builder Array of builder values +* @param array &$builder Array of builder values * @return bool */ public static function onAbuseFilterBuilder( array &$builder ) { @@ -157,7 +157,7 @@ /** * @static -* @param $user User +* @param User &$user * @return bool */ public static function onGetBlockedStatus( &$user ) { @@ -260,7 +260,7 @@ /** * If enabled, add a new tag type for recent changes made by Tor exit nodes. * -* @param array $emptyTags List of defined tags (for ListDefinedTags hook) or +* @param array &$emptyTags List of defined tags (for ListDefinedTags hook) or * list of active tags (for ChangeTagsListActive hook) * @return bool true */ @@ -276,7 +276,7 @@ /** * Creates a message with the Tor blocking status if applicable. * -* @param array $msg Message with the status +* @param array &$msg Message with the status * @param string $ip The IP address to be checked * @return bool true */ diff --git a/phpcs.xml b/phpcs.xml index 0bc8fcc..bf67ffa 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,19 +1,15 @@ - - - + . - - vendor - node_modules + -- To view, visit https://gerrit.wikimedia.org/r/380328 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic51c101917d6697ccaaccda9c3fc384d7453377b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TorBlock Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...FileImporter[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380651 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I62f4bd6d3d4d0059b701ab5078bfb193c16d84a8 --- M composer.json M src/Exceptions/SourceUrlException.php M src/Html/WikiTextEditor.php M src/Remote/MediaWiki/RemoteApiImportTitleChecker.php M src/Services/DuplicateFileRevisionChecker.php M src/Services/Importer.php M src/Services/WikiRevisionFactory.php M src/SpecialImportFile.php M tests/phan/config.php 9 files changed, 1 insertion(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileImporter refs/changes/51/380651/1 diff --git a/composer.json b/composer.json index 6d8c82e..c5ef5fc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { diff --git a/src/Exceptions/SourceUrlException.php b/src/Exceptions/SourceUrlException.php index 1c10f88..c248c2d 100644 --- a/src/Exceptions/SourceUrlException.php +++ b/src/Exceptions/SourceUrlException.php @@ -2,8 +2,6 @@ namespace FileImporter\Exceptions; -use RuntimeException; - /** * Thrown in cases that the SourceUrl is not deemed to be acceptable. */ diff --git a/src/Html/WikiTextEditor.php b/src/Html/WikiTextEditor.php index b36339a..3353610 100644 --- a/src/Html/WikiTextEditor.php +++ b/src/Html/WikiTextEditor.php @@ -5,7 +5,6 @@ use EditPage; use Html; use SpecialPage; -use StringUtils; class WikiTextEditor { diff --git a/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php b/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php index 3da4012..9a6a047 100644 --- a/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php +++ b/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php @@ -6,7 +6,6 @@ use FileImporter\Exceptions\HttpRequestException; use FileImporter\Exceptions\ImportException; use FileImporter\Interfaces\ImportTitleChecker; -use FileImporter\Remote\MediaWiki\HttpApiLookup; use FileImporter\Services\Http\HttpRequestExecutor; class RemoteApiImportTitleChecker implements ImportTitleChecker { diff --git a/src/Services/DuplicateFileRevisionChecker.php b/src/Services/DuplicateFileRevisionChecker.php index 12ce292..9dc2de7 100644 --- a/src/Services/DuplicateFileRevisionChecker.php +++ b/src/Services/DuplicateFileRevisionChecker.php @@ -5,7 +5,6 @@ use File; use FileImporter\Data\FileRevision; use LocalRepo; -use Wikimedia\Assert\Assert; /** * Class that can be used to check if a FileRevision already exists on the current wiki. diff --git a/src/Services/Importer.php b/src/Services/Importer.php index c697504..4308c9e 100644 --- a/src/Services/Importer.php +++ b/src/Services/Importer.php @@ -12,7 +12,6 @@ use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; -use Revision; use RuntimeException; use Title; use User; diff --git a/src/Services/WikiRevisionFactory.php b/src/Services/WikiRevisionFactory.php index ae732e9..9844b4b 100644 --- a/src/Services/WikiRevisionFactory.php +++ b/src/Services/WikiRevisionFactory.php @@ -5,7 +5,6 @@ use Config; use FileImporter\Data\FileRevision; use FileImporter\Data\TextRevision; -use InvalidArgumentException; use Title; use WikiRevision; diff --git a/src/SpecialImportFile.php b/src/SpecialImportFile.php index 5da354b..7693731 100644 --- a/src/SpecialImportFile.php +++ b/src/SpecialImportFile.php @@ -17,7 +17,6 @@ use FileImporter\Html\ImportSuccessPage; use FileImporter\Html\InputFormPage; use FileImporter\Html\RecoverableTitleExceptionPage; -use FileImporter\Services\DuplicateFileRevisionChecker; use FileImporter\Services\Importer; use FileImporter\Services\ImportPlanFactory; use FileImporter\Services\SourceSiteLocator; @@ -27,7 +26,6 @@ use Message; use PermissionsError; use SpecialPage; -use StringUtils; use UploadBase; use User; use UserBlockedError; diff --git a/tests/phan/config.php b/tests/phan/config.php index 5d61e6d..7872155 100644 --- a/tests/phan/config.php +++ b/tests/phan/config.php @@ -1,7 +1,5 @@ https://gerrit.wikimedia.org/r/380651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I62f4bd6d3d4d0059b701ab5078bfb193c16d84a8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FileImporter Gerrit-Branch: master Gerrit-Owner: Umherirrender___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...TemplateData[master]: Improve some parameter docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380334 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: I2ffe6893abf6ca6a7553acfd5ccfa26361f63124 --- M TemplateData.hooks.php M TemplateDataBlob.php M api/ApiTemplateData.php M phpcs.xml 4 files changed, 14 insertions(+), 11 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/TemplateData.hooks.php b/TemplateData.hooks.php index 1b6cf8a..bff3402 100644 --- a/TemplateData.hooks.php +++ b/TemplateData.hooks.php @@ -9,6 +9,8 @@ class TemplateDataHooks { /** * Register parser hooks +* @param Parser &$parser +* @return bool */ public static function onParserFirstCallInit( &$parser ) { $parser->setHook( 'templatedata', [ 'TemplateDataHooks', 'render' ] ); @@ -17,6 +19,9 @@ /** * Register qunit unit tests +* @param array &$testModules +* @param ResourceLoader &$resourceLoader +* @return bool */ public static function onResourceLoaderTestModules( array &$testModules, @@ -35,7 +40,7 @@ * Conditionally register the jquery.uls.data module, in case they've already been * registered by the UniversalLanguageSelector extension or the VisualEditor extension. * -* @param ResourceLoader $resourceLoader +* @param ResourceLoader &$resourceLoader * @return boolean true */ public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) { @@ -61,11 +66,12 @@ * @param User &$user * @param Content &$content * @param string &$summary -* @param $minor +* @param bool $minor * @param bool|null $watchthis -* @param $sectionanchor -* @param &$flags +* @param string $sectionanchor +* @param int &$flags * @param Status &$status +* @return bool */ public static function onPageContentSave( &$page, &$user, &$content, &$summary, $minor, $watchthis, $sectionanchor, &$flags, &$status diff --git a/TemplateDataBlob.php b/TemplateDataBlob.php index c024802..b088ded 100644 --- a/TemplateDataBlob.php +++ b/TemplateDataBlob.php @@ -561,7 +561,8 @@ /** * Normalise a InterfaceText field in the TemplateData blob. -* @return stdClass|string $text +* @param stdClass|string $text +* @return stdClass|string */ protected static function normaliseInterfaceText( $text ) { if ( is_string( $text ) ) { diff --git a/api/ApiTemplateData.php b/api/ApiTemplateData.php index a366846..8aa5b0f 100644 --- a/api/ApiTemplateData.php +++ b/api/ApiTemplateData.php @@ -155,6 +155,7 @@ /** * @see ApiBase::getExamplesMessages() +* @return array */ protected function getExamplesMessages() { return [ diff --git a/phpcs.xml b/phpcs.xml index 649a74b..d81f486 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,16 +2,11 @@ - - - - . - - vendor + -- To view, visit https://gerrit.wikimedia.org/r/380334 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2ffe6893abf6ca6a7553acfd5ccfa26361f63124 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TemplateData Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] mediawiki.special.apisandbox: Stop using double scroll...
Bartosz Dziewoński has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380650 ) Change subject: [WIP] mediawiki.special.apisandbox: Stop using double scrollbars .. [WIP] mediawiki.special.apisandbox: Stop using double scrollbars OOjs UI BookletLayout no longer has to be 'expanded' to the dimensions of its parent element, and can instead naturally accommodate its contents. This means we no longer have to explicitly set the size of the panel. Depends on I19cd1f2f3f7c4afa22a507a89c75fb206386eb0d in OOjs UI. WIP because the toolbar and menu no longer stay onscreen when scrolling in fullscreen mode. We'll probably have to toggle 'expanded' for all the nested panels to fix this. Bug: T129157 Change-Id: I18ae3f8b891fcd4b06cd826ecb7da9ac94232581 --- M resources/src/mediawiki.special/mediawiki.special.apisandbox.css M resources/src/mediawiki.special/mediawiki.special.apisandbox.js 2 files changed, 7 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/50/380650/1 diff --git a/resources/src/mediawiki.special/mediawiki.special.apisandbox.css b/resources/src/mediawiki.special/mediawiki.special.apisandbox.css index 750a567..96dcbf0 100644 --- a/resources/src/mediawiki.special/mediawiki.special.apisandbox.css +++ b/resources/src/mediawiki.special/mediawiki.special.apisandbox.css @@ -25,6 +25,7 @@ right: 0; background: #fff; z-index: 100; + overflow: auto; } .mw-apisandbox-fullscreen .mw-apisandbox-container { diff --git a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js index 7029116..e680013 100644 --- a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js +++ b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js @@ -2,7 +2,7 @@ ( function ( $, mw, OO ) { 'use strict'; var ApiSandbox, Util, WidgetMethods, Validators, - $content, panel, booklet, oldhash, windowManager, fullscreenButton, + $toolbar, $content, panel, booklet, oldhash, windowManager, fullscreenButton, formatDropdown, api = new mw.Api(), bookletPages = [], @@ -735,8 +735,6 @@ * Automatically called on $.ready() */ init: function () { - var $toolbar; - ApiSandbox.isFullscreen = false; $content = $( '#mw-apisandbox' ); @@ -767,6 +765,7 @@ ); booklet = new OO.ui.BookletLayout( { + expanded: false, outlined: true, autoFocus: false } ); @@ -807,10 +806,6 @@ .append( $toolbar ) .append( panel.$element ) ); - - $( window ).on( 'resize', ApiSandbox.resizePanel ); - - ApiSandbox.resizePanel(); }, /** @@ -832,26 +827,6 @@ fullscreenButton.setLabel( mw.message( 'apisandbox-fullscreen' ).text() ); fullscreenButton.setTitle( mw.message( 'apisandbox-fullscreen-tooltip' ).text() ); $content.append( $ui ); - } - ApiSandbox.resizePanel(); - }, - - /** -* Set the height of the panel based on the current viewport. -*/ - resizePanel: function () { - var height = $( window ).height(), - contentTop = $content.offset().top; - - if ( ApiSandbox.isFullscreen ) { - height -= panel.$element.offset().top - $( '#mw-apisandbox-ui' ).offset().top; - panel.$element.height( height - 1 ); - } else { - // Subtract the height of the intro text - height -= panel.$element.offset().top - contentTop; - - panel.$element.height( height - 10 ); - $( window ).scrollTop( contentTop - 5 ); } }, @@ -1053,7 +1028,9 @@ $result = $( '' ) .append( progress.$element ); - resultPage = page = new OO.ui.PageLayout( '|results|' ); + resultPage = page = new OO.ui.PageLayout( '|results|', { + expanded: false + } );
[MediaWiki-commits] [Gerrit] mediawiki...apex[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380648 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I776b14670db3b70afa28c41c8c2211066424b609 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/apex refs/changes/48/380648/1 diff --git a/composer.json b/composer.json index e4d469b..3ec375d 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380648 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I776b14670db3b70afa28c41c8c2211066424b609 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/apex Gerrit-Branch: master Gerrit-Owner: Umherirrender___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380649 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: Ieb4bd4e4e413c95f6f25d6b14234c4f9412d76d6 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Timeless refs/changes/49/380649/1 diff --git a/composer.json b/composer.json index e4d469b..3ec375d 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb4bd4e4e413c95f6f25d6b14234c4f9412d76d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Timeless Gerrit-Branch: master Gerrit-Owner: Umherirrender___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...AdminLinks[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Yaron Koren has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380645 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I28c67a0850d88dd6f9434587a73b1950c832d4e7 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Yaron Koren: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index 4527acd..7575813 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380645 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I28c67a0850d88dd6f9434587a73b1950c832d4e7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AdminLinks Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Yaron Koren Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ParserMigration[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380647 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I131e3014a21f8122f9a9ca5c039d315f5a5d4f4d --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ParserMigration refs/changes/47/380647/1 diff --git a/composer.json b/composer.json index 7898723..d980e06 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380647 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I131e3014a21f8122f9a9ca5c039d315f5a5d4f4d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ParserMigration Gerrit-Branch: master Gerrit-Owner: Umherirrender___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...FileExporter[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380646 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I3267a617969062741688cf18f807164e27fe7ff1 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileExporter refs/changes/46/380646/1 diff --git a/composer.json b/composer.json index 6d8c82e..c5ef5fc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380646 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3267a617969062741688cf18f807164e27fe7ff1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FileExporter Gerrit-Branch: master Gerrit-Owner: Umherirrender___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...AdminLinks[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380645 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: I28c67a0850d88dd6f9434587a73b1950c832d4e7 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AdminLinks refs/changes/45/380645/1 diff --git a/composer.json b/composer.json index 4527acd..7575813 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380645 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I28c67a0850d88dd6f9434587a73b1950c832d4e7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AdminLinks Gerrit-Branch: master Gerrit-Owner: Umherirrender___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WLFilters: Live update and View newest
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379602 ) Change subject: WLFilters: Live update and View newest .. WLFilters: Live update and View newest Moved handling for 'from', 'days' and 'limit' to base class (ChangesListSpecialPage) I moved 'days' because its implementation is related to 'from'. I moved 'limit' because it was getting lonely and it's identical in all cases. Bug: T176348 Change-Id: If6280ad6fbad65909e1d0b2a48344e24d485aca2 --- M includes/specialpage/ChangesListSpecialPage.php M includes/specials/SpecialRecentchanges.php M includes/specials/SpecialWatchlist.php M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.ChangesListViewModel.js 4 files changed, 26 insertions(+), 78 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index d7519d3..6fd33a7 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -957,6 +957,11 @@ $opts->add( 'urlversion', 1 ); $opts->add( 'tagfilter', '' ); + $opts->add( 'days', $this->getDefaultDays(), FormOptions::FLOAT ); + $opts->add( 'limit', $this->getDefaultLimit(), FormOptions::INT ); + + $opts->add( 'from', '' ); + return $opts; } @@ -1110,6 +1115,9 @@ $query = wfArrayToCgi( $this->convertParamsForLink( $opts->getChangedValues() ) ); $this->getOutput()->redirect( $this->getPageTitle()->getCanonicalURL( $query ) ); } + + $opts->validateIntBounds( 'limit', 0, 5000 ); + $opts->validateBounds( 'days', 0, $this->getConfig()->get( 'RCMaxAge' ) / ( 3600 * 24 ) ); } /** @@ -1249,6 +1257,19 @@ } $conds[] = "rc_namespace $operator $value"; } + + // Calculate cutoff + $cutoff_unixtime = time() - $opts['days'] * 3600 * 24; + $cutoff = $dbr->timestamp( $cutoff_unixtime ); + + $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] ); + if ( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) { + $cutoff = $dbr->timestamp( $opts['from'] ); + } else { + $opts->reset( 'from' ); + } + + $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $cutoff ); } /** diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 34a7714..522a0a6 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -164,10 +164,6 @@ true ); parent::execute( $subpage ); - - if ( $this->isStructuredFilterUiEnabled() ) { - $out->addJsConfigVars( 'wgStructuredChangeFiltersLiveUpdateSupported', true ); - } } /** @@ -232,10 +228,6 @@ public function getDefaultOptions() { $opts = parent::getDefaultOptions(); - $opts->add( 'days', $this->getDefaultDays(), FormOptions::FLOAT ); - $opts->add( 'limit', $this->getDefaultLimit() ); - $opts->add( 'from', '' ); - $opts->add( 'categories', '' ); $opts->add( 'categories_any', false ); @@ -285,36 +277,6 @@ $opts['tagfilter'] = $m[1]; } } - } - - public function validateOptions( FormOptions $opts ) { - $opts->validateIntBounds( 'limit', 0, 5000 ); - $opts->validateBounds( 'days', 0, $this->getConfig()->get( 'RCMaxAge' ) / ( 3600 * 24 ) ); - parent::validateOptions( $opts ); - } - - /** -* @inheritDoc -*/ - protected function buildQuery( &$tables, &$fields, &$conds, - &$query_options, &$join_conds, FormOptions $opts - ) { - $dbr = $this->getDB(); - parent::buildQuery( $tables, $fields, $conds, - $query_options, $join_conds, $opts ); - - // Calculate cutoff - $cutoff_unixtime = time() - $opts['days'] * 3600 * 24; - $cutoff = $dbr->timestamp( $cutoff_unixtime ); - - $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] ); - if ( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) { - $cutoff = $dbr->timestamp( $opts['from'] ); - } else { - $opts->reset( 'from' ); - } - -
[MediaWiki-commits] [Gerrit] mediawiki...FileAnnotations[master]: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380644 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 .. build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 Change-Id: Icd0ece7b181ea02208671fa0cc38b6da180e2dfd --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileAnnotations refs/changes/44/380644/1 diff --git a/composer.json b/composer.json index 7898723..d980e06 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { -- To view, visit https://gerrit.wikimedia.org/r/380644 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd0ece7b181ea02208671fa0cc38b6da180e2dfd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FileAnnotations Gerrit-Branch: master Gerrit-Owner: Umherirrender___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Typo fix in docs
MarcoAurelio has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380637 ) Change subject: Typo fix in docs .. Typo fix in docs Change-Id: Ibea12784963164caf0f44b3b860c5bbb2c6c528f --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer refs/changes/37/380637/1 -- To view, visit https://gerrit.wikimedia.org/r/380637 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibea12784963164caf0f44b3b860c5bbb2c6c528f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/tools/codesniffer Gerrit-Branch: master Gerrit-Owner: MarcoAurelio___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Add hi.wikivoyage to wikivoyage family
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/371142 ) Change subject: Add hi.wikivoyage to wikivoyage family .. Add hi.wikivoyage to wikivoyage family Bug: T173013 Change-Id: I82e708c0b55df2e48c83838a4db38e43bf0b5085 --- M pywikibot/families/wikivoyage_family.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Multichill: Looks good to me, approved jenkins-bot: Verified Dereckson: Looks good to me, but someone else must approve Zoranzoki21: Looks good to me, but someone else must approve Objections: Xqt: There's a problem with this change, please improve diff --git a/pywikibot/families/wikivoyage_family.py b/pywikibot/families/wikivoyage_family.py index bb0d8fb..a29341c 100644 --- a/pywikibot/families/wikivoyage_family.py +++ b/pywikibot/families/wikivoyage_family.py @@ -23,7 +23,7 @@ """Constructor.""" self.languages_by_size = [ 'en', 'de', 'fa', 'it', 'fr', 'pl', 'ru', 'nl', 'pt', 'fi', 'es', -'zh', 'he', 'vi', 'sv', 'el', 'ro', 'uk', +'zh', 'he', 'vi', 'sv', 'el', 'ro', 'uk', 'hi', ] super(Family, self).__init__() -- To view, visit https://gerrit.wikimedia.org/r/371142 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I82e708c0b55df2e48c83838a4db38e43bf0b5085 Gerrit-PatchSet: 7 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: MarcoAurelioGerrit-Reviewer: Dereckson Gerrit-Reviewer: Magul Gerrit-Reviewer: MarcoAurelio Gerrit-Reviewer: Multichill Gerrit-Reviewer: Xqt Gerrit-Reviewer: Zoranzoki21 Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] purtle[master]: Minor code structure clean ups in JsonLdRdfWriter
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379509 ) Change subject: Minor code structure clean ups in JsonLdRdfWriter .. Minor code structure clean ups in JsonLdRdfWriter This is a direct follow up for the review I did in I77d6a77. Instead of leaving comments there, I fixed everything I can myself here in this follow up patch. Bug: T44063 Change-Id: Ice0706146d9acbe97140f6f0336db521ba8a9b53 --- M README.md M composer.json M src/JsonLdRdfWriter.php 3 files changed, 46 insertions(+), 39 deletions(-) Approvals: C. Scott Ananian: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index edd0618..5dbdcd2 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ The concrete classes implementing the common `RdfWriter` interface are: * `TurtleRdfWriter` outputs Turtle +* `JsonLdRdfWriter` outputs JSON-LD * `XmlRdfWriter` outputs XML/RDF * `NTriplesRdfWriter` outputs N-Triples -* `JsonLdRdfWriter` outputs JSON-LD The PHP code would look something like this: diff --git a/composer.json b/composer.json index d714be3..4291bb6 100644 --- a/composer.json +++ b/composer.json @@ -3,10 +3,10 @@ "type": "library", "description": "Fast streaming RDF serializer", "keywords": [ + "JSON-LD", "RDF", "Serializer", - "Turtle", - "JSON-LD" + "Turtle" ], "homepage": "https://mediawiki.org/wiki/Purtle;, "license": "GPL-2.0+", diff --git a/src/JsonLdRdfWriter.php b/src/JsonLdRdfWriter.php index 2366a98..48dde9c 100644 --- a/src/JsonLdRdfWriter.php +++ b/src/JsonLdRdfWriter.php @@ -14,18 +14,24 @@ class JsonLdRdfWriter extends RdfWriterBase { /** -* The JSON-LD "@context" object, which maps terms to IRIs. -* This object is shared with all sub-writers, and a single -* context is emitted when the writer is finalized. +* The JSON-LD "@context", which maps terms to IRIs. This is shared with all sub-writers, and a +* single context is emitted when the writer is finalized. +* * @see https://www.w3.org/TR/json-ld/#the-context +* * @var string[] */ protected $context = []; /** -* The JSON-LD "@graph" array, which lists all the nodes -* described by this JSON-LD object. +* The JSON-LD "@graph", which lists all the nodes described by this JSON-LD object. +* We apply an optimization eliminating the "@graph" entry if it consists +* of a single node; in that case we will set $this->graph to null in +* #finishJson() to ensure that the deferred callback in #finishDocument() +* doesn't later emit "@graph". +* * @see https://www.w3.org/TR/json-ld/#named-graphs +* * @var array[]|null */ private $graph = []; @@ -34,7 +40,9 @@ * A collection of predicates about a specific subject. The * subject is identified by the "@id" key in this array; the other * keys identify JSON-LD properties. +* * @see https://www.w3.org/TR/json-ld/#dfn-edge +* * @var array */ private $predicates = []; @@ -42,13 +50,16 @@ /** * A sequence of zero or more IRIs, nodes, or values, which are the * destination targets of the current predicates. +* * @see https://www.w3.org/TR/json-ld/#dfn-list +* * @var array */ private $values = []; /** * True iff we have written the opening of the "@graph" field. +* * @var bool */ private $wroteGraph = false; @@ -57,6 +68,7 @@ * JSON-LD objects describing a single node can omit the "@graph" field; * this variable remains false only so long as we can guarantee that * only a single node has been described. +* * @var bool */ private $disableGraphOpt = false; @@ -96,9 +108,12 @@ public function encode( $val, $indent ) { $str = json_encode( $val, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ); // Strip outermost open/close braces/brackets - $str = preg_replace( '/(^[\[{]\n?)|(\n?[}\]]$)/', '', $str ); - // add extra indentation - $str = preg_replace( '/^/m', str_repeat( "", $indent ), $str ); + $str = preg_replace( '/^[[{]\n?|\n?[}\]]$/', '', $str ); + + if ( $indent > 0 ) { + // add extra indentation + $str = preg_replace( '/^/m', str_repeat( '', $indent ), $str ); + } return $str; } @@ -178,6 +193,7 @@ $this->write( "\n]" );
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Delete ganglia_reporter, use new module
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379806 ) Change subject: Delete ganglia_reporter, use new module .. Delete ganglia_reporter, use new module DEPLOY NOTE: remember to drush dis ganglia_reporter first! Bug: T171524 Change-Id: Ib527b1171d69ea5dd29d04a624420bd4d42b14cd --- D sites/all/modules/ganglia_reporter/GangliaReporter.php D sites/all/modules/ganglia_reporter/ganglia_reporter.info D sites/all/modules/ganglia_reporter/ganglia_reporter.module D sites/all/modules/ganglia_reporter/tests/ganglia_reporter.test M sites/all/modules/queue2civicrm/queue2civicrm.module M sites/default/enabled_modules 6 files changed, 9 insertions(+), 347 deletions(-) Approvals: Mepps: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/ganglia_reporter/GangliaReporter.php b/sites/all/modules/ganglia_reporter/GangliaReporter.php deleted file mode 100644 index 76409ff..000 --- a/sites/all/modules/ganglia_reporter/GangliaReporter.php +++ /dev/null @@ -1,126 +0,0 @@ -setGmetricPath( $gmetric_path ); - } - - /** - * Get gmetric path - * - * In the event that gmetric path is not set in scope, attempt to auto-locate - * and set it. - * - * @return string - */ - function getGmetricPath() { -if ( !$this->gmetric_path ) { - $this->setGmetricPath( self::locateGmetricPath() ); -} -return $this->gmetric_path; - } - - /** - * Set gmetric path - * - * Throws an exception in the event that the path to the gmetric binary does - * not exist. - * - * @param $path - */ - function setGmetricPath( $path ) { -if ( !file_exists( $path )) { - throw new Exception( 'Gmetric path "' . $path . '" does not exist.' ); -} -$this->gmetric_path = $path; - } - - /** - * Executes gmetric call - * - * Sends arbitrary data to Ganglia using gmetric. - * - * Params the same as arguments for gmetric. Run gmetric --help for more - * info. - * - * @param $name - * @param $value - * @param $type - * @param $units - * @param $slope - * @param $tmax - * @param $dmax - * @return bool - */ - function sendMetric( $name, $value, $type = 'int8', $units = '', $slope = 'both', $tmax = 60, $dmax = 0 ) { -// pack the params and their values into an array so we can more easily build our string of options -$opts = array( - 'name' => $name, - 'value' => $value, - 'type' => $type, - 'units' => $units, - 'slope' => $slope, - 'tmax' => $tmax, - 'dmax' => $dmax, -); - -// construct our command to execute, along with our string of options -$cmd = escapeshellcmd( $this->getGmetricPath() . ' ' . $this->prepareOptions( $opts )); -// execute the gmetric command... -exec( $cmd, $output, $retval ); - -// return true/false depending on success. -if( $retval === 0 ) { - return true; -} else { - return false; -} - } - - /** - * Returns a formatted string of options to be passed to executable - * - * Takes an associative array of $option_name => $option_value. - * - * @param $opts - * @return string - */ - function prepareOptions( array $opts ) { -foreach( $opts as $opt => $val ) { - $opts[ $opt ] = "--" . $opt . "=" . escapeshellarg( $val ); -} -return implode( " ", $opts ); - } - - /** - * Attempt to auto-determine location of gmetric - * @return string Gmetric path (or null) - */ - static function locateGmetricPath() { -$path = exec( 'which gmetric' ); -if ( !strlen( $path )) { - return null; -} -return $path; - } -} diff --git a/sites/all/modules/ganglia_reporter/ganglia_reporter.info b/sites/all/modules/ganglia_reporter/ganglia_reporter.info deleted file mode 100644 index 429b9c0..000 --- a/sites/all/modules/ganglia_reporter/ganglia_reporter.info +++ /dev/null @@ -1,6 +0,0 @@ -name = Ganglia Reporter -description = Reports metrics to Ganglia -core = 7.x -configure = admin/config/ganglia_reporter/configure -files[] = tests/ganglia_reporter.test -files[] = GangliaReporter.php diff --git a/sites/all/modules/ganglia_reporter/ganglia_reporter.module b/sites/all/modules/ganglia_reporter/ganglia_reporter.module deleted file mode 100644 index bee73bf..000 --- a/sites/all/modules/ganglia_reporter/ganglia_reporter.module +++ /dev/null @@ -1,98 +0,0 @@ - 'Ganglia Reporter', -'access arguments' => array( 'administer ganglia reporter' ), -'page callback' => 'system_admin_menu_block_page', -'file' => 'system.admin.inc', -'file path' => drupal_get_path('module', 'system'), - ); - - // forces 'Ganglia Reporter' to appear on the config page - $items[ 'admin/config/ganglia_reporter/configure' ] = array( -'title' => 'Configure', -'description' => 'Configure Ganglia Gmetric scripts.', -'access arguments' => array( 'administer ganglia reporter' ), -
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Set a reasonable --batch-size for Wikidata entity dumps
Hoo man has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380628 ) Change subject: Set a reasonable --batch-size for Wikidata entity dumps .. Set a reasonable --batch-size for Wikidata entity dumps I benchmarked this a little and this should make the dumps about 8% - 10% faster by always asking for about 500 entities from PrefetchingWikiPageEntityMetaDataAccessor at a time. Change-Id: I10f12b200cd47ff27898c3f3dacc79610c649eba --- M modules/snapshot/files/cron/dumpwikidatajson.sh M modules/snapshot/files/cron/dumpwikidatardf.sh 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/28/380628/1 diff --git a/modules/snapshot/files/cron/dumpwikidatajson.sh b/modules/snapshot/files/cron/dumpwikidatajson.sh index 80dd30b..5bb3279 100644 --- a/modules/snapshot/files/cron/dumpwikidatajson.sh +++ b/modules/snapshot/files/cron/dumpwikidatajson.sh @@ -29,7 +29,7 @@ ( set -o pipefail errorLog=/var/log/wikidatadump/dumpwikidatajson-$filename-$i.log - php5 $multiversionscript extensions/Wikidata/extensions/Wikibase/repo/maintenance/dumpJson.php --wiki wikidatawiki --shard $i --sharding-factor $shards --snippet 2>> $errorLog | gzip -9 > $tempDir/wikidataJson.$i.gz + php5 $multiversionscript extensions/Wikidata/extensions/Wikibase/repo/maintenance/dumpJson.php --wiki wikidatawiki --shard $i --sharding-factor $shards --batch-size `expr $shards \* 500` --snippet 2>> $errorLog | gzip -9 > $tempDir/wikidataJson.$i.gz exitCode=$? if [ $exitCode -gt 0 ]; then echo -e "\n\n(`date --iso-8601=minutes`) Process for shard $i failed with exit code $exitCode" >> $errorLog @@ -75,7 +75,7 @@ exit 1 fi fileSize=`stat --printf="%s" $tempFile` - if [ $fileSize -lt `expr 105 / $shards` ]; then + if [ $fileSize -lt `expr 200 / $shards` ]; then echo "File size of $tempFile is only $fileSize. Aborting." >> $mainLogFile exit 1 fi diff --git a/modules/snapshot/files/cron/dumpwikidatardf.sh b/modules/snapshot/files/cron/dumpwikidatardf.sh index 036eec9..1742842 100755 --- a/modules/snapshot/files/cron/dumpwikidatardf.sh +++ b/modules/snapshot/files/cron/dumpwikidatardf.sh @@ -43,7 +43,7 @@ declare -A dumpNameToMinSize # Sanity check: Minimal size we expect each shard of a certain dump to have -dumpNameToMinSize=(["all"]=`expr 125 / $shards` ["truthy"]=`expr 75 / $shards`) +dumpNameToMinSize=(["all"]=`expr 235 / $shards` ["truthy"]=`expr 140 / $shards`) # Try to create the dump (up to three times). retries=0 @@ -56,7 +56,7 @@ ( set -o pipefail errorLog=/var/log/wikidatadump/dumpwikidata$dumpFormat-$filename-$i.log - php5 $multiversionscript extensions/Wikidata/extensions/Wikibase/repo/maintenance/dumpRdf.php --wiki wikidatawiki --shard $i --sharding-factor $shards --format $dumpFormat --flavor $dumpFlavor 2>> $errorLog | gzip -9 > $tempDir/wikidata$dumpFormat-$dumpName.$i.gz + php5 $multiversionscript extensions/Wikidata/extensions/Wikibase/repo/maintenance/dumpRdf.php --wiki wikidatawiki --shard $i --sharding-factor $shards --batch-size `expr $shards \* 500` --format $dumpFormat --flavor $dumpFlavor 2>> $errorLog | gzip -9 > $tempDir/wikidata$dumpFormat-$dumpName.$i.gz exitCode=$? if [ $exitCode -gt 0 ]; then echo -e "\n\n(`date --iso-8601=minutes`) Process for shard $i failed with exit code $exitCode" >> $errorLog -- To view, visit https://gerrit.wikimedia.org/r/380628 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10f12b200cd47ff27898c3f3dacc79610c649eba Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Hoo man___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Add slow filters debug data to the logs.
Dmaza has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380621 ) Change subject: Add slow filters debug data to the logs. .. Add slow filters debug data to the logs. When $wgAbuseFilterRuntimeProfile is true, all filters taking longer than $wgAbuseFilterRuntimeLimit will be logged for later analysis Bug: T174205 Change-Id: Id81833afa8421476a6cee47eb3393acdb3a38d65 --- M AbuseFilter.php M extension.json M includes/AbuseFilter.class.php 3 files changed, 39 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/21/380621/1 diff --git a/AbuseFilter.php b/AbuseFilter.php index 7f13eaf..6746897 100644 --- a/AbuseFilter.php +++ b/AbuseFilter.php @@ -122,3 +122,8 @@ * Whether to record runtime metrics for all filters combined. */ $wgAbuseFilterRuntimeProfile = false; + +/** + * Runtime in miliseconds before a filter is considered slow. + */ +$wgAbuseFilterRuntimeLimit = 100; diff --git a/extension.json b/extension.json index a043b6c..a183d64 100644 --- a/extension.json +++ b/extension.json @@ -249,7 +249,8 @@ }, "AbuseFilterLogIPMaxAge": 7776000, "AbuseFilterProfile": false, - "AbuseFilterRuntimeProfile": false + "AbuseFilterRuntimeProfile": false, + "AbuseFilterRuntimeLimit": 100 }, "load_composer_autoloader": true, "manifest_version": 1 diff --git a/includes/AbuseFilter.class.php b/includes/AbuseFilter.class.php index 3ce5cdb..0a09ef7 100644 --- a/includes/AbuseFilter.class.php +++ b/includes/AbuseFilter.class.php @@ -529,12 +529,12 @@ * @return bool */ public static function checkFilter( $row, $vars, $profile = false, $prefix = '' ) { - global $wgAbuseFilterProfile; + global $wgAbuseFilterProfile, $wgAbuseFilterRuntimeProfile, $wgAbuseFilterRuntimeLimit; $filterID = $prefix . $row->af_id; $startConds = $startTime = null; - if ( $profile && $wgAbuseFilterProfile ) { + if ( $profile && ( $wgAbuseFilterProfile || $wgAbuseFilterRuntimeProfile ) ) { $startConds = self::$condCount; $startTime = microtime( true ); } @@ -558,19 +558,43 @@ $result = false; } - if ( $profile && $wgAbuseFilterProfile ) { - $endTime = microtime( true ); - $endConds = self::$condCount; + if ( $profile ) { + $timeTaken = microtime( true ) - $startTime; + $condsUsed = self::$condCount - $startConds; - $timeTaken = $endTime - $startTime; - $condsUsed = $endConds - $startConds; - self::recordProfilingResult( $row->af_id, $timeTaken, $condsUsed ); + if ( $wgAbuseFilterProfile ) { + self::recordProfilingResult( $row->af_id, $timeTaken, $condsUsed ); + } + + $runtime = $timeTaken * 1000; + if ( $wgAbuseFilterRuntimeProfile && $runtime > $wgAbuseFilterRuntimeLimit ) { + self::recordSlowFilter( $row->af_id, $runtime, $condsUsed ); + } } return $result; } /** +* Logs slow filter's runtime data for later analysis +* +* @param int $filterId +* @param float $runtime +* @param int $totalConditions +*/ + private static function recordSlowFilter( $filterId, $runtime, $totalConditions ) { + $logger = LoggerFactory::getInstance( 'AbuseFilterRuntime' ); + $logger->info( 'Edit filter is taking too long', + [ + 'wiki' => wfWikiID(), + 'filter_id' => $filterId, + 'runtime' => $runtime, + 'total_conditions' => $totalConditions + ] + ); + } + + /** * @param int $filter */ public static function resetFilterProfile( $filter ) { -- To view, visit https://gerrit.wikimedia.org/r/380621 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id81833afa8421476a6cee47eb3393acdb3a38d65 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Dmaza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] translatewiki[master]: Archive Extension:Phalanx
MarcoAurelio has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380592 ) Change subject: Archive Extension:Phalanx .. Archive Extension:Phalanx Bug: T176665 Change-Id: Iefb72bca99e3768a270058a0d66b9c452613eb5e --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/92/380592/1 -- To view, visit https://gerrit.wikimedia.org/r/380592 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iefb72bca99e3768a270058a0d66b9c452613eb5e Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: MarcoAurelioGerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...discovery-parent-pom[master]: Disable some spotbugs checks.
Gehel has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380591 ) Change subject: Disable some spotbugs checks. .. Disable some spotbugs checks. Previous attempt by using an exclusion filter file makes it too complex to manage dependencies, this **should** work better. Change-Id: I944306d8fe354b3ea210236a0c6bcb4feec61f99 --- D discovery-build-tools/src/main/resources/org/wikimedia/discovery/build/tools/spotbugs/spotbugs-excludes.xml M pom.xml 2 files changed, 1 insertion(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/discovery-parent-pom refs/changes/91/380591/1 diff --git a/discovery-build-tools/src/main/resources/org/wikimedia/discovery/build/tools/spotbugs/spotbugs-excludes.xml b/discovery-build-tools/src/main/resources/org/wikimedia/discovery/build/tools/spotbugs/spotbugs-excludes.xml deleted file mode 100644 index 3039b90..000 --- a/discovery-build-tools/src/main/resources/org/wikimedia/discovery/build/tools/spotbugs/spotbugs-excludes.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index e4c2b49..620b798 100644 --- a/pom.xml +++ b/pom.xml @@ -144,7 +144,7 @@ high low - org/wikimedia/discovery/build/tools/spotbugs/spotbugs-excludes.xml +PSC_PRESIZE_COLLECTIONS, EXS_EXCEPTION_SOFTENING_HAS_CHECKED, EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS, LSC_LITERAL_STRING_COMPARISON com.mebigfatguy.fb-contrib -- To view, visit https://gerrit.wikimedia.org/r/380591 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I944306d8fe354b3ea210236a0c6bcb4feec61f99 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/discovery-parent-pom Gerrit-Branch: master Gerrit-Owner: Gehel___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Phalanx[master]: Archive Extension:Phalanx
MarcoAurelio has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380587 ) Change subject: Archive Extension:Phalanx .. Archive Extension:Phalanx Bug: T176665 Change-Id: Ibdcd25dd424160536a4b597371c075e378676170 --- A ARCHIVED D Phalanx.alias.php D Phalanx.class.php D Phalanx.php D PhalanxAjax.class.php D PhalanxHelper.class.php D SpecialPhalanx.body.php D SpecialPhalanxStats.body.php D blocks/ContentBlock.class.php D blocks/QuestionTitleBlock.class.php D blocks/RecentQuestionsBlock.class.php D blocks/TitleBlock.class.php D blocks/UserBlock.class.php D blocks/UserCookieBlock.class.php D blocks/WikiCreationBlock.class.php D css/Phalanx.css D i18n/ar.json D i18n/ast.json D i18n/az.json D i18n/ba.json D i18n/bg.json D i18n/br.json D i18n/bs.json D i18n/ce.json D i18n/cs.json D i18n/cu.json D i18n/de-formal.json D i18n/de.json D i18n/diq.json D i18n/en.json D i18n/eo.json D i18n/es.json D i18n/et.json D i18n/eu.json D i18n/fa.json D i18n/fi.json D i18n/fr.json D i18n/fy.json D i18n/gl.json D i18n/he.json D i18n/hsb.json D i18n/hu.json D i18n/ia.json D i18n/id.json D i18n/it.json D i18n/ja.json D i18n/ka.json D i18n/km.json D i18n/ko.json D i18n/krc.json D i18n/ksh.json D i18n/ku-latn.json D i18n/lb.json D i18n/lki.json D i18n/lzh.json D i18n/mk.json D i18n/ml.json D i18n/ms.json D i18n/nb.json D i18n/nds-nl.json D i18n/nl.json D i18n/oc.json D i18n/om.json D i18n/os.json D i18n/pfl.json D i18n/pl.json D i18n/pms.json D i18n/ps.json D i18n/pt-br.json D i18n/pt.json D i18n/qqq.json D i18n/ro.json D i18n/roa-tara.json D i18n/ru.json D i18n/saz.json D i18n/si.json D i18n/sq.json D i18n/sr-ec.json D i18n/sr-el.json D i18n/sv.json D i18n/ta.json D i18n/te.json D i18n/tl.json D i18n/tt-cyrl.json D i18n/ug-arab.json D i18n/uk.json D i18n/uz.json D i18n/zh-hans.json D i18n/zh-hant.json D js/Phalanx.js D maintenance/clearPhalanxCache.php D maintenance/rebuildPhalanxCache.php D schema.sql D templates/phalanx.tmpl.php 94 files changed, 2 insertions(+), 7,480 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Phalanx refs/changes/87/380587/1 -- To view, visit https://gerrit.wikimedia.org/r/380587 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibdcd25dd424160536a4b597371c075e378676170 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Phalanx Gerrit-Branch: master Gerrit-Owner: MarcoAurelio___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MultimediaViewer[master]: Update for $wgMediaViewerEnableByDefault
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/316706 ) Change subject: Update for $wgMediaViewerEnableByDefault .. Update for $wgMediaViewerEnableByDefault To be consistent with $wgDefaultUserOptions logic Migration of bugzilla bug id to maniphest Bug: T148492 Change-Id: Ie371a0c2445c9aededb5c9e26018d19cbd616358 Depends-On: If53a735458703f0bd2c094349edf86f38f05ccd7 --- M MultimediaViewerHooks.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: MarkTraceur: Looks good to me, approved jenkins-bot: Verified Jdlrobson: Looks good to me, approved diff --git a/MultimediaViewerHooks.php b/MultimediaViewerHooks.php index 71dd430..1064de3 100644 --- a/MultimediaViewerHooks.php +++ b/MultimediaViewerHooks.php @@ -158,7 +158,7 @@ global $wgMediaViewerEnableByDefault; if ( $wgMediaViewerEnableByDefault ) { - $defaultOptions['multimediaviewer-enable'] = true; + $defaultOptions['multimediaviewer-enable'] = 1; } return true; -- To view, visit https://gerrit.wikimedia.org/r/316706 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie371a0c2445c9aededb5c9e26018d19cbd616358 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: master Gerrit-Owner: Arseny1992Gerrit-Reviewer: Aarcos Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Jdlrobson Gerrit-Reviewer: MarkTraceur Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: HTMLSelectAndOtherField/HTMLSelectOrOtherField: Change how I...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380571 ) Change subject: HTMLSelectAndOtherField/HTMLSelectOrOtherField: Change how ID is handled in OOUI mode .. HTMLSelectAndOtherField/HTMLSelectOrOtherField: Change how ID is handled in OOUI mode Set the ID on the main widget (mw.widgets.SelectWithInputWidget), so that it can be infused by ID. The dropdown/textbox by themselves can't be infused individually, therefore IDs on them are pretty useless; remove those where they're not necessary. Follow-up to 8bd6605736c47259bd5f901284cbd2e639cef30c. Change-Id: If54dd48f1000e3e0f5a978428a5b622797b4f765 --- M includes/htmlform/fields/HTMLSelectAndOtherField.php M includes/htmlform/fields/HTMLSelectOrOtherField.php 2 files changed, 4 insertions(+), 5 deletions(-) Approvals: jenkins-bot: Verified VolkerE: Looks good to me, but someone else must approve Jforrester: Looks good to me, approved diff --git a/includes/htmlform/fields/HTMLSelectAndOtherField.php b/includes/htmlform/fields/HTMLSelectAndOtherField.php index 38b487a..910a053 100644 --- a/includes/htmlform/fields/HTMLSelectAndOtherField.php +++ b/includes/htmlform/fields/HTMLSelectAndOtherField.php @@ -72,11 +72,10 @@ # TextInput $textAttribs = [ - 'id' => $this->mID . '-other', 'name' => $this->mName . '-other', 'size' => $this->getSize(), 'class' => [ 'mw-htmlform-select-and-other-field' ], - 'data-id-select' => $this->mID, + 'data-id-select' => $this->mID . '-select', 'value' => $value[2], ]; @@ -100,7 +99,7 @@ # DropdownInput $dropdownInputAttribs = [ 'name' => $this->mName, - 'id' => $this->mID, + 'id' => $this->mID . '-select', 'options' => $this->getOptionsOOUI(), 'value' => $value[1], ]; @@ -119,6 +118,7 @@ } return $this->getInputWidget( [ + 'id' => $this->mID, 'textinput' => $textAttribs, 'dropdowninput' => $dropdownInputAttribs, 'or' => false, diff --git a/includes/htmlform/fields/HTMLSelectOrOtherField.php b/includes/htmlform/fields/HTMLSelectOrOtherField.php index a009b28..f6c0b07 100644 --- a/includes/htmlform/fields/HTMLSelectOrOtherField.php +++ b/includes/htmlform/fields/HTMLSelectOrOtherField.php @@ -85,7 +85,6 @@ # DropdownInput $dropdownAttribs = [ - 'id' => $this->mID, 'name' => $this->mName, 'options' => $this->getOptionsOOUI(), 'value' => $valInSelect ? $value : 'other', @@ -103,7 +102,6 @@ # TextInput $textAttribs = [ - 'id' => $this->mID . '-other', 'name' => $this->mName . '-other', 'size' => $this->getSize(), 'value' => $valInSelect ? '' : $value, @@ -130,6 +128,7 @@ } return $this->getInputWidget( [ + 'id' => $this->mID, 'textinput' => $textAttribs, 'dropdowninput' => $dropdownAttribs, 'or' => true, -- To view, visit https://gerrit.wikimedia.org/r/380571 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If54dd48f1000e3e0f5a978428a5b622797b4f765 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz DziewońskiGerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Prtksxna Gerrit-Reviewer: VolkerE Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Remove data-mw attributes before parsing summary
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/379902 ) Change subject: Remove data-mw attributes before parsing summary .. Remove data-mw attributes before parsing summary Bug: T176521 Change-Id: Ifd0c47114973fd7c1cc1c2231a52947b5dfcbe34 --- M lib/transformations/summarize.js M test/lib/transformations/summarize.js 2 files changed, 7 insertions(+), 0 deletions(-) Approvals: BearND: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/transformations/summarize.js b/lib/transformations/summarize.js index 342371c..bf9e205 100644 --- a/lib/transformations/summarize.js +++ b/lib/transformations/summarize.js @@ -3,6 +3,7 @@ const domino = require('domino'); const flattenElements = require('./flattenElements'); const rmElementsWithSelector = require('./rmElementsWithSelector'); +const removeAttributes = require('./removeAttributes'); /** * Recursively discard any parentheticals that themselves are inside parentheticals @@ -29,6 +30,7 @@ module.exports = function(html) { const doc = domino.createDocument(html); flattenElements(doc, 'a'); +removeAttributes(doc, '*', ['data-mw']); rmElementsWithSelector(doc, '.mw-ref, .reference'); rmElementsWithSelector(doc, '.noexcerpts'); rmElementsWithSelector(doc, 'math'); diff --git a/test/lib/transformations/summarize.js b/test/lib/transformations/summarize.js index 75d3532..b58e3a3 100644 --- a/test/lib/transformations/summarize.js +++ b/test/lib/transformations/summarize.js @@ -43,6 +43,11 @@ 'The Planck–Einstein relation connects the particulate photon energy E with its associated wave frequency f:\n\nhttp://www.w3.org/1998/Math/MathML\;>\n \n \n \nE\n=\n h\nf\n \n\n{\\displaystyle E=hf}\n \nhttps://wikimedia.org/api/rest_v1/media/math/render/svg/f39fac3593bb1e2dec0282c112c4dff7a99007f6\; class=\"mwe-math-fallback-image-inline\" aria-hidden=\"true\" style=\"vertical-align: -0.671ex; width:7.533ex; height:2.509ex;\">', 'The Planck–Einstein relation connects the particulate photon energy E with its associated wave frequency f:\n\nhttps://wikimedia.org/api/rest_v1/media/math/render/svg/f39fac3593bb1e2dec0282c112c4dff7a99007f6\; class=\"mwe-math-fallback-image-inline\" aria-hidden=\"true\" style=\"vertical-align: -0.671ex; width:7.533ex; height:2.509ex;\">' ], +// Any parentheticals inside a data-mw attribute are ignored. +[ +'Shakira Isabel Mebarak Ripoll (pronounced[(t)ʃaˈkiɾa isaˈβel meβaˈɾak riˈpol]; English: /ʃəˈkiːrə/; born 2 February 1977) is a Colombian singer, songwriter, dancer.', +'Shakira Isabel Mebarak Ripoll is a Colombian singer, songwriter, dancer.' +], // Any content in parentheticals is stripped and no double spaces are left in the output [ 'Epistemology (/ᵻˌpɪstᵻˈmɒlədʒi/(listen); from Greek ἐπιστήμη, epistēmē, meaning \'knowledge\', and λόγος, logos, meaning \'logical discourse\') is the branch of philosophy concerned with the theory of knowledge.', -- To view, visit https://gerrit.wikimedia.org/r/379902 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifd0c47114973fd7c1cc1c2231a52947b5dfcbe34 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: JdlrobsonGerrit-Reviewer: BearND Gerrit-Reviewer: Dbrant Gerrit-Reviewer: Fjalapeno Gerrit-Reviewer: GWicke Gerrit-Reviewer: Jdlrobson Gerrit-Reviewer: Mholloway Gerrit-Reviewer: Mhurd Gerrit-Reviewer: Mobrovac Gerrit-Reviewer: Ppchelko Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Hygiene: Break out removeAttributes transformation
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380581 ) Change subject: Hygiene: Break out removeAttributes transformation .. Hygiene: Break out removeAttributes transformation Allow this to be reused in other places. In particular it is needed in the page summary endpoint to scrub mw-data attributes Change-Id: Iab348c2a3f44c10f3202e62a27ed4d2538e604b7 --- A lib/transformations/removeAttributes.js M lib/transforms.js 2 files changed, 14 insertions(+), 11 deletions(-) Approvals: BearND: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/transformations/removeAttributes.js b/lib/transformations/removeAttributes.js new file mode 100644 index 000..88671a7 --- /dev/null +++ b/lib/transformations/removeAttributes.js @@ -0,0 +1,13 @@ +'use strict'; + +function removeAttributes(doc, selector, attributeArray) { +const ps = doc.querySelectorAll(selector) || []; +for (let idx = 0; idx < ps.length; idx++) { +const node = ps[idx]; +for (let aa = 0; aa < attributeArray.length; aa++) { +node.removeAttribute(attributeArray[aa]); +} +} +} + +module.exports = removeAttributes; diff --git a/lib/transforms.js b/lib/transforms.js index c10dbb1..59d3651 100644 --- a/lib/transforms.js +++ b/lib/transforms.js @@ -19,7 +19,7 @@ const extractLeadIntroduction = require('./transformations/extractLeadIntroduction'); const flattenElements = require('./transformations/flattenElements'); const summarize = require('./transformations/summarize'); - +const _rmAttributes = require('./transformations/removeAttributes'); const transforms = {}; const NodeType = @@ -70,16 +70,6 @@ if (/^\[|]$/.test(node.innerHTML)) { const bracket = doc.createTextNode(node.innerHTML); node.parentNode.replaceChild(bracket, node); -} -} -} - -function _rmAttributes(doc, selector, attributeArray) { -const ps = doc.querySelectorAll(selector) || []; -for (let idx = 0; idx < ps.length; idx++) { -const node = ps[idx]; -for (let aa = 0; aa < attributeArray.length; aa++) { -node.removeAttribute(attributeArray[aa]); } } } -- To view, visit https://gerrit.wikimedia.org/r/380581 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iab348c2a3f44c10f3202e62a27ed4d2538e604b7 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: JdlrobsonGerrit-Reviewer: BearND Gerrit-Reviewer: Dbrant Gerrit-Reviewer: Fjalapeno Gerrit-Reviewer: GWicke Gerrit-Reviewer: Mholloway Gerrit-Reviewer: Mhurd Gerrit-Reviewer: Mobrovac Gerrit-Reviewer: Ppchelko Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] oojs/ui[master]: MenuLayout: Rewrite support for 'expanded: false'
Bartosz Dziewoński has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380586 ) Change subject: MenuLayout: Rewrite support for 'expanded: false' .. MenuLayout: Rewrite support for 'expanded: false' I have just rediscovered the well-known fact that you can't have equal-height columns with CSS floats. Use tables instead. Also add examples with long contents to the demos to demostrate this, and wrap existing examples in a framed PanelLayout, which looks pretty. Follow-up to eb91004c67a62caab8fe798e31ff916e9dd3c315. Change-Id: I54392db9b3a9902de8622a6b5c8668093a5715cd --- M demos/classes/SampleTabPanel.js M demos/pages/widgets.js M src/layouts/MenuLayout.js M src/styles/layouts/MenuLayout.less M src/themes/apex/layouts.less M src/themes/wikimediaui/layouts.less 6 files changed, 94 insertions(+), 56 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/86/380586/1 diff --git a/demos/classes/SampleTabPanel.js b/demos/classes/SampleTabPanel.js index 03bce0d..39a7c6b 100644 --- a/demos/classes/SampleTabPanel.js +++ b/demos/classes/SampleTabPanel.js @@ -1,5 +1,7 @@ Demo.SampleTabPanel = function DemoSampleTabPanel( name, config ) { OO.ui.TabPanelLayout.call( this, name, config ); - this.$element.text( this.label ); + if ( this.$element.is( ':empty' ) ) { + this.$element.text( this.label ); + } }; OO.inheritClass( Demo.SampleTabPanel, OO.ui.TabPanelLayout ); diff --git a/demos/pages/widgets.js b/demos/pages/widgets.js index 2bb62ac..fb59153 100644 --- a/demos/pages/widgets.js +++ b/demos/pages/widgets.js @@ -2680,27 +2680,46 @@ new OO.ui.FieldLayout( new OO.ui.Widget( { content: [ - new OO.ui.BookletLayout( { + new OO.ui.PanelLayout( { expanded: false, - outlined: true - } ).addPages( [ - new Demo.SamplePage( 'first', { - expanded: false, - label: 'One' - } ), - new Demo.SamplePage( 'second', { - expanded: false, - label: 'Two' - } ), - new Demo.SamplePage( 'third', { - expanded: false, - label: 'Three' - } ), - new Demo.SamplePage( 'fourth', { - expanded: false, - label: 'Four' - } ) - ] ) + framed: true, + content: [ + new OO.ui.BookletLayout( { + expanded: false, + outlined: true + } ).addPages( [ + new Demo.SamplePage( 'first', { + expanded: false, + label: 'One' + } ), + new Demo.SamplePage( 'second', { + expanded: false, + label: 'Two' +
[MediaWiki-commits] [Gerrit] wikimedia...discovery-parent-pom[master]: Publish IntelliJ settings matching some of the checkstyle ru...
Gehel has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380585 ) Change subject: Publish IntelliJ settings matching some of the checkstyle rules. .. Publish IntelliJ settings matching some of the checkstyle rules. Change-Id: Idedf0caefa49f8513f8b02ba67f39e6824714a0c --- M discovery-build-tools/pom.xml A discovery-build-tools/src/assembly/intellij-config.xml A discovery-build-tools/src/editors/intellij/IntelliJ IDEA Global Settings A discovery-build-tools/src/editors/intellij/codestyles/Default.xml A discovery-build-tools/src/editors/intellij/installed.txt 5 files changed, 56 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/discovery-parent-pom refs/changes/85/380585/1 diff --git a/discovery-build-tools/pom.xml b/discovery-build-tools/pom.xml index d04fca2..df843a1 100644 --- a/discovery-build-tools/pom.xml +++ b/discovery-build-tools/pom.xml @@ -9,4 +9,27 @@ discovery-build-tools + + + +org.apache.maven.plugins +maven-assembly-plugin + + + src/assembly/intellij-config.xml + + + + +intellij-config-assembly + +single + +package + + + + + + diff --git a/discovery-build-tools/src/assembly/intellij-config.xml b/discovery-build-tools/src/assembly/intellij-config.xml new file mode 100644 index 000..6fea253 --- /dev/null +++ b/discovery-build-tools/src/assembly/intellij-config.xml @@ -0,0 +1,16 @@ +http://maven.apache.org/ASSEMBLY/2.0.0; +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; +xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd;> +intellij-config + +jar + +/ + + +${basedir}/src/editors/intellij/ +/ +true + + + diff --git a/discovery-build-tools/src/editors/intellij/IntelliJ IDEA Global Settings b/discovery-build-tools/src/editors/intellij/IntelliJ IDEA Global Settings new file mode 100644 index 000..e69de29 --- /dev/null +++ b/discovery-build-tools/src/editors/intellij/IntelliJ IDEA Global Settings diff --git a/discovery-build-tools/src/editors/intellij/codestyles/Default.xml b/discovery-build-tools/src/editors/intellij/codestyles/Default.xml new file mode 100644 index 000..48133de --- /dev/null +++ b/discovery-build-tools/src/editors/intellij/codestyles/Default.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/discovery-build-tools/src/editors/intellij/installed.txt b/discovery-build-tools/src/editors/intellij/installed.txt new file mode 100644 index 000..e69de29 --- /dev/null +++ b/discovery-build-tools/src/editors/intellij/installed.txt -- To view, visit https://gerrit.wikimedia.org/r/380585 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idedf0caefa49f8513f8b02ba67f39e6824714a0c Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/discovery-parent-pom Gerrit-Branch: master Gerrit-Owner: Gehel___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Bump src/ to deploy-2017-09-25 branch for deploy
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380579 ) Change subject: Bump src/ to deploy-2017-09-25 branch for deploy .. Bump src/ to deploy-2017-09-25 branch for deploy Change-Id: Id6f85d6f24366aede8b4d02b9ae64ed9e67d0eca --- M src 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/src b/src index 05a0965..4230c27 16 --- a/src +++ b/src @@ -1 +1 @@ -Subproject commit 05a09652402402c93c64ef899eb09ff825607c01 +Subproject commit 4230c27b7bca8d251380d2c8f973868bc8f98f77 -- To view, visit https://gerrit.wikimedia.org/r/380579 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id6f85d6f24366aede8b4d02b9ae64ed9e67d0eca Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/services/parsoid/deploy Gerrit-Branch: master Gerrit-Owner: ArlolraGerrit-Reviewer: Arlolra Gerrit-Reviewer: Subramanya Sastry Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Consolidation: Abolish window_background_color attribute.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380537 ) Change subject: Consolidation: Abolish window_background_color attribute. .. Consolidation: Abolish window_background_color attribute. Also clean up a couple of things along the way. Change-Id: I6d721569e1b22bf6c2053f872b558c61b03da7d4 --- M app/src/main/java/org/wikipedia/offline/DiskUsageView.java M app/src/main/java/org/wikipedia/views/SwipeableItemTouchHelperCallback.java M app/src/main/res/layout/activity_about.xml M app/src/main/res/layout/activity_create_account.xml M app/src/main/res/layout/activity_edit_section.xml M app/src/main/res/layout/activity_langlinks.xml M app/src/main/res/layout/activity_license.xml M app/src/main/res/layout/activity_login.xml M app/src/main/res/layout/activity_single_fragment.xml M app/src/main/res/layout/activity_single_fragment_with_toolbar.xml M app/src/main/res/layout/dialog_preference_languages.xml M app/src/main/res/layout/fragment_compilation_detail.xml M app/src/main/res/layout/fragment_description_edit.xml M app/src/main/res/layout/fragment_history.xml M app/src/main/res/layout/fragment_local_compilations.xml M app/src/main/res/layout/fragment_news.xml M app/src/main/res/layout/fragment_page_bottom_content.xml M app/src/main/res/layout/fragment_preview_edit.xml M app/src/main/res/layout/fragment_preview_summary.xml M app/src/main/res/layout/fragment_reading_list.xml M app/src/main/res/layout/fragment_reading_lists.xml M app/src/main/res/layout/fragment_remote_compilations.xml M app/src/main/res/layout/fragment_search_recent.xml M app/src/main/res/layout/fragment_search_results.xml M app/src/main/res/layout/group_captcha.xml M app/src/main/res/layout/view_description_edit_help.xml M app/src/main/res/layout/view_disk_usage.xml M app/src/main/res/layout/view_explore_overflow.xml M app/src/main/res/layout/view_search_empty.xml M app/src/main/res/values/attrs.xml M app/src/main/res/values/styles_dark.xml M app/src/main/res/values/styles_light.xml 32 files changed, 32 insertions(+), 48 deletions(-) Approvals: jenkins-bot: Verified Mholloway: Looks good to me, approved diff --git a/app/src/main/java/org/wikipedia/offline/DiskUsageView.java b/app/src/main/java/org/wikipedia/offline/DiskUsageView.java index 1c32063..d88cac0 100644 --- a/app/src/main/java/org/wikipedia/offline/DiskUsageView.java +++ b/app/src/main/java/org/wikipedia/offline/DiskUsageView.java @@ -78,7 +78,7 @@ usageAppText.setText(R.string.app_name); setDotTint(otherDot, R.attr.primary_text_color); setDotTint(usedDot, R.attr.colorAccent); -setDotTint(freeDot, R.attr.window_background_color); +setDotTint(freeDot, android.R.attr.windowBackground); update(0); } diff --git a/app/src/main/java/org/wikipedia/views/SwipeableItemTouchHelperCallback.java b/app/src/main/java/org/wikipedia/views/SwipeableItemTouchHelperCallback.java index 54695aa..4e586f5 100644 --- a/app/src/main/java/org/wikipedia/views/SwipeableItemTouchHelperCallback.java +++ b/app/src/main/java/org/wikipedia/views/SwipeableItemTouchHelperCallback.java @@ -28,7 +28,7 @@ deleteBackgroundPaint.setStyle(Paint.Style.FILL); deleteBackgroundPaint.setColor(Color.RED); itemBackgroundPaint.setStyle(Paint.Style.FILL); -itemBackgroundPaint.setColor(ResourceUtil.getThemedColor(context, R.attr.window_background_color)); +itemBackgroundPaint.setColor(ResourceUtil.getThemedColor(context, android.R.attr.windowBackground)); deleteIcon = ResourceUtil.bitmapFromVectorDrawable(context, R.drawable.ic_delete_white_24dp); } diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 1d24cd4..d7c03b2 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -6,9 +6,7 @@ xmlns:tools="http://schemas.android.com/tools; android:id="@+id/about_scrollview" android:layout_width="match_parent" -android:layout_height="match_parent" -android:background="?attr/window_background_color" -> +android:layout_height="match_parent"> http://schemas.android.com/apk/res-auto; xmlns:tools="http://schemas.android.com/tools; android:layout_width="match_parent" -android:layout_height="match_parent" -android:background="?attr/window_background_color"> +android:layout_height="match_parent"> diff --git a/app/src/main/res/layout/activity_edit_section.xml b/app/src/main/res/layout/activity_edit_section.xml index 618e2ed..10c9f5d 100644 --- a/app/src/main/res/layout/activity_edit_section.xml +++ b/app/src/main/res/layout/activity_edit_section.xml @@ -5,8 +5,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto; xmlns:tools="http://schemas.android.com/tools;
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: Remove PageLoadCallbacks and related references
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380573 ) Change subject: Hygiene: Remove PageLoadCallbacks and related references .. Hygiene: Remove PageLoadCallbacks and related references (unused) Change-Id: I1175e3e8a1b60422ba082e24c3e95322578d --- M app/src/main/java/org/wikipedia/page/PageActivity.java M app/src/main/java/org/wikipedia/page/PageFragment.java D app/src/main/java/org/wikipedia/page/PageLoadCallbacks.java 3 files changed, 0 insertions(+), 44 deletions(-) Approvals: jenkins-bot: Verified Cooltey: Looks good to me, approved diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java b/app/src/main/java/org/wikipedia/page/PageActivity.java index f9af558..d3acece 100644 --- a/app/src/main/java/org/wikipedia/page/PageActivity.java +++ b/app/src/main/java/org/wikipedia/page/PageActivity.java @@ -16,7 +16,6 @@ import android.os.Looper; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.annotation.VisibleForTesting; import android.support.design.widget.BottomSheetDialog; import android.support.design.widget.BottomSheetDialogFragment; import android.support.v4.app.Fragment; @@ -113,7 +112,6 @@ private PageToolbarHideHandler toolbarHideHandler; private ExclusiveBottomSheetPresenter bottomSheetPresenter = new ExclusiveBottomSheetPresenter(); -@Nullable private PageLoadCallbacks pageLoadCallbacks; private DialogInterface.OnDismissListener listDialogDismissListener = new DialogInterface.OnDismissListener() { @Override @@ -558,12 +556,6 @@ hideSoftKeyboard(); } -@Nullable -@Override -public PageLoadCallbacks onPageGetPageLoadCallbacks() { -return pageLoadCallbacks; -} - @Override public void onPageLoadPage(@NonNull PageTitle title, @NonNull HistoryEntry entry, @NonNull TabPosition tabPosition) { @@ -877,11 +869,6 @@ .setPositiveButton(android.R.string.ok, null) .create() .show(); -} - -@VisibleForTesting -public void setPageLoadCallbacks(@Nullable PageLoadCallbacks pageLoadCallbacks) { -this.pageLoadCallbacks = pageLoadCallbacks; } @SuppressLint("CommitTransaction") diff --git a/app/src/main/java/org/wikipedia/page/PageFragment.java b/app/src/main/java/org/wikipedia/page/PageFragment.java index d86f641..de1d659 100755 --- a/app/src/main/java/org/wikipedia/page/PageFragment.java +++ b/app/src/main/java/org/wikipedia/page/PageFragment.java @@ -120,7 +120,6 @@ @Nullable ActionMode onPageStartSupportActionMode(@NonNull ActionMode.Callback callback); void onPageShowToolbar(); void onPageHideSoftKeyboard(); -@Nullable PageLoadCallbacks onPageGetPageLoadCallbacks(); void onPageAddToReadingList(@NonNull PageTitle title, @NonNull AddToReadingListDialog.InvokeSource source); void onPageRemoveFromReadingLists(@NonNull PageTitle title); @@ -903,10 +902,6 @@ // TODO: update this title in the db to be queued for saving by the service. checkAndShowSelectTextOnboarding(); - -if (getPageLoadCallbacks() != null) { -getPageLoadCallbacks().onLoadComplete(); -} } public void onPageLoadError(@NonNull Throwable caught) { @@ -939,10 +934,6 @@ errorState = true; if (callback() != null) { callback().onPageLoadError(getTitle()); -} - -if (getPageLoadCallbacks() != null) { -getPageLoadCallbacks().onLoadError(caught); } } @@ -1390,16 +1381,6 @@ if (callback != null) { callback.onPageHideSoftKeyboard(); } -} - -@Nullable -private PageLoadCallbacks getPageLoadCallbacks() { -PageLoadCallbacks callbacks = null; -Callback callback = callback(); -if (callback != null) { -callbacks = callback.onPageGetPageLoadCallbacks(); -} -return callbacks; } public void addToReadingList(@NonNull AddToReadingListDialog.InvokeSource source) { diff --git a/app/src/main/java/org/wikipedia/page/PageLoadCallbacks.java b/app/src/main/java/org/wikipedia/page/PageLoadCallbacks.java deleted file mode 100644 index 8383bf7..000 --- a/app/src/main/java/org/wikipedia/page/PageLoadCallbacks.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.wikipedia.page; - -import android.support.annotation.NonNull; - -/** - * Callback methods for page load state feedback - */ -public interface PageLoadCallbacks { -/** Called when page has finished loading */ -void onLoadComplete(); -void onLoadError(@NonNull Throwable e); -} -- To view, visit https://gerrit.wikimedia.org/r/380573 To unsubscribe, visit
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Properly tint ImageViews with colors that have alpha.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380512 ) Change subject: Properly tint ImageViews with colors that have alpha. .. Properly tint ImageViews with colors that have alpha. I've discovered the magic combination of attributes that allows us to override (tint + src_in) the color of an ImageView: - Specify "app:tint" instead of "android:tint", and then specify "app:tintMode". - Unfortunately, use the fully-qualified AppCompatImageView instead of ImageView, since this is the only way it passes Lint. Change-Id: Iad39dcdbf32e4024f30a71a6e430bcf9bfa664e4 --- M app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java M app/src/main/res/layout/dialog_link_preview.xml M app/src/main/res/layout/dialog_share_preview.xml M app/src/main/res/layout/inflate_create_account_onboarding.xml M app/src/main/res/layout/item_page_list_entry.xml M app/src/main/res/layout/view_compilation_download_widget.xml M app/src/main/res/layout/view_link_preview_error.xml M app/src/main/res/layout/view_list_card_item.xml M app/src/main/res/layout/view_page_header.xml M app/src/main/res/layout/view_search_bar.xml M app/src/main/res/values/attrs.xml M app/src/main/res/values/styles_dark.xml M app/src/main/res/values/styles_light.xml 13 files changed, 45 insertions(+), 48 deletions(-) Approvals: jenkins-bot: Verified Mholloway: Looks good to me, approved diff --git a/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java b/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java index a52fbfd..43cba09 100644 --- a/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java +++ b/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderView.java @@ -10,7 +10,6 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; -import android.support.v4.content.ContextCompat; import android.support.v7.widget.PopupMenu; import android.text.Spannable; import android.text.SpannableString; @@ -173,8 +172,8 @@ } public void setProtected(boolean isProtected) { -editPencil.setImageDrawable(ContextCompat.getDrawable(getContext(), isProtected -? R.drawable.ic_edit_lock_24px : R.drawable.ic_mode_edit_white_24dp)); +editPencil.setImageResource(isProtected +? R.drawable.ic_edit_lock_24px : R.drawable.ic_mode_edit_white_24dp); } public void setLocale(@NonNull String locale) { diff --git a/app/src/main/res/layout/dialog_link_preview.xml b/app/src/main/res/layout/dialog_link_preview.xml index 5396970..5277fc7 100755 --- a/app/src/main/res/layout/dialog_link_preview.xml +++ b/app/src/main/res/layout/dialog_link_preview.xml @@ -49,7 +49,7 @@ android:maxLines="3" android:ellipsize="end" tools:text="Lorem ipsum" /> - +app:tint="?attr/material_theme_secondary_color" +app:tintMode="src_in"/> - - +app:srcCompat="@drawable/ic_check_black_24dp" +app:tint="?attr/material_theme_secondary_color" +app:tintMode="src_in" /> - +app:srcCompat="@drawable/ic_check_black_24dp" +app:tint="?attr/material_theme_secondary_color" +app:tintMode="src_in" /> - +app:srcCompat="@drawable/ic_check_black_24dp" +app:tint="?attr/material_theme_secondary_color" +app:tintMode="src_in" /> - diff --git a/app/src/main/res/layout/view_compilation_download_widget.xml b/app/src/main/res/layout/view_compilation_download_widget.xml index ab3a93f..5d26bcf 100644 --- a/app/src/main/res/layout/view_compilation_download_widget.xml +++ b/app/src/main/res/layout/view_compilation_download_widget.xml @@ -46,13 +46,14 @@ - diff --git a/app/src/main/res/layout/view_link_preview_error.xml b/app/src/main/res/layout/view_link_preview_error.xml index dedd11d..9deb7fa 100644 --- a/app/src/main/res/layout/view_link_preview_error.xml +++ b/app/src/main/res/layout/view_link_preview_error.xml @@ -1,14 +1,15 @@ http://schemas.android.com/apk/res/android; xmlns:app="http://schemas.android.com/apk/res-auto;> - - diff --git a/app/src/main/res/layout/view_page_header.xml b/app/src/main/res/layout/view_page_header.xml index 436339c..28b2c48 100644 --- a/app/src/main/res/layout/view_page_header.xml +++ b/app/src/main/res/layout/view_page_header.xml @@ -63,7 +63,7 @@ android:background="@color/base70"/> - diff --git a/app/src/main/res/layout/view_search_bar.xml b/app/src/main/res/layout/view_search_bar.xml index 90215e7..5c71560 100644 ---
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Make onboarding gradient background global by default.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380519 ) Change subject: Make onboarding gradient background global by default. .. Make onboarding gradient background global by default. I noticed that the "initial" onboarding screens have a background that scrolls along with the pager, which isn't quite right. This patch enables the background to be for the whole layout (istead of per-page), while allowing certain onboarding screens like the Offline tutorial to have per- page backgrounds. Change-Id: Ia1aad5792086911986ff0a931f86f7cfccaf32ad --- M app/src/main/java/org/wikipedia/descriptions/DescriptionEditTutorialFragment.java M app/src/main/java/org/wikipedia/offline/OfflineTutorialFragment.java M app/src/main/java/org/wikipedia/onboarding/InitialOnboardingFragment.java M app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java M app/src/main/res/layout/inflate_description_edit_tutorial_page_one.xml M app/src/main/res/layout/inflate_description_edit_tutorial_page_two.xml M app/src/main/res/layout/inflate_initial_onboarding_page_one.xml M app/src/main/res/layout/inflate_initial_onboarding_page_three.xml M app/src/main/res/layout/inflate_initial_onboarding_page_two.xml 9 files changed, 23 insertions(+), 11 deletions(-) Approvals: jenkins-bot: Verified Mholloway: Looks good to me, approved diff --git a/app/src/main/java/org/wikipedia/descriptions/DescriptionEditTutorialFragment.java b/app/src/main/java/org/wikipedia/descriptions/DescriptionEditTutorialFragment.java index cdc8b60..9795906 100644 --- a/app/src/main/java/org/wikipedia/descriptions/DescriptionEditTutorialFragment.java +++ b/app/src/main/java/org/wikipedia/descriptions/DescriptionEditTutorialFragment.java @@ -21,4 +21,9 @@ protected int getDoneButtonText() { return R.string.description_edit_tutorial_button_label_start_editing; } + +@Override +protected int getBackgroundResId() { +return R.drawable.onboarding_gradient_background_90; +} } diff --git a/app/src/main/java/org/wikipedia/offline/OfflineTutorialFragment.java b/app/src/main/java/org/wikipedia/offline/OfflineTutorialFragment.java index ea0c856..a8cdfe5 100644 --- a/app/src/main/java/org/wikipedia/offline/OfflineTutorialFragment.java +++ b/app/src/main/java/org/wikipedia/offline/OfflineTutorialFragment.java @@ -40,6 +40,11 @@ return R.string.offline_library_onboarding_button_done; } +@Override +protected int getBackgroundResId() { +return R.drawable.onboarding_gradient_background_offline; +} + private BackgroundGradientOnPageChangeListener.MutatableGradientColors getBackgroundGradientColors() { List startColors = new ArrayList<>(); List centerColors = new ArrayList<>(); diff --git a/app/src/main/java/org/wikipedia/onboarding/InitialOnboardingFragment.java b/app/src/main/java/org/wikipedia/onboarding/InitialOnboardingFragment.java index 0a022cf..9f78cbc 100644 --- a/app/src/main/java/org/wikipedia/onboarding/InitialOnboardingFragment.java +++ b/app/src/main/java/org/wikipedia/onboarding/InitialOnboardingFragment.java @@ -35,6 +35,10 @@ return R.string.onboarding_get_started; } +@Override protected int getBackgroundResId() { +return R.drawable.onboarding_gradient_background_135; +} + @Override public void onActivityResult(int requestCode, int resultCode, final Intent data) { if (requestCode == Constants.ACTIVITY_REQUEST_LOGIN && resultCode == LoginActivity.RESULT_LOGIN_SUCCESS) { diff --git a/app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java b/app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java index 5bdb23c..073acca 100644 --- a/app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java +++ b/app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java @@ -2,6 +2,7 @@ import android.graphics.drawable.GradientDrawable; import android.os.Bundle; +import android.support.annotation.DrawableRes; import android.support.annotation.StringRes; import android.support.v4.app.Fragment; import android.support.v4.content.ContextCompat; @@ -42,6 +43,8 @@ @StringRes protected abstract int getDoneButtonText(); +@DrawableRes protected abstract int getBackgroundResId(); + protected ViewPager getViewPager() { return viewPager; } @@ -54,7 +57,7 @@ super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_onboarding_pager, container, false); unbinder = ButterKnife.bind(this, view); -background = (GradientDrawable) ContextCompat.getDrawable(getContext(), R.drawable.onboarding_gradient_background_offline); +background = (GradientDrawable) ContextCompat.getDrawable(getContext(), getBackgroundResId()); background.mutate();