Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple link shares #27337

Merged
merged 41 commits into from Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
df2f51f
Add "Add" and "Remove" button to link share,
felixheidecke Mar 14, 2017
6e0b5b7
Split link view to link list and link popup
Mar 15, 2017
a0984c6
Improve wiring for share link popup
Mar 15, 2017
fbb3a5d
Fix clipboard, social share and upload checkbox
Mar 15, 2017
ee42bd3
Split local and public shares in separate subtabs
Mar 15, 2017
d13db30
Add "name" field in oc_share
Mar 15, 2017
3f77077
Add mail view and name in list
Mar 15, 2017
30488c8
Lazy init link view
Mar 15, 2017
d882cb3
Prevent sidebar tabs to control subtabs
Mar 15, 2017
728796c
Fix some sinon warnings about callsFake
Mar 16, 2017
7007fe6
Adjust and add more unit tests
Mar 16, 2017
de331f6
Even more tests added for multiple link shares
Mar 16, 2017
0acdf42
First rough styling of multiple link shares,
felixheidecke Mar 16, 2017
429f06b
Updated tests + added tests for mail
Mar 16, 2017
a6b6707
Fix share link dialog for easier validation
Mar 16, 2017
14f5d32
Add more error handling for password enforcement
Mar 17, 2017
d65c290
Remove obsolete option "Always ask for password" for link shares
Mar 17, 2017
c7f33af
Only send required attrs for share links
Mar 17, 2017
5cdef10
Add back and tweak link expiration view
Mar 17, 2017
b2ad005
Add explicit sinon lib
Mar 17, 2017
00e0f49
Fix more share link tests
Mar 17, 2017
01b1786
Improve styling
felixheidecke Mar 17, 2017
daf598b
Add css-class attribute to dialog message, mute _setSite method
felixheidecke Mar 20, 2017
c910193
New styling of user, group and link shares
felixheidecke Mar 20, 2017
276a92f
Revert changes to sharee- list
felixheidecke Mar 20, 2017
df79db8
Fix share link icon in link list
Mar 20, 2017
fc9336b
Add back linkPassText to unbreak the code and tests
Mar 20, 2017
c96a22e
Add confirmation to delete link; Add copy-to-clipboard
felixheidecke Mar 20, 2017
a396b38
Revert CSS changes.
felixheidecke Mar 20, 2017
b332ede
Add brackets for readability
felixheidecke Mar 20, 2017
6fb61d9
Style social-share icons box
felixheidecke Mar 20, 2017
d10e68d
Always return the full URL
felixheidecke Mar 20, 2017
e42fad7
Remove unnecessary comments
felixheidecke Mar 20, 2017
5637733
Tweaks for link shares
Mar 20, 2017
e797eba
Make OC.webroot properly stubbable
Mar 21, 2017
40389d2
Fix link share generation tests
Mar 21, 2017
18ebe1e
Password input is type of password
felixheidecke Mar 21, 2017
36ab4b1
Remove unused local variable
felixheidecke Mar 21, 2017
20dc231
Small tweaks in share link dialog
Mar 21, 2017
f56b881
Provide a default deduplicated share link name
Mar 21, 2017
012208f
Set share link name max length to 64 chars
Mar 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/files/js/detailsview.js
Expand Up @@ -190,11 +190,11 @@

this._currentTabId = tabId;

var $tabsContainer = this.$el.find('.tabsContainer');
var $tabsContainer = this.$el.find('>.tabsContainer');
var $tabEl = $tabsContainer.find('#' + tabId);

// hide other tabs
$tabsContainer.find('.tab').addClass('hidden');
$tabsContainer.find('>.tab').addClass('hidden');

// tab already rendered ?
if (!$tabEl.length) {
Expand All @@ -209,7 +209,7 @@
$tabEl.removeClass('hidden');

// update tab headers
var $tabHeaders = this.$el.find('.tabHeaders li');
var $tabHeaders = this.$el.find('>.tabHeaders li');
$tabHeaders.removeClass('selected');
$tabHeaders.filterAttr('data-tabid', tabView.id).addClass('selected');
},
Expand Down Expand Up @@ -250,7 +250,7 @@
var self = this;
var deselect = false;
var countVisible = 0;
var $tabHeaders = this.$el.find('.tabHeaders li');
var $tabHeaders = this.$el.find('>.tabHeaders li');
_.each(this._tabViews, function(tabView) {
var isVisible = tabView.canDisplay(self.model);
if (isVisible) {
Expand All @@ -263,11 +263,11 @@
});

// hide the whole container if there is only one tab
this.$el.find('.tabHeaders').toggleClass('hidden', countVisible <= 1);
this.$el.find('>.tabHeaders').toggleClass('hidden', countVisible <= 1);

if (deselect) {
// select the first visible tab instead
var visibleTabId = this.$el.find('.tabHeader:not(.hidden):first').attr('data-tabid');
var visibleTabId = this.$el.find('>.tabHeaders .tabHeader:not(.hidden):first').attr('data-tabid');
this.selectTab(visibleTabId);
}

Expand Down
2 changes: 1 addition & 1 deletion apps/files/tests/js/filelistSpec.js
Expand Up @@ -2259,7 +2259,7 @@ describe('OCA.Files.FileList tests', function() {
var actionStub = sinon.stub();
var readyHandler = sinon.stub();
var clock = sinon.useFakeTimers();
var debounceStub = sinon.stub(_, 'debounce', function(callback) {
var debounceStub = sinon.stub(_, 'debounce').callsFake(function(callback) {
return function() {
// defer instead of debounce, to make it work with clock
_.defer(callback);
Expand Down
2 changes: 1 addition & 1 deletion apps/files_external/tests/js/settingsSpec.js
Expand Up @@ -15,7 +15,7 @@ describe('OCA.External.Settings tests', function() {

beforeEach(function() {
clock = sinon.useFakeTimers();
select2Stub = sinon.stub($.fn, 'select2', function(args) {
select2Stub = sinon.stub($.fn, 'select2').callsFake(function(args) {
if (args === 'val') {
return select2ApplicableUsers;
}
Expand Down
272 changes: 224 additions & 48 deletions apps/files_sharing/css/sharetabview.css
@@ -1,96 +1,272 @@
.app-files .shareTabView {
min-height: 100px;
min-height: 100px;
}

.shareTabView .oneline { white-space: nowrap; }

.shareTabView .shareWithLoading {
padding-left: 10px;
right: 30px;
top: 2px;
.shareTabView .oneline {
white-space: nowrap;
}

.shareTabView .shareWithRemoteInfo,
.shareTabView .clipboardButton {
padding-left: 10px;
.shareTabView .shareWithLoading {
padding-left: 10px;
right: 30px;
top: 2px;
}

.shareTabView label {
white-space: nowrap;
white-space: nowrap;
}

.shareTabView input[type="checkbox"] {
margin: 0 3px 0 8px;
vertical-align: middle;
margin: 0 3px 0 8px;
vertical-align: middle;
}

.shareTabView input[type="text"],
.shareTabView input[type="password"] {
width: 94%;
margin-left: 0;
width: 94%;
margin-left: 0;
}

.shareTabView input[type="text"].shareWithField,
.shareTabView input[type="text"].emailField,
.shareTabView input[type="text"].linkText {
width: 80%;
width: 80%;
}

.shareTabView form {
font-size: 100%;
margin-left: 0;
margin-right: 0;
font-size: 100%;
margin-left: 0;
margin-right: 0;
}

#shareWithList {
list-style-type: none;
padding: 0 0 16px;
list-style-type: none;
padding: 0 0 16px;
}

#shareWithList li {
padding-top: 5px;
padding-bottom: 5px;
font-weight: bold;
white-space: normal;
padding-top: 5px;
padding-bottom: 5px;
font-weight: bold;
white-space: normal;
}

#shareWithList .unshare img, #shareWithList .showCruds img {
vertical-align:text-bottom; /* properly align icons */
#shareWithList .unshare img,
#shareWithList .showCruds img {
vertical-align: text-bottom;
/* properly align icons */
}

#shareWithList label input[type=checkbox]{
margin-left: 0;
position: relative;
#shareWithList label input[type=checkbox] {
margin-left: 0;
position: relative;
}
#shareWithList .username{
padding-right: 8px;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 254px;
display: inline-block;
overflow: hidden;
vertical-align: middle;

#shareWithList .username {
padding-right: 8px;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 254px;
display: inline-block;
overflow: hidden;
vertical-align: middle;
}
#shareWithList li label{
margin-right: 8px;

#shareWithList li label {
margin-right: 8px;
}

.shareTabView .icon-loading-small {
display: inline-block;
z-index: 1;
background-color: white;
padding: 2px 0;
display: inline-block;
z-index: 1;
background-color: white;
padding: 2px 0;
}

.shareTabView .shareWithList .icon-loading-small,
.shareTabView .linkShareView .icon-loading-small {
position: absolute;
position: absolute;
}

.shareTabView .linkPass .icon-loading-small {
margin-top: 9px;
margin-top: 9px;
}

.shareTabView .icon {
display: inline-block;
background-size: 16px 16px;
display: inline-block;
background-size: 16px 16px;
}

.subTabHeaders .tabHeaders {
margin-left: 0px;
margin-right: 0px;
}

.link-shares {
margin-bottom: 20px;
}

.link-entry {
display: flex;
align-items: center;
min-height: 50px;
position: relative;
}

.link-entry:not(:last-child) {
border-bottom: 1px solid #eee;
}

.link-entry .socialShareContainer {
position: absolute;
right: 0;
top: -20px;
background-color: rgba(0, 0, 0, 0.5);
padding: 0 2px 2px 5px;
border-radius: 3px;
}

.link-entry--icon {
height: 32px;
width: 32px;
background-color: #b4b4b4;
background-position: 8px 8px;
border-radius: 50%;
margin-right: 10px;
}

.link-entry--title {
flex-grow: 1;
font-weight: bold;
}

.link-entry--icon-button {
margin-left: 5px;
opacity: .333;
-webkit-transition: opacity .25s;
-moz-transition: opacity .25s;
-ms-transition: opacity .25s;
-o-transition: opacity .25s;
transition: opacity .25s;
}

.link-entry--icon-button:hover {
opacity: 1;
}

.link-entry--icon-button span {
cursor: pointer;
}

/* -------------------------------------------------- USER & GROUP SHARES --- */
.user-shares {
margin: 20px -15px;
}

.user-share {
transition: all 0.25s ease;
padding: 0 15px;
}

.user-share .icon-settings-dark {
transition: all 0.25s ease;
opacity: .25;
}

.user-share.-active,
.user-share:hover {
background-color: #eee;
}

.user-share.-active .icon-settings-dark,
.user-share:hover .icon-settings-dark {
opacity: .25;
}

.user-share.-active .user-share--dropdown {
height: 30px;
}

.user-share:not(:last-child) {
border-bottom: 1px solid #eee;
}

.user-share .icon-settings-dark {
opacity: 0;
}

.user-share--user {
display: flex;
align-items: center;
}

.user-share--title {
font-weight: bold;
margin-right: 5px;
}

.user-share--main {
display: flex;
align-items: center;
min-height: 50px;
justify-content: space-between;
}

.user-share--checkbox:not(:first-child) {
margin-left: 5px;
}

.user-share--dropdown {
overflow: hidden;
height: 0;
transition: height 0.25s ease-in-out;
display: flex;
justify-content: space-between;
}
.user-share--permission-preview {
white-space: nowrap;
overflow: hidden;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
}
.user-share--permission-preview li {
display: inline;
font-size: 12px;
}
.user-share--permission-preview li:first-child:before {
content: '(';
}
.user-share--permission-preview li:not(:last-child):after {
content: ',';
}
.user-share--permission-preview li:last-child:after {
content: ')';
}
.user-share--permission-list li {
display: inline;
}
.user-share--toggle-dropdown {
cursor: pointer;
}
/* ---------------------------------------------------- PUBLIC LINK MODAL --- */

.public-link-modal {
width: 340px;
}
.public-link-modal--item {
margin-bottom: 20px;
}
.public-link-modal--label,
.public-link-modal--input {
display: block;
width: calc(100% - 15px) !important;
}
.minify {
width: 1px;
height: 1px;
overflow: hidden;
opacity: 0;
}
.minify input {
font-size: 1px;
}
4 changes: 2 additions & 2 deletions apps/files_sharing/tests/js/externalSpec.js
Expand Up @@ -24,8 +24,8 @@ describe('OCA.Sharing external tests', function() {
plugin = OCA.Sharing.ExternalShareDialogPlugin;
urlQueryStub = sinon.stub(OC.Util.History, 'parseUrlQuery');

confirmDialogStub = sinon.stub(OC.dialogs, 'confirm', dummyShowDialog);
promptDialogStub = sinon.stub(OC.dialogs, 'prompt', dummyShowDialog);
confirmDialogStub = sinon.stub(OC.dialogs, 'confirm').callsFake(dummyShowDialog);
promptDialogStub = sinon.stub(OC.dialogs, 'prompt').callsFake(dummyShowDialog);

plugin.filesApp = {
fileList: {
Expand Down