Merge pull request #6350 from lasniscinote/gl_SCI_9419

Fixed a list-item bug where view_mode was active [SCI-9419]
This commit is contained in:
Alex Kriuchykhin 2023-10-05 15:31:17 +02:00 committed by GitHub
commit 587e07a9f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,7 +37,7 @@
:class="{ 'text-sn-grey font-normal': isBlank, 'whitespace-pre-line': !singleLine }" :class="{ 'text-sn-grey font-normal': isBlank, 'whitespace-pre-line': !singleLine }"
@click="enableEdit($event)" @click="enableEdit($event)"
> >
<span class="list-item" :class="{'truncate': singleLine}" v-if="smartAnnotation" v-html="sa_value || placeholder" ></span> <span :class="{'truncate': singleLine, 'list-item': viewMode !== 'active'}" v-if="smartAnnotation" v-html="sa_value || placeholder" ></span>
<span :class="{'truncate': singleLine}" v-else>{{newValue || placeholder}}</span> <span :class="{'truncate': singleLine}" v-else>{{newValue || placeholder}}</span>
</div> </div>
@ -78,7 +78,8 @@
return { return {
editing: false, editing: false,
dirty: false, dirty: false,
newValue: '' newValue: '',
viewMode: null
} }
}, },
mixins: [UtilsMixin], mixins: [UtilsMixin],
@ -90,6 +91,13 @@
if (this.editOnload) { if (this.editOnload) {
this.enableEdit(); this.enableEdit();
} }
// determine whether view mode is in projects(active) or templates(inactive)
const urlSearchParam = window.location?.search
if (!urlSearchParam) return
if (urlSearchParam.includes('view_mode=active')) {
this.viewMode = 'active'
}
}, },
watch: { watch: {
editing() { editing() {