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

Extension layout #2637

Merged
merged 2 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion src/components/contentcards/CippButtonCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ export default function CippButtonCard({
CardButton,
children,
isFetching,
className = 'h-100',
}) {
return (
<CCard className="h-100 mb-3">
<CCard className={`${className} mb-3`}>
<CCardHeader>
<CCardTitle>
{titleType === 'big' ? <h3 className="underline mb-3">{title}</h3> : title}
Expand All @@ -32,4 +33,5 @@ CippButtonCard.propTypes = {
CardButton: PropTypes.element.isRequired,
children: PropTypes.element.isRequired,
isFetching: PropTypes.bool.isRequired,
className: PropTypes.string,
}
17 changes: 12 additions & 5 deletions src/data/Extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"type": "input",
"fieldtype": "input",
"name": "NinjaOne.Instance",
"label": "Please enter your NinjaOne Instance",
"label": "Please enter your NinjaOne Instance hostname",
"placeholder": "app.ninjarmm.com, eu.ninjarmm.com, oc.ninjarmm.com, ca.ninjarmm.com, us2.ninjarmm.com"
},
{
Expand Down Expand Up @@ -162,7 +162,8 @@
],
"mappingRequired": true,
"fieldMapping": true,
"autoMapSyncApi": true
"autoMapSyncApi": true,
"showSyncButton": true
},
{
"name": "Hudu",
Expand All @@ -187,8 +188,13 @@
},
{
"type": "checkbox",
"name": "Hudu.LicensedUsersOnly",
"label": "Only Sync Licensed Users"
"name": "Hudu.CreateMissingUsers",
"label": "Create missing users in Hudu"
},
{
"type": "checkbox",
"name": "Hudu.CreateMissingDevices",
"label": "Create missing devices in Hudu"
},
{
"type": "checkbox",
Expand All @@ -197,7 +203,8 @@
}
],
"mappingRequired": true,
"fieldMapping": true
"fieldMapping": true,
"showSyncButton": true
},
{
"name": "PasswordPusher",
Expand Down
44 changes: 31 additions & 13 deletions src/views/cipp/ExtensionMappings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,32 @@ export default function ExtensionMappings({ type, fieldMappings = false, autoMap
title={`${type} Organization Mapping`}
titleType="big"
isFetching={listMappingBackendResult.isFetching}
className="px-0"
CardButton={
<>
<CButton form={`${type}Org`} className="me-2" type="submit">
{extensionConfigResult.isFetching && (
<FontAwesomeIcon icon={faCircleNotch} spin className="me-2" size="1x" />
)}
Set Mappings
<CButton
form={`${type}Org`}
className="me-2"
type="submit"
disabled={listMappingBackendResult.isFetching}
>
<FontAwesomeIcon
icon={extensionConfigResult.isFetching ? 'circle-notch' : 'save'}
spin={extensionConfigResult.isFetching}
className="me-2"
/>
Save Mappings
</CButton>
<CButton onClick={() => onOrgsAutomap()} className="me-2">
{extensionAutomapResult.isFetching && (
<FontAwesomeIcon icon={faCircleNotch} spin className="me-2" size="1x" />
)}
<CButton
onClick={() => onOrgsAutomap()}
className="me-2"
disabled={listMappingBackendResult.isFetching}
>
<FontAwesomeIcon
icon={extensionAutomapResult.isFetching ? 'circle-notch' : 'wand-magic-sparkles'}
spin={extensionAutomapResult.isFetching}
className="me-2"
/>
Automap {type} Organizations
</CButton>
</>
Expand Down Expand Up @@ -311,12 +325,16 @@ export default function ExtensionMappings({ type, fieldMappings = false, autoMap
title={`${type} Field Mapping`}
titleType="big"
isFetching={listFieldsBackendResult.isFetching}
className="px-0"
CardButton={
<CButton form={`${type}Fields`} className="me-2" type="submit">
{extensionFieldsConfigResult.isFetching && (
<FontAwesomeIcon icon={faCircleNotch} spin className="me-2" size="1x" />
)}
Set Mappings
<FontAwesomeIcon
icon={extensionFieldsConfigResult.isFetching ? 'circle-notch' : 'save'}
spin={extensionFieldsConfigResult.isFetching}
className="me-2"
disabled={extensionFieldsConfigResult.isFetching}
/>
Save Mappings
</CButton>
}
>
Expand Down
35 changes: 22 additions & 13 deletions src/views/cipp/Extensions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,20 @@ export default function CIPPExtensions() {
const ButtonGenerate = (integrationType, forceSync, disabled) => (
<>
<CButton disabled={disabled} className="me-2" form={integrationType} type="submit">
{extensionConfigResult.isFetching && (
<FontAwesomeIcon icon={faCircleNotch} spin className="me-2" size="1x" />
)}
Set Extension Settings
<FontAwesomeIcon
icon={extensionConfigResult.isFetching ? 'circle-notch' : 'save'}
spin={extensionConfigResult.isFetching}
className="me-2"
/>
Save
</CButton>
<CButton disabled={disabled} onClick={() => onSubmitTest(integrationType)} className="me-2">
{listExtensionTestResult.isFetching && (
<FontAwesomeIcon icon={faCircleNotch} spin className="me-2" size="1x" />
)}
Test Extension
<FontAwesomeIcon
icon={listExtensionTestResult.isFetching ? 'circle-notch' : 'flask'}
spin={listExtensionTestResult.isFetching}
className="me-2"
/>
Test
</CButton>
{forceSync && (
<CButton
Expand All @@ -65,9 +69,11 @@ export default function CIPPExtensions() {
}
className="me-2"
>
{listSyncExtensionResult.isFetching && (
<FontAwesomeIcon icon={faCircleNotch} spin className="me-2" size="1x" />
)}
<FontAwesomeIcon
icon={listSyncExtensionResult.isFetching ? 'circle-notch' : 'sync'}
spin={listSyncExtensionResult.isFetching}
className="me-2"
/>
Force Sync
</CButton>
)}
Expand Down Expand Up @@ -118,10 +124,13 @@ export default function CIPPExtensions() {
isFetching={listBackendResult.isFetching}
CardButton={ButtonGenerate(
integration.type,
integration.forceSync,
(hostedMetaContent === 'true' && integration.disableWhenhosted) || false,
integration.forceSyncButton,
(hostedMetaContent === 'true' && integration.disableWhenhosted) ||
listBackendResult.isFetching ||
false,
)}
key={idx}
className=""
>
<p>{integration.helpText}</p>
<Form
Expand Down
Loading