mirror of https://github.com/nextcloud/server
fix(autocomplete): Fix missing user status on autocomplete endpoint
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
1a1514e296
commit
a7018bc5e8
|
@ -15,12 +15,13 @@ Feature: autocomplete
|
|||
| auto | users |
|
||||
| autocomplete | users |
|
||||
| autocomplete2 | users |
|
||||
And user "autocomplete" has status "dnd"
|
||||
When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
|
||||
Then get autocomplete for "auto"
|
||||
| id | source |
|
||||
| auto | users |
|
||||
| autocomplete | users |
|
||||
| autocomplete2 | users |
|
||||
| id | source | status |
|
||||
| auto | users | "" |
|
||||
| autocomplete | users | {"status":"dnd","message":null,"icon":null,"clearAt":null} |
|
||||
| autocomplete2 | users | "" |
|
||||
|
||||
|
||||
Scenario: getting autocomplete without enumeration
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
default:
|
||||
autoload:
|
||||
'': "%paths.base%/../features/bootstrap"
|
||||
formatters:
|
||||
pretty:
|
||||
output_styles:
|
||||
comment: [ 'bright-blue' ]
|
||||
suites:
|
||||
default:
|
||||
paths:
|
||||
|
|
|
@ -73,6 +73,9 @@ class CollaborationContext implements Context {
|
|||
if (isset($expected['source'])) {
|
||||
$data['source'] = $suggestion['source'];
|
||||
}
|
||||
if (isset($expected['status'])) {
|
||||
$data['status'] = json_encode($suggestion['status']);
|
||||
}
|
||||
return $data;
|
||||
}, $suggestions, $formData->getHash()));
|
||||
}
|
||||
|
|
|
@ -123,8 +123,8 @@ class AutoCompleteController extends OCSController {
|
|||
/** @var ?string $subline */
|
||||
$subline = array_key_exists('subline', $result) ? $result['subline'] : null;
|
||||
|
||||
/** @var ?string $status */
|
||||
$status = array_key_exists('status', $result) && is_string($result['status']) ? $result['status'] : null;
|
||||
/** @var ?array{status: string, message: ?string, icon: ?string, clearAt: ?int} $status */
|
||||
$status = array_key_exists('status', $result) && is_array($result['status']) && !empty($result['status']) ? $result['status'] : null;
|
||||
|
||||
/** @var ?string $shareWithDisplayNameUnique */
|
||||
$shareWithDisplayNameUnique = array_key_exists('shareWithDisplayNameUnique', $result) ? $result['shareWithDisplayNameUnique'] : null;
|
||||
|
|
|
@ -124,7 +124,12 @@ namespace OCA\Core;
|
|||
* label: string,
|
||||
* icon: string,
|
||||
* source: string,
|
||||
* status: string,
|
||||
* status: array{
|
||||
* status: string,
|
||||
* message: ?string,
|
||||
* icon: ?string,
|
||||
* clearAt: ?int,
|
||||
* }|string,
|
||||
* subline: string,
|
||||
* shareWithDisplayNameUnique: string,
|
||||
* }
|
||||
|
|
|
@ -45,7 +45,38 @@
|
|||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"status",
|
||||
"message",
|
||||
"icon",
|
||||
"clearAt"
|
||||
],
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"icon": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"clearAt": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"subline": {
|
||||
"type": "string"
|
||||
|
|
Loading…
Reference in New Issue