umbraco-community / umbraco-analytics

Google Analytics for the Umbraco CMS
41 stars 31 forks source link

"Last 7 days" dashboard chart only load on page load #12

Closed bjarnef closed 9 years ago

bjarnef commented 10 years ago

The chart in the dashboard "Last 7 days" only seems to load when the page loads or you e.g. access /umbraco/#/analytics/analyticsTree/view/dashboard

When you choose another tree node and go back to root node (Analytics) it doesn't render the chart.

warrenbuckley commented 9 years ago

@bjarnef I believe this is fixed now if you PULL latest and retest again please. 8e458d5c342b80da8c7b7ff2febe103af3c9c87a

bjarnef commented 9 years ago

@warrenbuckley I don't see the dashboard is added to /Config/Dashboard.config when I add these changes and build the solutions .. I can only access the dashboard via the url. But when I reported this error, it was by installing the package, where the dashboard only loaded on page refresh.

warrenbuckley commented 9 years ago

@bjarnef how strange. I would recommend refetching and ensuring the test website respins up (kick web.config or App Pool) as there is install code specific to adding the dashboard to that config file.

This code fires on the Umbraco event - Application Started.

And the dashboard can be accessed when clicking on the root tree item labelled Analytics. Do you mind retesting to see if this works or attaching the debugger and stepping through please to see if there are any YSODs on why it is not saving the changes to the config file.

bjarnef commented 9 years ago

@warrenbuckley I have tried to restart App Pool by touching web.config, but it didn't seem to have any effect.. I am running the application through localhost directly from Visual Studio - not sure if it makes a difference?

When I click on the section node (root) I get a 200 Status OK for http://localhost:62315/umbraco/backoffice/UmbracoApi/Dashboard/GetDashboard?section=analytics ... however the response is just )]}',[]

Shouldn't this request return something? /umbraco/backoffice/UmbracoApi/Dashboard/GetDashboard?section=analytics

bjarnef commented 9 years ago

@warrenbuckley I think it is correctly added to dashboard.config when installing the package. Not sure why it doesn't add it to dashboard.config when running the application from Visual Studio.

anyway, I just added the dashboard tree structure in dashboard.config manual and it then loads the dashboard. However when I browse from root node, select another node and back to root node, sometimes the graph isn't loaded.

<section alias='AnalyticsDashboardSection'>
    <areas>
      <area>analytics</area>
    </areas>
    <tab caption='Last 7 days'>
      <control addPanel='true' panelCaption=''>/App_Plugins/Analytics/backOffice/AnalyticsTree/partials/dashboard.html</control>
    </tab>
  </section>

Even if I modify dashboard.config to use double quotes("), it seems sometimes to fail to render the graph, but I don't get any errors in console and in that case the canvas element for the graph just have a height and width of 0px.

<section alias="AnalyticsDashboardSection">
    <areas>
      <area>analytics</area>
    </areas>
    <tab caption="Last 7 days">
      <control addPanel="true" panelCaption="">/App_Plugins/Analytics/backOffice/AnalyticsTree/partials/dashboard.html</control>
    </tab>
  </section>
warrenbuckley commented 9 years ago

@bjarnef I am going to close this issue as I believe it is fixed. When you do testing later today or tomorrow let's open any new issues where needed.