Skip to content

Commit 72a9146

Browse files
authored
Merge pull request #2146 from JohnDuprey/dev
Cleanup graph explorer import/export
2 parents 06b708f + 375459f commit 72a9146

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/components/utilities/CippCodeOffcanvas.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ function CippCodeOffCanvas({
7373
}
7474
className="me-2"
7575
>
76-
<FontAwesomeIcon icon="save" className="me-2" /> Save changes
77-
{templateDetails.isFetching && <CSpinner size="sm" />}
76+
{templateDetails.isFetching ? (
77+
<CSpinner size="sm" className="me-2" />
78+
) : (
79+
<FontAwesomeIcon icon="save" className="me-2" />
80+
)}
81+
Save changes
7882
</CButton>
7983
<CopyToClipboard text={JSON.stringify(row, null, 2)} onCopy={() => setCopied(true)}>
8084
<CButton disabled={invalidJSON}>

src/views/tenant/administration/GraphExplorer.jsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const GraphExplorer = () => {
8383
const handleManagePreset = ({ values, action, message }) => {
8484
var params = {
8585
action: action,
86-
values: values,
86+
preset: values,
8787
}
8888
ModalService.confirm({
8989
title: 'Confirm',
@@ -260,6 +260,15 @@ const GraphExplorer = () => {
260260
field: PropTypes.node,
261261
set: PropTypes.string,
262262
}
263+
264+
function getPresetProps(values) {
265+
var newvals = Object.assign({}, values)
266+
delete newvals['reportTemplate']
267+
delete newvals['tenantFilter']
268+
delete newvals['IsShared']
269+
return newvals
270+
}
271+
263272
console.log(graphrequest.data)
264273

265274
return (
@@ -301,6 +310,7 @@ const GraphExplorer = () => {
301310
name="reportTemplate"
302311
label="Select a report preset"
303312
placeholder="Select a report"
313+
retainInput={false}
304314
multi={false}
305315
values={presets.map((preset) => {
306316
return {
@@ -411,8 +421,7 @@ const GraphExplorer = () => {
411421
<CippCodeOffCanvas
412422
title="Preset Import / Export"
413423
row={{
414-
action: 'Copy',
415-
values: props.values,
424+
preset: getPresetProps(props.values),
416425
}}
417426
state={ocVisible}
418427
path="api/ExecGraphExplorerPreset"

0 commit comments

Comments
 (0)