Skip to content

Commit

Permalink
Render tooltip in needle table to reveal absolute time
Browse files Browse the repository at this point in the history
Tooltips are used in other places to show the time to
disambiguate relative times.

Related: https://progress.opensuse.org/issues/167635
  • Loading branch information
kalikiana authored and okurz committed Oct 1, 2024
1 parent b638ad7 commit 7a5fed2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/javascripts/admin_needle.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function setupAdminNeedles() {
if (type === 'display' && data != 'never') {
var ri = 'last_seen_link';
if (data == row['last_match']) ri = 'last_match_link';
return "<a href='" + row[ri] + "'>" + jQuery.timeago(new Date(data)) + '</a>';
return "<a href='" + row[ri] + "' title='" + data + "Z'>" + jQuery.timeago(new Date(data)) + '</a>';
} else {
return data;
}
Expand Down
5 changes: 5 additions & 0 deletions t/ui/21-admin-needles.t
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ subtest 'dereference symlink when displaying needles info' => sub {
is((shift @symlink_needle_tds)->get_text(), 'bootloader.json', 'symlink needle file name is displayed correctly');
my $last_used_td = shift @symlink_needle_tds;
is($last_used_td->get_text(), 'a day ago', 'symlink needle last use is displayed correctly');
is(
$last_used_td->child('a')->get_attribute('title'),
$real_needle->last_seen_time . 'Z',
'symlink needle last use tooltip is displayed correctly'
);
like(
$driver->find_child_element($last_used_td, 'a')->get_attribute('href'),
qr/admin\/needles\/$last_seen_module_id\/$real_needle_id/,
Expand Down

0 comments on commit 7a5fed2

Please sign in to comment.