diff --git a/waltz-data/src/main/java/org/finos/waltz/data/settings/SettingsDao.java b/waltz-data/src/main/java/org/finos/waltz/data/settings/SettingsDao.java index ef4d8786c6..97e3bd7b84 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/settings/SettingsDao.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/settings/SettingsDao.java @@ -91,6 +91,7 @@ public int update(UpdateSettingsCommand cmd) { return dsl .update(SETTINGS) .set(SETTINGS.VALUE, cmd.value()) + .set(SETTINGS.DESCRIPTION, cmd.description()) .where(SETTINGS.NAME.eq(cmd.name())) .and(SETTINGS.RESTRICTED.isFalse()) .execute(); diff --git a/waltz-model/src/main/java/org/finos/waltz/model/settings/UpdateSettingsCommand.java b/waltz-model/src/main/java/org/finos/waltz/model/settings/UpdateSettingsCommand.java index 35e1234e3f..9a89bb1f92 100644 --- a/waltz-model/src/main/java/org/finos/waltz/model/settings/UpdateSettingsCommand.java +++ b/waltz-model/src/main/java/org/finos/waltz/model/settings/UpdateSettingsCommand.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.finos.waltz.model.Nullable; import org.finos.waltz.model.command.Command; import org.immutables.value.Value; @@ -13,5 +14,6 @@ public abstract class UpdateSettingsCommand implements Command { public abstract String name(); public abstract String value(); + @Nullable public abstract String description(); } diff --git a/waltz-ng/client/system/svelte/settings/SettingsAdminView.svelte b/waltz-ng/client/system/svelte/settings/SettingsAdminView.svelte index f61416fffa..598ee5679f 100644 --- a/waltz-ng/client/system/svelte/settings/SettingsAdminView.svelte +++ b/waltz-ng/client/system/svelte/settings/SettingsAdminView.svelte @@ -27,7 +27,7 @@ $: displayedSettings = _.isEmpty(qry) ? settings - : termSearch(settings, qry, ["name", "value", "description"]) + : termSearch(settings, qry, ["name", "value", "description"]); $: canEdit = _.includes(user?.roles, 'ADMIN'); @@ -39,8 +39,9 @@ function updateSetting() { const cmd = { name: workingSetting.name, - value: workingSetting.value - } + value: workingSetting.value, + description: workingSetting.description + }; let updatePromise = settingsStore.update(cmd); @@ -123,20 +124,21 @@ {#each _.orderBy(displayedSettings, d => d.name) as setting} - - - {setting.name} - - - {#if editing && workingSetting?.name === setting?.name} - + {#if editing && workingSetting?.name === setting?.name} + + + {setting.name} + + +
@@ -145,29 +147,45 @@ Cancel
- {:else} + + + + + + + {:else} + + + {setting.name} + + {setting.value} - {/if} - - - {setting.description || ""} - - - {#if setting.restricted} -
- -
- {:else } - - {/if} - - + + + {setting.description || ""} + + + {#if setting.restricted} +
+ +
+ {:else } + + {/if} + + + {/if} {:else}