[MediaWiki-commits] [Gerrit] Show suggestions in the dashboard only if enabled - change (mediawiki...ContentTranslation)

2015-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Show suggestions in the dashboard only if enabled
..


Show suggestions in the dashboard only if enabled

Uses the variable $wgContentTranslationEnableSuggestions,
which was introduced in
I62b168957c4a9e2d0518fdbb48d6ceec44bf5dbd

Also avoid the api request to load suggestion when
disabled.

Bug: T111960
Change-Id: I02eb423eb92c570d4f38aee8107f10153e1fa7fb
---
M ContentTranslation.hooks.php
M modules/dashboard/ext.cx.dashboard.js
2 files changed, 23 insertions(+), 13 deletions(-)

Approvals:
  KartikMistry: Looks good to me, but someone else must approve
  Santhosh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php
index 8182cdd..c910ef2 100644
--- a/ContentTranslation.hooks.php
+++ b/ContentTranslation.hooks.php
@@ -164,6 +164,7 @@
public static function addConfig( array &$vars ) {
global $wgContentTranslationTranslateInTarget,
$wgContentTranslationDomainCodeMapping,
+   $wgContentTranslationEnableSuggestions,
$wgContentTranslationExperimentalFeatures,
$wgContentTranslationDatabase,
$wgContentTranslationSiteTemplates,
@@ -174,6 +175,7 @@
 
$vars['wgContentTranslationTranslateInTarget'] = 
$wgContentTranslationTranslateInTarget;
$vars['wgContentTranslationDomainCodeMapping'] = 
$wgContentTranslationDomainCodeMapping;
+   $vars['wgContentTranslationEnableSuggestions'] = 
$wgContentTranslationEnableSuggestions;
$vars['wgContentTranslationExperimentalFeatures'] = 
$wgContentTranslationExperimentalFeatures;
$vars['wgContentTranslationDatabase'] = 
$wgContentTranslationDatabase;
$vars['wgContentTranslationSiteTemplates'] = 
$wgContentTranslationSiteTemplates;
diff --git a/modules/dashboard/ext.cx.dashboard.js 
b/modules/dashboard/ext.cx.dashboard.js
index 13d6f87..fd367b2 100644
--- a/modules/dashboard/ext.cx.dashboard.js
+++ b/modules/dashboard/ext.cx.dashboard.js
@@ -43,7 +43,9 @@
 */
CXDashboard.prototype.initLists = function () {
this.renderTranslations();
-   this.renderTranslationSuggestions();
+   if ( mw.config.get( 'wgContentTranslationEnableSuggestions' ) ) 
{
+   this.renderTranslationSuggestions();
+   }
};
 
/**
@@ -170,19 +172,23 @@
};
 
CXDashboard.prototype.buildTranslationList = function () {
-   var $sourceLanguageContainer, $filterTabs, 
$targetLanguageContainer;
+   var $sourceLanguageContainer, $targetLanguageContainer,
+   $filterTabs = [];
 
-   $filterTabs = [
-   $( '' )
+   if ( mw.config.get( 'wgContentTranslationEnableSuggestions' ) ) 
{
+   $filterTabs.push( $( '' )
.addClass( 'cx-filter cx-suggestions 
mw-ui-input' )
-   .text( mw.msg( 
'cx-translation-filter-suggested-translations' ) ),
-   $( '' )
-   .addClass( 'cx-filter cx-filter--draft 
cx-filter--selected mw-ui-input' )
-   .text( mw.msg( 
'cx-translation-filter-draft-translations' ) ),
-   $( '' )
-   .addClass( 'cx-filter cx-filter--published 
mw-ui-input' )
-   .text( mw.msg( 
'cx-translation-filter-published-translations' ) )
-   ];
+   .text( mw.msg( 
'cx-translation-filter-suggested-translations' ) ) );
+   }
+
+   $filterTabs.push( $( '' )
+   .addClass( 'cx-filter cx-filter--draft 
cx-filter--selected mw-ui-input' )
+   .text( mw.msg( 
'cx-translation-filter-draft-translations' ) ) );
+
+   $filterTabs.push( $( '' )
+   .addClass( 'cx-filter cx-filter--published mw-ui-input' 
)
+   .text( mw.msg( 
'cx-translation-filter-published-translations' ) ) );
+
this.$listHeader = $( '' ).addClass( 'translation-filter' 
);
this.$newTranslationButton = $( '' )
.addClass( 'cx-cta__new-translation mw-ui-button 
mw-ui-constructive' )
@@ -318,7 +324,9 @@
this.translationList.filters[ type ] = value;
this.translationList.applyFilters( 
this.translationList.filters );
this.translationList.$translationsList.show();
-   this.suggestionList.$suggestionList.hide();
+   if ( mw.config.get( 
'wgContentTranslationEnableSuggestions' ) ) {
+  

[MediaWiki-commits] [Gerrit] Show suggestions in the dashboard only if enabled - change (mediawiki...ContentTranslation)

2015-09-09 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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

Change subject: Show suggestions in the dashboard only if enabled
..

Show suggestions in the dashboard only if enabled

Uses the variable $wgContentTranslationEnableSuggestions,
which was introduced in
I62b168957c4a9e2d0518fdbb48d6ceec44bf5dbd

Bug: T111960
Change-Id: I02eb423eb92c570d4f38aee8107f10153e1fa7fb
---
M ContentTranslation.hooks.php
M modules/dashboard/ext.cx.dashboard.js
2 files changed, 17 insertions(+), 11 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/53/237153/1

diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php
index 8182cdd..c910ef2 100644
--- a/ContentTranslation.hooks.php
+++ b/ContentTranslation.hooks.php
@@ -164,6 +164,7 @@
public static function addConfig( array &$vars ) {
global $wgContentTranslationTranslateInTarget,
$wgContentTranslationDomainCodeMapping,
+   $wgContentTranslationEnableSuggestions,
$wgContentTranslationExperimentalFeatures,
$wgContentTranslationDatabase,
$wgContentTranslationSiteTemplates,
@@ -174,6 +175,7 @@
 
$vars['wgContentTranslationTranslateInTarget'] = 
$wgContentTranslationTranslateInTarget;
$vars['wgContentTranslationDomainCodeMapping'] = 
$wgContentTranslationDomainCodeMapping;
+   $vars['wgContentTranslationEnableSuggestions'] = 
$wgContentTranslationEnableSuggestions;
$vars['wgContentTranslationExperimentalFeatures'] = 
$wgContentTranslationExperimentalFeatures;
$vars['wgContentTranslationDatabase'] = 
$wgContentTranslationDatabase;
$vars['wgContentTranslationSiteTemplates'] = 
$wgContentTranslationSiteTemplates;
diff --git a/modules/dashboard/ext.cx.dashboard.js 
b/modules/dashboard/ext.cx.dashboard.js
index 13d6f87..2b34282 100644
--- a/modules/dashboard/ext.cx.dashboard.js
+++ b/modules/dashboard/ext.cx.dashboard.js
@@ -170,19 +170,23 @@
};
 
CXDashboard.prototype.buildTranslationList = function () {
-   var $sourceLanguageContainer, $filterTabs, 
$targetLanguageContainer;
+   var $sourceLanguageContainer, $targetLanguageContainer,
+   $filterTabs = [];
 
-   $filterTabs = [
-   $( '' )
+   if ( mw.config.get( 'wgContentTranslationEnableSuggestions' ) ) 
{
+   $filterTabs.push( $( '' )
.addClass( 'cx-filter cx-suggestions 
mw-ui-input' )
-   .text( mw.msg( 
'cx-translation-filter-suggested-translations' ) ),
-   $( '' )
-   .addClass( 'cx-filter cx-filter--draft 
cx-filter--selected mw-ui-input' )
-   .text( mw.msg( 
'cx-translation-filter-draft-translations' ) ),
-   $( '' )
-   .addClass( 'cx-filter cx-filter--published 
mw-ui-input' )
-   .text( mw.msg( 
'cx-translation-filter-published-translations' ) )
-   ];
+   .text( mw.msg( 
'cx-translation-filter-suggested-translations' ) ) );
+   }
+
+   $filterTabs.push( $( '' )
+   .addClass( 'cx-filter cx-suggestions mw-ui-input' )
+   .text( mw.msg( 
'cx-translation-filter-draft-translations' ) ) );
+
+   $filterTabs.push( $( '' )
+   .addClass( 'cx-filter cx-filter--published mw-ui-input' 
)
+   .text( mw.msg( 
'cx-translation-filter-published-translations' ) ) );
+
this.$listHeader = $( '' ).addClass( 'translation-filter' 
);
this.$newTranslationButton = $( '' )
.addClass( 'cx-cta__new-translation mw-ui-button 
mw-ui-constructive' )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02eb423eb92c570d4f38aee8107f10153e1fa7fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Show suggestions in the dashboard only if enabled - change (mediawiki...ContentTranslation)

2015-08-31 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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

Change subject: Show suggestions in the dashboard only if enabled
..

Show suggestions in the dashboard only if enabled

Uses the variable $wgContentTranslationEnableSuggestions,
which was introduced in
I62b168957c4a9e2d0518fdbb48d6ceec44bf5dbd

Change-Id: I9ae46466ab8647b268bfe2aaa23deebc1e633cee
---
M ContentTranslation.hooks.php
M modules/dashboard/ext.cx.dashboard.js
2 files changed, 17 insertions(+), 11 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/16/235016/1

diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php
index 3875cd4..91ed69a 100644
--- a/ContentTranslation.hooks.php
+++ b/ContentTranslation.hooks.php
@@ -154,6 +154,7 @@
public static function addConfig( array &$vars ) {
global $wgContentTranslationTranslateInTarget,
$wgContentTranslationDomainCodeMapping,
+   $wgContentTranslationEnableSuggestions,
$wgContentTranslationExperimentalFeatures,
$wgContentTranslationDatabase,
$wgContentTranslationSiteTemplates,
@@ -164,6 +165,7 @@
 
$vars['wgContentTranslationTranslateInTarget'] = 
$wgContentTranslationTranslateInTarget;
$vars['wgContentTranslationDomainCodeMapping'] = 
$wgContentTranslationDomainCodeMapping;
+   $vars['wgContentTranslationEnableSuggestions'] = 
$wgContentTranslationEnableSuggestions;
$vars['wgContentTranslationExperimentalFeatures'] = 
$wgContentTranslationExperimentalFeatures;
$vars['wgContentTranslationDatabase'] = 
$wgContentTranslationDatabase;
$vars['wgContentTranslationSiteTemplates'] = 
$wgContentTranslationSiteTemplates;
diff --git a/modules/dashboard/ext.cx.dashboard.js 
b/modules/dashboard/ext.cx.dashboard.js
index 1da1050..4cc835d 100644
--- a/modules/dashboard/ext.cx.dashboard.js
+++ b/modules/dashboard/ext.cx.dashboard.js
@@ -231,19 +231,23 @@
};
 
CXDashboard.prototype.buildTranslationList = function () {
-   var $sourceLanguageContainer, $filterTabs, 
$targetLanguageContainer;
+   var $sourceLanguageContainer, $targetLanguageContainer,
+   $filterTabs = [];
 
-   $filterTabs = [
-   $( '' )
+   if ( mw.config.get( 'wgContentTranslationEnableSuggestions' ) ) 
{
+   $filterTabs.push( $( '' )
.addClass( 'cx-status cx-suggestions 
mw-ui-input' )
-   .text( mw.msg( 
'cx-translation-filter-suggested-translations' ) ),
-   $( '' )
-   .addClass( 'cx-status cx-status--draft 
cx-status--selected mw-ui-input' )
-   .text( mw.msg( 
'cx-translation-filter-draft-translations' ) ),
-   $( '' )
-   .addClass( 'cx-status cx-status--published 
mw-ui-input' )
-   .text( mw.msg( 
'cx-translation-filter-published-translations' ) )
-   ];
+   .text( mw.msg( 
'cx-translation-filter-suggested-translations' ) ) );
+   }
+
+   $filterTabs.push( $( '' )
+   .addClass( 'cx-status cx-status--draft 
cx-status--selected mw-ui-input' )
+   .text( mw.msg( 
'cx-translation-filter-draft-translations' ) ) );
+
+   $filterTabs.push( $( '' )
+   .addClass( 'cx-status cx-status--published mw-ui-input' 
)
+   .text( mw.msg( 
'cx-translation-filter-published-translations' ) ) )
+
// TODO: The classname cx-status for above tabs does not make 
since
// we added suggestions there. Need renaming.
this.$listHeader = $( '' ).addClass( 'translation-filter' 
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ae46466ab8647b268bfe2aaa23deebc1e633cee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits