Skip to content

Commit

Permalink
Add link icon for public link too
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Mar 21, 2019
1 parent 4c884f1 commit ff164db
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
7 changes: 5 additions & 2 deletions apps/files/tests/js/fileactionsmenuSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ describe('OCA.Files.FileActionsMenu tests', function() {
it('does not render default actions', function() {
expect(menu.$el.find('a[data-action=Testdefault]').length).toEqual(0);
});
it('does not render inline actions', function() {
expect(menu.$el.find('a[data-action=Testinline]').length).toEqual(0);
it('render inline actions', function() {
expect(menu.$el.find('a[data-action=Testinline]').length).toEqual(1);
});
it('render inline actions but it is hidden', function() {
expect(menu.$el.find('a[data-action=Testinline]').parent().hasClass('hidden')).toEqual(true);
});
it('only renders actions relevant to the mime type', function() {
fileActions.registerAction({
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/additionalScripts.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/additionalScripts.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion apps/files_sharing/src/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@
permissions: OC.PERMISSION_ALL,
iconClass: function(fileName, context) {
var shareType = parseInt(context.$file.data('share-types'), 10)
if (shareType === OC.Share.SHARE_TYPE_EMAIL) {
if (shareType === OC.Share.SHARE_TYPE_EMAIL
|| shareType === OC.Share.SHARE_TYPE_LINK) {
return 'icon-public'
}
return 'icon-shared'
Expand Down
10 changes: 5 additions & 5 deletions apps/files_sharing/tests/js/shareSpec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
*
* This file is licensed under the Affero General Public License version 3
Expand Down Expand Up @@ -149,7 +149,7 @@ describe('OCA.Sharing.Util tests', function() {
expect($action.find('.icon').hasClass('icon-public')).toEqual(true);
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-public.svg');
});
it('shows owner name when owner is available', function() {
it('shows owner name when owner is available but no icons', function() {
var $action, $tr;
fileList.setFiles([{
id: 1,
Expand All @@ -167,7 +167,7 @@ describe('OCA.Sharing.Util tests', function() {
$tr = fileList.$el.find('tbody tr:first');
$action = $tr.find('.action-share');
expect($action.find('>span').text().trim()).toEqual('Shared by User One');
expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-shared')).toEqual(false);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg');
});
Expand Down Expand Up @@ -389,7 +389,7 @@ describe('OCA.Sharing.Util tests', function() {
});

expect($action.find('>span').text().trim()).toEqual('Shared by User One');
expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-shared')).toEqual(false);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
});
it('keep share text after unsharing reshare', function() {
Expand Down Expand Up @@ -422,7 +422,7 @@ describe('OCA.Sharing.Util tests', function() {
expect($tr.attr('data-share-recipient-data')).not.toBeDefined();

expect($action.find('>span').text().trim()).toEqual('Shared by User One');
expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
expect($action.find('.icon').hasClass('icon-shared')).toEqual(false);
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
});
});
Expand Down

0 comments on commit ff164db

Please sign in to comment.