Skip to content
This repository was archived by the owner on Sep 23, 2023. It is now read-only.

Commit 96887b1

Browse files
edg2sMatmaRex
authored andcommitted
Add OOUI Demos link to Main_Page when patched
Also add the link to the Phabricator announcement. Fixes #432
1 parent 6b15586 commit 96887b1

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

new.php

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ function set_progress( float $pc, string $label ) {
308308

309309
foreach ( array_keys( $repos ) as $repo ) {
310310
// Unchecked the checkbox
311-
if ( $repo !== 'mediawiki/core' && !in_array( $repo, $allowedRepos ) ) {
311+
if ( $repo !== 'mediawiki/core' && !in_array( $repo, $allowedRepos, true ) ) {
312312
unset( $repos[$repo] );
313313
}
314314
// This branch doesn't exist for this repo
315-
if ( !in_array( $branch, get_branches( $repo ) ) ) {
315+
if ( !in_array( $branch, get_branches( $repo ), true ) ) {
316316
unset( $repos[$repo] );
317317
}
318318
}
@@ -321,10 +321,16 @@ function set_progress( float $pc, string $label ) {
321321
return "$k $v";
322322
}, array_keys( $repos ), array_values( $repos ) ) );
323323

324-
$mainPage = "This wiki was generated on [$server$serverPath '''Patch demo'''] at ~~~~~.
324+
// Build Main_Page
325+
$mainPage = "This wiki was generated on [$server$serverPath '''Patch demo'''] at ~~~~~.";
325326

326-
;Branch: $branchDesc
327-
;Applied patches:";
327+
$hasOOUI = in_array( 'oojs/ui', $allowedRepos, true );
328+
if ( $hasOOUI ) {
329+
$mainPage .= "\n\nThis wiki was built with OOUI patches so you can also view the [{{SERVER}}{{SCRIPTPATH}}/build/ooui/demos patched '''OOUI Demos'''].";
330+
}
331+
332+
$mainPage .= "\n\n;Branch: $branchDesc";
333+
$mainPage .= "\n;Applied patches:";
328334

329335
if ( !$patchesApplied ) {
330336
$mainPage .= " (none)";
@@ -507,9 +513,16 @@ static function ( string $repo ) use ( $repos ): bool {
507513
foreach ( $linkedTasks as $task ) {
508514
post_phab_comment(
509515
'T' . $task,
510-
"Test wiki **created** on [[ $server$serverPath | Patch demo ]]" . ( $creator ? ' by ' . $creator : '' ) . " using patch(es) linked to this task:\n" .
516+
"Test wiki **created** on [[ $server$serverPath | Patch demo ]]" . ( $creator ? ' by ' . $creator : '' ) . " using patch(es) linked to this task:" .
511517
"\n" .
512-
"$server$serverPath/wikis/$namePath/w/"
518+
"$server$serverPath/wikis/$namePath/w/" .
519+
( $hasOOUI ?
520+
"\n\n" .
521+
"Also created an **OOUI Demos** page:" .
522+
"\n" .
523+
"$server$serverPath/wikis/$namePath/w/build/ooui/demos"
524+
: ""
525+
)
513526
);
514527
}
515528
wiki_add_announced_tasks( $namePath, $linkedTasks );

0 commit comments

Comments
 (0)