Merge pull request #9418 from nextcloud/fix/sharing-note-mandatory

Don't make note mandatory for sharing
This commit is contained in:
Álvaro Brey 2021-12-09 15:58:46 +01:00 committed by GitHub
commit 451c629a44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View file

@ -491,13 +491,10 @@ class FileDetailsSharingProcessFragment : Fragment(), ExpirationDatePickerDialog
* method to validate step 2 (note screen) information
*/
private fun validateShareProcessSecond() {
if (TextUtils.isEmpty(binding.noteText.text.toString().trim())) {
DisplayUtils.showSnackMessage(binding.root, R.string.share_link_empty_note_message)
return
}
val noteText = binding.noteText.text.toString().trim()
// if modifying existing share then directly update the note and send email
if (share != null) {
fileOperationsHelper?.updateNoteToShare(share, binding.noteText.text.toString().trim())
if (share != null && share?.note != noteText) {
fileOperationsHelper?.updateNoteToShare(share, noteText)
} else {
// else create new share
fileOperationsHelper?.shareFileWithSharee(
@ -509,7 +506,8 @@ class FileDetailsSharingProcessFragment : Fragment(), ExpirationDatePickerDialog
.shareProcessHideDownloadCheckbox.isChecked,
binding.shareProcessEnterPassword.text.toString().trim(),
chosenExpDateInMills,
binding.noteText.text.toString().trim(), binding.shareProcessChangeNameEt.text.toString().trim()
noteText,
binding.shareProcessChangeNameEt.text.toString().trim()
)
}
removeCurrentFragment()

View file

@ -566,7 +566,7 @@ public class FileOperationsHelper {
service.putExtra(OperationsService.EXTRA_SHARE_HIDE_FILE_DOWNLOAD, hideFileDownload);
service.putExtra(OperationsService.EXTRA_SHARE_PASSWORD, (password == null) ? "" : password);
service.putExtra(OperationsService.EXTRA_SHARE_EXPIRATION_DATE_IN_MILLIS, expirationTimeInMillis);
service.putExtra(OperationsService.EXTRA_SHARE_NOTE, note);
service.putExtra(OperationsService.EXTRA_SHARE_NOTE, (note == null) ? "" : note);
service.putExtra(OperationsService.EXTRA_SHARE_PUBLIC_LABEL, (label == null) ? "" : label);
mWaitingForOpId = fileActivity.getOperationsServiceBinder().queueNewOperation(service);

View file

@ -972,7 +972,6 @@
<string name="common_next">Next</string>
<string name="send_share">Send Share</string>
<string name="no_share_permission_selected">Please select at least one permission to share.</string>
<string name="share_link_empty_note_message">Please enter note.</string>
<string name="share_copy_link">Share &amp; Copy Link</string>
<string name="set_note">Set Note</string>
<string name="share_open_in">Open in…</string>