From a50f1e250ff16b4fac617977d3b3dd1f422d0cc2 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 15 Aug 2023 21:40:47 -0400 Subject: [PATCH 1/2] BPA - Set report template in state for tenant change --- src/views/tenant/standards/BestPracticeAnalyser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/tenant/standards/BestPracticeAnalyser.js b/src/views/tenant/standards/BestPracticeAnalyser.js index bf3b06504930..fbacda2154d6 100644 --- a/src/views/tenant/standards/BestPracticeAnalyser.js +++ b/src/views/tenant/standards/BestPracticeAnalyser.js @@ -95,6 +95,7 @@ const getNestedValue = (obj, path) => { }, obj) } const BestPracticeAnalyser = () => { + const [reportTemplate, setReportTemplate] = useState('CIPP Best Practices v1.0 - Table view') const { data: templates = [], isLoading: templatesfetch } = useGenericGetRequestQuery({ path: 'api/listBPATemplates', }) @@ -106,9 +107,10 @@ const BestPracticeAnalyser = () => { const [visibleA, setVisibleA] = useState(true) const handleSubmit = async (values) => { setVisibleA(false) + setReportTemplate(values.reportTemplate) const shippedValues = { SearchNow: true, - Report: values.reportTemplate, + Report: reportTemplate, tenantFilter: tenant.customerId, random: (Math.random() + 1).toString(36).substring(7), } @@ -180,7 +182,7 @@ const BestPracticeAnalyser = () => { path: 'api/listBPA', params: { tenantFilter: tenant.customerId, - Report: Report, + Report: reportTemplate, SearchNow: SearchNow, }, }) From 8975ae6c1687ef36fc6f58c52debcadf9abf7052 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 15 Aug 2023 22:06:34 -0400 Subject: [PATCH 2/2] Tweak column sizes for smaller devices --- src/views/tenant/standards/BestPracticeAnalyser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tenant/standards/BestPracticeAnalyser.js b/src/views/tenant/standards/BestPracticeAnalyser.js index fbacda2154d6..f12b3b9d1e90 100644 --- a/src/views/tenant/standards/BestPracticeAnalyser.js +++ b/src/views/tenant/standards/BestPracticeAnalyser.js @@ -274,7 +274,7 @@ const BestPracticeAnalyser = () => { <> {graphrequest.data.Columns.map((info, idx) => ( - + {info.name}