Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'KelvinTegelaar:main' into main
Browse files Browse the repository at this point in the history
oitjack authored Jul 3, 2024
2 parents 8b4633e + 6224b50 commit b43f20d
Showing 61 changed files with 3,391 additions and 870 deletions.
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -27,6 +27,13 @@
"request": "launch",
"name": "Launch Chrome Debugger",
"url": "http://localhost:4280"
},
{
"type": "PowerShell",
"name": "Launch in Windows Terminal",
"request": "launch",
"cwd": "${cwd}",
"script": ". '${cwd}\\Tools\\Start-CippDevEmulators.ps1'"
}
],
"compounds": [
4 changes: 4 additions & 0 deletions Tools/Start-CippDevEmulators.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Write-Host "Starting CIPP Dev Emulators"
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName
wt --title CIPP`; new-tab --title 'Azurite' -d $Path pwsh -c azurite`; new-tab --title 'FunctionApp' -d $Path\CIPP-API pwsh -c func start`; new-tab --title 'CIPP Frontend' -d $Path\CIPP pwsh -c npm run start`; new-tab --title 'SWA' -d $Path\CIPP pwsh -c npm run start-swa

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cipp",
"version": "5.7.0",
"version": "5.9.3",
"description": "The CyberDrain Improved Partner Portal is a portal to help manage administration for Microsoft Partners.",
"homepage": "https://cipp.app/",
"bugs": {
14 changes: 14 additions & 0 deletions public/MFAStates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"value": "disabled",
"label": "Disabled"
},
{
"value": "enabled",
"label": "Enabled"
},
{
"value": "enforced",
"label": "Enforced"
}
]
2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.7.0
5.9.3
20 changes: 20 additions & 0 deletions src/_nav.jsx
Original file line number Diff line number Diff line change
@@ -45,6 +45,11 @@ const _nav = [
name: 'Users',
to: '/identity/administration/users',
},
{
component: CNavItem,
name: 'Risky Users',
to: '/identity/administration/risky-users',
},
{
component: CNavItem,
name: 'Groups',
@@ -75,6 +80,11 @@ const _nav = [
name: 'Roles',
to: '/identity/administration/roles',
},
{
component: CNavItem,
name: 'JIT Admin',
to: '/identity/administration/jit-admin',
},
{
component: CNavItem,
name: 'Offboarding Wizard',
@@ -109,6 +119,11 @@ const _nav = [
name: 'AAD Connect Report',
to: '/identity/reports/azure-ad-connect-report',
},
{
component: CNavItem,
name: 'Risk Detections',
to: '/identity/reports/risk-detections',
},
],
},
{
@@ -771,6 +786,11 @@ const _nav = [
name: 'Application Settings',
to: '/cipp/settings',
},
{
component: CNavItem,
name: 'Extensions Settings',
to: '/cipp/extensions',
},
{
component: CNavItem,
name: 'User Settings',
1 change: 1 addition & 0 deletions src/components/buttons/TableModalButton.jsx
Original file line number Diff line number Diff line change
@@ -50,4 +50,5 @@ TableModalButton.propTypes = {
title: PropTypes.string,
className: PropTypes.string,
countOnly: PropTypes.bool,
icon: PropTypes.string,
}
186 changes: 97 additions & 89 deletions src/components/forms/RFFComponents.jsx
Original file line number Diff line number Diff line change
@@ -253,6 +253,54 @@ RFFCFormInputArray.propTypes = {
...sharedPropTypes,
}

export const RFFCFormInputList = ({ name, label, className = 'mb-3' }) => {
return (
<>
<FieldArray name={name}>
{({ fields }) => (
<div>
<div className="mb-2">
{label && (
<CFormLabel className="me-2" htmlFor={name}>
{label}
</CFormLabel>
)}
<CButton
onClick={() => fields.push({ Key: '', Value: '' })}
className="circular-button"
title={'+'}
>
<FontAwesomeIcon icon={'plus'} />
</CButton>
</div>
{fields.map((name, index) => (
<div key={name} className={className}>
<div>
<Field name={`${name}`} component="input">
{({ input, meta }) => {
return <CFormInput placeholder="Value" {...input} className="mb-2" />
}}
</Field>
</div>
<CButton
onClick={() => fields.remove(index)}
className={`circular-button`}
title={'-'}
>
<FontAwesomeIcon icon={'minus'} />
</CButton>
</div>
))}
</div>
)}
</FieldArray>
</>
)
}
RFFCFormInputList.propTypes = {
...sharedPropTypes,
}

export const RFFCFormRadio = ({
name,
label,
@@ -293,7 +341,6 @@ export const RFFCFormRadioList = ({
name,
options,
className = 'mb-3',
disabled = false,
onClick,
inline = false,
}) => {
@@ -312,7 +359,6 @@ export const RFFCFormRadioList = ({
onChange={input.onChange}
type="radio"
{...option}
disabled={disabled}
onClick={onClick}
inline={inline}
/>
@@ -424,19 +470,25 @@ RFFCFormSelect.propTypes = {
export function Condition({ when, is, children, like, regex }) {
return (
<>
{is && (
{is !== undefined && (
<Field name={when} subscription={{ value: true }}>
{({ input: { value } }) => (value === is ? children : null)}
{({ input: { value } }) => {
return value === is ? children : null
}}
</Field>
)}
{like && (
{like !== undefined && (
<Field name={when} subscription={{ value: true }}>
{({ input: { value } }) => (value.includes(like) ? children : null)}
{({ input: { value } }) => {
return value.includes(like) ? children : null
}}
</Field>
)}
{regex && (
{regex !== undefined && (
<Field name={when} subscription={{ value: true }}>
{({ input: { value } }) => (value.match(regex) ? children : null)}
{({ input: { value } }) => {
return value.match(regex) ? children : null
}}
</Field>
)}
</>
@@ -465,10 +517,10 @@ export const RFFSelectSearch = ({
isLoading = false,
allowCreate = false,
refreshFunction,
props,
...props
}) => {
const [inputText, setInputText] = useState('')
const selectSearchvalues = values.map((val) => ({
const selectSearchValues = values.map((val) => ({
value: val.value,
label: val.name,
...val.props,
@@ -492,12 +544,33 @@ export const RFFSelectSearch = ({
return (
<Field name={name} validate={validate}>
{({ meta, input }) => {
const handleChange = onChange
? (e) => {
input.onChange(e)
onChange(e)
}
: input.onChange
const handleChange = (e) => {
if (onChange) {
onChange(e)
}
input.onChange(e)
}

const selectProps = {
classNamePrefix: 'react-select',
...input,
name,
id: name,
disabled,
options: selectSearchValues,
placeholder,
isMulti: multi,
inputValue: inputText,
isLoading,
onChange: handleChange,
onInputChange: setOnInputChange,
...props,
//merge className from props into the default className
className: props.className
? `${props.className} react-select-container`
: 'react-select-container',
}

return (
<div>
<CFormLabel htmlFor={name}>
@@ -515,81 +588,16 @@ export const RFFSelectSearch = ({
</CTooltip>
)}
</CFormLabel>
{!allowCreate && onChange && (
<Select
className="react-select-container"
classNamePrefix="react-select"
{...input}
isClearable={false}
name={name}
id={name}
disabled={disabled}
options={selectSearchvalues}
placeholder={placeholder}
isMulti={multi}
onChange={handleChange}
onInputChange={debounceOnInputChange}
inputValue={inputText}
isLoading={isLoading}
{...props}
/>
)}
{!allowCreate && !onChange && (
<Select
className="react-select-container"
classNamePrefix="react-select"
{...input}
isClearable={true}
name={name}
id={name}
disabled={disabled}
options={selectSearchvalues}
placeholder={placeholder}
onInputChange={setOnInputChange}
isMulti={multi}
inputValue={inputText}
isLoading={isLoading}
{...props}
/>
)}
{allowCreate && onChange && (
<Creatable
className="react-select-container"
classNamePrefix="react-select"
{...input}
isClearable={false}
name={name}
id={name}
disabled={disabled}
options={selectSearchvalues}
placeholder={placeholder}
isMulti={multi}
onChange={handleChange}
onInputChange={debounceOnInputChange}
inputValue={inputText}
isLoading={isLoading}
{...props}
/>
{allowCreate ? (
<Creatable {...selectProps} isClearable={true} />
) : (
<Select {...selectProps} isClearable={!onChange} />
)}
{allowCreate && !onChange && (
<Creatable
className="react-select-container"
classNamePrefix="react-select"
{...input}
isClearable={true}
name={name}
id={name}
disabled={disabled}
options={selectSearchvalues}
placeholder={placeholder}
onInputChange={setOnInputChange}
isMulti={multi}
inputValue={inputText}
isLoading={isLoading}
{...props}
/>
{meta.error && meta.touched && (
<span className="text-danger">
{typeof meta.error === 'object' ? Object.values(meta.error).join('') : meta.error}
</span>
)}
{meta.error && meta.touched && <span className="text-danger">{meta.error}</span>}
</div>
)
}}
2 changes: 2 additions & 0 deletions src/components/forms/index.js
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ import {
RFFCFormSelect,
RFFSelectSearch,
RFFCFormInputArray,
RFFCFormInputList,
} from 'src/components/forms/RFFComponents'

export {
@@ -24,4 +25,5 @@ export {
RFFCFormSelect,
RFFSelectSearch,
RFFCFormInputArray,
RFFCFormInputList,
}
Loading

0 comments on commit b43f20d

Please sign in to comment.