Added optional tps prefix. Fixes #3

This commit is contained in:
Peter Morton 2023-10-20 17:17:17 -05:00
parent b46475d18b
commit 4509e275b2

View File

@ -36,13 +36,19 @@ onMounted(() => {
}); });
function setValueFromTPS(reference, param, props) { function setValueFromTPS(reference, param, props) {
getTenantProperty(param, props)
if (param.startsWith('tps:')) {
const tpsProperty = param.substring(4, param.length);
getTenantProperty(tpsProperty, props)
.then((value) => { .then((value) => {
reference.value = value; reference.value = value;
}) })
.catch((err) => { .catch((err) => {
errorMessage.value = `${err} for TPS property ${param}`; errorMessage.value = `${err} for TPS property ${tpsProperty}`;
}); });
} else {
reference.value = param;
}
} }
function fetchData() { function fetchData() {
@ -72,11 +78,11 @@ function fetchData() {
<VerticalLabelValue label="ANI" :value="ani"></VerticalLabelValue> <VerticalLabelValue label="ANI" :value="ani"></VerticalLabelValue>
<VerticalLabelValue label="DNIS" :value="dnis"></VerticalLabelValue> <VerticalLabelValue label="DNIS" :value="dnis"></VerticalLabelValue>
<div v-if="authenticated == 'true'" id="authbox"> <div v-if="authenticated == 'true'" id="authbox">
<font-awesome-icon id="auth" :icon="['fas', 'user-shield']" size="2xl" style="color: #45b408;"/> <font-awesome-icon id="auth" :icon="['fas', 'user-shield']" size="2xl" style="color: #45b408;" />
Customer Authenticated Customer Authenticated
</div> </div>
<div v-else id="noauthbox"> <div v-else id="noauthbox">
<font-awesome-icon id="noauth" :icon="['fas', 'user-lock']" size="2xl"/> <font-awesome-icon id="noauth" :icon="['fas', 'user-lock']" size="2xl" />
Customer Not Authenticated Customer Not Authenticated
</div> </div>
</div> </div>