Changeset 7117


Ignore:
Timestamp:
Apr 14, 2016, 12:58:51 PM (6 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1997: The "Changed items" tab in the job dialog must limit the number of items

There is now a limit of 1000 items displayed in the "Change history". It would have been nice with full-fledged support for pagination and filtering but this requires a lot more work and is probably not worth the effort. Until someone really asks for it we'll just keep it simple.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/views/jobs/view_job.jsp

    r6988 r7117  
    560560        ItemQuery<ChangeHistory> query = ChangeHistory.getChangesBy(job);
    561561        query.order(Orders.asc(Hql.property("id")));
     562        query.setMaxResults(1000);
     563        query.setReturnTotalCount(true);
    562564        ItemResultIterator<ChangeHistory> changes = query.iterate(dc);
    563         int numChanges = 0;
     565        long numChanges = changes.getTotalCount();
    564566        %>
    565567        <tbl:table
     
    578580            <tbl:rows>
    579581            <%
     582            if (numChanges > 1000)
     583            {
     584              %>
     585              <tbl:panel subclass="bg-filled-100">
     586                <b>NOTE! Listing 1000 of <span title="<%=numChanges %>"><%=Values.formatNumber(numChanges / 1000f, 1, "k") %></span> total changes.</b>
     587              </tbl:panel>
     588              <%
     589            }
    580590            while (changes.hasNext())
    581591            {
    582               numChanges++;
    583592              ChangeHistory change = changes.next();
    584593              %>
Note: See TracChangeset for help on using the changeset viewer.