From b9338947d48b3efb33d847fc2d9e2692fd5c0a73 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 23 Apr 2024 15:03:32 -0400 Subject: [PATCH] [ALS-6171] Fix info modal disabling filter bug (#303) --- .../search-interface/variable-info-modal-template.hbs | 2 +- .../picsureui/search-interface/variable-info-modal-view.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/variable-info-modal-template.hbs b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/variable-info-modal-template.hbs index cdf39cfa..2ed94ca1 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/variable-info-modal-template.hbs +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/variable-info-modal-template.hbs @@ -33,7 +33,7 @@ {{#if variableMetadata.columnmeta_var_report_comment}}
Variable Report Comment: {{variableMetadata.columnmeta_var_report_comment}}
{{/if}} - {{#if variableMetadata.columnmeta_is_stigmatized}} + {{#if isStigmatized}}
This variable is stigmatizing.
{{/if}} diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/variable-info-modal-view.js b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/variable-info-modal-view.js index f0297ef2..884bcb36 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/variable-info-modal-view.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/variable-info-modal-view.js @@ -21,8 +21,8 @@ define(["jquery", "backbone", "handlebars", "underscore", "text!search-interface this.modalTemplate = HBS.compile(modalTemplate); this.varId = opts.varId; const variableInfo = variableInfoCache[opts.varId]; - const filterTitleText = this.isOpenAccess && variableInfo?.variableMetadata.columnmeta_is_stigmatized ? 'This variable is stigmatizing.' : "Click to configure a filter using this variable."; - const disabledClass = (this.isOpenAccess && variableInfo.variableMetadata.columnmeta_is_stigmatized) ? 'disabled-icon' : ''; + const filterTitleText = this.isOpenAccess && variableInfo?.variableMetadata.columnmeta_is_stigmatized === "true" ? 'This variable is stigmatizing.' : "Click to configure a filter using this variable."; + const disabledClass = (this.isOpenAccess && variableInfo.variableMetadata.columnmeta_is_stigmatized === "true") ? 'disabled-icon' : ''; const exportTitleText = "Click to add this variable to your data retrieval."; const dataTreeTitleText = "Click to view the data tree for this variable."; variableInfo.isAuthorized = !JSON.parse(sessionStorage.getItem('isOpenAccess')); @@ -34,6 +34,7 @@ define(["jquery", "backbone", "handlebars", "underscore", "text!search-interface && variableInfo?.variableMetadata?.data_hierarchy !== "{}"; variableInfo.dataTreeTitleText = dataTreeTitleText; variableInfo.disabledClass = disabledClass; + variableInfo.isStigmatized = variableInfo?.variableMetadata.columnmeta_is_stigmatized === "true"; this.dataTableData = opts.dataTableData; tagFilterModel.get('requiredTags').bind('add', this.tagRequired.bind(this)); tagFilterModel.get('excludedTags').bind('add', this.tagExcluded.bind(this));