oqtane/oqtane.blogs

Issue: Module Settings - Set Items Per Page Only Allows 0-9 Results In Critical Error When Set To 0 And Unable To Set To 10.

Closed this issue · 2 comments

image

Issue:

Items Per Page in Module Settings only goes from 0-9 since it only allows 1 diget.
0 will throw an error.
Unable To Set To Default "10"

Expected Behavior:

The Items Per Page setting should allow digits 1-10
Should at least be adjusted 10 as default min, and max should be 100.

My Solution 1

So I was approaching this as resolving this that way but ran into issues with the module settings message notifications making errors in the ModuleInstance.AddModuleMessage as I could not get the UI to validate and/or stay on the module settings tab.

My Solution 2

My alternative way I resolved it was if it wasn't able to parse as an INT and did not meet condition minimum 1 maximum 100 it would set the default value of 10. This was successful in testing by keeping the blog module from failing with an error and i can produce this PR now.

Additional Issue

image

I was producing a solution with using input type="number" min="1" max="100" and then I was hoping to have the validation work along with the error message to set this properly. When testing however I cannot get a message to display in the module settings popup window while trying to make it happen from the menu here as it is not getting the ModuleInstance = null...

If we can get past this issue I have solution 1 ready as well I believe.

If I change to this removing ModuleInstance name class since it is injected in the modulebase.cs it then generates errors at this file location as shown here in these screen shots:
image

Error as shown:

image

Or I get another error at that same location the clear message PR was introduced at in the Oqtane Framework. Removing that change makes no difference.

Notes

Sound familiar?

A little feedback is inside the issue while revealing this other potential additional issue I am wondering why I am falling short while working with the Blog Module Settings Popup Window Information, Warning and Error Notification Messages to help with displaying the validation on Save action button? It will generate an error at the ModuleBase with or without the current changes made to clear the message. ModuleInstance is null and I feel it relates to the save button actions logic or something relating? I am not sure if other modules have this issue so it could be framework related issue?

If we can get solution 1 to work I think that would be best but either is better than the error.

Additional Context

As an idea the Oqtane Framework Pager UI Control Component could use this items per page enhancement, and maximum items lifted up to 1000 for long days and a sort option of 10, 20, 50, 100. Not sure if some sort of lazy loading can be done here as well.

My guess is the Oqtane Framework messaging system is more tied into the page the module is viewed on and not integrated into the settings popup for modules or per module form/component if that makes sense? I think this could be a starting point to investigate if possible and is the direction I will be going. I am still getting familiar with utilizing the messaging system for components usage in different areas of modules like this.

@thabaum PR oqtane/oqtane.framework#4018 should resolve the challenges you were experiencing where the AddModuleMessage was throwing an exception because ModuleInstance was null. This was due to the way that the Module Settings component is dynamically created and injected into the Settings.razor component. Note that this fix only works on 5.1 because it references RenderModeBoundary.razor. You should use AddModuleMessage() rather than ModuleInstance.AddModuleMessage().

completed