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'],
};
const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData
permissionRequestData,
);
const { removeError } = useAPIError();
@ -58,12 +58,12 @@ export default function ContainerForExtensions() {
const eni: UiSchemaUxElement[] = processModels
.map((processModel: ProcessModel) => {
const extensionUiSchemaFile = processModel.files.find(
(file: ProcessFile) => file.name === 'extension_uischema.json'
(file: ProcessFile) => file.name === 'extension_uischema.json',
);
if (extensionUiSchemaFile && extensionUiSchemaFile.file_contents) {
try {
const extensionUiSchema: ExtensionUiSchema = JSON.parse(
extensionUiSchemaFile.file_contents
extensionUiSchemaFile.file_contents,
);
if (
extensionUiSchema &&
@ -74,7 +74,7 @@ export default function ContainerForExtensions() {
}
} catch (jsonParseError: any) {
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,
DateAndTimeService.REFRESH_TIMEOUT_SECONDS,
updateActiveUsers,
unregisterUser
unregisterUser,
);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []); // 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 [schemaInvalid, setSchemaInvalid] = useState<boolean>(false);
const [dataStoreTypes, setDataStoreTypes] = useState<[DataStoreType] | []>(
[]
[],
);
const [selectedDataStoreType, setSelectedDataStoreType] =
useState<DataStoreType | null>(null);
@ -67,7 +67,7 @@ export default function DataStoreForm({
const location = dataStoreLocation();
if (location !== '/') {
navigate(
`/process-groups/${modifyProcessIdentifierForPathParam(location)}`
`/process-groups/${modifyProcessIdentifierForPathParam(location)}`,
);
} else {
navigate(`/process-groups`);
@ -173,12 +173,12 @@ export default function DataStoreForm({
};
const dataStoreTypeDisplayString = (
dataStoreType: DataStoreType | null
dataStoreType: DataStoreType | null,
): string => {
if (dataStoreType) {
return `${dataStoreType.name} (${truncateString(
dataStoreType.description,
75
75,
)})`;
}
return '';
@ -215,7 +215,7 @@ export default function DataStoreForm({
}
setIdHasBeenUpdatedByUser(true);
}}
/>
/>,
);
if (mode === 'edit') {
@ -226,7 +226,7 @@ export default function DataStoreForm({
readonly
labelText="Type*"
value={dataStoreTypeDisplayString(selectedDataStoreType)}
/>
/>,
);
} else {
textInputs.push(
@ -241,7 +241,7 @@ export default function DataStoreForm({
invalid={typeInvalid}
placeholder="Choose the data store type"
selectedItem={selectedDataStoreType}
/>
/>,
);
}
@ -254,7 +254,7 @@ export default function DataStoreForm({
labelText="Schema*"
value={dataStore.schema}
onChange={(event: any) => onSchemaChanged(event.target.value)}
/>
/>,
);
textInputs.push(
@ -266,7 +266,7 @@ export default function DataStoreForm({
onChange={(event: any) =>
updateDataStore({ description: event.target.value })
}
/>
/>,
);
return textInputs;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -123,21 +123,21 @@ export default function ProcessInstanceLogList({
];
const pickedSearchParams = selectKeysFromSearchParams(
searchParams,
searchParamsToInclude
searchParamsToInclude,
);
const { page, perPage } = getPageInfoFromSearchParams(
searchParams,
undefined,
undefined,
paginationQueryParamPrefix
paginationQueryParamPrefix,
);
const eventsQueryParam = isEventsView ? 'true' : 'false';
HttpService.makeCallToBackend({
path: `${targetUris.processInstanceLogListPath}?${createSearchParams(
pickedSearchParams
pickedSearchParams,
)}&page=${page}&per_page=${perPage}&events=${eventsQueryParam}`,
successCallback: setProcessInstanceLogListFromResult,
});
@ -178,7 +178,7 @@ export default function ProcessInstanceLogList({
if (eventErrorDetails) {
const errorForDisplay = errorForDisplayFromProcessInstanceErrorDetail(
eventForModal,
eventErrorDetails
eventErrorDetails,
);
const errorChildren = childrenForErrorObject(errorForDisplay);
// eslint-disable-next-line react/jsx-no-useless-fragment
@ -200,7 +200,7 @@ export default function ProcessInstanceLogList({
};
const handleErrorDetailsReponse = (
results: ProcessInstanceEventErrorDetail
results: ProcessInstanceEventErrorDetail,
) => {
setEventErrorDetails(results);
};
@ -280,14 +280,14 @@ export default function ProcessInstanceLogList({
<td data-qa="paginated-entity-id">{logEntry.id}</td>
{bpmnProcessCell}
{taskNameCell}
</>
</>,
);
} else {
tableRow.push(
<>
{taskNameCell}
{bpmnProcessCell}
</>
</>,
);
}
if (isEventsView) {
@ -301,14 +301,14 @@ export default function ProcessInstanceLogList({
<span className="system-user-log-entry">system</span>
)}
</td>
</>
</>,
);
}
let timestampComponent = (
<td>
{DateAndTimeService.convertSecondsToFormattedDateTime(
logEntry.timestamp
logEntry.timestamp,
)}
</td>
);
@ -322,7 +322,7 @@ export default function ProcessInstanceLogList({
title="View state when task was completed"
>
{DateAndTimeService.convertSecondsToFormattedDateTime(
logEntry.timestamp
logEntry.timestamp,
)}
</Link>
</td>
@ -337,7 +337,7 @@ export default function ProcessInstanceLogList({
const rows = processInstanceLogs.map(
(logEntry: ProcessInstanceLogEntry) => {
return getTableRow(logEntry);
}
},
);
const tableHeaders = [];
@ -347,14 +347,14 @@ export default function ProcessInstanceLogList({
<th>Id</th>
<th>Bpmn process</th>
<th>{taskNameHeader}</th>
</>
</>,
);
} else {
tableHeaders.push(
<>
<th>{taskNameHeader}</th>
<th>Bpmn process</th>
</>
</>,
);
}
if (isEventsView) {
@ -364,7 +364,7 @@ export default function ProcessInstanceLogList({
<th>Task type</th>
<th>Event type</th>
<th>User</th>
</>
</>,
);
}
tableHeaders.push(<th>Timestamp</th>);
@ -380,7 +380,7 @@ export default function ProcessInstanceLogList({
const resetFilters = () => {
['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}
selectedItem={searchParams.get('bpmn_name')}
/>
</Column>
</Column>,
);
if (isEventsView) {
@ -486,7 +486,7 @@ export default function ProcessInstanceLogList({
selectedItem={searchParams.get('event_type')}
/>
</Column>
</>
</>,
);
}
@ -525,7 +525,7 @@ export default function ProcessInstanceLogList({
searchParams,
undefined,
undefined,
paginationQueryParamPrefix
paginationQueryParamPrefix,
);
if (clearAll) {
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)
);
},
[]
[],
);
// Useful to stop refreshing if an api call gets an error
@ -91,7 +91,7 @@ export default function ProcessInstanceProgress({
// 15,
1,
DateAndTimeService.REFRESH_TIMEOUT_SECONDS,
checkProgress
checkProgress,
);
return clearRefreshRef.current;
}, [
@ -121,7 +121,7 @@ export default function ProcessInstanceProgress({
};
const userMessage = (
taskInstructionForEndUser: TaskInstructionForEndUser
taskInstructionForEndUser: TaskInstructionForEndUser,
) => {
return (
<InstructionsForEndUser

View File

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

View File

@ -14,12 +14,12 @@ import { usePermissionFetcher } from '../hooks/PermissionService';
import useAPIError from '../hooks/UseApiError';
const storeRecentProcessModelInLocalStorage = (
processModelForStorage: ProcessModel
processModelForStorage: ProcessModel,
) => {
// All values stored in localStorage are strings.
// Grab our recentProcessModels string from localStorage.
const stringFromLocalStorage = window.localStorage.getItem(
'recentProcessModels'
'recentProcessModels',
);
// 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...
const matchingItem = array.find(
(item) => item.processModelIdentifier === value.processModelIdentifier
(item) => item.processModelIdentifier === value.processModelIdentifier,
);
if (matchingItem === undefined) {
// add the value to the beginning of the array
@ -80,7 +80,7 @@ export default function ProcessInstanceRun({
const [disableStartButton, setDisableStartButton] = useState<boolean>(false);
const modifiedProcessModelId = modifyProcessIdentifierForPathParam(
processModel.id
processModel.id,
);
const processInstanceCreatePath = `/v1.0/process-instances/${modifiedProcessModelId}`;
@ -98,11 +98,11 @@ export default function ProcessInstanceRun({
const processInstanceId = processInstance.id;
if (processInstance.process_model_uses_queued_execution) {
navigate(
`/process-instances/for-me/${modifiedProcessModelId}/${processInstanceId}/progress`
`/process-instances/for-me/${modifiedProcessModelId}/${processInstanceId}/progress`,
);
} else {
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() {
setState('CLOSED');
},
}
},
);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []); // it is critical to only run this once.
@ -83,7 +83,7 @@ export default function ProcessInterstitial({
HUMAN_TASK_TYPES.includes(myTask.type)
);
},
[allowRedirect, processInstance]
[allowRedirect, processInstance],
);
const shouldRedirectToProcessInstance = useCallback((): boolean => {
@ -136,7 +136,7 @@ export default function ProcessInterstitial({
const inlineMessage = (
title: string,
subtitle: string,
kind: string = 'info'
kind: string = 'info',
) => {
return (
<div>
@ -152,13 +152,13 @@ export default function ProcessInterstitial({
const userMessageForProcessInstance = (
pi: ProcessInstance,
myTask: ProcessInstanceTask | null = null
myTask: ProcessInstanceTask | null = null,
) => {
if (['terminated', 'suspended'].includes(pi.status)) {
return inlineMessage(
`Process ${pi.status}`,
`This process instance was ${pi.status} by an administrator. Please get in touch with them for more information.`,
'warning'
'warning',
);
}
if (pi.status === 'error') {
@ -198,13 +198,13 @@ export default function ProcessInterstitial({
potentialOwnerArray = potentialOwnerArray.slice(0, 2).concat(['...']);
}
message = `This next task is assigned to user(s): ${potentialOwnerArray.join(
', '
', ',
)}.`;
}
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)) {
@ -217,7 +217,7 @@ export default function ProcessInterstitial({
) {
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) {

View File

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

View File

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

View File

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

View File

@ -41,7 +41,7 @@ export default function ProcessSearch({
if (process) {
return `${process.display_name} (${truncateString(
process.identifier,
75
75,
)})`;
}
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 */
@ -179,11 +179,11 @@ export default function ReactDiagramEditor({
const refs = event.references.filter(
(r: any) =>
r.property === 'bpmn:loopDataInputRef' ||
r.property === 'bpmn:loopDataOutputRef'
r.property === 'bpmn:loopDataOutputRef',
);
// eslint-disable-next-line no-underscore-dangle
const desc = diagramModelerToUse._moddle.registry.getEffectiveDescriptor(
'bpmn:ItemAwareElement'
'bpmn:ItemAwareElement',
);
refs.forEach((ref: any) => {
const props = {
@ -287,7 +287,7 @@ export default function ReactDiagramEditor({
element: any,
script: string,
scriptType: string,
eventBus: any
eventBus: any,
) {
if (onLaunchScriptEditor) {
setPerformingXmlUpdates(true);
@ -299,7 +299,7 @@ export default function ReactDiagramEditor({
function handleLaunchMarkdownEditor(
element: any,
value: string,
eventBus: any
eventBus: any,
) {
if (onLaunchMarkdownEditor) {
setPerformingXmlUpdates(true);
@ -311,7 +311,7 @@ export default function ReactDiagramEditor({
if (onElementClick) {
const canvas = diagramModeler.get('canvas');
const bpmnProcessIdentifiers = getBpmnProcessIdentifiers(
canvas.getRootElement()
canvas.getRootElement(),
);
onElementClick(event.element, bpmnProcessIdentifiers);
}
@ -459,13 +459,13 @@ export default function ReactDiagramEditor({
canvas: any,
task: Task,
bpmnIoClassName: string,
bpmnProcessIdentifiers: string[]
bpmnProcessIdentifiers: string[],
) {
if (checkTaskCanBeHighlighted(task.bpmn_identifier)) {
try {
if (
bpmnProcessIdentifiers.includes(
task.bpmn_process_definition_identifier
task.bpmn_process_definition_identifier,
)
) {
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
if (tasks) {
const bpmnProcessIdentifiers = getBpmnProcessIdentifiers(
canvas.getRootElement()
canvas.getRootElement(),
);
tasks.forEach((task: Task) => {
let className = '';
@ -522,7 +522,7 @@ export default function ReactDiagramEditor({
canvas,
task,
className,
bpmnProcessIdentifiers
bpmnProcessIdentifiers,
);
}
});
@ -531,7 +531,7 @@ export default function ReactDiagramEditor({
function displayDiagram(
diagramModelerToUse: any,
diagramXMLToDisplay: any
diagramXMLToDisplay: any,
) {
if (alreadyImportedXmlRef.current) {
return;
@ -558,7 +558,7 @@ export default function ReactDiagramEditor({
function fetchDiagramFromURL(
urlToUse: any,
textHandler?: (text: str) => void
textHandler?: (text: str) => void,
) {
fetch(urlToUse)
.then((response) => response.text())
@ -683,7 +683,7 @@ export default function ReactDiagramEditor({
<Link
size="lg"
href={`/process-models/${modifyProcessIdentifierForPathParam(
ref.relative_location
ref.relative_location,
)}`}
>
{`${ref.display_name}`}
@ -762,7 +762,7 @@ export default function ReactDiagramEditor({
<Button
onClick={() => {
navigate(
`/process-models/${processModelId}/form/${fileName}`
`/process-models/${processModelId}/form/${fileName}`,
);
}}
>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,13 +8,13 @@ import {
test('it can slugify a string', () => {
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', () => {
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 = (
object: any,
value: string,
onAttribute?: string
onAttribute?: string,
) => {
return Object.keys(object).find((key) => {
if (onAttribute) {
@ -104,7 +104,7 @@ export const getPageInfoFromSearchParams = (
searchParams: any,
defaultPerPage: string | number = DEFAULT_PER_PAGE,
defaultPage: string | number = DEFAULT_PAGE,
paginationQueryParamPrefix: string | null = null
paginationQueryParamPrefix: string | null = null,
) => {
const paginationQueryParamPrefixToUse = paginationQueryParamPrefix
? `${paginationQueryParamPrefix}_`
@ -112,12 +112,12 @@ export const getPageInfoFromSearchParams = (
const page = parseInt(
searchParams.get(`${paginationQueryParamPrefixToUse}page`) ||
defaultPage.toString(),
10
10,
);
const perPage = parseInt(
searchParams.get(`${paginationQueryParamPrefixToUse}per_page`) ||
defaultPerPage.toString(),
10
10,
);
return { page, perPage };
@ -135,12 +135,12 @@ export const makeid = (length: number) => {
};
export const getProcessModelFullIdentifierFromSearchParams = (
searchParams: any
searchParams: any,
) => {
let processModelFullIdentifier = null;
if (searchParams.get('process_model_identifier')) {
processModelFullIdentifier = `${searchParams.get(
'process_model_identifier'
'process_model_identifier',
)}`;
}
return processModelFullIdentifier;
@ -182,7 +182,7 @@ export const refreshAtInterval = (
interval: number,
timeout: number,
periodicFunction: Function,
cleanupFunction?: Function
cleanupFunction?: Function,
) => {
const intervalRef = setInterval(() => periodicFunction(), interval * 1000);
const timeoutRef = setTimeout(() => {
@ -262,7 +262,7 @@ export const decodeBase64 = (data: string) => {
export const getLastMilestoneFromProcessInstance = (
processInstance: ProcessInstance,
value: any
value: any,
) => {
let valueToUse = value;
if (!valueToUse) {
@ -281,7 +281,7 @@ export const getLastMilestoneFromProcessInstance = (
if (truncatedValue.length > milestoneLengthLimit) {
truncatedValue = `${truncatedValue.substring(
0,
milestoneLengthLimit - 3
milestoneLengthLimit - 3,
)}...`;
}
return [valueToUse, truncatedValue];
@ -293,7 +293,7 @@ export const parseTaskShowUrl = (url: string) => {
// expected url pattern:
// /tasks/[process_instance_id]/[task_guid]
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 versionInfoFromHtmlMetaTag = document.querySelector(
'meta[name="version-info"]'
'meta[name="version-info"]',
);
let versionInfo: ObjectWithStringKeysAndValues = {};
if (versionInfoFromHtmlMetaTag) {

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@ export default function useProcessGroupFetcher(processGroupIdentifier: string) {
const getProcessGroupCache = useCallback(() => {
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(
'storedProcessGroups',
JSON.stringify(storedProcessGroups)
JSON.stringify(storedProcessGroups),
);
};
@ -77,7 +77,7 @@ export default function useProcessGroupFetcher(processGroupIdentifier: string) {
};
localStorage.setItem(
LOCAL_STORAGE_PROCESS_GROUP_CACHE_KEY,
JSON.stringify(storedProcessGroups)
JSON.stringify(storedProcessGroups),
);
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -44,7 +44,7 @@ function RadioWidget({
label,
schema,
uiSchema,
rawErrors
rawErrors,
);
// 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<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>({
schema,
id,
@ -49,7 +49,7 @@ function SelectWidget<
label,
schema,
uiSchema,
rawErrors
rawErrors,
);
// 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<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>({
id,
options = {},
@ -38,19 +38,19 @@ function TextareaWidget<
const handleChange = useCallback(
({ target: { value } }: React.ChangeEvent<HTMLTextAreaElement>) =>
onChange(value === '' ? options.emptyValue : value),
[onChange, options.emptyValue]
[onChange, options.emptyValue],
);
const handleBlur = useCallback(
({ target: { value } }: FocusEvent<HTMLTextAreaElement>) =>
onBlur(id, value),
[onBlur, id]
[onBlur, id],
);
const handleFocus = useCallback(
({ target: { value } }: FocusEvent<HTMLTextAreaElement>) =>
onFocus(id, value),
[id, onFocus]
[id, onFocus],
);
// this helps with performance for the select widget with rsjf 5.1+.
@ -61,14 +61,14 @@ function TextareaWidget<
handleChange(fullObject);
},
// delay in ms
100
100,
);
const commonAttributes = getCommonAttributes(
label,
schema,
uiSchema,
rawErrors
rawErrors,
);
let enableCounter = false;
@ -79,7 +79,7 @@ function TextareaWidget<
maxCount = schema.maxLength;
} else {
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<
T = any,
S extends StrictRJSFSchema = RJSFSchema,
F extends FormContextType = any
F extends FormContextType = any,
>(props: TitleFieldProps<T, S, F>) {
const { id, title, required } = props;
return (

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,7 +14,7 @@ export default function AuthenticationList() {
AuthenticationItem[] | null
>(null);
const [connectProxyBaseUrl, setConnectProxyBaseUrl] = useState<string | null>(
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}**`,
};
const identifierForTable = `completed-by-group-${slugifyString(
userGroup
userGroup,
)}`;
return (
<ProcessInstanceListTable

View File

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

View File

@ -92,14 +92,14 @@ export default function Extension({
return optionString;
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
[],
);
const processLoadResult = useCallback(
(result: ExtensionApiResponse, pageDefinition: UiSchemaPageDefinition) => {
if (pageDefinition.navigate_to_on_load) {
const optionString = interpolateNavigationString(
pageDefinition.navigate_to_on_load,
result.task_data
result.task_data,
);
if (optionString !== null) {
window.location.href = optionString;
@ -107,7 +107,7 @@ export default function Extension({
}
if (result.rendered_results_markdown) {
const newMarkdown = FormattingService.checkForSpiffFormats(
result.rendered_results_markdown
result.rendered_results_markdown,
);
setMarkdownToRenderOnLoad(newMarkdown);
}
@ -120,7 +120,7 @@ export default function Extension({
setuiSchemaPageComponents(
result.task_data[
pageDefinition.on_load.ui_schema_page_components_variable
]
],
);
// 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);
setReadyForComponentsToDisplay(true);
},
[interpolateNavigationString]
[interpolateNavigationString],
);
const setConfigsIfDesiredSchemaFile = useCallback(
@ -147,7 +147,7 @@ export default function Extension({
(extensionUiSchemaFile as ProcessFile).file_contents
) {
const extensionUiSchema: ExtensionUiSchema = JSON.parse(
(extensionUiSchemaFile as any).file_contents
(extensionUiSchemaFile as any).file_contents,
);
let pageIdentifierToUse = pageIdentifier;
@ -175,7 +175,7 @@ export default function Extension({
postBody.extension_input[searchParam] =
searchParams.get(searchParam);
}
}
},
);
}
postBody.ui_schema_action = pageDefinition.on_load;
@ -199,7 +199,7 @@ export default function Extension({
filesByName,
processLoadResult,
pageIdentifier,
]
],
);
useEffect(() => {
@ -223,7 +223,7 @@ export default function Extension({
const processSubmitResult = (
pageComponent: UiSchemaPageComponent,
result: ExtensionApiResponse
result: ExtensionApiResponse,
) => {
let taskData = result.task_data;
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) {
const optionString = interpolateNavigationString(
pageComponent.navigate_to_on_form_submit,
taskData
taskData,
);
if (optionString !== null) {
window.location.href = optionString;
@ -241,7 +241,7 @@ export default function Extension({
setProcessedTaskData(taskData);
if (result.rendered_results_markdown) {
const newMarkdown = FormattingService.checkForSpiffFormats(
result.rendered_results_markdown
result.rendered_results_markdown,
);
setMarkdownToRenderOnSubmit(newMarkdown);
}
@ -252,7 +252,7 @@ export default function Extension({
const handleFormSubmit = (
pageComponent: UiSchemaPageComponent,
formObject: any,
event: any
event: any,
// eslint-disable-next-line sonarjs/cognitive-complexity
) => {
event.preventDefault();
@ -273,7 +273,7 @@ export default function Extension({
if (pageComponent.navigate_to_on_form_submit) {
optionString = interpolateNavigationString(
pageComponent.navigate_to_on_form_submit,
dataToSubmit
dataToSubmit,
);
if (optionString !== null) {
window.location.href = optionString;
@ -327,7 +327,7 @@ export default function Extension({
const pmFileForArg = processModel.files.find(
(pmFile: ProcessFile) => {
return pmFile.name === fileName;
}
},
);
if (pmFileForArg) {
let newArgValue = pmFileForArg.file_contents;
@ -370,7 +370,7 @@ export default function Extension({
linkTarget={mdEditorLinkTarget}
source={markdownContentsToRender.join('\n')}
wrapperClassName="with-bottom-margin"
/>
/>,
);
}
@ -382,12 +382,12 @@ export default function Extension({
componentsToDisplay.push(
createElement(
supportedComponents[componentName],
argumentsForComponent
)
argumentsForComponent,
),
);
} else {
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"
source={markdownToRenderOnSubmit}
wrapperClassName="with-top-margin"
/>
/>,
);
} else {
componentsToDisplay.push(
@ -419,7 +419,7 @@ export default function Extension({
minimap: { enabled: true },
}}
/>
</>
</>,
);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,7 +18,7 @@ export default function PublicForm() {
const [taskData, setTaskData] = useState<any>(null);
const [formButtonsDisabled, setFormButtonsDisabled] = useState(false);
const [confirmationMessage, setConfirmationMessage] = useState<string | null>(
null
null,
);
const [publicTask, setPublicTask] = useState<PublicTask | null>(null);
const [currentPageError, setCurrentPageError] =
@ -41,7 +41,7 @@ export default function PublicForm() {
setCurrentPageError(error);
} else {
setCurrentPageError(
errorForDisplayFromString('Error retrieving content.')
errorForDisplayFromString('Error retrieving content.'),
);
}
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(86500)).toEqual(
'1d 1m 40s'
'1d 1m 40s',
);
expect(DateAndTimeService.formatDurationForDisplay(2629746)).toEqual(
'30d 10h 29m 6s'
'30d 10h 29m 6s',
);
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(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
expectedDateString
)
expectedDateString,
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'03-04-2024'
)
'03-04-2024',
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'March 4, 2024'
)
'March 4, 2024',
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'mar-4-2024'
)
'mar-4-2024',
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'03/04/2024'
)
'03/04/2024',
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'03.04.2024'
)
'03.04.2024',
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'04-03-2024',
newDateFormat
)
newDateFormat,
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'March 4, 2024',
newDateFormat
)
newDateFormat,
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'4-mar-2024',
newDateFormat
)
newDateFormat,
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'4 March 2024',
newDateFormat
)
newDateFormat,
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'04/03/2024',
newDateFormat
)
newDateFormat,
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
'04.03.2024',
newDateFormat
)
newDateFormat,
),
).toEqual(expectedDateString);
expect(
DateAndTimeService.attemptToConvertUnknownDateStringFormatToKnownFormat(
expectedDateString,
newDateFormat
)
newDateFormat,
),
).toEqual(expectedDateString);
});

View File

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

View File

@ -4,7 +4,7 @@ test('it can convert date string to date for display', () => {
const markdown =
'HEY SPIFF_FORMAT:::convert_date_to_date_for_display(2024-03-01)';
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 =
'HEY SPIFF_FORMAT:::convert_seconds_to_duration_for_display(10000)';
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 = (
match: string,
spiffFormat: string,
originalValue: string
originalValue: string,
) => {
if (spiffFormat in spiffFormatFunctions) {
return spiffFormatFunctions[spiffFormat](originalValue);
}
console.warn(
`attempted: ${match}, but ${spiffFormat} is not a valid conversion function`
`attempted: ${match}, but ${spiffFormat} is not a valid conversion function`,
);
return match;

View File

@ -2,12 +2,12 @@ import HttpService from './HttpService';
test('it can use given http status message in messageForHttpError', () => {
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', () => {
expect(HttpService.messageForHttpError(400, '')).toEqual(
'HTTP Error 400: Bad Request'
'HTTP Error 400: Bad Request',
);
});

View File

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

View File

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