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

[pull] dev from KelvinTegelaar:dev #44

Merged
merged 24 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a540aa5
Added more Anti-Phishing actions
OfficialEsco Jun 5, 2024
651de59
Tenant block list
JohnDuprey Jun 5, 2024
9ee4e4b
Merge pull request #2514 from JohnDuprey/dev
JohnDuprey Jun 5, 2024
af8202c
Add sort
JohnDuprey Jun 5, 2024
8b35938
Add Pronouns standard
kris6673 Jun 5, 2024
8a979de
Update SettingsCustomRoles.jsx
JohnDuprey Jun 5, 2024
622e1dd
Merge remote-tracking branch 'upstream/dev' into dev
JohnDuprey Jun 5, 2024
4f9fdf1
Merge pull request #2516 from JohnDuprey/dev
JohnDuprey Jun 5, 2024
e742061
Add input list for string[] values
JohnDuprey Jun 5, 2024
665aafe
Update SettingsCustomRoles.jsx
JohnDuprey Jun 5, 2024
8238f95
Merge branch 'KelvinTegelaar:dev' into dev
JohnDuprey Jun 5, 2024
49218f0
Merge pull request #2518 from JohnDuprey/dev
JohnDuprey Jun 5, 2024
c569c82
Merge pull request #2513 from Ren-Roros-Digital/antiphishpolicy
KelvinTegelaar Jun 5, 2024
5bdb4c1
Merge pull request #2515 from kris6673/pronouns
KelvinTegelaar Jun 5, 2024
95ee284
Extension tweaks
JohnDuprey Jun 5, 2024
aeeb2eb
Merge pull request #182 from KelvinTegelaar/dev
JohnDuprey Jun 5, 2024
5d3c33e
Merge pull request #2522 from JohnDuprey/dev
JohnDuprey Jun 5, 2024
3624930
Update Extensions.json
JohnDuprey Jun 5, 2024
722274f
Merge branch 'KelvinTegelaar:dev' into dev
JohnDuprey Jun 5, 2024
bc2d74f
Merge pull request #2523 from JohnDuprey/dev
JohnDuprey Jun 5, 2024
8e0710d
fixes bug with rffcomponents and input
KelvinTegelaar Jun 6, 2024
b544f43
improved fuzzy search
KelvinTegelaar Jun 6, 2024
de39748
remove console.log
KelvinTegelaar Jun 6, 2024
68f666c
add language option to autopilot profile
KelvinTegelaar Jun 6, 2024
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
162 changes: 81 additions & 81 deletions src/components/forms/RFFComponents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -463,10 +511,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,
Expand All @@ -490,12 +538,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}>
Expand All @@ -513,79 +582,10 @@ 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 && !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}
/>
{allowCreate ? (
<Creatable {...selectProps} isClearable={true} />
) : (
<Select {...selectProps} isClearable={!onChange} />
)}
{meta.error && meta.touched && (
<span className="text-danger">
Expand Down
2 changes: 2 additions & 0 deletions src/components/forms/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
RFFCFormSelect,
RFFSelectSearch,
RFFCFormInputArray,
RFFCFormInputList,
} from 'src/components/forms/RFFComponents'

export {
Expand All @@ -24,4 +25,5 @@ export {
RFFCFormSelect,
RFFSelectSearch,
RFFCFormInputArray,
RFFCFormInputList,
}
6 changes: 3 additions & 3 deletions src/components/utilities/CippFuzzySearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Fuse from 'fuse.js'
function CippfuzzySearch(options) {
const fuse = new Fuse(options, {
keys: ['name', 'groupName', 'items.name'],
threshold: 0.5,
threshold: 0.3,
location: 0,
ignoreLocation: true,
useExtendedSearch: true,
Expand All @@ -15,8 +15,8 @@ function CippfuzzySearch(options) {
if (!value.length) {
return options
}

return fuse.search(value).map((_ref) => {
const search = fuse.search(value)
return search.map((_ref) => {
let { item } = _ref
return item
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/utilities/TenantSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useDispatch, useSelector } from 'react-redux'
import PropTypes from 'prop-types'
import { useListTenantsQuery } from 'src/store/api/tenants'
import { setCurrentTenant } from 'src/store/features/app'
import { CButton, CDropdown, CDropdownMenu, CDropdownToggle } from '@coreui/react'
import { CButton } from '@coreui/react'
import { useNavigate, useSearchParams } from 'react-router-dom'
import { queryString } from 'src/helpers'
import { faBuilding } from '@fortawesome/free-solid-svg-icons'
Expand Down
60 changes: 60 additions & 0 deletions src/data/Extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,65 @@
}
],
"mappingRequired": true
},
{
"name": "PasswordPusher",
"type": "PWPush",
"cat": "Passwords",
"forceSyncButton": false,
"helpText": "This integration allows you to generate password links instead of plain text passwords. Visit https://pwpush.com/ or https://github.com/pglombardo/PasswordPusher for more information.",
"SettingOptions": [
{
"type": "checkbox",
"name": "PWPush.Enabled",
"label": "Replace generated passwords with PWPush links"
},
{
"type": "input",
"fieldtype": "text",
"name": "PWPush.BaseUrl",
"label": "PWPush URL",
"placeholder": "Enter your PWPush URL. (default: https://pwpush.com)"
},
{
"type": "input",
"fieldtype": "text",
"name": "PWPush.EmailAddress",
"label": "PWPush email address",
"placeholder": "Enter your email address for PWPush. (optional)"
},
{
"type": "input",
"fieldtype": "password",
"name": "PWPush.APIKey",
"label": "PWPush API Key",
"placeholder": "Enter your PWPush API Key. (optional)"
},
{
"type": "checkbox",
"name": "PWPush.RetrievalStep",
"label": "Click to retrieve password (recommended)"
},
{
"type": "input",
"fieldtype": "number",
"name": "PWPush.ExpireAfterDays",
"label": "Expiration in Days",
"placeholder": "Expiration time in days. (optional)"
},
{
"type": "input",
"fieldtype": "number",
"name": "PWPush.ExpireAfterViews",
"label": "Expiration after views",
"placeholder": "Expiration after views. (optional)"
},
{
"type": "checkbox",
"name": "PWPush.DeletableByViewer",
"label": "Allow deletion of passwords"
}
],
"mappingRequired": false
}
]
48 changes: 48 additions & 0 deletions src/data/standards.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@
"impact": "Low Impact",
"impactColour": "info"
},
{
"name": "standards.EnablePronouns",
"cat": "Global Standards",
"tag": ["lowimpact"],
"helpText": "Enables the Pronouns feature for the tenant. This allows users to set their pronouns in their profile.",
"addedComponent": [],
"label": "Enable Pronouns",
"impact": "Low Impact",
"impactColour": "info"
},
{
"name": "standards.AnonReportDisable",
"cat": "Global Standards",
Expand Down Expand Up @@ -1102,6 +1112,44 @@
"name": "standards.AntiPhishPolicy.EnableUnusualCharactersSafetyTips",
"default": true
},
{
"type": "Select",
"label": "If a message is detected as user impersonation",
"name": "standards.AntiPhishPolicy.TargetedUserProtectionAction",
"values": [
{
"label": "Move to Junk Folder",
"value": "MoveToJmf"
},
{
"label": "Delete the message before its delivered",
"value": "Delete"
},
{
"label": "Quarantine the message",
"value": "Quarantine"
}
]
},
{
"type": "Select",
"label": "If a message is detected as domain impersonation",
"name": "standards.AntiPhishPolicy.TargetedDomainProtectionAction",
"values": [
{
"label": "Move to Junk Folder",
"value": "MoveToJmf"
},
{
"label": "Delete the message before its delivered",
"value": "Delete"
},
{
"label": "Quarantine the message",
"value": "Quarantine"
}
]
},
{
"type": "Select",
"label": "If Mailbox Intelligence detects an impersonated user",
Expand Down
Loading