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

[Auto refresh] Should auto refresh transform unit? #5571

Closed
katrin-freihofner opened this issue Jan 27, 2022 · 6 comments · Fixed by #7501
Closed

[Auto refresh] Should auto refresh transform unit? #5571

katrin-freihofner opened this issue Jan 27, 2022 · 6 comments · Fixed by #7501

Comments

@katrin-freihofner
Copy link

As a user, I would expect the refresh interval to stick to the unit I have set it. For example: if I set it to 62 seconds, I would expect when I reopen the popover, that it shows 62 seconds again.

eui

@thompsongl
Copy link
Contributor

I think this is related to #4026, and that the underlying issue is the transformation process into and out of rounded formatting. Definitely worth some investigation.

@github-actions
Copy link

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

@daveyholler
Copy link
Contributor

@constancecchen You mentioned you may have an update here.

@cee-chen
Copy link
Contributor

I swear I remember trying to solve this but I don't think I ever did, or that intention was too difficult to figure out. For what it's worth, the relevant code is here:

function fromMilliseconds(milliseconds: Milliseconds): EuiRefreshIntervalState {
const round = (value: number) => parseFloat(value.toFixed(2));
if (milliseconds > MILLISECONDS_IN_HOUR) {
return {
units: 'h',
value: round(milliseconds / MILLISECONDS_IN_HOUR),
};
}
if (milliseconds > MILLISECONDS_IN_MINUTE) {
return {
units: 'm',
value: round(milliseconds / MILLISECONDS_IN_MINUTE),
};
}
return {
units: 's',
value: round(milliseconds / MILLISECONDS_IN_SECOND),
};
}

@daveyholler
Copy link
Contributor

We're going to close this issue for the time being. In the mean time, feel free to provide guidelines and specifications on how you see this working in all instances.

@cee-chen
Copy link
Contributor

cee-chen commented Feb 6, 2024

Hey! Just to update on this, we've added the ability for consumers/Kibana devs to address this in their individual use-cases with a new refreshIntervalUnits prop. See #7501 for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants