bakerkretzmar / nova-settings-tool

Laravel Nova tool to view and edit application settings.
MIT License
167 stars 32 forks source link

How can "toggle" be set to true as default? #17

Closed michapixel closed 5 years ago

bakerkretzmar commented 5 years ago

Just added this! Set 'default' => true for the Toggle settings you want on by default.

michapixel commented 5 years ago

Very nice! The toggle works as promised, but textfields/Textareas do not (didn't try checkboxes and radios or selects/options), unless there is another way like what i did:

default -> nada
value -> nada
text -> nada
html -> nada
bakerkretzmar commented 5 years ago

Didn't even think to expand this to the other setting types, will do.

bakerkretzmar commented 5 years ago

I'm rethinking this actually, since this package's goal isn't to handle the settings themselves in your app, just make a nice gui for them in Nova. With the toggle for example, setting default => true actually doesn't affect the value of the setting in the JSON, only what gets displayed on the tool. This actually strikes me as pretty confusing.

@michapixel thoughts?

michapixel commented 5 years ago

My standpoint would be:

Not all settings possible should be covered by this tool, but the most basic things, like checkbox/toggle, input (single line), input numbers (int and decimal), Multiline text, image field, icon field (fontawesome, customizable?) And for complex one's I'd suggest json-editor ( https://github.com/josdejong/jsoneditor/blob/develop/README.md)

Beware, I'm on vacation this week and the next, and after that i might be working on some other thing the first days, but I'll try to help, as i think this might be very handsome in every project.

Let me know what you think.

Jacob Baker-Kretzmar notifications@github.com schrieb am Sa., 27. Juli 2019, 21:38:

I'm rethinking this actually, since this package's goal isn't to handle the settings themselves in your app, just make a nice gui for them in Nova. With the toggle for example, setting default => true actually doesn't affect the value of the setting in the JSON, only what gets displayed on the tool. This actually strikes me as pretty confusing.

@michapixel https://github.com/michapixel thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bakerkretzmar/nova-settings-tool/issues/17?email_source=notifications&email_token=AAC2RPIIYKQWNPYWEKB6MW3QBSP3VA5CNFSM4HXKJLTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26RMAI#issuecomment-515708417, or mute the thread https://github.com/notifications/unsubscribe-auth/AAC2RPNRQHOWJ4YLTEJDNOLQBSP3VANCNFSM4HXKJLTA .

bakerkretzmar commented 5 years ago

@michapixel thanks for your input. I'm going to revert this in v1, I think it's safer to keep the presentation of the settings and their values firmly separate, if a setting needs to be 'on' or some other value by default, you should configure that where you're consuming the setting value or just manually set it to your desired default when you add it.