Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

Limit relative quota in user menu to two decimals - #9369

Merged
dschmidt merged 1 commit into
owncloud:masterfrom
pascalwengerter:feature/9259
Jul 10, 2023
Merged

dschmidt merged 1 commit into
owncloud:masterfrom
pascalwengerter:feature/9259

Conversation

@pascalwengerter

Copy link
Copy Markdown
Contributor

@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2023

Copy link
Copy Markdown

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

quotaUsagePercent() {
return this.useLegacyQuota
? this.quota.relative
? parseFloat(this.quota.relative.toFixed(2))

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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 done
@dschmidt
dschmidt merged commit 15e09d8 into owncloud:master Jul 10, 2023
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong display of Quota percentage

4 participants