Skip to content

Commit ed89972

Browse files
Merge pull request KelvinTegelaar#1690 from johnduprey/dev
BPA - Set report template in state for tenant change
2 parents b989aa8 + 8975ae6 commit ed89972

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/views/tenant/standards/BestPracticeAnalyser.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const getNestedValue = (obj, path) => {
9595
}, obj)
9696
}
9797
const BestPracticeAnalyser = () => {
98+
const [reportTemplate, setReportTemplate] = useState('CIPP Best Practices v1.0 - Table view')
9899
const { data: templates = [], isLoading: templatesfetch } = useGenericGetRequestQuery({
99100
path: 'api/listBPATemplates',
100101
})
@@ -106,9 +107,10 @@ const BestPracticeAnalyser = () => {
106107
const [visibleA, setVisibleA] = useState(true)
107108
const handleSubmit = async (values) => {
108109
setVisibleA(false)
110+
setReportTemplate(values.reportTemplate)
109111
const shippedValues = {
110112
SearchNow: true,
111-
Report: values.reportTemplate,
113+
Report: reportTemplate,
112114
tenantFilter: tenant.customerId,
113115
random: (Math.random() + 1).toString(36).substring(7),
114116
}
@@ -180,7 +182,7 @@ const BestPracticeAnalyser = () => {
180182
path: 'api/listBPA',
181183
params: {
182184
tenantFilter: tenant.customerId,
183-
Report: Report,
185+
Report: reportTemplate,
184186
SearchNow: SearchNow,
185187
},
186188
})
@@ -272,7 +274,7 @@ const BestPracticeAnalyser = () => {
272274
<>
273275
<CRow>
274276
{graphrequest.data.Columns.map((info, idx) => (
275-
<CCol sm={10} md={4} className="mb-3">
277+
<CCol md={12} xl={4} className="mb-3">
276278
<CCard className="h-100">
277279
<CCardHeader>
278280
<CCardTitle>{info.name}</CCardTitle>

0 commit comments

Comments
 (0)