Skip to content

Commit

Permalink
add language option to autopilot profile
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Jun 6, 2024
1 parent de39748 commit 68f666c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 30 deletions.
5 changes: 4 additions & 1 deletion src/components/forms/RFFComponents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ export const RFFSelectSearch = ({
}

const selectProps = {
className: 'react-select-container',
classNamePrefix: 'react-select',
...input,
name,
Expand All @@ -560,6 +559,10 @@ export const RFFSelectSearch = ({
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 (
Expand Down
75 changes: 46 additions & 29 deletions src/views/endpoint/autopilot/AutopilotAddProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { faCheck, faExclamationTriangle, faTimes } from '@fortawesome/free-solid
import { CippWizard } from 'src/components/layout'
import { WizardTableField } from 'src/components/tables'
import PropTypes from 'prop-types'
import { RFFCFormInput, RFFCFormSwitch } from 'src/components/forms'
import { RFFCFormInput, RFFCFormSwitch, RFFSelectSearch } from 'src/components/forms'
import { useLazyGenericPostRequestQuery } from 'src/store/api/app'
import langaugeList from 'src/data/languageList'

const Error = ({ name }) => (
<Field
Expand Down Expand Up @@ -112,7 +113,20 @@ const ApplyStandard = () => {
</CCol>
</CRow>
<CRow>
<CCol md={12}>
<CCol md={12} className="mb-2">
<RFFSelectSearch
values={langaugeList.map(({ language, tag }) => ({
value: tag,
name: language,
}))}
name="languages"
multi={false}
label="Languages"
/>
</CCol>
</CRow>
<CRow>
<CCol md={12} className="mb-2">
<RFFCFormInput
type="text"
name="Description"
Expand All @@ -122,41 +136,44 @@ const ApplyStandard = () => {
</CCol>
</CRow>
<CRow>
<CCol md={12}>
<CCol md={12} className="mb-2">
<RFFCFormInput
type="text"
name="DeviceNameTemplate"
label="Unique name template"
placeholder="leave blank for none"
/>
<br></br>
</CCol>
</CRow>
<RFFCFormSwitch
value={true}
name="CollectHash"
label="Convert all targeted devices to Autopilot"
/>
<RFFCFormSwitch value={true} name="Assignto" label="Assign to all devices" />
<RFFCFormSwitch value={true} name="DeploymentMode" label="Self-deploying mode" />
<RFFCFormSwitch value={true} name="HideTerms" label="Hide Terms and conditions" />
<RFFCFormSwitch value={true} name="HidePrivacy" label="Hide Privacy Settings" />
<RFFCFormSwitch
value={true}
name="HideChangeAccount"
label="Hide Change Account Options"
/>
<RFFCFormSwitch
value={true}
name="NotLocalAdmin"
label="Setup user as standard user (Leave unchecked to setup user as local admin)"
/>
<RFFCFormSwitch value={true} name="allowWhiteglove" label="Allow White Glove OOBE" />
<RFFCFormSwitch
value={true}
name="Autokeyboard"
label="Automatically configure keyboard"
/>
<CRow>
<CCol md={12} className="mb-2">
<RFFCFormSwitch
value={true}
name="CollectHash"
label="Convert all targeted devices to Autopilot"
/>
<RFFCFormSwitch value={true} name="Assignto" label="Assign to all devices" />
<RFFCFormSwitch value={true} name="DeploymentMode" label="Self-deploying mode" />
<RFFCFormSwitch value={true} name="HideTerms" label="Hide Terms and conditions" />
<RFFCFormSwitch value={true} name="HidePrivacy" label="Hide Privacy Settings" />
<RFFCFormSwitch
value={true}
name="HideChangeAccount"
label="Hide Change Account Options"
/>
<RFFCFormSwitch
value={true}
name="NotLocalAdmin"
label="Setup user as standard user (Leave unchecked to setup user as local admin)"
/>
<RFFCFormSwitch value={true} name="allowWhiteglove" label="Allow White Glove OOBE" />
<RFFCFormSwitch
value={true}
name="Autokeyboard"
label="Automatically configure keyboard"
/>
</CCol>
</CRow>
</CForm>
<hr className="my-4" />
</CippWizard.Page>
Expand Down
14 changes: 14 additions & 0 deletions src/views/tenant/standards/ListAppliedStandards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import GDAPRoles from 'src/data/GDAPRoles'
import timezoneList from 'src/data/timezoneList'
import Select from 'react-select'
import { cellGenericFormatter } from 'src/components/tables/CellGenericFormat'
import langaugeList from 'src/data/languageList'

const DeleteAction = () => {
const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName)
Expand Down Expand Up @@ -875,6 +876,19 @@ const ApplyNewStandard = () => {
/>
<br></br>
</CCol>
<CRow>
<CCol md={12} className="mb-2">
<RFFSelectSearch
values={langaugeList.map(({ language, tag }) => ({
value: tag,
name: language,
}))}
name="standards.APConfig.languages"
multi={false}
label="Languages"
/>
</CCol>
</CRow>
</CRow>
<RFFCFormSwitch
value={true}
Expand Down

0 comments on commit 68f666c

Please sign in to comment.