Skip to content

Commit

Permalink
Merge pull request #36 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
[pull] dev from KelvinTegelaar:dev
  • Loading branch information
JohnDuprey authored Aug 5, 2023
2 parents 39b4c8c + a53ffa2 commit dc79cb7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/components/tables/CellBoolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export default function CellBoolean({
cell.toLowerCase() === 'fail' ||
cell.toLowerCase() === 'default' ||
cell.toLowerCase() === 'false' ||
cell.toLowerCase() === 'noncompliant'
cell.toLowerCase() === 'noncompliant' ||
cell.toLowerCase() === 'disabled'
) {
normalized = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ const ConnectorListTemplates = () => {
)}
<CippPageList
title="Exchange Connector Templates"
titleButton={<TitleButton href="/email/connectors/add-template" title="Add Template" />}
titleButton={
<TitleButton href="/email/connectors/add-connector-templates" title="Add Template" />
}
datatable={{
reportName: `${tenant?.defaultDomainName}-Groups`,
path: '/api/ListExconnectorTemplates',
Expand Down
18 changes: 11 additions & 7 deletions src/views/tenant/administration/TenantLookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ import { CippContentCard } from 'src/components/layout'
import Skeleton from 'react-loading-skeleton'
import { domainsApi } from 'src/store/api/domains'

const isValidTenantInput = (value) => {
// Regular expression for validating GUID
const guidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
// Regular expression for validating domain
const domainRegex = /^([a-zA-Z0-9](-?[a-zA-Z0-9])*\.)+[a-zA-Z]{2,}$/

// Check if the input is a valid GUID or domain
return !(guidRegex.test(value) || domainRegex.test(value))
}

const GraphExplorer = () => {
let navigate = useNavigate()
const tenant = useSelector((state) => state.app.currentTenant)
Expand Down Expand Up @@ -57,12 +67,6 @@ const GraphExplorer = () => {
})
}
}, [execGraphRequest, tenant.defaultDomainName, query, tenantdomain])
const isValidDomain = (value) =>
/^(((?!-))(xn--|_{1,1})?[a-z0-9-]{0,61}[a-z0-9]{1,1}\.)*(xn--)?([a-z0-9][a-z0-9-]{0,60}|[a-z0-9-]{1,30}\.[a-z]{2,})$/i.test(
value,
)
? undefined
: value

return (
<CRow>
Expand All @@ -80,7 +84,7 @@ const GraphExplorer = () => {
render={({ handleSubmit, submitting, pristine }) => {
return (
<CForm onSubmit={handleSubmit}>
<Field name="domain" validate={isValidDomain}>
<Field name="domain" validate={isValidTenantInput}>
{({ input, meta }) => {
return (
<>
Expand Down

0 comments on commit dc79cb7

Please sign in to comment.