From 331e12ff288ebb220ad3f3cf22923c5cdd29e217 Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Fri, 6 Dec 2019 18:04:32 +1000 Subject: [PATCH] Hide special metadata values from display --- app/server/static/components/annotation.pug | 2 +- app/server/static/components/annotationMixin.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/server/static/components/annotation.pug b/app/server/static/components/annotation.pug index a3aaacf8..5aed7acb 100644 --- a/app/server/static/components/annotation.pug +++ b/app/server/static/components/annotation.pug @@ -103,7 +103,7 @@ div.columns(v-cloak="") ) section.modal-card-body.modal-card-body-footer vue-json-pretty( - v-bind:data="documentMetadata" + v-bind:data="displayDocumentMetadata" v-bind:show-double-quotes="false" v-bind:show-line="false" ) diff --git a/app/server/static/components/annotationMixin.js b/app/server/static/components/annotationMixin.js index d194252f..02d16a28 100644 --- a/app/server/static/components/annotationMixin.js +++ b/app/server/static/components/annotationMixin.js @@ -297,6 +297,18 @@ export default { : 'Click to approve annotations'; }, + displayDocumentMetadata() { + let documentMetadata = this.documentMetadata; + if (documentMetadata == null) { + return null; + } + + documentMetadata = { ...documentMetadata }; + delete documentMetadata.guideline; + delete documentMetadata.documentSourceUrl; + return documentMetadata; + }, + documentMetadata() { const document = this.docs[this.pageNumber]; if (document == null || document.meta == null) {