File tree Expand file tree Collapse file tree 7 files changed +47
-23
lines changed
resources/views/components Expand file tree Collapse file tree 7 files changed +47
-23
lines changed Original file line number Diff line number Diff line change @@ -141,9 +141,6 @@ public function apiViewSubProjects(): JsonResponse
141
141
$ response ['showcalendar ' ] = 1 ;
142
142
143
143
$ banners = [];
144
- if (config ('cdash.global_banner ' ) !== null && strlen (config ('cdash.global_banner ' )) > 0 ) {
145
- $ banners [] = config ('cdash.global_banner ' );
146
- }
147
144
if ($ this ->project ->Banner !== null && strlen ($ this ->project ->Banner ) > 0 ) {
148
145
$ banners [] = $ this ->project ->Banner ;
149
146
}
Original file line number Diff line number Diff line change 51
51
$ response ['showcalendar ' ] = 1 ;
52
52
53
53
$ banners = [];
54
- if (config ('cdash.global_banner ' ) !== null && strlen (config ('cdash.global_banner ' )) > 0 ) {
55
- $ banners [] = config ('cdash.global_banner ' );
56
- }
57
54
if ($ Project ->Banner !== null && strlen ($ Project ->Banner ) > 0 ) {
58
55
$ banners [] = $ Project ->Banner ;
59
56
}
Original file line number Diff line number Diff line change @@ -156,6 +156,8 @@ add_feature_test(/Feature/SlowPageTest)
156
156
157
157
add_feature_test(/Feature/GitHubWebhook)
158
158
159
+ add_feature_test(/Feature/GlobalBannerTest)
160
+
159
161
add_legacy_unit_test(/CDash/Lib/Repository/GitHub)
160
162
set_tests_properties (/CDash/Lib/Repository/GitHub PROPERTIES
161
163
DEPENDS /CDash/XmlHandler/UpdateHandler
Original file line number Diff line number Diff line change 86
86
'require_full_email_when_adding_user ' => env ('REQUIRE_FULL_EMAIL_WHEN_ADDING_USER ' , false ),
87
87
// Whether or not project administrators can invite users
88
88
'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.
89
90
'global_banner ' => env ('GLOBAL_BANNER ' ),
90
91
// Whether or not "normal" username+password authentication is enabled
91
92
'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:
2400
2400
count: 2
2401
2401
path: app/Http/Controllers/SubProjectController.php
2402
2402
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
-
2409
2403
-
2410
2404
message: '#^Parameter \#1 \$string of function strlen expects string, string\|false given\.$#'
2411
2405
identifier: argument.type
@@ -17163,12 +17157,6 @@ parameters:
17163
17157
count: 6
17164
17158
path: app/cdash/public/api/v1/index.php
17165
17159
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
-
17172
17160
-
17173
17161
message: '#^Parameter \#1 \$string of function strlen expects string, string\|false given\.$#'
17174
17162
identifier: argument.type
Original file line number Diff line number Diff line change 1
1
@php
2
+ use Illuminate\Support\ Str ;
3
+
2
4
if (isset ($project )) {
3
5
$logoid = $project -> ImageId ;
4
6
}
12
14
13
15
<div id =" header" >
14
16
<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 >
19
29
@endif
20
30
21
- <span style = " float : right ; " >
31
+ <span >
22
32
@if (Auth:: check () )
23
33
<a class =" cdash-link" href =" {{ url (' /logout' ) } }" >Logout</a >
24
34
@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