|
Lines 364-377
import { APIClient } from "../../fetch/api-client.js";
Link Here
|
| 364 |
|
364 |
|
| 365 |
export default { |
365 |
export default { |
| 366 |
setup() { |
366 |
setup() { |
| 367 |
const AVStore = inject("AVStore"); |
367 |
const ERMStore = inject("ERMStore"); |
| 368 |
const { |
368 |
const { authorisedValues } = storeToRefs(ERMStore); |
| 369 |
av_report_types, |
|
|
| 370 |
av_platform_reports_metrics, |
| 371 |
av_database_reports_metrics, |
| 372 |
av_title_reports_metrics, |
| 373 |
av_item_reports_metrics, |
| 374 |
} = storeToRefs(AVStore); |
| 375 |
|
369 |
|
| 376 |
const { setConfirmationDialog, setMessage, setError } = |
370 |
const { setConfirmationDialog, setMessage, setError } = |
| 377 |
inject("mainStore"); |
371 |
inject("mainStore"); |
|
Lines 382-392
export default {
Link Here
|
| 382 |
const title_property_column_options = getColumnOptions(); |
376 |
const title_property_column_options = getColumnOptions(); |
| 383 |
|
377 |
|
| 384 |
return { |
378 |
return { |
| 385 |
av_report_types, |
379 |
authorisedValues, |
| 386 |
av_platform_reports_metrics, |
|
|
| 387 |
av_database_reports_metrics, |
| 388 |
av_title_reports_metrics, |
| 389 |
av_item_reports_metrics, |
| 390 |
setConfirmationDialog, |
380 |
setConfirmationDialog, |
| 391 |
setMessage, |
381 |
setMessage, |
| 392 |
setError, |
382 |
setError, |
|
Lines 472-478
export default {
Link Here
|
| 472 |
}, |
462 |
}, |
| 473 |
metric_types_options: [], |
463 |
metric_types_options: [], |
| 474 |
access_types_options: [], |
464 |
access_types_options: [], |
| 475 |
report_types_options: [...this.av_report_types], |
465 |
report_types_options: [...this.authorisedValues.av_report_types], |
| 476 |
filter_data: [], |
466 |
filter_data: [], |
| 477 |
usage_data_provider_list: [...this.usage_data_providers], |
467 |
usage_data_provider_list: [...this.usage_data_providers], |
| 478 |
time_period_columns_builder: null, |
468 |
time_period_columns_builder: null, |
|
Lines 788-806
export default {
Link Here
|
| 788 |
if (report_type) { |
778 |
if (report_type) { |
| 789 |
switch (report_type.substring(0, 1)) { |
779 |
switch (report_type.substring(0, 1)) { |
| 790 |
case "P": |
780 |
case "P": |
| 791 |
av_type = this.av_platform_reports_metrics; |
781 |
av_type = |
|
|
782 |
this.authorisedValues.av_platform_reports_metrics; |
| 792 |
this.data_type = "platform"; |
783 |
this.data_type = "platform"; |
| 793 |
break; |
784 |
break; |
| 794 |
case "T": |
785 |
case "T": |
| 795 |
av_type = this.av_title_reports_metrics; |
786 |
av_type = |
|
|
787 |
this.authorisedValues.av_title_reports_metrics; |
| 796 |
this.data_type = "title"; |
788 |
this.data_type = "title"; |
| 797 |
break; |
789 |
break; |
| 798 |
case "I": |
790 |
case "I": |
| 799 |
av_type = this.av_item_reports_metrics; |
791 |
av_type = this.authorisedValues.av_item_reports_metrics; |
| 800 |
this.data_type = "item"; |
792 |
this.data_type = "item"; |
| 801 |
break; |
793 |
break; |
| 802 |
case "D": |
794 |
case "D": |
| 803 |
av_type = this.av_database_reports_metrics; |
795 |
av_type = |
|
|
796 |
this.authorisedValues.av_database_reports_metrics; |
| 804 |
this.data_type = "database"; |
797 |
this.data_type = "database"; |
| 805 |
break; |
798 |
break; |
| 806 |
} |
799 |
} |
|
Lines 859-865
export default {
Link Here
|
| 859 |
setReportTypesAndResetFilterData(providers) { |
852 |
setReportTypesAndResetFilterData(providers) { |
| 860 |
const permittedReportTypes = []; |
853 |
const permittedReportTypes = []; |
| 861 |
if (providers.length === 0) { |
854 |
if (providers.length === 0) { |
| 862 |
this.report_types_options = this.av_report_types; |
855 |
this.report_types_options = |
|
|
856 |
this.authorisedValues.av_report_types; |
| 863 |
this.query.keywords = null; |
857 |
this.query.keywords = null; |
| 864 |
this.filter_data.length = 0; |
858 |
this.filter_data.length = 0; |
| 865 |
return; |
859 |
return; |
|
Lines 874-882
export default {
Link Here
|
| 874 |
single_report_types.pop(); // remove trailing "" from array |
868 |
single_report_types.pop(); // remove trailing "" from array |
| 875 |
|
869 |
|
| 876 |
single_report_types.forEach(type => { |
870 |
single_report_types.forEach(type => { |
| 877 |
const report_type = this.av_report_types.find( |
871 |
const report_type = |
| 878 |
rt => rt.value === type |
872 |
this.authorisedValues.av_report_types.find( |
| 879 |
); |
873 |
rt => rt.value === type |
|
|
874 |
); |
| 880 |
permittedReportTypes.push(report_type); |
875 |
permittedReportTypes.push(report_type); |
| 881 |
}); |
876 |
}); |
| 882 |
// If we change/remove a data provider then we don't want data being displayed from that provider in the dropdown |
877 |
// If we change/remove a data provider then we don't want data being displayed from that provider in the dropdown |
| 883 |
- |
|
|