From e7e3b65f34c9d9ef94a018b1107255e045fceb84 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 5 Sep 2023 17:52:34 -0400 Subject: [PATCH 01/29] Switch to BPA Report schema --- src/_nav.js | 4 +- src/data/BPAReport.schema.v1.json | 251 ++++++++++++++++++ src/data/BPAReport.uischema.v1.json | 36 +++ src/routes.js | 8 +- ...BPAFieldBuilder.js => BPAReportBuilder.js} | 21 +- 5 files changed, 304 insertions(+), 16 deletions(-) create mode 100644 src/data/BPAReport.schema.v1.json create mode 100644 src/data/BPAReport.uischema.v1.json rename src/views/tenant/standards/{BPAFieldBuilder.js => BPAReportBuilder.js} (74%) diff --git a/src/_nav.js b/src/_nav.js index 415109e33280..2f8d05e25f85 100644 --- a/src/_nav.js +++ b/src/_nav.js @@ -173,8 +173,8 @@ const _nav = [ }, { component: CNavItem, - name: 'BPA Field Builder', - to: '/tenant/tools/bpa-field-builder', + name: 'BPA Report Builder', + to: '/tenant/tools/bpa-report-builder', }, ], }, diff --git a/src/data/BPAReport.schema.v1.json b/src/data/BPAReport.schema.v1.json new file mode 100644 index 000000000000..45d6e0e56c2b --- /dev/null +++ b/src/data/BPAReport.schema.v1.json @@ -0,0 +1,251 @@ +{ + "title": "BPA Report Builder", + "type": "object", + "required": ["name", "style", "Fields"], + "properties": { + "name": { + "type": "string", + "title": "Report Name", + "description": "The title or name of the report." + }, + "style": { + "type": "string", + "title": "Report Style", + "default": "Table", + "enum": ["Table", "Tenant"], + "description": "Specifies the layout or presentation style of the report." + }, + "Fields": { + "title": "Report Fields", + "type": "array", + "minItems": 1, + "items": { + "required": ["name", "API", "StoreAs"], + "properties": { + "name": { + "type": "string", + "title": "Field Name", + "description": "Identifier for each set or category of data." + }, + "UseExistingInfo": { + "type": "boolean", + "title": "Use Existing Info?", + "default": false + }, + "StoreAs": { + "type": "string", + "title": "Store As", + "description": "The format in which to store the fetched data.", + "anyOf": [ + { + "const": "JSON", + "title": "JSON - For structured data" + }, + { + "const": "bool", + "title": "Boolean - True/False values" + } + ] + }, + "ExtractFields": { + "title": "Extract Fields", + "description": "Lists the attributes or fields to extract from the returned data.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "where": { + "title": "Where", + "description": "A conditional filter to determine which data gets displayed or processed. Use PowerShell's Where-Object Filterscript format.", + "type": "string" + }, + "FrontendFields": { + "type": "array", + "title": "Frontend Fields", + "description": "Describes how each data attribute will be displayed in the report.", + "items": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "Label for the data in the report.", + "type": "string" + }, + "value": { + "title": "Value", + "description": "Reference to the data's location or attribute.", + "type": "string" + }, + "formatter": { + "title": "Formatter", + "description": "Specifies how the data will be formatted for display.", + "type": "string", + "anyOf": [ + { + "const": "string", + "title": "Display as plain text" + }, + { + "const": "bool", + "title": "Presents as True or False" + }, + { + "const": "warnBool", + "title": "Shows boolean values with potential visual warnings" + }, + { + "const": "reverseBool", + "title": "Inverts the boolean value for display" + }, + { + "const": "table", + "title": "Represents the data in a table format" + }, + { + "const": "number", + "title": "Displays as a numerical value" + } + ] + } + } + }, + "minItems": 1, + "required": ["name", "value", "formatter"] + }, + "desc": { + "title": "Field Description", + "description": "A description field shown on the end of the card on the tenant overview page", + "type": "string" + } + }, + "allOf": [ + { + "if": { + "properties": { + "UseExistingInfo": { + "enum": [false] + } + } + }, + "then": { + "properties": { + "API": { + "type": "string", + "title": "API", + "anyOf": [ + { + "const": "Graph", + "title": "Graph" + }, + { + "const": "Exchange", + "title": "Exchange" + }, + { + "const": "CIPPFunction", + "title": "CIPP Function" + } + ], + "default": "Graph", + "description": "Defines the source or type of API to fetch the data." + } + }, + "allOf": [ + { + "if": { + "properties": { + "API": { + "enum": ["CIPPFunction"] + } + } + }, + "then": { + "properties": { + "URL": { + "type": "string", + "description": "The endpoint for CIPP Function" + } + }, + "required": ["URL"] + } + }, + { + "if": { + "properties": { + "API": { + "enum": ["Exchange"] + } + } + }, + "then": { + "properties": { + "Command": { + "type": "string", + "title": "Command", + "pattern": "^Get-", + "description": "Command for Exchange (Get only)" + } + }, + "required": ["Command"] + } + }, + { + "if": { + "properties": { + "API": { + "enum": ["Graph"] + } + } + }, + "then": { + "properties": { + "parameters": { + "type": "object", + "title": "Parameters", + "description": "Additional settings or parameters required for the API call.", + "properties": { + "asApp": { + "title": "Use Application Permissions", + "type": "boolean" + } + }, + "additionalProperties": true + }, + "URL": { + "type": "string", + "pattern": "^https://graph.microsoft.com/", + "description": "The endpoint for Graph" + } + }, + "required": ["URL"] + } + }, + { + "if": { + "properties": { + "API": { + "enum": ["Exchange", "CIPPFunction"] + } + } + }, + "then": { + "properties": { + "parameters": { + "type": "object", + "title": "Parameters", + "description": "Additional settings or parameters required for the API call.", + "additionalProperties": true + } + } + } + } + ] + } + } + ] + } + } + } +} diff --git a/src/data/BPAReport.uischema.v1.json b/src/data/BPAReport.uischema.v1.json new file mode 100644 index 000000000000..14c831199f2c --- /dev/null +++ b/src/data/BPAReport.uischema.v1.json @@ -0,0 +1,36 @@ +{ + "ui:disabled": false, + "ui:readonly": false, + "ui:order": ["name", "style", "*"], + "Fields": { + "items": { + "ui:order": [ + "name", + "desc", + "UseExistingInfo", + "StoreAs", + "API", + "URL", + "Command", + "parameters", + "where", + "ExtractFields", + "FrontendFields", + "*" + ] + } + }, + "ui:submitButtonOptions": { + "submitText": "Validate", + "norender": false, + "props": { + "disabled": false, + "className": "btn btn-info" + } + }, + "Fields": { + "items": { + "ui:classNames": "card card-title p-4 my-4" + } + } +} diff --git a/src/routes.js b/src/routes.js index 2851d6e96eb7..75079b327e2c 100644 --- a/src/routes.js +++ b/src/routes.js @@ -71,7 +71,7 @@ const DeviceComplianceReport = React.lazy(() => const BestPracticeAnalyzer = React.lazy(() => import('src/views/tenant/standards/BestPracticeAnalyser'), ) -const BPAFieldBuilder = React.lazy(() => import('src/views/tenant/standards/BPAFieldBuilder')) +const BPAReportBuilder = React.lazy(() => import('src/views/tenant/standards/BPAReportBuilder')) const DomainsAnalyser = React.lazy(() => import('src/views/tenant/standards/DomainsAnalyser')) const OffboardingWizard = React.lazy(() => import('src/views/identity/administration/OffboardingWizard'), @@ -387,9 +387,9 @@ const routes = [ component: GeoIPLookup, }, { - path: '/tenant/tools/bpa-field-builder', - name: 'BPA Field Builder', - component: BPAFieldBuilder, + path: '/tenant/tools/bpa-report-builder', + name: 'BPA Report Builder', + component: BPAReportBuilder, }, { path: '/tenant/standards/alert-list', name: 'Alert List (Alpha)', component: ListAlerts }, { path: '/endpoint', name: 'Endpoint' }, diff --git a/src/views/tenant/standards/BPAFieldBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js similarity index 74% rename from src/views/tenant/standards/BPAFieldBuilder.js rename to src/views/tenant/standards/BPAReportBuilder.js index 738c37946809..660b1142229f 100644 --- a/src/views/tenant/standards/BPAFieldBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -1,15 +1,15 @@ import React, { useState, useRef } from 'react' import { CippPage } from 'src/components/layout' -import BPAFieldSchema from 'src/data/BPAField.schema.v1' -import BPAFieldUISchema from 'src/data/BPAField.uischema.v1' +import BPAReportSchema from 'src/data/BPAReport.schema.v1' +import BPAReportUISchema from 'src/data/BPAReport.uischema.v1' import validator from '@rjsf/validator-ajv8' import Form from '@rjsf/core' import { CippContentCard } from 'src/components/layout' -import { CRow, CCol, CButton } from '@coreui/react' +import { CRow, CCol } from '@coreui/react' import Editor from '@monaco-editor/react' import { useSelector } from 'react-redux' -const BPAFieldBuilder = () => { +const BPAReportBuilder = () => { const [formData, setFormData] = useState(null) const editorRef = useRef(null) const currentTheme = useSelector((state) => state.app.currentTheme) @@ -18,19 +18,19 @@ const BPAFieldBuilder = () => { } return ( - +
setFormData(e.formData)} enable={true} - showErrorList="bottom" + showErrorList="none" omitExtraData={true} liveOmit={true} /> @@ -42,9 +42,10 @@ const BPAFieldBuilder = () => { defaultLanguage="json" value={JSON.stringify(formData, null, 2)} onChange={handleEditorChange} - schema={BPAFieldSchema} + schema={BPAReportSchema} validator={validator} theme={currentTheme == 'cyberdrain' ? 'vs-light' : 'vs-dark'} + height="700px" /> @@ -53,4 +54,4 @@ const BPAFieldBuilder = () => { ) } -export default BPAFieldBuilder +export default BPAReportBuilder From 038be3774fbd583d47506cc3625550b400fd42cb Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 5 Sep 2023 19:01:19 -0400 Subject: [PATCH 02/29] Update BPAReport.uischema.v1.json --- src/data/BPAReport.uischema.v1.json | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/data/BPAReport.uischema.v1.json b/src/data/BPAReport.uischema.v1.json index 14c831199f2c..f5d3db89270d 100644 --- a/src/data/BPAReport.uischema.v1.json +++ b/src/data/BPAReport.uischema.v1.json @@ -17,20 +17,14 @@ "ExtractFields", "FrontendFields", "*" - ] + ], + "FrontendFields": { + "ui:classNames": "card card-title p-4 my-4" + }, + "ui:classNames": "card card-title p-4 my-4" } }, "ui:submitButtonOptions": { - "submitText": "Validate", - "norender": false, - "props": { - "disabled": false, - "className": "btn btn-info" - } - }, - "Fields": { - "items": { - "ui:classNames": "card card-title p-4 my-4" - } + "norender": true } } From bcb1dcb74d79b022a0ca9a5d28cf9f25aaaf116e Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 5 Sep 2023 19:18:05 -0400 Subject: [PATCH 03/29] Update BPAReportBuilder.js --- src/views/tenant/standards/BPAReportBuilder.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index 660b1142229f..003ac1e6f1a7 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -16,6 +16,9 @@ const BPAReportBuilder = () => { function handleEditorChange(value, event) { setFormData(JSON.parse(value)) } + const options = { + wordWrap: true, + } return ( @@ -42,10 +45,9 @@ const BPAReportBuilder = () => { defaultLanguage="json" value={JSON.stringify(formData, null, 2)} onChange={handleEditorChange} - schema={BPAReportSchema} - validator={validator} theme={currentTheme == 'cyberdrain' ? 'vs-light' : 'vs-dark'} height="700px" + options={options} /> From 409da1c7e927b5ff3b63ff9dd1ef236a0d620cae Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 5 Sep 2023 20:09:51 -0400 Subject: [PATCH 04/29] Add custom widgets --- .../tenant/standards/BPAReportBuilder.js | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index 003ac1e6f1a7..a50f885400a4 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -8,6 +8,54 @@ import { CippContentCard } from 'src/components/layout' import { CRow, CCol } from '@coreui/react' import Editor from '@monaco-editor/react' import { useSelector } from 'react-redux' +import { WidgetProps, RegistryWidgetsType } from '@rjsf/utils' +import { CFormInput, CFormSelect, CFormSwitch } from '@coreui/react' + +const CippTextWidget = (props: WidgetProps) => { + return ( + props.onChange(event.target.value)} + /> + ) +} +const CippSelectWidget = (props: WidgetProps) => { + const options = props?.options.length > 0 ? props.options : props.options.enumOptions + console.log(options) + return ( + props.onChange(event.target.value)} + > + {options.map(({ label, value }, idx) => ( + + ))} + + ) +} + +const CippCheckboxWidget = (props: WidgetProps) => { + // not working yet + return ( + props.onChange(!props.value)} + /> + ) +} +const CippWidgets: RegistryWidgetsType = { + TextWidget: CippTextWidget, + SelectWidget: CippSelectWidget, +} const BPAReportBuilder = () => { const [formData, setFormData] = useState(null) @@ -36,6 +84,7 @@ const BPAReportBuilder = () => { showErrorList="none" omitExtraData={true} liveOmit={true} + widgets={CippWidgets} /> From a042dd6df1d936848230231d66688af0b9268bf8 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 6 Sep 2023 00:30:58 -0400 Subject: [PATCH 05/29] Report/schema tweaks --- src/data/BPAReport.schema.v1.json | 61 +++++++++++-------- .../tenant/standards/BPAReportBuilder.js | 24 +++++--- 2 files changed, 49 insertions(+), 36 deletions(-) diff --git a/src/data/BPAReport.schema.v1.json b/src/data/BPAReport.schema.v1.json index 45d6e0e56c2b..41eff446c312 100644 --- a/src/data/BPAReport.schema.v1.json +++ b/src/data/BPAReport.schema.v1.json @@ -20,7 +20,7 @@ "type": "array", "minItems": 1, "items": { - "required": ["name", "API", "StoreAs"], + "required": ["name", "API"], "properties": { "name": { "type": "string", @@ -32,21 +32,6 @@ "title": "Use Existing Info?", "default": false }, - "StoreAs": { - "type": "string", - "title": "Store As", - "description": "The format in which to store the fetched data.", - "anyOf": [ - { - "const": "JSON", - "title": "JSON - For structured data" - }, - { - "const": "bool", - "title": "Boolean - True/False values" - } - ] - }, "ExtractFields": { "title": "Extract Fields", "description": "Lists the attributes or fields to extract from the returned data.", @@ -56,11 +41,7 @@ }, "minItems": 1 }, - "where": { - "title": "Where", - "description": "A conditional filter to determine which data gets displayed or processed. Use PowerShell's Where-Object Filterscript format.", - "type": "string" - }, + "FrontendFields": { "type": "array", "title": "Frontend Fields", @@ -89,15 +70,15 @@ }, { "const": "bool", - "title": "Presents as True or False" + "title": "True/False" }, { "const": "warnBool", - "title": "Shows boolean values with potential visual warnings" + "title": "True/False values with potential visual warnings" }, { "const": "reverseBool", - "title": "Inverts the boolean value for display" + "title": "Inverts the True/False value for display" }, { "const": "table", @@ -131,6 +112,31 @@ }, "then": { "properties": { + "required": "StoreAs", + "where": { + "title": "Where", + "description": "A conditional filter to determine which data gets displayed or processed. Use PowerShell's Where-Object Filterscript format.", + "type": "string" + }, + "StoreAs": { + "type": "string", + "title": "Store As", + "description": "The format in which to store the fetched data.", + "anyOf": [ + { + "const": "string", + "title": "String - For plain text" + }, + { + "const": "JSON", + "title": "JSON - For structured data" + }, + { + "const": "bool", + "title": "Boolean - True/False values" + } + ] + }, "API": { "type": "string", "title": "API", @@ -163,12 +169,13 @@ }, "then": { "properties": { - "URL": { + "Command": { "type": "string", - "description": "The endpoint for CIPP Function" + "pattern": "^Get-CIPP", + "description": "Command for CIPP Function (Get-CIPP)" } }, - "required": ["URL"] + "required": ["Command"] } }, { diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index a50f885400a4..384c78d9e24c 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -8,10 +8,9 @@ import { CippContentCard } from 'src/components/layout' import { CRow, CCol } from '@coreui/react' import Editor from '@monaco-editor/react' import { useSelector } from 'react-redux' -import { WidgetProps, RegistryWidgetsType } from '@rjsf/utils' import { CFormInput, CFormSelect, CFormSwitch } from '@coreui/react' -const CippTextWidget = (props: WidgetProps) => { +const CippTextWidget = (props) => { return ( { /> ) } -const CippSelectWidget = (props: WidgetProps) => { +const CippSelectWidget = (props) => { const options = props?.options.length > 0 ? props.options : props.options.enumOptions - console.log(options) return ( { ) } -const CippCheckboxWidget = (props: WidgetProps) => { +const CippCheckboxWidget = (props) => { // not working yet + console.log(props) return ( props.onChange(!props.value)} + onChange={(event) => { + props.onChange(event.target.checked) + }} /> ) } -const CippWidgets: RegistryWidgetsType = { +const CippWidgets = { TextWidget: CippTextWidget, SelectWidget: CippSelectWidget, + CheckboxWidget: CippCheckboxWidget, } const BPAReportBuilder = () => { @@ -62,7 +64,11 @@ const BPAReportBuilder = () => { const editorRef = useRef(null) const currentTheme = useSelector((state) => state.app.currentTheme) function handleEditorChange(value, event) { - setFormData(JSON.parse(value)) + try { + setFormData(JSON.parse(value)) + } catch { + setFormData({}) + } } const options = { wordWrap: true, From c2efca5b38327467f45c6b7ae614c394f4b218d9 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 6 Sep 2023 00:37:30 -0400 Subject: [PATCH 06/29] Update BPAReport.schema.v1.json --- src/data/BPAReport.schema.v1.json | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/data/BPAReport.schema.v1.json b/src/data/BPAReport.schema.v1.json index 41eff446c312..f84418893481 100644 --- a/src/data/BPAReport.schema.v1.json +++ b/src/data/BPAReport.schema.v1.json @@ -20,7 +20,7 @@ "type": "array", "minItems": 1, "items": { - "required": ["name", "API"], + "required": ["name"], "properties": { "name": { "type": "string", @@ -32,16 +32,6 @@ "title": "Use Existing Info?", "default": false }, - "ExtractFields": { - "title": "Extract Fields", - "description": "Lists the attributes or fields to extract from the returned data.", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - }, - "FrontendFields": { "type": "array", "title": "Frontend Fields", @@ -111,8 +101,8 @@ } }, "then": { + "required": ["API", "StoreAs", "ExtractFields"], "properties": { - "required": "StoreAs", "where": { "title": "Where", "description": "A conditional filter to determine which data gets displayed or processed. Use PowerShell's Where-Object Filterscript format.", @@ -156,6 +146,15 @@ ], "default": "Graph", "description": "Defines the source or type of API to fetch the data." + }, + "ExtractFields": { + "title": "Extract Fields", + "description": "Lists the attributes or fields to extract from the returned data.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 } }, "allOf": [ From be63aeac1c9e78af0ee803f67d39503cc759b3cd Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Wed, 6 Sep 2023 18:14:00 +0200 Subject: [PATCH 07/29] tmp bpa fix --- src/views/tenant/standards/BestPracticeAnalyser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tenant/standards/BestPracticeAnalyser.js b/src/views/tenant/standards/BestPracticeAnalyser.js index 68356121e425..025095e1a48c 100644 --- a/src/views/tenant/standards/BestPracticeAnalyser.js +++ b/src/views/tenant/standards/BestPracticeAnalyser.js @@ -198,7 +198,7 @@ const BestPracticeAnalyser = () => { name: col.name, selector: (row) => getNestedValue(row, col.value), sortable: true, - exportSelector: col.value, + exportSelector: col.value.split('.').join('/'), cell: cellSelector, // Use the determined cell selector }) }) From 869fdf8f98f5a04b27dcb58786d625950d22f392 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Wed, 6 Sep 2023 18:35:02 +0200 Subject: [PATCH 08/29] fix spacing --- src/data/BPAField.uischema.v1.json | 2 +- src/views/tenant/standards/BPAReportBuilder.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/BPAField.uischema.v1.json b/src/data/BPAField.uischema.v1.json index 4eeb72527109..5d88206bb0aa 100644 --- a/src/data/BPAField.uischema.v1.json +++ b/src/data/BPAField.uischema.v1.json @@ -20,7 +20,7 @@ "norender": false, "props": { "disabled": false, - "className": "btn btn-info" + "className": "btn mb-3 btn-primary" } } } diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index 384c78d9e24c..39015265c675 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -14,6 +14,7 @@ const CippTextWidget = (props) => { return ( props.onChange(event.target.value)} @@ -26,6 +27,7 @@ const CippSelectWidget = (props) => { props.onChange(event.target.value)} > {options.map(({ label, value }, idx) => ( @@ -46,7 +48,7 @@ const CippCheckboxWidget = (props) => { id={props.name} label={props.label} checked={props.value} - className="my-2" + className="mb-3" onChange={(event) => { props.onChange(event.target.checked) }} From 9979c91c09a6303458d3da18388d18cae3cb6e61 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Wed, 6 Sep 2023 20:57:22 +0200 Subject: [PATCH 09/29] theming of bpa --- package-lock.json | 293 +++++++++++++++++- package.json | 1 + src/data/BPAField.uischema.v1.json | 2 +- src/data/BPAReport.uischema.v1.json | 3 +- .../tenant/standards/BPAReportBuilder.js | 5 +- 5 files changed, 292 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index a7f3bc927e18..acf2cd561d02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "@monaco-editor/react": "^4.5.2", "@popperjs/core": "^2.10.2", "@reduxjs/toolkit": "^1.7.0", + "@rjsf/bootstrap-4": "^5.12.1", "@rjsf/core": "^5.12.1", "@rjsf/utils": "^5.12.1", "@rjsf/validator-ajv8": "^5.12.1", @@ -3175,13 +3176,22 @@ } }, "node_modules/@popperjs/core": { - "version": "2.11.2", - "license": "MIT", + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" } }, + "node_modules/@react-icons/all-files": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz", + "integrity": "sha512-hxBI2UOuVaI3O/BhQfhtb4kcGn9ft12RWAFVMUeNjqqhLsHvFtzIkFaptBJpFDANTKoDfdVoHTKZDlwKCACbMQ==", + "peerDependencies": { + "react": "*" + } + }, "node_modules/@reduxjs/toolkit": { "version": "1.8.0", "license": "MIT", @@ -3211,6 +3221,44 @@ "@babel/runtime": "^7.9.2" } }, + "node_modules/@restart/context": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", + "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==", + "peer": true, + "peerDependencies": { + "react": ">=16.3.2" + } + }, + "node_modules/@restart/hooks": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.11.tgz", + "integrity": "sha512-Ft/ncTULZN6ldGHiF/k5qt72O8JyRMOeg0tApvCni8LkoiEahO+z3TNxfXIVGy890YtWVDvJAl662dVJSJXvMw==", + "peer": true, + "dependencies": { + "dequal": "^2.0.3" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@rjsf/bootstrap-4": { + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.12.1.tgz", + "integrity": "sha512-aUnijxIlYWza8klJ+GvgoYk4gFSaQQV97LLdujMQY096iLm12ryxWLEjyLyPPNOymyp4kdkNO4FCTiWMs2bh3Q==", + "dependencies": { + "@react-icons/all-files": "^4.1.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@rjsf/core": "^5.8.x", + "@rjsf/utils": "^5.8.x", + "react": "^16.14.0 || >=17", + "react-bootstrap": "^1.6.5" + } + }, "node_modules/@rjsf/core": { "version": "5.12.1", "resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.12.1.tgz", @@ -3767,6 +3815,12 @@ "@types/node": "*" } }, + "node_modules/@types/invariant": { + "version": "2.2.35", + "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.35.tgz", + "integrity": "sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==", + "peer": true + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "dev": true, @@ -3946,6 +4000,12 @@ "version": "2.0.6", "license": "MIT" }, + "node_modules/@types/warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz", + "integrity": "sha512-t/Tvs5qR47OLOr+4E9ckN8AmP2Tf16gWq+/qA4iUGS/OOyHVO8wv2vjJuX8SNOUTJyWb+2t7wJm6cXILFnOROA==", + "peer": true + }, "node_modules/@types/ws": { "version": "8.5.2", "dev": true, @@ -6940,6 +7000,15 @@ "node": ">= 0.6" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/desandro-matches-selector": { "version": "2.0.2", "license": "MIT" @@ -9686,7 +9755,6 @@ }, "node_modules/invariant": { "version": "2.2.4", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.0.0" @@ -14643,6 +14711,25 @@ "react-is": "^16.13.1" } }, + "node_modules/prop-types-extra": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz", + "integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==", + "peer": true, + "dependencies": { + "react-is": "^16.3.2", + "warning": "^4.0.0" + }, + "peerDependencies": { + "react": ">=0.14.0" + } + }, + "node_modules/prop-types-extra/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "peer": true + }, "node_modules/prop-types/node_modules/react-is": { "version": "16.13.1", "license": "MIT" @@ -14839,6 +14926,35 @@ "node": ">=10" } }, + "node_modules/react-bootstrap": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.6.7.tgz", + "integrity": "sha512-IzCYXuLSKDEjGFglbFWk0/iHmdhdcJzTmtS6lXxc0kaNFx2PFgrQf5jKnx5sarF2tiXh9Tgx3pSt3pdK7YwkMA==", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.14.0", + "@restart/context": "^2.1.4", + "@restart/hooks": "^0.4.7", + "@types/invariant": "^2.2.33", + "@types/prop-types": "^15.7.3", + "@types/react": ">=16.14.8", + "@types/react-transition-group": "^4.4.1", + "@types/warning": "^3.0.0", + "classnames": "^2.3.1", + "dom-helpers": "^5.2.1", + "invariant": "^2.2.4", + "prop-types": "^15.7.2", + "prop-types-extra": "^1.1.0", + "react-overlays": "^5.1.2", + "react-transition-group": "^4.4.1", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, "node_modules/react-copy-to-clipboard": { "version": "5.0.4", "license": "MIT", @@ -15073,6 +15189,12 @@ "version": "17.0.2", "license": "MIT" }, + "node_modules/react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", + "peer": true + }, "node_modules/react-loading-skeleton": { "version": "3.1.0", "license": "MIT", @@ -15115,6 +15237,26 @@ "react-dom": "^15.5.x || ^16.x || ^17.x || ^18.x" } }, + "node_modules/react-overlays": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.2.1.tgz", + "integrity": "sha512-GLLSOLWr21CqtJn8geSwQfoJufdt3mfdsnIiQswouuQ2MMPns+ihZklxvsTDKD3cR2tF8ELbi5xUsvqVhR6WvA==", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.13.8", + "@popperjs/core": "^2.11.6", + "@restart/hooks": "^0.4.7", + "@types/warning": "^3.0.0", + "dom-helpers": "^5.2.0", + "prop-types": "^15.7.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + }, + "peerDependencies": { + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + } + }, "node_modules/react-papaparse": { "version": "3.18.2", "license": "MIT", @@ -17558,6 +17700,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/uncontrollable": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", + "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.6.3", + "@types/react": ">=16.9.11", + "invariant": "^2.2.4", + "react-lifecycles-compat": "^3.0.4" + }, + "peerDependencies": { + "react": ">=15.0.0" + } + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "dev": true, @@ -20598,7 +20755,15 @@ } }, "@popperjs/core": { - "version": "2.11.2" + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==" + }, + "@react-icons/all-files": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz", + "integrity": "sha512-hxBI2UOuVaI3O/BhQfhtb4kcGn9ft12RWAFVMUeNjqqhLsHvFtzIkFaptBJpFDANTKoDfdVoHTKZDlwKCACbMQ==", + "requires": {} }, "@reduxjs/toolkit": { "version": "1.8.0", @@ -20617,6 +20782,30 @@ } } }, + "@restart/context": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", + "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==", + "peer": true, + "requires": {} + }, + "@restart/hooks": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.11.tgz", + "integrity": "sha512-Ft/ncTULZN6ldGHiF/k5qt72O8JyRMOeg0tApvCni8LkoiEahO+z3TNxfXIVGy890YtWVDvJAl662dVJSJXvMw==", + "peer": true, + "requires": { + "dequal": "^2.0.3" + } + }, + "@rjsf/bootstrap-4": { + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.12.1.tgz", + "integrity": "sha512-aUnijxIlYWza8klJ+GvgoYk4gFSaQQV97LLdujMQY096iLm12ryxWLEjyLyPPNOymyp4kdkNO4FCTiWMs2bh3Q==", + "requires": { + "@react-icons/all-files": "^4.1.0" + } + }, "@rjsf/core": { "version": "5.12.1", "resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.12.1.tgz", @@ -20981,6 +21170,12 @@ "@types/node": "*" } }, + "@types/invariant": { + "version": "2.2.35", + "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.35.tgz", + "integrity": "sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==", + "peer": true + }, "@types/istanbul-lib-coverage": { "version": "2.0.4", "dev": true @@ -21130,6 +21325,12 @@ "@types/unist": { "version": "2.0.6" }, + "@types/warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz", + "integrity": "sha512-t/Tvs5qR47OLOr+4E9ckN8AmP2Tf16gWq+/qA4iUGS/OOyHVO8wv2vjJuX8SNOUTJyWb+2t7wJm6cXILFnOROA==", + "peer": true + }, "@types/ws": { "version": "8.5.2", "dev": true, @@ -22970,6 +23171,12 @@ "version": "1.1.2", "dev": true }, + "dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "peer": true + }, "desandro-matches-selector": { "version": "2.0.2" }, @@ -24714,7 +24921,6 @@ }, "invariant": { "version": "2.2.4", - "dev": true, "requires": { "loose-envify": "^1.0.0" } @@ -27707,6 +27913,24 @@ } } }, + "prop-types-extra": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz", + "integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==", + "peer": true, + "requires": { + "react-is": "^16.3.2", + "warning": "^4.0.0" + }, + "dependencies": { + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "peer": true + } + } + }, "property-information": { "version": "5.6.0", "requires": { @@ -27823,6 +28047,31 @@ "whatwg-fetch": "^3.4.1" } }, + "react-bootstrap": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.6.7.tgz", + "integrity": "sha512-IzCYXuLSKDEjGFglbFWk0/iHmdhdcJzTmtS6lXxc0kaNFx2PFgrQf5jKnx5sarF2tiXh9Tgx3pSt3pdK7YwkMA==", + "peer": true, + "requires": { + "@babel/runtime": "^7.14.0", + "@restart/context": "^2.1.4", + "@restart/hooks": "^0.4.7", + "@types/invariant": "^2.2.33", + "@types/prop-types": "^15.7.3", + "@types/react": ">=16.14.8", + "@types/react-transition-group": "^4.4.1", + "@types/warning": "^3.0.0", + "classnames": "^2.3.1", + "dom-helpers": "^5.2.1", + "invariant": "^2.2.4", + "prop-types": "^15.7.2", + "prop-types-extra": "^1.1.0", + "react-overlays": "^5.1.2", + "react-transition-group": "^4.4.1", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + } + }, "react-copy-to-clipboard": { "version": "5.0.4", "requires": { @@ -27973,6 +28222,12 @@ "react-is": { "version": "17.0.2" }, + "react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", + "peer": true + }, "react-loading-skeleton": { "version": "3.1.0", "requires": {} @@ -27998,6 +28253,22 @@ "integrity": "sha512-NMXGa223OnsrGVp5dJHkuKxQ4czdLmXSp5jSV9OqiCky9LOpPATn3vLldc+q5fK3gKbEHvr7J1u0yhBh/xYkpA==", "requires": {} }, + "react-overlays": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.2.1.tgz", + "integrity": "sha512-GLLSOLWr21CqtJn8geSwQfoJufdt3mfdsnIiQswouuQ2MMPns+ihZklxvsTDKD3cR2tF8ELbi5xUsvqVhR6WvA==", + "peer": true, + "requires": { + "@babel/runtime": "^7.13.8", + "@popperjs/core": "^2.11.6", + "@restart/hooks": "^0.4.7", + "@types/warning": "^3.0.0", + "dom-helpers": "^5.2.0", + "prop-types": "^15.7.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + } + }, "react-papaparse": { "version": "3.18.2", "requires": { @@ -29610,6 +29881,18 @@ "which-boxed-primitive": "^1.0.2" } }, + "uncontrollable": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", + "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==", + "peer": true, + "requires": { + "@babel/runtime": "^7.6.3", + "@types/react": ">=16.9.11", + "invariant": "^2.2.4", + "react-lifecycles-compat": "^3.0.4" + } + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "dev": true diff --git a/package.json b/package.json index ccb4c6383316..88f3735fcc05 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "@monaco-editor/react": "^4.5.2", "@popperjs/core": "^2.10.2", "@reduxjs/toolkit": "^1.7.0", + "@rjsf/bootstrap-4": "^5.12.1", "@rjsf/core": "^5.12.1", "@rjsf/utils": "^5.12.1", "@rjsf/validator-ajv8": "^5.12.1", diff --git a/src/data/BPAField.uischema.v1.json b/src/data/BPAField.uischema.v1.json index 5d88206bb0aa..bc36b81d44b2 100644 --- a/src/data/BPAField.uischema.v1.json +++ b/src/data/BPAField.uischema.v1.json @@ -20,7 +20,7 @@ "norender": false, "props": { "disabled": false, - "className": "btn mb-3 btn-primary" + "className": "btn btn-primary" } } } diff --git a/src/data/BPAReport.uischema.v1.json b/src/data/BPAReport.uischema.v1.json index f5d3db89270d..19e3c7d01237 100644 --- a/src/data/BPAReport.uischema.v1.json +++ b/src/data/BPAReport.uischema.v1.json @@ -20,8 +20,7 @@ ], "FrontendFields": { "ui:classNames": "card card-title p-4 my-4" - }, - "ui:classNames": "card card-title p-4 my-4" + } } }, "ui:submitButtonOptions": { diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index 39015265c675..a452eb1a6d4e 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -3,7 +3,7 @@ import { CippPage } from 'src/components/layout' import BPAReportSchema from 'src/data/BPAReport.schema.v1' import BPAReportUISchema from 'src/data/BPAReport.uischema.v1' import validator from '@rjsf/validator-ajv8' -import Form from '@rjsf/core' +import Form from '@rjsf/bootstrap-4' import { CippContentCard } from 'src/components/layout' import { CRow, CCol } from '@coreui/react' import Editor from '@monaco-editor/react' @@ -14,7 +14,6 @@ const CippTextWidget = (props) => { return ( props.onChange(event.target.value)} @@ -27,7 +26,6 @@ const CippSelectWidget = (props) => { props.onChange(event.target.value)} > {options.map(({ label, value }, idx) => ( @@ -48,7 +46,6 @@ const CippCheckboxWidget = (props) => { id={props.name} label={props.label} checked={props.value} - className="mb-3" onChange={(event) => { props.onChange(event.target.checked) }} From 7318fc36881122f63c2a58ca02040b7d3f2280c9 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Wed, 6 Sep 2023 23:48:23 +0200 Subject: [PATCH 10/29] added offcanvas and theming for code --- src/components/utilities/CippCodeOffcanvas.js | 60 +++++++++++++++++++ src/components/utilities/CippOffcanvas.js | 2 +- src/scss/_custom.scss | 8 ++- .../connectors/ListConnectorTemplates.js | 18 +++--- .../spamfilter/ListSpamfilterTemplates.js | 14 ++--- .../transport/ListTransportTemplates.js | 14 ++--- .../endpoint/intune/MEMListPolicyTemplates.js | 14 ++--- .../identity/administration/GroupTemplates.js | 14 ++--- .../tenant/conditional/ListCATemplates.js | 14 ++--- 9 files changed, 104 insertions(+), 54 deletions(-) create mode 100644 src/components/utilities/CippCodeOffcanvas.js diff --git a/src/components/utilities/CippCodeOffcanvas.js b/src/components/utilities/CippCodeOffcanvas.js new file mode 100644 index 000000000000..a36a23b8dae4 --- /dev/null +++ b/src/components/utilities/CippCodeOffcanvas.js @@ -0,0 +1,60 @@ +import React, { useState } from 'react' +import { CButton, CCallout, CCol, CRow, CSpinner } from '@coreui/react' +import { CippOffcanvas } from 'src/components/utilities' +import { useLazyGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 'src/store/api/app' + +import { Editor } from '@monaco-editor/react' +import { useSelector } from 'react-redux' + +function CippCodeOffCanvas({ row, state, hideFunction, type }) { + const [SaveTemplate, templateDetails] = useLazyGenericPostRequestQuery() + const currentTheme = useSelector((state) => state.app.currentTheme) + const [templateData, setFormData] = useState(row) + function handleEditorChange(value, event) { + setFormData(JSON.parse(value)) + } + return ( + <> + + + + + + SaveTemplate({ + path: `/api/ExecEditTemplate?type=${type}`, + method: 'POST', + values: templateData, + }) + } + > + Save changes {templateDetails.isFetching && } + + + + {templateDetails.isSuccess && !templateDetails.isFetching && ( + {templateDetails.data.Results} + )} + + + ) +} + +export default CippCodeOffCanvas diff --git a/src/components/utilities/CippOffcanvas.js b/src/components/utilities/CippOffcanvas.js index 7a6590eb57d1..3148f5992ecb 100644 --- a/src/components/utilities/CippOffcanvas.js +++ b/src/components/utilities/CippOffcanvas.js @@ -8,7 +8,7 @@ export default function CippOffcanvas(props) { return ( { const tenant = useSelector((state) => state.app.currentTenant) - const [ExecuteGetRequest, getResults] = useLazyGenericGetRequestQuery() const Offcanvas = (row, rowIndex, formatExtraData) => { const [ocVisible, setOCVisible] = useState(false) @@ -44,15 +45,12 @@ const ConnectorListTemplates = () => { - setOCVisible(false)} - > - - + /> ) } diff --git a/src/views/email-exchange/spamfilter/ListSpamfilterTemplates.js b/src/views/email-exchange/spamfilter/ListSpamfilterTemplates.js index 13afb7fa99a4..076a7879c423 100644 --- a/src/views/email-exchange/spamfilter/ListSpamfilterTemplates.js +++ b/src/views/email-exchange/spamfilter/ListSpamfilterTemplates.js @@ -9,6 +9,7 @@ import { useLazyGenericGetRequestQuery } from 'src/store/api/app' import { CippPageList } from 'src/components/layout' import { ModalService } from 'src/components/utilities' import { TitleButton } from 'src/components/buttons' +import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas' const SpamFilterListTemplates = () => { const tenant = useSelector((state) => state.app.currentTenant) @@ -44,15 +45,12 @@ const SpamFilterListTemplates = () => { - setOCVisible(false)} - > - - + /> ) } diff --git a/src/views/email-exchange/transport/ListTransportTemplates.js b/src/views/email-exchange/transport/ListTransportTemplates.js index 3a8cf38287bd..c0cfb1148979 100644 --- a/src/views/email-exchange/transport/ListTransportTemplates.js +++ b/src/views/email-exchange/transport/ListTransportTemplates.js @@ -9,6 +9,7 @@ import { useLazyGenericGetRequestQuery } from 'src/store/api/app' import { CippPageList } from 'src/components/layout' import { ModalService } from 'src/components/utilities' import { TitleButton } from 'src/components/buttons' +import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas' const TransportListTemplates = () => { const tenant = useSelector((state) => state.app.currentTenant) @@ -44,15 +45,12 @@ const TransportListTemplates = () => { - setOCVisible(false)} - > - - + /> ) } diff --git a/src/views/endpoint/intune/MEMListPolicyTemplates.js b/src/views/endpoint/intune/MEMListPolicyTemplates.js index 73324c19b7f1..645744383d56 100644 --- a/src/views/endpoint/intune/MEMListPolicyTemplates.js +++ b/src/views/endpoint/intune/MEMListPolicyTemplates.js @@ -16,6 +16,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { useLazyGenericGetRequestQuery } from 'src/store/api/app' import { CippPage } from 'src/components/layout' import { ModalService } from 'src/components/utilities' +import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas' //todo: expandable with RAWJson property. @@ -52,15 +53,12 @@ const AutopilotListTemplates = () => { > - setOCVisible(false)} - > - - + /> ) } diff --git a/src/views/identity/administration/GroupTemplates.js b/src/views/identity/administration/GroupTemplates.js index 67ce049e327c..590bf91cd3eb 100644 --- a/src/views/identity/administration/GroupTemplates.js +++ b/src/views/identity/administration/GroupTemplates.js @@ -9,6 +9,7 @@ import { useLazyGenericGetRequestQuery } from 'src/store/api/app' import { CippPageList } from 'src/components/layout' import { ModalService } from 'src/components/utilities' import { TitleButton } from 'src/components/buttons' +import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas' const GroupTemplates = () => { const tenant = useSelector((state) => state.app.currentTenant) @@ -43,15 +44,12 @@ const GroupTemplates = () => { > - setOCVisible(false)} - > - - + /> ) } diff --git a/src/views/tenant/conditional/ListCATemplates.js b/src/views/tenant/conditional/ListCATemplates.js index f19472d10587..835ed3fef2ff 100644 --- a/src/views/tenant/conditional/ListCATemplates.js +++ b/src/views/tenant/conditional/ListCATemplates.js @@ -17,6 +17,7 @@ import { useLazyGenericGetRequestQuery } from 'src/store/api/app' import { CippPage } from 'src/components/layout' import { ModalService } from 'src/components/utilities' import { CellTip } from 'src/components/tables' +import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas' //todo: expandable with RAWJson property. @@ -53,15 +54,12 @@ const AutopilotListTemplates = () => { > - setOCVisible(false)} - > - - + /> ) } From 46c7a4bba77bdd01617210291b56319aae4940ec Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Thu, 7 Sep 2023 00:18:00 +0200 Subject: [PATCH 11/29] added invalid json do not send marker --- src/components/utilities/CippCodeOffcanvas.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/utilities/CippCodeOffcanvas.js b/src/components/utilities/CippCodeOffcanvas.js index a36a23b8dae4..c8cdbf175d35 100644 --- a/src/components/utilities/CippCodeOffcanvas.js +++ b/src/components/utilities/CippCodeOffcanvas.js @@ -10,8 +10,15 @@ function CippCodeOffCanvas({ row, state, hideFunction, type }) { const [SaveTemplate, templateDetails] = useLazyGenericPostRequestQuery() const currentTheme = useSelector((state) => state.app.currentTheme) const [templateData, setFormData] = useState(row) + const [invalidJSON, setInvalid] = useState(false) + function handleEditorChange(value, event) { - setFormData(JSON.parse(value)) + try { + setFormData(JSON.parse(value)) + setInvalid(false) + } catch { + setInvalid(true) + } } return ( <> @@ -37,6 +44,7 @@ function CippCodeOffCanvas({ row, state, hideFunction, type }) { SaveTemplate({ path: `/api/ExecEditTemplate?type=${type}`, From 5563827e337df6aa6c709110602f65672f9a43bc Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Thu, 7 Sep 2023 11:08:34 +0200 Subject: [PATCH 12/29] added multi select to offboarding wizard --- src/views/identity/administration/OffboardingWizard.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/identity/administration/OffboardingWizard.js b/src/views/identity/administration/OffboardingWizard.js index 4e6318addf9d..58c425a52b2d 100644 --- a/src/views/identity/administration/OffboardingWizard.js +++ b/src/views/identity/administration/OffboardingWizard.js @@ -45,9 +45,9 @@ const OffboardingWizard = () => { TenantFilter: tenantDomain, OOO: values.OOO ? values.OOO : '', forward: values.forward ? values.forward.value : '', - OnedriveAccess: values.OnedriveAccess ? values.OnedriveAccess.value : '', - AccessNoAutomap: values.AccessNoAutomap ? values.AccessNoAutomap.value : '', - AccessAutomap: values.AccessAutomap ? values.AccessAutomap.value : '', + OnedriveAccess: values.OnedriveAccess ? values.OnedriveAccess : '', + AccessNoAutomap: values.AccessNoAutomap ? values.AccessNoAutomap : '', + AccessAutomap: values.AccessAutomap ? values.AccessAutomap : '', ConvertToShared: values.ConvertToShared, HideFromGAL: values.HideFromGAL, DisableSignIn: values.DisableSignIn, @@ -130,6 +130,7 @@ const OffboardingWizard = () => { x.mail) .map((user) => ({ @@ -143,6 +144,7 @@ const OffboardingWizard = () => { x.mail) .map((user) => ({ @@ -156,6 +158,7 @@ const OffboardingWizard = () => { x.mail) .map((user) => ({ From afadd686684f78df717e66cadd88fdd850d44d67 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Thu, 7 Sep 2023 12:57:22 +0200 Subject: [PATCH 13/29] improved search for tenant selector. --- src/components/utilities/CippFuzzySearch.js | 26 +++++++++++++++++++++ src/components/utilities/TenantSelector.js | 7 +++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 src/components/utilities/CippFuzzySearch.js diff --git a/src/components/utilities/CippFuzzySearch.js b/src/components/utilities/CippFuzzySearch.js new file mode 100644 index 000000000000..f4db1f1473cb --- /dev/null +++ b/src/components/utilities/CippFuzzySearch.js @@ -0,0 +1,26 @@ +var _fuse = _interopRequireDefault(require('fuse.js')) + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj } +} + +function CippfuzzySearch(options) { + var fuse = new _fuse['default'](options, { + keys: ['name', 'groupName', 'items.name'], + threshold: 0.2, + location: 0, + ignoreLocation: true, + useExtendedSearch: true, + }) + return function (value) { + if (!value.length) { + return options + } + + return fuse.search(value).map((_ref) => { + let { item } = _ref + return item + }) + } +} +export default CippfuzzySearch diff --git a/src/components/utilities/TenantSelector.js b/src/components/utilities/TenantSelector.js index 686fdd0727e4..570f2f30c002 100644 --- a/src/components/utilities/TenantSelector.js +++ b/src/components/utilities/TenantSelector.js @@ -10,6 +10,7 @@ import { queryString } from 'src/helpers' import { faBuilding } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import CippTenantOffcanvas from './CippTenantOffcanvas' +import CippfuzzySearch from './CippFuzzySearch' const TenantSelector = ({ action, showAllTenantSelector = true, NavSelector = false }) => { const currentTenant = useSelector((state) => state.app.currentTenant) @@ -95,13 +96,13 @@ const TenantSelector = ({ action, showAllTenantSelector = true, NavSelector = fa ({ value: customerId, - name: [displayName] + [` (${defaultDomainName})`], + name: `${displayName} (${defaultDomainName})`, }))} /> @@ -112,7 +113,7 @@ const TenantSelector = ({ action, showAllTenantSelector = true, NavSelector = fa Date: Thu, 7 Sep 2023 12:11:01 -0400 Subject: [PATCH 14/29] BPA Report Builder - Load/Publish - Add Load Existing Template - Add publish to GitHub button --- .../tenant/standards/BPAReportBuilder.js | 153 +++++++++++++++++- 1 file changed, 148 insertions(+), 5 deletions(-) diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index a452eb1a6d4e..52987e1dc3e5 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -1,14 +1,33 @@ -import React, { useState, useRef } from 'react' +import React, { useState, useEffect, useRef } from 'react' import { CippPage } from 'src/components/layout' import BPAReportSchema from 'src/data/BPAReport.schema.v1' import BPAReportUISchema from 'src/data/BPAReport.uischema.v1' import validator from '@rjsf/validator-ajv8' import Form from '@rjsf/bootstrap-4' import { CippContentCard } from 'src/components/layout' -import { CRow, CCol } from '@coreui/react' import Editor from '@monaco-editor/react' import { useSelector } from 'react-redux' -import { CFormInput, CFormSelect, CFormSwitch } from '@coreui/react' +import useQuery from 'src/hooks/useQuery' +import { + CFormInput, + CFormSelect, + CFormSwitch, + CRow, + CCol, + CCard, + CCardHeader, + CCardTitle, + CButton, + CCollapse, + CCardBody, + CForm, + CSpinner, + CFormLabel, + CTooltip, +} from '@coreui/react' +import { useGenericGetRequestQuery } from 'src/store/api/app' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import CopyToClipboard from 'react-copy-to-clipboard' const CippTextWidget = (props) => { return ( @@ -38,8 +57,6 @@ const CippSelectWidget = (props) => { } const CippCheckboxWidget = (props) => { - // not working yet - console.log(props) return ( { + let query = useQuery() + const [refreshValue, setRefreshValue] = useState('') + const Report = query.get('Report') + const [filename, setFilename] = useState() + const [visibleA, setVisibleA] = useState(true) + const { data: templates = [], isLoading: templatesfetch } = useGenericGetRequestQuery({ + path: 'api/listBPATemplates?RawJson=true&Refresh=' + refreshValue, + }) const [formData, setFormData] = useState(null) const editorRef = useRef(null) const currentTheme = useSelector((state) => state.app.currentTheme) + + function handleRefresh() { + setRefreshValue((Math.random() + 1).toString(36).substring(7)) + } + function handleEditorChange(value, event) { try { setFormData(JSON.parse(value)) @@ -69,12 +99,125 @@ const BPAReportBuilder = () => { setFormData({}) } } + const handleSubmit = async (event) => { + event.preventDefault() + var reportTemplate = event.target.form[0].value + setVisibleA(false) + if (reportTemplate !== 'New') { + var template = templates.filter(function (tpl) { + return tpl.name == reportTemplate + }) + setFormData(template[0]) + } else { + setFormData({}) + } + } + useEffect(() => { + var reportName = formData?.name ? formData?.name?.replace(/[\W]/g, '') : 'NewReport' + var newfilename = reportName + '.BPATemplate.json' + setFilename(newfilename) + }, [filename, formData]) + + const handlePublish = async (event) => { + event.preventDefault() + const data = new FormData(event.target) + const ghuser = data.get('GitHubUser') + const reportfilename = data.get('ReportFilename') + const report = JSON.stringify(formData, null, 2) + const url = + 'https://github.com/' + ghuser + '/CIPP-API/new/master/Config?filename=' + reportfilename + window.open(url, '_blank') + } + const options = { wordWrap: true, } return ( + + + + + + Report Settings + setVisibleA(!visibleA)}> + + + + + + + + + + + + Load Existing Report + + + {templates.map((template, idx) => ( + + ))} + + + {templatesfetch && } + + + + + + Load Report + + + + + + + + + + + + + GitHub Username/Org Name + + Report Filename + + + + + + + + + + Publish + + + + + + + + + + + + + +
From d9aa06d248e82b13bfc4e131d12c5d78e7927616 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 7 Sep 2023 12:36:54 -0400 Subject: [PATCH 15/29] Update BPAReportBuilder.js --- src/views/tenant/standards/BPAReportBuilder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index 52987e1dc3e5..46a4766bd25c 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -174,7 +174,7 @@ const BPAReportBuilder = () => { - + Load Report From 71945e1fe7ca315e39f2383374a6e3e0f4da58d6 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 7 Sep 2023 12:44:32 -0400 Subject: [PATCH 16/29] Add react-bootstrap --- package-lock.json | 310 +++++++++++++++++++++++++--------------------- package.json | 1 + 2 files changed, 173 insertions(+), 138 deletions(-) diff --git a/package-lock.json b/package-lock.json index acf2cd561d02..5af2243419af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,6 +42,7 @@ "prop-types": "^15.7.2", "react": "^17.0.2", "react-app-polyfill": "^2.0.0", + "react-bootstrap": "^2.8.0", "react-copy-to-clipboard": "^5.0.4", "react-data-table-component": "^7.4.5", "react-datepicker": "^4.10.0", @@ -1776,10 +1777,11 @@ } }, "node_modules/@babel/runtime": { - "version": "7.17.2", - "license": "MIT", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", + "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", "dependencies": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" @@ -1797,6 +1799,11 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/runtime/node_modules/regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, "node_modules/@babel/template": { "version": "7.16.7", "license": "MIT", @@ -3184,6 +3191,20 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@react-aria/ssr": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.7.1.tgz", + "integrity": "sha512-ovVPSD1WlRpZHt7GI9DqJrWG3OIYS+NXQ9y5HIewMJpSe+jPQmMQfyRmgX4EnvmxSlp0u04Wg/7oItcoSIb/RA==", + "dependencies": { + "@swc/helpers": "^0.5.0" + }, + "engines": { + "node": ">= 12" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" + } + }, "node_modules/@react-icons/all-files": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz", @@ -3221,20 +3242,10 @@ "@babel/runtime": "^7.9.2" } }, - "node_modules/@restart/context": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", - "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==", - "peer": true, - "peerDependencies": { - "react": ">=16.3.2" - } - }, "node_modules/@restart/hooks": { "version": "0.4.11", "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.11.tgz", "integrity": "sha512-Ft/ncTULZN6ldGHiF/k5qt72O8JyRMOeg0tApvCni8LkoiEahO+z3TNxfXIVGy890YtWVDvJAl662dVJSJXvMw==", - "peer": true, "dependencies": { "dequal": "^2.0.3" }, @@ -3242,6 +3253,34 @@ "react": ">=16.8.0" } }, + "node_modules/@restart/ui": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.6.6.tgz", + "integrity": "sha512-eC3puKuWE1SRYbojWHXnvCNHGgf3uzHCb6JOhnF4OXPibOIPEkR1sqDSkL643ydigxwh+ruCa1CmYHlzk7ikKA==", + "dependencies": { + "@babel/runtime": "^7.21.0", + "@popperjs/core": "^2.11.6", + "@react-aria/ssr": "^3.5.0", + "@restart/hooks": "^0.4.9", + "@types/warning": "^3.0.0", + "dequal": "^2.0.3", + "dom-helpers": "^5.2.0", + "uncontrollable": "^8.0.1", + "warning": "^4.0.3" + }, + "peerDependencies": { + "react": ">=16.14.0", + "react-dom": ">=16.14.0" + } + }, + "node_modules/@restart/ui/node_modules/uncontrollable": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-8.0.4.tgz", + "integrity": "sha512-ulRWYWHvscPFc0QQXvyJjY6LIXU56f0h8pQFvhxiKk5V1fcI8gp9Ht9leVAhrVjzqMw0BgjspBINx9r6oyJUvQ==", + "peerDependencies": { + "react": ">=16.14.0" + } + }, "node_modules/@rjsf/bootstrap-4": { "version": "5.12.1", "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.12.1.tgz", @@ -3651,6 +3690,14 @@ "url": "https://github.com/sponsors/gregberge" } }, + "node_modules/@swc/helpers": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", + "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@tootallnate/once": { "version": "1.1.2", "dev": true, @@ -3815,12 +3862,6 @@ "@types/node": "*" } }, - "node_modules/@types/invariant": { - "version": "2.2.35", - "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.35.tgz", - "integrity": "sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==", - "peer": true - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "dev": true, @@ -3938,8 +3979,9 @@ } }, "node_modules/@types/react-transition-group": { - "version": "4.4.4", - "license": "MIT", + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.6.tgz", + "integrity": "sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==", "dependencies": { "@types/react": "*" } @@ -4003,8 +4045,7 @@ "node_modules/@types/warning": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz", - "integrity": "sha512-t/Tvs5qR47OLOr+4E9ckN8AmP2Tf16gWq+/qA4iUGS/OOyHVO8wv2vjJuX8SNOUTJyWb+2t7wJm6cXILFnOROA==", - "peer": true + "integrity": "sha512-t/Tvs5qR47OLOr+4E9ckN8AmP2Tf16gWq+/qA4iUGS/OOyHVO8wv2vjJuX8SNOUTJyWb+2t7wJm6cXILFnOROA==" }, "node_modules/@types/ws": { "version": "8.5.2", @@ -6069,8 +6110,9 @@ "license": "MIT" }, "node_modules/classnames": { - "version": "2.3.1", - "license": "MIT" + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" }, "node_modules/clean-css": { "version": "5.2.4", @@ -7004,7 +7046,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "peer": true, "engines": { "node": ">=6" } @@ -14715,7 +14756,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz", "integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==", - "peer": true, "dependencies": { "react-is": "^16.3.2", "warning": "^4.0.0" @@ -14727,8 +14767,7 @@ "node_modules/prop-types-extra/node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "peer": true + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/prop-types/node_modules/react-is": { "version": "16.13.1", @@ -14927,32 +14966,32 @@ } }, "node_modules/react-bootstrap": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.6.7.tgz", - "integrity": "sha512-IzCYXuLSKDEjGFglbFWk0/iHmdhdcJzTmtS6lXxc0kaNFx2PFgrQf5jKnx5sarF2tiXh9Tgx3pSt3pdK7YwkMA==", - "peer": true, - "dependencies": { - "@babel/runtime": "^7.14.0", - "@restart/context": "^2.1.4", - "@restart/hooks": "^0.4.7", - "@types/invariant": "^2.2.33", - "@types/prop-types": "^15.7.3", - "@types/react": ">=16.14.8", - "@types/react-transition-group": "^4.4.1", - "@types/warning": "^3.0.0", - "classnames": "^2.3.1", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.8.0.tgz", + "integrity": "sha512-e/aNtxl0Z2ozrIaR82jr6Zz7ss9GSoaXpQaxmvtDUsTZIq/XalkduR/ZXP6vbQHz2T4syvjA+4FbtwELxxmpww==", + "dependencies": { + "@babel/runtime": "^7.21.0", + "@restart/hooks": "^0.4.9", + "@restart/ui": "^1.6.3", + "@types/react-transition-group": "^4.4.5", + "classnames": "^2.3.2", "dom-helpers": "^5.2.1", "invariant": "^2.2.4", - "prop-types": "^15.7.2", + "prop-types": "^15.8.1", "prop-types-extra": "^1.1.0", - "react-overlays": "^5.1.2", - "react-transition-group": "^4.4.1", + "react-transition-group": "^4.4.5", "uncontrollable": "^7.2.1", "warning": "^4.0.3" }, "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" + "@types/react": ">=16.14.8", + "react": ">=16.14.0", + "react-dom": ">=16.14.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, "node_modules/react-copy-to-clipboard": { @@ -15192,8 +15231,7 @@ "node_modules/react-lifecycles-compat": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", - "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", - "peer": true + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" }, "node_modules/react-loading-skeleton": { "version": "3.1.0", @@ -15237,26 +15275,6 @@ "react-dom": "^15.5.x || ^16.x || ^17.x || ^18.x" } }, - "node_modules/react-overlays": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.2.1.tgz", - "integrity": "sha512-GLLSOLWr21CqtJn8geSwQfoJufdt3mfdsnIiQswouuQ2MMPns+ihZklxvsTDKD3cR2tF8ELbi5xUsvqVhR6WvA==", - "peer": true, - "dependencies": { - "@babel/runtime": "^7.13.8", - "@popperjs/core": "^2.11.6", - "@restart/hooks": "^0.4.7", - "@types/warning": "^3.0.0", - "dom-helpers": "^5.2.0", - "prop-types": "^15.7.2", - "uncontrollable": "^7.2.1", - "warning": "^4.0.3" - }, - "peerDependencies": { - "react": ">=16.3.0", - "react-dom": ">=16.3.0" - } - }, "node_modules/react-papaparse": { "version": "3.18.2", "license": "MIT", @@ -15534,8 +15552,9 @@ "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" }, "node_modules/react-transition-group": { - "version": "4.4.2", - "license": "BSD-3-Clause", + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", "dependencies": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", @@ -17590,8 +17609,9 @@ } }, "node_modules/tslib": { - "version": "2.3.1", - "license": "0BSD" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -17704,7 +17724,6 @@ "version": "7.2.1", "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==", - "peer": true, "dependencies": { "@babel/runtime": "^7.6.3", "@types/react": ">=16.9.11", @@ -19860,9 +19879,18 @@ } }, "@babel/runtime": { - "version": "7.17.2", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", + "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", "requires": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + } } }, "@babel/runtime-corejs3": { @@ -20759,6 +20787,14 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==" }, + "@react-aria/ssr": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.7.1.tgz", + "integrity": "sha512-ovVPSD1WlRpZHt7GI9DqJrWG3OIYS+NXQ9y5HIewMJpSe+jPQmMQfyRmgX4EnvmxSlp0u04Wg/7oItcoSIb/RA==", + "requires": { + "@swc/helpers": "^0.5.0" + } + }, "@react-icons/all-files": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz", @@ -20782,22 +20818,38 @@ } } }, - "@restart/context": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", - "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==", - "peer": true, - "requires": {} - }, "@restart/hooks": { "version": "0.4.11", "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.11.tgz", "integrity": "sha512-Ft/ncTULZN6ldGHiF/k5qt72O8JyRMOeg0tApvCni8LkoiEahO+z3TNxfXIVGy890YtWVDvJAl662dVJSJXvMw==", - "peer": true, "requires": { "dequal": "^2.0.3" } }, + "@restart/ui": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.6.6.tgz", + "integrity": "sha512-eC3puKuWE1SRYbojWHXnvCNHGgf3uzHCb6JOhnF4OXPibOIPEkR1sqDSkL643ydigxwh+ruCa1CmYHlzk7ikKA==", + "requires": { + "@babel/runtime": "^7.21.0", + "@popperjs/core": "^2.11.6", + "@react-aria/ssr": "^3.5.0", + "@restart/hooks": "^0.4.9", + "@types/warning": "^3.0.0", + "dequal": "^2.0.3", + "dom-helpers": "^5.2.0", + "uncontrollable": "^8.0.1", + "warning": "^4.0.3" + }, + "dependencies": { + "uncontrollable": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-8.0.4.tgz", + "integrity": "sha512-ulRWYWHvscPFc0QQXvyJjY6LIXU56f0h8pQFvhxiKk5V1fcI8gp9Ht9leVAhrVjzqMw0BgjspBINx9r6oyJUvQ==", + "requires": {} + } + } + }, "@rjsf/bootstrap-4": { "version": "5.12.1", "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.12.1.tgz", @@ -21032,6 +21084,14 @@ "loader-utils": "^2.0.0" } }, + "@swc/helpers": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", + "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", + "requires": { + "tslib": "^2.4.0" + } + }, "@tootallnate/once": { "version": "1.1.2", "dev": true @@ -21170,12 +21230,6 @@ "@types/node": "*" } }, - "@types/invariant": { - "version": "2.2.35", - "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.35.tgz", - "integrity": "sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==", - "peer": true - }, "@types/istanbul-lib-coverage": { "version": "2.0.4", "dev": true @@ -21273,7 +21327,9 @@ } }, "@types/react-transition-group": { - "version": "4.4.4", + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.6.tgz", + "integrity": "sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==", "requires": { "@types/react": "*" } @@ -21328,8 +21384,7 @@ "@types/warning": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz", - "integrity": "sha512-t/Tvs5qR47OLOr+4E9ckN8AmP2Tf16gWq+/qA4iUGS/OOyHVO8wv2vjJuX8SNOUTJyWb+2t7wJm6cXILFnOROA==", - "peer": true + "integrity": "sha512-t/Tvs5qR47OLOr+4E9ckN8AmP2Tf16gWq+/qA4iUGS/OOyHVO8wv2vjJuX8SNOUTJyWb+2t7wJm6cXILFnOROA==" }, "@types/ws": { "version": "8.5.2", @@ -22584,7 +22639,9 @@ "dev": true }, "classnames": { - "version": "2.3.1" + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" }, "clean-css": { "version": "5.2.4", @@ -23174,8 +23231,7 @@ "dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "peer": true + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==" }, "desandro-matches-selector": { "version": "2.0.2" @@ -27917,7 +27973,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz", "integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==", - "peer": true, "requires": { "react-is": "^16.3.2", "warning": "^4.0.0" @@ -27926,8 +27981,7 @@ "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "peer": true + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" } } }, @@ -28048,26 +28102,20 @@ } }, "react-bootstrap": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.6.7.tgz", - "integrity": "sha512-IzCYXuLSKDEjGFglbFWk0/iHmdhdcJzTmtS6lXxc0kaNFx2PFgrQf5jKnx5sarF2tiXh9Tgx3pSt3pdK7YwkMA==", - "peer": true, - "requires": { - "@babel/runtime": "^7.14.0", - "@restart/context": "^2.1.4", - "@restart/hooks": "^0.4.7", - "@types/invariant": "^2.2.33", - "@types/prop-types": "^15.7.3", - "@types/react": ">=16.14.8", - "@types/react-transition-group": "^4.4.1", - "@types/warning": "^3.0.0", - "classnames": "^2.3.1", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.8.0.tgz", + "integrity": "sha512-e/aNtxl0Z2ozrIaR82jr6Zz7ss9GSoaXpQaxmvtDUsTZIq/XalkduR/ZXP6vbQHz2T4syvjA+4FbtwELxxmpww==", + "requires": { + "@babel/runtime": "^7.21.0", + "@restart/hooks": "^0.4.9", + "@restart/ui": "^1.6.3", + "@types/react-transition-group": "^4.4.5", + "classnames": "^2.3.2", "dom-helpers": "^5.2.1", "invariant": "^2.2.4", - "prop-types": "^15.7.2", + "prop-types": "^15.8.1", "prop-types-extra": "^1.1.0", - "react-overlays": "^5.1.2", - "react-transition-group": "^4.4.1", + "react-transition-group": "^4.4.5", "uncontrollable": "^7.2.1", "warning": "^4.0.3" } @@ -28225,8 +28273,7 @@ "react-lifecycles-compat": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", - "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", - "peer": true + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" }, "react-loading-skeleton": { "version": "3.1.0", @@ -28253,22 +28300,6 @@ "integrity": "sha512-NMXGa223OnsrGVp5dJHkuKxQ4czdLmXSp5jSV9OqiCky9LOpPATn3vLldc+q5fK3gKbEHvr7J1u0yhBh/xYkpA==", "requires": {} }, - "react-overlays": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.2.1.tgz", - "integrity": "sha512-GLLSOLWr21CqtJn8geSwQfoJufdt3mfdsnIiQswouuQ2MMPns+ihZklxvsTDKD3cR2tF8ELbi5xUsvqVhR6WvA==", - "peer": true, - "requires": { - "@babel/runtime": "^7.13.8", - "@popperjs/core": "^2.11.6", - "@restart/hooks": "^0.4.7", - "@types/warning": "^3.0.0", - "dom-helpers": "^5.2.0", - "prop-types": "^15.7.2", - "uncontrollable": "^7.2.1", - "warning": "^4.0.3" - } - }, "react-papaparse": { "version": "3.18.2", "requires": { @@ -28456,7 +28487,9 @@ } }, "react-transition-group": { - "version": "4.4.2", + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", "requires": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", @@ -29817,7 +29850,9 @@ } }, "tslib": { - "version": "2.3.1" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "tsutils": { "version": "3.21.0", @@ -29885,7 +29920,6 @@ "version": "7.2.1", "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==", - "peer": true, "requires": { "@babel/runtime": "^7.6.3", "@types/react": ">=16.9.11", diff --git a/package.json b/package.json index 88f3735fcc05..3a1b4acfb7c6 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "prop-types": "^15.7.2", "react": "^17.0.2", "react-app-polyfill": "^2.0.0", + "react-bootstrap": "^2.8.0", "react-copy-to-clipboard": "^5.0.4", "react-data-table-component": "^7.4.5", "react-datepicker": "^4.10.0", From 3b067433e399d00cdb32f5d95c39a98fefdf585c Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Fri, 8 Sep 2023 01:06:37 +0200 Subject: [PATCH 17/29] sharepoint url stuff --- src/views/identity/administration/Users.js | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/views/identity/administration/Users.js b/src/views/identity/administration/Users.js index da5db287e270..415274ae6406 100644 --- a/src/views/identity/administration/Users.js +++ b/src/views/identity/administration/Users.js @@ -113,6 +113,21 @@ const Offcanvas = (row, rowIndex, formatExtraData) => { modalUrl: `/api/ExecConvertToSharedMailbox?TenantFilter=${tenant.defaultDomainName}&ID=${row.userPrincipalName}`, modalMessage: 'Are you sure you want to convert this user to a shared mailbox?', }, + { + label: 'Add OneDrive Shortcut', + color: 'info', + modal: true, + modalType: 'POST', + modalBody: { + username: row.userPrincipalName, + userid: row.id, + TenantFilter: tenant.defaultDomainName, + message: row.message, + }, + modalUrl: `/api/ExecOneDriveShortCut`, + modalInput: true, + modalMessage: 'Enter a SharePoint URL to create a OneDrive shortcut for', + }, { label: 'Enable Online Archive', color: 'info', @@ -416,6 +431,21 @@ const Users = (row) => { modalUrl: `/api/ExecRevokeSessions?Enable=true&TenantFilter=!Tenant&ID=!userPrincipalName`, modalMessage: 'Are you sure you want to revoke all sessions for these users?', }, + { + label: 'Create OneDrive Shortcut', + color: 'info', + modal: true, + modalType: 'POST', + modalBody: { + username: '!userPrincipalName', + userid: '!id', + TenantFilter: tenant.defaultDomainName, + }, + modalUrl: `/api/ExecOneDriveShortCut`, + modalInput: true, + modalMessage: + 'Enter a SharePoint URL to create a OneDrive shortcut for and press continue.', + }, { label: 'Set Out of Office', color: 'info', From b0bb32ff353d7c415d6ec275648be2ea3fb7d11f Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 7 Sep 2023 20:00:44 -0400 Subject: [PATCH 18/29] Add stretched-link to collapses --- src/views/cipp/AppApproval.js | 7 ++++++- src/views/cipp/Logs.js | 7 ++++++- src/views/email-exchange/reports/MessageTrace.js | 7 ++++++- src/views/identity/reports/SignIns.js | 7 ++++++- src/views/tenant/administration/GraphExplorer.js | 7 ++++++- src/views/tenant/standards/BPAReportBuilder.js | 9 +++++++-- src/views/tenant/standards/BestPracticeAnalyser.js | 7 ++++++- 7 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/views/cipp/AppApproval.js b/src/views/cipp/AppApproval.js index 9c957db0707b..4c2752163e6b 100644 --- a/src/views/cipp/AppApproval.js +++ b/src/views/cipp/AppApproval.js @@ -112,7 +112,12 @@ const GraphExplorer = () => { Approval Settings - setVisibleA(!visibleA)}> + setVisibleA(!visibleA)} + > diff --git a/src/views/cipp/Logs.js b/src/views/cipp/Logs.js index e7733a152fff..6371ffef2a45 100644 --- a/src/views/cipp/Logs.js +++ b/src/views/cipp/Logs.js @@ -126,7 +126,12 @@ const Logs = () => { Logbook Settings - setVisibleA(!visibleA)}> + setVisibleA(!visibleA)} + > diff --git a/src/views/email-exchange/reports/MessageTrace.js b/src/views/email-exchange/reports/MessageTrace.js index c3ef99d51d4f..6eab5824f3f6 100644 --- a/src/views/email-exchange/reports/MessageTrace.js +++ b/src/views/email-exchange/reports/MessageTrace.js @@ -95,7 +95,12 @@ const MessageTrace = () => { Message Trace Settings - setVisibleA(!visibleA)}> + setVisibleA(!visibleA)} + > diff --git a/src/views/identity/reports/SignIns.js b/src/views/identity/reports/SignIns.js index 7e6ec7fe2488..926fe7570c9c 100644 --- a/src/views/identity/reports/SignIns.js +++ b/src/views/identity/reports/SignIns.js @@ -129,7 +129,12 @@ const SignInsReport = () => { Sign In log Settings - setVisibleA(!visibleA)}> + setVisibleA(!visibleA)} + > diff --git a/src/views/tenant/administration/GraphExplorer.js b/src/views/tenant/administration/GraphExplorer.js index 55d6c11c7af4..9c02146e679a 100644 --- a/src/views/tenant/administration/GraphExplorer.js +++ b/src/views/tenant/administration/GraphExplorer.js @@ -109,7 +109,12 @@ const GraphExplorer = () => { Report Settings - setVisibleA(!visibleA)}> + setVisibleA(!visibleA)} + > diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index 46a4766bd25c..a16ac2ca7a3a 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -141,7 +141,12 @@ const BPAReportBuilder = () => { Report Settings - setVisibleA(!visibleA)}> + setVisibleA(!visibleA)} + > @@ -174,7 +179,7 @@ const BPAReportBuilder = () => { - + Load Report diff --git a/src/views/tenant/standards/BestPracticeAnalyser.js b/src/views/tenant/standards/BestPracticeAnalyser.js index 025095e1a48c..086e53f2e925 100644 --- a/src/views/tenant/standards/BestPracticeAnalyser.js +++ b/src/views/tenant/standards/BestPracticeAnalyser.js @@ -226,7 +226,12 @@ const BestPracticeAnalyser = () => { Report Settings - setVisibleA(!visibleA)}> + setVisibleA(!visibleA)} + > From 0be3128a13549441a81a3a037c2f66ea9bf8934d Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 7 Sep 2023 20:11:41 -0400 Subject: [PATCH 19/29] Update BPAReportBuilder.js --- src/views/tenant/standards/BPAReportBuilder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index a16ac2ca7a3a..e837cb8715ce 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -179,7 +179,7 @@ const BPAReportBuilder = () => { - + Load Report From e6602ed3ea4eb830179d75ea8bafaf1ee68fba90 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 7 Sep 2023 20:34:06 -0400 Subject: [PATCH 20/29] Fix clickable areas --- src/views/cipp/AppApproval.js | 9 ++++++--- src/views/cipp/Logs.js | 9 ++++++--- src/views/email-exchange/reports/MessageTrace.js | 9 ++++++--- src/views/identity/reports/SignIns.js | 11 +++++++---- src/views/tenant/administration/GraphExplorer.js | 9 ++++++--- src/views/tenant/standards/BPAReportBuilder.js | 9 ++++++--- src/views/tenant/standards/BestPracticeAnalyser.js | 9 ++++++--- 7 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/views/cipp/AppApproval.js b/src/views/cipp/AppApproval.js index 4c2752163e6b..66d88991a92b 100644 --- a/src/views/cipp/AppApproval.js +++ b/src/views/cipp/AppApproval.js @@ -122,7 +122,10 @@ const GraphExplorer = () => { - + + + + { }} /> - - + +
diff --git a/src/views/cipp/Logs.js b/src/views/cipp/Logs.js index 6371ffef2a45..b1e93e85d8c8 100644 --- a/src/views/cipp/Logs.js +++ b/src/views/cipp/Logs.js @@ -136,7 +136,10 @@ const Logs = () => {
- + + + + { }} /> - - + +

diff --git a/src/views/email-exchange/reports/MessageTrace.js b/src/views/email-exchange/reports/MessageTrace.js index 6eab5824f3f6..253aa6821beb 100644 --- a/src/views/email-exchange/reports/MessageTrace.js +++ b/src/views/email-exchange/reports/MessageTrace.js @@ -105,7 +105,10 @@ const MessageTrace = () => {
- + + + + { }} /> - - + +

diff --git a/src/views/identity/reports/SignIns.js b/src/views/identity/reports/SignIns.js index 926fe7570c9c..aea60797072b 100644 --- a/src/views/identity/reports/SignIns.js +++ b/src/views/identity/reports/SignIns.js @@ -125,7 +125,7 @@ const SignInsReport = () => { <> - + Sign In log Settings @@ -139,7 +139,10 @@ const SignInsReport = () => { - + + + + { }} /> - - + +
diff --git a/src/views/tenant/administration/GraphExplorer.js b/src/views/tenant/administration/GraphExplorer.js index 9c02146e679a..4bb325b4f0ff 100644 --- a/src/views/tenant/administration/GraphExplorer.js +++ b/src/views/tenant/administration/GraphExplorer.js @@ -119,7 +119,10 @@ const GraphExplorer = () => { - + + + + { }} /> - - + +
diff --git a/src/views/tenant/standards/BPAReportBuilder.js b/src/views/tenant/standards/BPAReportBuilder.js index e837cb8715ce..b649a86556d6 100644 --- a/src/views/tenant/standards/BPAReportBuilder.js +++ b/src/views/tenant/standards/BPAReportBuilder.js @@ -151,7 +151,10 @@ const BPAReportBuilder = () => { - + + + + @@ -218,8 +221,8 @@ const BPAReportBuilder = () => { - - + +
diff --git a/src/views/tenant/standards/BestPracticeAnalyser.js b/src/views/tenant/standards/BestPracticeAnalyser.js index 086e53f2e925..a18f42909746 100644 --- a/src/views/tenant/standards/BestPracticeAnalyser.js +++ b/src/views/tenant/standards/BestPracticeAnalyser.js @@ -236,7 +236,10 @@ const BestPracticeAnalyser = () => { - + + + + { }} /> - - + +
From 495193468e76ac482c8e9809f5f427a166752a5d Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Fri, 8 Sep 2023 15:41:58 +0200 Subject: [PATCH 21/29] added dropdown to OffCanvas buttons. --- .../utilities/CippActionsOffcanvas.js | 75 +++++++++++++++++-- src/views/identity/administration/Users.js | 8 +- 2 files changed, 76 insertions(+), 7 deletions(-) diff --git a/src/components/utilities/CippActionsOffcanvas.js b/src/components/utilities/CippActionsOffcanvas.js index 1bcf1773251f..371276f49375 100644 --- a/src/components/utilities/CippActionsOffcanvas.js +++ b/src/components/utilities/CippActionsOffcanvas.js @@ -8,6 +8,7 @@ import { CCardText, CCardTitle, CFormInput, + CFormSelect, CListGroup, CListGroupItem, COffcanvasTitle, @@ -20,17 +21,60 @@ import { useLazyGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 's import { Link, useNavigate } from 'react-router-dom' import { stringCamelCase } from 'src/components/utilities/CippCamelCase' import ReactTimeAgo from 'react-time-ago' +import { useEffect } from 'react' +import { useState } from 'react' export default function CippActionsOffcanvas(props) { const inputRef = useRef('') const [genericGetRequest, getResults] = useLazyGenericGetRequestQuery() const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() + const [getDrowndownInfo, dropDownInfo] = useLazyGenericGetRequestQuery() + const [modalContent, setModalContent] = useState(null) + + useEffect(() => { + if (dropDownInfo.isFetching) { + handleModal( + , + modalContent.modalUrl, + modalContent.modalType, + modalContent.modalBody, + modalContent.modalInput, + modalContent.modalDropdown, + ) + } + if (dropDownInfo.isSuccess) { + handleModal( + modalContent.modalMessage, + modalContent.modalUrl, + modalContent.modalType, + modalContent.modalBody, + modalContent.modalInput, + modalContent.modalDropdown, + ) + } else if (dropDownInfo.isError) { + handleModal( + 'Error connecting to the API.', + modalContent.modalUrl, + modalContent.modalType, + modalContent.modalBody, + modalContent.modalInput, + modalContent.modalDropdown, + ) + } + }, [dropDownInfo]) const handleLink = useNavigate() const handleExternalLink = (link) => { window.open(link, '_blank') } - const handleModal = (modalMessage, modalUrl, modalType = 'GET', modalBody, modalInput) => { + const handleModal = ( + modalMessage, + modalUrl, + modalType = 'GET', + modalBody, + modalInput, + modalDropdown, + ) => { if (modalType === 'GET') { ModalService.confirm({ body: ( @@ -43,6 +87,7 @@ export default function CippActionsOffcanvas(props) { }) } else { ModalService.confirm({ + key: modalContent, body: (
{modalInput && ( @@ -50,6 +95,19 @@ export default function CippActionsOffcanvas(props) {
)} + {modalDropdown && ( +
+ {dropDownInfo.isSuccess && ( + ({ + value: data[modalDropdown.valueField], + label: data[modalDropdown.labelField], + }))} + /> + )} +
+ )}
{modalMessage}
), @@ -72,6 +130,7 @@ export default function CippActionsOffcanvas(props) { modalType, modalBody, modalInput, + modalDropdown, ) => { if (link) { if (external) { @@ -80,7 +139,12 @@ export default function CippActionsOffcanvas(props) { handleLink(link) } } else if (modal) { - handleModal(modalMessage, modalUrl, modalType, modalBody, modalInput) + if (modalDropdown) { + getDrowndownInfo({ path: modalDropdown.url }) + } + setModalContent({ modalMessage, modalUrl, modalType, modalBody, modalInput, modalDropdown }) + + handleModal(modalMessage, modalUrl, modalType, modalBody, modalInput, modalDropdown) } } @@ -112,9 +176,7 @@ export default function CippActionsOffcanvas(props) { )) - } catch (error) { - console.error('An error occurred building OCanvas actions' + error.toString()) - } + } catch (error) {} const extendedInfoContent = let actionsContent @@ -134,6 +196,7 @@ export default function CippActionsOffcanvas(props) { action.modalType, action.modalBody, action.modalInput, + action.modalDropdown, ) } key={index} @@ -232,6 +295,7 @@ const CippActionsOffcanvasPropTypes = { modal: PropTypes.bool, modalUrl: PropTypes.string, modalBody: PropTypes.object, + modalDropdown: PropTypes.object, modalType: PropTypes.string, modalInput: PropTypes.bool, modalMessage: PropTypes.string, @@ -252,6 +316,7 @@ const CippActionsOffcanvasPropTypes = { modalType: PropTypes.string, modalInput: PropTypes.bool, modalMessage: PropTypes.string, + modalDropdown: PropTypes.object, external: PropTypes.bool, }), ), diff --git a/src/views/identity/administration/Users.js b/src/views/identity/administration/Users.js index 415274ae6406..4dac8d415cf2 100644 --- a/src/views/identity/administration/Users.js +++ b/src/views/identity/administration/Users.js @@ -125,8 +125,12 @@ const Offcanvas = (row, rowIndex, formatExtraData) => { message: row.message, }, modalUrl: `/api/ExecOneDriveShortCut`, - modalInput: true, - modalMessage: 'Enter a SharePoint URL to create a OneDrive shortcut for', + modalDropdown: { + url: `/api/listSites?TenantFilter=${tenant.defaultDomainName}&type=SharePointSiteUsage`, + labelField: 'URL', + valueField: 'URL', + }, + modalMessage: 'Select the sharepoint site to create a shortcut for', }, { label: 'Enable Online Archive', From 817eaf67d29028bb2fd5174f4542ffa267e2694f Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Fri, 8 Sep 2023 16:00:37 +0200 Subject: [PATCH 22/29] added dropdown to other locations too --- src/components/tables/CippTable.js | 210 ++++++++++++++------- src/views/identity/administration/Users.js | 8 +- 2 files changed, 146 insertions(+), 72 deletions(-) diff --git a/src/components/tables/CippTable.js b/src/components/tables/CippTable.js index 4cdad5b0c56f..fa11d257ea78 100644 --- a/src/components/tables/CippTable.js +++ b/src/components/tables/CippTable.js @@ -14,6 +14,7 @@ import { CModalBody, CModalTitle, CCallout, + CFormSelect, } from '@coreui/react' import DataTable, { createTheme } from 'react-data-table-component' import PropTypes from 'prop-types' @@ -24,6 +25,7 @@ import { cellGenericFormatter } from './CellGenericFormat' import { ModalService } from '../utilities' import { useLazyGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 'src/store/api/app' import { ConfirmModal } from '../utilities/SharedModal' +import { useState } from 'react' const FilterComponent = ({ filterText, @@ -156,6 +158,40 @@ export default function CippTable({ const [selectedRows, setSelectedRows] = React.useState(false) const [genericGetRequest, getResults] = useLazyGenericGetRequestQuery() const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() + const [getDrowndownInfo, dropDownInfo] = useLazyGenericGetRequestQuery() + const [modalContent, setModalContent] = useState(null) + useEffect(() => { + if (dropDownInfo.isFetching) { + handleModal( + , + modalContent.item.modalUrl, + modalContent.item.modalType, + modalContent.item.modalBody, + modalContent.item.modalInput, + modalContent.item.modalDropdown, + ) + } + if (dropDownInfo.isSuccess) { + console.log(modalContent) + handleModal( + modalContent.item.modalMessage, + modalContent.item.modalUrl, + modalContent.item.modalType, + modalContent.item.modalBody, + modalContent.item.modalInput, + modalContent.item.modalDropdown, + ) + } else if (dropDownInfo.isError) { + handleModal( + 'Error connecting to the API.', + modalContent.item.modalUrl, + modalContent.item.modalType, + modalContent.item.modalBody, + modalContent.item.modalInput, + modalContent.item.modalDropdown, + ) + } + }, [dropDownInfo]) const handleSelectedChange = ({ selectedRows }) => { setSelectedRows(selectedRows) if (selectedRows.length < 1) { @@ -229,84 +265,118 @@ export default function CippTable({ }, }, } - const subHeaderComponentMemo = React.useMemo(() => { - const handleClear = () => { - if (filterText) { - setResetPaginationToggle(!resetPaginationToggle) - setFilterText('') - } - } - const handleModal = (modalMessage, modalUrl, modalType = 'GET', modalBody, modalInput) => { - if (modalType === 'GET') { - ModalService.confirm({ - body: ( -
-
{modalMessage}
-
- ), - title: 'Confirm', - onConfirm: async () => { - const resultsarr = [] - for (const row of selectedRows) { - setLoopRunning(true) - const urlParams = new URLSearchParams(modalUrl.split('?')[1]) - for (let [paramName, paramValue] of urlParams.entries()) { - if (paramValue.startsWith('!')) { - urlParams.set(paramName, row[paramValue.replace('!', '')]) - } + const handleModal = ( + modalMessage, + modalUrl, + modalType = 'GET', + modalBody, + modalInput, + modalDropdown, + ) => { + if (modalType === 'GET') { + ModalService.confirm({ + body: ( +
+
{modalMessage}
+
+ ), + title: 'Confirm', + onConfirm: async () => { + const resultsarr = [] + for (const row of selectedRows) { + setLoopRunning(true) + const urlParams = new URLSearchParams(modalUrl.split('?')[1]) + for (let [paramName, paramValue] of urlParams.entries()) { + if (paramValue.startsWith('!')) { + urlParams.set(paramName, row[paramValue.replace('!', '')]) } - const NewModalUrl = `${modalUrl.split('?')[0]}?${urlParams.toString()}` - const results = await genericGetRequest({ path: NewModalUrl, refreshParam: row.id }) - resultsarr.push(results) - setMassResults(resultsarr) } - setLoopRunning(false) - }, - }) - } else { - ModalService.confirm({ - body: ( -
- {modalInput && ( -
- -
- )} -
{modalMessage}
-
- ), - title: 'Confirm', - onConfirm: async () => { - const resultsarr = [] - for (const row of selectedRows) { - setLoopRunning(true) - const urlParams = new URLSearchParams(modalUrl.split('?')[1]) - for (let [paramName, paramValue] of urlParams.entries()) { - if (paramValue.toString().startsWith('!')) { - urlParams.set(paramName, row[paramValue.replace('!', '')]) - } + const NewModalUrl = `${modalUrl.split('?')[0]}?${urlParams.toString()}` + const results = await genericGetRequest({ path: NewModalUrl, refreshParam: row.id }) + resultsarr.push(results) + setMassResults(resultsarr) + } + setLoopRunning(false) + }, + }) + } else { + ModalService.confirm({ + body: ( +
+ {modalInput && ( +
+ +
+ )} + {modalDropdown && ( +
+ {dropDownInfo.isSuccess && ( + ({ + value: data[modalDropdown.valueField], + label: data[modalDropdown.labelField], + }))} + /> + )} +
+ )} +
{modalMessage}
+
+ ), + title: 'Confirm', + onConfirm: async () => { + const resultsarr = [] + for (const row of selectedRows) { + setLoopRunning(true) + const urlParams = new URLSearchParams(modalUrl.split('?')[1]) + for (let [paramName, paramValue] of urlParams.entries()) { + if (paramValue.toString().startsWith('!')) { + urlParams.set(paramName, row[paramValue.replace('!', '')]) } - const newModalBody = {} - for (let [objName, objValue] of Object.entries(modalBody)) { - if (objValue.toString().startsWith('!')) { - newModalBody[objName] = row[objValue.replace('!', '')] - } + } + const newModalBody = {} + for (let [objName, objValue] of Object.entries(modalBody)) { + if (objValue.toString().startsWith('!')) { + newModalBody[objName] = row[objValue.replace('!', '')] } - const NewModalUrl = `${modalUrl.split('?')[0]}?${urlParams.toString()}` - const results = await genericPostRequest({ - path: NewModalUrl, - values: { ...modalBody, ...newModalBody, ...{ input: inputRef.current.value } }, - }) - resultsarr.push(results) - setMassResults(resultsarr) } - setLoopRunning(false) - }, - }) + const NewModalUrl = `${modalUrl.split('?')[0]}?${urlParams.toString()}` + const results = await genericPostRequest({ + path: NewModalUrl, + values: { ...modalBody, ...newModalBody, ...{ input: inputRef.current.value } }, + }) + resultsarr.push(results) + setMassResults(resultsarr) + } + setLoopRunning(false) + }, + }) + } + } + const subHeaderComponentMemo = React.useMemo(() => { + const handleClear = () => { + if (filterText) { + setResetPaginationToggle(!resetPaginationToggle) + setFilterText('') } } + const executeselectedAction = (item) => { - handleModal(item.modalMessage, item.modalUrl, item.modalType, item.modalBody, item.modalInput) + setModalContent({ + item, + }) + if (item.modalDropdown) { + getDrowndownInfo({ path: item.modalDropdown.url }) + } + handleModal( + item.modalMessage, + item.modalUrl, + item.modalType, + item.modalBody, + item.modalInput, + item.modalDropdown, + ) } const defaultActions = [] const dataKeys = () => { diff --git a/src/views/identity/administration/Users.js b/src/views/identity/administration/Users.js index 4dac8d415cf2..4f64168fa419 100644 --- a/src/views/identity/administration/Users.js +++ b/src/views/identity/administration/Users.js @@ -446,9 +446,13 @@ const Users = (row) => { TenantFilter: tenant.defaultDomainName, }, modalUrl: `/api/ExecOneDriveShortCut`, - modalInput: true, modalMessage: - 'Enter a SharePoint URL to create a OneDrive shortcut for and press continue.', + 'Select a SharePoint URL to create a OneDrive shortcut for and press continue.', + modalDropdown: { + url: `/api/listSites?TenantFilter=${tenant.defaultDomainName}&type=SharePointSiteUsage`, + labelField: 'URL', + valueField: 'URL', + }, }, { label: 'Set Out of Office', From 30a4fb3c33d61867a8e2e6af548960407caa7143 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Fri, 8 Sep 2023 16:52:36 +0200 Subject: [PATCH 23/29] latest release --- public/version_latest.txt | 2 +- version_latest.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/version_latest.txt b/public/version_latest.txt index 99eba4de9311..ef8d7569d677 100644 --- a/public/version_latest.txt +++ b/public/version_latest.txt @@ -1 +1 @@ -4.1.0 \ No newline at end of file +4.2.0 \ No newline at end of file diff --git a/version_latest.txt b/version_latest.txt index 99eba4de9311..ef8d7569d677 100644 --- a/version_latest.txt +++ b/version_latest.txt @@ -1 +1 @@ -4.1.0 \ No newline at end of file +4.2.0 \ No newline at end of file From 5f3fc7461f5fee8abb6ebc046f6e025cde9890cf Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Fri, 8 Sep 2023 16:58:14 +0200 Subject: [PATCH 24/29] text changes --- src/views/tenant/administration/AlertWizard.js | 10 ++++++++-- src/views/tenant/administration/ListAlertsQueue.js | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/views/tenant/administration/AlertWizard.js b/src/views/tenant/administration/AlertWizard.js index 40a310af660d..b0d8a9dbdfbf 100644 --- a/src/views/tenant/administration/AlertWizard.js +++ b/src/views/tenant/administration/AlertWizard.js @@ -95,8 +95,8 @@ const AlertWizard = () => {

- These alerts will be sent to the user or webhook configured in the CIPP notification - settings menu. + Alerts setup on this page will be sent to webhook configured in CIPPs settings, and be + delivered as messages

{ Microsoft sends them to CIPP. These alerts generate a ticket, email or webhook message per alert, with more information about the alert.

+ +

+ "Alerts setup on this page will be sent to the webhook configured in CIPPs settings, and + be delivered as raw json information. Warning: Teams, Slack, and Discord do not support + receiving raw json messages" +

{ const [ExecuteGetRequest, getResults] = useLazyGenericGetRequestQuery() @@ -75,24 +76,28 @@ const ListAlertsQueue = () => { selector: (row) => row['Expiration'], sortable: true, exportSelector: 'Expiration', + cell: (row) => CellTip(row['Expiration']), }, { name: 'Monitored Resource', selector: (row) => row['Resource'], sortable: true, exportSelector: 'Resource', + cell: (row) => CellTip(row['Resource']), }, { name: 'Monitored Actions', selector: (row) => row['Operations'], sortable: true, exportSelector: 'Operations', + cell: (row) => CellTip(row['Operations']), }, { name: 'Webhook URL', selector: (row) => row['WebhookNotificationUrl'], sortable: true, exportSelector: 'WebhookNotificationUrl', + cell: (row) => CellTip(row['WebhookNotificationUrl']), }, { name: 'Actions', From 81979afe45c1f91d33e7a46c3eef1239882a543d Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Fri, 8 Sep 2023 17:32:58 +0200 Subject: [PATCH 25/29] fixed package --- package-lock.json | 214 ++++++++++++++++++++-------------------------- package.json | 2 +- 2 files changed, 94 insertions(+), 122 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5af2243419af..2db89fb7513f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "prop-types": "^15.7.2", "react": "^17.0.2", "react-app-polyfill": "^2.0.0", - "react-bootstrap": "^2.8.0", + "react-bootstrap": "^1.6.5", "react-copy-to-clipboard": "^5.0.4", "react-data-table-component": "^7.4.5", "react-datepicker": "^4.10.0", @@ -3191,20 +3191,6 @@ "url": "https://opencollective.com/popperjs" } }, - "node_modules/@react-aria/ssr": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.7.1.tgz", - "integrity": "sha512-ovVPSD1WlRpZHt7GI9DqJrWG3OIYS+NXQ9y5HIewMJpSe+jPQmMQfyRmgX4EnvmxSlp0u04Wg/7oItcoSIb/RA==", - "dependencies": { - "@swc/helpers": "^0.5.0" - }, - "engines": { - "node": ">= 12" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" - } - }, "node_modules/@react-icons/all-files": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz", @@ -3242,6 +3228,14 @@ "@babel/runtime": "^7.9.2" } }, + "node_modules/@restart/context": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", + "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==", + "peerDependencies": { + "react": ">=16.3.2" + } + }, "node_modules/@restart/hooks": { "version": "0.4.11", "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.11.tgz", @@ -3253,34 +3247,6 @@ "react": ">=16.8.0" } }, - "node_modules/@restart/ui": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.6.6.tgz", - "integrity": "sha512-eC3puKuWE1SRYbojWHXnvCNHGgf3uzHCb6JOhnF4OXPibOIPEkR1sqDSkL643ydigxwh+ruCa1CmYHlzk7ikKA==", - "dependencies": { - "@babel/runtime": "^7.21.0", - "@popperjs/core": "^2.11.6", - "@react-aria/ssr": "^3.5.0", - "@restart/hooks": "^0.4.9", - "@types/warning": "^3.0.0", - "dequal": "^2.0.3", - "dom-helpers": "^5.2.0", - "uncontrollable": "^8.0.1", - "warning": "^4.0.3" - }, - "peerDependencies": { - "react": ">=16.14.0", - "react-dom": ">=16.14.0" - } - }, - "node_modules/@restart/ui/node_modules/uncontrollable": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-8.0.4.tgz", - "integrity": "sha512-ulRWYWHvscPFc0QQXvyJjY6LIXU56f0h8pQFvhxiKk5V1fcI8gp9Ht9leVAhrVjzqMw0BgjspBINx9r6oyJUvQ==", - "peerDependencies": { - "react": ">=16.14.0" - } - }, "node_modules/@rjsf/bootstrap-4": { "version": "5.12.1", "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.12.1.tgz", @@ -3690,14 +3656,6 @@ "url": "https://github.com/sponsors/gregberge" } }, - "node_modules/@swc/helpers": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", - "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@tootallnate/once": { "version": "1.1.2", "dev": true, @@ -3862,6 +3820,11 @@ "@types/node": "*" } }, + "node_modules/@types/invariant": { + "version": "2.2.35", + "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.35.tgz", + "integrity": "sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==" + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "dev": true, @@ -14966,32 +14929,31 @@ } }, "node_modules/react-bootstrap": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.8.0.tgz", - "integrity": "sha512-e/aNtxl0Z2ozrIaR82jr6Zz7ss9GSoaXpQaxmvtDUsTZIq/XalkduR/ZXP6vbQHz2T4syvjA+4FbtwELxxmpww==", - "dependencies": { - "@babel/runtime": "^7.21.0", - "@restart/hooks": "^0.4.9", - "@restart/ui": "^1.6.3", - "@types/react-transition-group": "^4.4.5", - "classnames": "^2.3.2", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.6.7.tgz", + "integrity": "sha512-IzCYXuLSKDEjGFglbFWk0/iHmdhdcJzTmtS6lXxc0kaNFx2PFgrQf5jKnx5sarF2tiXh9Tgx3pSt3pdK7YwkMA==", + "dependencies": { + "@babel/runtime": "^7.14.0", + "@restart/context": "^2.1.4", + "@restart/hooks": "^0.4.7", + "@types/invariant": "^2.2.33", + "@types/prop-types": "^15.7.3", + "@types/react": ">=16.14.8", + "@types/react-transition-group": "^4.4.1", + "@types/warning": "^3.0.0", + "classnames": "^2.3.1", "dom-helpers": "^5.2.1", "invariant": "^2.2.4", - "prop-types": "^15.8.1", + "prop-types": "^15.7.2", "prop-types-extra": "^1.1.0", - "react-transition-group": "^4.4.5", + "react-overlays": "^5.1.2", + "react-transition-group": "^4.4.1", "uncontrollable": "^7.2.1", "warning": "^4.0.3" }, "peerDependencies": { - "@types/react": ">=16.14.8", - "react": ">=16.14.0", - "react-dom": ">=16.14.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "react": ">=16.8.0", + "react-dom": ">=16.8.0" } }, "node_modules/react-copy-to-clipboard": { @@ -15275,6 +15237,25 @@ "react-dom": "^15.5.x || ^16.x || ^17.x || ^18.x" } }, + "node_modules/react-overlays": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.2.1.tgz", + "integrity": "sha512-GLLSOLWr21CqtJn8geSwQfoJufdt3mfdsnIiQswouuQ2MMPns+ihZklxvsTDKD3cR2tF8ELbi5xUsvqVhR6WvA==", + "dependencies": { + "@babel/runtime": "^7.13.8", + "@popperjs/core": "^2.11.6", + "@restart/hooks": "^0.4.7", + "@types/warning": "^3.0.0", + "dom-helpers": "^5.2.0", + "prop-types": "^15.7.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + }, + "peerDependencies": { + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + } + }, "node_modules/react-papaparse": { "version": "3.18.2", "license": "MIT", @@ -20787,14 +20768,6 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==" }, - "@react-aria/ssr": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.7.1.tgz", - "integrity": "sha512-ovVPSD1WlRpZHt7GI9DqJrWG3OIYS+NXQ9y5HIewMJpSe+jPQmMQfyRmgX4EnvmxSlp0u04Wg/7oItcoSIb/RA==", - "requires": { - "@swc/helpers": "^0.5.0" - } - }, "@react-icons/all-files": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz", @@ -20818,6 +20791,12 @@ } } }, + "@restart/context": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", + "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==", + "requires": {} + }, "@restart/hooks": { "version": "0.4.11", "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.11.tgz", @@ -20826,30 +20805,6 @@ "dequal": "^2.0.3" } }, - "@restart/ui": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.6.6.tgz", - "integrity": "sha512-eC3puKuWE1SRYbojWHXnvCNHGgf3uzHCb6JOhnF4OXPibOIPEkR1sqDSkL643ydigxwh+ruCa1CmYHlzk7ikKA==", - "requires": { - "@babel/runtime": "^7.21.0", - "@popperjs/core": "^2.11.6", - "@react-aria/ssr": "^3.5.0", - "@restart/hooks": "^0.4.9", - "@types/warning": "^3.0.0", - "dequal": "^2.0.3", - "dom-helpers": "^5.2.0", - "uncontrollable": "^8.0.1", - "warning": "^4.0.3" - }, - "dependencies": { - "uncontrollable": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-8.0.4.tgz", - "integrity": "sha512-ulRWYWHvscPFc0QQXvyJjY6LIXU56f0h8pQFvhxiKk5V1fcI8gp9Ht9leVAhrVjzqMw0BgjspBINx9r6oyJUvQ==", - "requires": {} - } - } - }, "@rjsf/bootstrap-4": { "version": "5.12.1", "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.12.1.tgz", @@ -21084,14 +21039,6 @@ "loader-utils": "^2.0.0" } }, - "@swc/helpers": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", - "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", - "requires": { - "tslib": "^2.4.0" - } - }, "@tootallnate/once": { "version": "1.1.2", "dev": true @@ -21230,6 +21177,11 @@ "@types/node": "*" } }, + "@types/invariant": { + "version": "2.2.35", + "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.35.tgz", + "integrity": "sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==" + }, "@types/istanbul-lib-coverage": { "version": "2.0.4", "dev": true @@ -28102,20 +28054,25 @@ } }, "react-bootstrap": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.8.0.tgz", - "integrity": "sha512-e/aNtxl0Z2ozrIaR82jr6Zz7ss9GSoaXpQaxmvtDUsTZIq/XalkduR/ZXP6vbQHz2T4syvjA+4FbtwELxxmpww==", - "requires": { - "@babel/runtime": "^7.21.0", - "@restart/hooks": "^0.4.9", - "@restart/ui": "^1.6.3", - "@types/react-transition-group": "^4.4.5", - "classnames": "^2.3.2", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.6.7.tgz", + "integrity": "sha512-IzCYXuLSKDEjGFglbFWk0/iHmdhdcJzTmtS6lXxc0kaNFx2PFgrQf5jKnx5sarF2tiXh9Tgx3pSt3pdK7YwkMA==", + "requires": { + "@babel/runtime": "^7.14.0", + "@restart/context": "^2.1.4", + "@restart/hooks": "^0.4.7", + "@types/invariant": "^2.2.33", + "@types/prop-types": "^15.7.3", + "@types/react": ">=16.14.8", + "@types/react-transition-group": "^4.4.1", + "@types/warning": "^3.0.0", + "classnames": "^2.3.1", "dom-helpers": "^5.2.1", "invariant": "^2.2.4", - "prop-types": "^15.8.1", + "prop-types": "^15.7.2", "prop-types-extra": "^1.1.0", - "react-transition-group": "^4.4.5", + "react-overlays": "^5.1.2", + "react-transition-group": "^4.4.1", "uncontrollable": "^7.2.1", "warning": "^4.0.3" } @@ -28300,6 +28257,21 @@ "integrity": "sha512-NMXGa223OnsrGVp5dJHkuKxQ4czdLmXSp5jSV9OqiCky9LOpPATn3vLldc+q5fK3gKbEHvr7J1u0yhBh/xYkpA==", "requires": {} }, + "react-overlays": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.2.1.tgz", + "integrity": "sha512-GLLSOLWr21CqtJn8geSwQfoJufdt3mfdsnIiQswouuQ2MMPns+ihZklxvsTDKD3cR2tF8ELbi5xUsvqVhR6WvA==", + "requires": { + "@babel/runtime": "^7.13.8", + "@popperjs/core": "^2.11.6", + "@restart/hooks": "^0.4.7", + "@types/warning": "^3.0.0", + "dom-helpers": "^5.2.0", + "prop-types": "^15.7.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + } + }, "react-papaparse": { "version": "3.18.2", "requires": { diff --git a/package.json b/package.json index 3a1b4acfb7c6..9d1cc1f15d02 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "prop-types": "^15.7.2", "react": "^17.0.2", "react-app-polyfill": "^2.0.0", - "react-bootstrap": "^2.8.0", + "react-bootstrap": "^1.6.5", "react-copy-to-clipboard": "^5.0.4", "react-data-table-component": "^7.4.5", "react-datepicker": "^4.10.0", From e897c6bc22888cf6c7f9a7b7524db2cfca3f39bb Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Fri, 8 Sep 2023 18:51:26 +0200 Subject: [PATCH 26/29] fix fuzzy search? --- src/components/utilities/CippFuzzySearch.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/utilities/CippFuzzySearch.js b/src/components/utilities/CippFuzzySearch.js index f4db1f1473cb..a97625dcd818 100644 --- a/src/components/utilities/CippFuzzySearch.js +++ b/src/components/utilities/CippFuzzySearch.js @@ -7,10 +7,13 @@ function _interopRequireDefault(obj) { function CippfuzzySearch(options) { var fuse = new _fuse['default'](options, { keys: ['name', 'groupName', 'items.name'], - threshold: 0.2, + threshold: 0.5, location: 0, ignoreLocation: true, useExtendedSearch: true, + includeMatches: true, + includeScore: true, + useExtendedSearch: true, }) return function (value) { if (!value.length) { From 98565c6504d3cbb88f9a11ae62f435871e7e6673 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Fri, 8 Sep 2023 18:55:14 +0200 Subject: [PATCH 27/29] fix weird bug --- public/version_latest.txt | 2 +- version_latest.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/version_latest.txt b/public/version_latest.txt index ef8d7569d677..d87edbfc1069 100644 --- a/public/version_latest.txt +++ b/public/version_latest.txt @@ -1 +1 @@ -4.2.0 \ No newline at end of file +4.2.1 \ No newline at end of file diff --git a/version_latest.txt b/version_latest.txt index ef8d7569d677..d87edbfc1069 100644 --- a/version_latest.txt +++ b/version_latest.txt @@ -1 +1 @@ -4.2.0 \ No newline at end of file +4.2.1 \ No newline at end of file From 927cf00cc6f85f8ed3fc95c6a8b5417ff367e603 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Sat, 9 Sep 2023 00:41:45 +0200 Subject: [PATCH 28/29] remove duplicate --- src/components/utilities/CippFuzzySearch.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/utilities/CippFuzzySearch.js b/src/components/utilities/CippFuzzySearch.js index a97625dcd818..43021b80014e 100644 --- a/src/components/utilities/CippFuzzySearch.js +++ b/src/components/utilities/CippFuzzySearch.js @@ -13,7 +13,6 @@ function CippfuzzySearch(options) { useExtendedSearch: true, includeMatches: true, includeScore: true, - useExtendedSearch: true, }) return function (value) { if (!value.length) { From f529c982149ec35e0271b7f63f1709e4462b733a Mon Sep 17 00:00:00 2001 From: lwhitelock <79275328+lwhitelock@users.noreply.github.com> Date: Sat, 9 Sep 2023 10:07:17 +0100 Subject: [PATCH 29/29] Refactor to support new extensions in the future This refactors the frontend code to allow support for additional extension mappings in the future. --- src/views/cipp/CIPPSettings.js | 37 ++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/views/cipp/CIPPSettings.js b/src/views/cipp/CIPPSettings.js index 09d06f708953..9f72a84401e9 100644 --- a/src/views/cipp/CIPPSettings.js +++ b/src/views/cipp/CIPPSettings.js @@ -1576,12 +1576,12 @@ const ExtensionsTab = () => { } const MappingsTab = () => { - const [listBackend, listBackendResult] = useLazyGenericGetRequestQuery() - const [setExtensionconfig, extensionConfigResult] = useLazyGenericPostRequestQuery() + const [listHaloBackend, listBackendHaloResult] = useLazyGenericGetRequestQuery() + const [setHaloExtensionconfig, extensionHaloConfigResult] = useLazyGenericPostRequestQuery() - const onSubmit = (values) => { - setExtensionconfig({ - path: 'api/ExecExtensionMapping?AddMapping=true', + const onHaloSubmit = (values) => { + setHaloExtensionconfig({ + path: 'api/ExecExtensionMapping?AddMapping=Halo', values: { mappings: values }, }) } @@ -1590,44 +1590,47 @@ const MappingsTab = () => { {listBackendResult.isUninitialized && listBackend({ path: 'api/ExecExtensionMapping?List=true' })} <> - + HaloPSA Mapping Table - {listBackendResult.isFetching ? ( + {listBackendHaloResult.isFetching ? ( ) : ( { return ( Use the table below to map your client to the correct PSA client - {listBackendResult.isSuccess && - listBackendResult.data.Tenants.map((tenant) => ( + {listBackendHaloResult.isSuccess && + listBackendHaloResult.data.Tenants.map((tenant) => ( ))} - {extensionConfigResult.isFetching && ( + {extensionHaloConfigResult.isFetching && ( )} Set Mappings - {(extensionConfigResult.isSuccess || extensionConfigResult.isError) && ( - - {extensionConfigResult.isSuccess - ? extensionConfigResult.data.Results + {(extensionHaloConfigResult.isSuccess || + extensionHaloConfigResult.isError) && ( + + {extensionHaloConfigResult.isSuccess + ? extensionHaloConfigResult.data.Results : 'Error'} )}