diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/datatable-filter-modal-view.js b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/datatable-filter-modal-view.js index caf51266..9bb179e4 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/datatable-filter-modal-view.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/datatable-filter-modal-view.js @@ -79,7 +79,7 @@ define(['backbone', 'handlebars', 'underscore', 'text!search-interface/datatable let dataRow = _.find(this.data(), (entry)=>{ return entry[1] === variableId;}); dataRow[0] = true; let checkbox = $('input[data-varid="' + variableId +'"]')[0]; - if(checkbox!==undefined){ + if(checkbox!==undefined && checkbox.disabled === false){ checkbox.checked = true; } }); @@ -182,17 +182,7 @@ define(['backbone', 'handlebars', 'underscore', 'text!search-interface/datatable let data = this.dtData; const isOpenAccess = JSON.parse(sessionStorage.getItem('isOpenAccess')); if(!data){ - - if (isOpenAccess) { - // filter out stigmatized variables - data = this.model.dtVariables.filter(function (variable) { - return variable.result.metadata?.is_stigmatized === "false" || variable.result.metadata?.columnmeta_is_stigmatized === "false"; - }); - } else { - data = this.model.dtVariables; - } - - data = data.map(function(variable) { + data = this.model.dtVariables.map(function(variable) { let values = variable.result.values.join(", "); return [ existingFilter ? @@ -206,7 +196,8 @@ define(['backbone', 'handlebars', 'underscore', 'text!search-interface/datatable variable.result.metadata.columnmeta_data_type, (variable.result.metadata.columnmeta_data_type.toLowerCase() == 'continuous') ? 'Min: '+ variable.result.metadata.columnmeta_min + ', Max: ' + variable.result.metadata.columnmeta_max : 'See Values', (variable.result.metadata.columnmeta_data_type.toLowerCase() == 'continuous') ? "" : '[ ' + values + ' ]', - variable.result.metadata.columnmeta_HPDS_PATH + variable.result.metadata.columnmeta_HPDS_PATH, + variable.result.metadata.columnmeta_is_stigmatized, ]; }); this.dtData = data; @@ -237,7 +228,11 @@ define(['backbone', 'handlebars', 'underscore', 'text!search-interface/datatable }, { render: function(data,type,row,meta){ - return ''; + if (isOpenAccess && (row[8] === false || row[8] === "false")) { + return ''; + } else { + return ''; + } }, type:'string', targets: 0 diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/no-results-open-help-view.hbs b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/no-results-open-help-view.hbs index 0d81da55..3e65823b 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/no-results-open-help-view.hbs +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/no-results-open-help-view.hbs @@ -1,11 +1,13 @@

There are a few reasons a user might see no or unexpected results when searching for variables.

Note that you will not be able to use DCC Harmonized data set variables with variables from studies that are not included in the harmonized data set in the same query.

diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-results-view.js b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-results-view.js index 5a42d413..f2f48dcc 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-results-view.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-results-view.js @@ -371,11 +371,6 @@ define(["backbone", "handlebars", "underscore", "text!search-interface/search-re if (tagFilterModel.get("searchResults")) { let filteredResults = filterUnwantedResultsOut(tagFilterModel.get("searchResults").results.searchResults); - if (JSON.parse(sessionStorage.getItem('isOpenAccess'))) { - filteredResults = _.filter(filteredResults, function (result) { - return result.result.metadata.columnmeta_is_stigmatized === "false"; - }); - } if (filteredResults.length === 0) { if ($('#no-results').length === 0) { $('#guide-me-button-container').show(); @@ -409,6 +404,7 @@ define(["backbone", "handlebars", "underscore", "text!search-interface/search-re dataTableDescription: metadata.columnmeta_var_group_description, description: metadata.columnmeta_description, hashed_var_id: metadata.hashed_var_id, + is_stigmatized: metadata.columnmeta_is_stigmatized === 'true', is_harmonized: searchUtil.isStudyHarmonized(metadata.columnmeta_study_id.toLowerCase()), result_index: i, metadata: metadata @@ -467,9 +463,10 @@ define(["backbone", "handlebars", "underscore", "text!search-interface/search-re }, { render: function (data, type, row, meta) { - let filterTitleText = "Click to configure a filter using this variable."; - let exportTitleText = "Click to add this variable to your data retrieval."; let isOpenAccess = JSON.parse(sessionStorage.getItem('isOpenAccess')); + let filterTitleText = (isOpenAccess && row.is_stigmatized) ? "This variable is stigmatizing." : "Click to configure a filter using this variable."; + let filterClasses = 'fa fa-filter search-result-action-btn' + (isOpenAccess && row.is_stigmatized ? " disabled-icon" : ''); + let exportTitleText = "Click to add this variable to your data retrieval."; let tourAttr; if (row.result_index == 0) { tourAttr = isOpenAccess ? ' data-intro="#open-actions-row"' : ' data-intro="#authorized-actions-row"' + ' data-sequence="6" id="first-actions-row"'; @@ -480,7 +477,7 @@ define(["backbone", "handlebars", "underscore", "text!search-interface/search-re // add data_hierarchy iconHtml += ''; // add filter - iconHtml += '' + iconHtml += '' // add export if (!isOpenAccess) { iconHtml += ' {{/if}} - + {{#if isAuthorized}} {{#if isExportField}} @@ -33,6 +33,9 @@ {{#if variableMetadata.columnmeta_var_report_comment}}
Variable Report Comment: {{variableMetadata.columnmeta_var_report_comment}}
{{/if}} + {{#if variableMetadata.columnmeta_is_stigmatized}} +
This variable is stigmatizing.
+ {{/if}}
{{#if variableMetadata.derived_group_id}}
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 acb4053e..f0297ef2 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 @@ -20,10 +20,11 @@ define(["jquery", "backbone", "handlebars", "underscore", "text!search-interface this.isOpenAccess = JSON.parse(sessionStorage.getItem('isOpenAccess')); this.modalTemplate = HBS.compile(modalTemplate); this.varId = opts.varId; - const filterTitleText = "Click to configure a filter using this variable."; + 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 exportTitleText = "Click to add this variable to your data retrieval."; const dataTreeTitleText = "Click to view the data tree for this variable."; - const variableInfo = variableInfoCache[opts.varId]; variableInfo.isAuthorized = !JSON.parse(sessionStorage.getItem('isOpenAccess')); variableInfo.filterTitleText = filterTitleText; variableInfo.exportTitleText = exportTitleText; @@ -32,6 +33,7 @@ define(["jquery", "backbone", "handlebars", "underscore", "text!search-interface && variableInfo?.variableMetadata?.data_hierarchy !== "" && variableInfo?.variableMetadata?.data_hierarchy !== "{}"; variableInfo.dataTreeTitleText = dataTreeTitleText; + variableInfo.disabledClass = disabledClass; this.dataTableData = opts.dataTableData; tagFilterModel.get('requiredTags').bind('add', this.tagRequired.bind(this)); tagFilterModel.get('excludedTags').bind('add', this.tagExcluded.bind(this)); @@ -179,9 +181,7 @@ define(["jquery", "backbone", "handlebars", "underscore", "text!search-interface let filterViewData = { dtId: event.target.dataset.id, filter: filter ? filter.toJSON() : undefined, - dtVariables: JSON.parse(sessionStorage.getItem('isOpenAccess')) ? - this.filterStigmatizedVariables(response.results.searchResults) : - response.results.searchResults, + dtVariables: response.results.searchResults, dataTableInfo: dataTableInfo }; this.filterModalView = new datatableFilterModalView({ @@ -199,9 +199,6 @@ define(["jquery", "backbone", "handlebars", "underscore", "text!search-interface }); } }, - filterStigmatizedVariables: function (results) { - return results.filter(searchResult => searchResult.result.metadata.columnmeta_is_stigmatized !== true); - }, filterKeypressHandler: function (event) { if (event.key.toLowerCase() === 'enter' || event.key.toLowerCase() === ' ') { this.filterClickHandler(event);