Move humanize and truncate functions to horizon.quota.js

Bug #1480106 reported by Rajat Vig
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Rajat Vig

Bug Description

As commented on the review for

https://review.openstack.org/#/c/199345

here

https://review.openstack.org/#/c/199345/16/horizon/static/framework/util/tech-debt/helper-functions.js

the functions humanize and truncate are only used in horizon.quota.js and should be located there.

Also, no code uses capitalize which should be deleted

Changed in horizon:
assignee: nobody → Rajat Vig (rajatv)
status: New → In Progress
Revision history for this message
Doug Fish (drfish) wrote :

Looking more broadly at this patch, I don't think it's moving in the right direction.

If we had a working humanizeNumbers function I'd expect it to be broadly used, the same way Django's humanize filter is. It shouldn't be specifically associated with the quotas panel. If this weren't in a directory called "tech-debt" which is completely inappropriate I'd have given the patch a -2. However, the code shouldn't stay like it is.

We should either yank the broken humanizeNumbers function entirely, or place it appropriately for reuse

humanizeNumbers bug: https://bugs.launchpad.net/horizon/+bug/1384462

Revision history for this message
Doug Fish (drfish) wrote :

oops - wrong box!

Revision history for this message
Doug Fish (drfish) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/219841

Changed in horizon:
assignee: Rajat Vig (rajatv) → Richard Jones (r1chardj0n3s)
Changed in horizon:
assignee: Richard Jones (r1chardj0n3s) → Rajat Vig (rajatv)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/207549
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=3f126c08e993cf60098a2e2dcf9745859198d848
Submitter: Jenkins
Branch: master

commit 3f126c08e993cf60098a2e2dcf9745859198d848
Author: Rajat Vig <email address hidden>
Date: Mon Oct 5 09:44:51 2015 -0700

    Move humanize and truncate to horizon.quota.js

    The functions humanize and truncate from horizon.utils
    module are only used in horizon.quota.
    This moves them over there and removes them the module.

    This was inspired off comments in
    https://review.openstack.org/#/c/199345

    Co-Authored-By: Kyle Olivo<email address hidden>
    Co-Authored-By: Richard Jones <email address hidden>
    Change-Id: I48cf59cde7a673a19aa532b6515cdebf6f9d3638
    Closes-Bug: #1480106

Changed in horizon:
status: In Progress → Fix Committed
Changed in horizon:
importance: Undecided → Low
milestone: none → mitaka-1
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 9.0.0.0b1

This issue was fixed in the openstack/horizon 9.0.0.0b1 development milestone.

Changed in horizon:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/219841
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=cd4942c640b39f41b97d235699ba8497335fc80c
Submitter: Jenkins
Branch: master

commit cd4942c640b39f41b97d235699ba8497335fc80c
Author: Rajat Vig <email address hidden>
Date: Wed Sep 2 11:33:42 2015 -0700

    Remove the truncate function from horizon.quota.js

    The function is replaced by using CSS rules

    This was inspired off comments in
    https://review.openstack.org/#/c/207549

    Change-Id: Id433b3988ea1007cba942f1e5d200d5e6972edf2
    Co-Authored-By: Kyle Olivo<email address hidden>
    Co-Authored-By: Diana Whitten <email address hidden>
    Closes-Bug: #1480106

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 9.0.0.0b3

This issue was fixed in the openstack/horizon 9.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.