mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
UI: Better default transit auto-rotation (#15474)
* TTL Picker convers to largest unit when value is number * Initial value for transit auto-rotation period is 30d * Add auto-rotation check to transit test * Add changelog * Add clarifying comment
This commit is contained in:
@@ -74,7 +74,15 @@ export default TtlForm.extend({
|
||||
|
||||
if (typeOf(value) === 'number') {
|
||||
// if the passed value is a number, assume unit is seconds
|
||||
time = value;
|
||||
// then check if the value can be converted into a larger unit
|
||||
if (value % secondsMap.d === 0) {
|
||||
unit = 'd';
|
||||
} else if (value % secondsMap.h === 0) {
|
||||
unit = 'h';
|
||||
} else if (value % secondsMap.m === 0) {
|
||||
unit = 'm';
|
||||
}
|
||||
time = convertFromSeconds(value, unit);
|
||||
} else {
|
||||
try {
|
||||
const seconds = Duration.parse(value).seconds();
|
||||
|
||||
Reference in New Issue
Block a user