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

UI: Align auth method ttl with tune value #26663

Merged
Merged
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
Next Next commit
Revert "include hours in format for easy comparison to CLI return"
This reverts commit 990aaf5.
  • Loading branch information
hellobontempo committed Apr 26, 2024
commit 4d5729e6a331a817aaec969f2899b04eae58b18f
7 changes: 2 additions & 5 deletions ui/lib/core/addon/helpers/format-duration.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { helper } from '@ember/component/helper';
import { convertFromSeconds, durationToSeconds, largestUnitFromSeconds } from 'core/utils/duration-utils';
import { durationToSeconds } from 'core/utils/duration-utils';
import { formatDuration, intervalToDuration } from 'date-fns';

export function duration([time]) {
Expand All @@ -23,10 +23,7 @@ export function duration([time]) {
return '0 seconds';
}
// convert to human-readable format: '1 hour 6 seconds'
let unit = largestUnitFromSeconds(seconds);
if (unit === 'd') unit = 'h'; // highest increment backend returns is hour
const duration = convertFromSeconds(seconds, unit);
return `${formatDuration(durationObject)} (${duration}${unit})`;
return formatDuration(durationObject);
}
return time;
}
Expand Down
Loading