oqtane / DNF.Projects

Sample Oqtane module demonstrating a scheduled job and JSInterop visualizations using Chart.js. This module powers the trend analysis on https://dnfprojects.org.
https://dnfprojects.org/
MIT License
25 stars 17 forks source link

No graphic is shown #5

Closed jaruiz-ual closed 4 months ago

jaruiz-ual commented 1 year ago

Directory of the module is at the same level than oqtane.framework. After installing the module in one page I have added several github projects urls. I have checked that the data are in the database, but no graphics are shown in the page.

jaruiz-ual commented 1 year ago

I do not know why, but in the last try it seems that it is working.

jaruiz-ual commented 1 year ago

I can see some empty data, but nothing else. It is not working as expected.

jaruiz-ual commented 1 year ago

line 50 of ProjectRepositoty.cs in the Repository folder in DNF.Projects.Server the method public IEnumerable GetProjectActivity(int ProjectId, DateTime FromDate, DateTime ToDate)

is called with date parameters in the format mm/dd/yyyy but my local date format is dd/mm/yyyy then no ProjectActivity is found.

sbwalker commented 1 year ago

Sounds like there is an internationalization bug in the module

jaruiz-ual commented 1 year ago

Hi Shaun,As I did not know why any data of GitHub project is loaded by the module  then I filled manually them.  And I noticed that even in this way, any record was not selected to be shown (the filter between dates is not working in my case).Then, surfing around de source code, I  realiced  that it is necessary to fill in the Project Settings tab (GithubToken) in order to Access to the Github api for project data (start, contributions …). And also it is necessary activate the Scheluled job for the Github Projects. But I do not know where I can found the information to  access to those data using the Github api, for checking if the module work as expected.So, what information I have to set in the textboxs of the Project Settings Tab:GithubToken, NotifyName and NotityEmail?Thank you in advance.

sbwalker commented 1 year ago

Are you interested in this project as an example of how to create an Oqtane module (ie. including a scheduled job and JavaScript interop)... or are you interested in capturing daily metrics from Github?

sbwalker commented 1 year ago

Like most real world applications this module has a number of dependencies which need to be configured correctly in order for the full functionality to be enabled. You would configure these dependencies in the Module Settings:

  1. You need to create your own Github Token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token and enter the value.

  2. You should specify the Notify Name as your name and Notify Email as your preferred email address. These would be used to notify you if there was an issue accessing the Github API. However for this to work correctly, you would need to ensure the Notification job is also enabled in your installation and the SMTP Settings are set properly in the Site Settings..

jaruiz-ual commented 1 year ago

Thank you very much. 

jaruiz-ual commented 1 year ago

Finally I got the module working properly with some tricks. 1) Create a user key to be able to access the github apis (as you pointed). 2) Fill in the configuration of the module using that key. 3) Enable the module update frequency in "Scheduled Jobs" in the administration panel. 4) Add urls of the existing Github projects in the module, but be careful that you have to access the projects type combobox and change it (you cannot leave the default value "communtity", because it does not store anything – it seems to be a bug).

What was happend The Visual studio debugger always displays the value of a date field in the format "mm/dd/yyyy" when the mouse is on it. That's why I thought there was a problem in the format of the input parameters of the date type in the method that selected the git projects, but the problem was not there, it was in the "project type" combobox that was left with the default value " community" without changing it, the value null is entered in the database record, and therefore no records are selected.

jaruiz-ual commented 1 year ago

There is another bug in the view.razor source code. When a project is displayed all data are shown. It is necessary a where clausulae filtering the project id (in the line 123, inside the Display() method). image.

jaruiz-ual commented 1 year ago

when the interop.CreateChart is called (line 175 of View.razor) the fontColor options is set to "white". Then if the background of the module is also "white" the labels of the projects in the graph can not be seen. At least the fontColor property of the labels should be configurable in the module (or set to another colour distinct of the background colour dinamically)

sbwalker commented 1 year ago

@jaruiz-ual I have to apologize... I finally had time to open the project locally and I noticed that I have a bunch of code files that were modified but not submitted to the repo. I will address get this fixed this weekend.

sbwalker commented 1 year ago

@jaruiz-ual this commit should resolve all of your issues:

https://github.com/oqtane/DNF.Projects/commit/7d7b151cd09ee33bb512722b96ec08d99a019663

jaruiz-ual commented 1 year ago

Thank you very much!!

jaruiz-ual commented 1 year ago

Hi Shaun,I have updated the source code of DNF.Projects.However, there is a problem with the field category when adding a Project.  The select tag does not change the value of the binded variable. It is always null.And I do not know why.

sbwalker commented 1 year ago

I will take a look today.