Skip to content

Cleanup graph explorer import/export #2146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/utilities/CippCodeOffcanvas.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ function CippCodeOffCanvas({
}
className="me-2"
>
<FontAwesomeIcon icon="save" className="me-2" /> Save changes
{templateDetails.isFetching && <CSpinner size="sm" />}
{templateDetails.isFetching ? (
<CSpinner size="sm" className="me-2" />
) : (
<FontAwesomeIcon icon="save" className="me-2" />
)}
Save changes
</CButton>
<CopyToClipboard text={JSON.stringify(row, null, 2)} onCopy={() => setCopied(true)}>
<CButton disabled={invalidJSON}>
Expand Down
15 changes: 12 additions & 3 deletions src/views/tenant/administration/GraphExplorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const GraphExplorer = () => {
const handleManagePreset = ({ values, action, message }) => {
var params = {
action: action,
values: values,
preset: values,
}
ModalService.confirm({
title: 'Confirm',
Expand Down Expand Up @@ -260,6 +260,15 @@ const GraphExplorer = () => {
field: PropTypes.node,
set: PropTypes.string,
}

function getPresetProps(values) {
var newvals = Object.assign({}, values)
delete newvals['reportTemplate']
delete newvals['tenantFilter']
delete newvals['IsShared']
return newvals
}

console.log(graphrequest.data)

return (
Expand Down Expand Up @@ -301,6 +310,7 @@ const GraphExplorer = () => {
name="reportTemplate"
label="Select a report preset"
placeholder="Select a report"
retainInput={false}
multi={false}
values={presets.map((preset) => {
return {
Expand Down Expand Up @@ -411,8 +421,7 @@ const GraphExplorer = () => {
<CippCodeOffCanvas
title="Preset Import / Export"
row={{
action: 'Copy',
values: props.values,
preset: getPresetProps(props.values),
}}
state={ocVisible}
path="api/ExecGraphExplorerPreset"
Expand Down