From 9a1d8eb0e55cffa7d48c527ef9cbe05582bd113c Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Tue, 29 Jan 2019 20:26:22 +0100 Subject: Fix updating the password of a link share when passwords are enforced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The password input was shown in the popup menu when passwords were not enforced, or when they were enforced but no password was set, which prevented updating/changing the password once set. As the password input should be shown too when password are enforced and a password is set no condition is needed, so now the password input is always shown. Signed-off-by: Daniel Calviño Sánchez --- ...haredialoglinkshareview_popover_menu.handlebars | 2 - core/js/sharedialoglinkshareview.js | 2 - core/js/sharetemplates.js | 71 ++++++++++------------ 3 files changed, 33 insertions(+), 42 deletions(-) (limited to 'core') diff --git a/core/js/share/sharedialoglinkshareview_popover_menu.handlebars b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars index 9c715c7f4ee..2b4873bc56c 100644 --- a/core/js/share/sharedialoglinkshareview_popover_menu.handlebars +++ b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars @@ -45,7 +45,6 @@ - {{#if showPasswordCheckBox}}
  • - {{/if}} {{#if showPasswordByTalkCheckBox}}
  • diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index 91101e47b2e..211d41b3b43 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -854,7 +854,6 @@ var isPasswordSet = !!share.password; var isPasswordEnabledByDefault = this.configModel.get('enableLinkPasswordByDefault') === true; var isPasswordEnforced = this.configModel.get('enforcePasswordForPublicLink'); - var showPasswordCheckBox = !isPasswordEnforced || !share.password; var isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced'); var defaultExpireDays = this.configModel.get('defaultExpireDate'); var hasExpireDate = !!share.expiration || isExpirationEnforced; @@ -891,7 +890,6 @@ shareLinkURL: share.url, passwordPlaceholder: isPasswordSet ? PASSWORD_PLACEHOLDER : PASSWORD_PLACEHOLDER_MESSAGE, isPasswordSet: isPasswordSet || isPasswordEnabledByDefault || isPasswordEnforced, - showPasswordCheckBox: showPasswordCheckBox, showPasswordByTalkCheckBox: isTalkEnabled && isPasswordSet, passwordByTalkLabel: t('core', 'Password protect by Talk'), isPasswordByTalkSet: sendPasswordByTalk, diff --git a/core/js/sharetemplates.js b/core/js/sharetemplates.js index 4d827bbe83f..99ce558b9d9 100644 --- a/core/js/sharetemplates.js +++ b/core/js/sharetemplates.js @@ -124,30 +124,10 @@ templates['sharedialoglinkshareview_popover_menu'] = template({"1":function(cont },"5":function(container,depth0,helpers,partials,data) { return "checked=\"checked\""; },"7":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "
  • \n \n \n \n \n
  • \n
  • \n \n \n \n \n \n
  • \n"; -},"8":function(container,depth0,helpers,partials,data) { return "disabled=\"disabled\""; -},"10":function(container,depth0,helpers,partials,data) { +},"9":function(container,depth0,helpers,partials,data) { return "hidden"; -},"12":function(container,depth0,helpers,partials,data) { +},"11":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; return "
  • \n \n \n " + alias4(((helper = (helper = helpers.passwordByTalkLabel || (depth0 != null ? depth0.passwordByTalkLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"passwordByTalkLabel","hash":{},"data":data}) : helper))) + "\n \n
  • \n"; -},"14":function(container,depth0,helpers,partials,data) { +},"13":function(container,depth0,helpers,partials,data) { return "datepicker"; -},"16":function(container,depth0,helpers,partials,data) { +},"15":function(container,depth0,helpers,partials,data) { var helper; return container.escapeExpression(((helper = (helper = helpers.expireDate || (depth0 != null ? depth0.expireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"expireDate","hash":{},"data":data}) : helper))); -},"18":function(container,depth0,helpers,partials,data) { +},"17":function(container,depth0,helpers,partials,data) { var helper; return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultExpireDate","hash":{},"data":data}) : helper))); -},"20":function(container,depth0,helpers,partials,data) { +},"19":function(container,depth0,helpers,partials,data) { return "readonly"; -},"22":function(container,depth0,helpers,partials,data) { +},"21":function(container,depth0,helpers,partials,data) { var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; return "
  • \n " + alias4(((helper = (helper = helpers.hideDownloadLabel || (depth0 != null ? depth0.hideDownloadLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"hideDownloadLabel","hash":{},"data":data}) : helper))) - + "\n \n
  • \n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.showPasswordCheckBox : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.showPasswordByTalkCheckBox : depth0),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + "\n \n \n
  • \n \n \n \n \n
  • \n
  • \n \n \n \n \n \n
  • \n" + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.showPasswordByTalkCheckBox : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "
  • \n \n \n \n \n
  • \n
  • \n \n \n
  • \n
  • \n \n \n \n " + alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addNoteLabel","hash":{},"data":data}) : helper))) + "\n \n \n
  • \n
  • \n \n \n \n \n
  • \n" - + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.social : depth0),{"name":"each","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.social : depth0),{"name":"each","hash":{},"fn":container.program(21, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + "
  • \n " + alias4(((helper = (helper = helpers.unshareLinkLabel || (depth0 != null ? depth0.unshareLinkLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"unshareLinkLabel","hash":{},"data":data}) : helper))) + "\n
  • \n
  • \n \n \n \n " -- cgit v1.2.3