An inherited field shows what it inherited, not an example

Country read "DE" under the words "inherited from your organization",
while the organization it was inheriting from said DK. The DE was never
a value at all — it was the example placeholder, left in place when the
field locked, and an example in that position is not a hint. It is a
wrong answer to the question the box is being asked: which country am I
inheriting?

The server had already settled what may be shown. It sends the secrets
back as dots and everything else in the clear, country included, and only
the panel was throwing that away. So a locked field now placeholders its
effective value, and the example is kept for the case it was written for:
an empty box waiting to be filled in.

Applied to the non-secret cascading fields rather than to the one that
was noticed — Green Cell's port, serial, timeout and command topic had
the same example hardcoded a card further down, and would have told the
same lie the moment an org set them.

The dots are left alone. They are the panel's own masking, and rerouting
them through the server's effective value would be the same result by a
different path — not worth changing how a secret is displayed as a side
effect of this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tajniak81
2026-09-03 20:51:57 +02:00
co-authored by Claude Opus 5
parent 830ef0cde5
commit c1b76a801d
+20 -5
View File
@@ -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"
/>
<p v-if="greencellField('serial').locked" class="mt-1 text-xs text-muted">{{ greencellSourceLabel('serial') }}</p>
@@ -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"
/>
<p v-if="greencellField('commandTopic').locked" class="mt-1 text-xs text-muted">{{ greencellSourceLabel('commandTopic') }}</p>