fix(frontend): show PlotRenderOptions only in user settings

PlotRenderOptions was rendered both in AdminSettings.svelte and in
UserSettings.svelte. Since Config.root.svelte always renders UserSettings,
including for admins, admins saw the identical plot-render cards twice on
/config.

The admin copy was also misleading: every form in the component posts to
/frontend/configuration/, whose handler (RestAPI.updateConfiguration) always
writes per-user config via UserCfgRepo.UpdateConfig — never a global default.
On top of that, the admin-side handleSettingSubmit lacked the colorblind-mode
special case that UserSettings uses to keep PlotColorScheme in sync, so
toggling the option there did not refresh the palette preview.

Removes the component from AdminSettings.svelte along with the message,
displayMessage, handleSettingSubmit and popMessage members that existed only
to feed it. The remaining admin children manage their own messages.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-27 09:05:00 +02:00
co-authored by Claude Opus 5
parent e63cafc877
commit 947b784ba8
@@ -16,7 +16,6 @@
import Options from "./admin/Options.svelte"; import Options from "./admin/Options.svelte";
import NoticeEdit from "./admin/NoticeEdit.svelte"; import NoticeEdit from "./admin/NoticeEdit.svelte";
import RunTaggers from "./admin/RunTaggers.svelte"; import RunTaggers from "./admin/RunTaggers.svelte";
import PlotRenderOptions from "./user/PlotRenderOptions.svelte";
/* Svelte 5 Props */ /* Svelte 5 Props */
let { let {
@@ -30,8 +29,6 @@
/* State Init */ /* State Init */
let users = $state([]); let users = $state([]);
let roles = $state([]); let roles = $state([]);
let message = $state({ msg: "", target: "", color: "#d63384" });
let displayMessage = $state(false);
/* Functions */ /* Functions */
function getUserList() { function getUserList() {
@@ -55,37 +52,6 @@
getValidRoles(); getValidRoles();
} }
async function handleSettingSubmit(event, setting) {
event.preventDefault();
const selector = setting.selector
const target = setting.target
let form = document.querySelector(selector);
let formData = new FormData(form);
try {
const res = await fetch(form.action, { method: "POST", body: formData });
if (res.ok) {
let text = await res.text();
popMessage(text, target, "#048109");
} else {
let text = await res.text();
throw new Error("Response Code " + res.status + "-> " + text);
}
} catch (err) {
popMessage(err, target, "#d63384");
}
return false;
}
function popMessage(response, restarget, rescolor) {
message = { msg: response, target: restarget, color: rescolor };
displayMessage = true;
setTimeout(function () {
displayMessage = false;
}, 3500);
}
/* on Mount */ /* on Mount */
onMount(() => initAdmin()); onMount(() => initAdmin());
</script> </script>
@@ -107,4 +73,3 @@
<NoticeEdit {ncontent}/> <NoticeEdit {ncontent}/>
<RunTaggers /> <RunTaggers />
</Row> </Row>
<PlotRenderOptions config={ccconfig} bind:message bind:displayMessage updateSetting={(e, newSetting) => handleSettingSubmit(e, newSetting)}/>