From 57e61250ac6c59fe93c65a95bfd2cb081cd3c34f Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 19 Oct 2016 12:51:01 +0200 Subject: [PATCH] Remove notify recipient option Signed-off-by: Roeland Jago Douma --- core/js/sharedialogshareelistview.js | 17 ----------- core/js/shareitemmodel.js | 29 ------------------- .../tests/specs/sharedialogshareelistview.js | 17 ----------- settings/templates/admin/sharing.php | 4 --- 4 files changed, 67 deletions(-) diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 0125a433a3..9b0d9c8c50 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -25,12 +25,6 @@ '
' + '{{/if}}' + '{{shareWithDisplayName}}' + - '{{#if mailNotificationEnabled}} {{#unless isRemoteShare}}' + - '' + - '' + - '' + - '' + - '{{/unless}} {{/if}}' + '' + '{{#if editPermissionPossible}}' + '' + @@ -122,7 +116,6 @@ 'click .unshare': 'onUnshare', 'click .icon-more': 'onToggleMenu', 'click .permissions': 'onPermissionChange', - 'click .mailNotification': 'onSendMailNotification' }, initialize: function(options) { @@ -175,7 +168,6 @@ getShareeList: function() { var universal = { avatarEnabled: this.configModel.areAvatarsEnabled(), - mailNotificationEnabled: this.configModel.isMailNotificationEnabled(), notifyByMailLabel: t('core', 'notify by email'), unshareLabel: t('core', 'Unshare'), canShareLabel: t('core', 'can reshare'), @@ -371,15 +363,6 @@ this.model.updateShare(shareId, {permissions: permissions}); }, - - onSendMailNotification: function(event) { - var $target = $(event.target); - var $li = $(event.target).closest('li[data-share-id]'); - var shareType = $li.data('share-type'); - var shareWith = $li.attr('data-share-with'); - - this.model.sendNotificationForShare(shareType, shareWith, $target.is(':checked')); - } }); OC.Share.ShareDialogShareeListView = ShareDialogShareeListView; diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index e8a0d17a7c..ecc75ab147 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -426,35 +426,6 @@ return share.mail_send === 1; }, - /** - * Sends an email notification for the given share - * - * @param {int} shareType share type - * @param {string} shareWith recipient - * @param {bool} state whether to set the notification flag or remove it - */ - sendNotificationForShare: function(shareType, shareWith, state) { - var itemType = this.get('itemType'); - var itemSource = this.get('itemSource'); - - return $.post( - OC.generateUrl('core/ajax/share.php'), - { - action: state ? 'informRecipients' : 'informRecipientsDisabled', - recipient: shareWith, - shareType: shareType, - itemSource: itemSource, - itemType: itemType - }, - function(result) { - if (result.status !== 'success') { - // FIXME: a model should not show dialogs - OC.dialogs.alert(t('core', result.data.message), t('core', 'Warning')); - } - } - ); - }, - /** * Send the link share information by email * diff --git a/core/js/tests/specs/sharedialogshareelistview.js b/core/js/tests/specs/sharedialogshareelistview.js index 9aab46d911..699e2e58d7 100644 --- a/core/js/tests/specs/sharedialogshareelistview.js +++ b/core/js/tests/specs/sharedialogshareelistview.js @@ -139,23 +139,6 @@ describe('OC.Share.ShareDialogShareeListView', function () { listView.$el.find('a.showCruds').click(); expect(listView.$el.find('li.cruds').hasClass('hidden')).toEqual(false); }); - - it('sends notification to user when checkbox clicked', function () { - shareModel.set('shares', [{ - id: 100, - item_source: 123, - permissions: 1, - share_type: OC.Share.SHARE_TYPE_USER, - share_with: 'user1', - share_with_displayname: 'User One' - }]); - listView.render(); - var notificationStub = sinon.stub(listView.model, 'sendNotificationForShare'); - listView.$el.find("input[name='mailNotification']").click(); - expect(notificationStub.called).toEqual(true); - notificationStub.restore(); - }); - }); }); diff --git a/settings/templates/admin/sharing.php b/settings/templates/admin/sharing.php index 802bcad319..eed8f36dbd 100644 --- a/settings/templates/admin/sharing.php +++ b/settings/templates/admin/sharing.php @@ -55,10 +55,6 @@ value="1" />
- /> -
-

t( 'Expire after ' )); ?>