diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c54085fb10..381979dc40 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,12 @@ fourfront Change Log ---------- +7.5.5 +===== + +* bug fix - button "Select All" not turns into "Deselect All" in /browse after QuickInfoBar updates in 7.5.0 + + 7.5.4 ===== diff --git a/pyproject.toml b/pyproject.toml index 5ba94fbb15..bab68eaef6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] # Note: Various modules refer to this system as "encoded", not "fourfront". name = "encoded" -version = "7.5.4" +version = "7.5.5" description = "4DN-DCIC Fourfront" authors = ["4DN-DCIC Team "] license = "MIT" diff --git a/src/encoded/static/components/browse/components/above-table-controls/SelectedFilesControls.js b/src/encoded/static/components/browse/components/above-table-controls/SelectedFilesControls.js index 15ab02b6f2..30c63300c9 100644 --- a/src/encoded/static/components/browse/components/above-table-controls/SelectedFilesControls.js +++ b/src/encoded/static/components/browse/components/above-table-controls/SelectedFilesControls.js @@ -133,6 +133,7 @@ export class SelectAllFilesButton extends React.PureComponent { } render(){ + const { totalOPFCount } = this.props; const { selecting } = this.state; const isAllSelected = this.isAllSelected(); const isEnabled = this.isEnabled(); @@ -140,7 +141,13 @@ export class SelectAllFilesButton extends React.PureComponent { "mr-05 icon icon-fw icon-" + (selecting ? 'circle-notch icon-spin fas' : (isAllSelected ? 'square far' : 'check-square far')) ); const cls = "btn " + (isAllSelected ? "btn-outline-primary" : "btn-primary"); - const tooltip = (!isAllSelected && !isEnabled) ? `"Select All" is disabled since the total file count exceeds the upper limit: ${SELECT_ALL_LIMIT}` : null; + + let tooltip = null; + if (!isAllSelected && !isEnabled) { + tooltip = `"Select All" is disabled since the total file count exceeds the upper limit: ${SELECT_ALL_LIMIT}`; + } else if (!isAllSelected) { + tooltip = 'Select All Files' + (totalOPFCount ? ` - please note that Supplementary files (${totalOPFCount}) will not be included in the selection` : ''); + } return (
@@ -288,7 +295,7 @@ export const SelectedFilesControls = React.memo(function SelectedFilesControls(p } = props; const selectedFileProps = SelectedFilesController.pick(props); - let totalUniqueFilesCount; + let totalUniqueFilesCount = 0, totalUniqueOPFCount = 0; if (Array.isArray(context['@type']) && context['@type'].indexOf('FileSearchResults') > -1) { totalUniqueFilesCount = context.total || 0; } else { @@ -296,14 +303,17 @@ export const SelectedFilesControls = React.memo(function SelectedFilesControls(p // This gets unique file count from ES aggs. In future we might be able to get total including // duplicates, in which case should change up logic downstream from this component for e.g. `isAllSelected` // in SelectAllFilesButton & similar. - totalUniqueFilesCount = (barPlotData && barPlotData.total && barPlotData.total.files) || 0; + if (barPlotData && barPlotData.total) { + totalUniqueFilesCount = barPlotData.total.files || 0; + totalUniqueOPFCount = barPlotData.total.files_opf || 0; + } } return ( // This rendered within a row by AboveTableControlsBase.js // TODO maybe refactor some of this stuff to be simpler.
- +
diff --git a/src/encoded/static/components/viz/QuickInfoBar.js b/src/encoded/static/components/viz/QuickInfoBar.js index e9c9ebd6a3..c09324229a 100644 --- a/src/encoded/static/components/viz/QuickInfoBar.js +++ b/src/encoded/static/components/viz/QuickInfoBar.js @@ -273,18 +273,20 @@ const StatsCol = React.memo(function StatsCol(props){ const { total, current } = QuickInfoBar.getCountsFromProps(props); const expSetFilters = QuickInfoBar.expSetFilters((context && context.filters) || null, navigate.getBrowseBaseParams(browseBaseState)); + const totalFilesIncludingOPF = (total.files || 0) + (total.files_opf || 0); + const currentFilesIncludingOPF = current ? (current.files || 0) + (current.files_opf || 0) : 0; let stats; if (current && (typeof current.experiment_sets === 'number' || typeof current.experiments === 'number' || typeof current.files === 'number')) { stats = { 'experiment_sets' : { current.experiment_sets } / { total.experiment_sets || 0 }, 'experiments' : { current.experiments } / {total.experiments || 0}, - 'files' : { current.files } / {total.files || 0} + 'files' : { currentFilesIncludingOPF } / { totalFilesIncludingOPF } }; } else { stats = { 'experiment_sets' : total.experiment_sets || 0, 'experiments' : total.experiments || 0, - 'files' : total.files || 0 + 'files' : totalFilesIncludingOPF }; } const statProps = _.extend(_.pick(props, 'id', 'href', 'isLoadingChartData', 'browseBaseState'), { 'expSetFilters' : expSetFilters }); @@ -292,7 +294,7 @@ const StatsCol = React.memo(function StatsCol(props){
- +
diff --git a/src/encoded/visualization.py b/src/encoded/visualization.py index 7bfd817f65..2d68a389a9 100644 --- a/src/encoded/visualization.py +++ b/src/encoded/visualization.py @@ -191,11 +191,18 @@ def trace_workflow_runs(context, request): "buckets_path": { "expSetProcessedFiles": "total_expset_processed_files", "expProcessedFiles": "total_exp_processed_files", + "expRawFiles": "total_exp_raw_files" + }, + "script" : "params.expSetProcessedFiles + params.expProcessedFiles + params.expRawFiles" + } + }, + "total_opf_files" : { + "bucket_script" : { + "buckets_path": { "expSetOtherProcessedFiles": "total_expset_other_processed_files", "expOtherProcessedFiles": "total_exp_other_processed_files", - "expRawFiles": "total_exp_raw_files" }, - "script" : "params.expSetProcessedFiles + params.expProcessedFiles + params.expSetOtherProcessedFiles + params.expOtherProcessedFiles + params.expRawFiles" + "script" : "params.expSetOtherProcessedFiles + params.expOtherProcessedFiles" } }, "total_experiments" : { @@ -252,6 +259,7 @@ def bar_plot_chart(context, request): primary_agg.update(deepcopy(SUM_FILES_EXPS_AGGREGATION_DEFINITION)) del primary_agg['total_files'] # "bucket_script" not supported on root-level aggs + del primary_agg['total_opf_files'] # "bucket_script" not supported on root-level aggs # Nest in additional fields, if any curr_field_aggs = primary_agg['field_0']['aggs'] @@ -278,19 +286,20 @@ def bar_plot_chart(context, request): continue del search_result[field_to_delete] + raw_and_processed_count = (search_result['aggregations']['total_expset_processed_files']['value'] + + search_result['aggregations']['total_exp_raw_files']['value'] + + search_result['aggregations']['total_exp_processed_files']['value']) + opf_count = (search_result['aggregations']['total_expset_other_processed_files']['value'] + + search_result['aggregations']['total_exp_other_processed_files']['value']) + ret_result = { # We will fill up the "terms" here from our search_result buckets and then return this dictionary. "field": fields_to_aggregate_for[0], "terms": {}, "total": { "experiment_sets": search_result['total'], "experiments": search_result['aggregations']['total_experiments']['value'], - "files": ( - search_result['aggregations']['total_expset_processed_files']['value'] + - search_result['aggregations']['total_exp_raw_files']['value'] + - search_result['aggregations']['total_exp_processed_files']['value'] + - search_result['aggregations']['total_expset_other_processed_files']['value'] + - search_result['aggregations']['total_exp_other_processed_files']['value'] - ) + "files": raw_and_processed_count, + "files_opf": opf_count }, "other_doc_count": search_result['aggregations']['field_0'].get('sum_other_doc_count', 0), "time_generated": str(datetime.utcnow()) @@ -301,7 +310,8 @@ def format_bucket_result(bucket_result, returned_buckets, curr_field_depth = 0): curr_bucket_totals = { 'experiment_sets' : int(bucket_result['doc_count']), 'experiments' : int(bucket_result['total_experiments']['value']), - 'files' : int(bucket_result['total_files']['value']) + 'files' : int(bucket_result['total_files']['value']), + 'files_opf' : int(bucket_result['total_opf_files']['value']) } next_field_name = None