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}}