Skip to content

Commit dc79cb7

Browse files
authored
Merge pull request KelvinTegelaar#36 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 39b4c8c + a53ffa2 commit dc79cb7

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

src/components/tables/CellBoolean.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export default function CellBoolean({
5252
cell.toLowerCase() === 'fail' ||
5353
cell.toLowerCase() === 'default' ||
5454
cell.toLowerCase() === 'false' ||
55-
cell.toLowerCase() === 'noncompliant'
55+
cell.toLowerCase() === 'noncompliant' ||
56+
cell.toLowerCase() === 'disabled'
5657
) {
5758
normalized = false
5859
}

src/views/email-exchange/connectors/ListConnectorTemplates.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ const ConnectorListTemplates = () => {
9999
)}
100100
<CippPageList
101101
title="Exchange Connector Templates"
102-
titleButton={<TitleButton href="/email/connectors/add-template" title="Add Template" />}
102+
titleButton={
103+
<TitleButton href="/email/connectors/add-connector-templates" title="Add Template" />
104+
}
103105
datatable={{
104106
reportName: `${tenant?.defaultDomainName}-Groups`,
105107
path: '/api/ListExconnectorTemplates',

src/views/tenant/administration/TenantLookup.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ import { CippContentCard } from 'src/components/layout'
2424
import Skeleton from 'react-loading-skeleton'
2525
import { domainsApi } from 'src/store/api/domains'
2626

27+
const isValidTenantInput = (value) => {
28+
// Regular expression for validating GUID
29+
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}$/
30+
// Regular expression for validating domain
31+
const domainRegex = /^([a-zA-Z0-9](-?[a-zA-Z0-9])*\.)+[a-zA-Z]{2,}$/
32+
33+
// Check if the input is a valid GUID or domain
34+
return !(guidRegex.test(value) || domainRegex.test(value))
35+
}
36+
2737
const GraphExplorer = () => {
2838
let navigate = useNavigate()
2939
const tenant = useSelector((state) => state.app.currentTenant)
@@ -57,12 +67,6 @@ const GraphExplorer = () => {
5767
})
5868
}
5969
}, [execGraphRequest, tenant.defaultDomainName, query, tenantdomain])
60-
const isValidDomain = (value) =>
61-
/^(((?!-))(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(
62-
value,
63-
)
64-
? undefined
65-
: value
6670

6771
return (
6872
<CRow>
@@ -80,7 +84,7 @@ const GraphExplorer = () => {
8084
render={({ handleSubmit, submitting, pristine }) => {
8185
return (
8286
<CForm onSubmit={handleSubmit}>
83-
<Field name="domain" validate={isValidDomain}>
87+
<Field name="domain" validate={isValidTenantInput}>
8488
{({ input, meta }) => {
8589
return (
8690
<>

0 commit comments

Comments
 (0)