mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-02-12 17:36:42 +00:00
Bump eslint-plugin-sonarjs from 1.0.3 to 2.0.3 in /spiffworkflow-frontend (#2092)
* Bump eslint-plugin-sonarjs in /spiffworkflow-frontend Bumps [eslint-plugin-sonarjs](https://github.com/SonarSource/SonarJS) from 1.0.3 to 2.0.3. - [Release notes](https://github.com/SonarSource/SonarJS/releases) - [Commits](https://github.com/SonarSource/SonarJS/commits) --- updated-dependencies: - dependency-name: eslint-plugin-sonarjs dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * resolved sonarjs lint issues mostly by ignoring them --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
parent
785262e7ff
commit
8a9c7c399b
@ -49,7 +49,16 @@ module.exports = {
|
||||
'react/require-default-props': 'off',
|
||||
'import/prefer-default-export': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
'sonarjs/fixme-tag': 'off',
|
||||
'sonarjs/jsx-key': 'off',
|
||||
'sonarjs/no-commented-code': 'off',
|
||||
'sonarjs/no-duplicate-string': ['error', { threshold: 7 }],
|
||||
'sonarjs/no-ignored-exceptions': 'off',
|
||||
'sonarjs/no-nested-conditional': 'off',
|
||||
'sonarjs/no-nested-functions': 'off',
|
||||
'sonarjs/pseudo-random': 'off',
|
||||
'sonarjs/slow-regex': 'off',
|
||||
'sonarjs/todo-tag': 'off',
|
||||
'unused-imports/no-unused-imports': 'error',
|
||||
'unused-imports/no-unused-vars': [
|
||||
'warn',
|
||||
|
4238
spiffworkflow-frontend/package-lock.json
generated
4238
spiffworkflow-frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -133,7 +133,7 @@
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"eslint-plugin-react": "^7.31.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"eslint-plugin-sonarjs": "^1.0.3",
|
||||
"eslint-plugin-sonarjs": "^2.0.3",
|
||||
"eslint-plugin-unused-imports": "^3.2.0",
|
||||
"inherits-browser": "^0.1.0",
|
||||
"jsdom": "^24.1.1",
|
||||
|
@ -129,7 +129,7 @@ export default function ContainerForExtensions() {
|
||||
};
|
||||
|
||||
const backendIsDownPage = () => {
|
||||
return [<BackendIsDown />];
|
||||
return [<BackendIsDown key="backendIsDownPage" />];
|
||||
};
|
||||
|
||||
const innerComponents = () => {
|
||||
|
@ -43,7 +43,7 @@ export default function Dashboards() {
|
||||
const [searchText, setSearchText] = useState('');
|
||||
const [panelData, setPanelData] = useState<Record<string, any>>({});
|
||||
const [dashboardAccordionOpen, setDashboardAccordionOpen] = useState(true);
|
||||
const [infoPanelOpen, setInfoPanelIsOpen] = useState(false);
|
||||
const [infoPanelIsOpen, setInfoPanelIsOpen] = useState(false);
|
||||
const [isTaskData, setIsTaskData] = useState(false);
|
||||
const { processInstanceCollection } = useProcessInstanceCollection();
|
||||
const { processInstanceTimesReport, setProcessInstances } =
|
||||
@ -72,7 +72,7 @@ export default function Dashboards() {
|
||||
setPanelData(data);
|
||||
setInfoPanelIsOpen(true);
|
||||
} else {
|
||||
setInfoPanelIsOpen(!infoPanelOpen);
|
||||
setInfoPanelIsOpen(!infoPanelIsOpen);
|
||||
}
|
||||
};
|
||||
|
||||
@ -82,7 +82,7 @@ export default function Dashboards() {
|
||||
setPanelData(data);
|
||||
setInfoPanelIsOpen(true);
|
||||
} else {
|
||||
setInfoPanelIsOpen(!infoPanelOpen);
|
||||
setInfoPanelIsOpen(!infoPanelIsOpen);
|
||||
}
|
||||
};
|
||||
|
||||
@ -244,7 +244,7 @@ export default function Dashboards() {
|
||||
</Grid>
|
||||
{/** Absolutely positioned info window */}
|
||||
{Object.keys(panelData).length ? (
|
||||
<Slide in={infoPanelOpen} direction="left" mountOnEnter unmountOnExit>
|
||||
<Slide in={infoPanelIsOpen} direction="left" mountOnEnter unmountOnExit>
|
||||
<Stack
|
||||
sx={{
|
||||
display: { xs: 'none', sm: 'block' },
|
||||
|
@ -62,15 +62,12 @@ export default function CustomForm({
|
||||
hideSubmitButton = false,
|
||||
bpmnEvent,
|
||||
}: OwnProps) {
|
||||
let reactJsonSchemaFormTheme = reactJsonSchemaForm;
|
||||
const reactJsonSchemaFormTheme = reactJsonSchemaForm;
|
||||
if ('ui:theme' in uiSchema) {
|
||||
if (uiSchema['ui:theme'] === 'mui') {
|
||||
reactJsonSchemaFormTheme = 'mui';
|
||||
} else {
|
||||
if (uiSchema['ui:theme'] !== 'mui') {
|
||||
console.error(
|
||||
`Unsupported theme: ${uiSchema['ui:theme']}. Defaulting to mui`,
|
||||
);
|
||||
reactJsonSchemaFormTheme = 'mui';
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,6 +116,7 @@ export default function CustomForm({
|
||||
// field:[field_name_to_use]:[start or end]
|
||||
//
|
||||
// defaults to "start" in all cases
|
||||
// eslint-disable-next-line sonarjs/sonar-no-unused-vars
|
||||
const [_, fieldIdentifierToCompareWith, startOrEnd] = dateCheck.split(':');
|
||||
if (!(fieldIdentifierToCompareWith in formDataToCheck)) {
|
||||
errors[propertyKey].addError(
|
||||
|
@ -13,7 +13,7 @@ import HttpService from '../../services/HttpService';
|
||||
import DateAndTimeService from '../../services/DateAndTimeService';
|
||||
import InstructionsForEndUser from './InstructionsForEndUser';
|
||||
import {
|
||||
ErrorDisplayStateless,
|
||||
errorDisplayStateless,
|
||||
errorForDisplayFromProcessInstanceErrorDetail,
|
||||
} from '../../components/ErrorDisplay';
|
||||
|
||||
@ -135,7 +135,7 @@ export default function ProcessInstanceProgress({
|
||||
if (currentPageError) {
|
||||
return (
|
||||
<>
|
||||
{ErrorDisplayStateless(currentPageError)}
|
||||
{errorDisplayStateless(currentPageError)}
|
||||
<p>
|
||||
Go to <a href={processInstanceShowPageUrl}>Process Instance</a>
|
||||
</p>
|
||||
|
@ -48,6 +48,7 @@ type OwnProps = {
|
||||
setAdditionalNavElement: Function;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||
function SideNav({
|
||||
isCollapsed,
|
||||
onToggleCollapse,
|
||||
|
@ -65,9 +65,7 @@ export default function CustomForm({
|
||||
}: OwnProps) {
|
||||
let reactJsonSchemaFormTheme = reactJsonSchemaForm;
|
||||
if ('ui:theme' in uiSchema) {
|
||||
if (uiSchema['ui:theme'] === 'carbon') {
|
||||
reactJsonSchemaFormTheme = 'carbon';
|
||||
} else if (uiSchema['ui:theme'] === 'mui') {
|
||||
if (uiSchema['ui:theme'] === 'mui') {
|
||||
reactJsonSchemaFormTheme = 'mui';
|
||||
} else {
|
||||
console.error(
|
||||
@ -122,6 +120,7 @@ export default function CustomForm({
|
||||
// field:[field_name_to_use]:[start or end]
|
||||
//
|
||||
// defaults to "start" in all cases
|
||||
// eslint-disable-next-line sonarjs/sonar-no-unused-vars
|
||||
const [_, fieldIdentifierToCompareWith, startOrEnd] = dateCheck.split(':');
|
||||
if (!(fieldIdentifierToCompareWith in formDataToCheck)) {
|
||||
errors[propertyKey].addError(
|
||||
|
@ -151,7 +151,7 @@ export const childrenForErrorObject = (errorObject: ErrorForDisplay) => {
|
||||
];
|
||||
};
|
||||
|
||||
export function ErrorDisplayStateless(
|
||||
export function errorDisplayStateless(
|
||||
errorObject: ErrorForDisplay,
|
||||
onClose?: Function,
|
||||
) {
|
||||
@ -176,7 +176,7 @@ export default function ErrorDisplay() {
|
||||
let errorTag = null;
|
||||
|
||||
if (errorObject) {
|
||||
errorTag = ErrorDisplayStateless(errorObject, removeError);
|
||||
errorTag = errorDisplayStateless(errorObject, removeError);
|
||||
}
|
||||
return errorTag;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ type OwnProps = {
|
||||
extensionUxElements?: UiSchemaUxElement[] | null;
|
||||
};
|
||||
|
||||
export function ExtensionUxElementMap({
|
||||
export function extensionUxElementMap({
|
||||
displayLocation,
|
||||
elementCallback,
|
||||
extensionUxElements,
|
||||
@ -34,10 +34,10 @@ export function ExtensionUxElementMap({
|
||||
export default function ExtensionUxElementForDisplay(
|
||||
args: OwnProps,
|
||||
): ReactElement | null {
|
||||
const result = ExtensionUxElementMap(args);
|
||||
const result = extensionUxElementMap(args);
|
||||
if (result === null) {
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line react/jsx-no-useless-fragment
|
||||
// eslint-disable-next-line react/jsx-no-useless-fragment, sonarjs/jsx-no-useless-fragment
|
||||
return <>{result}</>;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ export default function Filters({
|
||||
setShowFilterOptions(!showFilterOptions);
|
||||
};
|
||||
|
||||
const [copiedReportLinktoClipboard, setCopiedReportLinkToClipboard] =
|
||||
const [copiedReportLinkToClipboard, setCopiedReportLinkToClipboard] =
|
||||
useState<boolean>(false);
|
||||
|
||||
const copyReportLink = () => {
|
||||
@ -59,7 +59,7 @@ export default function Filters({
|
||||
onClick={toggleShowFilterOptions}
|
||||
/>,
|
||||
);
|
||||
if (copiedReportLinktoClipboard) {
|
||||
if (copiedReportLinkToClipboard) {
|
||||
elements.push(
|
||||
<Notification
|
||||
onClose={() => setCopiedReportLinkToClipboard(false)}
|
||||
|
@ -90,7 +90,7 @@ export default function ProcessInstanceListTable({
|
||||
);
|
||||
const [
|
||||
reportMetadataFromProcessInstances,
|
||||
setreportMetadataFromProcessInstances,
|
||||
setReportMetadataFromProcessInstances,
|
||||
] = useState<ReportMetadata | null>(null);
|
||||
|
||||
// this is used from pages like the home page that have multiple tables
|
||||
@ -125,7 +125,7 @@ export default function ProcessInstanceListTable({
|
||||
const processInstancesFromApi = result.results;
|
||||
setProcessInstances(processInstancesFromApi);
|
||||
setPagination(result.pagination);
|
||||
setreportMetadataFromProcessInstances(result.report_metadata);
|
||||
setReportMetadataFromProcessInstances(result.report_metadata);
|
||||
setReportHash(result.report_hash);
|
||||
if (onProcessInstanceTableListUpdate) {
|
||||
onProcessInstanceTableListUpdate(result);
|
||||
|
@ -87,7 +87,7 @@ type OwnProps = {
|
||||
tableHtmlId?: string;
|
||||
};
|
||||
|
||||
interface dateParameters {
|
||||
interface DateParameters {
|
||||
[key: string]: ((..._args: any[]) => any)[];
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ export default function ProcessInstanceListTableWithFilters({
|
||||
useState<boolean>(false);
|
||||
const [withOldestOpenTask, setWithOldestOpenTask] =
|
||||
useState<boolean>(showActionsColumn);
|
||||
const [withRelationToMe, setwithRelationToMe] =
|
||||
const [withRelationToMe, setWithRelationToMe] =
|
||||
useState<boolean>(showActionsColumn);
|
||||
const [systemReport, setSystemReport] = useState<string | null>(null);
|
||||
const [selectedUserGroup, setSelectedUserGroup] = useState<string | null>(
|
||||
@ -216,7 +216,7 @@ export default function ProcessInstanceListTableWithFilters({
|
||||
|
||||
const lastRequestedInitatorSearchTerm = useRef<string>();
|
||||
|
||||
const dateParametersToAlwaysFilterBy: dateParameters = useMemo(() => {
|
||||
const dateParametersToAlwaysFilterBy: DateParameters = useMemo(() => {
|
||||
return {
|
||||
start_from: [setStartFromDate, setStartFromTime],
|
||||
start_to: [setStartToDate, setStartToTime],
|
||||
@ -253,7 +253,7 @@ export default function ProcessInstanceListTableWithFilters({
|
||||
setStartToTime('');
|
||||
setSystemReport(null);
|
||||
setWithOldestOpenTask(false);
|
||||
setwithRelationToMe(false);
|
||||
setWithRelationToMe(false);
|
||||
if (reportMetadata) {
|
||||
const reportMetadataCopy = { ...reportMetadata };
|
||||
reportMetadataCopy.filter_by = [];
|
||||
@ -318,7 +318,7 @@ export default function ProcessInstanceListTableWithFilters({
|
||||
} else if (reportFilter.field_name === 'with_oldest_open_task') {
|
||||
setWithOldestOpenTask(reportFilter.field_value);
|
||||
} else if (reportFilter.field_name === 'with_relation_to_me') {
|
||||
setwithRelationToMe(reportFilter.field_value);
|
||||
setWithRelationToMe(reportFilter.field_value);
|
||||
} else if (reportFilter.field_name === 'user_group_identifier') {
|
||||
setSelectedUserGroup(reportFilter.field_value);
|
||||
} else if (systemReportOptions.includes(reportFilter.field_name)) {
|
||||
@ -653,6 +653,8 @@ export default function ProcessInstanceListTableWithFilters({
|
||||
onChangeTimeFunction: any,
|
||||
timeInvalid: boolean,
|
||||
setTimeInvalid: any,
|
||||
// TODO: fix this to use an object instead and avoid max params issue
|
||||
// eslint-disable-next-line sonarjs/sonar-max-params
|
||||
) => {
|
||||
if (!reportMetadata) {
|
||||
return null;
|
||||
@ -1273,7 +1275,7 @@ export default function ProcessInstanceListTableWithFilters({
|
||||
'with_relation_to_me',
|
||||
value.target.checked,
|
||||
);
|
||||
setwithRelationToMe(value.target.checked);
|
||||
setWithRelationToMe(value.target.checked);
|
||||
}}
|
||||
/>
|
||||
</Column>
|
||||
|
@ -181,7 +181,7 @@ export default function ProcessInstanceLogList({
|
||||
eventErrorDetails,
|
||||
);
|
||||
const errorChildren = childrenForErrorObject(errorForDisplay);
|
||||
// eslint-disable-next-line react/jsx-no-useless-fragment
|
||||
// eslint-disable-next-line react/jsx-no-useless-fragment, sonarjs/jsx-no-useless-fragment
|
||||
errorMessageTag = <>{errorChildren}</>;
|
||||
}
|
||||
return (
|
||||
|
@ -13,7 +13,7 @@ import HttpService from '../services/HttpService';
|
||||
import DateAndTimeService from '../services/DateAndTimeService';
|
||||
import InstructionsForEndUser from './InstructionsForEndUser';
|
||||
import {
|
||||
ErrorDisplayStateless,
|
||||
errorDisplayStateless,
|
||||
errorForDisplayFromProcessInstanceErrorDetail,
|
||||
} from './ErrorDisplay';
|
||||
|
||||
@ -144,7 +144,7 @@ export default function ProcessInstanceProgress({
|
||||
if (currentPageError) {
|
||||
return (
|
||||
<>
|
||||
{ErrorDisplayStateless(currentPageError)}
|
||||
{errorDisplayStateless(currentPageError)}
|
||||
<p>
|
||||
Go to <a href={processInstanceShowPageUrl}>Process Instance</a>
|
||||
</p>
|
||||
|
@ -35,7 +35,6 @@ export default function ProcessModelForm({
|
||||
const [idHasBeenUpdatedByUser, setIdHasBeenUpdatedByUser] =
|
||||
useState<boolean>(false);
|
||||
const [displayNameInvalid, setDisplayNameInvalid] = useState<boolean>(false);
|
||||
useState<boolean>(false);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const navigateToProcessModel = (result: ProcessModel) => {
|
||||
|
@ -38,7 +38,7 @@ export function MessageEditor({
|
||||
const [displaySaveMessageMessage, setDisplaySaveMessageMessage] =
|
||||
useState<boolean>(false);
|
||||
const [currentMessageId, setCurrentMessageId] = useState<string | null>(null);
|
||||
const [isSynced, setSynced] = useState<boolean>(true);
|
||||
const [isSynced, setIsSynced] = useState<boolean>(true);
|
||||
|
||||
const updateCorrelationPropertiesOnProcessGroup = useCallback(
|
||||
(currentMessagesForId: MessageDefinition, formData: any) => {
|
||||
@ -80,7 +80,7 @@ export function MessageEditor({
|
||||
correlation_properties: updatedMessagesForId.correlation_properties,
|
||||
elementId,
|
||||
});
|
||||
setSynced(true);
|
||||
setIsSynced(true);
|
||||
},
|
||||
[elementId, messageEvent.eventBus],
|
||||
);
|
||||
@ -174,7 +174,7 @@ export function MessageEditor({
|
||||
messageId,
|
||||
correlationProperties,
|
||||
);
|
||||
setSynced(newIsSynced);
|
||||
setIsSynced(newIsSynced);
|
||||
setProcessGroup(result);
|
||||
setCurrentMessageId(messageId);
|
||||
setPageTitle([result.display_name]);
|
||||
|
@ -22,7 +22,7 @@ type OwnProps = {
|
||||
const paginationQueryParamPrefix = 'message-list';
|
||||
|
||||
export default function MessageInstanceList({ processInstanceId }: OwnProps) {
|
||||
const [messageIntances, setMessageInstances] = useState([]);
|
||||
const [messageInstances, setMessageInstances] = useState([]);
|
||||
const [pagination, setPagination] = useState(null);
|
||||
const [searchParams] = useSearchParams();
|
||||
|
||||
@ -88,7 +88,7 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
|
||||
};
|
||||
|
||||
const buildTable = () => {
|
||||
const rows = messageIntances.map((row: MessageInstance) => {
|
||||
const rows = messageInstances.map((row: MessageInstance) => {
|
||||
let errorIcon = null;
|
||||
let errorTitle = null;
|
||||
if (row.failure_cause) {
|
||||
|
@ -303,7 +303,7 @@ export const parseTaskShowUrl = (url: string) => {
|
||||
// https://stackoverflow.com/a/15855457/6090676
|
||||
export const isURL = (str: string) => {
|
||||
const urlRegex =
|
||||
// eslint-disable-next-line max-len
|
||||
// eslint-disable-next-line max-len, sonarjs/regex-complexity
|
||||
/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))?)(?::\d{2,5})?(?:[/?#]\S*)?$/i;
|
||||
return urlRegex.test(str);
|
||||
};
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
import { getCommonAttributes } from '../../helpers';
|
||||
import DateAndTimeService from '../../../services/DateAndTimeService';
|
||||
|
||||
interface widgetArgs {
|
||||
interface WidgetArgs {
|
||||
id: string;
|
||||
value: any;
|
||||
label: string;
|
||||
@ -38,7 +38,7 @@ export default function DateRangePickerWidget({
|
||||
autofocus,
|
||||
label,
|
||||
rawErrors = [],
|
||||
}: widgetArgs) {
|
||||
}: WidgetArgs) {
|
||||
const commonAttributes = getCommonAttributes(
|
||||
label,
|
||||
schema,
|
||||
@ -77,11 +77,11 @@ export default function DateRangePickerWidget({
|
||||
try {
|
||||
startDate = DateAndTimeService.convertStringToDate(startDateString);
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (RangeError) {}
|
||||
} catch (rangeError) {}
|
||||
try {
|
||||
endDate = DateAndTimeService.convertStringToDate(endDateString);
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (RangeError) {}
|
||||
} catch (rangeError) {}
|
||||
|
||||
dateValue = [startDate, endDate];
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
import MDEditor from '@uiw/react-md-editor';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
interface widgetArgs {
|
||||
interface WidgetArgs {
|
||||
id: string;
|
||||
value: any;
|
||||
schema?: any;
|
||||
@ -28,7 +28,7 @@ export default function MarkDownFieldWidget({
|
||||
autofocus,
|
||||
label,
|
||||
rawErrors = [],
|
||||
}: widgetArgs) {
|
||||
}: WidgetArgs) {
|
||||
let invalid = false;
|
||||
let errorMessageForField = null;
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { ComboBox } from '@carbon/react';
|
||||
import HttpService from '../../../services/HttpService';
|
||||
import { getCommonAttributes } from '../../helpers';
|
||||
|
||||
interface typeaheadArgs {
|
||||
interface TypeaheadArgs {
|
||||
id: string;
|
||||
onChange: any;
|
||||
options: any;
|
||||
@ -32,7 +32,7 @@ export default function TypeaheadWidget({
|
||||
label,
|
||||
rawErrors = [],
|
||||
reactJsonSchemaFormTheme,
|
||||
}: typeaheadArgs) {
|
||||
}: TypeaheadArgs) {
|
||||
const lastSearchTerm = useRef('');
|
||||
const [items, setItems] = useState<any[]>([]);
|
||||
const [selectedItem, setSelectedItem] = useState<any>(null);
|
||||
|
@ -15,7 +15,7 @@ import Page404 from './Page404';
|
||||
import AdminRedirect from './AdminRedirect';
|
||||
import RootRoute from './RootRoute';
|
||||
import LoginHandler from '../components/LoginHandler';
|
||||
import { ExtensionUxElementMap } from '../components/ExtensionUxElementForDisplay';
|
||||
import { extensionUxElementMap } from '../components/ExtensionUxElementForDisplay';
|
||||
import Extension from './Extension';
|
||||
|
||||
type OwnProps = {
|
||||
@ -34,7 +34,7 @@ export default function BaseRoutes({ extensionUxElements }: OwnProps) {
|
||||
};
|
||||
|
||||
if (extensionUxElements !== null) {
|
||||
const extensionRoutes = ExtensionUxElementMap({
|
||||
const extensionRoutes = extensionUxElementMap({
|
||||
displayLocation: 'routes',
|
||||
elementCallback,
|
||||
extensionUxElements,
|
||||
|
@ -56,7 +56,7 @@ export default function Extension({
|
||||
useState<UiSchemaPageDefinition | null>(null);
|
||||
const [readyForComponentsToDisplay, setReadyForComponentsToDisplay] =
|
||||
useState<boolean>(false);
|
||||
const [uiSchemaPageComponents, setuiSchemaPageComponents] = useState<
|
||||
const [uiSchemaPageComponents, setUiSchemaPageComponents] = useState<
|
||||
UiSchemaPageComponent[] | null
|
||||
>(null);
|
||||
|
||||
@ -117,7 +117,7 @@ export default function Extension({
|
||||
pageDefinition.on_load &&
|
||||
pageDefinition.on_load.ui_schema_page_components_variable
|
||||
) {
|
||||
setuiSchemaPageComponents(
|
||||
setUiSchemaPageComponents(
|
||||
result.task_data[
|
||||
pageDefinition.on_load.ui_schema_page_components_variable
|
||||
],
|
||||
@ -160,7 +160,7 @@ export default function Extension({
|
||||
) {
|
||||
const pageDefinition = extensionUiSchema.pages[pageIdentifierToUse];
|
||||
setUiSchemaPageDefinition(pageDefinition);
|
||||
setuiSchemaPageComponents(pageDefinition.components || null);
|
||||
setUiSchemaPageComponents(pageDefinition.components || null);
|
||||
setProcessModel(pm);
|
||||
pm.files.forEach((file: ProcessFile) => {
|
||||
filesByName[file.name] = file;
|
||||
|
@ -454,6 +454,7 @@ export default function ProcessModelEditDiagram() {
|
||||
|
||||
const onJsonSchemaFilesRequested = useCallback(
|
||||
(event: any) => {
|
||||
// eslint-disable-next-line sonarjs/slow-regex
|
||||
const re = /.*[-.]schema.json/;
|
||||
if (processModel?.files) {
|
||||
const jsonFiles = processModel.files.filter((f) => f.name.match(re));
|
||||
|
@ -405,7 +405,7 @@ export default function ProcessModelShow() {
|
||||
};
|
||||
|
||||
const [fileUploadEvent, setFileUploadEvent] = useState(null);
|
||||
const [duplicateFilename, setDuplicateFilename] = useState<String>('');
|
||||
const [duplicateFilename, setDuplicateFilename] = useState<string>('');
|
||||
const [showOverwriteConfirmationPrompt, setShowOverwriteConfirmationPrompt] =
|
||||
useState(false);
|
||||
|
||||
@ -455,7 +455,7 @@ export default function ProcessModelShow() {
|
||||
/>
|
||||
);
|
||||
};
|
||||
const displayOverwriteConfirmation = (filename: String) => {
|
||||
const displayOverwriteConfirmation = (filename: string) => {
|
||||
setDuplicateFilename(filename);
|
||||
setShowOverwriteConfirmationPrompt(true);
|
||||
};
|
||||
|
@ -191,6 +191,7 @@ export default function ReactFormEditor() {
|
||||
onRequestSubmit={handleFileNameSave}
|
||||
onRequestClose={handleFileNameCancel}
|
||||
>
|
||||
{/* eslint-disable-next-line sonarjs/label-has-associated-control */}
|
||||
<label>File Name:</label>
|
||||
<span>
|
||||
<input
|
||||
|
@ -24,7 +24,7 @@ export default function SpiffUIV2() {
|
||||
const location = useLocation();
|
||||
|
||||
const [displayLocation, setDisplayLocation] = useState(location);
|
||||
const [transitionStage, setTransistionStage] = useState('fadeIn');
|
||||
const [transitionStage, setTransitionStage] = useState('fadeIn');
|
||||
|
||||
const fadeIn = 'fadeIn';
|
||||
const fadeOutImmediate = 'fadeOutImmediate';
|
||||
@ -43,7 +43,7 @@ export default function SpiffUIV2() {
|
||||
/** Respond to transition events, this softens screen changes (UX) */
|
||||
useEffect(() => {
|
||||
if (location !== displayLocation) {
|
||||
setTransistionStage(fadeOutImmediate);
|
||||
setTransitionStage(fadeOutImmediate);
|
||||
}
|
||||
}, [location, displayLocation]);
|
||||
|
||||
@ -118,7 +118,7 @@ export default function SpiffUIV2() {
|
||||
}}
|
||||
onAnimationEnd={() => {
|
||||
if (transitionStage === fadeOutImmediate) {
|
||||
setTransistionStage(fadeIn);
|
||||
setTransitionStage(fadeIn);
|
||||
setDisplayLocation(location);
|
||||
}
|
||||
}}
|
||||
|
@ -42,7 +42,7 @@ export default function SpiffUIV3() {
|
||||
const location = useLocation();
|
||||
|
||||
const [displayLocation, setDisplayLocation] = useState(location);
|
||||
const [transitionStage, setTransistionStage] = useState('fadeIn');
|
||||
const [transitionStage, setTransitionStage] = useState('fadeIn');
|
||||
const [isLongFadeIn, setIsLongFadeIn] = useState(false);
|
||||
const [additionalNavElement, setAdditionalNavElement] =
|
||||
useState<ReactElement | null>(null);
|
||||
@ -102,11 +102,11 @@ export default function SpiffUIV3() {
|
||||
setIsLongFadeIn(
|
||||
isComingFromInterstitialOrProgress && location.pathname === '/newui',
|
||||
);
|
||||
setTransistionStage(fadeOutImmediate);
|
||||
setTransitionStage(fadeOutImmediate);
|
||||
}
|
||||
if (transitionStage === fadeOutImmediate) {
|
||||
setDisplayLocation(location);
|
||||
setTransistionStage(fadeIn);
|
||||
setTransitionStage(fadeIn);
|
||||
}
|
||||
}, [location, displayLocation, transitionStage]);
|
||||
|
||||
@ -185,7 +185,7 @@ export default function SpiffUIV3() {
|
||||
onAnimationEnd={(e) => {
|
||||
if (e.animationName === fadeOutImmediate) {
|
||||
setDisplayLocation(location);
|
||||
setTransistionStage(fadeIn);
|
||||
setTransitionStage(fadeIn);
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
@ -383,6 +383,7 @@ export default function TaskShow() {
|
||||
<>
|
||||
{taskWithTaskData.signal_buttons.map((signal) => (
|
||||
<Button
|
||||
key={`signal.signal-${signal.label}`}
|
||||
name="signal.signal"
|
||||
disabled={formButtonsDisabled}
|
||||
onClick={() => handleSignalSubmit(signal.event)}
|
||||
|
@ -8,7 +8,7 @@ import { ErrorForDisplay, PublicTask } from '../../interfaces';
|
||||
import MarkdownRenderer from '../../components/MarkdownRenderer';
|
||||
import InstructionsForEndUser from '../../components/InstructionsForEndUser';
|
||||
import {
|
||||
ErrorDisplayStateless,
|
||||
errorDisplayStateless,
|
||||
errorForDisplayFromString,
|
||||
} from '../../components/ErrorDisplay';
|
||||
import Page404 from '../Page404';
|
||||
@ -109,7 +109,7 @@ export default function PublicForm() {
|
||||
}
|
||||
return (
|
||||
<>
|
||||
{ErrorDisplayStateless(currentPageError)}
|
||||
{errorDisplayStateless(currentPageError)}
|
||||
<p>
|
||||
Go to{' '}
|
||||
<a href="/" data-qa="public-home-link">
|
||||
|
@ -132,6 +132,7 @@ backendCallProps) => {
|
||||
return { response, text: result };
|
||||
});
|
||||
})
|
||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||
.then((result: any) => {
|
||||
let jsonResult = null;
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user