Skip to content

Commit

Permalink
Do not hide collaborator if other entry with same name exists if they…
Browse files Browse the repository at this point in the history
… are not same type
  • Loading branch information
LukasHirt committed Dec 17, 2019
1 parent e9dced7 commit c8acbda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 4 additions & 1 deletion apps/files/src/components/Collaborators/NewCollaborator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ export default {
)
const exists = this.shares.find(existingCollaborator => {
return collaborator.value.shareWith === existingCollaborator.name
return (
collaborator.value.shareWith === existingCollaborator.name &&
parseInt(collaborator.value.shareType, 10) === parseInt(existingCollaborator.info.share_type, 10)
)
})
if (selected || exists) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Feature: Sharing files and folders with internal groups
| ?\?@#%@,; |
| नेपाली |

@issue-2419
Scenario: Share file with a user and a group with same name
Given these users have been created with default attributes:
| username |
Expand All @@ -48,14 +47,13 @@ Feature: Sharing files and folders with internal groups
And user "user3" has uploaded file with content "user3 file" to "/randomfile.txt"
And user "user3" has logged in using the webUI
When the user shares file "randomfile.txt" with user "User One" as "Editor" using the webUI
# And the user shares file "randomfile.txt" with group "user1" as "Editor" using the webUI
And the user shares file "randomfile.txt" with group "user1" as "Editor" using the webUI
And the user opens the share creation dialog in the webUI
And the user types "user1" in the share-with-field
Then "group" "user1" should not be listed in the autocomplete list on the webUI
And the content of file "randomfile.txt" for user "user1" should be "user3 file"
# And the content of file "randmfile.txt" for user "user2" should be "user3 file"
And the content of file "randomfile.txt" for user "user2" should be "user3 file"

@issue-2419
Scenario: Share file with a group and a user with same name
Given these users have been created with default attributes:
| username |
Expand All @@ -69,12 +67,12 @@ Feature: Sharing files and folders with internal groups
And user "user3" has uploaded file with content "user3 file" to "/randomfile.txt"
And user "user3" has logged in using the webUI
When the user shares file "randomfile.txt" with group "user1" as "Editor" using the webUI
# And the user shares file "randomfile.txt" with user "User One" as "Editor" using the webUI
And the user shares file "randomfile.txt" with user "User One" as "Editor" using the webUI
And the user opens the share creation dialog in the webUI
And the user types "user" in the share-with-field
Then "user" "User One" should not be listed in the autocomplete list on the webUI
And the content of file "randomfile.txt" for user "user2" should be "user3 file"
# And the content of file "randmfile.txt" for user "user1" should be "user3 file"
And the content of file "randomfile.txt" for user "user1" should be "user3 file"

@yetToImplement
Scenario: Share file with a user and again with a group with same name but different case
Expand Down

0 comments on commit c8acbda

Please sign in to comment.