r46038 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46037‎ | r46038 | r46039 >
Date:22:37, 22 January 2009
Author:tparscal
Status:deferred
Tags:
Comment:
Added additional confirmation requirements to removals. Fixed some UI issues with removal pages. Removed notes from native model rows. Added notes to all components as meta fields.
Modified paths:
  • /trunk/extensions/DataCenter/Controllers/Plans.php (modified) (history)
  • /trunk/extensions/DataCenter/Controllers/Settings.php (modified) (history)
  • /trunk/extensions/DataCenter/DataCenter.db.php (modified) (history)
  • /trunk/extensions/DataCenter/DataCenter.i18n.php (modified) (history)
  • /trunk/extensions/DataCenter/DataCenter.sql (modified) (history)
  • /trunk/extensions/DataCenter/UI/Widgets/Table.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Models.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Plans/Object.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Plans/Plan.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Plans/Rack.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Settings/Field.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataCenter/DataCenter.db.php
@@ -2233,7 +2233,7 @@
22342234 }
22352235 }
22362236
2237 -class DataCenterDBPlan extends DataCenterDBComponent {
 2237+class DataCenterDBPlan extends DataCenterDBRow {
22382238
22392239 /* Protected Members */
22402240
Index: trunk/extensions/DataCenter/Controllers/Plans.php
@@ -92,6 +92,13 @@
9393 array $data,
9494 $type
9595 ) {
 96+ // Checks for confirmation
 97+ if (
 98+ !isset( $data['row']['confirm'] ) ||
 99+ ( $data['row']['confirm'] != 'yes' )
 100+ ) {
 101+ return false;
 102+ }
96103 switch ( $type ) {
97104 case 'plan':
98105 $plan = DataCenterDBPlan::newFromValues( $data['row'] );
Index: trunk/extensions/DataCenter/Controllers/Settings.php
@@ -59,6 +59,13 @@
6060 array $data,
6161 $type
6262 ) {
 63+ // Checks for confirmation
 64+ if (
 65+ !isset( $data['row']['confirm'] ) ||
 66+ ( $data['row']['confirm'] != 'yes' )
 67+ ) {
 68+ return false;
 69+ }
6370 switch ( $type ) {
6471 case 'field':
6572 $field = DataCenterDBMetaField::newFromValues( $data['row'] );
Index: trunk/extensions/DataCenter/DataCenter.sql
@@ -98,8 +98,6 @@
9999 mdl_rak_name VARBINARY(255) NOT NULL default '',
100100 -- Kind of this rack model
101101 mdl_rak_kind VARBINARY(255) NOT NULL default '',
102 - -- Note about this rack model
103 - mdl_rak_note BLOB,
104102 -- Number of vertical rack units this rack model can hold
105103 mdl_rak_units INTEGER,
106104 --
@@ -117,8 +115,6 @@
118116 mdl_obj_name VARBINARY(255) NOT NULL default '',
119117 -- Kind of this object model
120118 mdl_obj_kind VARBINARY(255) NOT NULL default '',
121 - -- Note about this object model
122 - mdl_obj_note BLOB,
123119 -- The form factor of this object model
124120 mdl_obj_form_factor ENUM(
125121 'rackunit',
@@ -507,7 +503,7 @@
508504 )
509505 VALUES
510506 ( 'WikiMedia Owned', 'boolean' ),
511 - ( 'Extra Notes', 'text' ),
 507+ ( 'Notes', 'text' ),
512508 ( 'Weight (LBS)', 'number' ),
513509 ( 'Assigned User', 'string' );
514510 --
@@ -575,6 +571,9 @@
576572 ( 2, 'facility', 'space' ),
577573 ( 2, 'asset', 'rack' ),
578574 ( 2, 'asset', 'object' ),
 575+ ( 2, 'model', 'rack' ),
 576+ ( 2, 'model', 'object' ),
 577+ ( 2, 'model', 'port' ),
579578 ( 3, 'asset', 'object' ),
580579 ( 4, 'asset', 'object' );
581580 --
Index: trunk/extensions/DataCenter/UI/Widgets/Table.php
@@ -101,6 +101,13 @@
102102 DataCenterUI::message( 'field', $label )
103103 );
104104 }
 105+ if ( count( $parameters['rows'] ) == 0 ) {
 106+ $xmlOutput .= DataCenterXml::row(
 107+ DataCenterXml::cell(
 108+ DataCenterUI::message( 'error', 'no-rows' )
 109+ )
 110+ );
 111+ }
105112 // Loops over each row
106113 foreach ( $parameters['rows'] as $i => $row ) {
107114 // Builds row attributes
Index: trunk/extensions/DataCenter/Views/Settings/Field.php
@@ -170,7 +170,9 @@
171171 'page' => 'settings',
172172 'type' => 'field'
173173 ),
174 - 'fields' => array()
 174+ 'fields' => array(
 175+ 'confirm' => array( 'type' => 'string' )
 176+ )
175177 )
176178 )
177179 )
Index: trunk/extensions/DataCenter/Views/Models.php
@@ -23,7 +23,6 @@
2424 'manufacturer' => array( 'type' => 'string' ),
2525 'name' => array( 'type' => 'string' ),
2626 'kind' => array( 'type' => 'string' ),
27 - 'note' => array( 'type' => 'text' ),
2827 'units' => array(
2928 'type' => 'number',
3029 'min' => 1,
@@ -34,7 +33,7 @@
3534 'details' => array(
3635 'heading' => array( 'field' => 'name' ),
3736 'fields' => array(
38 - 'manufacturer', 'name', 'kind', 'units', 'note'
 37+ 'manufacturer', 'name', 'kind', 'units'
3938 )
4039 ),
4140 ),
@@ -51,7 +50,6 @@
5251 'manufacturer' => array( 'type' => 'string' ),
5352 'name' => array( 'type' => 'string' ),
5453 'kind' => array( 'type' => 'string' ),
55 - 'note' => array( 'type' => 'text' ),
5654 'form-factor' => array(
5755 'field' => 'form_factor',
5856 'type' => 'list',
@@ -87,7 +85,6 @@
8886 'units',
8987 'depth',
9088 'power',
91 - 'note'
9289 )
9390 ),
9491 ),
@@ -103,7 +100,6 @@
104101 'fields' => array(
105102 'name' => array( 'type' => 'string' ),
106103 'kind' => array( 'type' => 'string' ),
107 - 'note' => array( 'type' => 'text' ),
108104 'category' => array(
109105 'type' => 'list',
110106 'enum' => array(
@@ -125,7 +121,7 @@
126122 'details' => array(
127123 'heading' => array( 'field' => 'name' ),
128124 'fields' => array(
129 - 'name', 'kind', 'category', 'format', 'note'
 125+ 'name', 'kind', 'category', 'format'
130126 )
131127 ),
132128 ),
Index: trunk/extensions/DataCenter/Views/Plans/Plan.php
@@ -220,9 +220,9 @@
221221 DataCenterUI::renderWidget(
222222 'body',
223223 array(
224 - 'message' => 'confirm-remove-type',
225 - 'subject' => $path['type'],
226 - 'type' => 'notice',
 224+ 'message' => 'notice-removing-type',
 225+ 'type' => $path['type'],
 226+ 'style' => 'notice',
227227 )
228228 ),
229229 DataCenterUI::renderWidget(
@@ -259,7 +259,9 @@
260260 'page' => 'plans',
261261 'type' => 'plan'
262262 ),
263 - 'fields' => array()
 263+ 'fields' => array(
 264+ 'confirm' => array( 'type' => 'string' )
 265+ )
264266 )
265267 ),
266268 )
Index: trunk/extensions/DataCenter/Views/Plans/Rack.php
@@ -308,9 +308,9 @@
309309 DataCenterUI::renderWidget(
310310 'body',
311311 array(
312 - 'message' => 'confirm-remove-type',
313 - 'subject' => $path['type'],
314 - 'type' => 'notice',
 312+ 'message' => 'notice-removing-type',
 313+ 'type' => $path['type'],
 314+ 'style' => 'notice',
315315 )
316316 ),
317317 DataCenterUI::renderWidget(
@@ -350,7 +350,9 @@
351351 'page' => 'plans',
352352 'type' => 'rack'
353353 ),
354 - 'fields' => array()
 354+ 'fields' => array(
 355+ 'confirm' => array( 'type' => 'string' )
 356+ )
