From 5c77282f6052af7d77e1ece31c780d46e54df28a Mon Sep 17 00:00:00 2001
From: florian <f.spreckelsen@inidscale.com>
Date: Tue, 29 Nov 2022 16:56:31 +0100
Subject: [PATCH] ENH: Add build property for ext_prop_display

---
 build.properties.d/00_default.properties |  1 +
 src/core/js/ext_prop_display.js          | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/build.properties.d/00_default.properties b/build.properties.d/00_default.properties
index 19fbe7af..078aed9b 100644
--- a/build.properties.d/00_default.properties
+++ b/build.properties.d/00_default.properties
@@ -62,6 +62,7 @@ BUILD_MODULE_EXT_RESOLVE_REFERENCES=ENABLED
 BUILD_EXT_REFERENCES_CUSTOM_RESOLVER=caosdb_default_person_reference
 
 BUILD_MODULE_EXT_EDITMODE_WYSIWYG_TEXT=DISABLED
+BUILD_MODULE_EXT_PROPERTY_DISPLAY=DISABLED
 
 ##############################################################################
 # Navbar properties
diff --git a/src/core/js/ext_prop_display.js b/src/core/js/ext_prop_display.js
index ee5c40ea..576eb11e 100644
--- a/src/core/js/ext_prop_display.js
+++ b/src/core/js/ext_prop_display.js
@@ -135,12 +135,21 @@ var prop_display = new function ($, getEntityName, getPropertyElements, getPrope
         };
     }
 
+    this._unhide_all_properties = function () {
+        // Just show all initially hidden properties
+        $(".caosdb-v-hidden-property").removeClass("caosdb-v-hidden-property");
+    }
+
     this.init = async function () {
         console.log("initializing ext_prop_display.js");
         const conf = await this.load_config();
-        const allTypes = await this._getRecordTypes(conf);
-        var entities = this._get_entities_in_view();
-        this._unhide_properties(entities, conf, allTypes)
+        if (("${BUILD_MODULE_EXT_PROPERTY_DISPLAY}" == "ENABLED") && conf) {
+            const allTypes = await this._getRecordTypes(conf);
+            var entities = this._get_entities_in_view();
+            this._unhide_properties(entities, conf, allTypes);
+        } else {
+            this._unhide_all_properties();
+        }
     }
 }($, getEntityName, getPropertyElements, getPropertyName, getUserName, getUserRoles, log.getLogger("ext_prop_display"), load_config, query);
 
-- 
GitLab