@diosmosis opened this Pull Request on June 28th 2022 Member

Description:

This PR is based off of #19390.

Changes:

  • Add Passthrough component to CoreHome for easy way to conditionally surround elements w/ a component (see LivePage.vue for use).
  • Move twig contents in Live that use angularjs directives to new Vue components.
  • Replace uses of $rootScope.$emit w/ Matomo.postEvent.

Review

@github-actions[bot] commented on July 19th 2022 Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions[bot] commented on July 28th 2022 Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@diosmosis commented on August 5th 2022 Member

Seems like there's one Live test failure here, where the icons are padded differently, however this doesn't seem Vue related as the rendering is done in twig and vue-directive doesn't actually invoke Vue.

@diosmosis commented on August 16th 2022 Member

@sgiehl applied a fix for what I think you're referring to

@sgiehl commented on August 16th 2022 Member

@diosmosis I was referrering to the profile links in this widget, which still don't work:

image

@diosmosis commented on August 16th 2022 Member

@sgiehl I see, should be fixed

@sgiehl commented on August 16th 2022 Member

@diosmosis found another issue. It seems that the real time widget looses its head on the first refresh. Guess that is caused by this code:
https://github.com/matomo-org/matomo/blob/d868c5c76d707e5e41666421ed27418c397806ef/plugins/Live/vue/src/LiveWidget/LiveWidgetRefresh.ts#L27-L38
Guess the vue component would need to be initialized after the content was replaced...

@diosmosis commented on August 16th 2022 Member

@sgiehl fixed

@sgiehl commented on August 17th 2022 Member

@diosmosis this seems to work on the real time page now. but not when displayed as a widget. In the widget the header seems not to be replaced at all.

@diosmosis commented on August 17th 2022 Member

@sgiehl interesting, I only tested in the widget on the dashboard. Tested again on both sites and it works for me. Could it be a caching issue on your end? Can you test again?

@sgiehl commented on August 18th 2022 Member

Tried it again. But it still doesn't work in the widget. I can see that the requests are sent out. But the result seems not be placed in the widget. I have the visitor generator running in parallel to ensure the numbers in the widget would change. So I'm able to validated that they don't 🤷

@diosmosis commented on August 19th 2022 Member

Ok, I'll try again w/ visitor generator running in parallel

@diosmosis commented on August 19th 2022 Member

@sgiehl ok, its definitely working for me. I looked at the network tab for getLastVisitsStart requests and checked that the response was used when completed. When the response had different HTML there was a visual change in the widget. I did notice however, it took quite a while for that response to actually be different. From previous experience w/ the visitor generator I think it might be due to time zone issues w/ visits being tracked, or visits tracked out of order, or something like that, so they don't always register as more recent than what's displayed.

@sgiehl commented on August 22nd 2022 Member

@diosmosis the list of visits is refreshing correctly. What doesn't seem to refresh is the summary above. That should be handled by the request for ajaxTotalVisitors. The numbers shown for last 24h / 30m always stay the same, even if the request would contain other numbers.

@diosmosis commented on August 22nd 2022 Member

@sgiehl I see, I get it now. Apologies it took a while for me to understand. Will take a look.

@diosmosis commented on August 22nd 2022 Member

@sgiehl Ok, I checked again, and this is working for me too. I saw the following scenarios:

  • The visits list doesn't change, so the following code in live.js does not trigger:

    if ($('#' + visitId, this.element).html() != $(item).html()) {
      this.updated = true;
    }

    This results in the onUpdate() function not being called, which means the count doesn't update.

  • The visits list changes, but ajaxTotalVisits returns the same count as before.

  • The visits list changes and the ajaxTotalVisits request returns a different count, in which case it updates.

Can you check that:

  • the getLastVisitsStart request returns something different
  • when it does, ajaxTotalVisits is then requested,
  • when the response for ajaxTotalVisits is different, the value is updated in the UI
    ?
This Pull Request was closed on August 25th 2022
Powered by GitHub Issue Mirror