Skip to content

Commit

Permalink
Merge pull request #204 from stephb9959/main
Browse files Browse the repository at this point in the history
[WIFI-13534] Removed captive from services configuration section
  • Loading branch information
BourqueCharles authored Jun 6, 2024
2 parents 7d5f4ec + 63967fe commit 0c9b3b3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 325 deletions.
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": "wlan-cloud-owprov-ui",
"version": "3.0.2(3)",
"version": "3.1.0(2)",
"description": "",
"main": "index.tsx",
"scripts": {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import InternalFormAccess from '../common/InternalFormAccess';
import SectionGeneralCard from '../common/SectionGeneralCard';
import SubSectionPicker from '../common/SubSectionPicker';
import AirtimePolicies from './AirtimePolicies';
import Captive from './Captive';
import DataPlane from './DataPlane';
import DhcpRelay from './DhcpRelay';
import FacebookWifi from './FacebookWifi';
Expand Down Expand Up @@ -124,7 +123,6 @@ const ServicesSection = ({ editing, setSection, sectionInformation, removeSub })
editing={editing}
subsections={[
'airtime-policies',
'captive',
'data-plane',
'dhcp-relay',
'facebook-wifi',
Expand All @@ -149,7 +147,6 @@ const ServicesSection = ({ editing, setSection, sectionInformation, removeSub })
}
/>
{isSubSectionActive('airtime-policies') && <AirtimePolicies editing={editing} />}
{isSubSectionActive('captive') && <Captive editing={editing} />}
{isSubSectionActive('data-plane') && <DataPlane editing={editing} />}
{isSubSectionActive('dhcp-relay') && <DhcpRelay isEditing={editing} />}
{isSubSectionActive('facebook-wifi') && <FacebookWifi editing={editing} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,131 +21,6 @@ export const SERVICES_DHCP_RELAY_SCHEMA = (t, useDefault = false) => {
return useDefault ? shape : shape.nullable().default(undefined);
};

export const SERVICES_CAPTIVE_SCHEMA = (t, useDefault = false) => {
const shape = object()
.shape({
'auto-mode': string().required(t('form.required')).default('click'),
'walled-garden-fqdn': array()
.when('auth-mode', {
is: 'uam',
then: array().of(string()).min(1, t('form.required')),
})
.default(undefined),
'walled-garden-ipaddr': array().of(string()).default(undefined),
'web-root': string().default(undefined),
'idle-timeout': number().required(t('form.required')).positive().lessThan(65535).integer().default(600),
'session-timeout': number().positive().lessThan(65535).integer().default(undefined),
// Only if auto-mode is "credentials"
credentials: array()
.when('auth-mode', {
is: 'credentials',
then: array()
.of(
object().shape({
username: string().required(t('form.required')).default(''),
password: string().required(t('form.required')).default(''),
}),
)
.min(1, t('form.required')),
})
.default(undefined),
// Radius && UAM values
'auth-server': string()
.when('auth-mode', {
is: (authMode) => authMode === 'radius' || authMode === 'uam',
then: string().required(t('form.required')).default(''),
})
.default(undefined),
'auth-secret': string()
.when('auth-mode', {
is: (authMode) => authMode === 'radius' || authMode === 'uam',
then: string().required(t('form.required')).default(''),
else: string().default(undefined),
})
.default(undefined),
'auth-port': number()
.when('auth-mode', {
is: (authMode) => authMode === 'radius' || authMode === 'uam',
then: number().required(t('form.required')).moreThan(1023).lessThan(65535).integer().default(1812),
else: number().default(undefined),
})
.default(undefined),
'acct-server': string()
.when('auth-mode', {
is: (authMode) => authMode === 'radius' || authMode === 'uam',
then: string().default(undefined),
else: string().default(undefined),
})
.default(undefined),
'acct-secret': string()
.when('auth-mode', {
is: (authMode) => authMode === 'radius' || authMode === 'uam',
then: string().default(undefined),
else: string().default(undefined),
})
.default(undefined),
'acct-port': number()
.when('auth-mode', {
is: (authMode) => authMode === 'radius' || authMode === 'uam',
then: number().moreThan(1023).lessThan(65535).integer().default(undefined),
else: number().default(undefined),
})
.default(undefined),
'acct-interval': number()
.when('auth-mode', {
is: (authMode) => authMode === 'radius' || authMode === 'uam',
then: number().positive().lessThan(65535).integer().default(undefined),
})
.default(undefined),
// Only UAM fields
'uam-server': string()
.when('auth-mode', {
is: (authMode) => authMode === 'uam',
then: string().required(t('form.required')).default(''),
})
.default(undefined),
'uam-secret': string()
.when('auth-mode', {
is: (authMode) => authMode === 'uam',
then: string().required(t('form.required')).default(''),
})
.default(undefined),
'uam-port': number()
.when('auth-mode', {
is: (authMode) => authMode === 'uam',
then: number().required(t('form.required')).moreThan(1023).lessThan(65535).integer().default(3990),
})
.default(undefined),
ssid: string()
.when('auth-mode', {
is: (authMode) => authMode === 'uam',
then: string().default(undefined),
})
.default(undefined),
'mac-format': string()
.when('auth-mode', {
is: (authMode) => authMode === 'uam',
then: string().required(t('form.required')).default('aabbccddeeff'),
})
.default(undefined),
nasid: string()
.when('auth-mode', {
is: (authMode) => authMode === 'uam',
then: string().required(t('form.required')).default(''),
})
.default(undefined),
nasmac: string()
.when('auth-mode', {
is: (authMode) => authMode === 'uam',
then: string().default(undefined),
})
.default(undefined),
})
.default({});

return useDefault ? shape : shape.nullable().default(undefined);
};

export const SERVICES_CLASSIFIER_DNS_SCHEMA = (t, useDefault = false) => {
const shape = object().shape({
fqdn: string().default(''),
Expand Down Expand Up @@ -446,7 +321,6 @@ export const SERVICES_SCHEMA = (t, useDefault = false) =>
'data-plane': SERVICES_DATA_PLANE_SCHEMA(t, useDefault),
'radius-proxy': SERVICES_RADIUS_PROXY_SCHEMA(t, useDefault),
ieee8021x: SERVICES_IEEE8021X_SCHEMA(t, useDefault),
captive: SERVICES_CAPTIVE_SCHEMA(t, useDefault),
gps: SERVICES_GPS_SCHEMA(t, useDefault),
'dhcp-relay': SERVICES_DHCP_RELAY_SCHEMA(t, useDefault),
}),
Expand Down Expand Up @@ -488,8 +362,6 @@ export const getSubSectionDefaults = (t, sub) => {
return SERVICES_IEEE8021X_SCHEMA(t, true).cast();
case 'radius-proxy':
return SERVICES_RADIUS_PROXY_SCHEMA(t, true).cast();
case 'captive':
return SERVICES_CAPTIVE_SCHEMA(t, true).cast();
case 'gps':
return SERVICES_GPS_SCHEMA(t, true).cast();
case 'dhcp-relay':
Expand Down

0 comments on commit 0c9b3b3

Please sign in to comment.