Modern UI Zimlets: Questions regarding the Modern UI's settings dialog

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Post Reply
leading zero
Posts: 35
Joined: Fri Apr 21, 2023 9:37 am
Location: Germany
ZCS/ZD Version: 10.0.3

Modern UI Zimlets: Questions regarding the Modern UI's settings dialog

Post by leading zero »

Hi everyone,

using the "settings" slot, it's possible for a zimlet to extend the standard "Settings" dialog with your own custom panels. That's pretty cool.
I've got two questions on this:

1. Is there also a canonical way to hook into the "Save" button's click event in order to save any changes the user made in a zimlet's custom settings panel?
By default, when the user clicks on "save", a ModifyPrefs request is sent to the server with all the changes made by the user. But changes made in a custom panel are not included in that request (of course).
So I guess the only way is to display a seperate "save" button for every zimlet or to create a separate modal window, respectively... is that correct or is there a more elegant way?

2. The display order of custom buttons in the "Settings" window is random, or, more precisely, seems to be depending on when the respective zimlet issues the context.plugins.register() call. I observed this with the Zoom zimlet and two zimlets I made. Sometimes the Zoom zimlet comes first, sometimes one of the other ones does.
Is there a proper way to make the display order deterministic? For now I resorted to an artificially introduced delay before my zimlets call context.plugins.register() (100 msec apart from one another), so they appear in the same order most of the time.

Thanks in advance for any thoughts on this.
Attachments
zimbra-settings-dialog.png
zimbra-settings-dialog.png (45 KiB) Viewed 8328 times
saket.patel
Zimbra Employee
Zimbra Employee
Posts: 130
Joined: Mon Apr 11, 2022 8:39 pm

Re: Modern UI Zimlets: Questions regarding the Modern UI's settings dialog

Post by saket.patel »

You can increase priority of zimlet to load first using

Code: Select all

zmzimletctl setPriority
command
leading zero
Posts: 35
Joined: Fri Apr 21, 2023 9:37 am
Location: Germany
ZCS/ZD Version: 10.0.3

Re: Modern UI Zimlets: Questions regarding the Modern UI's settings dialog

Post by leading zero »

saket.patel wrote: Fri Sep 15, 2023 5:16 pm You can increase priority of zimlet to load first using

Code: Select all

zmzimletctl setPriority
command
Thanks, but according to my tests, the priority doesn't seem to affect the buttons in the "Settings" dialog. Not even after "zmcontrol restart". They are still displayed in seemingly random order.
Damini Vashishtha
Zimbra Employee
Zimbra Employee
Posts: 29
Joined: Tue Oct 18, 2022 12:16 pm

Re: Modern UI Zimlets: Questions regarding the Modern UI's settings dialog

Post by Damini Vashishtha »

Regarding the answer of your first question: Yes, you can display a separate save button if you have multiple parameters to save from different options of zimlet UI in one go otherwise you can directly hit api on an action.
Post Reply