mirror of
https://github.com/sartography/bpmn-js-spiffworkflow.git
synced 2025-02-23 13:08:11 +00:00
ignoring some react lints for now
This commit is contained in:
parent
defcc1f191
commit
d1b336ea36
@ -5,7 +5,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
extends: [
|
extends: [
|
||||||
'airbnb',
|
'airbnb',
|
||||||
'plugin:bpmn-io/es6',
|
|
||||||
'plugin:prettier/recommended',
|
'plugin:prettier/recommended',
|
||||||
'plugin:sonarjs/recommended',
|
'plugin:sonarjs/recommended',
|
||||||
'plugin:import/errors',
|
'plugin:import/errors',
|
||||||
@ -40,5 +39,10 @@ module.exports = {
|
|||||||
tsx: 'never',
|
tsx: 'never',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// We could try turning these on at some point but do not want to force it now
|
||||||
|
'react/react-in-jsx-scope': 'off',
|
||||||
|
'react/prop-types': 'off',
|
||||||
|
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -11,39 +11,9 @@ export const SCRIPT_TYPE = {
|
|||||||
post: 'spiffworkflow:postScript',
|
post: 'spiffworkflow:postScript',
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a python script.
|
|
||||||
* @param element The elemment that should get the script task.
|
|
||||||
* @param scriptType The type of script -- can be a preScript, postScript or a BPMN:Script for script tags
|
|
||||||
* @param moddle For updating the underlying xml document when needed.
|
|
||||||
* @returns {[{component: (function(*)), isEdited: *, id: string, element},{component: (function(*)), isEdited: *, id: string, element}]}
|
|
||||||
*/
|
|
||||||
export default function (element, moddle, scriptType, label, description) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
id: `pythonScript_${scriptType}`,
|
|
||||||
element,
|
|
||||||
targetTag: scriptType,
|
|
||||||
component: PythonScript,
|
|
||||||
isEdited: isTextFieldEntryEdited,
|
|
||||||
moddle,
|
|
||||||
label,
|
|
||||||
description,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: `launchEditorButton${scriptType}`,
|
|
||||||
target_tag: scriptType,
|
|
||||||
element,
|
|
||||||
component: LaunchEditorButton,
|
|
||||||
isEdited: isTextFieldEntryEdited,
|
|
||||||
moddle,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
function PythonScript(props) {
|
function PythonScript(props) {
|
||||||
const { element, id } = props;
|
const { element, id } = props;
|
||||||
const type = props.targetTag;
|
const { type } = props;
|
||||||
const { moddle } = props;
|
const { moddle } = props;
|
||||||
const { label } = props;
|
const { label } = props;
|
||||||
const { description } = props;
|
const { description } = props;
|
||||||
@ -76,9 +46,11 @@ function PythonScript(props) {
|
|||||||
if (!bizObj.extensionElements) {
|
if (!bizObj.extensionElements) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return bizObj.extensionElements.get('values').filter(function (e) {
|
return bizObj.extensionElements
|
||||||
return e.$instanceOf(type);
|
.get('values')
|
||||||
})[0];
|
.filter(function getInstanceOfType(e) {
|
||||||
|
return e.$instanceOf(type);
|
||||||
|
})[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
const getValue = () => {
|
const getValue = () => {
|
||||||
@ -121,9 +93,8 @@ function PythonScript(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function LaunchEditorButton(props) {
|
function LaunchEditorButton(props) {
|
||||||
const { element, id, type } = props;
|
const { element, type } = props;
|
||||||
const eventBus = useService('eventBus');
|
const eventBus = useService('eventBus');
|
||||||
const modeling = useService('modeling');
|
|
||||||
// fixme: add a call up date as a property
|
// fixme: add a call up date as a property
|
||||||
return (
|
return (
|
||||||
<HeaderButton
|
<HeaderButton
|
||||||
@ -136,3 +107,39 @@ function LaunchEditorButton(props) {
|
|||||||
</HeaderButton>
|
</HeaderButton>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a python script.
|
||||||
|
* @param element The elemment that should get the script task.
|
||||||
|
* @param scriptType The type of script -- can be a preScript, postScript or a BPMN:Script for script tags
|
||||||
|
* @param moddle For updating the underlying xml document when needed.
|
||||||
|
* @returns {[{component: (function(*)), isEdited: *, id: string, element},{component: (function(*)), isEdited: *, id: string, element}]}
|
||||||
|
*/
|
||||||
|
export default function getEntries(
|
||||||
|
element,
|
||||||
|
moddle,
|
||||||
|
scriptType,
|
||||||
|
label,
|
||||||
|
description
|
||||||
|
) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
id: `pythonScript_${scriptType}`,
|
||||||
|
element,
|
||||||
|
type: scriptType,
|
||||||
|
component: PythonScript,
|
||||||
|
isEdited: isTextFieldEntryEdited,
|
||||||
|
moddle,
|
||||||
|
label,
|
||||||
|
description,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: `launchEditorButton${scriptType}`,
|
||||||
|
type: scriptType,
|
||||||
|
element,
|
||||||
|
component: LaunchEditorButton,
|
||||||
|
isEdited: isTextFieldEntryEdited,
|
||||||
|
moddle,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
import { TextAreaEntry, TextFieldEntry, isTextFieldEntryEdited } from '@bpmn-io/properties-panel';
|
import {
|
||||||
|
TextAreaEntry,
|
||||||
|
TextFieldEntry,
|
||||||
|
isTextFieldEntryEdited,
|
||||||
|
} from '@bpmn-io/properties-panel';
|
||||||
import { useService } from 'bpmn-js-properties-panel';
|
import { useService } from 'bpmn-js-properties-panel';
|
||||||
import { is, isAny } from 'bpmn-js/lib/util/ModelUtil';
|
import { is, isAny } from 'bpmn-js/lib/util/ModelUtil';
|
||||||
|
|
||||||
@ -6,9 +10,15 @@ import { is, isAny } from 'bpmn-js/lib/util/ModelUtil';
|
|||||||
// import { SpiffExtensionTextInput } from './SpiffExtensionTextInput';
|
// import { SpiffExtensionTextInput } from './SpiffExtensionTextInput';
|
||||||
const LOW_PRIORITY = 500;
|
const LOW_PRIORITY = 500;
|
||||||
|
|
||||||
export default function MessagesPropertiesProvider(propertiesPanel, translate, moddle, commandStack, elementRegistry) {
|
export default function MessagesPropertiesProvider(
|
||||||
this.getGroups = function(element) {
|
propertiesPanel,
|
||||||
return function(groups) {
|
translate,
|
||||||
|
moddle,
|
||||||
|
commandStack,
|
||||||
|
elementRegistry
|
||||||
|
) {
|
||||||
|
this.getGroups = function (element) {
|
||||||
|
return function (groups) {
|
||||||
if (is(element, 'bpmn:Collaboration')) {
|
if (is(element, 'bpmn:Collaboration')) {
|
||||||
groups.push(createCollaborationGroup(element, translate, moddle));
|
groups.push(createCollaborationGroup(element, translate, moddle));
|
||||||
}
|
}
|
||||||
@ -19,8 +29,44 @@ export default function MessagesPropertiesProvider(propertiesPanel, translate, m
|
|||||||
propertiesPanel.registerProvider(LOW_PRIORITY, this);
|
propertiesPanel.registerProvider(LOW_PRIORITY, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagesPropertiesProvider.$inject = [ 'propertiesPanel', 'translate', 'moddle', 'commandStack', 'elementRegistry' ];
|
MessagesPropertiesProvider.$inject = [
|
||||||
|
'propertiesPanel',
|
||||||
|
'translate',
|
||||||
|
'moddle',
|
||||||
|
'commandStack',
|
||||||
|
'elementRegistry',
|
||||||
|
];
|
||||||
|
|
||||||
|
function MessageCollaboration(props) {
|
||||||
|
const { element } = props;
|
||||||
|
const debounce = useService('debounceInput');
|
||||||
|
const getValue = () => {
|
||||||
|
return '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const setValue = (value) => {};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TextAreaEntry
|
||||||
|
id="message_collaborations"
|
||||||
|
element={element}
|
||||||
|
description="description"
|
||||||
|
label="label"
|
||||||
|
getValue={getValue}
|
||||||
|
setValue={setValue}
|
||||||
|
debounce={debounce}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function messageCollaborationGroup(element, _moddle, _label, _description) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
component: MessageCollaboration,
|
||||||
|
element,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a group to the properties panel for the script task that allows you
|
* Adds a group to the properties panel for the script task that allows you
|
||||||
@ -32,36 +78,11 @@ function createCollaborationGroup(element, translate, moddle, commandStack) {
|
|||||||
return {
|
return {
|
||||||
id: 'collaboration_id',
|
id: 'collaboration_id',
|
||||||
label: translate('Message Collaboration'),
|
label: translate('Message Collaboration'),
|
||||||
entries: messageCollaborationGroup(element, moddle, 'Collab', 'More Collabor')
|
entries: messageCollaborationGroup(
|
||||||
|
element,
|
||||||
|
moddle,
|
||||||
|
'Collab',
|
||||||
|
'More Collabor'
|
||||||
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function messageCollaborationGroup(element, moddle, label, description) {
|
|
||||||
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
component: MessageCollaboration,
|
|
||||||
element: element,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
function MessageCollaboration(props) {
|
|
||||||
const { element } = props;
|
|
||||||
const debounce = useService('debounceInput');
|
|
||||||
const getValue = () => {
|
|
||||||
return ""
|
|
||||||
};
|
|
||||||
|
|
||||||
const setValue = value => {
|
|
||||||
};
|
|
||||||
|
|
||||||
return <TextAreaEntry
|
|
||||||
id="message_collaborations"
|
|
||||||
element={ element }
|
|
||||||
description="description"
|
|
||||||
label="label"
|
|
||||||
getValue={ getValue }
|
|
||||||
setValue={ setValue }
|
|
||||||
debounce={ debounce }
|
|
||||||
/>;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user