Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT tweaks #2569

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion src/views/identity/administration/DeployJITAdmin.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react'
import { CButton, CCallout, CCol, CForm, CRow, CSpinner, CTooltip } from '@coreui/react'
import { useSelector } from 'react-redux'
import { Field, Form } from 'react-final-form'
import { Field, Form, FormSpy } from 'react-final-form'
import {
Condition,
RFFCFormInput,
Expand All @@ -14,11 +14,11 @@
import { faCircleNotch, faEdit, faEye } from '@fortawesome/free-solid-svg-icons'
import { CippContentCard, CippPage, CippPageList } from 'src/components/layout'
import { CellTip, cellGenericFormatter } from 'src/components/tables/CellGenericFormat'
import 'react-datepicker/dist/react-datepicker.css'

Check warning on line 17 in src/views/identity/administration/DeployJITAdmin.jsx

View workflow job for this annotation

GitHub Actions / NPM Install and Build (16.x, ubuntu-latest)

'/home/runner/work/CIPP/CIPP/node_modules/react-datepicker/dist/react-datepicker.css' imported multiple times
import { TenantSelector } from 'src/components/utilities'
import arrayMutators from 'final-form-arrays'
import DatePicker from 'react-datepicker'
import 'react-datepicker/dist/react-datepicker.css'

Check warning on line 21 in src/views/identity/administration/DeployJITAdmin.jsx

View workflow job for this annotation

GitHub Actions / NPM Install and Build (16.x, ubuntu-latest)

'/home/runner/work/CIPP/CIPP/node_modules/react-datepicker/dist/react-datepicker.css' imported multiple times
import { useListUsersQuery } from 'src/store/api/users'
import GDAPRoles from 'src/data/GDAPRoles'
import { CippDatatable, cellDateFormatter } from 'src/components/tables'
Expand All @@ -45,6 +45,7 @@
useraction: values.useraction,
AdminRoles: values.AdminRoles?.map((role) => role.value),
StartDate: startTime,
UseTAP: values.useTap,
EndDate: endTime,
ExpireAction: values.expireAction.value,
PostExecution: {
Expand Down Expand Up @@ -137,6 +138,23 @@
name="UserId"
isLoading={usersIsFetching}
/>
<FormSpy subscription={{ values: true }}>
{({ values }) => {
return users.map((user, key) => {
if (
user.id === values?.UserId?.value &&
user.accountEnabled === false
) {
return (
<CCallout color="warning" key={key} className="mt-3">
This user is currently disabled, they will automatically be
enabled when JIT is executed.
</CCallout>
)
}
})
}}
</FormSpy>
</CCol>
</CRow>
</Condition>
Expand Down Expand Up @@ -195,6 +213,15 @@
/>
</CCol>
</CRow>
<CRow className="mb-3">
<CCol>
<CTooltip content="Generate a Temporary Access Password for the JIT Admin account if enabled for the tenant. This applies to both New and Existing users. The start time coincides with the scheduled time.">
<div>
<RFFCFormSwitch name="useTap" label="Generate TAP" />
</div>
</CTooltip>
</CCol>
</CRow>
<CRow className="mb-3">
<CCol>
<label>Send results to</label>
Expand Down Expand Up @@ -258,6 +285,13 @@
cell: cellGenericFormatter(),
exportSelector: 'userPrincipalName',
},
{
name: 'Account Enabled',
selector: (row) => row['accountEnabled'],
sortable: true,
cell: cellGenericFormatter(),
exportSelector: 'accountEnabled',
},
{
name: 'JIT Enabled',
selector: (row) => row['jitAdminEnabled'],
Expand Down
Loading