File tree Expand file tree Collapse file tree
resources/views/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,9 +141,6 @@ public function apiViewSubProjects(): JsonResponse
141141 $ response ['showcalendar ' ] = 1 ;
142142
143143 $ banners = [];
144- if (config ('cdash.global_banner ' ) !== null && strlen (config ('cdash.global_banner ' )) > 0 ) {
145- $ banners [] = config ('cdash.global_banner ' );
146- }
147144 if ($ this ->project ->Banner !== null && strlen ($ this ->project ->Banner ) > 0 ) {
148145 $ banners [] = $ this ->project ->Banner ;
149146 }
Original file line number Diff line number Diff line change 5151$ response ['showcalendar ' ] = 1 ;
5252
5353$ banners = [];
54- if (config ('cdash.global_banner ' ) !== null && strlen (config ('cdash.global_banner ' )) > 0 ) {
55- $ banners [] = config ('cdash.global_banner ' );
56- }
5754if ($ Project ->Banner !== null && strlen ($ Project ->Banner ) > 0 ) {
5855 $ banners [] = $ Project ->Banner ;
5956}
Original file line number Diff line number Diff line change @@ -156,6 +156,8 @@ add_feature_test(/Feature/SlowPageTest)
156156
157157add_feature_test (/Feature/GitHubWebhook )
158158
159+ add_feature_test (/Feature/GlobalBannerTest )
160+
159161add_legacy_unit_test (/CDash/Lib/Repository/GitHub )
160162set_tests_properties (/CDash/Lib/Repository/GitHub PROPERTIES
161163 DEPENDS /CDash/XmlHandler/UpdateHandler
Original file line number Diff line number Diff line change 8686 'require_full_email_when_adding_user ' => env ('REQUIRE_FULL_EMAIL_WHEN_ADDING_USER ' , false ),
8787 // Whether or not project administrators can invite users
8888 'project_admin_registration_form_enabled ' => env ('PROJECT_ADMIN_REGISTRATION_FORM_ENABLED ' , true ),
89+ // Text displayed at the top of all pages. Limited to 40 characters.
8990 'global_banner ' => env ('GLOBAL_BANNER ' ),
9091 // Whether or not "normal" username+password authentication is enabled
9192 'username_password_authentication_enabled ' => env ('USERNAME_PASSWORD_AUTHENTICATION_ENABLED ' , true ),
Original file line number Diff line number Diff line change @@ -2400,12 +2400,6 @@ parameters:
24002400 count: 2
24012401 path: app/Http/Controllers/SubProjectController.php
24022402
2403- -
2404- message: '#^Parameter \#1 \$string of function strlen expects string, mixed given\.$#'
2405- identifier: argument.type
2406- count: 1
2407- path: app/Http/Controllers/SubProjectController.php
2408-
24092403 -
24102404 message: '#^Parameter \#1 \$string of function strlen expects string, string\|false given\.$#'
24112405 identifier: argument.type
@@ -17163,12 +17157,6 @@ parameters:
1716317157 count: 6
1716417158 path: app/cdash/public/api/v1/index.php
1716517159
17166- -
17167- message: '#^Parameter \#1 \$string of function strlen expects string, mixed given\.$#'
17168- identifier: argument.type
17169- count: 1
17170- path: app/cdash/public/api/v1/index.php
17171-
1717217160 -
1717317161 message: '#^Parameter \#1 \$string of function strlen expects string, string\|false given\.$#'
1717417162 identifier: argument.type
Original file line number Diff line number Diff line change 11@php
2+ use Illuminate\Support\ Str ;
3+
24if (isset ($project )) {
35 $logoid = $project -> ImageId ;
46}
1214
1315<div id =" header" >
1416 <div id =" headertop" >
15- <div id =" topmenu" >
16- <a class =" cdash-link" href =" {{ url (' /projects' ) } }" >All Dashboards</a >
17- @if (Auth:: check () )
18- <a class =" cdash-link" href =" {{ url (' /user' ) } }" >My CDash</a >
17+ <div id =" topmenu" style =" display : flex ; justify-content : space-between ;" >
18+ <span >
19+ <a class =" cdash-link" href =" {{ url (' /projects' ) } }" >All Dashboards</a >
20+ @if (Auth:: check () )
21+ <a class =" cdash-link" href =" {{ url (' /user' ) } }" >My CDash</a >
22+ @endif
23+ </span >
24+
25+ @if (config (' cdash.global_banner' ) !== null && strlen (config (' cdash.global_banner' )) > 0 )
26+ <span id =" global-banner" style =" color : #2ee84a ;" >
27+ {{ Str:: limit (config (' cdash.global_banner' ), 40 ) } }
28+ </span >
1929 @endif
2030
21- <span style = " float : right ; " >
31+ <span >
2232 @if (Auth:: check () )
2333 <a class =" cdash-link" href =" {{ url (' /logout' ) } }" >Logout</a >
2434 @else
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Feature ;
4+
5+ use Illuminate \Support \Str ;
6+ use Tests \TestCase ;
7+
8+ class GlobalBannerTest extends TestCase
9+ {
10+ public function testGlobalBannerAppearsWhenSet (): void
11+ {
12+ $ bannerText = Str::uuid ()->toString ();
13+
14+ $ this ->get ('/login ' )->assertDontSee ($ bannerText );
15+
16+ config (['cdash.global_banner ' => $ bannerText ]);
17+
18+ $ this ->get ('/login ' )->assertSee ($ bannerText );
19+ }
20+
21+ public function testLongGlobalBannerGetsTruncated (): void
22+ {
23+ $ bannerText = 'AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMM ' ;
24+
25+ config (['cdash.global_banner ' => $ bannerText ]);
26+
27+ $ this ->get ('/login ' )->assertSee ('AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJ... ' );
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments