case 3987

This commit is contained in:
2021-09-29 20:22:50 +00:00
parent 67ce070580
commit b925badccc
3 changed files with 35 additions and 14 deletions

View File

@@ -55,21 +55,26 @@ export default {
//ctx.title if set is a Translation key
//ctx.formData.recordName is the object name or serial number or whatever identifies it uniquely
let recordName = "";
if (ctx && ctx.formData && ctx.formData.recordName) {
if (
ctx &&
ctx.formData &&
ctx.formData.recordName &&
ctx.formData.recordName != "null" //some forms (part) present "null" as the record name due to attempts to format a name so if that's the case just turn it into null here to bypass
) {
recordName = ctx.formData.recordName;
}
const hasRecordName = recordName != "";
const hasRecordName = !window.$gz.util.stringIsNullOrEmpty(recordName);
if (ctx.title) {
//it has a title translation key
const translatedTitle = vm.$ay.t(ctx.title);
if (hasRecordName) {
//recordname takes all precedence in AppBar in order to conserve space (narrow view etc)
//also it just looks cleaner, the icon is already there to indicate where the user is at
//vm.appBar.title = `${ctx.title}:${recordName}`;
vm.appBar.title = recordName;
document.title = `${recordName} - ${vm.$ay.t(ctx.title)} AyaNova `;
document.title = `${recordName} - ${translatedTitle} AyaNova `;
} else {
vm.appBar.title = ctx.title;
document.title = `${vm.$ay.t(ctx.title)} ${recordName}`;
vm.appBar.title = translatedTitle;
document.title = `${translatedTitle} ${recordName}`;
}
} else {
if (hasRecordName) {