Some filtering/sorting doesn't work on CPF?

The sorting on the events table doesn’t seem to be working, I don’t believe the work flow or the html were ever changed at any point, what makes it weirder is that the sorting does work on other pages such as the devices table.

Also along with that the icon for an “info event” also does not load/show.

Not exactly sure how the filtering works so Im not sure what could’ve broke it.

Lastly the arrows to navigate pages, and the drop down to change the number of events doesn’t work either.

Info Icon not showing, other icons are showing:
image

Sorting not working on the events table:
image

Sorting working on devices table:
image

Just for clarification, you’re saying “sorting” a lot but I think you mean “filtering”? As in, sorting being the order in which results are returned and filtering being limiting which results are returned?

Also along with that the icon for an “info event” also does not load/show.

I can confirm this and have filed a bug ticket. We’ll investigate; it’s probably an easy fix and we’ll let you know how to apply it to your version of the template.

Sorting not working on the events table:

I’m not seeing this issue in the base template. Is the table refreshing when you change the value in the “Customer” dropdown but just returning the same results, or is nothing happening?

  • If refreshing with the same results, I would check the workflow that is rendering that table and verify that the requested value is being passed through to the Event: Get Node. In the base template, this is an experience workflow called “cpf-element-events-table”. (See attached)
  • If nothing is happening, I would check your browser console to see if an error is being thrown somewhere that would prevent the request from going through. (In this case you would not see the workflow execute.)

Lastly the arrows to navigate pages, and the drop down to change the number of events doesn’t work either.

This issue I am not seeing. My recommendation is the same as the previous - verify that a request is being made when changing pages and that the page number / per-page values are making it to the workflow if so.

I looked both of those place initially as well, neither seem to show anything, these are taken after me loading the page, then clearing the console and debug, then trying to filter or change pages

weirdly enough the only one that showed anything at all was the date filter which did change the filtering and trigger the work flow, other than that nothing in console or on debug


Fix for the missing “info” icon -

In the experience page “cpf-element-events-table”, we simply aren’t covering the case for “info” events". In the base template, you’ll see this around line 114 …

<td class="text-nowrap material-symbols-outlined cpf-icon-{{this.level}} cpf-icon-small" data-bs-toggle="tooltip" title="{{this.level}}">
  {{#eq this.level 'warning'}}
  warning
  {{/eq}}
  {{#eq this.level 'critical'}}
  explosion
  {{/eq}}
  {{#eq this.level 'error'}}
  error
  {{/eq}}
</td>

If you just add this as another case before the closing </td> tag, the icon will appear:

{{#eq this.level 'info'}}
info
{{/eq}}
1 Like

image
Thank you

This is a sanity check question but, are you sure filtering isn’t working? Based on your screenshot I tracked down your application. It does not have any events of the “Warning” level and the “Acknowledged” state - which matches up with your CPF screenshot.

If you determine that filtering is indeed broken, we’ll need you to set up an experience user for us and PM us the password so we can reproduce.

The original screenshot is misleading, nothing was filtered until I changed the date range filter, then that made nothing appear

here is filtering for critical level and still having all types of levels show up
image

and debug for the events table is empty
imagec

sure I can set that up for you how should i message you the info

Update, I’m told this is actually an older bug that was fixed here:

So if you want to port these changes into the component “cpf-js-element-events-table”, that should resolve it.

1 Like

Alright thank you that seems to have fixed all my issues

@Dylan_Schuster This couldve been something that was fixed also since I got my cpf version,

I was having an issue where the filter bars would “save” two inputs, or an old input that has since been deleted.

This was preventing me from clearing out the filter again to default and showing everything

For example:


image


image

Typing something again let me get back filtering just for the inputted text


image

clearing out the box again to default returns no devices and this is what’s sent to the query
image

I believe it is this section of code that is causing this issue (around line 110 in cpf-js-element-events-table)

let queryParams = Array.from(filterFields).map((f) => {
    return f.value !== '' ? `${f.dataset.filter}=${encodeURIComponent(f.value)}` : null
});

changing that to just not check for '' seemed to fix the issue of not being able to clear the filtering for me, not sure if this would cause any other unintended interactions for but figured id just bring it up incase it hadn’t been fixed/still existed

let queryParams = Array.from(filterFields).map((f) => {
    return `${f.dataset.filter}=${encodeURIComponent(f.value)}`;
});

I suppose this could have also stemmed from the fact i changed it to sorting via name rather than ID but if i remember correctly i was having the issue prior to that change

It will also some times also return values like this
image
which i fixed with a function node with

if (Array.isArray(payload.data.query.device)) {
    payload.data.query.device=payload.data.query.device[0];
}