[stx-gui] Use timesinceSorter in admin/inventory panel instead of uptimeSorter.

Bug #1809861 reported by Yan Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Yan Chen

Bug Description

Use timesinceSorter in admin/inventory panel instead of uptimeSorter.

timesinceSorter is provided by horizon as the default sorter of the datetime fields in a table.
uptimeSorter is introduced by stx-gui project and is only used in host inventory panel, for the sortable column of uptime of the hosts.
We can use timesinceSorter instead, so that we dont have upstream dependency.

Found by code-review.

Yan Chen (ychen2u)
Changed in starlingx:
assignee: nobody → Yan Chen (ychen2u)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stx-gui (master)

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

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stx-gui (master)

Reviewed: https://review.openstack.org/627459
Committed: https://git.openstack.org/cgit/openstack/stx-gui/commit/?id=d230601b8e7ea90643e3cce67d6f7a38ae079c91
Submitter: Zuul
Branch: master

commit d230601b8e7ea90643e3cce67d6f7a38ae079c91
Author: Yan Chen <email address hidden>
Date: Thu Dec 27 20:03:51 2018 +0800

    Use timesinceSorter instead of the uptimeSorter.

    timesinceSorter is provided by horizon as the default sorter of
    the datetime fields in a table. We don't have to create a uptimeSorter
    for host inventory panel.

    The reason that we failed to use timesinceSorter before is the
    datetime returned by host.boottime is calculated by datetime.now() but
    not timezone.now(). With this change, timesinceSorter can work well
    with host inventory panel.

    Test done for the change:

    1. Build iso with this patch.
    2. Deploy with 1 controller and 2 compute nodes.
    3. Open starlingx dashboard, Admin -> Platform -> Host Inventory,
    press on the column head of "Uptime" of the table for compute nodes,
    the timesinceSorter works well to sort the compute nodes.
    4. Check the page source, the Uptime column is marked as
    "data-type="timesince"", and the data for this column is marked
    with data-seconds (added by the timesince_sortable filter),
    format as below:
      <span data-seconds="4361">1 hour, 12 minutes</span>

    Closes-Bug: 1809861

    Change-Id: I5f9e896ccb0e4bb0e7d801402f9139e191cf9e08
    Signed-off-by: Yan Chen <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Revision history for this message
Ghada Khalil (gkhalil) wrote :

Adding stx.2019.05 tag as this fix was merged for that release

tags: added: stx.2019.05 stx.gui
Changed in starlingx:
importance: Undecided → Medium
Ken Young (kenyis)
tags: added: stx.2.0
removed: stx.2019.05
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.