Hey @rosscdh - what a first post in the community. I love it Welcome to the Zammad community.
I checked the current implementation and the Setting
storage_provider JS controller is inheriting from App.SettingsAreaItem and renders a custom template (you’ve already updated in the PR). A Setting Item is handled as a simple one value entity without any relation to other Settings. This helps us to add simple Settings without much hassle.
In your context you want to have a more rich Setting with logic and dependencies. So instead of using the
App.SettingsAreaItem as a controller you want to build a custom one like e.g.
App.SettingsAreaLogo. This way you get the full control of rendering your setting block.
App.SettingsAreaLogo actually is a pretty good example here with a rich functionality.
We have no perfect solution for storing access variables yet and relied on dedicated Settings-Records with custom rendering in the past.
So what you could do is migrate the Setting “element” from inheriting from
App.SettingsAreaItem to a custom version of
App.SettingsAreaStorage. This would extend the current UI and would render a nice UI where the Admin could choose between the storage providers the same way as it is right now. There would be no visual difference from the current input except that S3 would be available. But when the Admin selects S3 the additionally required attribute input fields are shown. Once the Admin clicks submit the new
App.SettingsAreaStorage controller kicks in, checks which provider is selected and also checks for additional attributes if needed. These custom attributes/additional access variables could then be stored via
We could let the S3 storage backend fall back on ENVs if the access variable Settings are blank.
Some more backround information you might be interested in:
For the frontend we rely on an outdated framework called SpineJS with some additional custom logic. You can find more information about it here: https://spine.github.io/
I’d also recommend to open up a bottle of wine and spend some time on looking how other JS controllers work.
The JS template engine we use is called and outdated as well. You can find more information about it here: https://github.com/sstephenson/eco
Hope that helps and gives you a direction. Let me know if you have any further questions.
Looking forward to merge your S3 contribution