355357 )
356358 ),
357359 )
Index: trunk/extensions/DataCenter/Views/Plans/Object.php
@@ -281,9 +281,9 @@
282282 DataCenterUI::renderWidget(
283283 'body',
284284 array(
285 - 'message' => 'confirm-remove-type',
286 - 'subject' => $path['type'],
287 - 'type' => 'notice',
 285+ 'message' => 'notice-removing-type',
 286+ 'type' => $path['type'],
 287+ 'style' => 'notice',
288288 )
289289 ),
290290 DataCenterUI::renderWidget(
@@ -323,7 +323,9 @@
324324 'page' => 'plans',
325325 'type' => 'object'
326326 ),
327 - 'fields' => array()
 327+ 'fields' => array(
 328+ 'confirm' => array( 'type' => 'string' )
 329+ )
328330 )
329331 )
330332 )
Index: trunk/extensions/DataCenter/DataCenter.i18n.php
@@ -91,6 +91,7 @@
9292 'datacenter-ui-error-invalid-data' => 'You have provided invalid data',
9393 'datacenter-ui-error-no-components' => 'No components were provided',
9494 'datacenter-ui-error-no-fields' => 'No fields were provided',
 95+ 'datacenter-ui-error-no-rows' => 'No records found',
9596 'datacenter-ui-error-no-ui-widget' => 'The user-interface widget "$1" doesn\'t exist',
9697 // Fields
9798 'datacenter-ui-field-name' => 'Name',
@@ -142,6 +143,7 @@
143144 'datacenter-ui-field-tense' => 'Tense',
144145 'datacenter-ui-field-change-summary' => 'Change Summary',
145146 'datacenter-ui-field-uses' => 'Uses',
 147+ 'datacenter-ui-field-confirm' => 'Enter "yes" to confirm',
146148 // Label
147149 'datacenter-ui-label-reset' => 'Reset',
148150 'datacenter-ui-label-cancel' => 'Cancel',

Status & tagging log