diff --git a/.gitignore b/.gitignore
index c7b6b39663..a11e3a1459 100644
--- a/.gitignore
+++ b/.gitignore
@@ -121,6 +121,7 @@ nbproject
/build/jsdocs/
/npm-debug.log
/PhantomJS_*
+/build/package-lock.json
# puphpet
puphpet
diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss
index 2a71af038c..017253fdf8 100644
--- a/apps/files/css/files.scss
+++ b/apps/files/css/files.scss
@@ -94,7 +94,8 @@
@include icon-color('star-dark', 'files', $color-black, 2, true);
}
.nav-icon-sharingin,
-.nav-icon-sharingout {
+.nav-icon-sharingout,
+.nav-icon-shareoverview {
@include icon-color('share', 'files', $color-black);
}
.nav-icon-sharinglinks {
diff --git a/apps/files_sharing/css/sharetabview.scss b/apps/files_sharing/css/sharetabview.scss
index 82a04936bf..b3516c6857 100644
--- a/apps/files_sharing/css/sharetabview.scss
+++ b/apps/files_sharing/css/sharetabview.scss
@@ -135,10 +135,16 @@
margin-left: 0;
margin-right: 0;
}
+ // share note on the sidebar
+ .share-note {
+ border-radius: var(--border-radius);
+ margin-bottom: 10px;
+ margin-left: 37px;
+ }
}
// Sharing tab users list
-#shareWithList {
+.shareWithList {
list-style-type: none;
display: flex;
flex-direction: column;
@@ -218,4 +224,18 @@
left: 8px;
right: auto;
}
+}
+
+.reshare,
+#link label,
+#expiration label {
+ display: inline-flex;
+ align-items: center;
+ .avatar {
+ margin-right: 5px;
+ }
+}
+
+.resharerInfoView.subView {
+ position: relative;
}
\ No newline at end of file
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js
index 19ce4d65c5..925d8ed918 100644
--- a/core/js/sharedialoglinkshareview.js
+++ b/core/js/sharedialoglinkshareview.js
@@ -21,7 +21,7 @@
var TEMPLATE =
'{{#if shareAllowed}}' +
- '
' +
+ '' +
' - ' +
' {{linkShareLabel}}' +
' ' +
diff --git a/core/js/sharedialogresharerinfoview.js b/core/js/sharedialogresharerinfoview.js
index f4bf9afa0b..fadd0a41f7 100644
--- a/core/js/sharedialogresharerinfoview.js
+++ b/core/js/sharedialogresharerinfoview.js
@@ -19,7 +19,8 @@
'' +
' ' +
' {{sharedByText}}' +
- '
'
+ '' +
+ '{{#if hasShareNote}}{{shareNote}}
{{/if}}'
;
/**
@@ -72,7 +73,10 @@
var reshareTemplate = this.template();
var ownerDisplayName = this.model.getReshareOwnerDisplayname();
+ var shareNote = this.model.getReshareNote();
+
var sharedByText = '';
+
if (this.model.getReshareType() === OC.Share.SHARE_TYPE_GROUP) {
sharedByText = t(
'core',
@@ -105,9 +109,13 @@
);
}
+
+
this.$el.html(reshareTemplate({
reshareOwner: this.model.getReshareOwner(),
- sharedByText: sharedByText
+ sharedByText: sharedByText,
+ shareNote: shareNote,
+ hasShareNote: shareNote !== ''
}));
this.$el.find('.avatar').each(function() {
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index 68e55443dd..241b9c19c0 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -340,6 +340,13 @@
return this.get('reshare').displayname_owner;
},
+ /**
+ * @returns {string}
+ */
+ getReshareNote: function() {
+ return this.get('reshare').note;
+ },
+
/**
* @returns {string}
*/
diff --git a/core/js/tests/specs/sharedialoglinkshareview.js b/core/js/tests/specs/sharedialoglinkshareview.js
index 12f5e762ce..9d07dcb479 100644
--- a/core/js/tests/specs/sharedialoglinkshareview.js
+++ b/core/js/tests/specs/sharedialoglinkshareview.js
@@ -92,7 +92,7 @@ describe('OC.Share.ShareDialogLinkShareView', function () {
var $passwordDiv = view.$el.find('#linkPass');
$passwordText = view.$el.find('.linkPassText');
- $workingIcon = view.$el.find('.linkPass .icon-loading-small');
+ $workingIcon = view.$el.find('.linkPassMenu .icon-loading-small');
sinon.stub(shareModel, 'saveLinkShare');
diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js
index 5fd920a758..33d3be5144 100644
--- a/core/js/tests/specs/sharedialogviewSpec.js
+++ b/core/js/tests/specs/sharedialogviewSpec.js
@@ -214,188 +214,6 @@ describe('OC.Share.ShareDialogView', function() {
focusStub.restore();
selectStub.restore();
});
- describe('password', function() {
- var slideToggleStub;
-
- beforeEach(function() {
- $('#allowShareWithLink').val('yes');
- configModel.set({
- enforcePasswordForPublicLink: false
- });
-
- slideToggleStub = sinon.stub($.fn, 'slideToggle');
- });
- afterEach(function() {
- slideToggleStub.restore();
- });
-
- it('enforced but toggled does not fire request', function() {
- configModel.set('enforcePasswordForPublicLink', true);
- dialog.render();
-
- dialog.$el.find('.linkCheckbox').click();
-
- // The password linkPass field is shown (slideToggle is called).
- // No request is made yet
- expect(slideToggleStub.callCount).toEqual(1);
- expect(slideToggleStub.getCall(0).thisValue.eq(0).attr('id')).toEqual('linkPass');
- expect(fakeServer.requests.length).toEqual(0);
-
- // Now untoggle share by link
- dialog.$el.find('.linkCheckbox').click();
- dialog.render();
-
- // Password field disappears and no ajax requests have been made
- expect(fakeServer.requests.length).toEqual(0);
- expect(slideToggleStub.callCount).toEqual(2);
- expect(slideToggleStub.getCall(1).thisValue.eq(0).attr('id')).toEqual('linkPass');
- });
- });
- describe('expiration date', function() {
- var shareData;
- var shareItem;
- var clock;
- var expectedMinDate;
-
- beforeEach(function() {
- // pick a fake date
- clock = sinon.useFakeTimers(new Date(2014, 0, 20, 14, 0, 0).getTime());
- expectedMinDate = new Date(2014, 0, 21, 14, 0, 0);
-
- configModel.set({
- enforcePasswordForPublicLink: false,
- isDefaultExpireDateEnabled: false,
- isDefaultExpireDateEnforced: false,
- defaultExpireDate: 7
- });
-
- shareModel.set('linkShare', {
- isLinkShare: true,
- token: 'tehtoken',
- permissions: OC.PERMISSION_READ,
- expiration: null
- });
- });
- afterEach(function() {
- clock.restore();
- });
-
- it('does not check expiration date checkbox when no date was set', function() {
- shareModel.get('linkShare').expiration = null;
- dialog.render();
-
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('checked')).toEqual(false);
- expect(dialog.$el.find('.datepicker').val()).toEqual('');
- });
- it('does not check expiration date checkbox for new share', function() {
- dialog.render();
-
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('checked')).toEqual(false);
- expect(dialog.$el.find('.datepicker').val()).toEqual('');
- });
- it('checks expiration date checkbox and populates field when expiration date was set', function() {
- shareModel.get('linkShare').expiration = '2014-02-01 00:00:00';
- dialog.render();
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('checked')).toEqual(true);
- expect(dialog.$el.find('.datepicker').val()).toEqual('01-02-2014');
- });
- it('sets default date when default date setting is enabled', function() {
- configModel.set('isDefaultExpireDateEnabled', true);
- dialog.render();
- dialog.$el.find('.linkCheckbox').click();
- // here fetch would be called and the server returns the expiration date
- shareModel.get('linkShare').expiration = '2014-1-27 00:00:00';
- dialog.render();
-
- // enabled by default
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('checked')).toEqual(true);
- expect(dialog.$el.find('.datepicker').val()).toEqual('27-01-2014');
-
- // disabling is allowed
- dialog.$el.find('[name=expirationCheckbox]').click();
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('checked')).toEqual(false);
- });
- it('enforces default date when enforced date setting is enabled', function() {
- configModel.set({
- isDefaultExpireDateEnabled: true,
- isDefaultExpireDateEnforced: true
- });
- dialog.render();
- dialog.$el.find('.linkCheckbox').click();
- // here fetch would be called and the server returns the expiration date
- shareModel.get('linkShare').expiration = '2014-1-27 00:00:00';
- dialog.render();
-
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('checked')).toEqual(true);
- expect(dialog.$el.find('.datepicker').val()).toEqual('27-01-2014');
-
- // disabling is not allowed
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('disabled')).toEqual(true);
- dialog.$el.find('[name=expirationCheckbox]').click();
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('checked')).toEqual(true);
- });
- it('enforces default date when enforced date setting is enabled and password is enforced', function() {
- configModel.set({
- enforcePasswordForPublicLink: true,
- isDefaultExpireDateEnabled: true,
- isDefaultExpireDateEnforced: true
- });
- dialog.render();
- dialog.$el.find('.linkCheckbox').click();
- // here fetch would be called and the server returns the expiration date
- shareModel.get('linkShare').expiration = '2014-1-27 00:00:00';
- dialog.render();
-
- //Enter password
- dialog.$el.find('.linkPassText').val('foo');
- dialog.$el.find('.linkPassText').trigger(new $.Event('keyup', {keyCode: 13}));
- fakeServer.requests[0].respond(
- 200,
- { 'Content-Type': 'application/json' },
- JSON.stringify({data: {token: 'xyz'}, status: 'success'})
- );
-
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('checked')).toEqual(true);
- expect(dialog.$el.find('.datepicker').val()).toEqual('27-01-2014');
-
- // disabling is not allowed
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('disabled')).toEqual(true);
- dialog.$el.find('[name=expirationCheckbox]').click();
- expect(dialog.$el.find('[name=expirationCheckbox]').prop('checked')).toEqual(true);
- });
- it('sets picker minDate to today and no maxDate by default', function() {
- dialog.render();
- dialog.$el.find('.linkCheckbox').click();
- dialog.$el.find('[name=expirationCheckbox]').click();
- expect($.datepicker._defaults.minDate).toEqual(expectedMinDate);
- expect($.datepicker._defaults.maxDate).toEqual(null);
- });
- it('limits the date range to X days after share time when enforced', function() {
- configModel.set({
- isDefaultExpireDateEnabled: true,
- isDefaultExpireDateEnforced: true
- });
- dialog.render();
- dialog.$el.find('.linkCheckbox').click();
- expect($.datepicker._defaults.minDate).toEqual(expectedMinDate);
- expect($.datepicker._defaults.maxDate).toEqual(new Date(2014, 0, 27, 0, 0, 0, 0));
- });
- it('limits the date range to X days after share time when enforced, even when redisplayed the next days', function() {
- // item exists, was created two days ago
- var shareItem = shareModel.get('linkShare');
- shareItem.expiration = '2014-1-27';
- // share time has time component but must be stripped later
- shareItem.stime = new Date(2014, 0, 20, 11, 0, 25).getTime() / 1000;
- configModel.set({
- isDefaultExpireDateEnabled: true,
- isDefaultExpireDateEnforced: true
- });
- dialog.render();
- expect($.datepicker._defaults.minDate).toEqual(expectedMinDate);
- expect($.datepicker._defaults.maxDate).toEqual(new Date(2014, 0, 27, 0, 0, 0, 0));
- });
- });
-
});
describe('check for avatar', function() {
beforeEach(function() {
@@ -455,8 +273,8 @@ describe('OC.Share.ShareDialogView', function() {
it('test correct function calls', function() {
expect(avatarStub.calledThrice).toEqual(true);
expect(placeholderStub.callCount).toEqual(4);
- expect(dialog.$('.shareWithList').children().length).toEqual(5);
- expect(dialog.$('.avatar').length).toEqual(6);
+ expect(dialog.$('.shareWithList').children().length).toEqual(6);
+ expect(dialog.$('.avatar').length).toEqual(7);
});
it('test avatar owner', function() {
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php
index 52e0628987..0a9371d35b 100644
--- a/lib/private/Share/Share.php
+++ b/lib/private/Share/Share.php
@@ -86,7 +86,6 @@ class Share extends Constants {
);
if(count(self::$backendTypes) === 1) {
Util::addScript('core', 'merged-share-backend');
- \OC_Util::addStyle('core', 'share');
}
return true;
}