-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow to add a personal note to a share #10218
Conversation
@skjnldsv maybe you have some time to look at the UI part? |
$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; | ||
$initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; | ||
|
||
$plainBodyPart = $this->l->t("%s shared »%s« with you and want to add:\n", [$initiatorDisplayName, $filename]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Single quotes
- Please use counted placeholders:
%$1s
and%$2s
, otherwise Right-to-Left languages have problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The current implementation has one drawback: Notes for internal user/group shares might never reach the user if no email address is configured. Could be nice to display them somehow in the file listing, people might still miss it if they use desktop/mobile clients only but at least it is visible "somehow". But don't know how hard it would be to add it... @skjnldsv (would also put it at the end of the todo list) |
If okay, I would only allow this for mail/public shares. |
$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; | ||
$initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; | ||
|
||
$plainHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the $
between the number and s: %1$s
and %2$s
// The "From" contains the sharers name | ||
$instanceName = $this->defaults->getName(); | ||
$senderName = $this->l->t( | ||
'%s via %s', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%1$s
$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; | ||
$initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; | ||
|
||
$plainHeading = $this->l->t('%1s shared »%2s« with you and want to add:', [$initiatorDisplayName, $filename]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%1$s
No, one of the important use case is to avoid the typical work flow: share a document with a colleague, go to the mail client and write a mail "hey, I just have shared document X with you. Can you please review it so that we can do XYZ". So it is important that it also works for internal shares. Btw, this reminds me that I should add a link to the internal share to the mail. Is there a easy way to generate it? |
c3482fc
to
7cbd4aa
Compare
|
||
$table = $schema->getTable('share'); | ||
$table->addColumn('note', 'text', [ | ||
'notnull' => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for this?
Just received the error when testing:
An exception occurred while executing 'INSERT INTO `oc_share` (`share_type`, `item_type`, `item_source`, `file_source`, `share_with`, `uid_owner`, `uid_initiator`, `permissions`, `token`, `password`, `stime`, `file_target`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [4, "file", 3, 3, "test@****.com", "admin", "admin", 1, "dLzxBkWpFcjZnFN", null, 1531473009, ""]: SQLSTATE[HY000]: General error: 1364 Field 'note' doesn't have a default value
@@ -31,6 +31,11 @@ | |||
<input type="hidden" name="maxSizeAnimateGif" value="<?php p($_['maxSizeAnimateGif']); ?>" id="maxSizeAnimateGif"> | |||
<?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?> | |||
<div id="files-public-content"> | |||
<?php if (isset($_['note']) && $_['note'] !== '') : ?> | |||
<div id="note"> | |||
<?php p($l->t('Note: ')); p($_['note']); ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space should not be part of the translation, or you insert the note with a placeholder
$initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null; | ||
|
||
$plainHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); | ||
$htmlHeading = $this->l->t('%1$s shared »%2$s« with you and want to add:', [$initiatorDisplayName, $filename]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*wants (3rd person singular - he/she/it, das s muss mit :) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the HTML email the trailing :
looks strange
Currently it always sends a new email when the note is updated, is that intentional? |
Well, good question. I thought that it might make sense to send the note again if the user changes it. If you replace the note with another one you would expect that the user receives it, right? If we send it only once we would also need to block editing once a note was set, but this could confuse people if they can't fix a typo, extend the note, etc. |
Would it be possible to grow the open "..." menu and put the input field in the menu? Putting it below the share link looks confusing. Especially if there are more then one share and maybe even a public link. When I try to save a note I get "An error occurred. Unable to save the note". It looks like you send a PUT request to " http://localhost/server/index.php/apps/files/", the right URL would be I also couldn't find a way to set a not for a public link share. |
@schiessle I used the design examples provided by the other issue :) The public share isn't available indeed, I realized that later and did not found the proper design for this yet, I'll think about it. |
@skjnldsv afaik the design was from a stage of discussion where we considered haveing only one comment per file (for all shares). But as we now want to have one comment per share I think it makes more sense to display the input filed more next to the share like we do it with the password field for mail shares: For the link shares I would just add another checkbox and behave also the same as the "Password protect" checkbox for link shares behave. |
Does anyone know why this tests fail: https://drone.nextcloud.com/nextcloud/server/8944/107 When I saw it the first time I fixed it here: a0ac9b3 Now all tests pass locally but it seems like CI ignores this commit 😕 |
@schiessle sure :) Still unsure on how to properly implement a nice ui for the public shares then. I'll check if @jancborchardt have an idea ;) |
Wouldn't it make sense to 'simply' make this the first comment on the file? Sorry, just thinking out loud... |
No, because it should be personal 1:1 comment, only seen by the recipient not "randomly" the first comment seen by everyone. |
It's kind of weird. Shouldn't it be just a comment?
This should be a comment as well and you should receive this as email. Another thing that came to my mind: A recipient is getting two emails then? That's also not optimal, as it then is again a missing context. |
I mean, we had a discussion about this, no? And we discussed the proper way to do this is:
Adding yet another different way to add text to a file (remember we will already have the Comments vs Talk chat issue) will just be a mess. |
83f66dc
to
a20cabb
Compare
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
The share link UI no longer uses its own layout below the other shares; now it is shown as a share row with a menu for the actions (except enabling it, which is shown in the row itself), just like the other shares. The share link is no longer shown, either; now the link is got by clicking on a "Copy URL" menu item, which copies the link to the clipboard. As the clipboard is not accessible from the acceptance tests the URL is now extracted from the attributes of that menu item (although the menu item is clicked anyway to mimic the user behaviour). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Acceptance tests fixed; the test Viewing a favorite file in its folder does not prevent opening the details view in "All files" section fails not due to changes in this pull request, but due to #9982 |
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Failure unrelated for files : I'll handle the user acceptance failure in another pr since it's on master! |
Closes #876 I didn't test on NC < 14, but it should be fine since it only puts back old sidebar behaviour before nextcloud/server#10218 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Closes #876 I didn't test on NC < 14, but it should be fine since it only puts back old sidebar behaviour before nextcloud/server#10218 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Allow users to add a personal note to a share which will then be send to the recipient (in case of a user, group or mail share) or displayed at the public link page (in case of a link or mail share)
For the UI to add a note to a share I would suggest to add another menu option to the "..." menu for user, group and mail shares called "Add note" if the user clicks on it we show a input field to add the note. For public links I would add a similar option under the check-boxes.
After the user set a note it is send to the server over the already existing OCS API, same as we already use to update permission, expire date, etc. Example call: