Skip to content

Commit 98871fe

Browse files
authored
Merge pull request #53339 from nextcloud/fix/product-name-capability
fix: Pass over product name as capability
2 parents ea98e4b + 1d0915b commit 98871fe

4 files changed

Lines changed: 17 additions & 0 deletions

File tree

apps/theming/lib/Capabilities.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function __construct(
4141
* @return array{
4242
* theming: array{
4343
* name: string,
44+
* productName: string,
4445
* url: string,
4546
* slogan: string,
4647
* color: string,
@@ -94,6 +95,7 @@ public function getCapabilities() {
9495
return [
9596
'theming' => [
9697
'name' => $this->theming->getName(),
98+
'productName' => $this->theming->getProductName(),
9799
'url' => $this->theming->getBaseUrl(),
98100
'slogan' => $this->theming->getSlogan(),
99101
'color' => $color,

apps/theming/openapi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"type": "object",
8080
"required": [
8181
"name",
82+
"productName",
8283
"url",
8384
"slogan",
8485
"color",
@@ -98,6 +99,9 @@
9899
"name": {
99100
"type": "string"
100101
},
102+
"productName": {
103+
"type": "string"
104+
},
101105
"url": {
102106
"type": "string"
103107
},

apps/theming/tests/CapabilitiesTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public static function dataGetCapabilities(): array {
5454
return [
5555
['name', 'url', 'slogan', '#FFFFFF', '#000000', 'logo', 'background', '#fff', '#000', 'http://absolute/', true, [
5656
'name' => 'name',
57+
'productName' => 'name',
5758
'url' => 'url',
5859
'slogan' => 'slogan',
5960
'color' => '#FFFFFF',
@@ -71,6 +72,7 @@ public static function dataGetCapabilities(): array {
7172
]],
7273
['name1', 'url2', 'slogan3', '#01e4a0', '#ffffff', 'logo5', 'background6', '#fff', '#000', 'http://localhost/', false, [
7374
'name' => 'name1',
75+
'productName' => 'name1',
7476
'url' => 'url2',
7577
'slogan' => 'slogan3',
7678
'color' => '#01e4a0',
@@ -88,6 +90,7 @@ public static function dataGetCapabilities(): array {
8890
]],
8991
['name1', 'url2', 'slogan3', '#000000', '#ffffff', 'logo5', 'backgroundColor', '#000000', '#ffffff', 'http://localhost/', true, [
9092
'name' => 'name1',
93+
'productName' => 'name1',
9194
'url' => 'url2',
9295
'slogan' => 'slogan3',
9396
'color' => '#000000',
@@ -105,6 +108,7 @@ public static function dataGetCapabilities(): array {
105108
]],
106109
['name1', 'url2', 'slogan3', '#000000', '#ffffff', 'logo5', 'backgroundColor', '#000000', '#ffffff', 'http://localhost/', false, [
107110
'name' => 'name1',
111+
'productName' => 'name1',
108112
'url' => 'url2',
109113
'slogan' => 'slogan3',
110114
'color' => '#000000',
@@ -134,6 +138,9 @@ public function testGetCapabilities(string $name, string $url, string $slogan, s
134138
$this->theming->expects($this->once())
135139
->method('getName')
136140
->willReturn($name);
141+
$this->theming->expects($this->once())
142+
->method('getProductName')
143+
->willReturn($name);
137144
$this->theming->expects($this->once())
138145
->method('getBaseUrl')
139146
->willReturn($url);

openapi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4047,6 +4047,7 @@
40474047
"type": "object",
40484048
"required": [
40494049
"name",
4050+
"productName",
40504051
"url",
40514052
"slogan",
40524053
"color",
@@ -4066,6 +4067,9 @@
40664067
"name": {
40674068
"type": "string"
40684069
},
4070+
"productName": {
4071+
"type": "string"
4072+
},
40694073
"url": {
40704074
"type": "string"
40714075
},

0 commit comments

Comments
 (0)