Skip to content

Commit 481fcbe

Browse files
Add external_uuid column to Contact/Contactgroup model
Only show this column in the search column suggestions if explicitly specified
1 parent 8c1b267 commit 481fcbe

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

library/Notifications/Model/Contact.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ public function getColumns(): array
2626
return [
2727
'full_name',
2828
'username',
29-
'default_channel_id'
29+
'default_channel_id',
30+
'external_uuid'
3031
];
3132
}
3233

3334
public function getColumnDefinitions()
3435
{
3536
return [
36-
'full_name' => t('Full Name'),
37-
'username' => t('Username')
37+
'full_name' => t('Full Name'),
38+
'username' => t('Username'),
39+
'external_uuid' => t('UUID')
3840
];
3941
}
4042

library/Notifications/Model/Contactgroup.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ public function getKeyName(): string
3333
public function getColumns(): array
3434
{
3535
return [
36-
'name'
36+
'name',
37+
'external_uuid'
3738
];
3839
}
3940

4041
public function getColumnDefinitions(): array
4142
{
42-
return ['name' => t('Name')];
43+
return [
44+
'name' => t('Name'),
45+
'external_uuid' => t('UUID')
46+
];
4347
}
4448

4549
public function getSearchColumns(): array

library/Notifications/Web/Control/SearchBar/ObjectSuggestions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected function queryTags(Model $model, string $searchTerm): Query
231231

232232
protected function matchSuggestion($path, $label, $searchTerm)
233233
{
234-
if (preg_match('/[_.](id)$/', $path)) {
234+
if (preg_match('/[_.](id|uuid)$/', $path)) {
235235
// Only suggest exotic columns if the user knows about them
236236
$trimmedSearch = trim($searchTerm, ' *');
237237
return substr($path, -strlen($trimmedSearch)) === $trimmedSearch;

0 commit comments

Comments
 (0)