Skip to content

Commit 1bd4c5a

Browse files
authored
[1.x] chore: add purified_description to custom field models (#224)
* chore: add purified_description to custom field models * fix phpcs * add to translations too * fix * fix * fix
1 parent bda7b40 commit 1bd4c5a

File tree

6 files changed

+81
-4
lines changed

6 files changed

+81
-4
lines changed

src/Model/Shared/CustomField.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ abstract class CustomField extends BaseModel
108108
*/
109109
private $description;
110110

111+
/**
112+
* @var string|null
113+
* @SerializedName("purified_description")
114+
*/
115+
private $purifiedDescription;
116+
111117
/**
112118
* @var int|null
113119
* @SerializedName("type")
@@ -385,6 +391,25 @@ public function setDescription(?string $description): self
385391
return $this;
386392
}
387393

394+
/**
395+
* @return string|null
396+
*/
397+
public function getPurifiedDescription(): ?string
398+
{
399+
return $this->purifiedDescription;
400+
}
401+
402+
/**
403+
* @param string|null $description
404+
* @return self
405+
*/
406+
public function setPurifiedDescription(?string $description): self
407+
{
408+
$this->purifiedDescription = $description;
409+
410+
return $this;
411+
}
412+
388413
/**
389414
* @return int|null
390415
*/

src/Model/Ticket/TicketCustomFieldTranslation.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ class TicketCustomFieldTranslation extends BaseTranslation
3131
*/
3232
private $description;
3333

34+
/**
35+
* @var string|null
36+
* @SerializedName("purified_description")
37+
*/
38+
private $purifiedDescription;
39+
3440
/**
3541
* @var string|null
3642
* @SerializedName("regex_error_message")
@@ -113,6 +119,25 @@ public function setDescription(?string $description): self
113119
return $this;
114120
}
115121

122+
/**
123+
* @return string|null
124+
*/
125+
public function getPurifiedDescription(): ?string
126+
{
127+
return $this->purifiedDescription;
128+
}
129+
130+
/**
131+
* @param string|null $description
132+
* @return self
133+
*/
134+
public function setPurifiedDescription(?string $description): self
135+
{
136+
$this->purifiedDescription = $description;
137+
138+
return $this;
139+
}
140+
116141
/**
117142
* @return string|null
118143
*/

src/Model/User/UserCustomFieldTranslation.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ class UserCustomFieldTranslation extends BaseTranslation
3131
*/
3232
private $description;
3333

34+
/**
35+
* @var string|null
36+
* @SerializedName("purified_description")
37+
*/
38+
private $purifiedDescription;
39+
3440
/**
3541
* @var string|null
3642
* @SerializedName("regex_error_message")
@@ -113,6 +119,25 @@ public function setDescription(?string $description): self
113119
return $this;
114120
}
115121

122+
/**
123+
* @return string|null
124+
*/
125+
public function getPurifiedDescription(): ?string
126+
{
127+
return $this->purifiedDescription;
128+
}
129+
130+
/**
131+
* @param string|null $description
132+
* @return self
133+
*/
134+
public function setPurifiedDescription(?string $description): self
135+
{
136+
$this->purifiedDescription = $description;
137+
138+
return $this;
139+
}
140+
116141
/**
117142
* @return string|null
118143
*/

test/DataFixtures/Ticket/TicketCustomFieldData.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ class TicketCustomFieldData extends BaseModelData
1313
public const DATA = [
1414
'id' => 1,
1515
'name' => 'Related Product/Service',
16-
'description' => 'Please select an option if this ticket is related to one of your products/services.',
16+
'description' => '<div class="sp-editor-content"><p>Please select an option if this ticket is related to one of your products/services.</p></div>',
17+
'purified_description' => '<div class="sp-editor-content"><p>Please select an option if this ticket is related to one of your products/services.</p></div>',
1718
'type' => 5,
1819
'depends_on_field_id' => null,
1920
'depends_on_option_id' => null,

test/DataFixtures/User/UserCustomFieldData.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ class UserCustomFieldData extends BaseModelData
1313
public const DATA = [
1414
'id' => 1,
1515
'name' => 'test',
16-
'description' => 'custom',
16+
'description' => '<div class="sp-editor-content"><p>Custom</p></div>',
17+
'purified_description' => '<div class="sp-editor-content"><p>Custom</p></div>',
1718
'type' => 0,
1819
'depends_on_field_id' => null,
1920
'depends_on_option_id' => null,

test/Unit/Config/ApiContextTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function provideGetApiUrlCases(): iterable
9494

9595
yield [$apiContext, 'http://localhost:80/test/test/api/'];
9696

97-
$apiContext = (new ApiContext(self::HOST, self::TOKEN));
97+
$apiContext = new ApiContext(self::HOST, self::TOKEN);
9898

9999
yield [$apiContext, 'https://localhost:443/api/'];
100100

@@ -120,7 +120,7 @@ public function provideGetApiPathCases(): iterable
120120

121121
yield [$apiContext, '/test/test/api/'];
122122

123-
$apiContext = (new ApiContext(self::HOST, self::TOKEN));
123+
$apiContext = new ApiContext(self::HOST, self::TOKEN);
124124

125125
yield [$apiContext, '/api/'];
126126
}

0 commit comments

Comments
 (0)