haavardj / ngx-cron-editor

Graphically build CRON expressions in Angular 15+
https://github.com/haavardj/ngx-cron-editor
MIT License
44 stars 101 forks source link

Default values of tabs are wrong, when tabs are hidden #11

Closed hannosgit closed 1 year ago

hannosgit commented 1 year ago

Hi, I think I found a bug. I did not know where the file an issue, so I created a PR here. When tabs are hidden via CronOptions, the default value of the cron expression when switching between the tabs is wrong. E.g. when I hide the minutes tab, and I switch to the daily tab, the value of the cron expression is set to once per hour (which is the default value for the hour tab). I think I already found the location of the bug. I will try to come up with a PR to fix this.

haavardj commented 1 year ago

Yikes! That seems to require a non-trival fix :-)

I see that the issue tracker was disabled for this repo. I enabled it now. Please submit this as an issue/bug so we don't lose track of it.

ChaosNemesis commented 1 year ago

Does this explain why I'm unable to update the UI from code? I'm hiding the minutes and hours tabs. My UI is in a Material Dialog, that after ngOnInt call does an AJAX to get the form data. I've been unable to use the downloaded CRON string to set the UI.

hannosgit commented 1 year ago

Hi @haavardj , thank you for your work on maintaining this helpful component and for the quick response. I just pushed a commit to fix this. Could you please take a look at it?

haavardj commented 1 year ago

@ChaosNemesis: Yes, this might explain the problems you are seeing. I'll check and merge the fix provided by @hannosgit later this week.

hannosgit commented 1 year ago

@ChaosNemesis I do not think that this issue is related to your issue. You want to set the value of the component via Code but this component does currently not support a real two-way binding. You can only set the initial value of the component. You could try to not hide the tabs and then try to set the values but I assume that it will not work. I suggest you create a new issue here in GitHub.

hannosgit commented 1 year ago

@haavardj Thanks for the quick response. When to you plan to release a new version?

haavardj commented 1 year ago

Just posted 0.7.6 on npm :-)