Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Develop Merge to Production #88

Merged
merged 108 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
ea552b2
Renamed docs portal
nielsdejong Jan 16, 2023
393aaad
Release 2.3.4 (#580)
BennuFire Aug 22, 2023
5da476a
Fix axis color on non canvas
BennuFire Aug 22, 2023
6f17ce7
Moving Header Text color up
BennuFire Aug 22, 2023
de3125a
Adjusting to default
BennuFire Aug 22, 2023
76f1d29
Bump @adobe/css-tools from 4.1.0 to 4.3.1
dependabot[bot] Aug 30, 2023
e86e422
Removed hardcoded subpath
m-o-n-i-s-h Sep 8, 2023
ff431d6
Fix multiple providers
BennuFire Sep 14, 2023
566ca2a
Update quickstart.adoc
davidlrosenblum Sep 14, 2023
bc6fdea
Fix if
BennuFire Sep 15, 2023
53aceb6
Base config
BennuFire Sep 18, 2023
c3bf98f
Docs on ssoProviders
BennuFire Sep 18, 2023
0a4782d
Optional Params
BennuFire Sep 18, 2023
3c58ca6
Fix bar colors
BennuFire Sep 18, 2023
b7a03c6
Cherry Cleaned
BennuFire Sep 18, 2023
3924723
Merge branch 'develop' into dependabot/npm_and_yarn/adobe/css-tools-4…
nielsdejong Sep 21, 2023
bcc5000
Extra colors
BennuFire Sep 21, 2023
739daaf
Fix
BennuFire Sep 21, 2023
33f2c1e
Improve robustness for edge header title
nielsdejong Sep 21, 2023
db212fe
Merge branch 'develop' into patch-1
nielsdejong Sep 21, 2023
5376f94
Fix locale and link prep
BennuFire Sep 21, 2023
c8bdc33
Clean logs
BennuFire Sep 22, 2023
314ad0b
Merge pull request #632 from neo4j-labs/git/rule-based-styling-rules-…
BennuFire Sep 22, 2023
d3bab80
Merge branch 'develop' into pr/VULCAN-231-source-target
BennuFire Sep 22, 2023
26194d7
Merge pull request #627 from neo4j-labs/pr/VULCAN-231-source-target
BennuFire Sep 22, 2023
9c758c8
Merge branch 'develop' into si/fixSSOMultipleProviders
BennuFire Sep 22, 2023
59fb394
Merge branch 'develop' into fix/BarColorAssignment
BennuFire Sep 22, 2023
cdf50b7
Merge pull request #626 from neo4j-labs/fix/BarColorAssignment
BennuFire Sep 22, 2023
0d2f3f2
Merge branch 'develop' into dependabot/npm_and_yarn/adobe/css-tools-4…
BennuFire Sep 22, 2023
35039d1
Merge pull request #604 from neo4j-labs/dependabot/npm_and_yarn/adobe…
BennuFire Sep 22, 2023
479276f
Merge pull request #620 from davidlrosenblum/patch-1
BennuFire Sep 22, 2023
e3e4f14
Merge pull request #618 from mercedes-benz/RemoveHardcodedSubPath
BennuFire Sep 22, 2023
2c890ee
Merge branch 'develop' into task/fixDarkThemeMore
BennuFire Sep 22, 2023
a5a5da1
Merge pull request #585 from neo4j-labs/task/fixDarkThemeMore
BennuFire Sep 22, 2023
9225049
Merge branch 'develop' into feature/linksRender
BennuFire Sep 22, 2023
17b98c8
Merge branch 'develop' into fix/OptionalVariablesOnQuery
BennuFire Sep 22, 2023
a607b62
Merge branch 'develop' into si/fixSSOMultipleProviders
BennuFire Sep 22, 2023
4b1664f
Merge pull request #624 from neo4j-labs/si/fixSSOMultipleProviders
BennuFire Sep 22, 2023
6d86d3c
Merge branch 'develop' into feature/linksRender
BennuFire Sep 22, 2023
55ffed8
Merge pull request #633 from neo4j-labs/feature/linksRender
BennuFire Sep 22, 2023
a11b5c9
Changelog
BennuFire Sep 22, 2023
ae07a93
Merge branch 'develop' into notes/release-notes-2.3.4
BennuFire Sep 22, 2023
cd2f5c5
Merge branch 'develop' into fix/OptionalVariablesOnQuery
BennuFire Sep 22, 2023
a4cb852
Version bumps
BennuFire Sep 22, 2023
20a97a0
Merge pull request #625 from neo4j-labs/fix/OptionalVariablesOnQuery
BennuFire Sep 22, 2023
dd2681e
Merge branch 'develop' into notes/release-notes-2.3.4
BennuFire Sep 22, 2023
862e55f
Tests
BennuFire Sep 22, 2023
6e35e44
Change start to prod
BennuFire Sep 22, 2023
bb97da0
back to dev
BennuFire Sep 22, 2023
4aaf4b2
back to prod
BennuFire Sep 22, 2023
e10d296
Version package
BennuFire Sep 22, 2023
074111c
bump cypress
BennuFire Sep 22, 2023
187a99e
Merge pull request #635 from neo4j-labs/notes/release-notes-2.3.4
BennuFire Sep 22, 2023
3b69b58
bump cypress
BennuFire Sep 22, 2023
2111a27
Font on pies
BennuFire Sep 22, 2023
735f37d
Merge pull request #638 from neo4j-labs/feature/pieFontSize
AleSim94 Sep 25, 2023
5b3d477
Merge branch 'develop' into fix/sentryOnServed
BennuFire Sep 25, 2023
1a4bb4b
FIxes
BennuFire Sep 25, 2023
7aee4a6
Merge pull request #637 from neo4j-labs/fix/sentryOnServed
BennuFire Sep 25, 2023
cb94aca
FIxes
BennuFire Sep 25, 2023
a421ee9
Merge pull request #639 from neo4j-labs/fix/sonarHot
BennuFire Sep 25, 2023
ae87c21
Merge pull request #636 from neo4j-labs/develop
BennuFire Sep 25, 2023
f151d32
Made API keys hidden (password fields) in the query translator module
nielsdejong Oct 10, 2023
0caa78a
Added new report action type for tables: multiselect checkboxes (#664)
nielsdejong Oct 27, 2023
3a2cf4d
Fix handling external updates of parameter values in parameter select…
nielsdejong Oct 27, 2023
5e27a02
Feature/new dashboard load UI (#657)
nielsdejong Oct 27, 2023
f4c2791
Bump @babel/traverse from 7.21.4 to 7.23.2 in /gallery (#670)
dependabot[bot] Nov 3, 2023
7b7bed1
Bump @babel/traverse from 7.20.13 to 7.23.2 (#669)
dependabot[bot] Nov 3, 2023
4f29427
Bump postcss from 8.4.23 to 8.4.31 in /gallery (#656)
dependabot[bot] Nov 6, 2023
f823de2
Bump postcss from 8.4.21 to 8.4.31 (#655)
dependabot[bot] Nov 6, 2023
e4b0ecd
Text hard to read on dark theme (#668)
JonanOribe Nov 6, 2023
96bd80b
Hotfix for wrong default parameter replacement in markdown
nielsdejong Nov 7, 2023
2d030a4
Merge branch 'develop' of github.com:neo4j-labs/neodash into develop
nielsdejong Nov 7, 2023
295857b
Add back arrow on connection modal (#675)
hugorplobo Nov 10, 2023
3742393
VULCAN-126/Override default message (#683)
nielsdejong Nov 10, 2023
be8b08f
Fix/hiding columns in table (#685)
AleSim94 Nov 13, 2023
ad4bd0b
Fix parameters values (#641)
BennuFire Nov 13, 2023
d7be8c7
Updated dashboard format to 2.4. Double resolution for horizontal and…
nielsdejong Nov 14, 2023
fceb5f3
Feature/gantt chart (#684)
alfredorubin96 Nov 14, 2023
c54acd3
adding in advanced config for the graph viz more graph layout config …
AleSim94 Nov 14, 2023
a6140d0
Adding form widget as a new extension (#568)
nielsdejong Nov 14, 2023
27d35f1
Model Examples and LLM improvements (#600)
alfredorubin96 Nov 15, 2023
85ff8fd
Merge branch 'master' into develop
nielsdejong Nov 16, 2023
9732c09
Added release notes for 2.4 + bonus feature (keyboard shortcut to run…
nielsdejong Nov 16, 2023
86cf207
Hotfixes for Sonarqube issues
nielsdejong Nov 16, 2023
85d9581
minor fix in the forms where it wasn't getting the correct value in t…
alfredorubin96 Nov 16, 2023
31e898b
2.4 Release (#688)
nielsdejong Nov 16, 2023
826e0e0
Fix hiding column prefix (#695)
alfredorubin96 Nov 16, 2023
1768dea
Merge branch 'master' into develop
nielsdejong Nov 16, 2023
216d1d6
fixing merge
alfredorubin96 Nov 16, 2023
bb40a17
Vulcan-408 version 2.4 upgrade for neodash
brahmprakashMishra Nov 17, 2023
5f03479
Dynamic height report
m-o-n-i-s-h Nov 21, 2023
2d0ce84
Refactored
m-o-n-i-s-h Nov 22, 2023
c8908bb
Wrapping NeoDashboardSidebar in a div to prevent rendering issues
brahmprakashMishra Nov 23, 2023
34e6074
Merge pull request #78 from mercedes-benz/VULCAN-419/InvestigateDynam…
brahmprakashMishra Nov 23, 2023
a39fa51
Merge branch 'develop' into VULCAN-408/NeodashMerge_v2.4
brahmprakashMishra Nov 23, 2023
e564bdf
Merge pull request #79 from mercedes-benz/VULCAN-408/NeodashMerge_v2.4
m-o-n-i-s-h Nov 29, 2023
ef46db5
Neodash Bug Fixes
m-o-n-i-s-h Nov 30, 2023
080b57d
Merge pull request #80 from mercedes-benz/Neodash2.4BugFixes
m-o-n-i-s-h Nov 30, 2023
3f107c4
opens landing page in new url
m-o-n-i-s-h Dec 8, 2023
7137449
Added landing page link to logo
m-o-n-i-s-h Dec 8, 2023
1ea65f3
Removed obsolete code
m-o-n-i-s-h Dec 11, 2023
0c89672
Merge pull request #83 from mercedes-benz/VULCAN-470/TableIssue
brahmprakashMishra Dec 15, 2023
815d9f9
Merge pull request #81 from mercedes-benz/VULCAN-452/LogoClickToLandi…
brahmprakashMishra Dec 15, 2023
f2fbc4d
Bug Fixes (#82)
m-o-n-i-s-h Dec 15, 2023
ce67bae
Changed dockerfile version (#85)
brahmprakashMishra Dec 18, 2023
f52113d
v2.4 changes (#87)
m-o-n-i-s-h Dec 18, 2023
4422ee9
Merge branch 'production' into develop
brahmprakashMishra Dec 18, 2023
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
Prev Previous commit
Next Next commit
Adding form widget as a new extension (neo4j-labs#568)
* Added forms skeleton

* Completed form skeleton

* WIP on forms interface

* Form framework (data entry, running, success, error) added

* Added comments

* Adding fields specification interface

* UI for specifying individual parameter in a form

* changing Dockerfile to enable args during build

* fixing typo on argument in dockerfile

* reverting dockerfile to older version

* Rendering parameters inside the form component

* Added docs for forms. Improved stability on form

* Fixed warnings in console

* Finished IT test for forms report

* added new field to disable a parameter selector (in this way it works only with actions)

* Fixed issue where parameter values were not updated on external changes

* Fixed styling on freetext spinner

* Workaround for clipping menu selectors in Needle

* fix(rule based styling): js doing is magic with parseFloat (some strings were casted to floats event if they were just strings starting with 0

* Added save button to form create UI

* removing console logs

* Fix for needle dropdowns not showing on modals

* Sortable list for form parameters

* Improving the drag 'n drop

* Iterating on form interface

* Final version of forms

* Disabling test

* Improved robustness of form / parameter select component

* Updated docs, added clear form button

* removing code smells

* cleaning code followign SonarCloud code smells

* cleaning code followign SonarCloud code smells

* removing code smells

* Intelligent parameters clearing in forms

---------

Co-authored-by: Alfred Rubin <alfredo.rubin@neo4j.com>
  • Loading branch information
nielsdejong and alfredorubin96 authored Nov 14, 2023
commit a6140d05e2cd904a01d3364fc43f03758748b9a9
2 changes: 2 additions & 0 deletions docs/modules/ROOT/pages/user-guide/reports/form.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ image::formselector.png[Parameter-only Form]

|Confirmation Message | multiline text |Form submitted. |Text displayed to the user after the form is submitted successfully.

|Clear parameters after submit |on/off |on | Clears all dashboard parameters in the form after submitting.

|Has Submit Button |on/off |on | When enabled, lets the user submit the form with a button. Disabling turns the form into parameters-only mode.

|Has Reset Button |on/off |on |When enabled, lets the user reset the form to enter more data.
Expand Down
Binary file added public/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const PropertyNameAutocomplete = ({
id='autocomplete-property'
disabled={disabled}
options={records.map((r) => (r._fields ? r._fields[0] : '(no data)'))}
getOptionLabel={(option) => (option ? option : '')}
getOptionLabel={(option) => option || ''}
style={{ display: 'inline-block', width: 170, marginLeft: '5px', marginTop: '0px' }}
inputValue={inputs[index]}
onInputChange={(event, value) => {
Expand Down
16 changes: 6 additions & 10 deletions src/chart/parameter/ParameterSelectCardSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin

// When certain settings are updated, a re-generated search query is needed.
useEffect(() => {
updateReportQuery(
settings.entityType,
settings.propertyType,
settings.propertyTypeDisplay || settings.propertyTypeDisplay
);
updateReportQuery(settings.entityType, settings.propertyType, settings.propertyTypeDisplay);
}, [settings.suggestionLimit, settings.deduplicateSuggestions, settings.searchType, settings.caseSensitive]);

useEffect(() => {
Expand All @@ -47,7 +43,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin

const cleanParameter = (parameter: string) => parameter.replaceAll(' ', '_').replaceAll('-', '_').toLowerCase();
const formatParameterId = (id: string | undefined | null) => {
const cleanedId = id || '';
const cleanedId = id ?? '';
return cleanedId == '' || cleanedId.startsWith('_') ? cleanedId : `_${cleanedId}`;
};

Expand Down Expand Up @@ -132,7 +128,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
}

function handleIdSelectionUpdate(value) {
const newValue = value ? value : '';
const newValue = value || '';
onReportSettingUpdate('id', `${newValue}`);
if (settings.propertyType && settings.entityType) {
const newParameterName = `neodash_${settings.entityType}_${settings.propertyType}`;
Expand Down Expand Up @@ -196,7 +192,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
settings.overridePropertyDisplayName !== undefined ? settings.overridePropertyDisplayName : false;

// If the override is off, and the two values differ, set the display value to the original one again.
if (overridePropertyDisplayName == false && propertyInputText !== propertyInputDisplayText) {
if (!overridePropertyDisplayName && propertyInputText !== propertyInputDisplayText) {
onReportSettingUpdate('propertyTypeDisplay', settings.propertyType);
setPropertyInputDisplayText(propertyInputText);
updateReportQuery(settings.entityType, settings.propertyType, settings.propertyType);
Expand Down Expand Up @@ -335,7 +331,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
? [settings.propertyType]
: propertyRecords.map((r) => (r._fields ? r._fields[0] : '(no data)'))
}
getOptionLabel={(option) => (option ? option : '')}
getOptionLabel={(option) => option || ''}
style={{ display: 'inline-block', width: '65%', marginTop: '13px', marginRight: '5%' }}
inputValue={propertyInputText}
onInputChange={(event, value) => {
Expand Down Expand Up @@ -372,7 +368,7 @@ const ParameterSelectCardSettings = ({ query, database, settings, onReportSettin
? [settings.propertyTypeDisplay || settings.propertyType]
: propertyRecords.map((r) => (r._fields ? r._fields[0] : '(no data)'))
}
getOptionLabel={(option) => (option ? option : '')}
getOptionLabel={(option) => option || ''}
style={{ display: 'inline-block', width: '65%', marginTop: '13px', marginRight: '5%' }}
inputValue={propertyInputDisplayText}
onInputChange={(event, value) => {
Expand Down
10 changes: 5 additions & 5 deletions src/chart/parameter/component/DateParameterSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback, useEffect } from 'react';
import React, { useEffect } from 'react';
import { ParameterSelectProps } from './ParameterSelect';
import NeoDatePicker from '../../../component/field/DateField';
import dayjs, { Dayjs } from 'dayjs';
import dayjs from 'dayjs';
import { Date as Neo4jDate } from 'neo4j-driver-core/lib/temporal-types.js';
import { isCastableToNeo4jDate, isEmptyObject } from '../../ChartUtils';
import { debounce } from '@mui/material';
Expand All @@ -27,11 +27,11 @@ const DatePickerParameterSelectComponent = (props: ParameterSelectProps) => {
: dayjs();

const [inputDate, setInputDate] = React.useState(castPropsToJsDate(props.parameterValue));
const label = props.settings && props.settings.entityType ? props.settings.entityType : '';
const helperText = props.settings && props.settings.helperText ? props.settings.helperText : '';
const label = props?.settings?.entityType ? props.settings.entityType : '';
const helperText = props?.settings?.helperText ? props.settings.helperText : '';
const clearParameterOnFieldClear =
props.settings && props.settings.clearParameterOnFieldClear ? props.settings.clearParameterOnFieldClear : false;
const disabled = props.settings && props.settings.disabled ? props.settings.disabled : false;
const disabled = props?.settings?.disabled ? props.settings.disabled : false;

const setParameterValue = (value) => {
props.setParameterValue(castPropsToBoltDate(value));
Expand Down
2 changes: 1 addition & 1 deletion src/chart/parameter/component/FreeTextParameterSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const FreeTextParameterSelectComponent = (props: ParameterSelectProps) => {
const helperText = props.settings && props.settings.helperText ? props.settings.helperText : '';
const clearParameterOnFieldClear =
props.settings && props.settings.clearParameterOnFieldClear ? props.settings.clearParameterOnFieldClear : false;
const disabled = props.settings && props.settings.disabled ? props.settings.disabled : false;
const disabled = props?.settings?.disabled ? props.settings.disabled : false;
const [running, setRunning] = React.useState(false);
const [paramValueLocal, setParamValueLocal] = React.useState(null);

Expand Down
15 changes: 4 additions & 11 deletions src/chart/parameter/component/NodePropertyParameterSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { SelectionConfirmationButton } from './SelectionConfirmationButton';
import NeoCodeViewerComponent from '../../../component/editor/CodeViewerComponent';
import { getRecordType, toNumber } from '../../ChartUtils';


const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
const suggestionsUpdateTimeout =
props.settings && props.settings.suggestionsUpdateTimeout ? props.settings.suggestionsUpdateTimeout : 250;
Expand All @@ -16,7 +15,7 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
? props.settings.defaultValue
: '';

const disabled = props.settings && props.settings.disabled ? props.settings.disabled : false;
const disabled = props?.settings?.disabled ? props.settings.disabled : false;
const getInitialValue = (value, multi) => {
if (value && Array.isArray(value)) {
return multi ? value : null;
Expand Down Expand Up @@ -154,18 +153,12 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
setInputValue(props.parameterDisplayValue);
}
}, [props.parameterDisplayValue]);



// The query used to populate the selector is invalid.
if (extraRecords && extraRecords[0] && extraRecords[0].error) {
return (
<NeoCodeViewerComponent
value={
`The parameter value retrieval query is invalid: \n${
props.query
}\n\nError message:\n${
extraRecords[0].error}`
}
value={`The parameter value retrieval query is invalid: \n${props.query}\n\nError message:\n${extraRecords[0].error}`}
/>
);
}
Expand All @@ -175,7 +168,7 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
<Autocomplete
id='autocomplete'
multiple={multiSelector}
options={extraRecords && extraRecords.map((r) => r?._fields?.[displayValueRowIndex] || '(no data)').sort()}
options={extraRecords?.map((r) => r?._fields?.[displayValueRowIndex] || '(no data)').sort()}
disabled={disabled}
limitTags={multiSelectLimit}
style={{
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/ExtensionConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const EXTENSIONS: Record<string, Extension> = {
name: 'forms',
label: 'Forms',
author: 'Neo4j Professional Services',
image: 'https://www.pulsecarshalton.co.uk/wp-content/uploads/2016/08/jk-placeholder-image.jpg',
image: 'form.png',
enabled: true,
description:
'Forms let you craft Cypher queries with multiple inputs, that are fired on demand. Using parameters from the dashboard, or form specific input, you will be able to trigger custom logic with forms.',
Expand Down
10 changes: 5 additions & 5 deletions src/extensions/ExtensionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { FORMS } from './forms/FormsReportConfig';
import { EXAMPLE_FORMS } from './forms/FormsExampleConfig';
// Components can call this to check if any extension is enabled. For example, to decide whether to all rule-based styling.
export const extensionEnabled = (extensions, name) => {
return extensions && extensions[name] && extensions[name].active;
return extensions[name]?.active;
};

// Tell the application what charts are available, dynmically, based on the selected extensions.
export const getReportTypes = (extensions) => {
let charts = { ...REPORT_TYPES };
if (extensions && extensions['advanced-charts'] && extensions['advanced-charts'].active) {
if (extensions['advanced-charts']?.active) {
charts = { ...charts, ...ADVANCED_REPORT_TYPES };
}
if (extensions && extensions.forms && extensions.forms.active) {
if (extensions?.forms?.active) {
charts = { ...charts, ...FORMS };
}
return charts;
Expand All @@ -25,10 +25,10 @@ export const getReportTypes = (extensions) => {
// Tell the application what examples are available, dynmically, based on the selected extensions.
export const getExampleReports = (extensions) => {
let examples = [...EXAMPLE_REPORTS];
if (extensions && extensions['advanced-charts'] && extensions['advanced-charts'].active) {
if (extensions['advanced-charts']?.active) {
examples = [...examples, ...EXAMPLE_ADVANCED_REPORTS];
}
if (extensions && extensions.forms && extensions.forms.active) {
if (extensions?.forms?.active) {
examples = [...examples, ...EXAMPLE_FORMS];
}
return examples;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getAnimationElement(svgElement, attr, from, to, dur = '0.4s', begin = '
from,
to,
dur,
begin: `click + ${ begin}`, // artificial click
begin: `click + ${begin}`, // artificial click
});
return svgElement;
}
Expand All @@ -55,7 +55,7 @@ function getAnimationElement(svgElement, attr, from, to, dur = '0.4s', begin = '
dur,
begin,
calcMode: 'spline',
values: `${from };${ to}`,
values: `${from};${to}`,
keyTimes: '0; 1',
keySplines: cubic_bezier('ease-out'),
});
Expand Down
6 changes: 6 additions & 0 deletions src/extensions/forms/FormsReportConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ export const FORMS = {
values: [true, false],
default: true,
},
clearParametersAfterSubmit: {
label: 'Clear parameters after submit',
type: SELECTION_TYPES.LIST,
values: [true, false],
default: false,
},
hasResetButton: {
label: 'Has Reset Button',
type: SELECTION_TYPES.LIST,
Expand Down
22 changes: 18 additions & 4 deletions src/extensions/forms/chart/NeoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ enum FormStatus {
*/
const NeoForm = (props: ChartProps) => {
const { settings } = props;
const [submitButtonActive, setSubmitButtonActive] = React.useState(true);
const buttonText = settings?.runButtonText ? settings.runButtonText : 'Submit';
const confirmationMessage = settings?.confirmationMessage ? settings.confirmationMessage : 'Form Submitted.';
const resetButtonText = settings?.resetButtonText ? settings.resetButtonText : 'Reset Form';
const hasResetButton = settings?.hasResetButton !== undefined ? settings.hasResetButton : true;
const hasSubmitButton = settings?.hasSubmitButton !== undefined ? settings.hasSubmitButton : true;
const hasSubmitMessage = settings?.hasSubmitMessage !== undefined ? settings.hasSubmitMessage : true;
const hasResetButton = settings?.hasResetButton ? settings.hasResetButton : true;
const hasSubmitButton = settings?.hasSubmitButton ? settings.hasSubmitButton : true;
const hasSubmitMessage = settings?.hasSubmitMessage ? settings.hasSubmitMessage : true;
const clearParametersAfterSubmit = settings?.clearParametersAfterSubmit ? settings.clearParametersAfterSubmit : false;
const [submitButtonActive, setSubmitButtonActive] = React.useState(true);
const [status, setStatus] = React.useState(FormStatus.DATA_ENTRY);
const [formResults, setFormResults] = React.useState([]);
const debouncedRunCypherQuery = useCallback(debounce(props.queryCallback, RUN_QUERY_DELAY_MS), []);
Expand Down Expand Up @@ -92,6 +93,19 @@ const NeoForm = (props: ChartProps) => {
setStatus(FormStatus.ERROR);
} else {
forceRefreshDependentReports();
if (clearParametersAfterSubmit) {
const formFields = props?.settings?.formFields;
if (formFields) {
const entries = formFields.map((f) => f.settings);
entries.forEach((entry) => {
if (entry.multiSelector) {
props.setGlobalParameter && props.setGlobalParameter(entry.parameterName, []);
} else {
props.setGlobalParameter && props.setGlobalParameter(entry.parameterName, '');
}
});
}
}
if (hasSubmitMessage) {
setStatus(FormStatus.SUBMITTED);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/forms/settings/NeoFormCardSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const NeoFormCardSettings = ({ query, database, settings, extensions, onReportSe
<div>
<span style={{ lineHeight: '32px' }}>
<SortableList.DragHandle />{' '}
{formFields[index] && formFields[index].settings.parameterName
{formFields[index]?.settings?.parameterName
? `$${formFields[index].settings.parameterName}`
: '(undefined)'}
</span>
Expand Down
7 changes: 1 addition & 6 deletions src/extensions/forms/settings/NeoFormCardSettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import React from 'react';
import { Button, Dialog } from '@neo4j-ndl/react';
import ParameterSelectCardSettings from '../../../chart/parameter/ParameterSelectCardSettings';
import NeoCardSettingsFooter from '../../../card/settings/CardSettingsFooter';
import {
AdjustmentsHorizontalIconOutline,
PencilIconOutline,
PlusIconOutline,
XMarkIconOutline,
} from '@neo4j-ndl/react/icons';

const NeoFormCardSettingsModal = ({ open, setOpen, index, formFields, setFormFields, database, extensions }) => {
const [advancedSettingsOpen, setAdvancedSettingsOpen] = React.useState(false);

Expand Down
3 changes: 3 additions & 0 deletions src/extensions/styling/StyleRuleEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ const evaluateCondition = (realValue, condition, ruleValue) => {
// If something is null, rules are never met.
return false;
}
if (!isNaN(Number(ruleValue))) {
ruleValue = Number(ruleValue);
}
if (condition == '=') {
return realValue === ruleValue;
}
Expand Down