From dd6aa74684525c12d76a5e757f92e2d4626c378d Mon Sep 17 00:00:00 2001 From: danloa Date: Thu, 20 Jul 2023 16:19:26 -0400 Subject: [PATCH] Use a global constant for the default timer event inspector --- src/components/inspectors/IntermediateTimer.vue | 4 ++-- src/components/nodes/boundaryTimerEvent/index.js | 5 ++--- src/components/nodes/intermediateTimerEvent/index.js | 4 ++-- src/constants.js | 1 + 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 src/constants.js diff --git a/src/components/inspectors/IntermediateTimer.vue b/src/components/inspectors/IntermediateTimer.vue index 30416b2fa..adc2c7fc3 100644 --- a/src/components/inspectors/IntermediateTimer.vue +++ b/src/components/inspectors/IntermediateTimer.vue @@ -19,7 +19,7 @@ import DurationExpression from './DurationExpression'; import DateTimeExpression from './DateTimeExpression'; import CycleExpression from './CycleExpression'; import { DateTime } from 'luxon'; -import { defaultDurationValue } from '@/components/nodes/intermediateTimerEvent'; +import { defaultDurationTimerEvent } from '@/constants'; const types = { timeDuration: 'DurationExpression', @@ -61,7 +61,7 @@ export default { methods: { changeType(type) { const defaultValue = (this.isDelayType(type) || this.isCycleType(type)) - ? defaultDurationValue + ? defaultDurationTimerEvent : DateTime .local() .toUTC() diff --git a/src/components/nodes/boundaryTimerEvent/index.js b/src/components/nodes/boundaryTimerEvent/index.js index 339d776f8..3ff3b102f 100644 --- a/src/components/nodes/boundaryTimerEvent/index.js +++ b/src/components/nodes/boundaryTimerEvent/index.js @@ -6,8 +6,7 @@ import cloneDeep from 'lodash/cloneDeep'; import interruptingToggleConfig from '../boundaryEvent/interruptingToggleInspector'; import advancedAccordionConfig from '@/components/inspectors/advancedAccordionConfig'; import documentationAccordionConfig from '@/components/inspectors/documentationAccordionConfig'; - -export const defaultDurationValue = 'PT1H'; +import { defaultDurationTimerEvent } from '@/constants'; export const id = 'processmaker-modeler-boundary-timer-event'; @@ -24,7 +23,7 @@ export default merge(cloneDeep(boundaryEventConfig), { eventDefinitions: [ moddle.create('bpmn:TimerEventDefinition', { timeDuration: moddle.create('bpmn:Expression', { - body: defaultDurationValue, + body: defaultDurationTimerEvent, }), }), ], diff --git a/src/components/nodes/intermediateTimerEvent/index.js b/src/components/nodes/intermediateTimerEvent/index.js index ce51f4275..d92d04b54 100644 --- a/src/components/nodes/intermediateTimerEvent/index.js +++ b/src/components/nodes/intermediateTimerEvent/index.js @@ -4,8 +4,8 @@ import nameConfigSettings from '@/components/inspectors/nameConfigSettings'; import advancedAccordionConfig from '@/components/inspectors/advancedAccordionConfig'; import documentationAccordionConfig from '@/components/inspectors/documentationAccordionConfig'; import defaultNames from '@/components/nodes/intermediateEvent/defaultNames'; +import { defaultDurationTimerEvent } from '@/constants'; -export const defaultDurationValue = 'PT1H'; const id = 'processmaker-modeler-intermediate-catch-timer-event'; export default { @@ -67,7 +67,7 @@ export default { eventDefinitions: [ moddle.create('bpmn:TimerEventDefinition', { timeDuration: moddle.create('bpmn:Expression', { - body: defaultDurationValue, + body: defaultDurationTimerEvent, }), }), ], diff --git a/src/constants.js b/src/constants.js new file mode 100644 index 000000000..282b44b3c --- /dev/null +++ b/src/constants.js @@ -0,0 +1 @@ +export const defaultDurationTimerEvent = 'PT1H'; \ No newline at end of file