Skip to content

Commit

Permalink
Merge pull request #2578 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
Sign in report tweaks
  • Loading branch information
JohnDuprey authored Jun 21, 2024
2 parents bae2574 + e0a4d83 commit 0a07a10
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions src/views/identity/reports/SignIns.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import React, { useState } from 'react'
import { Form } from 'react-final-form'
import { useSelector } from 'react-redux'
import { useNavigate } from 'react-router-dom'
import { RFFCFormCheck, RFFCFormInput } from 'src/components/forms'
import { Condition, RFFCFormCheck, RFFCFormInput } from 'src/components/forms'
import { CippPageList } from 'src/components/layout'
import { CellTip } from 'src/components/tables'
import useQuery from 'src/hooks/useQuery'
Expand Down Expand Up @@ -95,11 +95,10 @@ const columns = [

const SignInsReport = () => {
const tenant = useSelector((state) => state.app.currentTenant)
let navigate = useNavigate()
let query = useQuery()
const filter = query.get('filter')
const DateFilter = query.get('DateFilter')
const searchparams = query.toString()
const [searchParams, setSearchParams] = useState({})
const [visibleA, setVisibleA] = useState(true)

const handleSubmit = async (values) => {
Expand All @@ -113,11 +112,7 @@ const SignInsReport = () => {
SearchNow: true,
...values,
}
var queryString = Object.keys(shippedValues)
.map((key) => key + '=' + shippedValues[key])
.join('&')

navigate(`?${queryString}`)
setSearchParams(shippedValues)
}

return (
Expand Down Expand Up @@ -152,6 +147,11 @@ const SignInsReport = () => {
render={({ handleSubmit, submitting, values }) => {
return (
<CForm onSubmit={handleSubmit}>
<CRow>
<CCol>
<RFFCFormInput type="number" name="Days" label="Days" placeholder="7" />
</CCol>
</CRow>
<CRow>
<CCol>
<RFFCFormInput
Expand All @@ -167,6 +167,18 @@ const SignInsReport = () => {
<RFFCFormCheck label="Failed Logons Only" name="failedLogonsOnly" />
</CCol>
</CRow>
<Condition when="failedLogonsOnly" is={true}>
<CRow>
<CCol>
<RFFCFormInput
label="Failure Threshold"
type="number"
name="FailureThreshold"
placeholder="0"
/>
</CCol>
</CRow>
</Condition>
<CRow className="mb-3">
<CCol>
<CButton type="submit" disabled={submitting}>
Expand All @@ -190,9 +202,9 @@ const SignInsReport = () => {
capabilities={{ allTenants: false, helpContext: 'https://google.com' }}
datatable={{
columns: columns,
path: `/api/ListSignIns?${searchparams}`,
path: `/api/ListSignIns`,
reportName: `${tenant?.defaultDomainName}-SignIns-Report`,
params: { TenantFilter: tenant?.defaultDomainName },
params: { TenantFilter: tenant?.defaultDomainName, ...searchParams },
}}
/>
</>
Expand Down

0 comments on commit 0a07a10

Please sign in to comment.