diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index cda837a66c..6725f625be 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -30,8 +30,8 @@ '' + '{{#if editPermissionPossible}}' + '' + - '' + - '' + + '' + + '' + '' + '{{/if}}' + '' + @@ -58,8 +58,8 @@ '{{#if isResharingAllowed}} {{#if sharePermissionPossible}} {{#unless isMailShare}}' + '
  • ' + '' + - '' + - '' + + '' + + '' + '' + '
  • ' + '{{/unless}} {{/if}} {{/if}}' + @@ -67,24 +67,24 @@ '{{#if createPermissionPossible}}{{#unless isMailShare}}' + '
  • ' + '' + - '' + - '' + + '' + + '' + '' + '
  • ' + '{{/unless}}{{/if}}' + '{{#if updatePermissionPossible}}{{#unless isMailShare}}' + '
  • ' + '' + - '' + - '' + + '' + + '' + '' + '
  • ' + '{{/unless}}{{/if}}' + '{{#if deletePermissionPossible}}{{#unless isMailShare}}' + '
  • ' + '' + - '' + - '' + + '' + + '' + '' + '
  • ' + '{{/unless}}{{/if}}' + @@ -383,7 +383,7 @@ var _this = this; this.getShareeList().forEach(function(sharee) { - var checkBoxId = 'canEdit-' + _this.cid + '-' + sharee.shareWith; + var checkBoxId = 'canEdit-' + _this.cid + '-' + sharee.shareId; checkBoxId = '#' + checkBoxId.replace( /(:|\.|\[|\]|,|=|@|\/)/g, "\\$1"); var $edit = _this.$(checkBoxId); if($edit.length === 1) { diff --git a/core/js/tests/specs/sharedialogshareelistview.js b/core/js/tests/specs/sharedialogshareelistview.js index cc0268ba58..8e34225d19 100644 --- a/core/js/tests/specs/sharedialogshareelistview.js +++ b/core/js/tests/specs/sharedialogshareelistview.js @@ -105,6 +105,21 @@ describe('OC.Share.ShareDialogShareeListView', function () { expect(listView.$el.find("input[name='edit']").is(':indeterminate')).toEqual(true); }); + it('marks edit box as indeterminate when only some permissions are given for sharee with special characters', function () { + shareModel.set('shares', [{ + id: 100, + item_source: 123, + permissions: 1 | OC.PERMISSION_UPDATE, + share_type: OC.Share.SHARE_TYPE_USER, + share_with: 'user _.@-\'', + share_with_displayname: 'User One', + itemType: 'folder' + }]); + shareModel.set('itemType', 'folder'); + listView.render(); + expect(listView.$el.find("input[name='edit']").is(':indeterminate')).toEqual(true); + }); + it('Checks edit box when all permissions are given', function () { shareModel.set('shares', [{ id: 100, @@ -119,6 +134,21 @@ describe('OC.Share.ShareDialogShareeListView', function () { listView.render(); expect(listView.$el.find("input[name='edit']").is(':checked')).toEqual(true); }); + + it('Checks edit box when all permissions are given for sharee with special characters', function () { + shareModel.set('shares', [{ + id: 100, + item_source: 123, + permissions: 1 | OC.PERMISSION_CREATE | OC.PERMISSION_UPDATE | OC.PERMISSION_DELETE, + share_type: OC.Share.SHARE_TYPE_USER, + share_with: 'user _.@-\'', + share_with_displayname: 'User One', + itemType: 'folder' + }]); + shareModel.set('itemType', 'folder'); + listView.render(); + expect(listView.$el.find("input[name='edit']").is(':checked')).toEqual(true); + }); }); describe('Manages checkbox events correctly', function () { it('Checks cruds boxes when edit box checked', function () {