[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Improve layout of special page

2017-06-27 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/359906 )

Change subject: Improve layout of special page
..


Improve layout of special page

- Use OO.ui.
- Remove the width limitation, which is not present on similar special
  pages (Special:NewItem, Special:SetLabel, …).
- Change the two explanation divs with a line break between them to a
  single explanation div containing two paragraphs.

Change-Id: I1273d183621f0a11aa49a0fd54303a87faa81481
---
M modules/SpecialConstraintReportPage.css
M specials/SpecialConstraintReport.php
M tests/phpunit/Specials/SpecialConstraintReportTest.php
3 files changed, 27 insertions(+), 28 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/SpecialConstraintReportPage.css 
b/modules/SpecialConstraintReportPage.css
index efe4657..faf0d85 100644
--- a/modules/SpecialConstraintReportPage.css
+++ b/modules/SpecialConstraintReportPage.css
@@ -1,11 +1,6 @@
 /* Entity id form */
 form {
margin-bottom: 20px;
-   width: 250px;
-}
-
-.wbqc-constraintreport-form-entity-id {
-   width: 120px;
 }
 
 /* Notices */
@@ -16,11 +11,6 @@
 .wbqc-constraintreport-notice-error {
font-weight: bold;
color: #ba;
-}
-
-/* Explanation infobox */
-.wbqc-explanation {
-   width: 50%;
 }
 
 /* Statuses */
diff --git a/specials/SpecialConstraintReport.php 
b/specials/SpecialConstraintReport.php
index b6bd285..9c51150 100644
--- a/specials/SpecialConstraintReport.php
+++ b/specials/SpecialConstraintReport.php
@@ -266,7 +266,7 @@
'placeholder' => $this->msg( 
'wbqc-constraintreport-form-entityid-placeholder' )->escaped()
]
];
-   $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 
'wbqc-constraintreport-form' );
+   $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, 
$this->getContext(), 'wbqc-constraintreport-form' );
$htmlForm->setSubmitText( $this->msg( 
'wbqc-constraintreport-form-submit-label' )->escaped() );
$htmlForm->setSubmitCallback( function() {
return false;
@@ -312,16 +312,19 @@
 */
private function getExplanationText() {
return Html::rawElement(
-   'div',
-   [ 'class' => 'wbqc-explanation' ],
+   'div',
+   [ 'class' => 'wbqc-explanation' ],
+   Html::rawElement(
+   'p',
+   [],
$this->msg( 
'wbqc-constraintreport-explanation-part-one' )->escaped()
)
-   . Html::element( 'br' )
. Html::rawElement(
-   'div',
-   [ 'class' => 'wbqc-explanation' ],
+   'p',
+   [],
$this->msg( 
'wbqc-constraintreport-explanation-part-two' )->escaped()
-   );
+   )
+   );
}
 
/**
diff --git a/tests/phpunit/Specials/SpecialConstraintReportTest.php 
b/tests/phpunit/Specials/SpecialConstraintReportTest.php
index 87ff139..3f7b1e3 100644
--- a/tests/phpunit/Specials/SpecialConstraintReportTest.php
+++ b/tests/phpunit/Specials/SpecialConstraintReportTest.php
@@ -167,23 +167,29 @@
$matchers = [];
 
// Empty input
-   $matchers['explanationOne'] = both( withTagName( 'div' ) )
+   $matchers['explanationOne'] = both( withTagName( 'p' ) )
->andAlso( havingTextContents( 
'(wbqc-constraintreport-explanation-part-one)' ) );
 
-   $matchers['explanationTwo'] = both( withTagName( 'div' ) )
+   $matchers['explanationTwo'] = both( withTagName( 'p' ) )
->andAlso( havingTextContents( 
'(wbqc-constraintreport-explanation-part-two)' ) );
 
-   $matchers['entityId'] = tagMatchingOutline(
-   ''
+   $matchers['entityId'] = both(
+   tagMatchingOutline( '' )
+   )->andAlso(
+   havingChild( tagMatchingOutline(
+   ''
+   ) )
);
 
-   $matchers['submit'] = tagMatchingOutline(
-   ''
+   $matchers['submit'] = both(
+   tagMatchingOutline( '' )
+   )->andAlso(
+   havingChild( allOf(
+   withTagName( 'span' ),
+   havingTextContents( 
'(wbqc-constraintreport-form-submit-label)' )
+   ) )

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Improve layout of special page

2017-06-19 Thread Lucas Werkmeister (WMDE) (Code Review)
Lucas Werkmeister (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/359906 )

Change subject: Improve layout of special page
..

Improve layout of special page

- Use OO.ui.
- Remove the width limitation, which is not present on similar special
  pages (Special:NewItem, Special:SetLabel, …).
- Change the two explanation divs with a line break between them to a
  single explanation div containing two paragraphs.

Change-Id: I1273d183621f0a11aa49a0fd54303a87faa81481
---
M modules/SpecialConstraintReportPage.css
M specials/SpecialConstraintReport.php
2 files changed, 10 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/06/359906/1

diff --git a/modules/SpecialConstraintReportPage.css 
b/modules/SpecialConstraintReportPage.css
index efe4657..faf0d85 100644
--- a/modules/SpecialConstraintReportPage.css
+++ b/modules/SpecialConstraintReportPage.css
@@ -1,11 +1,6 @@
 /* Entity id form */
 form {
margin-bottom: 20px;
-   width: 250px;
-}
-
-.wbqc-constraintreport-form-entity-id {
-   width: 120px;
 }
 
 /* Notices */
@@ -16,11 +11,6 @@
 .wbqc-constraintreport-notice-error {
font-weight: bold;
color: #ba;
-}
-
-/* Explanation infobox */
-.wbqc-explanation {
-   width: 50%;
 }
 
 /* Statuses */
diff --git a/specials/SpecialConstraintReport.php 
b/specials/SpecialConstraintReport.php
index b6bd285..9c51150 100644
--- a/specials/SpecialConstraintReport.php
+++ b/specials/SpecialConstraintReport.php
@@ -266,7 +266,7 @@
'placeholder' => $this->msg( 
'wbqc-constraintreport-form-entityid-placeholder' )->escaped()
]
];
-   $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 
'wbqc-constraintreport-form' );
+   $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, 
$this->getContext(), 'wbqc-constraintreport-form' );
$htmlForm->setSubmitText( $this->msg( 
'wbqc-constraintreport-form-submit-label' )->escaped() );
$htmlForm->setSubmitCallback( function() {
return false;
@@ -312,16 +312,19 @@
 */
private function getExplanationText() {
return Html::rawElement(
-   'div',
-   [ 'class' => 'wbqc-explanation' ],
+   'div',
+   [ 'class' => 'wbqc-explanation' ],
+   Html::rawElement(
+   'p',
+   [],
$this->msg( 
'wbqc-constraintreport-explanation-part-one' )->escaped()
)
-   . Html::element( 'br' )
. Html::rawElement(
-   'div',
-   [ 'class' => 'wbqc-explanation' ],
+   'p',
+   [],
$this->msg( 
'wbqc-constraintreport-explanation-part-two' )->escaped()
-   );
+   )
+   );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1273d183621f0a11aa49a0fd54303a87faa81481
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) 

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