Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Simplify test code and don't show anything if no date is set
  • Loading branch information
MorrisJobke authored and DeepDiver1975 committed Jul 7, 2016
commit fa40ba7f19c99eabe91407f5702a40f9d8eddbd6
2 changes: 1 addition & 1 deletion apps/files_sharing/js/sharedfilelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
text = OC.Util.relativeModifiedDate(expirationTimestamp);
} else {
formatted = t('files_sharing', 'No expiration date set');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we want to show something here, @jancborchardt what do you think ? Maybe a shorter message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Never' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you can see this is only the tooltip. (see third row in the screenshot above)

I can also permanently show a "Never" instead of the empty cell.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d say »Never« or even nothing at all is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d say »Never« or even nothing at all is better.

The cell itself is empty. This is only the tooltip. Should the tooltip be empty and the cell should say "Never"? Or what is the way to go here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave it empty, and the tooltip should say »No expiration date set«. When a date is set, the tooltip is for the exact date I assume (whereas the displayed date is a relative date, like in the file list).

text = t('files_sharing', 'Never');
text = '';
modifiedColor = 160;
}
td = $('<td></td>').attr({"class": "date"});
Expand Down
12 changes: 3 additions & 9 deletions apps/files_sharing/tests/js/sharedfilelistSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,8 @@ describe('OCA.Sharing.FileList tests', function() {

fileList.reload();

var currentdate = new Date();
var expirationDateInADay =
+ currentdate.getFullYear() + "-"
+ ((currentdate.getMonth()+1 < 10) ? "0" : "") + (currentdate.getMonth()+1) + "-"
+ ((currentdate.getDate()+1 < 10) ? "0" : "") + (currentdate.getDate()+1) + " "
+ ((currentdate.getHours()+1 < 10) ? "0" : "") + currentdate.getHours() + ":"
+ ((currentdate.getMinutes()+1 < 10) ? "0" : "") + currentdate.getMinutes() + ":"
+ ((currentdate.getSeconds()+1 < 10) ? "0" : "") + currentdate.getSeconds();
var expirationDateInADay = moment()
.add(1, 'days').format('YYYY-MM-DD HH:mm:ss');

/* jshint camelcase: false */
ocsResponse = {
Expand Down Expand Up @@ -617,7 +611,7 @@ describe('OCA.Sharing.FileList tests', function() {
OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.attr('data-expiration')).toEqual('0');
expect($tr.find('td:last-child span').text()).toEqual('Never');
expect($tr.find('td:last-child span').text()).toEqual('');

expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');

Expand Down