Fix record not loading before blocks on record pages
This commit is contained in:
parent
7b40471f35
commit
6c75df8977
@ -3,22 +3,11 @@
|
|||||||
v-bind="$props"
|
v-bind="$props"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
>
|
>
|
||||||
<label
|
|
||||||
v-if="error"
|
|
||||||
class="text-primary p-3"
|
|
||||||
>
|
|
||||||
{{ error }}
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-else
|
|
||||||
class="rt-content p-3"
|
|
||||||
>
|
|
||||||
<p
|
|
||||||
:style="{ 'white-space': 'pre-wrap' }"
|
:style="{ 'white-space': 'pre-wrap' }"
|
||||||
|
class="rt-content p-3"
|
||||||
v-html="contentBody"
|
v-html="contentBody"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
</wrap>
|
</wrap>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -29,30 +18,12 @@ import { NoID } from '@cortezaproject/corteza-js'
|
|||||||
export default {
|
export default {
|
||||||
extends: base,
|
extends: base,
|
||||||
|
|
||||||
data () {
|
computed: {
|
||||||
return {
|
contentBody () {
|
||||||
error: null,
|
|
||||||
contentBody: '',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
watch: {
|
|
||||||
'options.body': {
|
|
||||||
immediate: true,
|
|
||||||
handler () {
|
|
||||||
this.makeContentBody()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
makeContentBody () {
|
|
||||||
this.error = null
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { body = '' } = this.options
|
const { body = '' } = this.options
|
||||||
|
|
||||||
this.contentBody = evaluatePrefilter(body, {
|
return evaluatePrefilter(body, {
|
||||||
record: this.record,
|
record: this.record,
|
||||||
user: this.$auth.user || {},
|
user: this.$auth.user || {},
|
||||||
recordID: (this.record || {}).recordID || NoID,
|
recordID: (this.record || {}).recordID || NoID,
|
||||||
@ -60,7 +31,8 @@ export default {
|
|||||||
userID: (this.$auth.user || {}).userID || NoID,
|
userID: (this.$auth.user || {}).userID || NoID,
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.error = this.getToastMessage(e)
|
this.toastErrorHandler(e)
|
||||||
|
return ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -146,7 +146,7 @@ export default {
|
|||||||
document.title = [title, this.namespace.name, this.$t('general:label.app-name.public')].filter(v => v).join(' | ')
|
document.title = [title, this.namespace.name, this.$t('general:label.app-name.public')].filter(v => v).join(' | ')
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.updateBlocks(variables)
|
this.updateBlocks(variables)
|
||||||
},
|
},
|
||||||
|
|
||||||
async updateBlocks (variables = {}) {
|
async updateBlocks (variables = {}) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user