Skip to content

Commit

Permalink
Merge pull request KelvinTegelaar#1690 from johnduprey/dev
Browse files Browse the repository at this point in the history
BPA - Set report template in state for tenant change
  • Loading branch information
KelvinTegelaar authored Aug 16, 2023
2 parents b989aa8 + 8975ae6 commit ed89972
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/views/tenant/standards/BestPracticeAnalyser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand All @@ -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),
}
Expand Down Expand Up @@ -180,7 +182,7 @@ const BestPracticeAnalyser = () => {
path: 'api/listBPA',
params: {
tenantFilter: tenant.customerId,
Report: Report,
Report: reportTemplate,
SearchNow: SearchNow,
},
})
Expand Down Expand Up @@ -272,7 +274,7 @@ const BestPracticeAnalyser = () => {
<>
<CRow>
{graphrequest.data.Columns.map((info, idx) => (
<CCol sm={10} md={4} className="mb-3">
<CCol md={12} xl={4} className="mb-3">
<CCard className="h-100">
<CCardHeader>
<CCardTitle>{info.name}</CCardTitle>
Expand Down

0 comments on commit ed89972

Please sign in to comment.