Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-05-03 08:20:46 +0300
committerJoas Schilling <coding@schilljs.com>2022-05-03 13:51:23 +0300
commit6e4d721278e886710032a132e2df50626836be7a (patch)
tree1ea32587074d546a3e6271eee7af50f00d1100d9
parentfc826e98115b510313ddacbf6fef4ce8d041e373 (diff)
Expose shareWithDisplayNameUnique also on autocomplete endpointbugfix/noid/fix-missing-subline-info
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--core/Controller/AutoCompleteController.php1
-rw-r--r--tests/Core/Controller/AutoCompleteControllerTest.php39
2 files changed, 31 insertions, 9 deletions
diff --git a/core/Controller/AutoCompleteController.php b/core/Controller/AutoCompleteController.php
index 6cbca91ec0f..9f0e43dedd6 100644
--- a/core/Controller/AutoCompleteController.php
+++ b/core/Controller/AutoCompleteController.php
@@ -118,6 +118,7 @@ class AutoCompleteController extends Controller {
'source' => $type,
'status' => $result['status'] ?? '',
'subline' => $result['subline'] ?? '',
+ 'shareWithDisplayNameUnique' => $result['shareWithDisplayNameUnique'] ?? '',
];
}
}
diff --git a/tests/Core/Controller/AutoCompleteControllerTest.php b/tests/Core/Controller/AutoCompleteControllerTest.php
index 61fc90e3c82..0775fbbd818 100644
--- a/tests/Core/Controller/AutoCompleteControllerTest.php
+++ b/tests/Core/Controller/AutoCompleteControllerTest.php
@@ -75,8 +75,8 @@ class AutoCompleteControllerTest extends TestCase {
],
// expected
[
- [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''],
- [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''],
+ [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
+ [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
],
'',
'files',
@@ -96,8 +96,8 @@ class AutoCompleteControllerTest extends TestCase {
],
// expected
[
- [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''],
- [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''],
+ [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
+ [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
],
'',
null,
@@ -117,8 +117,8 @@ class AutoCompleteControllerTest extends TestCase {
],
// expected
[
- [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''],
- [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''],
+ [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
+ [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
],
'',
'files',
@@ -138,14 +138,35 @@ class AutoCompleteControllerTest extends TestCase {
],
],
[
- [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''],
- [ 'id' => 'bobby', 'label' => 'Robert R.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''],
+ [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
+ [ 'id' => 'bobby', 'label' => 'Robert R.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
],
'bob',
'files',
'42',
null
- ]
+ ],
+ [ #4 – with unique name
+ [
+ 'exact' => [
+ 'users' => [],
+ 'robots' => [],
+ ],
+ 'users' => [
+ ['label' => 'Alice A.', 'value' => ['shareWith' => 'alice'], 'shareWithDisplayNameUnique' => 'alica@nextcloud.com'],
+ ['label' => 'Alice A.', 'value' => ['shareWith' => 'alicea'], 'shareWithDisplayNameUnique' => 'alicaa@nextcloud.com'],
+ ],
+ ],
+ // expected
+ [
+ [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => 'alica@nextcloud.com'],
+ [ 'id' => 'alicea', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => 'alicaa@nextcloud.com'],
+ ],
+ '',
+ 'files',
+ '42',
+ 'karma|bus-factor'
+ ],
];
}