summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-07 17:49:24 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-07 17:49:24 +0100
commit77958bb601f69fc022f9973267c8865d00f3c6c0 (patch)
tree04862067f504a9b621c94de711fa127864a1b429 /core
parent0f30908aa3ff4cd7242d2a1ef99704606628fa5b (diff)
parent6735005be09840431823afb281ad183e9635d4cc (diff)
downloadnextcloud-server-77958bb601f69fc022f9973267c8865d00f3c6c0.tar.gz
nextcloud-server-77958bb601f69fc022f9973267c8865d00f3c6c0.zip
Merge pull request #21009 from owncloud/share-forbidlinkshare-duplicatefield
Fix duplicate bogus share field when link sharing is not allowed
Diffstat (limited to 'core')
-rw-r--r--core/js/sharedialoglinkshareview.js15
-rw-r--r--core/js/tests/specs/sharedialogviewSpec.js1
2 files changed, 10 insertions, 6 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js
index 29dce21486c..452599fb7f2 100644
--- a/core/js/sharedialoglinkshareview.js
+++ b/core/js/sharedialoglinkshareview.js
@@ -48,7 +48,7 @@
' {{/if}}' +
'{{else}}' +
// FIXME: this doesn't belong in this view
- '<input id="shareWith-{{cid}}" class="shareWithField" type="text" placeholder="{{noSharingPlaceholder}}" disabled="disabled"/>' +
+ '{{#if noSharingPlaceholder}}<input id="shareWith-{{cid}}" class="shareWithField" type="text" placeholder="{{noSharingPlaceholder}}" disabled="disabled"/>{{/if}}' +
'{{/if}}'
;
@@ -238,15 +238,18 @@
render: function() {
var linkShareTemplate = this.template();
+ var resharingAllowed = this.model.sharePermissionPossible();
- if( !this.model.sharePermissionPossible()
+ if(!resharingAllowed
|| !this.showLink
|| !this.configModel.isShareWithLinkAllowed())
{
- this.$el.html(linkShareTemplate({
- shareAllowed: false,
- noSharingPlaceholder: t('core', 'Resharing is not allowed')
- }));
+ var templateData = {shareAllowed: false};
+ if (!resharingAllowed) {
+ // add message
+ templateData.noSharingPlaceholder = t('core', 'Resharing is not allowed');
+ }
+ this.$el.html(linkShareTemplate(templateData));
return this;
}
diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js
index 6d5243b0e86..bfd3d987866 100644
--- a/core/js/tests/specs/sharedialogviewSpec.js
+++ b/core/js/tests/specs/sharedialogviewSpec.js
@@ -218,6 +218,7 @@ describe('OC.Share.ShareDialogView', function() {
dialog.render();
expect(dialog.$el.find('.linkCheckbox').length).toEqual(0);
+ expect(dialog.$el.find('.shareWithField').length).toEqual(1);
});
it('shows populated link share when a link share exists', function() {
// this is how the OC.Share class does it...