Skip to content

Commit

Permalink
removed unused import to unknown module w/ burnettk
Browse files Browse the repository at this point in the history
  • Loading branch information
jasquat committed Apr 11, 2024
1 parent c963f11 commit fdaeacb
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ import { is, isAny } from 'bpmn-js/lib/util/ModelUtil';
import scriptGroup, { SCRIPT_TYPE } from './SpiffScriptGroup';
import {
ServiceTaskParameterArray,
ServiceTaskOperatorSelect, ServiceTaskResultTextInput,
ServiceTaskOperatorSelect,
ServiceTaskResultTextInput,
} from './SpiffExtensionServiceProperties';
import {OPTION_TYPE, spiffExtensionOptions, SpiffExtensionSelect} from './SpiffExtensionSelect';
import {SpiffExtensionLaunchButton} from './SpiffExtensionLaunchButton';
import {SpiffExtensionTextArea} from './SpiffExtensionTextArea';
import {SpiffExtensionTextInput} from './SpiffExtensionTextInput';
import {SpiffExtensionCheckboxEntry} from './SpiffExtensionCheckboxEntry';
import {hasEventDefinition} from 'bpmn-js/lib/util/DiUtil';
import { PropertyDescription } from 'bpmn-js-properties-panel/';
import {setExtensionValue} from "../extensionHelpers";
import {
OPTION_TYPE,
spiffExtensionOptions,
SpiffExtensionSelect,
} from './SpiffExtensionSelect';
import { SpiffExtensionLaunchButton } from './SpiffExtensionLaunchButton';
import { SpiffExtensionTextArea } from './SpiffExtensionTextArea';
import { SpiffExtensionTextInput } from './SpiffExtensionTextInput';
import { SpiffExtensionCheckboxEntry } from './SpiffExtensionCheckboxEntry';
import { hasEventDefinition } from 'bpmn-js/lib/util/DiUtil';
import { setExtensionValue } from '../extensionHelpers';

const LOW_PRIORITY = 500;

