Wizard: add descriptions for settings
This commit is contained in:
+2
@@ -20,6 +20,7 @@ typealias AnySetting = Setting<*, *>
|
||||
|
||||
interface Setting<out V : Any, out T : SettingType<V>> : Entity, ActivityCheckerOwner, Validatable<V> {
|
||||
val title: String
|
||||
val description: String?
|
||||
val defaultValue: SettingDefaultValue<V>?
|
||||
val isRequired: Boolean
|
||||
val isSavable: Boolean
|
||||
@@ -31,6 +32,7 @@ interface Setting<out V : Any, out T : SettingType<V>> : Entity, ActivityChecker
|
||||
data class InternalSetting<out V : Any, out T : SettingType<V>>(
|
||||
override val path: String,
|
||||
override val title: String,
|
||||
override val description: String?,
|
||||
override val defaultValue: SettingDefaultValue<V>?,
|
||||
override val isAvailable: Checker,
|
||||
override val isRequired: Boolean,
|
||||
|
||||
+2
@@ -23,6 +23,7 @@ abstract class SettingBuilder<V : Any, T : SettingType<V>>(
|
||||
var validateOnProjectCreation = true
|
||||
var isSavable: Boolean = false
|
||||
var isRequired: Boolean? = null
|
||||
var description: String? = null
|
||||
|
||||
fun value(value: V) = SettingDefaultValue.Value(value)
|
||||
fun dynamic(getter: Reader.(SettingReference<V, SettingType<V>>) -> V?) =
|
||||
@@ -47,6 +48,7 @@ abstract class SettingBuilder<V : Any, T : SettingType<V>>(
|
||||
fun buildInternal() = InternalSetting(
|
||||
path = path,
|
||||
title = title,
|
||||
description = description,
|
||||
defaultValue = defaultValue,
|
||||
isAvailable = isAvailable,
|
||||
isRequired = isRequired ?: (defaultValue == null),
|
||||
|
||||
Reference in New Issue
Block a user