Skip to content

Commit 66522e8

Browse files
Add external_uuid column to Contact/Contactgroup model
Only show this column in the search column suggestions if explicitly specified
1 parent 7795ef3 commit 66522e8

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

library/Notifications/Model/Contact.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ public function getColumns(): array
2727
'full_name',
2828
'username',
2929
'color',
30-
'default_channel_id'
30+
'default_channel_id',
31+
'external_uuid'
3132
];
3233
}
3334

3435
public function getColumnDefinitions()
3536
{
3637
return [
37-
'full_name' => t('Full Name'),
38-
'username' => t('Username'),
39-
'color' => t('Color')
38+
'full_name' => t('Full Name'),
39+
'username' => t('Username'),
40+
'color' => t('Color'),
41+
'external_uuid' => t('UUID')
4042
];
4143
}
4244

library/Notifications/Model/Contactgroup.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ public function getColumns(): array
3535
{
3636
return [
3737
'name',
38-
'color'
38+
'color',
39+
'external_uuid'
3940
];
4041
}
4142

4243
public function getColumnDefinitions(): array
4344
{
44-
return ['name' => t('Name')];
45+
return [
46+
'name' => t('Name'),
47+
'external_uuid' => t('UUID')
48+
];
4549
}
4650

4751
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)