Expand All @@ -31,20 +35,22 @@ export default function ExtensionsPropertiesProvider(
return function (groups) {
if (is(element, 'bpmn:ScriptTask')) {
groups.push(
createScriptGroup(element, translate, moddle, commandStack)
createScriptGroup(element, translate, moddle, commandStack),
);
} else if (
isAny(element, ['bpmn:Task', 'bpmn:CallActivity', 'bpmn:SubProcess'])
) {
groups.push(preScriptPostScriptGroup(element, translate, moddle, commandStack));
groups.push(
preScriptPostScriptGroup(element, translate, moddle, commandStack),
);
}
if (is(element, 'bpmn:UserTask')) {
groups.push(createUserGroup(element, translate, moddle, commandStack));
}

if (is(element, 'bpmn:BusinessRuleTask')) {
groups.push(
createBusinessRuleGroup(element, translate, moddle, commandStack)
createBusinessRuleGroup(element, translate, moddle, commandStack),
);
}
if (
Expand All @@ -60,31 +66,29 @@ export default function ExtensionsPropertiesProvider(
])
) {
groups.push(
createUserInstructionsGroup(element, translate, moddle, commandStack)
createUserInstructionsGroup(element, translate, moddle, commandStack),
);
}
if (
isAny(element, [
'bpmn:ManualTask',
'bpmn:UserTask',
])
) {
if (isAny(element, ['bpmn:ManualTask', 'bpmn:UserTask'])) {
groups.push(
createAllowGuestGroup(element, translate, moddle, commandStack)
createAllowGuestGroup(element, translate, moddle, commandStack),
);
}
if (
is(element, 'bpmn:BoundaryEvent') &&
hasEventDefinition(element, 'bpmn:SignalEventDefinition') &&
isAny(element.businessObject.attachedToRef, ['bpmn:ManualTask', 'bpmn:UserTask'])
isAny(element.businessObject.attachedToRef, [
'bpmn:ManualTask',
'bpmn:UserTask',
])
) {
groups.push(
createSignalButtonGroup(element, translate, moddle, commandStack)
createSignalButtonGroup(element, translate, moddle, commandStack),
);
}
if (is(element, 'bpmn:ServiceTask')) {
groups.push(
createServiceGroup(element, translate, moddle, commandStack)
createServiceGroup(element, translate, moddle, commandStack),
);
}

Expand Down Expand Up @@ -154,7 +158,7 @@ function preScriptPostScriptGroup(element, translate, moddle, commandStack) {
}),
];
const loopCharacteristics = element.businessObject.loopCharacteristics;
if (typeof(loopCharacteristics) !== 'undefined') {
if (typeof loopCharacteristics !== 'undefined') {
entries.push({
id: 'scriptValence',
component: ScriptValenceCheckbox,
Expand All @@ -170,7 +174,6 @@ function preScriptPostScriptGroup(element, translate, moddle, commandStack) {
}

function ScriptValenceCheckbox(props) {

const { element, commandStack } = props;

const getValue = () => {
Expand Down Expand Up @@ -204,16 +207,38 @@ function ScriptValenceCheckbox(props) {
* @returns entries
*/
function createUserGroup(element, translate, moddle, commandStack) {

const updateExtensionProperties = (element, name, value, moddle, commandStack) => {
const uiName = value.replace('schema\.json', 'uischema\.json')
setExtensionValue(element, 'formJsonSchemaFilename', value, moddle, commandStack);
setExtensionValue(element, 'formUiSchemaFilename', uiName, moddle, commandStack);
const matches = spiffExtensionOptions[OPTION_TYPE.json_schema_files].filter((opt) => opt.value === value);
const updateExtensionProperties = (
element,
name,
value,
moddle,
commandStack,
) => {
const uiName = value.replace('schema.json', 'uischema.json');
setExtensionValue(
element,
'formJsonSchemaFilename',
value,
moddle,
commandStack,
);
setExtensionValue(
element,
'formUiSchemaFilename',
uiName,
moddle,
commandStack,
);
const matches = spiffExtensionOptions[OPTION_TYPE.json_schema_files].filter(
(opt) => opt.value === value,
);
if (matches.length === 0) {
spiffExtensionOptions[OPTION_TYPE.json_schema_files].push({label: value, value: value});
spiffExtensionOptions[OPTION_TYPE.json_schema_files].push({
label: value,
value: value,
});
}
}
};

return {
id: 'user_task_properties',
Expand All @@ -239,7 +264,7 @@ function createUserGroup(element, translate, moddle, commandStack) {
event: 'spiff.file.edit',
listenEvent: 'spiff.jsonSchema.update',
listenFunction: updateExtensionProperties,
description: translate('Edit the form schema')
description: translate('Edit the form schema'),
},
],
};
Expand Down Expand Up @@ -288,12 +313,7 @@ function createBusinessRuleGroup(element, translate, moddle, commandStack) {
* @param moddle
* @returns entries
*/
function createUserInstructionsGroup (
element,
translate,
moddle,
commandStack
) {
function createUserInstructionsGroup(element, translate, moddle, commandStack) {
return {
id: 'instructions',
label: translate('Instructions'),
Expand All @@ -305,7 +325,8 @@ function createUserInstructionsGroup (
component: SpiffExtensionTextArea,
name: 'spiffworkflow:InstructionsForEndUser',
label: 'Instructions',
description: 'Displayed above user forms or when this task is executing.',
description:
'Displayed above user forms or when this task is executing.',
},
{
element,
Expand All @@ -317,7 +338,7 @@ function createUserInstructionsGroup (
event: 'spiff.markdown.edit',
listenEvent: 'spiff.markdown.update',
description: translate('Edit the form schema'),
}
},
],
};
}
Expand All @@ -329,12 +350,7 @@ function createUserInstructionsGroup (
* @param moddle
* @returns entries
*/
function createAllowGuestGroup (
element,
translate,
moddle,
commandStack
) {
function createAllowGuestGroup(element, translate, moddle, commandStack) {
return {
id: 'allow_guest_user',
label: translate('Guest options'),
Expand All @@ -346,7 +362,8 @@ function createAllowGuestGroup (
component: SpiffExtensionCheckboxEntry,
name: 'spiffworkflow:AllowGuest',
label: 'Guest can complete this task',
description: 'Allow a guest user to complete this task without logging in. They will not be allowed to do anything but submit this task. If another task directly follows it that allows guest access, they could also complete that task.',
description:
'Allow a guest user to complete this task without logging in. They will not be allowed to do anything but submit this task. If another task directly follows it that allows guest access, they could also complete that task.',
},
{
element,
Expand All @@ -355,7 +372,8 @@ function createAllowGuestGroup (
component: SpiffExtensionTextArea,
name: 'spiffworkflow:GuestConfirmation',
label: 'Guest confirmation',
description: 'This is markdown that is displayed to the user after they complete the task. If this is filled out then the user will not be able to complete additional tasks without a new link to the next task.',
description:
'This is markdown that is displayed to the user after they complete the task. If this is filled out then the user will not be able to complete additional tasks without a new link to the next task.',
},
{
element,
Expand All @@ -366,7 +384,7 @@ function createAllowGuestGroup (
label: translate('Launch Editor'),
event: 'spiff.markdown.edit',
listenEvent: 'spiff.markdown.update',
}
},
],
};
}
Expand All @@ -379,15 +397,14 @@ function createAllowGuestGroup (
* @param moddle
* @returns entries
*/
function createSignalButtonGroup (
element,
translate,
moddle,
commandStack
) {
let description =
<p style={{maxWidth : "330px"}}> If attached to a user/manual task, setting this value will display a button which a user can click to immediately fire this signal event.
function createSignalButtonGroup(element, translate, moddle, commandStack) {
let description = (
<p style={{ maxWidth: '330px' }}>
{' '}
If attached to a user/manual task, setting this value will display a
button which a user can click to immediately fire this signal event.
</p>
);
return {
id: 'signal_button',
label: translate('Button'),
Expand All @@ -399,13 +416,12 @@ function createSignalButtonGroup (
component: SpiffExtensionTextInput,
name: 'spiffworkflow:SignalButtonLabel',
label: 'Button Label',
description: description
description: description,
},
],
};
}


/**
* Create a group on the main panel with a text box (for choosing the dmn to connect)
* @param element
Expand Down Expand Up @@ -441,7 +457,7 @@ function createServiceGroup(element, translate, moddle, commandStack) {
element,
moddle,
translate,
commandStack
commandStack,
}),
},
],
Expand Down
9 changes: 5 additions & 4 deletions app/spiffworkflow/messages/MessageHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function findCorrelationKeyForCorrelationProperty(shapeElement, moddle) {
}

export function findCorrelationPropertiesAndRetrievalExpressionsForMessage(
shapeElement
shapeElement,
) {
const formalExpressions = [];
const messageRefElement = getMessageRefElement(shapeElement);
Expand All @@ -95,7 +95,7 @@ export function findCorrelationPropertiesAndRetrievalExpressionsForMessage(
const retrievalExpression =
getRetrievalExpressionFromCorrelationProperty(
childElement,
messageRefElement
messageRefElement,
);
if (retrievalExpression) {
const formalExpression = {
Expand Down Expand Up @@ -128,7 +128,7 @@ export function getMessageElementForShapeElement(shapeElement) {

function getRetrievalExpressionFromCorrelationProperty(
correlationProperty,
message
message,
) {
if (correlationProperty.correlationPropertyRetrievalExpression) {
for (const retrievalExpression of correlationProperty.correlationPropertyRetrievalExpression) {
Expand Down Expand Up @@ -174,7 +174,8 @@ export function findCorrelationKeys(businessObject, moddle) {
if (rootElement.$type === 'bpmn:Collaboration') {
const currentKeys = rootElement.correlationKeys;
for (const correlationKey in currentKeys) {
const currentCorrelation = rootElement.correlationKeys[correlationKey];
const currentCorrelation =
rootElement.correlationKeys[correlationKey];
correlationKeys.push(currentCorrelation);
}
}
Expand Down

0 comments on commit fdaeacb

Please sign in to comment.