diff --git a/Web App/web/src/views/Settings.vue b/Web App/web/src/views/Settings.vue index 3075a56..b8546ac 100644 --- a/Web App/web/src/views/Settings.vue +++ b/Web App/web/src/views/Settings.vue @@ -336,6 +336,21 @@ async function saveBio() { } } +// What an inherited field shows when it is empty. +// +// A locked field is standing in for a value set above the caller, and the server +// has already decided which of those may be read: it sends the secrets back as +// dots and everything else in the clear. So the placeholder is that effective +// value — the thing the field will actually use — and the example is for the +// other case, an empty box waiting to be filled in. +// +// The example belongs only there. A country field placeholdered "DE" under the +// words "inherited from your organization" is not a hint, it is a wrong answer +// to the question the user is asking it: which country am I inheriting? +function inheritedPlaceholder(field, example = "") { + return field.locked ? field.effective || "" : example; +} + // --- Integrations: Toyota Connected (per-user, cascading settings) --- // // The server resolves a superadmin → org admin → user cascade and returns, per @@ -1561,7 +1576,7 @@ onBeforeUnmount(() => { v-model="ankerForm.country" class="dh-input" :disabled="ankerLocked('country')" - placeholder="DE" + :placeholder="inheritedPlaceholder(ankerField('country'), 'DE')" maxlength="2" autocomplete="off" /> @@ -1825,7 +1840,7 @@ onBeforeUnmount(() => { v-model="greencellForm.port" class="dh-input" :disabled="greencellLocked('port')" - placeholder="1883" + :placeholder="inheritedPlaceholder(greencellField('port'), '1883')" inputmode="numeric" autocomplete="off" /> @@ -1878,7 +1893,7 @@ onBeforeUnmount(() => { v-model="greencellForm.serial" class="dh-input" :disabled="greencellLocked('serial')" - placeholder="EVGC021B22752405ZM0018" + :placeholder="inheritedPlaceholder(greencellField('serial'), 'EVGC021B22752405ZM0018')" autocomplete="off" />
{{ greencellSourceLabel('serial') }}
@@ -1890,7 +1905,7 @@ onBeforeUnmount(() => { v-model="greencellForm.timeout" class="dh-input" :disabled="greencellLocked('timeout')" - placeholder="12" + :placeholder="inheritedPlaceholder(greencellField('timeout'), '12')" inputmode="numeric" autocomplete="off" /> @@ -1903,7 +1918,7 @@ onBeforeUnmount(() => { v-model="greencellForm.commandTopic" class="dh-input" :disabled="greencellLocked('commandTopic')" - placeholder="/greencell/evse/{sn}/command" + :placeholder="inheritedPlaceholder(greencellField('commandTopic'), '/greencell/evse/{sn}/command')" autocomplete="off" />{{ greencellSourceLabel('commandTopic') }}