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

Limit relative quota in user menu to two decimals #9369

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

pascalwengerter
Copy link
Contributor

@sonarcloud
Copy link

sonarcloud bot commented Jul 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -210,7 +210,7 @@ export default defineComponent({
},
quotaUsagePercent() {
return this.useLegacyQuota
? this.quota.relative
? parseFloat(this.quota.relative.toFixed(2))
Copy link
Member

Choose a reason for hiding this comment

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

Only parse this.quota.relative to float and then to a toFixed(2) on the result.

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 did that initially but then quotaUsagePercent is string | number and it gets messy further down where we're calculating how much free quota is left to change the color of the OcProgress component.
The alternative was parseFloat(parseFloat(this.quota.relative).toFixed(2)) but that also didn't really feel right...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll go ahead as-is and can adapt (= add another parseFloat) if EOS/Reva requires it

@dschmidt dschmidt mentioned this pull request Jul 10, 2023
37 tasks
@dschmidt dschmidt merged commit 15e09d8 into owncloud:master Jul 10, 2023
2 checks passed
@pascalwengerter pascalwengerter deleted the feature/9259 branch July 10, 2023 11:14
@tbsbdr tbsbdr added this to the CERN Web Merge milestone Jul 10, 2023
ownclouders pushed a commit that referenced this pull request Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong display of Quota percentage
4 participants