format fe files based on new prettier w/ burnettk (#1674)

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
jasquat 2024-06-04 15:48:04 -04:00 committed by GitHub
parent a988e7691a
commit c7c2d61e78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
93 changed files with 528 additions and 526 deletions

View File

@ -36,7 +36,7 @@ export default function ContainerForExtensions() {
[targetUris.extensionListPath]: ['GET'], [targetUris.extensionListPath]: ['GET'],
}; };
const { ability, permissionsLoaded } = usePermissionFetcher( const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData permissionRequestData,
); );
const { removeError } = useAPIError(); const { removeError } = useAPIError();
@ -58,12 +58,12 @@ export default function ContainerForExtensions() {
const eni: UiSchemaUxElement[] = processModels const eni: UiSchemaUxElement[] = processModels
.map((processModel: ProcessModel) => { .map((processModel: ProcessModel) => {
const extensionUiSchemaFile = processModel.files.find( const extensionUiSchemaFile = processModel.files.find(
(file: ProcessFile) => file.name === 'extension_uischema.json' (file: ProcessFile) => file.name === 'extension_uischema.json',
); );
if (extensionUiSchemaFile && extensionUiSchemaFile.file_contents) { if (extensionUiSchemaFile && extensionUiSchemaFile.file_contents) {
try { try {
const extensionUiSchema: ExtensionUiSchema = JSON.parse( const extensionUiSchema: ExtensionUiSchema = JSON.parse(
extensionUiSchemaFile.file_contents extensionUiSchemaFile.file_contents,
); );
if ( if (
extensionUiSchema && extensionUiSchema &&
@ -74,7 +74,7 @@ export default function ContainerForExtensions() {
} }
} catch (jsonParseError: any) { } catch (jsonParseError: any) {
console.error( console.error(
`Unable to get navigation items for ${processModel.id}` `Unable to get navigation items for ${processModel.id}`,
); );
} }
} }

View File

@ -51,7 +51,7 @@ export default function ActiveUsers() {
15, 15,
DateAndTimeService.REFRESH_TIMEOUT_SECONDS, DateAndTimeService.REFRESH_TIMEOUT_SECONDS,
updateActiveUsers, updateActiveUsers,
unregisterUser unregisterUser,
); );
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []); // it is critical to only run this once. }, []); // it is critical to only run this once.

View File

@ -34,7 +34,7 @@ export default function DataStoreForm({
const [typeInvalid, setTypeInvalid] = useState<boolean>(false); const [typeInvalid, setTypeInvalid] = useState<boolean>(false);
const [schemaInvalid, setSchemaInvalid] = useState<boolean>(false); const [schemaInvalid, setSchemaInvalid] = useState<boolean>(false);
const [dataStoreTypes, setDataStoreTypes] = useState<[DataStoreType] | []>( const [dataStoreTypes, setDataStoreTypes] = useState<[DataStoreType] | []>(
[] [],
); );
const [selectedDataStoreType, setSelectedDataStoreType] = const [selectedDataStoreType, setSelectedDataStoreType] =
useState<DataStoreType | null>(null); useState<DataStoreType | null>(null);
@ -67,7 +67,7 @@ export default function DataStoreForm({
const location = dataStoreLocation(); const location = dataStoreLocation();
if (location !== '/') { if (location !== '/') {
navigate( navigate(
`/process-groups/${modifyProcessIdentifierForPathParam(location)}` `/process-groups/${modifyProcessIdentifierForPathParam(location)}`,
); );
} else { } else {
navigate(`/process-groups`); navigate(`/process-groups`);
@ -173,12 +173,12 @@ export default function DataStoreForm({
}; };
const dataStoreTypeDisplayString = ( const dataStoreTypeDisplayString = (
dataStoreType: DataStoreType | null dataStoreType: DataStoreType | null,
): string => { ): string => {
if (dataStoreType) { if (dataStoreType) {
return `${dataStoreType.name} (${truncateString( return `${dataStoreType.name} (${truncateString(
dataStoreType.description, dataStoreType.description,
75 75,
)})`; )})`;
} }
return ''; return '';
@ -215,7 +215,7 @@ export default function DataStoreForm({
} }
setIdHasBeenUpdatedByUser(true); setIdHasBeenUpdatedByUser(true);
}} }}
/> />,
); );
if (mode === 'edit') { if (mode === 'edit') {
@ -226,7 +226,7 @@ export default function DataStoreForm({
readonly readonly
labelText="Type*" labelText="Type*"
value={dataStoreTypeDisplayString(selectedDataStoreType)} value={dataStoreTypeDisplayString(selectedDataStoreType)}
/> />,
); );
} else { } else {
textInputs.push( textInputs.push(
@ -241,7 +241,7 @@ export default function DataStoreForm({
invalid={typeInvalid} invalid={typeInvalid}
placeholder="Choose the data store type" placeholder="Choose the data store type"
selectedItem={selectedDataStoreType} selectedItem={selectedDataStoreType}
/> />,
); );
} }
@ -254,7 +254,7 @@ export default function DataStoreForm({
labelText="Schema*" labelText="Schema*"
value={dataStore.schema} value={dataStore.schema}
onChange={(event: any) => onSchemaChanged(event.target.value)} onChange={(event: any) => onSchemaChanged(event.target.value)}
/> />,
); );
textInputs.push( textInputs.push(
@ -266,7 +266,7 @@ export default function DataStoreForm({
onChange={(event: any) => onChange={(event: any) =>
updateDataStore({ description: event.target.value }) updateDataStore({ description: event.target.value })
} }
/> />,
); );
return textInputs; return textInputs;

View File

@ -34,7 +34,7 @@ export default function DataStoreListTable() {
searchParams, searchParams,
10, 10,
1, 1,
'datastore' 'datastore',
); );
const dataStoreType = searchParams.get('type') || ''; const dataStoreType = searchParams.get('type') || '';
const dataStoreIdentifier = searchParams.get('identifier') || ''; const dataStoreIdentifier = searchParams.get('identifier') || '';
@ -114,7 +114,7 @@ export default function DataStoreListTable() {
searchParams, searchParams,
10, 10,
1, 1,
'datastore' 'datastore',
); );
return ( return (
<> <>

View File

@ -33,7 +33,7 @@ export default function DataStoreListTiles({
[targetUris.dataStoreListPath]: ['GET'], [targetUris.dataStoreListPath]: ['GET'],
}; };
const { ability, permissionsLoaded } = usePermissionFetcher( const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData permissionRequestData,
); );
useEffect(() => { useEffect(() => {

View File

@ -12,7 +12,7 @@ const defaultMessageClassName = 'failure-string';
function errorDetailDisplay( function errorDetailDisplay(
errorObject: any, errorObject: any,
propertyName: string, propertyName: string,
title: string title: string,
) { ) {
// Creates a bit of html for displaying a single error property if it exists. // Creates a bit of html for displaying a single error property if it exists.
let value = errorObject[propertyName]; let value = errorObject[propertyName];
@ -40,7 +40,7 @@ export const errorForDisplayFromString = (errorMessage: string) => {
export const errorForDisplayFromProcessInstanceErrorDetail = ( export const errorForDisplayFromProcessInstanceErrorDetail = (
processInstanceEvent: ProcessInstanceLogEntry, processInstanceEvent: ProcessInstanceLogEntry,
processInstanceErrorEventDetail: ProcessInstanceEventErrorDetail processInstanceErrorEventDetail: ProcessInstanceEventErrorDetail,
) => { ) => {
const errorForDisplay: ErrorForDisplay = { const errorForDisplay: ErrorForDisplay = {
message: processInstanceErrorEventDetail.message, message: processInstanceErrorEventDetail.message,
@ -56,7 +56,7 @@ export const errorForDisplayFromProcessInstanceErrorDetail = (
}; };
export const errorForDisplayFromTestCaseErrorDetails = ( export const errorForDisplayFromTestCaseErrorDetails = (
testCaseErrorDetails: TestCaseErrorDetails testCaseErrorDetails: TestCaseErrorDetails,
) => { ) => {
const errorForDisplay: ErrorForDisplay = { const errorForDisplay: ErrorForDisplay = {
message: testCaseErrorDetails.error_messages.join('\n'), message: testCaseErrorDetails.error_messages.join('\n'),
@ -99,19 +99,19 @@ export const childrenForErrorObject = (errorObject: ErrorForDisplay) => {
const lineNumber = errorDetailDisplay( const lineNumber = errorDetailDisplay(
errorObject, errorObject,
'line_number', 'line_number',
'Line Number' 'Line Number',
); );
const errorLine = errorDetailDisplay(errorObject, 'error_line', 'Context'); const errorLine = errorDetailDisplay(errorObject, 'error_line', 'Context');
const taskType = errorDetailDisplay(errorObject, 'task_type', 'Task Type'); const taskType = errorDetailDisplay(errorObject, 'task_type', 'Task Type');
const outputData = errorDetailDisplay( const outputData = errorDetailDisplay(
errorObject, errorObject,
'output_data', 'output_data',
'Output Data' 'Output Data',
); );
const expectedData = errorDetailDisplay( const expectedData = errorDetailDisplay(
errorObject, errorObject,
'expected_data', 'expected_data',
'Expected Data' 'Expected Data',
); );
let codeTrace = null; let codeTrace = null;
if (errorObject.task_trace && errorObject.task_trace.length > 0) { if (errorObject.task_trace && errorObject.task_trace.length > 0) {
@ -153,7 +153,7 @@ export const childrenForErrorObject = (errorObject: ErrorForDisplay) => {
export function ErrorDisplayStateless( export function ErrorDisplayStateless(
errorObject: ErrorForDisplay, errorObject: ErrorForDisplay,
onClose?: Function onClose?: Function,
) { ) {
const title = 'Error:'; const title = 'Error:';
const hideCloseButton = !onClose; const hideCloseButton = !onClose;

View File

@ -19,12 +19,12 @@ export function ExtensionUxElementMap({
const elementsForDisplayLocation = extensionUxElements.filter( const elementsForDisplayLocation = extensionUxElements.filter(
(uxElement: UiSchemaUxElement) => { (uxElement: UiSchemaUxElement) => {
return uxElement.display_location === displayLocation; return uxElement.display_location === displayLocation;
} },
); );
return elementsForDisplayLocation.map( return elementsForDisplayLocation.map(
(uxElement: UiSchemaUxElement, index: number) => { (uxElement: UiSchemaUxElement, index: number) => {
return elementCallback(uxElement, index); return elementCallback(uxElement, index);
} },
); );
}; };
return mainElement(); return mainElement();

View File

@ -46,7 +46,7 @@ export default function Filters({
iconDescription="Copy shareable link" iconDescription="Copy shareable link"
hasIconOnly hasIconOnly
size="md" size="md"
/> />,
); );
} }
elements.push( elements.push(
@ -57,7 +57,7 @@ export default function Filters({
hasIconOnly hasIconOnly
size="md" size="md"
onClick={toggleShowFilterOptions} onClick={toggleShowFilterOptions}
/> />,
); );
if (copiedReportLinktoClipboard) { if (copiedReportLinktoClipboard) {
elements.push( elements.push(
@ -68,7 +68,7 @@ export default function Filters({
timeout={2000} timeout={2000}
hideCloseButton hideCloseButton
withBottomMargin={false} withBottomMargin={false}
/> />,
); );
} }
return elements; return elements;

View File

@ -38,7 +38,7 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
searchParams, searchParams,
undefined, undefined,
undefined, undefined,
paginationQueryParamPrefix paginationQueryParamPrefix,
); );
let queryParamString = `per_page=${perPage}&page=${page}`; let queryParamString = `per_page=${perPage}&page=${page}`;
if (processInstanceId) { if (processInstanceId) {
@ -108,7 +108,7 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
<Link <Link
data-qa="process-instance-show-link" data-qa="process-instance-show-link"
to={`/process-instances/${modifyProcessIdentifierForPathParam( to={`/process-instances/${modifyProcessIdentifierForPathParam(
row.process_model_identifier row.process_model_identifier,
)}/${row.process_instance_id}`} )}/${row.process_instance_id}`}
> >
{row.process_instance_id} {row.process_instance_id}
@ -136,7 +136,7 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
<td>{row.status}</td> <td>{row.status}</td>
<td> <td>
{DateAndTimeService.convertSecondsToFormattedDateTime( {DateAndTimeService.convertSecondsToFormattedDateTime(
row.created_at_in_seconds row.created_at_in_seconds,
)} )}
</td> </td>
</tr> </tr>
@ -166,7 +166,7 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
searchParams, searchParams,
undefined, undefined,
undefined, undefined,
paginationQueryParamPrefix paginationQueryParamPrefix,
); );
let breadcrumbElement = null; let breadcrumbElement = null;
if (searchParams.get('process_instance_id')) { if (searchParams.get('process_instance_id')) {
@ -182,7 +182,7 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
[ [
`Process Instance: ${searchParams.get('process_instance_id')}`, `Process Instance: ${searchParams.get('process_instance_id')}`,
`/process-instances/${searchParams.get( `/process-instances/${searchParams.get(
'process_model_id' 'process_model_id',
)}/${searchParams.get('process_instance_id')}`, )}/${searchParams.get('process_instance_id')}`,
], ],
['Messages'], ['Messages'],

View File

@ -3,7 +3,7 @@ import { modifyProcessIdentifierForPathParam } from '../helpers';
import { MessageInstance, ProcessInstance } from '../interfaces'; import { MessageInstance, ProcessInstance } from '../interfaces';
export function FormatProcessModelDisplayName( export function FormatProcessModelDisplayName(
instanceObject: ProcessInstance | MessageInstance instanceObject: ProcessInstance | MessageInstance,
) { ) {
const { const {
process_model_identifier: processModelIdentifier, process_model_identifier: processModelIdentifier,
@ -12,7 +12,7 @@ export function FormatProcessModelDisplayName(
return ( return (
<Link <Link
to={`/process-models/${modifyProcessIdentifierForPathParam( to={`/process-models/${modifyProcessIdentifierForPathParam(
processModelIdentifier processModelIdentifier,
)}`} )}`}
title={processModelIdentifier} title={processModelIdentifier}
> >

View File

@ -232,7 +232,7 @@ export default function NavigationBar({ extensionUxElements }: OwnProps) {
to={navItemPage} to={navItemPage}
isActive={isActivePage(navItemPage)} isActive={isActivePage(navItemPage)}
data-qa={`extension-${slugifyString( data-qa={`extension-${slugifyString(
uxElement.label || uxElement.page uxElement.label || uxElement.page,
)}`} )}`}
> >
{uxElement.label || uxElement.page} {uxElement.label || uxElement.page}

View File

@ -33,7 +33,7 @@ export function Notification({
'data-qa': dataQa, 'data-qa': dataQa,
}: OwnProps) { }: OwnProps) {
const [showMessage, setShowMessage] = useState<boolean>( const [showMessage, setShowMessage] = useState<boolean>(
!allowTogglingFullMessage !allowTogglingFullMessage,
); );
let iconComponent = <Checkmark className="notification-icon" />; let iconComponent = <Checkmark className="notification-icon" />;
if (type === 'error') { if (type === 'error') {

View File

@ -21,7 +21,7 @@ test('renders hotCrumbs', () => {
[`Process Group: hey`], [`Process Group: hey`],
]} ]}
/> />
</BrowserRouter> </BrowserRouter>,
); );
const homeElement = screen.getByText(/Process Groups/); const homeElement = screen.getByText(/Process Groups/);
expect(homeElement).toBeInTheDocument(); expect(homeElement).toBeInTheDocument();

View File

@ -36,25 +36,25 @@ export default function ProcessBreadcrumb({ hotCrumbs }: OwnProps) {
if (entityType === 'process-model-id') { if (entityType === 'process-model-id') {
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `/process-models/${modifyProcessIdentifierForPathParam( path: `/process-models/${modifyProcessIdentifierForPathParam(
entityToExplode as string entityToExplode as string,
)}`, )}`,
successCallback: setProcessEntity, successCallback: setProcessEntity,
onUnauthorized: () => {}, onUnauthorized: () => {},
failureCallback: (error: any) => failureCallback: (error: any) =>
console.error( console.error(
`Failed to load process model for breadcrumb. Error was: ${error.message}` `Failed to load process model for breadcrumb. Error was: ${error.message}`,
), ),
}); });
} else if (entityType === 'process-group-id') { } else if (entityType === 'process-group-id') {
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `/process-groups/${modifyProcessIdentifierForPathParam( path: `/process-groups/${modifyProcessIdentifierForPathParam(
entityToExplode as string entityToExplode as string,
)}`, )}`,
successCallback: setProcessEntity, successCallback: setProcessEntity,
onUnauthorized: () => {}, onUnauthorized: () => {},
failureCallback: (error: any) => failureCallback: (error: any) =>
console.error( console.error(
`Failed to load process group for breadcrumb. Error was: ${error.message}` `Failed to load process group for breadcrumb. Error was: ${error.message}`,
), ),
}); });
} else { } else {
@ -93,14 +93,14 @@ export default function ProcessBreadcrumb({ hotCrumbs }: OwnProps) {
const breadcrumbs = processEntity.parent_groups.map( const breadcrumbs = processEntity.parent_groups.map(
(parentGroup: ProcessGroupLite) => { (parentGroup: ProcessGroupLite) => {
const fullUrl = `/process-groups/${modifyProcessIdentifierForPathParam( const fullUrl = `/process-groups/${modifyProcessIdentifierForPathParam(
parentGroup.id parentGroup.id,
)}`; )}`;
return ( return (
<Link key={parentGroup.id} to={fullUrl}> <Link key={parentGroup.id} to={fullUrl}>
{parentGroup.display_name} {parentGroup.display_name}
</Link> </Link>
); );
} },
); );
if (crumb.linkLastItem) { if (crumb.linkLastItem) {
@ -111,18 +111,18 @@ export default function ProcessBreadcrumb({ hotCrumbs }: OwnProps) {
dataQaTag = 'process-model-breadcrumb-link'; dataQaTag = 'process-model-breadcrumb-link';
} }
const fullUrl = `${apiBase}/${modifyProcessIdentifierForPathParam( const fullUrl = `${apiBase}/${modifyProcessIdentifierForPathParam(
processEntity.id processEntity.id,
)}`; )}`;
breadcrumbs.push( breadcrumbs.push(
<Link key={processEntity.id} to={fullUrl} data-qa={dataQaTag}> <Link key={processEntity.id} to={fullUrl} data-qa={dataQaTag}>
{processEntity.display_name} {processEntity.display_name}
</Link> </Link>,
); );
} else { } else {
breadcrumbs.push( breadcrumbs.push(
<Typography key={processEntity.id} color="text.primary"> <Typography key={processEntity.id} color="text.primary">
{processEntity.display_name} {processEntity.display_name}
</Typography> </Typography>,
); );
} }
return breadcrumbs; return breadcrumbs;
@ -146,7 +146,7 @@ export default function ProcessBreadcrumb({ hotCrumbs }: OwnProps) {
} }
} }
return null; return null;
} },
); );
return ( return (
<Breadcrumbs className="spiff-breadcrumb"> <Breadcrumbs className="spiff-breadcrumb">

View File

@ -32,8 +32,8 @@ export default function ProcessGroupForm({
updateProcessGroupCache(processGroup); updateProcessGroupCache(processGroup);
navigate( navigate(
`/process-groups/${modifyProcessIdentifierForPathParam( `/process-groups/${modifyProcessIdentifierForPathParam(
newProcessGroupId newProcessGroupId,
)}` )}`,
); );
} }
}; };
@ -62,7 +62,7 @@ export default function ProcessGroupForm({
let path = '/process-groups'; let path = '/process-groups';
if (mode === 'edit') { if (mode === 'edit') {
path = `/process-groups/${modifyProcessIdentifierForPathParam( path = `/process-groups/${modifyProcessIdentifierForPathParam(
processGroup.id processGroup.id,
)}`; )}`;
} }
let httpMethod = 'POST'; let httpMethod = 'POST';
@ -140,7 +140,7 @@ export default function ProcessGroupForm({
} }
setIdHasBeenUpdatedByUser(true); setIdHasBeenUpdatedByUser(true);
}} }}
/> />,
); );
} }
@ -153,7 +153,7 @@ export default function ProcessGroupForm({
onChange={(event: any) => onChange={(event: any) =>
updateProcessGroup({ description: event.target.value }) updateProcessGroup({ description: event.target.value })
} }
/> />,
); );
return textInputs; return textInputs;

View File

@ -28,7 +28,7 @@ export default function ProcessGroupListTiles({
const navigate = useNavigate(); const navigate = useNavigate();
const [processGroups, setProcessGroups] = useState<ProcessGroup[] | null>( const [processGroups, setProcessGroups] = useState<ProcessGroup[] | null>(
null null,
); );
useEffect(() => { useEffect(() => {
@ -69,7 +69,7 @@ export default function ProcessGroupListTiles({
className="tile-process-group" className="tile-process-group"
onClick={() => onClick={() =>
navigateToProcessGroup( navigateToProcessGroup(
`/process-groups/${modifyProcessIdentifierForPathParam(row.id)}` `/process-groups/${modifyProcessIdentifierForPathParam(row.id)}`,
) )
} }
> >

View File

@ -31,7 +31,7 @@ export default function ProcessInstanceCurrentTaskInfo({
const inlineMessage = ( const inlineMessage = (
title: string, title: string,
subtitle: string, subtitle: string,
kind: string = 'info' kind: string = 'info',
) => { ) => {
return ( return (
<div> <div>
@ -60,13 +60,13 @@ export default function ProcessInstanceCurrentTaskInfo({
potentialOwnerArray = potentialOwnerArray.slice(0, 2).concat(['...']); potentialOwnerArray = potentialOwnerArray.slice(0, 2).concat(['...']);
} }
message = `This next task is assigned to user(s): ${potentialOwnerArray.join( message = `This next task is assigned to user(s): ${potentialOwnerArray.join(
', ' ', ',
)}.`; )}.`;
} }
return inlineMessage( return inlineMessage(
'', '',
`${message} There is no action for you to take at this time.` `${message} There is no action for you to take at this time.`,
); );
} }
if (task && task.can_complete && HUMAN_TASK_TYPES.includes(task.type)) { if (task && task.can_complete && HUMAN_TASK_TYPES.includes(task.type)) {
@ -87,7 +87,7 @@ export default function ProcessInstanceCurrentTaskInfo({
return inlineMessage( return inlineMessage(
`Process ${processInstance.status}`, `Process ${processInstance.status}`,
`This process instance was ${processInstance.status} by an administrator. Please get in touch with them for more information.`, `This process instance was ${processInstance.status} by an administrator. Please get in touch with them for more information.`,
'warning' 'warning',
); );
} }
if (processInstance.status === 'error') { if (processInstance.status === 'error') {

View File

@ -25,7 +25,7 @@ export default function ProcessInstanceListSaveAsReport({
reportMetadata, reportMetadata,
}: OwnProps) { }: OwnProps) {
const [identifier, setIdentifier] = useState<string>( const [identifier, setIdentifier] = useState<string>(
processInstanceReportSelection?.identifier || '' processInstanceReportSelection?.identifier || '',
); );
const [showSaveForm, setShowSaveForm] = useState<boolean>(false); const [showSaveForm, setShowSaveForm] = useState<boolean>(false);

View File

@ -86,7 +86,7 @@ export default function ProcessInstanceListTable({
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
const [processInstances, setProcessInstances] = useState<ProcessInstance[]>( const [processInstances, setProcessInstances] = useState<ProcessInstance[]>(
[] [],
); );
const [ const [
reportMetadataFromProcessInstances, reportMetadataFromProcessInstances,
@ -131,7 +131,7 @@ export default function ProcessInstanceListTable({
onProcessInstanceTableListUpdate(result); onProcessInstanceTableListUpdate(result);
} }
}, },
[onProcessInstanceTableListUpdate] [onProcessInstanceTableListUpdate],
); );
const getProcessInstances = useCallback( const getProcessInstances = useCallback(
@ -150,7 +150,7 @@ export default function ProcessInstanceListTable({
searchParams, searchParams,
undefined, undefined,
undefined, undefined,
paginationQueryParamPrefix paginationQueryParamPrefix,
); );
if (perPageOptions && !perPageOptions.includes(perPage)) { if (perPageOptions && !perPageOptions.includes(perPage)) {
// eslint-disable-next-line prefer-destructuring // eslint-disable-next-line prefer-destructuring
@ -185,12 +185,12 @@ export default function ProcessInstanceListTable({
searchParams, searchParams,
setProcessInstancesFromResult, setProcessInstancesFromResult,
stopRefreshing, stopRefreshing,
] ],
); );
useEffect(() => { useEffect(() => {
const setReportMetadataFromReport = ( const setReportMetadataFromReport = (
processInstanceReport: ProcessInstanceReport processInstanceReport: ProcessInstanceReport,
) => { ) => {
getProcessInstances(processInstanceReport.report_metadata); getProcessInstances(processInstanceReport.report_metadata);
}; };
@ -212,7 +212,7 @@ export default function ProcessInstanceListTable({
clearRefreshRef.current = refreshAtInterval( clearRefreshRef.current = refreshAtInterval(
DateAndTimeService.REFRESH_INTERVAL_SECONDS, DateAndTimeService.REFRESH_INTERVAL_SECONDS,
DateAndTimeService.REFRESH_TIMEOUT_SECONDS, DateAndTimeService.REFRESH_TIMEOUT_SECONDS,
checkForReportAndRun checkForReportAndRun,
); );
return clearRefreshRef.current; return clearRefreshRef.current;
} }
@ -234,15 +234,15 @@ export default function ProcessInstanceListTable({
const getProcessModelSpanTag = ( const getProcessModelSpanTag = (
_processInstance: ProcessInstance, _processInstance: ProcessInstance,
identifier: string identifier: string,
) => { ) => {
return <span>{identifier}</span>; return <span>{identifier}</span>;
}; };
const navigateToProcessInstance = (processInstance: ProcessInstance) => { const navigateToProcessInstance = (processInstance: ProcessInstance) => {
navigate( navigate(
`${processInstanceShowPathPrefix}/${modifyProcessIdentifierForPathParam( `${processInstanceShowPathPrefix}/${modifyProcessIdentifierForPathParam(
processInstance.process_model_identifier processInstance.process_model_identifier,
)}/${processInstance.id}` )}/${processInstance.id}`,
); );
}; };
@ -267,7 +267,7 @@ export default function ProcessInstanceListTable({
}; };
const formatProcessInstanceId = ( const formatProcessInstanceId = (
processInstance: ProcessInstance, processInstance: ProcessInstance,
id: number id: number,
) => { ) => {
return <span data-qa="paginated-entity-id">{id}</span>; return <span data-qa="paginated-entity-id">{id}</span>;
// when we get rid of clickable table rows, something like this will be better // when we get rid of clickable table rows, something like this will be better
@ -283,23 +283,23 @@ export default function ProcessInstanceListTable({
}; };
const formatProcessModelIdentifier = ( const formatProcessModelIdentifier = (
processInstance: ProcessInstance, processInstance: ProcessInstance,
identifier: any identifier: any,
) => { ) => {
return getProcessModelSpanTag(processInstance, identifier); return getProcessModelSpanTag(processInstance, identifier);
}; };
const formatProcessModelDisplayName = ( const formatProcessModelDisplayName = (
processInstance: ProcessInstance, processInstance: ProcessInstance,
identifier: any identifier: any,
) => { ) => {
return getProcessModelSpanTag(processInstance, identifier); return getProcessModelSpanTag(processInstance, identifier);
}; };
const formatLastMilestone = ( const formatLastMilestone = (
processInstance: ProcessInstance, processInstance: ProcessInstance,
value: any value: any,
) => { ) => {
const [valueToUse, truncatedValue] = getLastMilestoneFromProcessInstance( const [valueToUse, truncatedValue] = getLastMilestoneFromProcessInstance(
processInstance, processInstance,
value value,
); );
return <span title={valueToUse}>{truncatedValue}</span>; return <span title={valueToUse}>{truncatedValue}</span>;
}; };
@ -323,7 +323,7 @@ export default function ProcessInstanceListTable({
}; };
const formattedColumn = ( const formattedColumn = (
processInstance: ProcessInstance, processInstance: ProcessInstance,
column: ReportColumn column: ReportColumn,
) => { ) => {
const reportColumnFormatters: Record<string, any> = { const reportColumnFormatters: Record<string, any> = {
id: formatProcessInstanceId, id: formatProcessInstanceId,
@ -522,7 +522,7 @@ export default function ProcessInstanceListTable({
); );
} }
const piLink = `${processInstanceShowPathPrefix}/${modifyProcessIdentifierForPathParam( const piLink = `${processInstanceShowPathPrefix}/${modifyProcessIdentifierForPathParam(
processInstance.process_model_identifier processInstance.process_model_identifier,
)}/${processInstance.id}`; )}/${processInstance.id}`;
const piShowButtonElement = ( const piShowButtonElement = (
<Button <Button
@ -551,7 +551,7 @@ export default function ProcessInstanceListTable({
{goButtonElement} {goButtonElement}
{piShowButtonElement} {piShowButtonElement}
</ButtonSet> </ButtonSet>
</TableCell> </TableCell>,
); );
} else { } else {
currentRow.push(<td>{piShowButtonElement}</td>); currentRow.push(<td>{piShowButtonElement}</td>);
@ -612,13 +612,13 @@ export default function ProcessInstanceListTable({
if (additionalReportFilters && reportMetadata) { if (additionalReportFilters && reportMetadata) {
errors.push( errors.push(
'Both reportMetadata and additionalReportFilters were provided. ' + 'Both reportMetadata and additionalReportFilters were provided. ' +
'It is recommended to only use additionalReportFilters with reportIdentifier and to specify ALL filters in reportMetadata if not using reportIdentifier.' 'It is recommended to only use additionalReportFilters with reportIdentifier and to specify ALL filters in reportMetadata if not using reportIdentifier.',
); );
} }
if (reportIdentifier && reportMetadata) { if (reportIdentifier && reportMetadata) {
errors.push( errors.push(
'Both reportIdentifier and reportMetadata were provided. ' + 'Both reportIdentifier and reportMetadata were provided. ' +
'You must use one or the other.' 'You must use one or the other.',
); );
} }
if (errors.length > 0) { if (errors.length > 0) {
@ -627,7 +627,7 @@ export default function ProcessInstanceListTable({
{tableTitleLine()} {tableTitleLine()}
<Column sm={{ span: 4 }} md={{ span: 8 }} lg={{ span: 16 }}> <Column sm={{ span: 4 }} md={{ span: 8 }} lg={{ span: 16 }}>
{childrenForErrorObject( {childrenForErrorObject(
errorForDisplayFromString(errors.join(' ::: ')) errorForDisplayFromString(errors.join(' ::: ')),
)} )}
</Column> </Column>
</Grid> </Grid>
@ -641,7 +641,7 @@ export default function ProcessInstanceListTable({
searchParams, searchParams,
undefined, undefined,
undefined, undefined,
paginationQueryParamPrefix paginationQueryParamPrefix,
); );
if (perPageOptions && !perPageOptions.includes(perPage)) { if (perPageOptions && !perPageOptions.includes(perPage)) {
// eslint-disable-next-line prefer-destructuring // eslint-disable-next-line prefer-destructuring

View File

@ -117,12 +117,12 @@ export default function ProcessInstanceListTableWithFilters({
[targetUris.userSearch]: ['GET'], [targetUris.userSearch]: ['GET'],
}; };
const { ability, permissionsLoaded } = usePermissionFetcher( const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData permissionRequestData,
); );
const canSearchUsers: boolean = ability.can('GET', targetUris.userSearch); const canSearchUsers: boolean = ability.can('GET', targetUris.userSearch);
const [reportMetadata, setReportMetadata] = useState<ReportMetadata | null>( const [reportMetadata, setReportMetadata] = useState<ReportMetadata | null>(
null null,
); );
const [startFromDate, setStartFromDate] = useState<string>(''); const [startFromDate, setStartFromDate] = useState<string>('');
@ -159,7 +159,7 @@ export default function ProcessInstanceListTableWithFilters({
variant === 'all' ? '/process-instances/all' : '/process-instances/for-me'; variant === 'all' ? '/process-instances/all' : '/process-instances/for-me';
const [processStatusAllOptions, setProcessStatusAllOptions] = useState<any[]>( const [processStatusAllOptions, setProcessStatusAllOptions] = useState<any[]>(
[] [],
); );
const [processStatusSelection, setProcessStatusSelection] = useState< const [processStatusSelection, setProcessStatusSelection] = useState<
string[] string[]
@ -199,7 +199,7 @@ export default function ProcessInstanceListTableWithFilters({
useState<boolean>(showActionsColumn); useState<boolean>(showActionsColumn);
const [systemReport, setSystemReport] = useState<string | null>(null); const [systemReport, setSystemReport] = useState<string | null>(null);
const [selectedUserGroup, setSelectedUserGroup] = useState<string | null>( const [selectedUserGroup, setSelectedUserGroup] = useState<string | null>(
null null,
); );
const [userGroups, setUserGroups] = useState<string[]>([]); const [userGroups, setUserGroups] = useState<string[]>([]);
const systemReportOptions: string[] = useMemo(() => { const systemReportOptions: string[] = useMemo(() => {
@ -263,7 +263,7 @@ export default function ProcessInstanceListTableWithFilters({
const setReportMetadataFromReport = useCallback( const setReportMetadataFromReport = useCallback(
( (
processInstanceReport: ProcessInstanceReport | null = null processInstanceReport: ProcessInstanceReport | null = null,
// eslint-disable-next-line sonarjs/cognitive-complexity // eslint-disable-next-line sonarjs/cognitive-complexity
) => { ) => {
let reportMetadataBodyToUse: ReportMetadata = { let reportMetadataBodyToUse: ReportMetadata = {
@ -289,7 +289,7 @@ export default function ProcessInstanceListTableWithFilters({
if ( if (
showActionsColumn && showActionsColumn &&
!reportMetadataBodyToUse.filter_by.some( !reportMetadataBodyToUse.filter_by.some(
(rf: ReportFilter) => rf.field_name === 'with_oldest_open_task' (rf: ReportFilter) => rf.field_name === 'with_oldest_open_task',
) )
) { ) {
const withOldestReportFilter = { const withOldestReportFilter = {
@ -311,7 +311,7 @@ export default function ProcessInstanceListTableWithFilters({
(reportFilter: ReportFilter) => { (reportFilter: ReportFilter) => {
if (reportFilter.field_name === 'process_status') { if (reportFilter.field_name === 'process_status') {
setProcessStatusSelection( setProcessStatusSelection(
(reportFilter.field_value || '').split(',') (reportFilter.field_value || '').split(','),
); );
} else if (reportFilter.field_name === 'process_initiator_username') { } else if (reportFilter.field_name === 'process_initiator_username') {
setProcessInitiatorSelection(reportFilter.field_value || ''); setProcessInitiatorSelection(reportFilter.field_value || '');
@ -330,7 +330,7 @@ export default function ProcessInstanceListTableWithFilters({
if (processModel.id === reportFilter.field_value) { if (processModel.id === reportFilter.field_value) {
setProcessModelSelection(processModel); setProcessModelSelection(processModel);
} }
} },
); );
} }
} else if (dateParametersToAlwaysFilterBy[reportFilter.field_name]) { } else if (dateParametersToAlwaysFilterBy[reportFilter.field_name]) {
@ -341,17 +341,17 @@ export default function ProcessInstanceListTableWithFilters({
if (reportFilter.field_value) { if (reportFilter.field_value) {
const dateString = const dateString =
DateAndTimeService.convertSecondsToFormattedDateString( DateAndTimeService.convertSecondsToFormattedDateString(
reportFilter.field_value as any reportFilter.field_value as any,
); );
dateFunctionToCall(dateString); dateFunctionToCall(dateString);
const timeString = const timeString =
DateAndTimeService.convertSecondsToFormattedTimeHoursMinutes( DateAndTimeService.convertSecondsToFormattedTimeHoursMinutes(
reportFilter.field_value as any reportFilter.field_value as any,
); );
timeFunctionToCall(timeString); timeFunctionToCall(timeString);
} }
} }
} },
); );
if (reportMetadataBodyToUse.filter_by.length > 1) { if (reportMetadataBodyToUse.filter_by.length > 1) {
@ -373,7 +373,7 @@ export default function ProcessInstanceListTableWithFilters({
filtersEnabled, filtersEnabled,
showActionsColumn, showActionsColumn,
systemReportOptions, systemReportOptions,
] ],
); );
// this is in its own callback to limit scrope of states we need to watch since // this is in its own callback to limit scrope of states we need to watch since
@ -428,7 +428,7 @@ export default function ProcessInstanceListTableWithFilters({
const processStatusAllOptionsArray = PROCESS_STATUSES.map( const processStatusAllOptionsArray = PROCESS_STATUSES.map(
(processStatusOption: any) => { (processStatusOption: any) => {
return processStatusOption; return processStatusOption;
} },
); );
setProcessStatusAllOptions(processStatusAllOptionsArray); setProcessStatusAllOptions(processStatusAllOptionsArray);
getReportMetadataWithReportHash(); getReportMetadataWithReportHash();
@ -458,10 +458,10 @@ export default function ProcessInstanceListTableWithFilters({
const removeFieldFromReportMetadata = ( const removeFieldFromReportMetadata = (
reportMetadataToUse: ReportMetadata, reportMetadataToUse: ReportMetadata,
fieldName: string fieldName: string,
) => { ) => {
const filtersToKeep = reportMetadataToUse.filter_by.filter( const filtersToKeep = reportMetadataToUse.filter_by.filter(
(rf: ReportFilter) => rf.field_name !== fieldName (rf: ReportFilter) => rf.field_name !== fieldName,
); );
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
reportMetadataToUse.filter_by = filtersToKeep; reportMetadataToUse.filter_by = filtersToKeep;
@ -469,13 +469,13 @@ export default function ProcessInstanceListTableWithFilters({
const getFilterByFromReportMetadata = ( const getFilterByFromReportMetadata = (
reportColumnAccessor: string, reportColumnAccessor: string,
reportMetadataToUse: ReportMetadata | null = reportMetadata reportMetadataToUse: ReportMetadata | null = reportMetadata,
) => { ) => {
if (reportMetadataToUse) { if (reportMetadataToUse) {
return reportMetadataToUse.filter_by.find( return reportMetadataToUse.filter_by.find(
(reportFilter: ReportFilter) => { (reportFilter: ReportFilter) => {
return reportColumnAccessor === reportFilter.field_name; return reportColumnAccessor === reportFilter.field_name;
} },
); );
} }
return null; return null;
@ -484,12 +484,12 @@ export default function ProcessInstanceListTableWithFilters({
const insertOrUpdateFieldInReportMetadata = ( const insertOrUpdateFieldInReportMetadata = (
reportMetadataToUse: ReportMetadata, reportMetadataToUse: ReportMetadata,
fieldName: string, fieldName: string,
fieldValue: any fieldValue: any,
) => { ) => {
if (fieldValue) { if (fieldValue) {
let existingReportFilter = getFilterByFromReportMetadata( let existingReportFilter = getFilterByFromReportMetadata(
fieldName, fieldName,
reportMetadataToUse reportMetadataToUse,
); );
if (existingReportFilter) { if (existingReportFilter) {
existingReportFilter.field_value = fieldValue; existingReportFilter.field_value = fieldValue;
@ -510,14 +510,14 @@ export default function ProcessInstanceListTableWithFilters({
const handleProcessInstanceInitiatorSearchResult = ( const handleProcessInstanceInitiatorSearchResult = (
result: any, result: any,
inputText: string inputText: string,
) => { ) => {
if ( if (
reportMetadata && reportMetadata &&
lastRequestedInitatorSearchTerm.current === result.username_prefix lastRequestedInitatorSearchTerm.current === result.username_prefix
) { ) {
setProcessInstanceInitiatorOptions( setProcessInstanceInitiatorOptions(
result.users.map((user: User) => user.username) result.users.map((user: User) => user.username),
); );
result.users.forEach((user: User) => { result.users.forEach((user: User) => {
if (user.username === inputText) { if (user.username === inputText) {
@ -526,7 +526,7 @@ export default function ProcessInstanceListTableWithFilters({
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
'process_initiator_username', 'process_initiator_username',
user.username user.username,
); );
setProcessInitiatorSelection(user.username); setProcessInitiatorSelection(user.username);
} }
@ -550,7 +550,7 @@ export default function ProcessInstanceListTableWithFilters({
searchForProcessInitiator(value); searchForProcessInitiator(value);
}, },
// delay in ms // delay in ms
250 250,
); );
const processInstanceReportSaveTag = () => { const processInstanceReportSaveTag = () => {
@ -600,21 +600,21 @@ export default function ProcessInstanceListTableWithFilters({
const startFromSeconds = const startFromSeconds =
DateAndTimeService.convertDateAndTimeStringsToSeconds( DateAndTimeService.convertDateAndTimeStringsToSeconds(
startFromDate, startFromDate,
startFromTime || '00:00:00' startFromTime || '00:00:00',
); );
const startToSeconds = const startToSeconds =
DateAndTimeService.convertDateAndTimeStringsToSeconds( DateAndTimeService.convertDateAndTimeStringsToSeconds(
startToDate, startToDate,
startToTime || '00:00:00' startToTime || '00:00:00',
); );
const endFromSeconds = const endFromSeconds =
DateAndTimeService.convertDateAndTimeStringsToSeconds( DateAndTimeService.convertDateAndTimeStringsToSeconds(
endFromDate, endFromDate,
endFromTime || '00:00:00' endFromTime || '00:00:00',
); );
const endToSeconds = DateAndTimeService.convertDateAndTimeStringsToSeconds( const endToSeconds = DateAndTimeService.convertDateAndTimeStringsToSeconds(
endToDate, endToDate,
endToTime || '00:00:00' endToTime || '00:00:00',
); );
let message = ''; let message = '';
@ -652,7 +652,7 @@ export default function ProcessInstanceListTableWithFilters({
onChangeDateFunction: any, onChangeDateFunction: any,
onChangeTimeFunction: any, onChangeTimeFunction: any,
timeInvalid: boolean, timeInvalid: boolean,
setTimeInvalid: any setTimeInvalid: any,
) => { ) => {
if (!reportMetadata) { if (!reportMetadata) {
return null; return null;
@ -677,19 +677,19 @@ export default function ProcessInstanceListTableWithFilters({
if (!initialDate && !initialTime) { if (!initialDate && !initialTime) {
onChangeTimeFunction( onChangeTimeFunction(
DateAndTimeService.convertDateObjectToFormattedHoursMinutes( DateAndTimeService.convertDateObjectToFormattedHoursMinutes(
new Date() new Date(),
) ),
); );
} }
const newValue = const newValue =
DateAndTimeService.convertDateAndTimeStringsToSeconds( DateAndTimeService.convertDateAndTimeStringsToSeconds(
dateChangeEvent.srcElement.value, dateChangeEvent.srcElement.value,
initialTime || '00:00:00' initialTime || '00:00:00',
); );
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
propNameUnderscored, propNameUnderscored,
newValue newValue,
); );
onChangeDateFunction(dateChangeEvent.srcElement.value); onChangeDateFunction(dateChangeEvent.srcElement.value);
validateStartAndEndSeconds(); validateStartAndEndSeconds();
@ -712,12 +712,12 @@ export default function ProcessInstanceListTableWithFilters({
const newValue = const newValue =
DateAndTimeService.convertDateAndTimeStringsToSeconds( DateAndTimeService.convertDateAndTimeStringsToSeconds(
initialDate, initialDate,
event.srcElement.value event.srcElement.value,
); );
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
propNameUnderscored, propNameUnderscored,
newValue newValue,
); );
onChangeTimeFunction(event.srcElement.value); onChangeTimeFunction(event.srcElement.value);
validateStartAndEndSeconds(); validateStartAndEndSeconds();
@ -746,7 +746,7 @@ export default function ProcessInstanceListTableWithFilters({
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
'process_status', 'process_status',
selection.selectedItems.join(',') selection.selectedItems.join(','),
); );
setProcessStatusSelection(selection.selectedItems); setProcessStatusSelection(selection.selectedItems);
}} }}
@ -785,7 +785,7 @@ export default function ProcessInstanceListTableWithFilters({
}; };
const onSaveReportSuccess = ( const onSaveReportSuccess = (
processInstanceReport: ProcessInstanceReport processInstanceReport: ProcessInstanceReport,
) => { ) => {
setProcessInstanceReportSelection(processInstanceReport); setProcessInstanceReportSelection(processInstanceReport);
searchParams.set('report_id', processInstanceReport.id.toString()); searchParams.set('report_id', processInstanceReport.id.toString());
@ -821,11 +821,11 @@ export default function ProcessInstanceListTableWithFilters({
if (reportMetadata) { if (reportMetadata) {
const reportMetadataCopy = { ...reportMetadata }; const reportMetadataCopy = { ...reportMetadata };
const newColumns = reportColumns().filter( const newColumns = reportColumns().filter(
(rc: ReportColumn) => rc.accessor !== reportColumn.accessor (rc: ReportColumn) => rc.accessor !== reportColumn.accessor,
); );
Object.assign(reportMetadataCopy, { columns: newColumns }); Object.assign(reportMetadataCopy, { columns: newColumns });
const newFilters = reportMetadataCopy.filter_by.filter( const newFilters = reportMetadataCopy.filter_by.filter(
(rf: ReportFilter) => rf.field_name !== reportColumn.accessor (rf: ReportFilter) => rf.field_name !== reportColumn.accessor,
); );
Object.assign(reportMetadataCopy, { Object.assign(reportMetadataCopy, {
columns: newColumns, columns: newColumns,
@ -842,7 +842,7 @@ export default function ProcessInstanceListTableWithFilters({
}; };
const getFilterOperatorFromReportColumn = ( const getFilterOperatorFromReportColumn = (
reportColumnForEditing: ReportColumnForEditing reportColumnForEditing: ReportColumnForEditing,
) => { ) => {
if (reportColumnForEditing.filter_operator) { if (reportColumnForEditing.filter_operator) {
// eslint-disable-next-line prefer-destructuring // eslint-disable-next-line prefer-destructuring
@ -854,7 +854,7 @@ export default function ProcessInstanceListTableWithFilters({
}; };
const getNewFiltersFromReportForEditing = ( const getNewFiltersFromReportForEditing = (
reportColumnForEditing: ReportColumnForEditing reportColumnForEditing: ReportColumnForEditing,
) => { ) => {
if (!reportMetadata) { if (!reportMetadata) {
return null; return null;
@ -868,10 +868,10 @@ export default function ProcessInstanceListTableWithFilters({
operator: reportColumnForEditing.filter_operator || 'equals', operator: reportColumnForEditing.filter_operator || 'equals',
}; };
const existingReportFilter = getFilterByFromReportMetadata( const existingReportFilter = getFilterByFromReportMetadata(
reportColumnForEditing.accessor reportColumnForEditing.accessor,
); );
const filterOperator = getFilterOperatorFromReportColumn( const filterOperator = getFilterOperatorFromReportColumn(
reportColumnForEditing reportColumnForEditing,
); );
if (existingReportFilter) { if (existingReportFilter) {
const existingReportFilterIndex = const existingReportFilterIndex =
@ -921,11 +921,11 @@ export default function ProcessInstanceListTableWithFilters({
const reportColumnToReportColumnForEditing = (reportColumn: ReportColumn) => { const reportColumnToReportColumnForEditing = (reportColumn: ReportColumn) => {
const reportColumnForEditing: ReportColumnForEditing = Object.assign( const reportColumnForEditing: ReportColumnForEditing = Object.assign(
reportColumn, reportColumn,
{ filter_field_value: '', filter_operator: '' } { filter_field_value: '', filter_operator: '' },
); );
if (reportColumn.filterable) { if (reportColumn.filterable) {
const reportFilter = getFilterByFromReportMetadata( const reportFilter = getFilterByFromReportMetadata(
reportColumnForEditing.accessor reportColumnForEditing.accessor,
); );
if (reportFilter) { if (reportFilter) {
reportColumnForEditing.filter_field_value = reportColumnForEditing.filter_field_value =
@ -941,7 +941,7 @@ export default function ProcessInstanceListTableWithFilters({
let reportColumnForEditing = null; let reportColumnForEditing = null;
if (event.selectedItem) { if (event.selectedItem) {
reportColumnForEditing = reportColumnToReportColumnForEditing( reportColumnForEditing = reportColumnToReportColumnForEditing(
event.selectedItem event.selectedItem,
); );
} }
setReportColumnToOperateOn(reportColumnForEditing); setReportColumnToOperateOn(reportColumnForEditing);
@ -1015,7 +1015,7 @@ export default function ProcessInstanceListTableWithFilters({
placeholder="Choose a column to show" placeholder="Choose a column to show"
titleText="Column" titleText="Column"
selectedItem={reportColumnToOperateOn} selectedItem={reportColumnToOperateOn}
/> />,
); );
} }
formElements.push([ formElements.push([
@ -1051,7 +1051,7 @@ export default function ProcessInstanceListTableWithFilters({
onChange={(value: any) => { onChange={(value: any) => {
setFilterDisplayType(value.selectedItem); setFilterDisplayType(value.selectedItem);
}} }}
/> />,
); );
// if we pass undefined into selectedItem followed by an actual value then the component changes from uncontrolled // if we pass undefined into selectedItem followed by an actual value then the component changes from uncontrolled
@ -1060,7 +1060,7 @@ export default function ProcessInstanceListTableWithFilters({
const operator = getKeyByValue( const operator = getKeyByValue(
filterOperatorMappings, filterOperatorMappings,
reportColumnToOperateOn.filter_operator, reportColumnToOperateOn.filter_operator,
'id' 'id',
); );
formElements.push( formElements.push(
<Dropdown <Dropdown
@ -1072,11 +1072,11 @@ export default function ProcessInstanceListTableWithFilters({
onChange={(value: any) => { onChange={(value: any) => {
setReportColumnConditionOperator(value.selectedItem); setReportColumnConditionOperator(value.selectedItem);
}} }}
/> />,
); );
const filterOperator = getFilterOperatorFromReportColumn( const filterOperator = getFilterOperatorFromReportColumn(
reportColumnToOperateOn reportColumnToOperateOn,
); );
if (filterOperator && filterOperator.requires_value) { if (filterOperator && filterOperator.requires_value) {
formElements.push( formElements.push(
@ -1090,12 +1090,12 @@ export default function ProcessInstanceListTableWithFilters({
: '' : ''
} }
onChange={setReportColumnConditionValue} onChange={setReportColumnConditionValue}
/> />,
); );
} }
} }
formElements.push( formElements.push(
<div className="vertical-spacer-to-allow-combo-box-to-expand-in-modal" /> <div className="vertical-spacer-to-allow-combo-box-to-expand-in-modal" />,
); );
const modalHeading = const modalHeading =
reportColumnFormMode === 'new' reportColumnFormMode === 'new'
@ -1163,7 +1163,7 @@ export default function ProcessInstanceListTableWithFilters({
onClick={() => removeColumn(reportColumnForEditing)} onClick={() => removeColumn(reportColumnForEditing)}
/> />
</Tag> </Tag>
</Column> </Column>,
); );
}); });
return ( return (
@ -1214,7 +1214,7 @@ export default function ProcessInstanceListTableWithFilters({
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
systemReportOption, systemReportOption,
value.selectedItem === systemReportOption value.selectedItem === systemReportOption,
); );
setSystemReport(value.selectedItem); setSystemReport(value.selectedItem);
}); });
@ -1233,7 +1233,7 @@ export default function ProcessInstanceListTableWithFilters({
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
'user_group_identifier', 'user_group_identifier',
value.selectedItem value.selectedItem,
); );
setSelectedUserGroup(value.selectedItem); setSelectedUserGroup(value.selectedItem);
}} }}
@ -1252,7 +1252,7 @@ export default function ProcessInstanceListTableWithFilters({
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
'with_oldest_open_task', 'with_oldest_open_task',
value.target.checked value.target.checked,
); );
setWithOldestOpenTask(value.target.checked); setWithOldestOpenTask(value.target.checked);
}} }}
@ -1268,7 +1268,7 @@ export default function ProcessInstanceListTableWithFilters({
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
'with_relation_to_me', 'with_relation_to_me',
value.target.checked value.target.checked,
); );
setwithRelationToMe(value.target.checked); setwithRelationToMe(value.target.checked);
}} }}
@ -1335,7 +1335,7 @@ export default function ProcessInstanceListTableWithFilters({
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
'process_model_identifier', 'process_model_identifier',
pmSelectionId pmSelectionId,
); );
setProcessModelSelection(selection.selectedItem); setProcessModelSelection(selection.selectedItem);
}} }}
@ -1360,7 +1360,7 @@ export default function ProcessInstanceListTableWithFilters({
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
'process_initiator_username', 'process_initiator_username',
event.selectedItem event.selectedItem,
); );
setProcessInitiatorSelection(event.selectedItem); setProcessInitiatorSelection(event.selectedItem);
}} }}
@ -1382,7 +1382,7 @@ export default function ProcessInstanceListTableWithFilters({
insertOrUpdateFieldInReportMetadata( insertOrUpdateFieldInReportMetadata(
reportMetadata, reportMetadata,
'process_initiator_username', 'process_initiator_username',
event.target.value event.target.value,
); );
setProcessInitiatorSelection(event.target.value); setProcessInitiatorSelection(event.target.value);
}} }}
@ -1407,7 +1407,7 @@ export default function ProcessInstanceListTableWithFilters({
setStartFromTime(val); setStartFromTime(val);
}, },
startFromTimeInvalid, startFromTimeInvalid,
setStartFromTimeInvalid setStartFromTimeInvalid,
)} )}
</Column> </Column>
<Column md={4}> <Column md={4}>
@ -1423,7 +1423,7 @@ export default function ProcessInstanceListTableWithFilters({
setStartToTime(val); setStartToTime(val);
}, },
startToTimeInvalid, startToTimeInvalid,
setStartToTimeInvalid setStartToTimeInvalid,
)} )}
</Column> </Column>
<Column md={4}> <Column md={4}>
@ -1439,7 +1439,7 @@ export default function ProcessInstanceListTableWithFilters({
setEndFromTime(val); setEndFromTime(val);
}, },
endFromTimeInvalid, endFromTimeInvalid,
setEndFromTimeInvalid setEndFromTimeInvalid,
)} )}
</Column> </Column>
<Column md={4}> <Column md={4}>
@ -1455,7 +1455,7 @@ export default function ProcessInstanceListTableWithFilters({
setEndToTime(val); setEndToTime(val);
}, },
endToTimeInvalid, endToTimeInvalid,
setEndToTimeInvalid setEndToTimeInvalid,
)} )}
</Column> </Column>
</Grid> </Grid>
@ -1520,7 +1520,7 @@ export default function ProcessInstanceListTableWithFilters({
searchParams, searchParams,
undefined, undefined,
undefined, undefined,
paginationQueryParamPrefix paginationQueryParamPrefix,
); );
if (page !== 1) { if (page !== 1) {
searchParams.set('page', '1'); searchParams.set('page', '1');
@ -1542,7 +1542,7 @@ export default function ProcessInstanceListTableWithFilters({
searchParams, searchParams,
setSearchParams, setSearchParams,
paginationQueryParamPrefix, paginationQueryParamPrefix,
] ],
); );
const filterComponent = () => { const filterComponent = () => {

View File

@ -123,21 +123,21 @@ export default function ProcessInstanceLogList({
]; ];
const pickedSearchParams = selectKeysFromSearchParams( const pickedSearchParams = selectKeysFromSearchParams(
searchParams, searchParams,
searchParamsToInclude searchParamsToInclude,
); );
const { page, perPage } = getPageInfoFromSearchParams( const { page, perPage } = getPageInfoFromSearchParams(
searchParams, searchParams,
undefined, undefined,
undefined, undefined,
paginationQueryParamPrefix paginationQueryParamPrefix,
); );
const eventsQueryParam = isEventsView ? 'true' : 'false'; const eventsQueryParam = isEventsView ? 'true' : 'false';
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `${targetUris.processInstanceLogListPath}?${createSearchParams( path: `${targetUris.processInstanceLogListPath}?${createSearchParams(
pickedSearchParams pickedSearchParams,
)}&page=${page}&per_page=${perPage}&events=${eventsQueryParam}`, )}&page=${page}&per_page=${perPage}&events=${eventsQueryParam}`,
successCallback: setProcessInstanceLogListFromResult, successCallback: setProcessInstanceLogListFromResult,
}); });
@ -178,7 +178,7 @@ export default function ProcessInstanceLogList({
if (eventErrorDetails) { if (eventErrorDetails) {
const errorForDisplay = errorForDisplayFromProcessInstanceErrorDetail( const errorForDisplay = errorForDisplayFromProcessInstanceErrorDetail(
eventForModal, eventForModal,
eventErrorDetails eventErrorDetails,
); );
const errorChildren = childrenForErrorObject(errorForDisplay); const errorChildren = childrenForErrorObject(errorForDisplay);
// eslint-disable-next-line react/jsx-no-useless-fragment // eslint-disable-next-line react/jsx-no-useless-fragment
@ -200,7 +200,7 @@ export default function ProcessInstanceLogList({
}; };
const handleErrorDetailsReponse = ( const handleErrorDetailsReponse = (
results: ProcessInstanceEventErrorDetail results: ProcessInstanceEventErrorDetail,
) => { ) => {
setEventErrorDetails(results); setEventErrorDetails(results);
}; };
@ -280,14 +280,14 @@ export default function ProcessInstanceLogList({
<td data-qa="paginated-entity-id">{logEntry.id}</td> <td data-qa="paginated-entity-id">{logEntry.id}</td>
{bpmnProcessCell} {bpmnProcessCell}
{taskNameCell} {taskNameCell}
</> </>,
); );
} else { } else {
tableRow.push( tableRow.push(
<> <>
{taskNameCell} {taskNameCell}
{bpmnProcessCell} {bpmnProcessCell}
</> </>,
); );
} }
if (isEventsView) { if (isEventsView) {
@ -301,14 +301,14 @@ export default function ProcessInstanceLogList({
<span className="system-user-log-entry">system</span> <span className="system-user-log-entry">system</span>
)} )}
</td> </td>
</> </>,
); );
} }
let timestampComponent = ( let timestampComponent = (
<td> <td>
{DateAndTimeService.convertSecondsToFormattedDateTime( {DateAndTimeService.convertSecondsToFormattedDateTime(
logEntry.timestamp logEntry.timestamp,
)} )}
</td> </td>
); );
@ -322,7 +322,7 @@ export default function ProcessInstanceLogList({
title="View state when task was completed" title="View state when task was completed"
> >
{DateAndTimeService.convertSecondsToFormattedDateTime( {DateAndTimeService.convertSecondsToFormattedDateTime(
logEntry.timestamp logEntry.timestamp,
)} )}
</Link> </Link>
</td> </td>
@ -337,7 +337,7 @@ export default function ProcessInstanceLogList({
const rows = processInstanceLogs.map( const rows = processInstanceLogs.map(
(logEntry: ProcessInstanceLogEntry) => { (logEntry: ProcessInstanceLogEntry) => {
return getTableRow(logEntry); return getTableRow(logEntry);
} },
); );
const tableHeaders = []; const tableHeaders = [];
@ -347,14 +347,14 @@ export default function ProcessInstanceLogList({
<th>Id</th> <th>Id</th>
<th>Bpmn process</th> <th>Bpmn process</th>
<th>{taskNameHeader}</th> <th>{taskNameHeader}</th>
</> </>,
); );
} else { } else {
tableHeaders.push( tableHeaders.push(
<> <>
<th>{taskNameHeader}</th> <th>{taskNameHeader}</th>
<th>Bpmn process</th> <th>Bpmn process</th>
</> </>,
); );
} }
if (isEventsView) { if (isEventsView) {
@ -364,7 +364,7 @@ export default function ProcessInstanceLogList({
<th>Task type</th> <th>Task type</th>
<th>Event type</th> <th>Event type</th>
<th>User</th> <th>User</th>
</> </>,
); );
} }
tableHeaders.push(<th>Timestamp</th>); tableHeaders.push(<th>Timestamp</th>);
@ -380,7 +380,7 @@ export default function ProcessInstanceLogList({
const resetFilters = () => { const resetFilters = () => {
['bpmn_name', 'bpmn_identifier', 'task_type', 'event_type'].forEach( ['bpmn_name', 'bpmn_identifier', 'task_type', 'event_type'].forEach(
(value: string) => searchParams.delete(value) (value: string) => searchParams.delete(value),
); );
}; };
@ -429,7 +429,7 @@ export default function ProcessInstanceLogList({
titleText={taskNameHeader} titleText={taskNameHeader}
selectedItem={searchParams.get('bpmn_name')} selectedItem={searchParams.get('bpmn_name')}
/> />
</Column> </Column>,
); );
if (isEventsView) { if (isEventsView) {
@ -486,7 +486,7 @@ export default function ProcessInstanceLogList({
selectedItem={searchParams.get('event_type')} selectedItem={searchParams.get('event_type')}
/> />
</Column> </Column>
</> </>,
); );
} }
@ -525,7 +525,7 @@ export default function ProcessInstanceLogList({
searchParams, searchParams,
undefined, undefined,
undefined, undefined,
paginationQueryParamPrefix paginationQueryParamPrefix,
); );
if (clearAll) { if (clearAll) {
return <p>Page cleared 👍</p>; return <p>Page cleared 👍</p>;

View File

@ -39,7 +39,7 @@ export default function ProcessInstanceProgress({
myTask && myTask.can_complete && HUMAN_TASK_TYPES.includes(myTask.type) myTask && myTask.can_complete && HUMAN_TASK_TYPES.includes(myTask.type)
); );
}, },
[] [],
); );
// Useful to stop refreshing if an api call gets an error // Useful to stop refreshing if an api call gets an error
@ -91,7 +91,7 @@ export default function ProcessInstanceProgress({
// 15, // 15,
1, 1,
DateAndTimeService.REFRESH_TIMEOUT_SECONDS, DateAndTimeService.REFRESH_TIMEOUT_SECONDS,
checkProgress checkProgress,
); );
return clearRefreshRef.current; return clearRefreshRef.current;
}, [ }, [
@ -121,7 +121,7 @@ export default function ProcessInstanceProgress({
}; };
const userMessage = ( const userMessage = (
taskInstructionForEndUser: TaskInstructionForEndUser taskInstructionForEndUser: TaskInstructionForEndUser,
) => { ) => {
return ( return (
<InstructionsForEndUser <InstructionsForEndUser

View File

@ -32,7 +32,7 @@ export default function ProcessInstanceReportSearch({
const selectedReportIdAsNumber = Number(selectedReportId); const selectedReportIdAsNumber = Number(selectedReportId);
function setProcessInstanceReportsFromResult( function setProcessInstanceReportsFromResult(
result: ProcessInstanceReport[] result: ProcessInstanceReport[],
) { ) {
setProcessInstanceReports(result); setProcessInstanceReports(result);
if (selectedReportId && handleSetSelectedReportCallback) { if (selectedReportId && handleSetSelectedReportCallback) {
@ -51,7 +51,7 @@ export default function ProcessInstanceReportSearch({
}, [handleSetSelectedReportCallback, selectedReportId]); }, [handleSetSelectedReportCallback, selectedReportId]);
const reportSelectionString = ( const reportSelectionString = (
processInstanceReport: ProcessInstanceReport processInstanceReport: ProcessInstanceReport,
) => { ) => {
return `${processInstanceReport.identifier} (Id: ${processInstanceReport.id})`; return `${processInstanceReport.identifier} (Id: ${processInstanceReport.id})`;
}; };

View File

@ -14,12 +14,12 @@ import { usePermissionFetcher } from '../hooks/PermissionService';
import useAPIError from '../hooks/UseApiError'; import useAPIError from '../hooks/UseApiError';
const storeRecentProcessModelInLocalStorage = ( const storeRecentProcessModelInLocalStorage = (
processModelForStorage: ProcessModel processModelForStorage: ProcessModel,
) => { ) => {
// All values stored in localStorage are strings. // All values stored in localStorage are strings.
// Grab our recentProcessModels string from localStorage. // Grab our recentProcessModels string from localStorage.
const stringFromLocalStorage = window.localStorage.getItem( const stringFromLocalStorage = window.localStorage.getItem(
'recentProcessModels' 'recentProcessModels',
); );
// adapted from https://stackoverflow.com/a/59424458/6090676 // adapted from https://stackoverflow.com/a/59424458/6090676
@ -41,7 +41,7 @@ const storeRecentProcessModelInLocalStorage = (
// If our parsed/empty array doesn't already have this value in it... // If our parsed/empty array doesn't already have this value in it...
const matchingItem = array.find( const matchingItem = array.find(
(item) => item.processModelIdentifier === value.processModelIdentifier (item) => item.processModelIdentifier === value.processModelIdentifier,
); );
if (matchingItem === undefined) { if (matchingItem === undefined) {
// add the value to the beginning of the array // add the value to the beginning of the array
@ -80,7 +80,7 @@ export default function ProcessInstanceRun({
const [disableStartButton, setDisableStartButton] = useState<boolean>(false); const [disableStartButton, setDisableStartButton] = useState<boolean>(false);
const modifiedProcessModelId = modifyProcessIdentifierForPathParam( const modifiedProcessModelId = modifyProcessIdentifierForPathParam(
processModel.id processModel.id,
); );
const processInstanceCreatePath = `/v1.0/process-instances/${modifiedProcessModelId}`; const processInstanceCreatePath = `/v1.0/process-instances/${modifiedProcessModelId}`;
@ -98,11 +98,11 @@ export default function ProcessInstanceRun({
const processInstanceId = processInstance.id; const processInstanceId = processInstance.id;
if (processInstance.process_model_uses_queued_execution) { if (processInstance.process_model_uses_queued_execution) {
navigate( navigate(
`/process-instances/for-me/${modifiedProcessModelId}/${processInstanceId}/progress` `/process-instances/for-me/${modifiedProcessModelId}/${processInstanceId}/progress`,
); );
} else { } else {
navigate( navigate(
`/process-instances/for-me/${modifiedProcessModelId}/${processInstanceId}/interstitial` `/process-instances/for-me/${modifiedProcessModelId}/${processInstanceId}/interstitial`,
); );
} }
}; };

View File

@ -68,7 +68,7 @@ export default function ProcessInterstitial({
onclose() { onclose() {
setState('CLOSED'); setState('CLOSED');
}, },
} },
); );
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []); // it is critical to only run this once. }, []); // it is critical to only run this once.
@ -83,7 +83,7 @@ export default function ProcessInterstitial({
HUMAN_TASK_TYPES.includes(myTask.type) HUMAN_TASK_TYPES.includes(myTask.type)
); );
}, },
[allowRedirect, processInstance] [allowRedirect, processInstance],
); );
const shouldRedirectToProcessInstance = useCallback((): boolean => { const shouldRedirectToProcessInstance = useCallback((): boolean => {
@ -136,7 +136,7 @@ export default function ProcessInterstitial({
const inlineMessage = ( const inlineMessage = (
title: string, title: string,
subtitle: string, subtitle: string,
kind: string = 'info' kind: string = 'info',
) => { ) => {
return ( return (
<div> <div>
@ -152,13 +152,13 @@ export default function ProcessInterstitial({
const userMessageForProcessInstance = ( const userMessageForProcessInstance = (
pi: ProcessInstance, pi: ProcessInstance,
myTask: ProcessInstanceTask | null = null myTask: ProcessInstanceTask | null = null,
) => { ) => {
if (['terminated', 'suspended'].includes(pi.status)) { if (['terminated', 'suspended'].includes(pi.status)) {
return inlineMessage( return inlineMessage(
`Process ${pi.status}`, `Process ${pi.status}`,
`This process instance was ${pi.status} by an administrator. Please get in touch with them for more information.`, `This process instance was ${pi.status} by an administrator. Please get in touch with them for more information.`,
'warning' 'warning',
); );
} }
if (pi.status === 'error') { if (pi.status === 'error') {
@ -198,13 +198,13 @@ export default function ProcessInterstitial({
potentialOwnerArray = potentialOwnerArray.slice(0, 2).concat(['...']); potentialOwnerArray = potentialOwnerArray.slice(0, 2).concat(['...']);
} }
message = `This next task is assigned to user(s): ${potentialOwnerArray.join( message = `This next task is assigned to user(s): ${potentialOwnerArray.join(
', ' ', ',
)}.`; )}.`;
} }
return inlineMessage( return inlineMessage(
'', '',
`${message} There is no action for you to take at this time.` `${message} There is no action for you to take at this time.`,
); );
} }
if (shouldRedirectToTask(myTask)) { if (shouldRedirectToTask(myTask)) {
@ -217,7 +217,7 @@ export default function ProcessInterstitial({
) { ) {
return inlineMessage( return inlineMessage(
'', '',
`The task "${myTask.title}" is ready for you to complete.` `The task "${myTask.title}" is ready for you to complete.`,
); );
} }
if (myTask.error_message) { if (myTask.error_message) {

View File

@ -65,13 +65,13 @@ export default function ProcessModelForm({
return; return;
} }
let path = `/process-models/${modifyProcessIdentifierForPathParam( let path = `/process-models/${modifyProcessIdentifierForPathParam(
processGroupId || '' processGroupId || '',
)}`; )}`;
let httpMethod = 'POST'; let httpMethod = 'POST';
if (mode === 'edit') { if (mode === 'edit') {
httpMethod = 'PUT'; httpMethod = 'PUT';
path = `/process-models/${modifyProcessIdentifierForPathParam( path = `/process-models/${modifyProcessIdentifierForPathParam(
processModel.id processModel.id,
)}`; )}`;
} }
const postBody = { const postBody = {
@ -106,7 +106,7 @@ export default function ProcessModelForm({
const metadataExtractionPathForm = ( const metadataExtractionPathForm = (
index: number, index: number,
metadataExtractionPath: MetadataExtractionPath metadataExtractionPath: MetadataExtractionPath,
) => { ) => {
return ( return (
<Grid> <Grid>
@ -165,7 +165,7 @@ export default function ProcessModelForm({
return processModel.metadata_extraction_paths.map( return processModel.metadata_extraction_paths.map(
(metadataExtractionPath: MetadataExtractionPath, index: number) => { (metadataExtractionPath: MetadataExtractionPath, index: number) => {
return metadataExtractionPathForm(index, metadataExtractionPath); return metadataExtractionPathForm(index, metadataExtractionPath);
} },
); );
} }
return null; return null;
@ -180,7 +180,7 @@ export default function ProcessModelForm({
const notificationAddressForm = ( const notificationAddressForm = (
index: number, index: number,
notificationAddress: string notificationAddress: string,
) => { ) => {
return ( return (
<Grid> <Grid>
@ -226,7 +226,7 @@ export default function ProcessModelForm({
return processModel.exception_notification_addresses.map( return processModel.exception_notification_addresses.map(
(notificationAddress: string, index: number) => { (notificationAddress: string, index: number) => {
return notificationAddressForm(index, notificationAddress); return notificationAddressForm(index, notificationAddress);
} },
); );
} }
return null; return null;
@ -287,7 +287,7 @@ export default function ProcessModelForm({
} }
setIdHasBeenUpdatedByUser(true); setIdHasBeenUpdatedByUser(true);
}} }}
/> />,
); );
} }
@ -300,7 +300,7 @@ export default function ProcessModelForm({
onChange={(event: any) => onChange={(event: any) =>
updateProcessModel({ description: event.target.value }) updateProcessModel({ description: event.target.value })
} }
/> />,
); );
textInputs.push( textInputs.push(
@ -314,7 +314,7 @@ export default function ProcessModelForm({
> >
<SelectItem value="fault" text="Fault" /> <SelectItem value="fault" text="Fault" />
<SelectItem value="suspend" text="Suspend" /> <SelectItem value="suspend" text="Suspend" />
</Select> </Select>,
); );
textInputs.push(<h2>Notification Addresses</h2>); textInputs.push(<h2>Notification Addresses</h2>);
textInputs.push( textInputs.push(
@ -324,7 +324,7 @@ export default function ProcessModelForm({
You can provide one or more addresses to notify if this model fails. You can provide one or more addresses to notify if this model fails.
</p> </p>
</Column> </Column>
</Grid> </Grid>,
); );
textInputs.push(<>{notificationAddressFormArea()}</>); textInputs.push(<>{notificationAddressFormArea()}</>);
textInputs.push( textInputs.push(
@ -342,7 +342,7 @@ export default function ProcessModelForm({
Add Notification Address Add Notification Address
</Button> </Button>
</Column> </Column>
</Grid> </Grid>,
); );
textInputs.push(<h2>Metadata Extractions</h2>); textInputs.push(<h2>Metadata Extractions</h2>);
@ -355,7 +355,7 @@ export default function ProcessModelForm({
perspectives. perspectives.
</p> </p>
</Column> </Column>
</Grid> </Grid>,
); );
textInputs.push(<>{metadataExtractionPathFormArea()}</>); textInputs.push(<>{metadataExtractionPathFormArea()}</>);
textInputs.push( textInputs.push(
@ -373,7 +373,7 @@ export default function ProcessModelForm({
Add Metadata Extraction Path Add Metadata Extraction Path
</Button> </Button>
</Column> </Column>
</Grid> </Grid>,
); );
return textInputs; return textInputs;

View File

@ -33,7 +33,7 @@ export default function ProcessModelListTiles({
}: OwnProps) { }: OwnProps) {
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
const [processModels, setProcessModels] = useState<ProcessModel[] | null>( const [processModels, setProcessModels] = useState<ProcessModel[] | null>(
null null,
); );
useEffect(() => { useEffect(() => {
@ -76,7 +76,7 @@ export default function ProcessModelListTiles({
title={row.id} title={row.id}
data-qa="process-model-show-link" data-qa="process-model-show-link"
to={`/process-models/${modifyProcessIdentifierForPathParam( to={`/process-models/${modifyProcessIdentifierForPathParam(
row.id row.id,
)}`} )}`}
> >
{row.display_name} {row.display_name}

View File

@ -93,7 +93,7 @@ export default function ProcessModelTestRun({
.forEach((testCaseResult: TestCaseResult) => { .forEach((testCaseResult: TestCaseResult) => {
if (testCaseResult.test_case_error_details) { if (testCaseResult.test_case_error_details) {
const errorForDisplay = errorForDisplayFromTestCaseErrorDetails( const errorForDisplay = errorForDisplayFromTestCaseErrorDetails(
testCaseResult.test_case_error_details testCaseResult.test_case_error_details,
); );
const errorChildren = childrenForErrorObject(errorForDisplay); const errorChildren = childrenForErrorObject(errorForDisplay);
failingRows.push( failingRows.push(
@ -104,7 +104,7 @@ export default function ProcessModelTestRun({
<strong>{testCaseResult.test_case_identifier}</strong> <strong>{testCaseResult.test_case_identifier}</strong>
</p> </p>
{errorChildren} {errorChildren}
</> </>,
); );
} }
}); });

View File

@ -41,7 +41,7 @@ export default function ProcessSearch({
if (process) { if (process) {
return `${process.display_name} (${truncateString( return `${process.display_name} (${truncateString(
process.identifier, process.identifier,
75 75,
)})`; )})`;
} }
return null; return null;

View File

@ -165,7 +165,7 @@ export default function ReactDiagramEditor({
} }
} }
}, },
[diagramModelerState, diagramType] [diagramModelerState, diagramType],
); );
/* This restores unresolved references that camunda removes, I wish we could move this to the bpmn-io extensions */ /* This restores unresolved references that camunda removes, I wish we could move this to the bpmn-io extensions */
@ -179,11 +179,11 @@ export default function ReactDiagramEditor({
const refs = event.references.filter( const refs = event.references.filter(
(r: any) => (r: any) =>
r.property === 'bpmn:loopDataInputRef' || r.property === 'bpmn:loopDataInputRef' ||
r.property === 'bpmn:loopDataOutputRef' r.property === 'bpmn:loopDataOutputRef',
); );
// eslint-disable-next-line no-underscore-dangle // eslint-disable-next-line no-underscore-dangle
const desc = diagramModelerToUse._moddle.registry.getEffectiveDescriptor( const desc = diagramModelerToUse._moddle.registry.getEffectiveDescriptor(
'bpmn:ItemAwareElement' 'bpmn:ItemAwareElement',
); );
refs.forEach((ref: any) => { refs.forEach((ref: any) => {
const props = { const props = {
@ -287,7 +287,7 @@ export default function ReactDiagramEditor({
element: any, element: any,
script: string, script: string,
scriptType: string, scriptType: string,
eventBus: any eventBus: any,
) { ) {
if (onLaunchScriptEditor) { if (onLaunchScriptEditor) {
setPerformingXmlUpdates(true); setPerformingXmlUpdates(true);
@ -299,7 +299,7 @@ export default function ReactDiagramEditor({
function handleLaunchMarkdownEditor( function handleLaunchMarkdownEditor(
element: any, element: any,
value: string, value: string,
eventBus: any eventBus: any,
) { ) {
if (onLaunchMarkdownEditor) { if (onLaunchMarkdownEditor) {
setPerformingXmlUpdates(true); setPerformingXmlUpdates(true);
@ -311,7 +311,7 @@ export default function ReactDiagramEditor({
if (onElementClick) { if (onElementClick) {
const canvas = diagramModeler.get('canvas'); const canvas = diagramModeler.get('canvas');
const bpmnProcessIdentifiers = getBpmnProcessIdentifiers( const bpmnProcessIdentifiers = getBpmnProcessIdentifiers(
canvas.getRootElement() canvas.getRootElement(),
); );
onElementClick(event.element, bpmnProcessIdentifiers); onElementClick(event.element, bpmnProcessIdentifiers);
} }
@ -459,13 +459,13 @@ export default function ReactDiagramEditor({
canvas: any, canvas: any,
task: Task, task: Task,
bpmnIoClassName: string, bpmnIoClassName: string,
bpmnProcessIdentifiers: string[] bpmnProcessIdentifiers: string[],
) { ) {
if (checkTaskCanBeHighlighted(task.bpmn_identifier)) { if (checkTaskCanBeHighlighted(task.bpmn_identifier)) {
try { try {
if ( if (
bpmnProcessIdentifiers.includes( bpmnProcessIdentifiers.includes(
task.bpmn_process_definition_identifier task.bpmn_process_definition_identifier,
) )
) { ) {
canvas.addMarker(task.bpmn_identifier, bpmnIoClassName); canvas.addMarker(task.bpmn_identifier, bpmnIoClassName);
@ -504,7 +504,7 @@ export default function ReactDiagramEditor({
// https://github.com/bpmn-io/bpmn-js-examples/tree/master/colors // https://github.com/bpmn-io/bpmn-js-examples/tree/master/colors
if (tasks) { if (tasks) {
const bpmnProcessIdentifiers = getBpmnProcessIdentifiers( const bpmnProcessIdentifiers = getBpmnProcessIdentifiers(
canvas.getRootElement() canvas.getRootElement(),
); );
tasks.forEach((task: Task) => { tasks.forEach((task: Task) => {
let className = ''; let className = '';
@ -522,7 +522,7 @@ export default function ReactDiagramEditor({
canvas, canvas,
task, task,
className, className,
bpmnProcessIdentifiers bpmnProcessIdentifiers,
); );
} }
}); });
@ -531,7 +531,7 @@ export default function ReactDiagramEditor({
function displayDiagram( function displayDiagram(
diagramModelerToUse: any, diagramModelerToUse: any,
diagramXMLToDisplay: any diagramXMLToDisplay: any,
) { ) {
if (alreadyImportedXmlRef.current) { if (alreadyImportedXmlRef.current) {
return; return;
@ -558,7 +558,7 @@ export default function ReactDiagramEditor({
function fetchDiagramFromURL( function fetchDiagramFromURL(
urlToUse: any, urlToUse: any,
textHandler?: (text: str) => void textHandler?: (text: str) => void,
) { ) {
fetch(urlToUse) fetch(urlToUse)
.then((response) => response.text()) .then((response) => response.text())
@ -683,7 +683,7 @@ export default function ReactDiagramEditor({
<Link <Link
size="lg" size="lg"
href={`/process-models/${modifyProcessIdentifierForPathParam( href={`/process-models/${modifyProcessIdentifierForPathParam(
ref.relative_location ref.relative_location,
)}`} )}`}
> >
{`${ref.display_name}`} {`${ref.display_name}`}
@ -762,7 +762,7 @@ export default function ReactDiagramEditor({
<Button <Button
onClick={() => { onClick={() => {
navigate( navigate(
`/process-models/${processModelId}/form/${fileName}` `/process-models/${processModelId}/form/${fileName}`,
); );
}} }}
> >

View File

@ -77,7 +77,7 @@ examples.push(
schema: typeaheadSchema, schema: typeaheadSchema,
ui: typeaheadUiSchema, ui: typeaheadUiSchema,
data: {}, data: {},
} },
); );
type OwnProps = { type OwnProps = {

View File

@ -129,7 +129,7 @@ export default function ReactFormBuilder({
postBody: submission, postBody: submission,
}); });
}, },
[processModelId, fileName] [processModelId, fileName],
); );
const hasValidName = (identifierToCheck: string) => { const hasValidName = (identifierToCheck: string) => {
@ -327,7 +327,7 @@ export default function ReactFormBuilder({
function fetchSchema() { function fetchSchema() {
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `/process-models/${processModelId}/files/${baseName( path: `/process-models/${processModelId}/files/${baseName(
fileName fileName,
)}${SCHEMA_EXTENSION}`, )}${SCHEMA_EXTENSION}`,
successCallback: (response: any) => { successCallback: (response: any) => {
setJsonSchemaFromResponseJson(response); setJsonSchemaFromResponseJson(response);
@ -342,7 +342,7 @@ export default function ReactFormBuilder({
function fetchUI() { function fetchUI() {
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `/process-models/${processModelId}/files/${baseName( path: `/process-models/${processModelId}/files/${baseName(
fileName fileName,
)}${UI_EXTENSION}`, )}${UI_EXTENSION}`,
successCallback: setJsonUiFromResponseJson, successCallback: setJsonUiFromResponseJson,
failureCallback: () => { failureCallback: () => {
@ -354,7 +354,7 @@ export default function ReactFormBuilder({
function fetchExampleData() { function fetchExampleData() {
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `/process-models/${processModelId}/files/${baseName( path: `/process-models/${processModelId}/files/${baseName(
fileName fileName,
)}${DATA_EXTENSION}`, )}${DATA_EXTENSION}`,
successCallback: setDataFromResponseJson, successCallback: setDataFromResponseJson,
failureCallback: () => { failureCallback: () => {

View File

@ -72,7 +72,7 @@ export default function TaskListTable({
const [tasks, setTasks] = useState<ProcessInstanceTask[] | null>(null); const [tasks, setTasks] = useState<ProcessInstanceTask[] | null>(null);
const [pagination, setPagination] = useState<PaginationObject | null>(null); const [pagination, setPagination] = useState<PaginationObject | null>(null);
const [formSubmissionTask, setFormSubmissionTask] = useState<Task | null>( const [formSubmissionTask, setFormSubmissionTask] = useState<Task | null>(
null null,
); );
const preferredUsername = UserService.getPreferredUsername(); const preferredUsername = UserService.getPreferredUsername();
@ -84,7 +84,7 @@ export default function TaskListTable({
searchParams, searchParams,
defaultPerPage, defaultPerPage,
undefined, undefined,
paginationQueryParamPrefix paginationQueryParamPrefix,
); );
const setTasksFromResult = (result: any) => { const setTasksFromResult = (result: any) => {
setTasks(result.results); setTasks(result.results);
@ -104,7 +104,7 @@ export default function TaskListTable({
return refreshAtInterval( return refreshAtInterval(
DateAndTimeService.REFRESH_INTERVAL_SECONDS, DateAndTimeService.REFRESH_INTERVAL_SECONDS,
DateAndTimeService.REFRESH_TIMEOUT_SECONDS, DateAndTimeService.REFRESH_TIMEOUT_SECONDS,
getTasks getTasks,
); );
} }
return undefined; return undefined;
@ -118,7 +118,7 @@ export default function TaskListTable({
]); ]);
const getWaitingForTableCellComponent = ( const getWaitingForTableCellComponent = (
processInstanceTask: ProcessInstanceTask processInstanceTask: ProcessInstanceTask,
) => { ) => {
let fullUsernameString = ''; let fullUsernameString = '';
let shortUsernameString = ''; let shortUsernameString = '';
@ -202,7 +202,7 @@ export default function TaskListTable({
}; };
const getFormSubmissionDataForTask = ( const getFormSubmissionDataForTask = (
processInstanceTask: ProcessInstanceTask processInstanceTask: ProcessInstanceTask,
) => { ) => {
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `/tasks/${processInstanceTask.process_instance_id}/${processInstanceTask.task_id}?with_form_data=true`, path: `/tasks/${processInstanceTask.process_instance_id}/${processInstanceTask.task_id}?with_form_data=true`,
@ -213,7 +213,7 @@ export default function TaskListTable({
const processIdRowElement = (processInstanceTask: ProcessInstanceTask) => { const processIdRowElement = (processInstanceTask: ProcessInstanceTask) => {
const modifiedProcessModelIdentifier = modifyProcessIdentifierForPathParam( const modifiedProcessModelIdentifier = modifyProcessIdentifierForPathParam(
processInstanceTask.process_model_identifier processInstanceTask.process_model_identifier,
); );
return ( return (
<td> <td>
@ -230,7 +230,7 @@ export default function TaskListTable({
const dealWithProcessCells = ( const dealWithProcessCells = (
rowElements: ReactElement[], rowElements: ReactElement[],
processInstanceTask: ProcessInstanceTask processInstanceTask: ProcessInstanceTask,
) => { ) => {
if (showProcessId) { if (showProcessId) {
rowElements.push(processIdRowElement(processInstanceTask)); rowElements.push(processIdRowElement(processInstanceTask));
@ -238,7 +238,7 @@ export default function TaskListTable({
if (showProcessModelIdentifier) { if (showProcessModelIdentifier) {
const modifiedProcessModelIdentifier = const modifiedProcessModelIdentifier =
modifyProcessIdentifierForPathParam( modifyProcessIdentifierForPathParam(
processInstanceTask.process_model_identifier processInstanceTask.process_model_identifier,
); );
rowElements.push( rowElements.push(
<td> <td>
@ -249,7 +249,7 @@ export default function TaskListTable({
> >
{processInstanceTask.process_model_display_name} {processInstanceTask.process_model_display_name}
</Link> </Link>
</td> </td>,
); );
} }
}; };
@ -281,7 +281,7 @@ export default function TaskListTable({
size="sm" size="sm"
> >
Go Go
</Button> </Button>,
); );
} }
if (showViewFormDataButton) { if (showViewFormDataButton) {
@ -291,7 +291,7 @@ export default function TaskListTable({
onClick={() => getFormSubmissionDataForTask(processInstanceTask)} onClick={() => getFormSubmissionDataForTask(processInstanceTask)}
> >
View task View task
</Button> </Button>,
); );
} }
return actions; return actions;
@ -309,16 +309,16 @@ export default function TaskListTable({
{processInstanceTask.task_title {processInstanceTask.task_title
? processInstanceTask.task_title ? processInstanceTask.task_title
: processInstanceTask.task_name} : processInstanceTask.task_name}
</td> </td>,
); );
if (showStartedBy) { if (showStartedBy) {
rowElements.push( rowElements.push(
<td>{processInstanceTask.process_initiator_username}</td> <td>{processInstanceTask.process_initiator_username}</td>,
); );
} }
if (showWaitingOn) { if (showWaitingOn) {
rowElements.push( rowElements.push(
<td>{getWaitingForTableCellComponent(processInstanceTask)}</td> <td>{getWaitingForTableCellComponent(processInstanceTask)}</td>,
); );
} }
if (showCompletedBy) { if (showCompletedBy) {
@ -328,16 +328,16 @@ export default function TaskListTable({
rowElements.push( rowElements.push(
<td> <td>
{DateAndTimeService.convertSecondsToFormattedDateTime( {DateAndTimeService.convertSecondsToFormattedDateTime(
processInstanceTask.created_at_in_seconds processInstanceTask.created_at_in_seconds,
) || '-'} ) || '-'}
</td> </td>,
); );
} }
if (showLastUpdated) { if (showLastUpdated) {
rowElements.push( rowElements.push(
<TableCellWithTimeAgoInWords <TableCellWithTimeAgoInWords
timeInSeconds={processInstanceTask.updated_at_in_seconds} timeInSeconds={processInstanceTask.updated_at_in_seconds}
/> />,
); );
} }
if (showActionsColumn) { if (showActionsColumn) {
@ -410,7 +410,7 @@ export default function TaskListTable({
searchParams, searchParams,
defaultPerPage, defaultPerPage,
undefined, undefined,
paginationQueryParamPrefix paginationQueryParamPrefix,
); );
let tableElement = ( let tableElement = (
<div className={paginationClassName}>{buildTable()}</div> <div className={paginationClassName}>{buildTable()}</div>

View File

@ -46,7 +46,7 @@ export default function UserSearch({
searchForUser(value); searchForUser(value);
}, },
// delay in ms // delay in ms
250 250,
); );
return ( return (
<ComboBox <ComboBox

View File

@ -32,7 +32,7 @@ export default function APIErrorProvider({ children }) {
removeError(); removeError();
}, },
}), }),
[error] [error],
); );
return ( return (

View File

@ -8,13 +8,13 @@ import {
test('it can slugify a string', () => { test('it can slugify a string', () => {
expect(slugifyString('hello---world_ and then Some such-')).toEqual( expect(slugifyString('hello---world_ and then Some such-')).toEqual(
'hello-world-and-then-some-such' 'hello-world-and-then-some-such',
); );
}); });
test('it can underscorize a string', () => { test('it can underscorize a string', () => {
expect(underscorizeString('hello---world_ and then Some such-')).toEqual( expect(underscorizeString('hello---world_ and then Some such-')).toEqual(
'hello_world_and_then_some_such' 'hello_world_and_then_some_such',
); );
}); });

View File

@ -47,7 +47,7 @@ export const underscorizeString = (inputString: string) => {
export const getKeyByValue = ( export const getKeyByValue = (
object: any, object: any,
value: string, value: string,
onAttribute?: string onAttribute?: string,
) => { ) => {
return Object.keys(object).find((key) => { return Object.keys(object).find((key) => {
if (onAttribute) { if (onAttribute) {
@ -104,7 +104,7 @@ export const getPageInfoFromSearchParams = (
searchParams: any, searchParams: any,
defaultPerPage: string | number = DEFAULT_PER_PAGE, defaultPerPage: string | number = DEFAULT_PER_PAGE,
defaultPage: string | number = DEFAULT_PAGE, defaultPage: string | number = DEFAULT_PAGE,
paginationQueryParamPrefix: string | null = null paginationQueryParamPrefix: string | null = null,
) => { ) => {
const paginationQueryParamPrefixToUse = paginationQueryParamPrefix const paginationQueryParamPrefixToUse = paginationQueryParamPrefix
? `${paginationQueryParamPrefix}_` ? `${paginationQueryParamPrefix}_`
@ -112,12 +112,12 @@ export const getPageInfoFromSearchParams = (
const page = parseInt( const page = parseInt(
searchParams.get(`${paginationQueryParamPrefixToUse}page`) || searchParams.get(`${paginationQueryParamPrefixToUse}page`) ||
defaultPage.toString(), defaultPage.toString(),
10 10,
); );
const perPage = parseInt( const perPage = parseInt(
searchParams.get(`${paginationQueryParamPrefixToUse}per_page`) || searchParams.get(`${paginationQueryParamPrefixToUse}per_page`) ||
defaultPerPage.toString(), defaultPerPage.toString(),
10 10,
); );
return { page, perPage }; return { page, perPage };
@ -135,12 +135,12 @@ export const makeid = (length: number) => {
}; };
export const getProcessModelFullIdentifierFromSearchParams = ( export const getProcessModelFullIdentifierFromSearchParams = (
searchParams: any searchParams: any,
) => { ) => {
let processModelFullIdentifier = null; let processModelFullIdentifier = null;
if (searchParams.get('process_model_identifier')) { if (searchParams.get('process_model_identifier')) {
processModelFullIdentifier = `${searchParams.get( processModelFullIdentifier = `${searchParams.get(
'process_model_identifier' 'process_model_identifier',
)}`; )}`;
} }
return processModelFullIdentifier; return processModelFullIdentifier;
@ -182,7 +182,7 @@ export const refreshAtInterval = (
interval: number, interval: number,
timeout: number, timeout: number,
periodicFunction: Function, periodicFunction: Function,
cleanupFunction?: Function cleanupFunction?: Function,
) => { ) => {
const intervalRef = setInterval(() => periodicFunction(), interval * 1000); const intervalRef = setInterval(() => periodicFunction(), interval * 1000);
const timeoutRef = setTimeout(() => { const timeoutRef = setTimeout(() => {
@ -262,7 +262,7 @@ export const decodeBase64 = (data: string) => {
export const getLastMilestoneFromProcessInstance = ( export const getLastMilestoneFromProcessInstance = (
processInstance: ProcessInstance, processInstance: ProcessInstance,
value: any value: any,
) => { ) => {
let valueToUse = value; let valueToUse = value;
if (!valueToUse) { if (!valueToUse) {
@ -281,7 +281,7 @@ export const getLastMilestoneFromProcessInstance = (
if (truncatedValue.length > milestoneLengthLimit) { if (truncatedValue.length > milestoneLengthLimit) {
truncatedValue = `${truncatedValue.substring( truncatedValue = `${truncatedValue.substring(
0, 0,
milestoneLengthLimit - 3 milestoneLengthLimit - 3,
)}...`; )}...`;
} }
return [valueToUse, truncatedValue]; return [valueToUse, truncatedValue];
@ -293,7 +293,7 @@ export const parseTaskShowUrl = (url: string) => {
// expected url pattern: // expected url pattern:
// /tasks/[process_instance_id]/[task_guid] // /tasks/[process_instance_id]/[task_guid]
return path.match( return path.match(
/^\/tasks\/(\d+)\/([0-9a-z]{8}-([0-9a-z]{4}-){3}[0-9a-z]{12})$/ /^\/tasks\/(\d+)\/([0-9a-z]{8}-([0-9a-z]{4}-){3}[0-9a-z]{12})$/,
); );
}; };

View File

@ -2,7 +2,7 @@ import { ObjectWithStringKeysAndValues } from '../interfaces';
const appVersionInfo = () => { const appVersionInfo = () => {
const versionInfoFromHtmlMetaTag = document.querySelector( const versionInfoFromHtmlMetaTag = document.querySelector(
'meta[name="version-info"]' 'meta[name="version-info"]',
); );
let versionInfo: ObjectWithStringKeysAndValues = {}; let versionInfo: ObjectWithStringKeysAndValues = {};
if (versionInfoFromHtmlMetaTag) { if (versionInfoFromHtmlMetaTag) {

View File

@ -8,7 +8,7 @@ import { PermissionCheckResponseBody, PermissionsToCheck } from '../interfaces';
import HttpService from '../services/HttpService'; import HttpService from '../services/HttpService';
export const usePermissionFetcher = ( export const usePermissionFetcher = (
permissionsToCheck: PermissionsToCheck permissionsToCheck: PermissionsToCheck,
) => { ) => {
const ability = useContext(AbilityContext); const ability = useContext(AbilityContext);
const [permissionsLoaded, setPermissionsLoaded] = useState<boolean>(false); const [permissionsLoaded, setPermissionsLoaded] = useState<boolean>(false);

View File

@ -13,7 +13,7 @@ const usePrevious = (value: any, initialValue: any) => {
export default function useEffectDebugger( export default function useEffectDebugger(
effectHook: any, effectHook: any,
dependencies: any, dependencies: any,
dependencyNames: any = [] dependencyNames: any = [],
) { ) {
const previousDeps = usePrevious(dependencies, []); const previousDeps = usePrevious(dependencies, []);
@ -32,7 +32,7 @@ export default function useEffectDebugger(
return accum; return accum;
}, },
{} {},
); );
if (Object.keys(changedDeps).length) { if (Object.keys(changedDeps).length) {

View File

@ -26,7 +26,7 @@ const DEFAULT_OPTIONS = {
const useKeyboardShortcut = ( const useKeyboardShortcut = (
keyboardShortcuts: KeyboardShortcuts, keyboardShortcuts: KeyboardShortcuts,
userOptions?: any userOptions?: any,
) => { ) => {
let options = DEFAULT_OPTIONS; let options = DEFAULT_OPTIONS;
if (userOptions) { if (userOptions) {
@ -40,7 +40,7 @@ const useKeyboardShortcut = (
const shortcutKeys = Object.keys(keyboardShortcuts); const shortcutKeys = Object.keys(keyboardShortcuts);
const lengthsOfShortcutKeys = shortcutKeys.map( const lengthsOfShortcutKeys = shortcutKeys.map(
(shortcutKey: string) => shortcutKey.length (shortcutKey: string) => shortcutKey.length,
); );
const numberOfKeysToKeep = Math.max(...lengthsOfShortcutKeys); const numberOfKeysToKeep = Math.max(...lengthsOfShortcutKeys);
@ -103,7 +103,7 @@ const useKeyboardShortcut = (
if ( if (
options.ignoreInputFields && options.ignoreInputFields &&
EXCLUDE_LIST_DOM_TARGETS.indexOf( EXCLUDE_LIST_DOM_TARGETS.indexOf(
(keydownEvent.target as any).tagName (keydownEvent.target as any).tagName,
) >= 0 ) >= 0
) { ) {
return undefined; return undefined;
@ -112,7 +112,7 @@ const useKeyboardShortcut = (
keySequence.current.push(loweredKey); keySequence.current.push(loweredKey);
const keySequenceString = keySequence.current.join(','); const keySequenceString = keySequence.current.join(',');
const shortcutKey = shortcutKeys.find((sk: string) => const shortcutKey = shortcutKeys.find((sk: string) =>
keySequenceString.endsWith(sk) keySequenceString.endsWith(sk),
); );
if (shortcutKey) { if (shortcutKey) {
@ -133,7 +133,7 @@ const useKeyboardShortcut = (
keyboardShortcuts, keyboardShortcuts,
numberOfKeysToKeep, numberOfKeysToKeep,
shortcutKeys, shortcutKeys,
] ],
); );
useEffect(() => { useEffect(() => {

View File

@ -15,7 +15,7 @@ export default function useProcessGroupFetcher(processGroupIdentifier: string) {
const getProcessGroupCache = useCallback(() => { const getProcessGroupCache = useCallback(() => {
return JSON.parse( return JSON.parse(
localStorage.getItem(LOCAL_STORAGE_PROCESS_GROUP_CACHE_KEY) || '{}' localStorage.getItem(LOCAL_STORAGE_PROCESS_GROUP_CACHE_KEY) || '{}',
); );
}, []); }, []);
@ -33,7 +33,7 @@ export default function useProcessGroupFetcher(processGroupIdentifier: string) {
}); });
localStorage.setItem( localStorage.setItem(
'storedProcessGroups', 'storedProcessGroups',
JSON.stringify(storedProcessGroups) JSON.stringify(storedProcessGroups),
); );
}; };
@ -77,7 +77,7 @@ export default function useProcessGroupFetcher(processGroupIdentifier: string) {
}; };
localStorage.setItem( localStorage.setItem(
LOCAL_STORAGE_PROCESS_GROUP_CACHE_KEY, LOCAL_STORAGE_PROCESS_GROUP_CACHE_KEY,
JSON.stringify(storedProcessGroups) JSON.stringify(storedProcessGroups),
); );
}; };

View File

@ -46,7 +46,7 @@ const doRender = () => {
<App /> <App />
</ThemeProvider> </ThemeProvider>
</ThemeProvider> </ThemeProvider>
</React.StrictMode> </React.StrictMode>,
); );
}; };

View File

@ -13,7 +13,7 @@ import { Add } from '@carbon/icons-react';
export default function AddButton< export default function AddButton<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>({ className, onClick, disabled, registry }: IconButtonProps<T, S, F>) { >({ className, onClick, disabled, registry }: IconButtonProps<T, S, F>) {
return ( return (
<Button <Button

View File

@ -13,7 +13,7 @@ import {
export default function ArrayFieldItemTemplate< export default function ArrayFieldItemTemplate<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: ArrayFieldTemplateItemType<T, S, F>) { >(props: ArrayFieldTemplateItemType<T, S, F>) {
const { const {
children, children,

View File

@ -16,7 +16,7 @@ import {
export default function ArrayFieldTemplate< export default function ArrayFieldTemplate<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: ArrayFieldTemplateProps<T, S, F>) { >(props: ArrayFieldTemplateProps<T, S, F>) {
const { const {
canAdd, canAdd,
@ -42,7 +42,7 @@ export default function ArrayFieldTemplate<
const ArrayFieldItemTemplate = getTemplate<'ArrayFieldItemTemplate', T, S, F>( const ArrayFieldItemTemplate = getTemplate<'ArrayFieldItemTemplate', T, S, F>(
'ArrayFieldItemTemplate', 'ArrayFieldItemTemplate',
registry, registry,
uiOptions uiOptions,
); );
const ArrayFieldTitleTemplate = getTemplate< const ArrayFieldTitleTemplate = getTemplate<
'ArrayFieldTitleTemplate', 'ArrayFieldTitleTemplate',
@ -76,7 +76,7 @@ export default function ArrayFieldTemplate<
items.map( items.map(
({ key, ...itemProps }: ArrayFieldTemplateItemType<T, S, F>) => ( ({ key, ...itemProps }: ArrayFieldTemplateItemType<T, S, F>) => (
<ArrayFieldItemTemplate key={key} {...itemProps} /> <ArrayFieldItemTemplate key={key} {...itemProps} />
) ),
)} )}
</div> </div>
{canAdd && ( {canAdd && (

View File

@ -24,7 +24,7 @@ import { getCommonAttributes } from '../../helpers';
export default function BaseInputTemplate< export default function BaseInputTemplate<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: WidgetProps<T, S, F>) { >(props: WidgetProps<T, S, F>) {
const { const {
id, id,
@ -62,29 +62,29 @@ export default function BaseInputTemplate<
({ target }: React.ChangeEvent<HTMLInputElement>) => { ({ target }: React.ChangeEvent<HTMLInputElement>) => {
onChange(target.value === '' ? options.emptyValue : target.value); onChange(target.value === '' ? options.emptyValue : target.value);
}, },
[onChange, options] [onChange, options],
); );
const _onBlur = useCallback( const _onBlur = useCallback(
({ target }: React.FocusEvent<HTMLInputElement>) => ({ target }: React.FocusEvent<HTMLInputElement>) =>
onBlur(id, target.value), onBlur(id, target.value),
[onBlur, id] [onBlur, id],
); );
const _onFocus = useCallback( const _onFocus = useCallback(
({ target }: React.FocusEvent<HTMLInputElement>) => ({ target }: React.FocusEvent<HTMLInputElement>) =>
onFocus(id, target.value), onFocus(id, target.value),
[onFocus, id] [onFocus, id],
); );
const addDebouncedOnChangeDate = useDebouncedCallback( const addDebouncedOnChangeDate = useDebouncedCallback(
(fullObject: React.ChangeEvent<HTMLInputElement>) => { (fullObject: React.ChangeEvent<HTMLInputElement>) => {
fullObject.target.value = fullObject.target.value =
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
fullObject.target.value fullObject.target.value,
); );
_onChange(fullObject); _onChange(fullObject);
}, },
// delay in ms // delay in ms
100 100,
); );
const addDebouncedOnChangeText = useDebouncedCallback( const addDebouncedOnChangeText = useDebouncedCallback(
@ -92,7 +92,7 @@ export default function BaseInputTemplate<
(onChangeOverride || _onChange)(fullObject); (onChangeOverride || _onChange)(fullObject);
}, },
// delay in ms // delay in ms
100 100,
); );
let enableCounter = false; let enableCounter = false;
@ -103,7 +103,7 @@ export default function BaseInputTemplate<
maxCount = schema.maxLength; maxCount = schema.maxLength;
} else { } else {
throw new Error( throw new Error(
`Counter was requested but no maxLength given on the ${label}` `Counter was requested but no maxLength given on the ${label}`,
); );
} }
} }
@ -112,7 +112,7 @@ export default function BaseInputTemplate<
label, label,
schema, schema,
uiSchema, uiSchema,
rawErrors rawErrors,
); );
let component = null; let component = null;
@ -202,7 +202,7 @@ export default function BaseInputTemplate<
<datalist key={`datalist_${id}`} id={`examples_${id}`}> <datalist key={`datalist_${id}`} id={`examples_${id}`}>
{[ {[
...new Set( ...new Set(
schema.examples.concat(schema.default ? [schema.default] : []) schema.examples.concat(schema.default ? [schema.default] : []),
), ),
].map((example: any) => ( ].map((example: any) => (
<option key={example} value={example} /> <option key={example} value={example} />

View File

@ -44,7 +44,7 @@ function CheckboxWidget(props: WidgetProps) {
label, label,
schema, schema,
uiSchema, uiSchema,
rawErrors rawErrors,
); );
return ( return (

View File

@ -6,7 +6,7 @@ function DateTimeWidget(props: WidgetProps) {
const BaseInputTemplate = getTemplate<'BaseInputTemplate'>( const BaseInputTemplate = getTemplate<'BaseInputTemplate'>(
'BaseInputTemplate', 'BaseInputTemplate',
registry, registry,
options options,
); );
const value = utcToLocal(props.value); const value = utcToLocal(props.value);
const onChange = (value: any) => { const onChange = (value: any) => {

View File

@ -7,7 +7,7 @@ function DateWidget(props: WidgetProps) {
const BaseInputTemplate = getTemplate<'BaseInputTemplate'>( const BaseInputTemplate = getTemplate<'BaseInputTemplate'>(
'BaseInputTemplate', 'BaseInputTemplate',
registry, registry,
options options,
); );
const handleChange = useCallback( const handleChange = useCallback(
(value: any) => { (value: any) => {
@ -15,7 +15,7 @@ function DateWidget(props: WidgetProps) {
const newValue = DateAndTimeService.dateStringToYMDFormat(value); const newValue = DateAndTimeService.dateStringToYMDFormat(value);
onChange(newValue || undefined); onChange(newValue || undefined);
}, },
[onChange] [onChange],
); );
return <BaseInputTemplate type="date" {...props} onChange={handleChange} />; return <BaseInputTemplate type="date" {...props} onChange={handleChange} />;

View File

@ -13,7 +13,7 @@ import MDEditor from '@uiw/react-md-editor';
export default function DescriptionField< export default function DescriptionField<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: DescriptionFieldProps<T, S, F>) { >(props: DescriptionFieldProps<T, S, F>) {
const { id, description } = props; const { id, description } = props;
if (!description) { if (!description) {

View File

@ -18,7 +18,7 @@ import Label from './Label';
export default function FieldTemplate< export default function FieldTemplate<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: FieldTemplateProps<T, S, F>) { >(props: FieldTemplateProps<T, S, F>) {
const { const {
id, id,

View File

@ -64,7 +64,7 @@ function processFiles(files: FileList) {
function FileInfoPreview< function FileInfoPreview<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>({ >({
fileInfo, fileInfo,
registry, registry,
@ -106,7 +106,7 @@ function FileInfoPreview<
function FilesInfo< function FilesInfo<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>({ >({
filesInfo, filesInfo,
registry, registry,
@ -129,7 +129,7 @@ function FilesInfo<
const { MuiRemoveButton } = getTemplate<any, any, any>( const { MuiRemoveButton } = getTemplate<any, any, any>(
'ButtonTemplates', 'ButtonTemplates',
registry, registry,
options options,
); );
return ( return (
@ -190,7 +190,7 @@ function extractFileInfo(dataURLs: string[]): FileInfoType[] {
function FileWidget< function FileWidget<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: WidgetProps<T, S, F>) { >(props: WidgetProps<T, S, F>) {
const { const {
autofocus, autofocus,
@ -215,7 +215,7 @@ function FileWidget<
const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>( const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>(
'BaseInputTemplate', 'BaseInputTemplate',
registry, registry,
options options,
); );
const handleChange = useCallback( const handleChange = useCallback(
@ -235,30 +235,30 @@ function FileWidget<
} }
}); });
}, },
[multiple, value, onChange] [multiple, value, onChange],
); );
const _onBlur = useCallback( const _onBlur = useCallback(
({ target }: React.FocusEvent<HTMLInputElement>) => ({ target }: React.FocusEvent<HTMLInputElement>) =>
onBlur(id, target.value), onBlur(id, target.value),
[onBlur, id] [onBlur, id],
); );
const _onFocus = useCallback( const _onFocus = useCallback(
({ target }: React.FocusEvent<HTMLInputElement>) => ({ target }: React.FocusEvent<HTMLInputElement>) =>
onFocus(id, target.value), onFocus(id, target.value),
[onFocus, id] [onFocus, id],
); );
const commonAttributes = getCommonAttributes( const commonAttributes = getCommonAttributes(
label, label,
schema, schema,
uiSchema, uiSchema,
rawErrors rawErrors,
); );
const filesInfo = useMemo( const filesInfo = useMemo(
() => extractFileInfo(Array.isArray(value) ? value : [value]), () => extractFileInfo(Array.isArray(value) ? value : [value]),
[value] [value],
); );
const rmFile = useCallback( const rmFile = useCallback(
(index: number) => { (index: number) => {
@ -269,7 +269,7 @@ function FileWidget<
onChange(undefined); onChange(undefined);
} }
}, },
[multiple, value, onChange] [multiple, value, onChange],
); );
const inputProps = { const inputProps = {

View File

@ -15,7 +15,7 @@ import { Add, TrashCan, ArrowUp, ArrowDown } from '@carbon/icons-react';
export default function IconButton< export default function IconButton<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: IconButtonProps<T, S, F>) { >(props: IconButtonProps<T, S, F>) {
const { const {
iconType = 'default', iconType = 'default',
@ -58,7 +58,7 @@ export default function IconButton<
export function MoveDownButton< export function MoveDownButton<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: IconButtonProps<T, S, F>) { >(props: IconButtonProps<T, S, F>) {
return ( return (
<IconButton <IconButton
@ -73,7 +73,7 @@ export function MoveDownButton<
export function MoveUpButton< export function MoveUpButton<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: IconButtonProps<T, S, F>) { >(props: IconButtonProps<T, S, F>) {
return ( return (
<IconButton <IconButton
@ -88,7 +88,7 @@ export function MoveUpButton<
export function RemoveButton< export function RemoveButton<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: IconButtonProps<T, S, F>) { >(props: IconButtonProps<T, S, F>) {
return ( return (
<IconButton <IconButton
@ -104,7 +104,7 @@ export function RemoveButton<
export function MuiRemoveButton< export function MuiRemoveButton<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: IconButtonProps<T, S, F>) { >(props: IconButtonProps<T, S, F>) {
return ( return (
<MuiIconButton <MuiIconButton

View File

@ -57,10 +57,10 @@ type customProps = {
export default function ObjectFieldTemplate< export default function ObjectFieldTemplate<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>( >(
props: ObjectFieldTemplateProps<T, S, F>, props: ObjectFieldTemplateProps<T, S, F>,
{ defaultSm = 4, defaultMd = 8, defaultLg = 16 }: customProps { defaultSm = 4, defaultMd = 8, defaultLg = 16 }: customProps,
) { ) {
const { const {
description, description,
@ -80,7 +80,7 @@ export default function ObjectFieldTemplate<
const TitleFieldTemplate = getTemplate<'TitleFieldTemplate', T, S, F>( const TitleFieldTemplate = getTemplate<'TitleFieldTemplate', T, S, F>(
'TitleFieldTemplate', 'TitleFieldTemplate',
registry, registry,
options options,
); );
const DescriptionFieldTemplate = getTemplate< const DescriptionFieldTemplate = getTemplate<
'DescriptionFieldTemplate', 'DescriptionFieldTemplate',
@ -131,7 +131,7 @@ export default function ObjectFieldTemplate<
}); });
} else { } else {
innerElements = properties.map( innerElements = properties.map(
(prop: ObjectFieldTemplatePropertyType) => prop.content (prop: ObjectFieldTemplatePropertyType) => prop.content,
); );
} }

View File

@ -44,7 +44,7 @@ function RadioWidget({
label, label,
schema, schema,
uiSchema, uiSchema,
rawErrors rawErrors,
); );
// pass values in as strings so we can support both boolean and string radio buttons // pass values in as strings so we can support both boolean and string radio buttons

View File

@ -11,7 +11,7 @@ import { getCommonAttributes } from '../../helpers';
function SelectWidget< function SelectWidget<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>({ >({
schema, schema,
id, id,
@ -49,7 +49,7 @@ function SelectWidget<
label, label,
schema, schema,
uiSchema, uiSchema,
rawErrors rawErrors,
); );
// ok. so in safari, the select widget showed the first option, whereas in chrome it forced you to select an option. // ok. so in safari, the select widget showed the first option, whereas in chrome it forced you to select an option.

View File

@ -17,7 +17,7 @@ import { getCommonAttributes } from '../../helpers';
function TextareaWidget< function TextareaWidget<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>({ >({
id, id,
options = {}, options = {},
@ -38,19 +38,19 @@ function TextareaWidget<
const handleChange = useCallback( const handleChange = useCallback(
({ target: { value } }: React.ChangeEvent<HTMLTextAreaElement>) => ({ target: { value } }: React.ChangeEvent<HTMLTextAreaElement>) =>
onChange(value === '' ? options.emptyValue : value), onChange(value === '' ? options.emptyValue : value),
[onChange, options.emptyValue] [onChange, options.emptyValue],
); );
const handleBlur = useCallback( const handleBlur = useCallback(
({ target: { value } }: FocusEvent<HTMLTextAreaElement>) => ({ target: { value } }: FocusEvent<HTMLTextAreaElement>) =>
onBlur(id, value), onBlur(id, value),
[onBlur, id] [onBlur, id],
); );
const handleFocus = useCallback( const handleFocus = useCallback(
({ target: { value } }: FocusEvent<HTMLTextAreaElement>) => ({ target: { value } }: FocusEvent<HTMLTextAreaElement>) =>
onFocus(id, value), onFocus(id, value),
[id, onFocus] [id, onFocus],
); );
// this helps with performance for the select widget with rsjf 5.1+. // this helps with performance for the select widget with rsjf 5.1+.
@ -61,14 +61,14 @@ function TextareaWidget<
handleChange(fullObject); handleChange(fullObject);
}, },
// delay in ms // delay in ms
100 100,
); );
const commonAttributes = getCommonAttributes( const commonAttributes = getCommonAttributes(
label, label,
schema, schema,
uiSchema, uiSchema,
rawErrors rawErrors,
); );
let enableCounter = false; let enableCounter = false;
@ -79,7 +79,7 @@ function TextareaWidget<
maxCount = schema.maxLength; maxCount = schema.maxLength;
} else { } else {
throw new Error( throw new Error(
`Counter was requested but no maxLength given on the ${label}` `Counter was requested but no maxLength given on the ${label}`,
); );
} }
} }

View File

@ -15,7 +15,7 @@ const REQUIRED_FIELD_SYMBOL = '*';
export default function TitleField< export default function TitleField<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: TitleFieldProps<T, S, F>) { >(props: TitleFieldProps<T, S, F>) {
const { id, title, required } = props; const { id, title, required } = props;
return ( return (

View File

@ -16,7 +16,7 @@ import Label from '../FieldTemplate/Label';
export default function WrapIfAdditionalTemplate< export default function WrapIfAdditionalTemplate<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: WrapIfAdditionalTemplateProps<T, S, F>) { >(props: WrapIfAdditionalTemplateProps<T, S, F>) {
const { const {
id, id,

View File

@ -14,7 +14,7 @@ import ObjectFieldTemplate from '../carbon_theme/ObjectFieldTemplate';
export default function ObjectFieldRestrictedGridTemplate< export default function ObjectFieldRestrictedGridTemplate<
T = any, T = any,
S extends StrictRJSFSchema = RJSFSchema, S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any F extends FormContextType = any,
>(props: ObjectFieldTemplateProps<T, S, F>) { >(props: ObjectFieldTemplateProps<T, S, F>) {
return ObjectFieldTemplate(props, { return ObjectFieldTemplate(props, {
defaultSm: 4, defaultSm: 4,

View File

@ -45,7 +45,7 @@ export default function MarkDownFieldWidget({
onChange(newValue); onChange(newValue);
} }
}, },
[onChange, disabled, readonly] [onChange, disabled, readonly],
); );
let helperText = null; let helperText = null;

View File

@ -50,7 +50,7 @@ export default function NumericRangeField({
label, label,
schema, schema,
uiSchema, uiSchema,
rawErrors rawErrors,
); );
const description = schema?.description || uiSchema?.['ui:description']; const description = schema?.description || uiSchema?.['ui:description'];
@ -59,7 +59,7 @@ export default function NumericRangeField({
const DescriptionFieldTemplate = getTemplate( const DescriptionFieldTemplate = getTemplate(
'DescriptionFieldTemplate', 'DescriptionFieldTemplate',
registry, registry,
uiOptions uiOptions,
); );
const formatNumberString = (numberString: string): string => { const formatNumberString = (numberString: string): string => {

View File

@ -42,7 +42,7 @@ export default function TypeaheadWidget({
label, label,
schema, schema,
uiSchema, uiSchema,
rawErrors rawErrors,
); );
if (itemFormat) { if (itemFormat) {
@ -72,7 +72,7 @@ export default function TypeaheadWidget({
}); });
} }
}, },
[category] [category],
); );
useEffect(() => { useEffect(() => {

View File

@ -3,7 +3,7 @@ export const getCommonAttributes = (
label: string, label: string,
schema: any, schema: any,
uiSchema: any, uiSchema: any,
rawErrors: any rawErrors: any,
) => { ) => {
let labelToUse = label; let labelToUse = label;
if (uiSchema && uiSchema['ui:title']) { if (uiSchema && uiSchema['ui:title']) {

View File

@ -12,7 +12,7 @@ export default function About() {
useEffect(() => { useEffect(() => {
const handleVersionInfoResponse = ( const handleVersionInfoResponse = (
response: ObjectWithStringKeysAndValues response: ObjectWithStringKeysAndValues,
) => { ) => {
setBackendVersionInfo(response); setBackendVersionInfo(response);
}; };
@ -25,7 +25,7 @@ export default function About() {
const versionInfoFromDict = ( const versionInfoFromDict = (
title: string, title: string,
versionInfoDict: ObjectWithStringKeysAndValues | null versionInfoDict: ObjectWithStringKeysAndValues | null,
) => { ) => {
if (versionInfoDict !== null && Object.keys(versionInfoDict).length) { if (versionInfoDict !== null && Object.keys(versionInfoDict).length) {
const tableRows = Object.keys(versionInfoDict) const tableRows = Object.keys(versionInfoDict)

View File

@ -14,7 +14,7 @@ export default function AuthenticationList() {
AuthenticationItem[] | null AuthenticationItem[] | null
>(null); >(null);
const [connectProxyBaseUrl, setConnectProxyBaseUrl] = useState<string | null>( const [connectProxyBaseUrl, setConnectProxyBaseUrl] = useState<string | null>(
null null,
); );
const [redirectUrl, setRedirectUrl] = useState<string | null>(null); const [redirectUrl, setRedirectUrl] = useState<string | null>(null);

View File

@ -25,7 +25,7 @@ export default function CompletedInstances() {
text: `Instances with tasks completed by **${userGroup}**`, text: `Instances with tasks completed by **${userGroup}**`,
}; };
const identifierForTable = `completed-by-group-${slugifyString( const identifierForTable = `completed-by-group-${slugifyString(
userGroup userGroup,
)}`; )}`;
return ( return (
<ProcessInstanceListTable <ProcessInstanceListTable

View File

@ -30,7 +30,7 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
[targetUris.secretListPath]: ['GET'], [targetUris.secretListPath]: ['GET'],
}; };
const { ability, permissionsLoaded } = usePermissionFetcher( const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData permissionRequestData,
); );
useEffect(() => { useEffect(() => {
@ -44,7 +44,7 @@ export default function Configuration({ extensionUxElements }: OwnProps) {
const configurationExtensionTab = ( const configurationExtensionTab = (
uxElement: UiSchemaUxElement, uxElement: UiSchemaUxElement,
uxElementIndex: number uxElementIndex: number,
) => { ) => {
const navItemPage = `/configuration/extension${uxElement.page}`; const navItemPage = `/configuration/extension${uxElement.page}`;

View File

@ -92,14 +92,14 @@ export default function Extension({
return optionString; return optionString;
}, },
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
[] [],
); );
const processLoadResult = useCallback( const processLoadResult = useCallback(
(result: ExtensionApiResponse, pageDefinition: UiSchemaPageDefinition) => { (result: ExtensionApiResponse, pageDefinition: UiSchemaPageDefinition) => {
if (pageDefinition.navigate_to_on_load) { if (pageDefinition.navigate_to_on_load) {
const optionString = interpolateNavigationString( const optionString = interpolateNavigationString(
pageDefinition.navigate_to_on_load, pageDefinition.navigate_to_on_load,
result.task_data result.task_data,
); );
if (optionString !== null) { if (optionString !== null) {
window.location.href = optionString; window.location.href = optionString;
@ -107,7 +107,7 @@ export default function Extension({
} }
if (result.rendered_results_markdown) { if (result.rendered_results_markdown) {
const newMarkdown = FormattingService.checkForSpiffFormats( const newMarkdown = FormattingService.checkForSpiffFormats(
result.rendered_results_markdown result.rendered_results_markdown,
); );
setMarkdownToRenderOnLoad(newMarkdown); setMarkdownToRenderOnLoad(newMarkdown);
} }
@ -120,7 +120,7 @@ export default function Extension({
setuiSchemaPageComponents( setuiSchemaPageComponents(
result.task_data[ result.task_data[
pageDefinition.on_load.ui_schema_page_components_variable pageDefinition.on_load.ui_schema_page_components_variable
] ],
); );
// we were getting any AJV8Validator error when we had this data in the task data // we were getting any AJV8Validator error when we had this data in the task data
@ -136,7 +136,7 @@ export default function Extension({
setFormData(taskDataCopy); setFormData(taskDataCopy);
setReadyForComponentsToDisplay(true); setReadyForComponentsToDisplay(true);
}, },
[interpolateNavigationString] [interpolateNavigationString],
); );
const setConfigsIfDesiredSchemaFile = useCallback( const setConfigsIfDesiredSchemaFile = useCallback(
@ -147,7 +147,7 @@ export default function Extension({
(extensionUiSchemaFile as ProcessFile).file_contents (extensionUiSchemaFile as ProcessFile).file_contents
) { ) {
const extensionUiSchema: ExtensionUiSchema = JSON.parse( const extensionUiSchema: ExtensionUiSchema = JSON.parse(
(extensionUiSchemaFile as any).file_contents (extensionUiSchemaFile as any).file_contents,
); );
let pageIdentifierToUse = pageIdentifier; let pageIdentifierToUse = pageIdentifier;
@ -175,7 +175,7 @@ export default function Extension({
postBody.extension_input[searchParam] = postBody.extension_input[searchParam] =
searchParams.get(searchParam); searchParams.get(searchParam);
} }
} },
); );
} }
postBody.ui_schema_action = pageDefinition.on_load; postBody.ui_schema_action = pageDefinition.on_load;
@ -199,7 +199,7 @@ export default function Extension({
filesByName, filesByName,
processLoadResult, processLoadResult,
pageIdentifier, pageIdentifier,
] ],
); );
useEffect(() => { useEffect(() => {
@ -223,7 +223,7 @@ export default function Extension({
const processSubmitResult = ( const processSubmitResult = (
pageComponent: UiSchemaPageComponent, pageComponent: UiSchemaPageComponent,
result: ExtensionApiResponse result: ExtensionApiResponse,
) => { ) => {
let taskData = result.task_data; let taskData = result.task_data;
if (pageComponent.on_form_submit?.set_extension_data_from_full_api_result) { if (pageComponent.on_form_submit?.set_extension_data_from_full_api_result) {
@ -232,7 +232,7 @@ export default function Extension({
if (pageComponent && pageComponent.navigate_to_on_form_submit) { if (pageComponent && pageComponent.navigate_to_on_form_submit) {
const optionString = interpolateNavigationString( const optionString = interpolateNavigationString(
pageComponent.navigate_to_on_form_submit, pageComponent.navigate_to_on_form_submit,
taskData taskData,
); );
if (optionString !== null) { if (optionString !== null) {
window.location.href = optionString; window.location.href = optionString;
@ -241,7 +241,7 @@ export default function Extension({
setProcessedTaskData(taskData); setProcessedTaskData(taskData);
if (result.rendered_results_markdown) { if (result.rendered_results_markdown) {
const newMarkdown = FormattingService.checkForSpiffFormats( const newMarkdown = FormattingService.checkForSpiffFormats(
result.rendered_results_markdown result.rendered_results_markdown,
); );
setMarkdownToRenderOnSubmit(newMarkdown); setMarkdownToRenderOnSubmit(newMarkdown);
} }
@ -252,7 +252,7 @@ export default function Extension({
const handleFormSubmit = ( const handleFormSubmit = (
pageComponent: UiSchemaPageComponent, pageComponent: UiSchemaPageComponent,
formObject: any, formObject: any,
event: any event: any,
// eslint-disable-next-line sonarjs/cognitive-complexity // eslint-disable-next-line sonarjs/cognitive-complexity
) => { ) => {
event.preventDefault(); event.preventDefault();
@ -273,7 +273,7 @@ export default function Extension({
if (pageComponent.navigate_to_on_form_submit) { if (pageComponent.navigate_to_on_form_submit) {
optionString = interpolateNavigationString( optionString = interpolateNavigationString(
pageComponent.navigate_to_on_form_submit, pageComponent.navigate_to_on_form_submit,
dataToSubmit dataToSubmit,
); );
if (optionString !== null) { if (optionString !== null) {
window.location.href = optionString; window.location.href = optionString;
@ -327,7 +327,7 @@ export default function Extension({
const pmFileForArg = processModel.files.find( const pmFileForArg = processModel.files.find(
(pmFile: ProcessFile) => { (pmFile: ProcessFile) => {
return pmFile.name === fileName; return pmFile.name === fileName;
} },
); );
if (pmFileForArg) { if (pmFileForArg) {
let newArgValue = pmFileForArg.file_contents; let newArgValue = pmFileForArg.file_contents;
@ -370,7 +370,7 @@ export default function Extension({
linkTarget={mdEditorLinkTarget} linkTarget={mdEditorLinkTarget}
source={markdownContentsToRender.join('\n')} source={markdownContentsToRender.join('\n')}
wrapperClassName="with-bottom-margin" wrapperClassName="with-bottom-margin"
/> />,
); );
} }
@ -382,12 +382,12 @@ export default function Extension({
componentsToDisplay.push( componentsToDisplay.push(
createElement( createElement(
supportedComponents[componentName], supportedComponents[componentName],
argumentsForComponent argumentsForComponent,
) ),
); );
} else { } else {
console.error( console.error(
`Extension tried to use component with name '${component.name}' but that is not allowed.` `Extension tried to use component with name '${component.name}' but that is not allowed.`,
); );
} }
}); });
@ -401,7 +401,7 @@ export default function Extension({
linkTarget="_blank" linkTarget="_blank"
source={markdownToRenderOnSubmit} source={markdownToRenderOnSubmit}
wrapperClassName="with-top-margin" wrapperClassName="with-top-margin"
/> />,
); );
} else { } else {
componentsToDisplay.push( componentsToDisplay.push(
@ -419,7 +419,7 @@ export default function Extension({
minimap: { enabled: true }, minimap: { enabled: true },
}} }}
/> />
</> </>,
); );
} }
} }

View File

@ -43,7 +43,7 @@ export default function Login() {
onClick={() => UserService.doLogin(option, getOriginalUrl())} onClick={() => UserService.doLogin(option, getOriginalUrl())}
> >
{option.label} {option.label}
</Button> </Button>,
); );
}); });
return buttons; return buttons;

View File

@ -28,7 +28,7 @@ export default function MyTasks() {
const getTasks = () => { const getTasks = () => {
const { page, perPage } = getPageInfoFromSearchParams( const { page, perPage } = getPageInfoFromSearchParams(
searchParams, searchParams,
PER_PAGE_FOR_TASKS_ON_HOME_PAGE PER_PAGE_FOR_TASKS_ON_HOME_PAGE,
); );
const setTasksFromResult = (result: any) => { const setTasksFromResult = (result: any) => {
setTasks(result.results); setTasks(result.results);
@ -44,7 +44,7 @@ export default function MyTasks() {
refreshAtInterval( refreshAtInterval(
DateAndTimeService.REFRESH_INTERVAL_SECONDS, DateAndTimeService.REFRESH_INTERVAL_SECONDS,
DateAndTimeService.REFRESH_TIMEOUT_SECONDS, DateAndTimeService.REFRESH_TIMEOUT_SECONDS,
getTasks getTasks,
); );
}, [searchParams]); }, [searchParams]);
@ -125,7 +125,7 @@ export default function MyTasks() {
files: [], files: [],
}; };
const modifiedProcessModelId = modifyProcessIdentifierForPathParam( const modifiedProcessModelId = modifyProcessIdentifierForPathParam(
row.processModelIdentifier row.processModelIdentifier,
); );
return ( return (
<tr key={`${row.processGroupIdentifier}/${row.processModelIdentifier}`}> <tr key={`${row.processGroupIdentifier}/${row.processModelIdentifier}`}>
@ -166,7 +166,7 @@ export default function MyTasks() {
} }
const { page, perPage } = getPageInfoFromSearchParams( const { page, perPage } = getPageInfoFromSearchParams(
searchParams, searchParams,
PER_PAGE_FOR_TASKS_ON_HOME_PAGE PER_PAGE_FOR_TASKS_ON_HOME_PAGE,
); );
return ( return (
<> <>

View File

@ -32,7 +32,7 @@ export default function OnboardingView() {
onboarding.task_id onboarding.task_id
) { ) {
navigate( navigate(
`/tasks/${onboarding.process_instance_id}/${onboarding.task_id}` `/tasks/${onboarding.process_instance_id}/${onboarding.task_id}`,
); );
} else if ( } else if (
onboarding && onboarding &&

View File

@ -20,7 +20,7 @@ export default function ProcessGroupList() {
const navigate = useNavigate(); const navigate = useNavigate();
const [processModelAvailableItems, setProcessModelAvailableItems] = useState( const [processModelAvailableItems, setProcessModelAvailableItems] = useState(
[] [],
); );
const { targetUris } = useUriListForPermissions(); const { targetUris } = useUriListForPermissions();
@ -55,8 +55,8 @@ export default function ProcessGroupList() {
const processModel = selection.selectedItem; const processModel = selection.selectedItem;
navigate( navigate(
`/process-models/${modifyProcessIdentifierForPathParam( `/process-models/${modifyProcessIdentifierForPathParam(
processModel.id processModel.id,
)}` )}`,
); );
}; };
return ( return (
@ -95,7 +95,7 @@ export default function ProcessGroupList() {
headerElement={<h2 className="clear-left">Data Stores</h2>} headerElement={<h2 className="clear-left">Data Stores</h2>}
userCanCreateDataStores={ability.can( userCanCreateDataStores={ability.can(
'POST', 'POST',
targetUris.dataStoreListPath targetUris.dataStoreListPath,
)} )}
/> />
</> </>

View File

@ -33,10 +33,10 @@ export default function ProcessGroupShow() {
[targetUris.processModelCreatePath]: ['POST'], [targetUris.processModelCreatePath]: ['POST'],
}; };
const { ability, permissionsLoaded } = usePermissionFetcher( const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData permissionRequestData,
); );
const unModifiedProcessGroupId = unModifyProcessIdentifierForPathParam( const unModifiedProcessGroupId = unModifyProcessIdentifierForPathParam(
`${params.process_group_id}` `${params.process_group_id}`,
); );
const { processGroup } = useProcessGroupFetcher(unModifiedProcessGroupId); const { processGroup } = useProcessGroupFetcher(unModifiedProcessGroupId);
@ -59,7 +59,7 @@ export default function ProcessGroupShow() {
if (processGroup) { if (processGroup) {
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `/process-groups/${modifyProcessIdentifierForPathParam( path: `/process-groups/${modifyProcessIdentifierForPathParam(
processGroup.id processGroup.id,
)}`, )}`,
successCallback: navigateToProcessGroups, successCallback: navigateToProcessGroups,
httpMethod: 'DELETE', httpMethod: 'DELETE',
@ -69,7 +69,7 @@ export default function ProcessGroupShow() {
if (processGroup && processGroupForBreadcrumb && permissionsLoaded) { if (processGroup && processGroupForBreadcrumb && permissionsLoaded) {
const modifiedProcessGroupId = modifyProcessIdentifierForPathParam( const modifiedProcessGroupId = modifyProcessIdentifierForPathParam(
processGroup.id processGroup.id,
); );
const dasherizedProcessGroupId = modifiedProcessGroupId.replace(/:/g, '-'); const dasherizedProcessGroupId = modifiedProcessGroupId.replace(/:/g, '-');
const showNoItemsDisplayText = const showNoItemsDisplayText =
@ -153,7 +153,7 @@ export default function ProcessGroupShow() {
showNoItemsDisplayText={showNoItemsDisplayText} showNoItemsDisplayText={showNoItemsDisplayText}
userCanCreateProcessModels={ability.can( userCanCreateProcessModels={ability.can(
'POST', 'POST',
targetUris.processModelCreatePath targetUris.processModelCreatePath,
)} )}
/> />
<br /> <br />
@ -164,7 +164,7 @@ export default function ProcessGroupShow() {
showNoItemsDisplayText={showNoItemsDisplayText} showNoItemsDisplayText={showNoItemsDisplayText}
userCanCreateProcessModels={ability.can( userCanCreateProcessModels={ability.can(
'POST', 'POST',
targetUris.processGroupListPath targetUris.processGroupListPath,
)} )}
/> />
<br /> <br />
@ -175,7 +175,7 @@ export default function ProcessGroupShow() {
showNoItemsDisplayText={showNoItemsDisplayText} showNoItemsDisplayText={showNoItemsDisplayText}
userCanCreateDataStores={ability.can( userCanCreateDataStores={ability.can(
'POST', 'POST',
targetUris.dataStoreListPath targetUris.dataStoreListPath,
)} )}
/> />
</ul> </ul>

View File

@ -21,7 +21,7 @@ export default function ProcessInstanceFindById() {
path += 'for-me/'; path += 'for-me/';
} }
path += `${modifyProcessIdentifierForPathParam( path += `${modifyProcessIdentifierForPathParam(
processInstance.process_model_identifier processInstance.process_model_identifier,
)}/${processInstance.id}`; )}/${processInstance.id}`;
navigate(path); navigate(path);
}; };

View File

@ -44,7 +44,7 @@ export default function ProcessInstanceReportEdit() {
const filterByCsv = reportMetadata.filter_by const filterByCsv = reportMetadata.filter_by
.map( .map(
(filterByItem: ReportFilterBy) => (filterByItem: ReportFilterBy) =>
`${filterByItem.field_name}=${filterByItem.field_value}` `${filterByItem.field_name}=${filterByItem.field_value}`,
) )
.join(','); .join(',');
setFilterBy(filterByCsv); setFilterBy(filterByCsv);

View File

@ -105,11 +105,11 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const [tasksCallHadError, setTasksCallHadError] = useState<boolean>(false); const [tasksCallHadError, setTasksCallHadError] = useState<boolean>(false);
const [taskToDisplay, setTaskToDisplay] = useState<Task | null>(null); const [taskToDisplay, setTaskToDisplay] = useState<Task | null>(null);
const [taskToTimeTravelTo, setTaskToTimeTravelTo] = useState<Task | null>( const [taskToTimeTravelTo, setTaskToTimeTravelTo] = useState<Task | null>(
null null,
); );
const [taskDataToDisplay, setTaskDataToDisplay] = useState<string>(''); const [taskDataToDisplay, setTaskDataToDisplay] = useState<string>('');
const [taskInstancesToDisplay, setTaskInstancesToDisplay] = useState<Task[]>( const [taskInstancesToDisplay, setTaskInstancesToDisplay] = useState<Task[]>(
[] [],
); );
const [showTaskDataLoading, setShowTaskDataLoading] = const [showTaskDataLoading, setShowTaskDataLoading] =
useState<boolean>(false); useState<boolean>(false);
@ -136,12 +136,12 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const { addError, removeError } = useAPIError(); const { addError, removeError } = useAPIError();
const unModifiedProcessModelId = unModifyProcessIdentifierForPathParam( const unModifiedProcessModelId = unModifyProcessIdentifierForPathParam(
`${params.process_model_id}` `${params.process_model_id}`,
); );
const modifiedProcessModelId = params.process_model_id; const modifiedProcessModelId = params.process_model_id;
const processModelId = unModifyProcessIdentifierForPathParam( const processModelId = unModifyProcessIdentifierForPathParam(
params.process_model_id ? params.process_model_id : '' params.process_model_id ? params.process_model_id : '',
); );
const { targetUris } = useUriListForPermissions(); const { targetUris } = useUriListForPermissions();
@ -167,17 +167,17 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
[taskListPath]: ['GET'], [taskListPath]: ['GET'],
}; };
const { ability, permissionsLoaded } = usePermissionFetcher( const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData permissionRequestData,
); );
const navigateToProcessInstances = (_result: any) => { const navigateToProcessInstances = (_result: any) => {
navigate( navigate(
`/process-instances?process_model_identifier=${unModifiedProcessModelId}` `/process-instances?process_model_identifier=${unModifiedProcessModelId}`,
); );
}; };
const onProcessInstanceForceRun = ( const onProcessInstanceForceRun = (
processInstanceResult: ProcessInstance processInstanceResult: ProcessInstance,
) => { ) => {
if (processInstanceResult.process_model_uses_queued_execution) { if (processInstanceResult.process_model_uses_queued_execution) {
navigateToInstance({ navigateToInstance({
@ -213,7 +213,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
return; return;
} }
navigate( navigate(
`/editor/process-models/${modifiedProcessModelId}/files/${primaryFileName}` `/editor/process-models/${modifiedProcessModelId}/files/${primaryFileName}`,
); );
}; };
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
@ -259,7 +259,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const processTasksSuccess = (results: Task[]) => { const processTasksSuccess = (results: Task[]) => {
if (params.to_task_guid) { if (params.to_task_guid) {
const matchingTask = results.find( const matchingTask = results.find(
(task: Task) => task.guid === params.to_task_guid (task: Task) => task.guid === params.to_task_guid,
); );
if (matchingTask) { if (matchingTask) {
setTaskToTimeTravelTo(matchingTask); setTaskToTimeTravelTo(matchingTask);
@ -479,7 +479,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
<dt>{lastUpdatedTimeLabel}:</dt> <dt>{lastUpdatedTimeLabel}:</dt>
<dd> <dd>
{DateAndTimeService.convertSecondsToFormattedDateTime( {DateAndTimeService.convertSecondsToFormattedDateTime(
lastUpdatedTime || 0 lastUpdatedTime || 0,
) || 'N/A'} ) || 'N/A'}
</dd> </dd>
</dl> </dl>
@ -502,7 +502,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const [lastMilestoneFullValue, lastMilestoneTruncatedValue] = const [lastMilestoneFullValue, lastMilestoneTruncatedValue] =
getLastMilestoneFromProcessInstance( getLastMilestoneFromProcessInstance(
processInstance, processInstance,
processInstance.last_milestone_bpmn_name processInstance.last_milestone_bpmn_name,
); );
return ( return (
@ -531,7 +531,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
<Link <Link
data-qa="go-to-current-diagram-process-model" data-qa="go-to-current-diagram-process-model"
to={`/process-models/${modifyProcessIdentifierForPathParam( to={`/process-models/${modifyProcessIdentifierForPathParam(
processInstance.process_model_with_diagram_identifier || '' processInstance.process_model_with_diagram_identifier || '',
)}`} )}`}
> >
{processInstance.process_model_with_diagram_identifier} {processInstance.process_model_with_diagram_identifier}
@ -543,7 +543,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
<dt>Started:</dt> <dt>Started:</dt>
<dd> <dd>
{DateAndTimeService.convertSecondsToFormattedDateTime( {DateAndTimeService.convertSecondsToFormattedDateTime(
processInstance.start_in_seconds || 0 processInstance.start_in_seconds || 0,
)} )}
</dd> </dd>
</dl> </dl>
@ -572,11 +572,11 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
<dd data-qa={`metadata-value-${processInstanceMetadata.key}`}> <dd data-qa={`metadata-value-${processInstanceMetadata.key}`}>
{formatMetadataValue( {formatMetadataValue(
processInstanceMetadata.key, processInstanceMetadata.key,
processInstanceMetadata.value processInstanceMetadata.value,
)} )}
</dd> </dd>
</dl> </dl>
) ),
)} )}
</Column> </Column>
</Grid> </Grid>
@ -748,7 +748,9 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
bodyComponent = ( bodyComponent = (
<> <>
{childrenForErrorObject( {childrenForErrorObject(
errorForDisplayFromString(processDataToDisplay.process_data_value) errorForDisplayFromString(
processDataToDisplay.process_data_value,
),
)} )}
</> </>
); );
@ -774,7 +776,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const handleProcessDataShowReponseUnauthorized = ( const handleProcessDataShowReponseUnauthorized = (
dataObjectIdentifer: string, dataObjectIdentifer: string,
result: any result: any,
) => { ) => {
const processData: ProcessData = { const processData: ProcessData = {
process_data_identifier: dataObjectIdentifer, process_data_identifier: dataObjectIdentifer,
@ -791,7 +793,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const categoryExtension = dataObjectRef.extensionElements.values.find( const categoryExtension = dataObjectRef.extensionElements.values.find(
(extension: any) => { (extension: any) => {
return extension.$type === 'spiffworkflow:category'; return extension.$type === 'spiffworkflow:category';
} },
); );
if (categoryExtension) { if (categoryExtension) {
category = categoryExtension.$body; category = categoryExtension.$body;
@ -813,7 +815,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
searchParams.get('bpmn_process_guid') searchParams.get('bpmn_process_guid')
) { ) {
additionalParams = `?process_identifier=${searchParams.get( additionalParams = `?process_identifier=${searchParams.get(
'process_identifier' 'process_identifier',
)}&bpmn_process_guid=${searchParams.get('bpmn_process_guid')}`; )}&bpmn_process_guid=${searchParams.get('bpmn_process_guid')}`;
} }
} }
@ -830,7 +832,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const handleClickedDiagramTask = ( const handleClickedDiagramTask = (
shapeElement: any, shapeElement: any,
bpmnProcessIdentifiers: any bpmnProcessIdentifiers: any,
) => { ) => {
if (shapeElement.type === 'bpmn:DataObjectReference') { if (shapeElement.type === 'bpmn:DataObjectReference') {
makeProcessDataCallFromShapeElement(shapeElement); makeProcessDataCallFromShapeElement(shapeElement);
@ -839,7 +841,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
return ( return (
task.bpmn_identifier === shapeElement.id && task.bpmn_identifier === shapeElement.id &&
bpmnProcessIdentifiers.includes( bpmnProcessIdentifiers.includes(
task.bpmn_process_definition_identifier task.bpmn_process_definition_identifier,
) )
); );
}); });
@ -889,7 +891,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const createScriptUnitTest = () => { const createScriptUnitTest = () => {
if (taskToDisplay) { if (taskToDisplay) {
const previousTask: Task | null = getTaskById( const previousTask: Task | null = getTaskById(
getParentTaskFromTask(taskToDisplay) getParentTaskFromTask(taskToDisplay),
); );
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `/process-models/${modifiedProcessModelId}/script-unit-tests`, path: `/process-models/${modifiedProcessModelId}/script-unit-tests`,
@ -989,7 +991,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
task.task_definition_properties_json.event_definition; task.task_definition_properties_json.event_definition;
if (eventDefinition && eventDefinition.event_definitions) { if (eventDefinition && eventDefinition.event_definitions) {
return eventDefinition.event_definitions.map((e: EventDefinition) => return eventDefinition.event_definitions.map((e: EventDefinition) =>
handleMessage(e) handleMessage(e),
); );
} }
if (eventDefinition) { if (eventDefinition) {
@ -1098,7 +1100,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
hasIconOnly hasIconOnly
data-qa="create-script-unit-test-button" data-qa="create-script-unit-test-button"
onClick={createScriptUnitTest} onClick={createScriptUnitTest}
/> />,
); );
} }
@ -1112,7 +1114,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
target="_blank" target="_blank"
> >
View Call Activity Diagram View Call Activity Diagram
</Link> </Link>,
); );
} }
@ -1126,7 +1128,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
hasIconOnly hasIconOnly
data-qa="edit-task-data-button" data-qa="edit-task-data-button"
onClick={() => setEditingTaskData(true)} onClick={() => setEditingTaskData(true)}
/> />,
); );
} }
if (canAddPotentialOwners(task)) { if (canAddPotentialOwners(task)) {
@ -1140,7 +1142,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
hasIconOnly hasIconOnly
data-qa="add-potential-owners-button" data-qa="add-potential-owners-button"
onClick={() => setAddingPotentialOwners(true)} onClick={() => setAddingPotentialOwners(true)}
/> />,
); );
} }
if (canCompleteTask(task)) { if (canCompleteTask(task)) {
@ -1155,7 +1157,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
onClick={() => completeTask(true)} onClick={() => completeTask(true)}
> >
Execute Task Execute Task
</Button> </Button>,
); );
buttons.push( buttons.push(
<Button <Button
@ -1168,7 +1170,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
onClick={() => completeTask(false)} onClick={() => completeTask(false)}
> >
Skip Task Skip Task
</Button> </Button>,
); );
} }
if (canSendEvent(task)) { if (canSendEvent(task)) {
@ -1183,7 +1185,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
onClick={() => setSelectingEvent(true)} onClick={() => setSelectingEvent(true)}
> >
Send Event Send Event
</Button> </Button>,
); );
} }
if (canResetProcess(task)) { if (canResetProcess(task)) {
@ -1202,7 +1204,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
title={titleText} title={titleText}
data-qa="reset-process-button" data-qa="reset-process-button"
onClick={() => resetProcessInstance()} onClick={() => resetProcessInstance()}
/> />,
); );
} }
return buttons; return buttons;
@ -1320,7 +1322,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
onChange={(value: any) => { onChange={(value: any) => {
setEventToSend(value.selectedItem); setEventToSend(value.selectedItem);
setEventTextEditorEnabled( setEventTextEditorEnabled(
eventsThatNeedPayload.includes(value.selectedItem.typename) eventsThatNeedPayload.includes(value.selectedItem.typename),
); );
}} }}
/> />
@ -1391,7 +1393,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
<div className="task-instance-modal-row-item"> <div className="task-instance-modal-row-item">
{index + 1} {': '} {index + 1} {': '}
{DateAndTimeService.convertSecondsToFormattedDateTime( {DateAndTimeService.convertSecondsToFormattedDateTime(
task.properties_json.last_state_change task.properties_json.last_state_change,
)}{' '} )}{' '}
{' - '} {task.state} {' - '} {task.state}
</div> </div>
@ -1405,7 +1407,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const createButtonsForMultiTasks = ( const createButtonsForMultiTasks = (
instances: number[], instances: number[],
infoType: string infoType: string,
) => { ) => {
if (!tasks || !taskToDisplay) { if (!tasks || !taskToDisplay) {
return []; return [];
@ -1443,7 +1445,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
className="task-info-modal-accordion" className="task-info-modal-accordion"
> >
{createButtonSetForTaskInstances()} {createButtonSetForTaskInstances()}
</AccordionItem> </AccordionItem>,
); );
} }
@ -1460,7 +1462,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
})`} })`}
> >
{taskInstances} {taskInstances}
</AccordionItem> </AccordionItem>,
); );
}); });
} }
@ -1470,7 +1472,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
]; ];
const buttons = createButtonsForMultiTasks( const buttons = createButtonsForMultiTasks(
loopTaskInstanceIndexes, loopTaskInstanceIndexes,
'mi-loop-iterations' 'mi-loop-iterations',
); );
let text = ''; let text = '';
if ( if (
@ -1487,7 +1489,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
> >
<div>{text}</div> <div>{text}</div>
<div>{buttons}</div> <div>{buttons}</div>
</AccordionItem> </AccordionItem>,
); );
} }
if (accordionItems.length > 0) { if (accordionItems.length > 0) {
@ -1578,7 +1580,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
<Stack orientation="horizontal" gap={2}> <Stack orientation="horizontal" gap={2}>
{completionViewLink( {completionViewLink(
'View process instance at the time when this task was active.', 'View process instance at the time when this task was active.',
taskToUse.guid taskToUse.guid,
)} )}
</Stack> </Stack>
<br /> <br />
@ -1671,8 +1673,8 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
<> <>
{childrenForErrorObject( {childrenForErrorObject(
errorForDisplayFromString( errorForDisplayFromString(
processInstance.bpmn_xml_file_contents_retrieval_error || '' processInstance.bpmn_xml_file_contents_retrieval_error || '',
) ),
)} )}
</> </>
); );
@ -1777,7 +1779,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
const canViewLogs = ability.can( const canViewLogs = ability.can(
'GET', 'GET',
targetUris.processInstanceLogListPath targetUris.processInstanceLogListPath,
); );
const canViewMsgs = ability.can('GET', targetUris.messageInstanceListPath); const canViewMsgs = ability.can('GET', targetUris.messageInstanceListPath);

View File

@ -97,7 +97,7 @@ export default function ProcessModelEditDiagram() {
const [scriptAssistValue, setScriptAssistValue] = useState<string>(''); const [scriptAssistValue, setScriptAssistValue] = useState<string>('');
const [scriptAssistError, setScriptAssistError] = useState<string | null>( const [scriptAssistError, setScriptAssistError] = useState<string | null>(
null null,
); );
const { scriptAssistEnabled } = useScriptAssistEnabled(); const { scriptAssistEnabled } = useScriptAssistEnabled();
const { setScriptAssistQuery, scriptAssistLoading, scriptAssistResult } = const { setScriptAssistQuery, scriptAssistLoading, scriptAssistResult } =
@ -137,14 +137,14 @@ export default function ProcessModelEditDiagram() {
const { addError, removeError } = useAPIError(); const { addError, removeError } = useAPIError();
const [processModelFile, setProcessModelFile] = useState<ProcessFile | null>( const [processModelFile, setProcessModelFile] = useState<ProcessFile | null>(
null null,
); );
const [newFileName, setNewFileName] = useState(''); const [newFileName, setNewFileName] = useState('');
const [bpmnXmlForDiagramRendering, setBpmnXmlForDiagramRendering] = const [bpmnXmlForDiagramRendering, setBpmnXmlForDiagramRendering] =
useState(null); useState(null);
const modifiedProcessModelId = modifyProcessIdentifierForPathParam( const modifiedProcessModelId = modifyProcessIdentifierForPathParam(
(params as any).process_model_id (params as any).process_model_id,
); );
const processModelPath = `process-models/${modifiedProcessModelId}`; const processModelPath = `process-models/${modifiedProcessModelId}`;
@ -220,10 +220,10 @@ export default function ProcessModelEditDiagram() {
} }
if (!params.file_name) { if (!params.file_name) {
const fileNameWithExtension = `${newFileName}.${searchParams.get( const fileNameWithExtension = `${newFileName}.${searchParams.get(
'file_type' 'file_type',
)}`; )}`;
navigate( navigate(
`/editor/process-models/${modifiedProcessModelId}/files/${fileNameWithExtension}` `/editor/process-models/${modifiedProcessModelId}/files/${fileNameWithExtension}`,
); );
} }
}; };
@ -365,7 +365,7 @@ export default function ProcessModelEditDiagram() {
const ruleList = styleSheet.cssRules; const ruleList = styleSheet.cssRules;
for (let ii = ruleList.length - 1; ii >= 0; ii -= 1) { for (let ii = ruleList.length - 1; ii >= 0; ii -= 1) {
const regexp = new RegExp( const regexp = new RegExp(
`^.${failingScriptLineClassNamePrefix}_.*::after ` `^.${failingScriptLineClassNamePrefix}_.*::after `,
); );
if (ruleList[ii].cssText.match(regexp)) { if (ruleList[ii].cssText.match(regexp)) {
styleSheet.deleteRule(ii); styleSheet.deleteRule(ii);
@ -473,7 +473,7 @@ export default function ProcessModelEditDiagram() {
const setScriptUnitTestElementWithIndex = ( const setScriptUnitTestElementWithIndex = (
scriptIndex: number, scriptIndex: number,
element: any = scriptElement element: any = scriptElement,
) => { ) => {
const unitTestsModdleElements = getScriptUnitTestElements(element); const unitTestsModdleElements = getScriptUnitTestElements(element);
if (unitTestsModdleElements.length > 0) { if (unitTestsModdleElements.length > 0) {
@ -487,7 +487,7 @@ export default function ProcessModelEditDiagram() {
script: string, script: string,
scriptTypeString: string, scriptTypeString: string,
eventBus: any, eventBus: any,
modeling: any modeling: any,
) => { ) => {
// TODO: modeling is only needed for script unit tests. // TODO: modeling is only needed for script unit tests.
// we should update this to act like updating scripts // we should update this to act like updating scripts
@ -590,14 +590,14 @@ export default function ProcessModelEditDiagram() {
monacoRef.current monacoRef.current
) { ) {
const currentClassName = `${failingScriptLineClassNamePrefix}_${makeid( const currentClassName = `${failingScriptLineClassNamePrefix}_${makeid(
7 7,
)}`; )}`;
// document.documentElement.style.setProperty causes the content property to go away // document.documentElement.style.setProperty causes the content property to go away
// so add the rule dynamically instead of changing a property variable // so add the rule dynamically instead of changing a property variable
document.styleSheets[0].addRule( document.styleSheets[0].addRule(
`.${currentClassName}::after`, `.${currentClassName}::after`,
`content: " # ${result.error.replaceAll('"', '')}"; color: red` `content: " # ${result.error.replaceAll('"', '')}"; color: red`,
); );
const lineLength = const lineLength =
@ -611,11 +611,11 @@ export default function ProcessModelEditDiagram() {
// Range(lineStart, column, lineEnd, column) // Range(lineStart, column, lineEnd, column)
range: new (monacoRef.current as any).Range( range: new (monacoRef.current as any).Range(
result.line_number, result.line_number,
lineLength lineLength,
), ),
options: { afterContentClassName: currentClassName }, options: { afterContentClassName: currentClassName },
}, },
] ],
); );
} }
} }
@ -628,7 +628,7 @@ export default function ProcessModelEditDiagram() {
try { try {
inputJson = JSON.parse(currentScriptUnitTest.inputJson.value); inputJson = JSON.parse(currentScriptUnitTest.inputJson.value);
expectedJson = JSON.parse( expectedJson = JSON.parse(
currentScriptUnitTest.expectedOutputJson.value currentScriptUnitTest.expectedOutputJson.value,
); );
} catch (e) { } catch (e) {
setScriptUnitTestResult({ setScriptUnitTestResult({
@ -662,7 +662,7 @@ export default function ProcessModelEditDiagram() {
errorObject = `Error encountered running the script. Please check the code around line ${scriptUnitTestResult.line_number}`; errorObject = `Error encountered running the script. Please check the code around line ${scriptUnitTestResult.line_number}`;
} else { } else {
errorObject = `Error encountered running the script. ${JSON.stringify( errorObject = `Error encountered running the script. ${JSON.stringify(
scriptUnitTestResult.error scriptUnitTestResult.error,
)}`; )}`;
} }
let errorStringElement = <span>{errorObject}</span>; let errorStringElement = <span>{errorObject}</span>;
@ -681,13 +681,13 @@ export default function ProcessModelEditDiagram() {
outputJson = JSON.stringify( outputJson = JSON.stringify(
JSON.parse(currentScriptUnitTest.expectedOutputJson.value), JSON.parse(currentScriptUnitTest.expectedOutputJson.value),
null, null,
' ' ' ',
); );
} }
const contextJson = JSON.stringify( const contextJson = JSON.stringify(
scriptUnitTestResult.context, scriptUnitTestResult.context,
null, null,
' ' ' ',
); );
errorContextElement = ( errorContextElement = (
<DiffEditor <DiffEditor
@ -762,12 +762,12 @@ export default function ProcessModelEditDiagram() {
inputJson = JSON.stringify( inputJson = JSON.stringify(
JSON.parse(currentScriptUnitTest.inputJson.value), JSON.parse(currentScriptUnitTest.inputJson.value),
null, null,
' ' ' ',
); );
outputJson = JSON.stringify( outputJson = JSON.stringify(
JSON.parse(currentScriptUnitTest.expectedOutputJson.value), JSON.parse(currentScriptUnitTest.expectedOutputJson.value),
null, null,
' ' ' ',
); );
} catch (e) { } catch (e) {
// Attemping to format the json failed -- it's invalid. // Attemping to format the json failed -- it's invalid.
@ -1001,7 +1001,7 @@ export default function ProcessModelEditDiagram() {
const onLaunchMarkdownEditor = ( const onLaunchMarkdownEditor = (
_element: any, _element: any,
markdown: string, markdown: string,
eventBus: any eventBus: any,
) => { ) => {
setMarkdownText(markdown || ''); setMarkdownText(markdown || '');
setMarkdownEventBus(eventBus); setMarkdownEventBus(eventBus);
@ -1039,7 +1039,7 @@ export default function ProcessModelEditDiagram() {
const onSearchProcessModels = ( const onSearchProcessModels = (
_processId: string, _processId: string,
eventBus: any, eventBus: any,
element: any element: any,
) => { ) => {
setProcessSearchEventBus(eventBus); setProcessSearchEventBus(eventBus);
setProcessSearchElement(element); setProcessSearchElement(element);
@ -1078,7 +1078,7 @@ export default function ProcessModelEditDiagram() {
const findFileNameForReferenceId = ( const findFileNameForReferenceId = (
id: string, id: string,
type: string type: string,
): ProcessFile | null => { ): ProcessFile | null => {
// Given a reference id (like a process_id, or decision_id) finds the file // Given a reference id (like a process_id, or decision_id) finds the file
// that contains that reference and returns it. // that contains that reference and returns it.
@ -1098,22 +1098,22 @@ export default function ProcessModelEditDiagram() {
const onLaunchBpmnEditor = (processId: string) => { const onLaunchBpmnEditor = (processId: string) => {
const openProcessModelFileInNewTab = ( const openProcessModelFileInNewTab = (
processReference: ProcessReference processReference: ProcessReference,
) => { ) => {
const path = generatePath( const path = generatePath(
'/editor/process-models/:process_model_path/files/:file_name', '/editor/process-models/:process_model_path/files/:file_name',
{ {
process_model_path: modifyProcessIdentifierForPathParam( process_model_path: modifyProcessIdentifierForPathParam(
processReference.relative_location processReference.relative_location,
), ),
file_name: processReference.file_name, file_name: processReference.file_name,
} },
); );
window.open(path); window.open(path);
}; };
const openFileNameForProcessId = ( const openFileNameForProcessId = (
processesReferences: ProcessReference[] processesReferences: ProcessReference[],
) => { ) => {
const processRef = processesReferences.find((p) => { const processRef = processesReferences.find((p) => {
return p.identifier === processId; return p.identifier === processId;
@ -1143,7 +1143,7 @@ export default function ProcessModelEditDiagram() {
const onLaunchJsonSchemaEditor = ( const onLaunchJsonSchemaEditor = (
element: any, element: any,
fileName: string, fileName: string,
eventBus: any eventBus: any,
) => { ) => {
setFileEventBus(eventBus); setFileEventBus(eventBus);
setJsonScehmaFileName(fileName); setJsonScehmaFileName(fileName);
@ -1188,7 +1188,7 @@ export default function ProcessModelEditDiagram() {
{ {
process_model_id: params.process_model_id || null, process_model_id: params.process_model_id || null,
file_name: file.name, file_name: file.name,
} },
); );
window.open(path); window.open(path);
} else { } else {
@ -1196,7 +1196,7 @@ export default function ProcessModelEditDiagram() {
'/editor/process-models/:process_model_id/files?file_type=dmn', '/editor/process-models/:process_model_id/files?file_type=dmn',
{ {
process_model_id: params.process_model_id || null, process_model_id: params.process_model_id || null,
} },
); );
} }
window.open(path); window.open(path);

View File

@ -36,7 +36,7 @@ export default function ProcessModelNew() {
<ProcessModelForm <ProcessModelForm
mode="new" mode="new"
processGroupId={unModifyProcessIdentifierForPathParam( processGroupId={unModifyProcessIdentifierForPathParam(
params.process_group_id || '' params.process_group_id || '',
)} )}
processModel={processModel} processModel={processModel}
setProcessModel={setProcessModel} setProcessModel={setProcessModel}

View File

@ -73,11 +73,11 @@ export default function ProcessModelShow() {
[targetUris.processModelFileCreatePath]: ['POST', 'PUT', 'GET', 'DELETE'], [targetUris.processModelFileCreatePath]: ['POST', 'PUT', 'GET', 'DELETE'],
}; };
const { ability, permissionsLoaded } = usePermissionFetcher( const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData permissionRequestData,
); );
const modifiedProcessModelId = modifyProcessIdentifierForPathParam( const modifiedProcessModelId = modifyProcessIdentifierForPathParam(
`${params.process_model_id}` `${params.process_model_id}`,
); );
let hasTestCaseFiles: boolean = false; let hasTestCaseFiles: boolean = false;
@ -88,7 +88,7 @@ export default function ProcessModelShow() {
if (processModel) { if (processModel) {
hasTestCaseFiles = !!processModel.files.find( hasTestCaseFiles = !!processModel.files.find(
(processModelFile: ProcessFile) => isTestCaseFile(processModelFile) (processModelFile: ProcessFile) => isTestCaseFile(processModelFile),
); );
} }
@ -193,7 +193,7 @@ export default function ProcessModelShow() {
const navigateToProcessModels = (_result: any) => { const navigateToProcessModels = (_result: any) => {
navigate( navigate(
`/process-groups/${getGroupFromModifiedModelId(modifiedProcessModelId)}` `/process-groups/${getGroupFromModifiedModelId(modifiedProcessModelId)}`,
); );
}; };
@ -229,7 +229,7 @@ export default function ProcessModelShow() {
const renderButtonElements = ( const renderButtonElements = (
processModelFile: ProcessFile, processModelFile: ProcessFile,
isPrimaryBpmnFile: boolean isPrimaryBpmnFile: boolean,
) => { ) => {
const elements = []; const elements = [];
@ -258,7 +258,7 @@ export default function ProcessModelShow() {
data-qa={`edit-file-${processModelFile.name.replace('.', '-')}`} data-qa={`edit-file-${processModelFile.name.replace('.', '-')}`}
onClick={() => navigateToFileEdit(processModelFile)} onClick={() => navigateToFileEdit(processModelFile)}
/> />
</Can> </Can>,
); );
elements.push( elements.push(
<Can I="GET" a={targetUris.processModelFileCreatePath} ability={ability}> <Can I="GET" a={targetUris.processModelFileCreatePath} ability={ability}>
@ -270,7 +270,7 @@ export default function ProcessModelShow() {
size="lg" size="lg"
onClick={() => downloadFile(processModelFile.name)} onClick={() => downloadFile(processModelFile.name)}
/> />
</Can> </Can>,
); );
if (!isPrimaryBpmnFile) { if (!isPrimaryBpmnFile) {
@ -292,7 +292,7 @@ export default function ProcessModelShow() {
confirmButtonLabel="Delete" confirmButtonLabel="Delete"
classNameForModal="modal-within-table-cell" classNameForModal="modal-within-table-cell"
/> />
</Can> </Can>,
); );
} }
if (processModelFile.name.match(/\.bpmn$/) && !isPrimaryBpmnFile) { if (processModelFile.name.match(/\.bpmn$/) && !isPrimaryBpmnFile) {
@ -306,7 +306,7 @@ export default function ProcessModelShow() {
size="lg" size="lg"
onClick={() => onSetPrimaryFile(processModelFile.name)} onClick={() => onSetPrimaryFile(processModelFile.name)}
/> />
</Can> </Can>,
); );
} }
if (isTestCaseFile(processModelFile)) { if (isTestCaseFile(processModelFile)) {
@ -317,7 +317,7 @@ export default function ProcessModelShow() {
titleText="Run BPMN unit tests defined in this file" titleText="Run BPMN unit tests defined in this file"
classNameForModal="modal-within-table-cell" classNameForModal="modal-within-table-cell"
/> />
</Can> </Can>,
); );
} }
return elements; return elements;
@ -540,21 +540,21 @@ export default function ProcessModelShow() {
onChange={(a: any) => { onChange={(a: any) => {
if (a.selectedItem.text === 'New BPMN File') { if (a.selectedItem.text === 'New BPMN File') {
navigate( navigate(
`/editor/process-models/${modifiedProcessModelId}/files?file_type=bpmn` `/editor/process-models/${modifiedProcessModelId}/files?file_type=bpmn`,
); );
} else if (a.selectedItem.text === 'Upload File') { } else if (a.selectedItem.text === 'Upload File') {
setShowFileUploadModal(true); setShowFileUploadModal(true);
} else if (a.selectedItem.text === 'New DMN File') { } else if (a.selectedItem.text === 'New DMN File') {
navigate( navigate(
`/editor/process-models/${modifiedProcessModelId}/files?file_type=dmn` `/editor/process-models/${modifiedProcessModelId}/files?file_type=dmn`,
); );
} else if (a.selectedItem.text === 'New JSON File') { } else if (a.selectedItem.text === 'New JSON File') {
navigate( navigate(
`/process-models/${modifiedProcessModelId}/form?file_ext=json` `/process-models/${modifiedProcessModelId}/form?file_ext=json`,
); );
} else if (a.selectedItem.text === 'New Markdown File') { } else if (a.selectedItem.text === 'New Markdown File') {
navigate( navigate(
`/process-models/${modifiedProcessModelId}/form?file_ext=md` `/process-models/${modifiedProcessModelId}/form?file_ext=md`,
); );
} }
}} }}

View File

@ -41,7 +41,7 @@ export default function ReactFormEditor() {
const [processModel, setProcessModel] = useState<ProcessModel | null>(null); const [processModel, setProcessModel] = useState<ProcessModel | null>(null);
const [processModelFile, setProcessModelFile] = useState<ProcessFile | null>( const [processModelFile, setProcessModelFile] = useState<ProcessFile | null>(
null null,
); );
const [processModelFileContents, setProcessModelFileContents] = useState(''); const [processModelFileContents, setProcessModelFileContents] = useState('');
@ -73,7 +73,7 @@ export default function ReactFormEditor() {
})(); })();
const modifiedProcessModelId = modifyProcessIdentifierForPathParam( const modifiedProcessModelId = modifyProcessIdentifierForPathParam(
`${params.process_model_id}` `${params.process_model_id}`,
); );
useEffect(() => { useEffect(() => {
@ -110,7 +110,7 @@ export default function ReactFormEditor() {
const fileNameWithExtension = const fileNameWithExtension =
defaultFileName ?? `${newFileName}.${fileExtension}`; defaultFileName ?? `${newFileName}.${fileExtension}`;
navigate( navigate(
`/process-models/${modifiedProcessModelId}/form/${fileNameWithExtension}` `/process-models/${modifiedProcessModelId}/form/${fileNameWithExtension}`,
); );
} }
}; };
@ -139,7 +139,7 @@ export default function ReactFormEditor() {
const file = new File( const file = new File(
[processModelFileContents], [processModelFileContents],
fileNameWithExtension || '' fileNameWithExtension || '',
); );
const formData = new FormData(); const formData = new FormData();
formData.append('file', file); formData.append('file', file);
@ -304,7 +304,7 @@ export default function ReactFormEditor() {
<Button <Button
onClick={() => onClick={() =>
navigate( navigate(
`/editor/process-models/${modifiedProcessModelId}/files/${params.file_name}` `/editor/process-models/${modifiedProcessModelId}/files/${params.file_name}`,
) )
} }
variant="danger" variant="danger"

View File

@ -23,7 +23,7 @@ export default function SecretList() {
[targetUris.secretListPath]: ['GET'], [targetUris.secretListPath]: ['GET'],
}; };
const { ability, permissionsLoaded } = usePermissionFetcher( const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData permissionRequestData,
); );
useEffect(() => { useEffect(() => {

View File

@ -25,7 +25,7 @@ export default function SecretShow() {
[targetUris.secretShowValuePath]: ['GET'], [targetUris.secretShowValuePath]: ['GET'],
}; };
const { ability, permissionsLoaded } = usePermissionFetcher( const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData permissionRequestData,
); );
useEffect(() => { useEffect(() => {

View File

@ -64,11 +64,11 @@ export default function TaskShow() {
(myTask: BasicTask) => { (myTask: BasicTask) => {
navigate( navigate(
`/process-instances/for-me/${modifyProcessIdentifierForPathParam( `/process-instances/for-me/${modifyProcessIdentifierForPathParam(
myTask.process_model_identifier myTask.process_model_identifier,
)}/${myTask.process_instance_id}/interstitial` )}/${myTask.process_instance_id}/interstitial`,
); );
}, },
[navigate] [navigate],
); );
const processBasicTaskResult = useCallback( const processBasicTaskResult = useCallback(
@ -79,8 +79,8 @@ export default function TaskShow() {
if (result.process_model_uses_queued_execution) { if (result.process_model_uses_queued_execution) {
navigate( navigate(
`/process-instances/for-me/${modifyProcessIdentifierForPathParam( `/process-instances/for-me/${modifyProcessIdentifierForPathParam(
result.process_model_identifier result.process_model_identifier,
)}/${result.process_instance_id}/progress` )}/${result.process_instance_id}/progress`,
); );
} else { } else {
navigateToInterstitial(result); navigateToInterstitial(result);
@ -97,14 +97,14 @@ export default function TaskShow() {
[ [
`Process Instance Id: ${result.process_instance_id}`, `Process Instance Id: ${result.process_instance_id}`,
`/process-instances/for-me/${modifyProcessIdentifierForPathParam( `/process-instances/for-me/${modifyProcessIdentifierForPathParam(
result.process_model_identifier result.process_model_identifier,
)}/${result.process_instance_id}`, )}/${result.process_instance_id}`,
], ],
[`Task: ${result.name_for_display || result.id}`], [`Task: ${result.name_for_display || result.id}`],
]; ];
setHotCrumbs(hotCrumbList); setHotCrumbs(hotCrumbList);
}, },
[navigateToInterstitial, navigate] [navigateToInterstitial, navigate],
); );
useEffect(() => { useEffect(() => {
@ -162,7 +162,7 @@ export default function TaskShow() {
const sendAutosaveEvent = (eventDetails?: any) => { const sendAutosaveEvent = (eventDetails?: any) => {
const elementToDispath: any = document.getElementById( const elementToDispath: any = document.getElementById(
'hidden-form-for-autosave' 'hidden-form-for-autosave',
); );
if (elementToDispath) { if (elementToDispath) {
elementToDispath.dispatchEvent( elementToDispath.dispatchEvent(
@ -170,7 +170,7 @@ export default function TaskShow() {
cancelable: true, cancelable: true,
bubbles: true, bubbles: true,
detail: eventDetails, detail: eventDetails,
}) }),
); );
} }
}; };
@ -182,7 +182,7 @@ export default function TaskShow() {
} }
}, },
// delay in ms // delay in ms
500 500,
); );
const processSubmitResult = (result: any) => { const processSubmitResult = (result: any) => {
@ -195,8 +195,8 @@ export default function TaskShow() {
} else if (result.process_model_uses_queued_execution) { } else if (result.process_model_uses_queued_execution) {
navigate( navigate(
`/process-instances/for-me/${modifyProcessIdentifierForPathParam( `/process-instances/for-me/${modifyProcessIdentifierForPathParam(
result.process_model_identifier result.process_model_identifier,
)}/${result.process_instance_id}/progress` )}/${result.process_instance_id}/progress`,
); );
} else { } else {
navigateToInterstitial(result); navigateToInterstitial(result);
@ -215,7 +215,7 @@ export default function TaskShow() {
} }
autoSaveTaskData( autoSaveTaskData(
recursivelyChangeNullAndUndefined(dataToSubmit, null), recursivelyChangeNullAndUndefined(dataToSubmit, null),
successCallback successCallback,
); );
}; };

View File

@ -18,7 +18,7 @@ export default function PublicForm() {
const [taskData, setTaskData] = useState<any>(null); const [taskData, setTaskData] = useState<any>(null);
const [formButtonsDisabled, setFormButtonsDisabled] = useState(false); const [formButtonsDisabled, setFormButtonsDisabled] = useState(false);
const [confirmationMessage, setConfirmationMessage] = useState<string | null>( const [confirmationMessage, setConfirmationMessage] = useState<string | null>(
null null,
); );
const [publicTask, setPublicTask] = useState<PublicTask | null>(null); const [publicTask, setPublicTask] = useState<PublicTask | null>(null);
const [currentPageError, setCurrentPageError] = const [currentPageError, setCurrentPageError] =
@ -41,7 +41,7 @@ export default function PublicForm() {
setCurrentPageError(error); setCurrentPageError(error);
} else { } else {
setCurrentPageError( setCurrentPageError(
errorForDisplayFromString('Error retrieving content.') errorForDisplayFromString('Error retrieving content.'),
); );
} }
console.error(error); console.error(error);

View File

@ -12,13 +12,13 @@ test('it can properly format a duration', () => {
expect(DateAndTimeService.formatDurationForDisplay('65')).toEqual('1m 5s'); expect(DateAndTimeService.formatDurationForDisplay('65')).toEqual('1m 5s');
expect(DateAndTimeService.formatDurationForDisplay(65)).toEqual('1m 5s'); expect(DateAndTimeService.formatDurationForDisplay(65)).toEqual('1m 5s');
expect(DateAndTimeService.formatDurationForDisplay(86500)).toEqual( expect(DateAndTimeService.formatDurationForDisplay(86500)).toEqual(
'1d 1m 40s' '1d 1m 40s',
); );
expect(DateAndTimeService.formatDurationForDisplay(2629746)).toEqual( expect(DateAndTimeService.formatDurationForDisplay(2629746)).toEqual(
'30d 10h 29m 6s' '30d 10h 29m 6s',
); );
expect(DateAndTimeService.formatDurationForDisplay(31536765)).toEqual( expect(DateAndTimeService.formatDurationForDisplay(31536765)).toEqual(
'365d 12m 45s' '365d 12m 45s',
); );
}); });
@ -28,75 +28,75 @@ test('it can get the correct date format from string', () => {
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
expectedDateString expectedDateString,
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'03-04-2024' '03-04-2024',
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'March 4, 2024' 'March 4, 2024',
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'mar-4-2024' 'mar-4-2024',
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'03/04/2024' '03/04/2024',
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'03.04.2024' '03.04.2024',
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'04-03-2024', '04-03-2024',
newDateFormat newDateFormat,
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'March 4, 2024', 'March 4, 2024',
newDateFormat newDateFormat,
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'4-mar-2024', '4-mar-2024',
newDateFormat newDateFormat,
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'4 March 2024', '4 March 2024',
newDateFormat newDateFormat,
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'04/03/2024', '04/03/2024',
newDateFormat newDateFormat,
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'04.03.2024', '04.03.2024',
newDateFormat newDateFormat,
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
expect( expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat( DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
expectedDateString, expectedDateString,
newDateFormat newDateFormat,
) ),
).toEqual(expectedDateString); ).toEqual(expectedDateString);
}); });

View File

@ -57,7 +57,7 @@ const dateStringToYMDFormat = (dateString: string) => {
const convertDateAndTimeStringsToDate = ( const convertDateAndTimeStringsToDate = (
dateString: string, dateString: string,
timeString: string timeString: string,
) => { ) => {
if (dateString && timeString) { if (dateString && timeString) {
return new Date(`${dateStringToYMDFormat(dateString)}T${timeString}`); return new Date(`${dateStringToYMDFormat(dateString)}T${timeString}`);
@ -67,7 +67,7 @@ const convertDateAndTimeStringsToDate = (
const convertDateAndTimeStringsToSeconds = ( const convertDateAndTimeStringsToSeconds = (
dateString: string, dateString: string,
timeString: string timeString: string,
) => { ) => {
const dateObject = convertDateAndTimeStringsToDate(dateString, timeString); const dateObject = convertDateAndTimeStringsToDate(dateString, timeString);
if (dateObject) { if (dateObject) {
@ -152,7 +152,7 @@ const secondsToDuration = (secNum: number) => {
const attemptToConvertUnknownDateStringFormatToKnownFormat = ( const attemptToConvertUnknownDateStringFormatToKnownFormat = (
dateString: string, dateString: string,
targetDateFormat?: string targetDateFormat?: string,
) => { ) => {
let dateFormat = targetDateFormat; let dateFormat = targetDateFormat;
if (!dateFormat) { if (!dateFormat) {
@ -170,14 +170,14 @@ const attemptToConvertUnknownDateStringFormatToKnownFormat = (
numericalDateFormat numericalDateFormat
.replace('dd', '\\d{2}') .replace('dd', '\\d{2}')
.replace('MM', '\\d{2}') .replace('MM', '\\d{2}')
.replace('yyyy', '\\d{4}') .replace('yyyy', '\\d{4}'),
); );
const normalizedDateString = dateString.replaceAll(/[.-/]+/g, '-'); const normalizedDateString = dateString.replaceAll(/[.-/]+/g, '-');
if (normalizedDateString.match(dateFormatRegex)) { if (normalizedDateString.match(dateFormatRegex)) {
const newDate = parse( const newDate = parse(
normalizedDateString, normalizedDateString,
numericalDateFormat, numericalDateFormat,
new Date() new Date(),
); );
newDateString = convertDateObjectToFormattedString(newDate) || ''; newDateString = convertDateObjectToFormattedString(newDate) || '';
} }
@ -223,7 +223,7 @@ const formatDateTime = (value: any) => {
const timeArgs = value.split('T'); const timeArgs = value.split('T');
dateInSeconds = convertDateAndTimeStringsToSeconds( dateInSeconds = convertDateAndTimeStringsToSeconds(
timeArgs[0], timeArgs[0],
timeArgs[1] timeArgs[1],
); );
} }
if (dateInSeconds) { if (dateInSeconds) {

View File

@ -4,7 +4,7 @@ test('it can convert date string to date for display', () => {
const markdown = const markdown =
'HEY SPIFF_FORMAT:::convert_date_to_date_for_display(2024-03-01)'; 'HEY SPIFF_FORMAT:::convert_date_to_date_for_display(2024-03-01)';
expect(FormattingService.checkForSpiffFormats(markdown)).toEqual( expect(FormattingService.checkForSpiffFormats(markdown)).toEqual(
'HEY 2024-03-01' 'HEY 2024-03-01',
); );
}); });
@ -12,6 +12,6 @@ test('it can convert seconds to duration time for display', () => {
const markdown = const markdown =
'HEY SPIFF_FORMAT:::convert_seconds_to_duration_for_display(10000)'; 'HEY SPIFF_FORMAT:::convert_seconds_to_duration_for_display(10000)';
expect(FormattingService.checkForSpiffFormats(markdown)).toEqual( expect(FormattingService.checkForSpiffFormats(markdown)).toEqual(
'HEY 2h 46m 40s' 'HEY 2h 46m 40s',
); );
}); });

View File

@ -12,13 +12,13 @@ const checkForSpiffFormats = (markdown: string) => {
const replacer = ( const replacer = (
match: string, match: string,
spiffFormat: string, spiffFormat: string,
originalValue: string originalValue: string,
) => { ) => {
if (spiffFormat in spiffFormatFunctions) { if (spiffFormat in spiffFormatFunctions) {
return spiffFormatFunctions[spiffFormat](originalValue); return spiffFormatFunctions[spiffFormat](originalValue);
} }
console.warn( console.warn(
`attempted: ${match}, but ${spiffFormat} is not a valid conversion function` `attempted: ${match}, but ${spiffFormat} is not a valid conversion function`,
); );
return match; return match;

View File

@ -2,12 +2,12 @@ import HttpService from './HttpService';
test('it can use given http status message in messageForHttpError', () => { test('it can use given http status message in messageForHttpError', () => {
expect(HttpService.messageForHttpError(400, 'Bad Request')).toEqual( expect(HttpService.messageForHttpError(400, 'Bad Request')).toEqual(
'HTTP Error 400: Bad Request' 'HTTP Error 400: Bad Request',
); );
}); });
test('it can figure out http status message if not given in messageForHttpError', () => { test('it can figure out http status message if not given in messageForHttpError', () => {
expect(HttpService.messageForHttpError(400, '')).toEqual( expect(HttpService.messageForHttpError(400, '')).toEqual(
'HTTP Error 400: Bad Request' 'HTTP Error 400: Bad Request',
); );
}); });

View File

@ -139,7 +139,7 @@ backendCallProps) => {
} catch (error) { } catch (error) {
const httpStatusMesage = messageForHttpError( const httpStatusMesage = messageForHttpError(
result.response.status, result.response.status,
result.response.statusText result.response.statusText,
); );
const baseMessage = `Received unexpected response from server. ${httpStatusMesage}.`; const baseMessage = `Received unexpected response from server. ${httpStatusMesage}.`;
console.error(`${baseMessage} Body: ${result.text}`); console.error(`${baseMessage} Body: ${result.text}`);

View File

@ -29,12 +29,12 @@ const getCurrentLocation = (queryParams: string = window.location.search) => {
queryParamString = `${queryParams}`; queryParamString = `${queryParams}`;
} }
return encodeURIComponent( return encodeURIComponent(
`${window.location.origin}${window.location.pathname}${queryParamString}` `${window.location.origin}${window.location.pathname}${queryParamString}`,
); );
}; };
const checkPathForTaskShowParams = ( const checkPathForTaskShowParams = (
redirectUrl: string = window.location.pathname redirectUrl: string = window.location.pathname,
) => { ) => {
const pathSegments = parseTaskShowUrl(redirectUrl); const pathSegments = parseTaskShowUrl(redirectUrl);
if (pathSegments) { if (pathSegments) {
@ -69,19 +69,19 @@ const isPublicUser = () => {
const doLogin = ( const doLogin = (
authenticationOption?: AuthenticationOption, authenticationOption?: AuthenticationOption,
redirectUrl?: string | null redirectUrl?: string | null,
) => { ) => {
const taskShowParams = checkPathForTaskShowParams(redirectUrl || undefined); const taskShowParams = checkPathForTaskShowParams(redirectUrl || undefined);
const loginParams = [`redirect_url=${redirectUrl || getCurrentLocation()}`]; const loginParams = [`redirect_url=${redirectUrl || getCurrentLocation()}`];
if (taskShowParams) { if (taskShowParams) {
loginParams.push( loginParams.push(
`process_instance_id=${taskShowParams.process_instance_id}` `process_instance_id=${taskShowParams.process_instance_id}`,
); );
loginParams.push(`task_guid=${taskShowParams.task_guid}`); loginParams.push(`task_guid=${taskShowParams.task_guid}`);
} }
if (authenticationOption) { if (authenticationOption) {
loginParams.push( loginParams.push(
`authentication_identifier=${authenticationOption.identifier}` `authentication_identifier=${authenticationOption.identifier}`,
); );
} }
const url = `${BACKEND_BASE_URL}/login?${loginParams.join('&')}`; const url = `${BACKEND_BASE_URL}/login?${loginParams.join('&')}`;