From 406c2d86683d36d253736da2e885517e981acda3 Mon Sep 17 00:00:00 2001 From: Joshua Toliver Date: Fri, 14 Jun 2024 17:26:16 -0400 Subject: [PATCH] Migrating from arrow components to function components --- .eslintrc.js | 4 +- app/javascript/app.jsx | 4 +- .../components/default-button/component.jsx | 6 +- .../components/icon-button/component.jsx | 4 +- .../components/link/component.jsx | 4 +- .../components/action-dialog/component.jsx | 6 +- .../components/text-with-close/component.jsx | 4 +- .../components/activity-log/component.jsx | 4 +- .../components/activity-item/component.jsx | 4 +- .../application-routes/app-route.jsx | 4 +- .../application-routes/component.jsx | 4 +- .../application-routes/sub-route.jsx | 4 +- .../components/application/use-app.jsx | 4 +- .../approvals/components/detail/component.jsx | 4 +- .../approvals/components/panel/component.jsx | 4 +- .../components/summary/component.jsx | 4 +- .../components/approvals/container.jsx | 4 +- .../components/button-text/component.jsx | 4 +- .../components/change-log-item/component.jsx | 4 +- .../components/change-log/component.jsx | 6 +- .../components/subform-dialog/component.jsx | 6 +- .../components/change-logs/container.jsx | 6 +- .../components/charts/bar-chart/component.jsx | 4 +- .../charts/table-values/component.jsx | 6 +- .../components/table-header/component.jsx | 4 +- .../components/table-rows/component.jsx | 4 +- .../components/code-of-conduct/component.jsx | 4 +- .../components/actions/component.jsx | 4 +- .../components/cancel-dialog/component.jsx | 4 +- .../contact-information/container.jsx | 4 +- .../custom-snackbar-provider/component.jsx | 4 +- .../dashboard/action-menu/component.jsx | 4 +- .../dashboard/badged-indicator/component.jsx | 4 +- .../dashboard/dashboard-chip/component.jsx | 4 +- .../dashboard/dashboard-table/component.jsx | 4 +- .../dashboard/doughnut-chart/component.jsx | 4 +- .../dashboard/flag-box/component.jsx | 4 +- .../components/flag-box-item/component.jsx | 4 +- .../dashboard/flag-list/component.jsx | 4 +- .../dashboard/line-chart/component.jsx | 4 +- .../dashboard/options-box/component.jsx | 4 +- .../dashboard/overview-box/component.jsx | 4 +- .../dashboard/pie-chart/component.jsx | 4 +- .../dashboard/priority-summary/component.jsx | 4 +- .../dashboard/services/component.jsx | 4 +- .../components/demo-indicator/component.jsx | 4 +- .../components/disable-offline/component.jsx | 4 +- .../components/offline-alert/component.jsx | 4 +- .../components/display-data/component.jsx | 4 +- .../components/error-state/component.jsx | 4 +- .../components/flagging/component.jsx | 4 +- .../flagging/components/TabPanel.jsx | 4 +- .../components/dialog-tabs/component.jsx | 4 +- .../components/flag-dialog/component.jsx | 4 +- .../components/flag-form/component.jsx | 4 +- .../list-flags-item-actions/component.jsx | 4 +- .../components/list-flags-item/component.jsx | 4 +- .../components/list-flags/component.jsx | 4 +- .../flagging/components/unflag/component.jsx | 4 +- .../components/form-filters/component.jsx | 4 +- .../components/change-log/component.jsx | 4 +- .../components/filters-form/component.jsx | 6 +- app/javascript/components/form/component.jsx | 6 +- .../components/actions-menu/container.jsx | 4 +- .../form/components/cancel-prompt.jsx | 4 +- .../components/draggable-option/component.jsx | 6 +- .../draggable-option/component.spec.js | 32 ++++---- .../form/components/form-action.jsx | 13 +-- .../form/components/form-section-actions.js | 4 +- .../form/components/form-section-field.jsx | 4 +- .../components/form-section-field.spec.js | 4 +- .../form-section-tabs/component.jsx | 4 +- .../form/components/form-section-title.jsx | 4 +- .../form/components/form-section.jsx | 4 +- .../form/components/input-label.jsx | 4 +- .../components/watched-form-section-field.jsx | 4 +- .../form/fields/attachment-input.jsx | 4 +- .../components/form/fields/checkbox-group.jsx | 4 +- .../components/form/fields/checkbox-input.jsx | 4 +- .../components/form/fields/date-input.jsx | 4 +- .../components/form/fields/dialog-trigger.jsx | 4 +- .../components/form/fields/error-field.jsx | 4 +- .../form/fields/error-field.spec.js | 8 +- .../components/form/fields/hidden-input.jsx | 4 +- .../components/form/fields/label.jsx | 4 +- .../components/form/fields/link-field.jsx | 4 +- .../form/fields/orderable-options-field.jsx | 10 +-- .../components/form/fields/radio-input.jsx | 4 +- .../form/fields/record-attachment-input.jsx | 4 +- .../components/form/fields/select-input.jsx | 4 +- .../components/form/fields/seperator.jsx | 4 +- .../components/form/fields/switch-input.jsx | 4 +- .../components/form/fields/text-input.jsx | 4 +- .../components/form/fields/toggle-input.jsx | 4 +- app/javascript/components/i18n/provider.js | 4 +- .../components/i18n/provider.spec.js | 8 +- .../components/detail/component.jsx | 6 +- .../components/panel/component.jsx | 6 +- .../components/summary/component.jsx | 4 +- .../incidents-from-case/container.jsx | 6 +- .../components/index-filters/component.jsx | 4 +- .../index-filters/components/actions.jsx | 4 +- .../components/filter-category.jsx | 4 +- .../checkbox-filter/component.jsx | 4 +- .../filter-types/chips-filter/component.jsx | 4 +- .../filter-types/date-filter/component.jsx | 4 +- .../filter-types/date-filter/field-select.jsx | 4 +- .../components/filter-types/search.jsx | 4 +- .../filter-types/select-filter/component.jsx | 6 +- .../filter-types/switch-filter/component.jsx | 4 +- .../filter-types/toggle-filter/component.jsx | 4 +- .../index-filters/components/more-section.jsx | 6 +- .../index-filters/components/panel.jsx | 4 +- .../index-filters/components/tab-filters.jsx | 6 +- .../index-table/cell-renderers/DateCell.jsx | 4 +- .../cell-renderers/ToggleIconCell.jsx | 4 +- .../components/index-table/component.jsx | 6 +- .../index-table/components/data-table.jsx | 6 +- .../custom-toolbar-select/component.jsx | 6 +- .../components/insights-filters/component.js | 4 +- .../components/insight-filter-tags.jsx | 4 +- .../components/insights-list/container.jsx | 4 +- .../components/exporter/exporter.jsx | 4 +- .../component.jsx | 4 +- .../insights-table-header/component.jsx | 4 +- .../insights-sub-report/container.jsx | 4 +- .../components/insights/component.jsx | 4 +- .../insights/components/exporter.jsx | 4 +- .../insights-exporter/component.jsx | 4 +- .../components/internal-alert/component.jsx | 4 +- .../components/dismiss-button/component.jsx | 4 +- .../components/item/component.jsx | 4 +- app/javascript/components/jewel/component.jsx | 4 +- .../key-performance-indicators/component.jsx | 4 +- .../component.spec.js | 5 +- .../assessment-status/component.jsx | 4 +- .../component.jsx | 4 +- .../average-referrals/component.jsx | 4 +- .../case-closure-rate/component.jsx | 4 +- .../components/case-load/component.jsx | 4 +- .../client-satisfaction-rate/component.jsx | 4 +- .../completed-case-action-plan/component.jsx | 4 +- .../completed-case-safety-plan/component.jsx | 4 +- .../component.jsx | 4 +- .../date-range-dialog/component.jsx | 4 +- .../date-range-select/component.jsx | 4 +- .../goal-progress-per-need/component.jsx | 4 +- .../components/kpi-table/component.jsx | 4 +- .../components/number-of-cases/component.jsx | 4 +- .../number-of-incidents/component.jsx | 4 +- .../components/percentage-cell/component.jsx | 4 +- .../components/reporting-delay/component.jsx | 4 +- .../services-provided/component.jsx | 4 +- .../single-aggregate-metric/component.jsx | 4 +- .../stacked-percentage-bar/component.jsx | 4 +- .../component.jsx | 4 +- .../component.jsx | 4 +- .../component.jsx | 4 +- .../table-percentage-bar/component.jsx | 4 +- .../component.jsx | 4 +- .../components/layouts/component.jsx | 4 +- .../components/app-layout/component.jsx | 4 +- .../components/empty-layout/component.jsx | 4 +- .../components/login-layout/component.jsx | 4 +- .../components/lightbox/component.jsx | 4 +- .../components/list-icon/component.jsx | 4 +- .../components/empty-state.jsx | 4 +- .../components/loading-indicator/loading.jsx | 4 +- .../components/login-dialog/component.jsx | 4 +- .../components/primero-idp-link.jsx | 4 +- .../components/primero-idp-select.jsx | 4 +- .../components/idp-selection/container.jsx | 4 +- .../login/components/login-form/component.jsx | 4 +- .../password-reset-dialog/component.jsx | 4 +- .../password-reset-form/component.jsx | 4 +- app/javascript/components/menu/component.jsx | 4 +- .../components/mobile-toolbar/component.jsx | 4 +- .../components/module-logo/component.jsx | 4 +- app/javascript/components/nav/component.jsx | 4 +- .../components/nav/component.spec.js | 4 +- .../nav/components/menu-entry/component.jsx | 4 +- .../nepali-calendar-input/component.jsx | 4 +- .../network-indicator/component.jsx | 4 +- .../components/not-implemented/component.jsx | 4 +- .../components/notifier/component.js | 4 +- .../components/snackbar-action/component.jsx | 4 +- .../components/page-navigation/component.jsx | 4 +- app/javascript/components/page/component.jsx | 4 +- .../page/components/page-content.jsx | 4 +- .../page/components/page-heading.jsx | 6 +- .../components/pages/account/container.jsx | 4 +- .../components/pages/admin/admin-nav-item.jsx | 4 +- .../components/pages/admin/admin-nav.jsx | 4 +- .../pages/admin/agencies-form/container.jsx | 4 +- .../pages/admin/agencies-list/container.jsx | 4 +- .../pages/admin/audit-logs/container.jsx | 4 +- .../pages/admin/code-of-conduct/component.jsx | 4 +- .../admin/configurations-form/container.jsx | 4 +- .../admin/configurations-list/container.jsx | 4 +- .../admin/contact-information/component.jsx | 4 +- .../components/pages/admin/container.jsx | 4 +- .../pages/admin/form-builder/component.jsx | 4 +- .../components/action-buttons/component.jsx | 4 +- .../components/clear-buttons/component.jsx | 4 +- .../custom-field-dialog/component.jsx | 4 +- .../component.jsx | 4 +- .../existing-field-dialog/component.jsx | 4 +- .../components/fields-table/component.jsx | 4 +- .../components/selection-column/component.jsx | 4 +- .../components/field-dialog/component.jsx | 4 +- .../components/field-list-item/component.jsx | 4 +- .../field-list-item/component.spec.js | 82 ++++++++++--------- .../field-translations-dialog/component.jsx | 4 +- .../translatable-options/component.jsx | 4 +- .../components/fields-list/component.jsx | 4 +- .../components/fields-tab/component.jsx | 4 +- .../form-translations-dialog/component.jsx | 4 +- .../components/settings-tab/component.jsx | 4 +- .../subform-fields-list/component.jsx | 4 +- .../components/tab-panel/component.jsx | 4 +- .../translations-form/component.jsx | 4 +- .../field-translation-row/component.jsx | 4 +- .../translations-note/component.jsx | 4 +- .../components/translations-tab/component.jsx | 4 +- .../pages/admin/forms-list/component.jsx | 4 +- .../components/drag-indicator/component.jsx | 4 +- .../components/filter-input/component.jsx | 4 +- .../filters-expansion-panel/component.jsx | 4 +- .../components/form-exporter/component.jsx | 4 +- .../components/form-filters/component.jsx | 4 +- .../components/form-group/component.jsx | 4 +- .../components/form-group/component.spec.js | 28 ++++--- .../components/form-section/component.jsx | 4 +- .../components/form-section/component.spec.js | 12 +-- .../components/reorder-actions/component.jsx | 4 +- .../components/table-row/component.jsx | 4 +- .../components/table-row/component.spec.js | 24 +++--- .../pages/admin/locations-list/container.jsx | 4 +- .../disable-dialog/component.jsx | 4 +- .../import-dialog/component.jsx | 4 +- .../components/draggable-row/component.jsx | 6 +- .../components/form/component.jsx | 4 +- .../components/header-values/component.jsx | 4 +- .../pages/admin/lookups-form/container.jsx | 4 +- .../pages/admin/lookups-list/component.jsx | 4 +- .../pages/admin/roles-form/container.jsx | 4 +- .../admin/roles-form/forms/action-buttons.jsx | 4 +- .../roles-form/roles-actions/component.jsx | 4 +- .../pages/admin/roles-list/container.jsx | 4 +- .../admin/user-groups-form/container.jsx | 4 +- .../admin/user-groups-list/container.jsx | 4 +- .../pages/admin/users-form/container.jsx | 4 +- .../user-confirmation/component.jsx | 6 +- .../pages/admin/users-list/container.jsx | 4 +- .../components/approvals/component.jsx | 4 +- .../cases-by-social-worker/component.jsx | 4 +- .../components/cases-to-assign/component.jsx | 4 +- .../dashboard/components/flags/component.jsx | 4 +- .../components/overdue-tasks/component.jsx | 4 +- .../components/overview/component.jsx | 4 +- .../component.jsx | 4 +- .../protection-concern/component.jsx | 4 +- .../reporting-location/component.jsx | 4 +- .../shared-from-my-team/component.jsx | 4 +- .../shared-with-my-team/component.jsx | 4 +- .../violations-category-region/component.jsx | 4 +- .../component.jsx | 4 +- .../workflow-individual-cases/component.jsx | 4 +- .../components/workflow-step.jsx | 4 +- .../workflow-team-cases/component.jsx | 4 +- .../components/pages/dashboard/container.jsx | 4 +- .../pages/errors/not-authorized/component.jsx | 4 +- .../pages/errors/not-found/component.jsx | 4 +- .../pages/export-list/container.jsx | 4 +- .../pages/potential-matches/container.jsx | 4 +- .../components/pages/support/component.jsx | 4 +- .../components/code-of-conduct/component.jsx | 4 +- .../components/navigation/component.jsx | 4 +- .../components/terms-of-use/component.jsx | 4 +- .../components/pages/task-list/container.jsx | 4 +- .../password-reset-confirmation/component.jsx | 4 +- .../components/password-reset/component.jsx | 4 +- .../components/key-value-cell/component.jsx | 6 +- .../components/logos/component.jsx | 4 +- .../components/render-table/component.js | 4 +- .../components/signatures/component.jsx | 4 +- .../components/table/component.jsx | 4 +- .../components/permissions/component.js | 4 +- .../record-actions/add-incident/component.jsx | 4 +- .../add-incident/fields/component.jsx | 4 +- .../record-actions/add-service/component.jsx | 4 +- .../components/record-actions/container.jsx | 12 +-- .../record-actions/exports/component.jsx | 6 +- .../link-incident-to-case/component.jsx | 4 +- .../mark-for-offline/component.jsx | 4 +- .../record-actions/notes/component.jsx | 4 +- .../request-approval/approval-form.jsx | 6 +- .../request-approval/component.jsx | 6 +- .../toggle-enable/component.jsx | 4 +- .../record-actions/toggle-open/component.jsx | 4 +- .../record-actions/transitions/component.jsx | 6 +- .../transitions/components/reassign-form.jsx | 6 +- .../components/referrals/component.jsx | 6 +- .../components/referrals/form-internal.jsx | 4 +- .../components/referrals/main-form.jsx | 4 +- .../components/referrals/main-form.spec.js | 4 +- .../referrals/on-change-refer-anyway.jsx | 2 +- .../components/referrals/provided-consent.jsx | 4 +- .../components/referrals/provided-form.jsx | 4 +- .../components/transfers/component.jsx | 6 +- .../components/transition-dialog.jsx | 6 +- .../transitions/referrals/component.jsx | 6 +- .../components/consent-provided/component.jsx | 4 +- .../record-creation-flow/component.jsx | 4 +- .../components/consent-prompt/component.jsx | 6 +- .../components/search-prompt/component.jsx | 6 +- .../record-form-alerts/component.jsx | 4 +- .../components/record-form/component.jsx | 6 +- .../components/render-form-sections.spec.js | 4 +- .../components/record-form/container.jsx | 4 +- .../components/disabled-record-indicator.jsx | 4 +- .../form/components/guiding-questions.jsx | 4 +- .../form/components/sync-record.jsx | 4 +- .../form/components/validation-errors.jsx | 4 +- .../form/components/workflow-indicator.jsx | 4 +- .../attachments/attachment-field.jsx | 4 +- .../attachments/attachment-input.jsx | 4 +- .../attachments/attachment-label.jsx | 4 +- .../attachments/attachment-preview.jsx | 4 +- .../field-types/attachments/component.jsx | 4 +- .../attachments/document-field.jsx | 6 +- .../field-types/attachments/photo-array.jsx | 4 +- .../attachments/render-preview.jsx | 1 + .../form/field-types/date-field-picker.jsx | 6 +- .../form/field-types/date-field.jsx | 4 +- .../form/field-types/link-to-form.jsx | 4 +- .../form/field-types/radio-field.jsx | 4 +- .../field-types/select-field-container.jsx | 6 +- .../form/field-types/select-field.jsx | 6 +- .../form/field-types/seperator.jsx | 4 +- .../field-types/tally-field-container.jsx | 4 +- .../form/field-types/tally-field.jsx | 4 +- .../form/field-types/text-field.jsx | 4 +- .../form/field-types/tick-field.jsx | 4 +- .../record-form/form/form-section-field.jsx | 6 +- .../record-form/form/formik-form.jsx | 6 +- .../record-form/form/page-heading.jsx | 6 +- .../record-form/form/record-form-title.jsx | 4 +- .../record-form/form/record-form-toolbar.jsx | 6 +- .../record-form/form/record-form.jsx | 6 +- .../subforms/services-subform/component.jsx | 6 +- .../subforms/subform-add-entry/component.jsx | 6 +- .../form/subforms/subform-chip/component.jsx | 4 +- .../subform-dialog-fields/component.jsx | 6 +- .../subforms/subform-dialog/component.jsx | 6 +- .../subform-drawer-actions/component.jsx | 4 +- .../subforms/subform-drawer/component.jsx | 4 +- .../subforms/subform-empty-data/component.jsx | 4 +- .../subforms/subform-errors/component.jsx | 4 +- .../subform-field-array/component.jsx | 6 +- .../subform-field-subform/component.jsx | 4 +- .../subforms/subform-fields/component.jsx | 6 +- .../tracing-request-status/component.jsx | 4 +- .../components/violation-item/component.jsx | 4 +- .../components/violation-item/select.jsx | 4 +- .../components/violation-title/component.jsx | 4 +- .../subform-header-date/component.jsx | 4 +- .../subform-header-lookup/component.jsx | 6 +- .../subform-header-tally/component.jsx | 4 +- .../subform-header-tickbox/component.jsx | 4 +- .../subforms/subform-header/component.jsx | 6 +- .../list-item-text-secondary/component.jsx | 4 +- .../form/subforms/subform-item/component.jsx | 6 +- .../form/subforms/subform-menu/component.jsx | 4 +- .../subform-menu/components/refer-action.js | 4 +- .../subforms/subform-traces/component.jsx | 4 +- .../components/compared-forms/component.jsx | 4 +- .../components/field-row/component.jsx | 4 +- .../components/field-rows/component.jsx | 4 +- .../components/trace-actions/component.jsx | 4 +- .../trace-comparison-form/component.jsx | 6 +- .../components/trace-form/component.jsx | 4 +- .../components/trace-matches/component.jsx | 4 +- .../components/record-form/nav/component.jsx | 6 +- .../nav/components/close-button-nav-bar.jsx | 4 +- .../nav/components/form-groups.jsx | 6 +- .../nav/components/nav-group/component.jsx | 6 +- .../nav/components/nav-item/component.jsx | 6 +- .../record-information/component.jsx | 4 +- .../record-information/component.spec.js | 4 +- .../record-list/add-record-menu.jsx | 4 +- .../components/date-column/component.jsx | 4 +- .../components/filter-container/component.jsx | 4 +- .../photo-column-body/component.jsx | 12 +-- .../components/record-list/container.jsx | 4 +- .../create-record-dialog/component.jsx | 4 +- .../record-list-toolbar/component.jsx | 4 +- .../record-list/view-modal/component.jsx | 4 +- .../view-modal/transfer-request/component.jsx | 4 +- .../transfer-request/request-form.jsx | 4 +- .../components/record-owner/component.jsx | 4 +- .../components/report/components/exporter.jsx | 4 +- .../components/report/container.jsx | 4 +- .../components/filter-applied/component.jsx | 6 +- .../components/filters-dialog/component.jsx | 4 +- .../components/filters-list/component.jsx | 6 +- .../components/filters/component.jsx | 6 +- .../components/reports-form/container.jsx | 4 +- .../components/reports-list/container.jsx | 4 +- .../save-and-redirect-dialog/component.jsx | 6 +- .../saved-searches/ListSavedSearches.jsx | 4 +- .../saved-searches/SavedSearchesForm.jsx | 4 +- .../components/saved-searches/component.jsx | 4 +- .../components/form-errors/component.jsx | 4 +- .../searchable-select/component.jsx | 6 +- .../session-timeout-dialog/component.jsx | 4 +- .../summary-incident-mrm/component.jsx | 4 +- .../component.jsx | 4 +- .../components/summary-fields/component.jsx | 4 +- .../violations-subforms/component.jsx | 4 +- .../components/summary/component.jsx | 4 +- .../components/comparison-form/component.jsx | 4 +- .../components/matched-traces/component.jsx | 4 +- .../matched-trace-panel/component.jsx | 4 +- .../components/matches-form/component.jsx | 4 +- .../components/tooltip/component.jsx | 4 +- .../components/tooltip/component.spec.js | 24 +++--- .../transitions/TransitionPanel.jsx | 4 +- .../transitions/TransitionStatus.jsx | 4 +- .../assignments/AssignmentsDetails.jsx | 4 +- .../assignments/AssignmentsSummary.jsx | 4 +- .../date-transitions-summary/component.jsx | 4 +- .../components/date-transitions/component.jsx | 4 +- .../components/menu-actions/component.jsx | 4 +- .../components/revoke-modal/component.jsx | 4 +- .../components/transitions/container.jsx | 6 +- .../transitions/referrals/details.jsx | 4 +- .../referrals/referral-action-menu.js | 4 +- .../referrals/referral-action/component.jsx | 6 +- .../referrals/render-icon-value.jsx | 1 + .../transitions/referrals/summary.jsx | 4 +- .../components/transitions/render-details.jsx | 1 + .../components/transitions/render-summary.jsx | 1 + .../transitions/render-transition.jsx | 1 + .../transitions/transfer_requests/details.jsx | 4 +- .../transitions/transfer_requests/summary.jsx | 4 +- .../transitions/transfers/TransferDetails.jsx | 4 +- .../transitions/transfers/TransferSummary.jsx | 4 +- .../transfers/render-icon-value.jsx | 1 + .../transfers/transfer-action-menu.jsx | 4 +- .../transfers/transfer-approval/component.js | 6 +- .../translations-dialog/component.jsx | 4 +- .../translations-toggle/component.jsx | 4 +- .../components/user-actions/component.jsx | 4 +- app/javascript/libs/conditional-wrapper.js | 4 +- .../test-utils/mounted-form-component.js | 4 +- .../test-utils/mounted-theme-component.js | 4 +- app/javascript/theme-provider.jsx | 4 +- 458 files changed, 1087 insertions(+), 1073 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 14591f112e..df3498093a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -51,7 +51,7 @@ module.exports = { "react/display-name": ["error", { ignoreTranspilerName: true }], "react/forbid-prop-types": "off", "react/jsx-props-no-spreading": "off", - "react/jsx-sort-default-props": [ + "react/sort-default-props": [ "error", { ignoreCase: true @@ -65,7 +65,7 @@ module.exports = { "import/no-extraneous-dependencies": "off", "default-param-last": "off", "arrow-body-style": "off", - "react/function-component-definition": "off", + "react/function-component-definition": [2, { namedComponents: "function-declaration" }], "no-restricted-exports": "off", "no-import-assign": "off", "react/jsx-no-useless-fragment": "off", diff --git a/app/javascript/app.jsx b/app/javascript/app.jsx index 4a0e8d25a8..8b02551098 100644 --- a/app/javascript/app.jsx +++ b/app/javascript/app.jsx @@ -19,7 +19,7 @@ import appInit from "./app-init"; const { store } = appInit(); -const App = () => { +function App() { window.I18n.fallbacks = true; useLayoutEffect(() => { @@ -51,7 +51,7 @@ const App = () => { ); -}; +} App.displayName = "App"; diff --git a/app/javascript/components/action-button/components/default-button/component.jsx b/app/javascript/components/action-button/components/default-button/component.jsx index ba03774f0e..71b58e204a 100644 --- a/app/javascript/components/action-button/components/default-button/component.jsx +++ b/app/javascript/components/action-button/components/default-button/component.jsx @@ -10,7 +10,7 @@ import ButtonText from "../../../button-text"; import { NAME } from "./constants"; import css from "./styles.css"; -const Component = ({ +function Component({ id, icon, cancel, @@ -22,7 +22,7 @@ const Component = ({ tooltip, rest, ...options -}) => { +}) { const renderIcon = icon || null; const isPending = Boolean(pending); const renderLoadingIndicator = isPending && ; @@ -62,7 +62,7 @@ const Component = ({ ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/action-button/components/icon-button/component.jsx b/app/javascript/components/action-button/components/icon-button/component.jsx index 64fefb7fa6..e5e5a5cb32 100644 --- a/app/javascript/components/action-button/components/icon-button/component.jsx +++ b/app/javascript/components/action-button/components/icon-button/component.jsx @@ -8,7 +8,7 @@ import { IconButton, Tooltip } from "@mui/material"; import css from "./styles.css"; import { NAME } from "./constants"; -const Component = ({ icon, id, rest, ...otherProps }) => { +function Component({ icon, id, rest, ...otherProps }) { const { tooltip } = otherProps; const Parent = tooltip ? Tooltip : Fragment; const spanClasses = clsx({ [css.isDisabled]: rest.disabled }); @@ -22,7 +22,7 @@ const Component = ({ icon, id, rest, ...otherProps }) => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/action-button/components/link/component.jsx b/app/javascript/components/action-button/components/link/component.jsx index 995e6e0e04..e5ebaab40c 100644 --- a/app/javascript/components/action-button/components/link/component.jsx +++ b/app/javascript/components/action-button/components/link/component.jsx @@ -5,7 +5,7 @@ import { Link } from "@mui/material"; import { NAME } from "./constants"; -const Component = ({ text, id, ...options }) => { +function Component({ text, id, ...options }) { const { rest, ...remainder } = options; if (rest.disabled) { @@ -17,7 +17,7 @@ const Component = ({ text, id, ...options }) => { {text} ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/action-dialog/component.jsx b/app/javascript/components/action-dialog/component.jsx index 101e7cbca7..9a4904e65f 100644 --- a/app/javascript/components/action-dialog/component.jsx +++ b/app/javascript/components/action-dialog/component.jsx @@ -17,7 +17,7 @@ import css from "./styles.css"; import { clearDialog } from "./action-creators"; import { getAsyncLoading } from "./selectors"; -const ActionDialog = ({ +function ActionDialog({ cancelButtonProps = {}, cancelHandler, children, @@ -42,7 +42,7 @@ const ActionDialog = ({ fetchAction, fetchArgs = [], fetchLoadingPath -}) => { +}) { const dispatch = useDispatch(); const { disabledApplication } = useApp(); @@ -166,7 +166,7 @@ const ActionDialog = ({ ); -}; +} ActionDialog.displayName = "ActionDialog"; diff --git a/app/javascript/components/action-dialog/components/text-with-close/component.jsx b/app/javascript/components/action-dialog/components/text-with-close/component.jsx index 5a9c138979..d297884836 100644 --- a/app/javascript/components/action-dialog/components/text-with-close/component.jsx +++ b/app/javascript/components/action-dialog/components/text-with-close/component.jsx @@ -7,7 +7,7 @@ import { DialogTitle, IconButton } from "@mui/material"; import { NAME } from "./constants"; import css from "./styles.css"; -const Component = ({ dialogTitle, dialogSubtitle, closeHandler, dialogActions, disableClose = false }) => { +function Component({ dialogTitle, dialogSubtitle, closeHandler, dialogActions, disableClose = false }) { const subtitle = dialogSubtitle ? {dialogSubtitle} : null; return ( @@ -28,7 +28,7 @@ const Component = ({ dialogTitle, dialogSubtitle, closeHandler, dialogActions, d ); -}; +} Component.propTypes = { closeHandler: PropTypes.func.isRequired, diff --git a/app/javascript/components/activity-log/component.jsx b/app/javascript/components/activity-log/component.jsx index 0f47dea50f..6619e66071 100644 --- a/app/javascript/components/activity-log/component.jsx +++ b/app/javascript/components/activity-log/component.jsx @@ -15,7 +15,7 @@ import { getColumns, getRecordPath } from "./utils"; import { fetchActivityLog, setActivityLogsFilter } from "./action-creators"; import css from "./styles.css"; -const Component = () => { +function Component() { const i18n = useI18n(); const dispatch = useDispatch(); const recordType = RESOURCES.activity_logs; @@ -67,7 +67,7 @@ const Component = () => { ); -}; +} Component.displayName = "ActivityLog"; diff --git a/app/javascript/components/activity-log/components/activity-item/component.jsx b/app/javascript/components/activity-log/components/activity-item/component.jsx index 39ed2353f8..bcc829d9c1 100644 --- a/app/javascript/components/activity-log/components/activity-item/component.jsx +++ b/app/javascript/components/activity-log/components/activity-item/component.jsx @@ -9,7 +9,7 @@ import getActivityMessage from "../../utils/get-activity-message"; import css from "./styles.css"; -const Component = ({ activityData }) => { +function Component({ activityData }) { const i18n = useI18n(); const classes = clsx(css.activityContainer, { [css.disabledItem]: activityData.recordAccessDenied @@ -36,7 +36,7 @@ const Component = ({ activityData }) => {
{i18n.t(`${type}.label`)}
); -}; +} Component.displayName = "ActivityItem"; diff --git a/app/javascript/components/application-routes/app-route.jsx b/app/javascript/components/application-routes/app-route.jsx index af1d409bf7..9ca5877417 100644 --- a/app/javascript/components/application-routes/app-route.jsx +++ b/app/javascript/components/application-routes/app-route.jsx @@ -6,7 +6,7 @@ import Layouts from "../layouts"; import SubRoutes from "./sub-routes"; -const AppRoute = ({ route }) => { +function AppRoute({ route }) { const { layout, component: Component, extraProps, ...routeProps } = route; if (layout) { @@ -18,7 +18,7 @@ const AppRoute = ({ route }) => { } return ; -}; +} AppRoute.displayName = "AppRoute"; diff --git a/app/javascript/components/application-routes/component.jsx b/app/javascript/components/application-routes/component.jsx index 60855a1bdf..c620da0530 100644 --- a/app/javascript/components/application-routes/component.jsx +++ b/app/javascript/components/application-routes/component.jsx @@ -5,7 +5,7 @@ import { Route, Switch } from "react-router-dom"; import AppRoute from "./app-route"; -const ApplicationRoutes = ({ routes }) => { +function ApplicationRoutes({ routes }) { const appRoutes = routes.map((route, index) => { const { routes: subRoutes, exact, path } = route; @@ -23,7 +23,7 @@ const ApplicationRoutes = ({ routes }) => { }); return {appRoutes}; -}; +} ApplicationRoutes.displayName = "ApplicationRoutes"; diff --git a/app/javascript/components/application-routes/sub-route.jsx b/app/javascript/components/application-routes/sub-route.jsx index 2964d55a13..6bd3745145 100644 --- a/app/javascript/components/application-routes/sub-route.jsx +++ b/app/javascript/components/application-routes/sub-route.jsx @@ -11,7 +11,7 @@ import Permission from "../permissions"; import { getCodeOfConductEnabled, getCodesOfConduct } from "../application/selectors"; import { getCodeOfConductId } from "../user"; -const SubRoute = ({ subRoute }) => { +function SubRoute({ subRoute }) { const { path, resources, actions, component: Component, extraProps } = subRoute; const codeOfConductAccepted = useMemoizedSelector(state => getCodeOfConductId(state)); @@ -38,7 +38,7 @@ const SubRoute = ({ subRoute }) => { ); -}; +} SubRoute.displayName = "SubRoute"; diff --git a/app/javascript/components/application/use-app.jsx b/app/javascript/components/application/use-app.jsx index a82a97b3fc..e6f0eb6534 100644 --- a/app/javascript/components/application/use-app.jsx +++ b/app/javascript/components/application/use-app.jsx @@ -11,13 +11,13 @@ import { getAppData } from "./selectors"; const Context = createContext(); -const ApplicationProvider = ({ children }) => { +function ApplicationProvider({ children }) { const { online, fieldMode } = useConnectivityStatus(); const appData = useMemoizedSelector(state => getAppData(state), isEqual); return {children}; -}; +} ApplicationProvider.displayName = "ApplicationProvider"; diff --git a/app/javascript/components/approvals/components/detail/component.jsx b/app/javascript/components/approvals/components/detail/component.jsx index fedfa03ac3..f638ca9bae 100644 --- a/app/javascript/components/approvals/components/detail/component.jsx +++ b/app/javascript/components/approvals/components/detail/component.jsx @@ -9,7 +9,7 @@ import { useApp } from "../../../application"; import { approvalLabel } from "./utils"; -const Component = ({ approvalSubform, isRequest, isResponse }) => { +function Component({ approvalSubform, isRequest, isResponse }) { const { approvalsLabels } = useApp(); const renderApprovalLabel = @@ -53,7 +53,7 @@ const Component = ({ approvalSubform, isRequest, isResponse }) => { ); -}; +} Component.displayName = NAME_DETAIL; diff --git a/app/javascript/components/approvals/components/panel/component.jsx b/app/javascript/components/approvals/components/panel/component.jsx index 31bd04d7c6..336730cc67 100644 --- a/app/javascript/components/approvals/components/panel/component.jsx +++ b/app/javascript/components/approvals/components/panel/component.jsx @@ -9,7 +9,7 @@ import ApprovalSummary from "../summary"; import ApprovalDetail from "../detail"; import { NAME_PANEL } from "../../constants"; -const Component = ({ approvalSubform, css }) => { +function Component({ approvalSubform, css }) { const [expanded, setExpanded] = useState(false); const handleExpanded = () => { @@ -45,7 +45,7 @@ const Component = ({ approvalSubform, css }) => { ); -}; +} Component.displayName = NAME_PANEL; diff --git a/app/javascript/components/approvals/components/summary/component.jsx b/app/javascript/components/approvals/components/summary/component.jsx index 258794554e..77a5297ae2 100644 --- a/app/javascript/components/approvals/components/summary/component.jsx +++ b/app/javascript/components/approvals/components/summary/component.jsx @@ -9,7 +9,7 @@ import { useI18n } from "../../../i18n"; import { NAME_SUMMARY } from "../../constants"; import { useApp } from "../../../application"; -const Component = ({ approvalSubform, css, isRequest, isResponse }) => { +function Component({ approvalSubform, css, isRequest, isResponse }) { const i18n = useI18n(); const { approvalsLabels } = useApp(); const status = approvalSubform.get("approval_status"); @@ -56,7 +56,7 @@ const Component = ({ approvalSubform, css, isRequest, isResponse }) => { {renderStatus} ); -}; +} Component.displayName = NAME_SUMMARY; diff --git a/app/javascript/components/approvals/container.jsx b/app/javascript/components/approvals/container.jsx index 9b2a8d0a23..8b3f94167d 100644 --- a/app/javascript/components/approvals/container.jsx +++ b/app/javascript/components/approvals/container.jsx @@ -9,7 +9,7 @@ import css from "./styles.css"; import { NAME } from "./constants"; import ApprovalPanel from "./components/panel"; -const Container = ({ approvals, mobileDisplay, handleToggleNav }) => { +function Container({ approvals, mobileDisplay, handleToggleNav }) { const i18n = useI18n(); const renderApprovals = @@ -34,7 +34,7 @@ const Container = ({ approvals, mobileDisplay, handleToggleNav }) => { ); -}; +} Container.displayName = NAME; diff --git a/app/javascript/components/button-text/component.jsx b/app/javascript/components/button-text/component.jsx index 1a4ad4ee81..d8faf97117 100644 --- a/app/javascript/components/button-text/component.jsx +++ b/app/javascript/components/button-text/component.jsx @@ -5,7 +5,7 @@ import { useMediaQuery } from "@mui/material"; import { NAME } from "./constants"; -const Component = ({ text, keepTextOnMobile = false }) => { +function Component({ text, keepTextOnMobile = false }) { const mobileDisplay = useMediaQuery(theme => theme.breakpoints.down("sm")); if (mobileDisplay && !keepTextOnMobile) { @@ -13,7 +13,7 @@ const Component = ({ text, keepTextOnMobile = false }) => { } return <>{text}; -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/change-logs/components/change-log-item/component.jsx b/app/javascript/components/change-logs/components/change-log-item/component.jsx index 949149e77c..b0069707db 100644 --- a/app/javascript/components/change-logs/components/change-log-item/component.jsx +++ b/app/javascript/components/change-logs/components/change-log-item/component.jsx @@ -17,7 +17,7 @@ import css from "../../styles.css"; import { NAME } from "./constants"; -const Component = ({ item }) => { +function Component({ item }) { const i18n = useI18n(); const { onClick } = item; const renderMessage = change => ( @@ -62,7 +62,7 @@ const Component = ({ item }) => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/change-logs/components/change-log/component.jsx b/app/javascript/components/change-logs/components/change-log/component.jsx index 767632bdb6..d39ff40407 100644 --- a/app/javascript/components/change-logs/components/change-log/component.jsx +++ b/app/javascript/components/change-logs/components/change-log/component.jsx @@ -10,7 +10,7 @@ import css from "../../styles.css"; import { NAME } from "./constants"; -const Component = ({ +function Component({ recordChangeLogs, setOpen, setRecordChanges, @@ -19,7 +19,7 @@ const Component = ({ allLookups, locations, allAgencies -}) => { +}) { const i18n = useI18n(); const handleSeeDetails = subformChanges => { @@ -39,7 +39,7 @@ const Component = ({ ).map(item => ); return {renderItems}; -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/change-logs/components/subform-dialog/component.jsx b/app/javascript/components/change-logs/components/subform-dialog/component.jsx index 7341a47dc4..0f40cee55f 100644 --- a/app/javascript/components/change-logs/components/subform-dialog/component.jsx +++ b/app/javascript/components/change-logs/components/subform-dialog/component.jsx @@ -13,7 +13,7 @@ import css from "../../styles.css"; import { NAME } from "./constants"; -const Component = ({ +function Component({ recordChanges, open, setOpen, @@ -23,7 +23,7 @@ const Component = ({ locations, setCalculatingChangeLog, allAgencies -}) => { +}) { const i18n = useI18n(); const subformTitle = i18n.t("change_logs.changes_subform", { @@ -60,7 +60,7 @@ const Component = ({ ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/change-logs/container.jsx b/app/javascript/components/change-logs/container.jsx index e8c06f56b2..8a8236ac4d 100644 --- a/app/javascript/components/change-logs/container.jsx +++ b/app/javascript/components/change-logs/container.jsx @@ -21,7 +21,7 @@ import { NAME } from "./constants"; import { getChangeLogs } from "./selectors"; import css from "./styles.css"; -const Container = ({ +function Container({ selectedForm, recordID, recordType, @@ -29,7 +29,7 @@ const Container = ({ mobileDisplay, handleToggleNav, fetchable = false -}) => { +}) { const i18n = useI18n(); const dispatch = useDispatch(); @@ -82,7 +82,7 @@ const Container = ({ /> ); -}; +} Container.displayName = NAME; diff --git a/app/javascript/components/charts/bar-chart/component.jsx b/app/javascript/components/charts/bar-chart/component.jsx index 6490dbb745..84a34c2a8c 100644 --- a/app/javascript/components/charts/bar-chart/component.jsx +++ b/app/javascript/components/charts/bar-chart/component.jsx @@ -7,7 +7,7 @@ import arrayReverse from "lodash/reverse"; import css from "./styles.css"; -const BarChart = ({ data, description, showDetails = false, hideLegend = false, reverse = false }) => { +function BarChart({ data, description, showDetails = false, hideLegend = false, reverse = false }) { const chartRef = createRef(); useEffect(() => { @@ -92,7 +92,7 @@ const BarChart = ({ data, description, showDetails = false, hideLegend = false, ); -}; +} BarChart.displayName = "BarChart"; diff --git a/app/javascript/components/charts/table-values/component.jsx b/app/javascript/components/charts/table-values/component.jsx index 6f0a981bf7..4024fff465 100644 --- a/app/javascript/components/charts/table-values/component.jsx +++ b/app/javascript/components/charts/table-values/component.jsx @@ -10,7 +10,7 @@ import InsightsTableHeader from "../../insights-sub-report/components/insights-t import { TableHeader, TableRows } from "./components"; import css from "./styles.css"; -const TableValues = ({ +function TableValues({ columns, values, showPlaceholder = false, @@ -18,7 +18,7 @@ const TableValues = ({ emptyMessage = "", useInsightsHeader = false, subColumnItemsSize -}) => { +}) { const Header = useInsightsHeader ? InsightsTableHeader : TableHeader; return ( @@ -37,7 +37,7 @@ const TableValues = ({ )} ); -}; +} TableValues.displayName = "TableValues"; diff --git a/app/javascript/components/charts/table-values/components/table-header/component.jsx b/app/javascript/components/charts/table-values/components/table-header/component.jsx index 144c4d1527..dc654ae39e 100644 --- a/app/javascript/components/charts/table-values/components/table-header/component.jsx +++ b/app/javascript/components/charts/table-values/components/table-header/component.jsx @@ -12,7 +12,7 @@ import css from "./styles.css"; import { emptyColumn } from "./utils"; import { NAME } from "./constants"; -const TableHeader = ({ columns }) => { +function TableHeader({ columns }) { const i18n = useI18n(); let newColumns = columns; @@ -76,7 +76,7 @@ const TableHeader = ({ columns }) => { })} ); -}; +} TableHeader.displayName = NAME; diff --git a/app/javascript/components/charts/table-values/components/table-rows/component.jsx b/app/javascript/components/charts/table-values/components/table-rows/component.jsx index 647ae1e5df..91d840f5d0 100644 --- a/app/javascript/components/charts/table-values/components/table-rows/component.jsx +++ b/app/javascript/components/charts/table-values/components/table-rows/component.jsx @@ -10,7 +10,7 @@ import generateKey from "../../utils"; import css from "./styles.css"; import { NAME } from "./constants"; -const Component = ({ values = [], subColumnItemsSize }) => { +function Component({ values = [], subColumnItemsSize }) { const i18n = useI18n(); const totalText = i18n.t("managed_reports.total"); @@ -37,7 +37,7 @@ const Component = ({ values = [], subColumnItemsSize }) => { ); }); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/code-of-conduct/component.jsx b/app/javascript/components/code-of-conduct/component.jsx index 96ccda896d..9feb6cc885 100644 --- a/app/javascript/components/code-of-conduct/component.jsx +++ b/app/javascript/components/code-of-conduct/component.jsx @@ -22,7 +22,7 @@ import { acceptCodeOfConduct } from "./action-creators"; import { selectUpdatingCodeOfConduct } from "./selectors"; import { Actions, CancelDialog } from "./components"; -const Component = () => { +function Component() { const i18n = useI18n(); const dispatch = useDispatch(); const location = useLocation(); @@ -82,7 +82,7 @@ const Component = () => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/code-of-conduct/components/actions/component.jsx b/app/javascript/components/code-of-conduct/components/actions/component.jsx index f1b04ba12e..b1fbba97ac 100644 --- a/app/javascript/components/code-of-conduct/components/actions/component.jsx +++ b/app/javascript/components/code-of-conduct/components/actions/component.jsx @@ -9,7 +9,7 @@ import { ACTION_BUTTON_TYPES } from "../../../action-button/constants"; import { NAME } from "./constants"; -const Component = ({ css, handleAccept, handleCancel, updatingCodeOfConduct, codeOfConductAccepted }) => { +function Component({ css, handleAccept, handleCancel, updatingCodeOfConduct, codeOfConductAccepted }) { return (
); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/code-of-conduct/components/cancel-dialog/component.jsx b/app/javascript/components/code-of-conduct/components/cancel-dialog/component.jsx index 472a01ea63..e406f5a9b0 100644 --- a/app/javascript/components/code-of-conduct/components/cancel-dialog/component.jsx +++ b/app/javascript/components/code-of-conduct/components/cancel-dialog/component.jsx @@ -9,7 +9,7 @@ import { ROUTES } from "../../../../config"; import { NAME } from "./constants"; -const Component = ({ dispatch, open, setOpen, i18n }) => { +function Component({ dispatch, open, setOpen, i18n }) { const onClose = () => setOpen(false); const handleLogout = () => { dispatch(push(ROUTES.logout)); @@ -29,7 +29,7 @@ const Component = ({ dispatch, open, setOpen, i18n }) => { }} /> ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/contact-information/container.jsx b/app/javascript/components/contact-information/container.jsx index 4d2380adc1..44ddf428f5 100644 --- a/app/javascript/components/contact-information/container.jsx +++ b/app/javascript/components/contact-information/container.jsx @@ -8,7 +8,7 @@ import { BLACK_LISTED_FIELDS } from "./constants"; import { selectSupportData } from "./selectors"; import css from "./styles.css"; -const Support = () => { +function Support() { const supportData = useMemoizedSelector(state => selectSupportData(state)); const i18n = useI18n(); @@ -38,7 +38,7 @@ const Support = () => { {renderInformation} ); -}; +} Support.displayName = "Support"; diff --git a/app/javascript/components/custom-snackbar-provider/component.jsx b/app/javascript/components/custom-snackbar-provider/component.jsx index eaf2278f98..d220e11368 100644 --- a/app/javascript/components/custom-snackbar-provider/component.jsx +++ b/app/javascript/components/custom-snackbar-provider/component.jsx @@ -10,7 +10,7 @@ import SignalWifiOffIcon from "@mui/icons-material/SignalWifiOff"; import { NAME } from "./constants"; import css from "./styles.css"; -const Component = ({ children }) => { +function Component({ children }) { return ( { {children} ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/dashboard/action-menu/component.jsx b/app/javascript/components/dashboard/action-menu/component.jsx index 5731be621b..8099be2e2d 100644 --- a/app/javascript/components/dashboard/action-menu/component.jsx +++ b/app/javascript/components/dashboard/action-menu/component.jsx @@ -7,7 +7,7 @@ import MoreVertIcon from "@mui/icons-material/MoreVert"; import css from "./styles.css"; -const ActionMenu = ({ open, onOpen, onClose, items }) => { +function ActionMenu({ open, onOpen, onClose, items }) { const moreButtonRef = useRef(null); return ( @@ -43,7 +43,7 @@ const ActionMenu = ({ open, onOpen, onClose, items }) => { ); -}; +} ActionMenu.displayName = "ActionMenu"; diff --git a/app/javascript/components/dashboard/badged-indicator/component.jsx b/app/javascript/components/dashboard/badged-indicator/component.jsx index 2af06b236b..70258a562e 100644 --- a/app/javascript/components/dashboard/badged-indicator/component.jsx +++ b/app/javascript/components/dashboard/badged-indicator/component.jsx @@ -13,7 +13,7 @@ import NAMESPACE from "../../pages/dashboard/namespace"; import css from "./styles.css"; -const BadgedIndicator = ({ data, lookup, sectionTitle, indicator, loading, errors }) => { +function BadgedIndicator({ data, lookup, sectionTitle, indicator, loading, errors }) { const dispatch = useDispatch(); const loadingIndicatorProps = { @@ -55,7 +55,7 @@ const BadgedIndicator = ({ data, lookup, sectionTitle, indicator, loading, error ); -}; +} BadgedIndicator.displayName = "BadgedIndicator"; diff --git a/app/javascript/components/dashboard/dashboard-chip/component.jsx b/app/javascript/components/dashboard/dashboard-chip/component.jsx index 25ed27a5f5..35928e47d1 100644 --- a/app/javascript/components/dashboard/dashboard-chip/component.jsx +++ b/app/javascript/components/dashboard/dashboard-chip/component.jsx @@ -6,7 +6,7 @@ import PropTypes from "prop-types"; import css from "./styles.css"; -const DashboardChip = ({ label, type, handleClick }) => { +function DashboardChip({ label, type, handleClick }) { const handler = typeof handleClick === "function" ? handleClick : null; const classes = clsx(css.chip, css[type]); @@ -22,7 +22,7 @@ const DashboardChip = ({ label, type, handleClick }) => { {label} ); -}; +} DashboardChip.displayName = "DashboardChip"; diff --git a/app/javascript/components/dashboard/dashboard-table/component.jsx b/app/javascript/components/dashboard/dashboard-table/component.jsx index 52a96facaa..dee468f35d 100644 --- a/app/javascript/components/dashboard/dashboard-table/component.jsx +++ b/app/javascript/components/dashboard/dashboard-table/component.jsx @@ -14,7 +14,7 @@ import { defaultTableOptions } from "../../index-table/utils"; import css from "./styles.css"; -const DashboardTable = ({ columns, data, query, title, pathname }) => { +function DashboardTable({ columns, data, query, title, pathname }) { const userPermissions = useMemoizedSelector(state => getPermissions(state)); const clickableCell = [...userPermissions.keys()].includes(pathname.split("/")[1]); @@ -70,7 +70,7 @@ const DashboardTable = ({ columns, data, query, title, pathname }) => { ); -}; +} DashboardTable.displayName = "DashboardTable"; diff --git a/app/javascript/components/dashboard/doughnut-chart/component.jsx b/app/javascript/components/dashboard/doughnut-chart/component.jsx index ec044850ca..7de84d91f7 100644 --- a/app/javascript/components/dashboard/doughnut-chart/component.jsx +++ b/app/javascript/components/dashboard/doughnut-chart/component.jsx @@ -48,7 +48,7 @@ Chart.pluginService.register({ } }); -const DoughnutChart = ({ chartData, options }) => { +function DoughnutChart({ chartData, options }) { const chartRef = createRef(); useEffect(() => { @@ -84,7 +84,7 @@ const DoughnutChart = ({ chartData, options }) => { }); return ; -}; +} DoughnutChart.displayName = "DoughnutChart"; diff --git a/app/javascript/components/dashboard/flag-box/component.jsx b/app/javascript/components/dashboard/flag-box/component.jsx index a116ff1d95..8ab981c4e8 100644 --- a/app/javascript/components/dashboard/flag-box/component.jsx +++ b/app/javascript/components/dashboard/flag-box/component.jsx @@ -8,7 +8,7 @@ import FlagBoxItem from "./components/flag-box-item"; import { showId } from "./utils"; import css from "./styles.css"; -const FlagBox = ({ flags }) => { +function FlagBox({ flags }) { return (
{flags @@ -25,7 +25,7 @@ const FlagBox = ({ flags }) => { .slice(0, 10)}
); -}; +} FlagBox.displayName = "FlagBox"; diff --git a/app/javascript/components/dashboard/flag-box/components/flag-box-item/component.jsx b/app/javascript/components/dashboard/flag-box/components/flag-box-item/component.jsx index f147712891..618a66bf70 100644 --- a/app/javascript/components/dashboard/flag-box/components/flag-box-item/component.jsx +++ b/app/javascript/components/dashboard/flag-box/components/flag-box-item/component.jsx @@ -12,7 +12,7 @@ import { UserArrowIcon } from "../../../../../images/primero-icons"; import { NAME } from "./constants"; -const Component = ({ date, reason, recordId, title, user }) => { +function Component({ date, reason, recordId, title, user }) { const dispatch = useDispatch(); const handleFlagOpen = id => () => dispatch(push(`${RECORD_PATH.cases}/${id}`)); @@ -27,7 +27,7 @@ const Component = ({ date, reason, recordId, title, user }) => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/dashboard/flag-list/component.jsx b/app/javascript/components/dashboard/flag-list/component.jsx index 9de4c9120f..162ba29665 100644 --- a/app/javascript/components/dashboard/flag-list/component.jsx +++ b/app/javascript/components/dashboard/flag-list/component.jsx @@ -8,7 +8,7 @@ import FlagBox from "../flag-box"; import css from "./styles.css"; -const FlagList = ({ flags }) => { +function FlagList({ flags }) { const i18n = useI18n(); return ( @@ -21,7 +21,7 @@ const FlagList = ({ flags }) => { ); -}; +} FlagList.displayName = "FlagList"; diff --git a/app/javascript/components/dashboard/line-chart/component.jsx b/app/javascript/components/dashboard/line-chart/component.jsx index 4a73eed68c..c79dfb71ab 100644 --- a/app/javascript/components/dashboard/line-chart/component.jsx +++ b/app/javascript/components/dashboard/line-chart/component.jsx @@ -6,7 +6,7 @@ import { createRef, useEffect } from "react"; import css from "./styles.css"; -const LineChart = ({ chartData, options, title }) => { +function LineChart({ chartData, options, title }) { const chartRef = createRef(); useEffect(() => { @@ -79,7 +79,7 @@ const LineChart = ({ chartData, options, title }) => { ); -}; +} LineChart.displayName = "LineChart"; diff --git a/app/javascript/components/dashboard/options-box/component.jsx b/app/javascript/components/dashboard/options-box/component.jsx index d2f6f5e269..f808b39707 100644 --- a/app/javascript/components/dashboard/options-box/component.jsx +++ b/app/javascript/components/dashboard/options-box/component.jsx @@ -10,7 +10,7 @@ import { ConditionalWrapper } from "../../../libs"; import css from "./styles.css"; -const OptionsBox = ({ title, action, children, to, flat, overlay, type = "", loading, errors, hasData = true }) => { +function OptionsBox({ title, action, children, to, flat, overlay, type = "", loading, errors, hasData = true }) { const loadingIndicatorProps = { overlay, type, @@ -47,7 +47,7 @@ const OptionsBox = ({ title, action, children, to, flat, overlay, type = "", loa ); -}; +} OptionsBox.displayName = "OptionsBox"; diff --git a/app/javascript/components/dashboard/overview-box/component.jsx b/app/javascript/components/dashboard/overview-box/component.jsx index 0f8843489b..dbbbceb3f3 100644 --- a/app/javascript/components/dashboard/overview-box/component.jsx +++ b/app/javascript/components/dashboard/overview-box/component.jsx @@ -18,7 +18,7 @@ import ActionButton from "../../action-button"; import css from "./styles.css"; -const OverviewBox = ({ items, chartData, sumTitle, withTotal = true, loading, errors }) => { +function OverviewBox({ items, chartData, sumTitle, withTotal = true, loading, errors }) { const i18n = useI18n(); const { approvalsLabels } = useApp(); const dispatch = useDispatch(); @@ -123,7 +123,7 @@ const OverviewBox = ({ items, chartData, sumTitle, withTotal = true, loading, er const renderOverviewBox = chartData ? renderWithChart() : renderItems(); return <>{renderOverviewBox}; -}; +} OverviewBox.displayName = "OverviewBox"; diff --git a/app/javascript/components/dashboard/pie-chart/component.jsx b/app/javascript/components/dashboard/pie-chart/component.jsx index 81d788e813..26639f77a3 100644 --- a/app/javascript/components/dashboard/pie-chart/component.jsx +++ b/app/javascript/components/dashboard/pie-chart/component.jsx @@ -11,7 +11,7 @@ import { buildFilter } from "../utils"; import { NAME, COLORS } from "./constants"; -const PieChart = ({ data, labels, query }) => { +function PieChart({ data, labels, query }) { const dispatch = useDispatch(); const chartRef = createRef(); @@ -60,7 +60,7 @@ const PieChart = ({ data, labels, query }) => { }); return ; -}; +} PieChart.displayName = NAME; diff --git a/app/javascript/components/dashboard/priority-summary/component.jsx b/app/javascript/components/dashboard/priority-summary/component.jsx index e89769d261..9d1d351fe4 100644 --- a/app/javascript/components/dashboard/priority-summary/component.jsx +++ b/app/javascript/components/dashboard/priority-summary/component.jsx @@ -7,7 +7,7 @@ import DashboardChip from "../dashboard-chip"; import css from "./styles.css"; -const PrioritySummary = ({ summary }) => { +function PrioritySummary({ summary }) { const i18n = useI18n(); const getTitle = status => { @@ -51,7 +51,7 @@ const PrioritySummary = ({ summary }) => { ); -}; +} PrioritySummary.displayName = "PrioritySummary"; diff --git a/app/javascript/components/dashboard/services/component.jsx b/app/javascript/components/dashboard/services/component.jsx index 46bd16878d..b1fcdfcfc5 100644 --- a/app/javascript/components/dashboard/services/component.jsx +++ b/app/javascript/components/dashboard/services/component.jsx @@ -8,7 +8,7 @@ import OptionsBox from "../options-box"; import css from "./styles.css"; -const Services = ({ servicesList }) => { +function Services({ servicesList }) { const i18n = useI18n(); const styleOverrides = { @@ -34,7 +34,7 @@ const Services = ({ servicesList }) => { ); -}; +} Services.displayName = "Services"; diff --git a/app/javascript/components/demo-indicator/component.jsx b/app/javascript/components/demo-indicator/component.jsx index 5c3a07bd9d..87a5dbc25e 100644 --- a/app/javascript/components/demo-indicator/component.jsx +++ b/app/javascript/components/demo-indicator/component.jsx @@ -10,7 +10,7 @@ import { DEMO } from "../application/constants"; import { NAME } from "./constants"; import css from "./styles.css"; -const Component = ({ isDemo }) => { +function Component({ isDemo }) { const mobileDisplay = useMediaQuery(theme => theme.breakpoints.down("sm")); const i18n = useI18n(); const classes = { standardInfo: css.standardInfo, message: css.standardInfoText }; @@ -24,7 +24,7 @@ const Component = ({ isDemo }) => { {i18n.t(DEMO)} ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/disable-offline/component.jsx b/app/javascript/components/disable-offline/component.jsx index 92a3da2486..180b3f4a0b 100644 --- a/app/javascript/components/disable-offline/component.jsx +++ b/app/javascript/components/disable-offline/component.jsx @@ -10,7 +10,7 @@ import { useI18n } from "../i18n"; import css from "./styles.css"; -const Component = ({ overrideCondition = false, children, button = false, offlineTextKey = null }) => { +function Component({ overrideCondition = false, children, button = false, offlineTextKey = null }) { const { online } = useApp(); const i18n = useI18n(); const classes = clsx(css.disabledLink, { @@ -29,7 +29,7 @@ const Component = ({ overrideCondition = false, children, button = false, offlin } return children; -}; +} Component.propTypes = { button: PropTypes.bool, diff --git a/app/javascript/components/disable-offline/components/offline-alert/component.jsx b/app/javascript/components/disable-offline/components/offline-alert/component.jsx index 9f394673e1..3ae33cf71c 100644 --- a/app/javascript/components/disable-offline/components/offline-alert/component.jsx +++ b/app/javascript/components/disable-offline/components/offline-alert/component.jsx @@ -8,7 +8,7 @@ import { useApp } from "../../../application"; import css from "./styles.css"; -const Component = ({ text, noMargin }) => { +function Component({ text, noMargin }) { const { online } = useApp(); if (online) return null; @@ -20,7 +20,7 @@ const Component = ({ text, noMargin }) => { ); -}; +} Component.displayName = "OfflineAlert"; diff --git a/app/javascript/components/display-data/component.jsx b/app/javascript/components/display-data/component.jsx index 85ac8e4013..7ca2ea1429 100644 --- a/app/javascript/components/display-data/component.jsx +++ b/app/javascript/components/display-data/component.jsx @@ -7,7 +7,7 @@ import { useI18n } from "../i18n"; import { NAME } from "./constants"; import css from "./styles.css"; -const DisplayData = ({ label, value }) => { +function DisplayData({ label, value }) { const i18n = useI18n(); return ( @@ -16,7 +16,7 @@ const DisplayData = ({ label, value }) => {
{value || "--"}
); -}; +} DisplayData.displayName = NAME; diff --git a/app/javascript/components/error-boundary/components/error-state/component.jsx b/app/javascript/components/error-boundary/components/error-state/component.jsx index b9b6e31c6a..b484267f48 100644 --- a/app/javascript/components/error-boundary/components/error-state/component.jsx +++ b/app/javascript/components/error-boundary/components/error-state/component.jsx @@ -8,7 +8,7 @@ import { useI18n } from "../../../i18n"; import css from "./styles.css"; -const ErrorState = ({ errorMessage, handleTryAgain, type }) => { +function ErrorState({ errorMessage, handleTryAgain, type }) { const i18n = useI18n(); return ( @@ -28,7 +28,7 @@ const ErrorState = ({ errorMessage, handleTryAgain, type }) => { ); -}; +} ErrorState.displayName = "ErrorState"; diff --git a/app/javascript/components/flagging/component.jsx b/app/javascript/components/flagging/component.jsx index 954f7ff8b5..5a4bf2d5b5 100644 --- a/app/javascript/components/flagging/component.jsx +++ b/app/javascript/components/flagging/component.jsx @@ -14,7 +14,7 @@ import { FlagDialog, FlagForm, ListFlags, Unflag } from "./components"; import { FLAG_DIALOG, NAME } from "./constants"; import { getSelectedFlag } from "./selectors"; -const Component = ({ control, record, recordType }) => { +function Component({ control, record, recordType }) { const [tab, setTab] = useState(0); const { dialogOpen, setDialog } = useDialog(FLAG_DIALOG); @@ -74,7 +74,7 @@ const Component = ({ control, record, recordType }) => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/flagging/components/TabPanel.jsx b/app/javascript/components/flagging/components/TabPanel.jsx index b3b11349a0..e67d882764 100644 --- a/app/javascript/components/flagging/components/TabPanel.jsx +++ b/app/javascript/components/flagging/components/TabPanel.jsx @@ -3,7 +3,7 @@ import PropTypes from "prop-types"; import { Box } from "@mui/material"; -const TabPanel = props => { +function TabPanel(props) { const { children, value, index } = props; return ( @@ -16,7 +16,7 @@ const TabPanel = props => { {children} ); -}; +} TabPanel.displayName = "TabPanel"; diff --git a/app/javascript/components/flagging/components/dialog-tabs/component.jsx b/app/javascript/components/flagging/components/dialog-tabs/component.jsx index 6c78e03eb6..f35f1175cc 100644 --- a/app/javascript/components/flagging/components/dialog-tabs/component.jsx +++ b/app/javascript/components/flagging/components/dialog-tabs/component.jsx @@ -9,7 +9,7 @@ import css from "../styles.css"; import { NAME } from "./constants"; -const Component = ({ children, isBulkFlags, tab, setTab }) => { +function Component({ children, isBulkFlags, tab, setTab }) { const i18n = useI18n(); const tabs = [i18n.t("flags.flags_tab"), i18n.t("flags.add_flag_tab")]; @@ -53,7 +53,7 @@ const Component = ({ children, isBulkFlags, tab, setTab }) => { } return null; -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/flagging/components/flag-dialog/component.jsx b/app/javascript/components/flagging/components/flag-dialog/component.jsx index 4ceb89b36a..89d661e2aa 100644 --- a/app/javascript/components/flagging/components/flag-dialog/component.jsx +++ b/app/javascript/components/flagging/components/flag-dialog/component.jsx @@ -9,7 +9,7 @@ import { NAME as FORM_ID } from "../flag-form/constants"; import { NAME } from "./constants"; -const Component = ({ dialogOpen, fetchAction, fetchArgs, children, isBulkFlags, tab, setTab }) => { +function Component({ dialogOpen, fetchAction, fetchArgs, children, isBulkFlags, tab, setTab }) { const i18n = useI18n(); return ( @@ -31,7 +31,7 @@ const Component = ({ dialogOpen, fetchAction, fetchArgs, children, isBulkFlags, ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/flagging/components/flag-form/component.jsx b/app/javascript/components/flagging/components/flag-form/component.jsx index 0601d2fe35..19efbf55a8 100644 --- a/app/javascript/components/flagging/components/flag-form/component.jsx +++ b/app/javascript/components/flagging/components/flag-form/component.jsx @@ -16,7 +16,7 @@ const initialValues = { message: "" }; -const Component = ({ recordType, record, handleActiveTab }) => { +function Component({ recordType, record, handleActiveTab }) { const i18n = useI18n(); const dispatch = useDispatch(); @@ -39,7 +39,7 @@ const Component = ({ recordType, record, handleActiveTab }) => { resetAfterSubmit /> ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/flagging/components/list-flags-item-actions/component.jsx b/app/javascript/components/flagging/components/list-flags-item-actions/component.jsx index 6dcd92f6e4..1992552e46 100644 --- a/app/javascript/components/flagging/components/list-flags-item-actions/component.jsx +++ b/app/javascript/components/flagging/components/list-flags-item-actions/component.jsx @@ -18,7 +18,7 @@ import { usePermissions, FLAG_RESOLVE_ANY } from "../../../permissions"; import { NAME } from "./constants"; -const Component = ({ flag }) => { +function Component({ flag }) { const i18n = useI18n(); const dispatch = useDispatch(); const canResolveAnyFlag = usePermissions(flag?.record_type, FLAG_RESOLVE_ANY); @@ -71,7 +71,7 @@ const Component = ({ flag }) => { ); return renderActions; -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/flagging/components/list-flags-item/component.jsx b/app/javascript/components/flagging/components/list-flags-item/component.jsx index adfeeb18fe..7ddcad084f 100644 --- a/app/javascript/components/flagging/components/list-flags-item/component.jsx +++ b/app/javascript/components/flagging/components/list-flags-item/component.jsx @@ -10,7 +10,7 @@ import ListFlagsItemActions from "../list-flags-item-actions"; import { NAME } from "./constants"; -const Component = ({ flag }) => { +function Component({ flag }) { const itemClass = flag?.removed ? css.itemResolved : css.item; if (!flag) { @@ -39,7 +39,7 @@ const Component = ({ flag }) => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/flagging/components/list-flags/component.jsx b/app/javascript/components/flagging/components/list-flags/component.jsx index 888d6bef05..d243d648b0 100644 --- a/app/javascript/components/flagging/components/list-flags/component.jsx +++ b/app/javascript/components/flagging/components/list-flags/component.jsx @@ -12,7 +12,7 @@ import css from "../styles.css"; import { NAME } from "./constants"; -const Component = ({ recordType, record }) => { +function Component({ recordType, record }) { const i18n = useI18n(); const flagsActived = useMemoizedSelector(state => getActiveFlags(state, record, recordType)); @@ -54,7 +54,7 @@ const Component = ({ recordType, record }) => { )} ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/flagging/components/unflag/component.jsx b/app/javascript/components/flagging/components/unflag/component.jsx index e744df480b..c5774c39b7 100644 --- a/app/javascript/components/flagging/components/unflag/component.jsx +++ b/app/javascript/components/flagging/components/unflag/component.jsx @@ -17,7 +17,7 @@ const validationSchema = object().shape({ unflag_message: string().required() }); -const Component = ({ flag }) => { +function Component({ flag }) { const i18n = useI18n(); const dispatch = useDispatch(); const { dialogOpen, setDialog, setDialogPending, dialogPending } = useDialog(UNFLAG_DIALOG); @@ -76,7 +76,7 @@ const Component = ({ flag }) => { /> ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/form-filters/component.jsx b/app/javascript/components/form-filters/component.jsx index fab8ca2e0d..2a15f5cdcd 100644 --- a/app/javascript/components/form-filters/component.jsx +++ b/app/javascript/components/form-filters/component.jsx @@ -8,7 +8,7 @@ import useFormFilters from "./use-form-filters"; import { getFilters } from "./utils"; import { NAME } from "./constants"; -const Component = ({ formMode, primeroModule, recordType, selectedForm, showDrawer }) => { +function Component({ formMode, primeroModule, recordType, selectedForm, showDrawer }) { const Filters = getFilters(selectedForm); const { clearFilters } = useFormFilters(selectedForm); @@ -30,7 +30,7 @@ const Component = ({ formMode, primeroModule, recordType, selectedForm, showDraw selectedForm={selectedForm} /> ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/form-filters/components/change-log/component.jsx b/app/javascript/components/form-filters/components/change-log/component.jsx index d2b53a2fe4..9aabce582c 100644 --- a/app/javascript/components/form-filters/components/change-log/component.jsx +++ b/app/javascript/components/form-filters/components/change-log/component.jsx @@ -13,7 +13,7 @@ import useFormFilters from "../../use-form-filters"; import { FILTER_NAMES, NAME } from "./constants"; import { getFilters } from "./utils"; -const Component = ({ selectedForm, formMode, primeroModule, recordType, showDrawer }) => { +function Component({ selectedForm, formMode, primeroModule, recordType, showDrawer }) { const i18n = useI18n(); const { setFormFilters, selectedFilters } = useFormFilters(selectedForm); @@ -46,7 +46,7 @@ const Component = ({ selectedForm, formMode, primeroModule, recordType, showDraw /> ) ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/form-filters/components/filters-form/component.jsx b/app/javascript/components/form-filters/components/filters-form/component.jsx index 8a351d1592..8b55882163 100644 --- a/app/javascript/components/form-filters/components/filters-form/component.jsx +++ b/app/javascript/components/form-filters/components/filters-form/component.jsx @@ -16,7 +16,7 @@ import { useMemoizedSelector, useThemeHelper } from "../../../../libs"; import { FILTERS_DRAWER, NAME } from "./constants"; import css from "./styles.css"; -const Component = ({ +function Component({ closeDrawerOnSubmit = false, filters, onSubmit, @@ -24,7 +24,7 @@ const Component = ({ defaultFilters = {}, initialFilters = {}, showDrawer = false -}) => { +}) { const methods = useForm(); const { mobileDisplay } = useThemeHelper(); @@ -96,7 +96,7 @@ const Component = ({ ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/form/component.jsx b/app/javascript/components/form/component.jsx index 34fab0060f..ba7caac1b5 100644 --- a/app/javascript/components/form/component.jsx +++ b/app/javascript/components/form/component.jsx @@ -16,7 +16,7 @@ import { whichFormMode } from "./utils/which-mode"; import { submitHandler } from "./utils/form-submission"; import notPropagatedOnSubmit from "./utils/not-propagated-on-submit"; -const Component = ({ +function Component({ formID, formSections, formOptions = {}, @@ -36,7 +36,7 @@ const Component = ({ registerFields = [], resetAfterSubmit = false, errorMessage = null -}) => { +}) { const i18n = useI18n(); const dispatch = useDispatch(); @@ -126,7 +126,7 @@ const Component = ({ {renderBottom && renderBottom(formMethods)} ); -}; +} Component.displayName = "Form"; diff --git a/app/javascript/components/form/components/actions-menu/container.jsx b/app/javascript/components/form/components/actions-menu/container.jsx index 744655131e..0789e1f3c8 100644 --- a/app/javascript/components/form/components/actions-menu/container.jsx +++ b/app/javascript/components/form/components/actions-menu/container.jsx @@ -10,7 +10,7 @@ import { ACTION_BUTTON_TYPES } from "../../../action-button/constants"; import { NAME } from "./constants"; -const Container = ({ actionItems = [] }) => { +function Container({ actionItems = [] }) { const [anchorEl, setAnchorEl] = useState(null); const handleClick = event => { @@ -59,7 +59,7 @@ const Container = ({ actionItems = [] }) => { ); -}; +} Container.propTypes = { actionItems: PropTypes.array diff --git a/app/javascript/components/form/components/cancel-prompt.jsx b/app/javascript/components/form/components/cancel-prompt.jsx index 5c900bcf10..cb624cf829 100644 --- a/app/javascript/components/form/components/cancel-prompt.jsx +++ b/app/javascript/components/form/components/cancel-prompt.jsx @@ -6,7 +6,7 @@ import NavigationPrompt from "react-router-navigation-prompt"; import ActionDialog from "../../action-dialog"; import { useI18n } from "../../i18n"; -const CancelPrompt = ({ useCancelPrompt = false, dirty = false, isSubmitted = false, isShow = false }) => { +function CancelPrompt({ useCancelPrompt = false, dirty = false, isSubmitted = false, isShow = false }) { const i18n = useI18n(); const promptCancelWhen = dirty && !isSubmitted && !isShow; @@ -29,7 +29,7 @@ const CancelPrompt = ({ useCancelPrompt = false, dirty = false, isSubmitted = fa } return null; -}; +} CancelPrompt.displayName = "CancelPrompt"; diff --git a/app/javascript/components/form/components/draggable-option/component.jsx b/app/javascript/components/form/components/draggable-option/component.jsx index ee1621f2a8..e1f3ea082e 100644 --- a/app/javascript/components/form/components/draggable-option/component.jsx +++ b/app/javascript/components/form/components/draggable-option/component.jsx @@ -18,7 +18,7 @@ import { generateIdFromDisplayText } from "../../utils/handle-options"; import textInputCss from "./styles.css"; import { NAME } from "./constants"; -const Component = ({ +function Component({ defaultOptionId, index, name, @@ -30,7 +30,7 @@ const Component = ({ showDeleteAction = true, showDisableOption = true, optionFieldName = "option_strings_text" -}) => { +}) { const { errors, setValue, @@ -140,7 +140,7 @@ const Component = ({ )} ); -}; +} Component.propTypes = { defaultOptionId: PropTypes.string, diff --git a/app/javascript/components/form/components/draggable-option/component.spec.js b/app/javascript/components/form/components/draggable-option/component.spec.js index ae89d2c226..ca44e3b546 100644 --- a/app/javascript/components/form/components/draggable-option/component.spec.js +++ b/app/javascript/components/form/components/draggable-option/component.spec.js @@ -7,21 +7,23 @@ import DraggableOption from "./component"; describe("
- components/", () => { beforeEach(() => { // eslint-disable-next-line react/display-name - const Component = props => ( - - - {() => ( - - )} - - - ); + function Component(props) { + return ( + + + {() => ( + + )} + + + ); + } mountedFormComponent(); }); diff --git a/app/javascript/components/form/components/form-action.jsx b/app/javascript/components/form/components/form-action.jsx index ad18166b28..50aee70f37 100644 --- a/app/javascript/components/form/components/form-action.jsx +++ b/app/javascript/components/form/components/form-action.jsx @@ -5,16 +5,7 @@ import PropTypes from "prop-types"; import ActionButton from "../../action-button"; import { ACTION_BUTTON_TYPES } from "../../action-button/constants"; -const FormAction = ({ - actionHandler, - cancel, - savingRecord = false, - startIcon, - text, - disabled, - options = {}, - tooltip -}) => { +function FormAction({ actionHandler, cancel, savingRecord = false, startIcon, text, disabled, options = {}, tooltip }) { return ( ); -}; +} FormAction.displayName = "FormAction"; diff --git a/app/javascript/components/form/components/form-section-actions.js b/app/javascript/components/form/components/form-section-actions.js index 8ecdcb5de8..967482c95b 100644 --- a/app/javascript/components/form/components/form-section-actions.js +++ b/app/javascript/components/form/components/form-section-actions.js @@ -4,7 +4,7 @@ import PropTypes from "prop-types"; import ActionButton from "../../action-button"; -const FormSectionActions = ({ actions, css }) => { +function FormSectionActions({ actions, css }) { if (!actions?.length) return null; return ( @@ -14,7 +14,7 @@ const FormSectionActions = ({ actions, css }) => { ))} ); -}; +} FormSectionActions.propTypes = { actions: PropTypes.array, diff --git a/app/javascript/components/form/components/form-section-field.jsx b/app/javascript/components/form/components/form-section-field.jsx index 6449304f5f..3573220ab9 100644 --- a/app/javascript/components/form/components/form-section-field.jsx +++ b/app/javascript/components/form/components/form-section-field.jsx @@ -10,7 +10,7 @@ import formComponent from "../utils/form-component"; import css from "./styles.css"; -const FormSectionField = ({ checkErrors, field, formMethods, formMode, disableUnderline = false }) => { +function FormSectionField({ checkErrors, field, formMethods, formMode, disableUnderline = false }) { const { errors } = formMethods; const { Field, @@ -55,7 +55,7 @@ const FormSectionField = ({ checkErrors, field, formMethods, formMode, disableUn ) ); -}; +} FormSectionField.displayName = "FormSectionField"; diff --git a/app/javascript/components/form/components/form-section-field.spec.js b/app/javascript/components/form/components/form-section-field.spec.js index aaa2622893..6e189dd095 100644 --- a/app/javascript/components/form/components/form-section-field.spec.js +++ b/app/javascript/components/form/components/form-section-field.spec.js @@ -18,9 +18,9 @@ describe(" - components/", () => { const field = FieldRecord({ name: "test_field", type: "error_field" }); // eslint-disable-next-line react/display-name - const Component = props => { + function Component(props) { return ; - }; + } mountedFormComponent(, { errors: [ diff --git a/app/javascript/components/form/components/form-section-tabs/component.jsx b/app/javascript/components/form/components/form-section-tabs/component.jsx index eb6bf09a1d..e427c9545a 100644 --- a/app/javascript/components/form/components/form-section-tabs/component.jsx +++ b/app/javascript/components/form/components/form-section-tabs/component.jsx @@ -11,7 +11,7 @@ import watchedFormSectionField from "../watched-form-section-field"; import { NAME } from "./constants"; import css from "./styles.css"; -const Component = ({ tabs, formMethods, formMode, handleTabChange }) => { +function Component({ tabs, formMethods, formMode, handleTabChange }) { const firstEnabled = tabs.findIndex(el => el.disabled === false); const [tab, setTab] = useState(firstEnabled); @@ -48,7 +48,7 @@ const Component = ({ tabs, formMethods, formMode, handleTabChange }) => { {renderTabPanel()} ); -}; +} Component.propTypes = { formMethods: PropTypes.object.isRequired, diff --git a/app/javascript/components/form/components/form-section-title.jsx b/app/javascript/components/form/components/form-section-title.jsx index 0d0a66bba8..edecd06657 100644 --- a/app/javascript/components/form/components/form-section-title.jsx +++ b/app/javascript/components/form/components/form-section-title.jsx @@ -4,7 +4,7 @@ import PropTypes from "prop-types"; import { useI18n } from "../../i18n"; -const FormSectionTitle = ({ formSection }) => { +function FormSectionTitle({ formSection }) { const i18n = useI18n(); const { name, expandable } = formSection; const title = i18n.getI18nStringFromObject(name); @@ -14,7 +14,7 @@ const FormSectionTitle = ({ formSection }) => { } return expandable ? title :

{title}

; -}; +} FormSectionTitle.displayName = "FormSectionTitle"; diff --git a/app/javascript/components/form/components/form-section.jsx b/app/javascript/components/form/components/form-section.jsx index a3193c4020..e8132cba3a 100644 --- a/app/javascript/components/form/components/form-section.jsx +++ b/app/javascript/components/form/components/form-section.jsx @@ -17,7 +17,7 @@ import css from "./styles.css"; import Fields from "./fields"; import FormSectionActions from "./form-section-actions"; -const FormSection = ({ formSection, showTitle = true, disableUnderline = false, formMethods, formMode }) => { +function FormSection({ formSection, showTitle = true, disableUnderline = false, formMethods, formMode }) { const { fields, check_errors: checkErrors, expandable, tooltip } = formSection; const { errors } = formMethods; const [expanded, setExpanded] = useState(formSection.expanded); @@ -73,7 +73,7 @@ const FormSection = ({ formSection, showTitle = true, disableUnderline = false, ); -}; +} FormSection.displayName = FORM_SECTION_NAME; diff --git a/app/javascript/components/form/components/input-label.jsx b/app/javascript/components/form/components/input-label.jsx index 866185a316..1a668de074 100644 --- a/app/javascript/components/form/components/input-label.jsx +++ b/app/javascript/components/form/components/input-label.jsx @@ -5,7 +5,7 @@ import isFunction from "lodash/isFunction"; import Tooltip from "../../tooltip"; -const InputLabel = ({ tooltip = "", i18nTitle = false, text = "" }) => { +function InputLabel({ tooltip = "", i18nTitle = false, text = "" }) { const renderText = isFunction(text) ? text() : text; return ( @@ -13,7 +13,7 @@ const InputLabel = ({ tooltip = "", i18nTitle = false, text = "" }) => { {renderText} ); -}; +} InputLabel.displayName = "InputLabel"; diff --git a/app/javascript/components/form/components/watched-form-section-field.jsx b/app/javascript/components/form/components/watched-form-section-field.jsx index aefd2e4158..642bbe130d 100644 --- a/app/javascript/components/form/components/watched-form-section-field.jsx +++ b/app/javascript/components/form/components/watched-form-section-field.jsx @@ -11,7 +11,7 @@ import formComponent from "../utils/form-component"; import css from "./styles.css"; -const WatchedFormSectionField = ({ checkErrors, field, formMethods, formMode, disableUnderline = false }) => { +function WatchedFormSectionField({ checkErrors, field, formMethods, formMode, disableUnderline = false }) { const { control, errors, getValues } = formMethods; const { @@ -77,7 +77,7 @@ const WatchedFormSectionField = ({ checkErrors, field, formMethods, formMode, di ) ); -}; +} WatchedFormSectionField.displayName = "WatchedFormSectionField"; diff --git a/app/javascript/components/form/fields/attachment-input.jsx b/app/javascript/components/form/fields/attachment-input.jsx index 0f9d7f60b4..d1c8ac7755 100644 --- a/app/javascript/components/form/fields/attachment-input.jsx +++ b/app/javascript/components/form/fields/attachment-input.jsx @@ -14,7 +14,7 @@ import { ATTACHMENT_TYPES } from "../../record-form/form/field-types/attachments import css from "./styles.css"; -const AttachmentInput = ({ commonInputProps, metaInputProps, formMode, formMethods }) => { +function AttachmentInput({ commonInputProps, metaInputProps, formMode, formMethods }) { const { setValue, watch, register } = formMethods; const [file, setFile] = useState({ @@ -137,7 +137,7 @@ const AttachmentInput = ({ commonInputProps, metaInputProps, formMode, formMetho
{downloadButton}
); -}; +} AttachmentInput.displayName = "AttachmentInput"; diff --git a/app/javascript/components/form/fields/checkbox-group.jsx b/app/javascript/components/form/fields/checkbox-group.jsx index aa318882ee..41338930c4 100644 --- a/app/javascript/components/form/fields/checkbox-group.jsx +++ b/app/javascript/components/form/fields/checkbox-group.jsx @@ -13,7 +13,7 @@ import InputLabel from "../components/input-label"; import Separator from "./seperator"; -const CheckboxGroup = ({ onChange, value, options, commonInputProps }) => { +function CheckboxGroup({ onChange, value, options, commonInputProps }) { const i18n = useI18n(); const [checked, setChecked] = useState([]); const { name, disabled } = commonInputProps; @@ -62,7 +62,7 @@ const CheckboxGroup = ({ onChange, value, options, commonInputProps }) => { }); return <>{renderCheckboxes()}; -}; +} CheckboxGroup.displayName = "CheckboxGroup"; diff --git a/app/javascript/components/form/fields/checkbox-input.jsx b/app/javascript/components/form/fields/checkbox-input.jsx index f3420008e6..a913a40aef 100644 --- a/app/javascript/components/form/fields/checkbox-input.jsx +++ b/app/javascript/components/form/fields/checkbox-input.jsx @@ -7,7 +7,7 @@ import { Controller } from "react-hook-form"; import CheckboxGroup from "./checkbox-group"; import css from "./styles.css"; -const CheckboxInput = ({ commonInputProps, options, metaInputProps, formMethods }) => { +function CheckboxInput({ commonInputProps, options, metaInputProps, formMethods }) { const { control } = formMethods; const { name, error, required, label, helperText, disabled } = commonInputProps; const { inlineCheckboxes } = metaInputProps; @@ -31,7 +31,7 @@ const CheckboxInput = ({ commonInputProps, options, metaInputProps, formMethods {helperText} ); -}; +} CheckboxInput.displayName = "CheckboxInput"; diff --git a/app/javascript/components/form/fields/date-input.jsx b/app/javascript/components/form/fields/date-input.jsx index ae418f2d4e..d8d181b010 100644 --- a/app/javascript/components/form/fields/date-input.jsx +++ b/app/javascript/components/form/fields/date-input.jsx @@ -14,7 +14,7 @@ import localize from "../../../libs/date-picker-localization"; import { LOCALE_KEYS } from "../../../config"; import NepaliCalendar from "../../nepali-calendar-input"; -const DateInput = ({ commonInputProps, metaInputProps = {}, formMethods }) => { +function DateInput({ commonInputProps, metaInputProps = {}, formMethods }) { const i18n = useI18n(); const { setValue, control } = formMethods; const { name, label, helperText, error, disabled, placeholder, fullWidth, required } = commonInputProps; @@ -84,7 +84,7 @@ const DateInput = ({ commonInputProps, metaInputProps = {}, formMethods }) => { /> ); -}; +} DateInput.displayName = "DateInput"; diff --git a/app/javascript/components/form/fields/dialog-trigger.jsx b/app/javascript/components/form/fields/dialog-trigger.jsx index 568625fe35..766c4a166f 100644 --- a/app/javascript/components/form/fields/dialog-trigger.jsx +++ b/app/javascript/components/form/fields/dialog-trigger.jsx @@ -5,7 +5,7 @@ import { Button, Link } from "@mui/material"; import css from "./styles.css"; -const DialogTrigger = ({ commonInputProps, metaInputProps }) => { +function DialogTrigger({ commonInputProps, metaInputProps }) { const { label, id } = commonInputProps; const { onClick } = metaInputProps; @@ -14,7 +14,7 @@ const DialogTrigger = ({ commonInputProps, metaInputProps }) => { {label} ); -}; +} DialogTrigger.displayName = "DialogTrigger"; diff --git a/app/javascript/components/form/fields/error-field.jsx b/app/javascript/components/form/fields/error-field.jsx index 517a6f56e9..a224fdc85a 100644 --- a/app/javascript/components/form/fields/error-field.jsx +++ b/app/javascript/components/form/fields/error-field.jsx @@ -6,7 +6,7 @@ import Alert from "@mui/material/Alert"; import { ERROR_FIELD_NAME } from "./constants"; -const ErrorField = ({ errorsToCheck = fromJS([]), formMethods }) => { +function ErrorField({ errorsToCheck = fromJS([]), formMethods }) { const { errors } = formMethods; if (!errorsToCheck?.size) { @@ -21,7 +21,7 @@ const ErrorField = ({ errorsToCheck = fromJS([]), formMethods }) => { {errors[error].message} )); -}; +} ErrorField.displayName = ERROR_FIELD_NAME; diff --git a/app/javascript/components/form/fields/error-field.spec.js b/app/javascript/components/form/fields/error-field.spec.js index fee9127e5e..4cf0cd3f2a 100644 --- a/app/javascript/components/form/fields/error-field.spec.js +++ b/app/javascript/components/form/fields/error-field.spec.js @@ -7,7 +7,9 @@ import ErrorField from "./error-field"; describe(" - fields/", () => { it("renders a error field if there are errors in the forms", () => { // eslint-disable-next-line react/display-name, react/no-multi-comp, react/prop-types - const Component = ({ formMethods }) => ; + function Component({ formMethods }) { + return ; + } mountedFieldComponent(, { errors: [ @@ -22,7 +24,9 @@ describe(" - fields/", () => { it("does not render the error field if the form doesn't have errors", () => { // eslint-disable-next-line react/display-name, react/no-multi-comp, react/prop-types - const Component = ({ formMethods }) => ; + function Component({ formMethods }) { + return ; + } mountedFieldComponent(); expect(document.querySelector(".MuiAlert-message")).toBeNull(); diff --git a/app/javascript/components/form/fields/hidden-input.jsx b/app/javascript/components/form/fields/hidden-input.jsx index 7cf4c67d01..9f3aad9446 100644 --- a/app/javascript/components/form/fields/hidden-input.jsx +++ b/app/javascript/components/form/fields/hidden-input.jsx @@ -2,12 +2,12 @@ import PropTypes from "prop-types"; -const HiddenInput = ({ commonInputProps, formMethods }) => { +function HiddenInput({ commonInputProps, formMethods }) { const { name } = commonInputProps; const { register } = formMethods; return ; -}; +} HiddenInput.displayName = "HiddenInput"; diff --git a/app/javascript/components/form/fields/label.jsx b/app/javascript/components/form/fields/label.jsx index d927828429..acaf981d48 100644 --- a/app/javascript/components/form/fields/label.jsx +++ b/app/javascript/components/form/fields/label.jsx @@ -2,12 +2,12 @@ import PropTypes from "prop-types"; -const Label = ({ commonInputProps }) => { +function Label({ commonInputProps }) { const { label, className } = commonInputProps; const classToApply = className || ""; return
{label}
; -}; +} Label.displayName = "Label"; diff --git a/app/javascript/components/form/fields/link-field.jsx b/app/javascript/components/form/fields/link-field.jsx index 61f82ba56b..897a92a797 100644 --- a/app/javascript/components/form/fields/link-field.jsx +++ b/app/javascript/components/form/fields/link-field.jsx @@ -9,7 +9,7 @@ import InputLabel from "../components/input-label"; import css from "./styles.css"; -const LinkField = ({ commonInputProps, metaInputProps, formMethods }) => { +function LinkField({ commonInputProps, metaInputProps, formMethods }) { const { tooltip, href } = metaInputProps; const { name, label } = commonInputProps; const { control } = formMethods; @@ -26,7 +26,7 @@ const LinkField = ({ commonInputProps, metaInputProps, formMethods }) => { ); -}; +} LinkField.displayName = "LinkField"; diff --git a/app/javascript/components/form/fields/orderable-options-field.jsx b/app/javascript/components/form/fields/orderable-options-field.jsx index 6d6d439aa5..da25213e58 100644 --- a/app/javascript/components/form/fields/orderable-options-field.jsx +++ b/app/javascript/components/form/fields/orderable-options-field.jsx @@ -17,13 +17,7 @@ import { generateIdForNewOption } from "../utils/handle-options"; import { ORDERABLE_OPTIONS_FIELD_NAME } from "./constants"; import css from "./styles.css"; -const OrderableOptionsField = ({ - commonInputProps, - metaInputProps, - showActionButtons = false, - formMethods, - formMode -}) => { +function OrderableOptionsField({ commonInputProps, metaInputProps, showActionButtons = false, formMethods, formMode }) { const i18n = useI18n(); const [disabledAddAction, setDisabledAddAction] = useState(false); @@ -112,7 +106,7 @@ const OrderableOptionsField = ({ )} ); -}; +} OrderableOptionsField.displayName = ORDERABLE_OPTIONS_FIELD_NAME; diff --git a/app/javascript/components/form/fields/radio-input.jsx b/app/javascript/components/form/fields/radio-input.jsx index 3eb5dff483..5971364eb2 100644 --- a/app/javascript/components/form/fields/radio-input.jsx +++ b/app/javascript/components/form/fields/radio-input.jsx @@ -6,7 +6,7 @@ import { Controller } from "react-hook-form"; import css from "./styles.css"; -const RadioInput = ({ commonInputProps, options, formMethods }) => { +function RadioInput({ commonInputProps, options, formMethods }) { const { helperText, error, name, label: radioGroupLabel, className, disabled } = commonInputProps; const { control } = formMethods; @@ -36,7 +36,7 @@ const RadioInput = ({ commonInputProps, options, formMethods }) => { {helperText && {helperText}} ); -}; +} RadioInput.displayName = "RadioInput"; diff --git a/app/javascript/components/form/fields/record-attachment-input.jsx b/app/javascript/components/form/fields/record-attachment-input.jsx index a61c907701..cf8d3e4e55 100644 --- a/app/javascript/components/form/fields/record-attachment-input.jsx +++ b/app/javascript/components/form/fields/record-attachment-input.jsx @@ -10,7 +10,7 @@ import { PHOTO_RECORD_FIELD } from "../constants"; import AudioArray from "./audio-array"; -const AttachmentInputArray = ({ commonInputProps, metaInputProps, formMode, formMethods }) => { +function AttachmentInputArray({ commonInputProps, metaInputProps, formMode, formMethods }) { const arrayMethods = useFieldArray({ control: formMethods.control, name: commonInputProps.name @@ -38,7 +38,7 @@ const AttachmentInputArray = ({ commonInputProps, metaInputProps, formMode, form ); -}; +} AttachmentInputArray.displayName = "AttachmentInputArray"; diff --git a/app/javascript/components/form/fields/select-input.jsx b/app/javascript/components/form/fields/select-input.jsx index d83a55a545..ed823b9e0b 100644 --- a/app/javascript/components/form/fields/select-input.jsx +++ b/app/javascript/components/form/fields/select-input.jsx @@ -22,7 +22,7 @@ import css from "./styles.css"; const filter = createFilterOptions({ limit: 50 }); -const SelectInput = ({ commonInputProps, metaInputProps, options: allOptions = [], formMethods, isShow = false }) => { +function SelectInput({ commonInputProps, metaInputProps, options: allOptions = [], formMethods, isShow = false }) { const { control, setValue, getValues } = formMethods; const { multiSelect, @@ -299,7 +299,7 @@ const SelectInput = ({ commonInputProps, metaInputProps, options: allOptions = [ )} /> ); -}; +} SelectInput.displayName = "SelectInput"; diff --git a/app/javascript/components/form/fields/seperator.jsx b/app/javascript/components/form/fields/seperator.jsx index 2d6d1b1b17..2c2221cdbd 100644 --- a/app/javascript/components/form/fields/seperator.jsx +++ b/app/javascript/components/form/fields/seperator.jsx @@ -5,7 +5,7 @@ import { Typography } from "@mui/material"; import css from "./styles.css"; -const Seperator = ({ commonInputProps }) => { +function Seperator({ commonInputProps }) { const { label, id = "" } = commonInputProps; if (!label) { @@ -17,7 +17,7 @@ const Seperator = ({ commonInputProps }) => { {label} ); -}; +} Seperator.displayName = "Seperator"; diff --git a/app/javascript/components/form/fields/switch-input.jsx b/app/javascript/components/form/fields/switch-input.jsx index 2bbe1af0da..11139957ff 100644 --- a/app/javascript/components/form/fields/switch-input.jsx +++ b/app/javascript/components/form/fields/switch-input.jsx @@ -6,7 +6,7 @@ import { Controller } from "react-hook-form"; import InputLabel from "../components/input-label"; -const SwitchInput = ({ commonInputProps, metaInputProps, formMethods }) => { +function SwitchInput({ commonInputProps, metaInputProps, formMethods }) { const { helperText, error, disabled, name, label, className, id } = commonInputProps; const { control } = formMethods; const { tooltip, selectedValue } = metaInputProps || {}; @@ -46,7 +46,7 @@ const SwitchInput = ({ commonInputProps, metaInputProps, formMethods }) => { {helperText && {helperText}} ); -}; +} SwitchInput.displayName = "SwitchInput"; diff --git a/app/javascript/components/form/fields/text-input.jsx b/app/javascript/components/form/fields/text-input.jsx index d4bceb557e..1c0aa76b2a 100644 --- a/app/javascript/components/form/fields/text-input.jsx +++ b/app/javascript/components/form/fields/text-input.jsx @@ -10,7 +10,7 @@ import InputLabel from "../components/input-label"; import css from "./styles.css"; -const TextInput = ({ commonInputProps, metaInputProps = {}, formMethods }) => { +function TextInput({ commonInputProps, metaInputProps = {}, formMethods }) { const { control } = formMethods; const { type, password, hint, tooltip, numeric, onBlur, onKeyPress, maxlength } = metaInputProps; let inputType = "text"; @@ -57,7 +57,7 @@ const TextInput = ({ commonInputProps, metaInputProps = {}, formMethods }) => { defaultValue={defaultValue || ""} /> ); -}; +} TextInput.displayName = "TextInput"; diff --git a/app/javascript/components/form/fields/toggle-input.jsx b/app/javascript/components/form/fields/toggle-input.jsx index 5ab35af160..4295becea1 100644 --- a/app/javascript/components/form/fields/toggle-input.jsx +++ b/app/javascript/components/form/fields/toggle-input.jsx @@ -4,7 +4,7 @@ import PropTypes from "prop-types"; import { Checkbox, FormControl, FormGroup, FormControlLabel, FormHelperText } from "@mui/material"; import { Controller } from "react-hook-form"; -const ToggleInput = ({ commonInputProps, formMethods }) => { +function ToggleInput({ commonInputProps, formMethods }) { const { control } = formMethods; const { helperText, error, disabled, name, label, className, id } = commonInputProps; @@ -34,7 +34,7 @@ const ToggleInput = ({ commonInputProps, formMethods }) => { {helperText && {helperText}} ); -}; +} ToggleInput.displayName = "ToggleInput"; diff --git a/app/javascript/components/i18n/provider.js b/app/javascript/components/i18n/provider.js index 8c622fa239..a47d73fe2f 100644 --- a/app/javascript/components/i18n/provider.js +++ b/app/javascript/components/i18n/provider.js @@ -18,7 +18,7 @@ import { getLocales, getLocale, getAppDirection } from "./selectors"; import useI18n from "./use-i18n"; import { getLocaleDir } from "./utils"; -const I18nProvider = ({ children }) => { +function I18nProvider({ children }) { const locale = useMemoizedSelector(state => getLocale(state)); const dir = useMemoizedSelector(state => getAppDirection(state)); const locales = useMemoizedSelector(state => getLocales(state)); @@ -77,7 +77,7 @@ const I18nProvider = ({ children }) => { {children} ); -}; +} I18nProvider.displayName = "I18nProvider"; diff --git a/app/javascript/components/i18n/provider.spec.js b/app/javascript/components/i18n/provider.spec.js index 9f7aaae192..834603a1c8 100644 --- a/app/javascript/components/i18n/provider.spec.js +++ b/app/javascript/components/i18n/provider.spec.js @@ -25,7 +25,7 @@ describe("I18nProvider - changeLocale", () => { it("should handle changeLocale method", () => { const newLocale = "fr"; - const TestComponent = () => { + function TestComponent() { const { changeLocale } = useI18n(); return ( @@ -39,7 +39,7 @@ describe("I18nProvider - changeLocale", () => { I18n Test Component ); - }; + } mountedComponent(); @@ -69,11 +69,11 @@ describe("localizeDate", () => { }); describe("I18nProvider - t", () => { - const TestComponent = () => { + function TestComponent() { const i18n = useI18n(); return

{i18n.t("test")}

; - }; + } const translations = { en: { diff --git a/app/javascript/components/incidents-from-case/components/detail/component.jsx b/app/javascript/components/incidents-from-case/components/detail/component.jsx index 90311835ea..b94016f328 100644 --- a/app/javascript/components/incidents-from-case/components/detail/component.jsx +++ b/app/javascript/components/incidents-from-case/components/detail/component.jsx @@ -14,7 +14,7 @@ import { ACTION_BUTTON_TYPES } from "../../../action-button/constants"; import { EDIT, VIEW } from "./constants"; -const Component = ({ +function Component({ css, incidentDateInterview, incidentDate, @@ -23,7 +23,7 @@ const Component = ({ handleCreateIncident, incidentAvailable, dirty = false -}) => { +}) { const i18n = useI18n(); const canViewIncidents = usePermissions(RESOURCES.incidents, READ_RECORDS); const canEditIncidents = usePermissions(RESOURCES.incidents, WRITE_RECORDS); @@ -92,7 +92,7 @@ const Component = ({ ); -}; +} Component.displayName = NAME_DETAIL; diff --git a/app/javascript/components/incidents-from-case/components/panel/component.jsx b/app/javascript/components/incidents-from-case/components/panel/component.jsx index 560ae30778..359875947b 100644 --- a/app/javascript/components/incidents-from-case/components/panel/component.jsx +++ b/app/javascript/components/incidents-from-case/components/panel/component.jsx @@ -17,7 +17,7 @@ import { getFieldByName } from "../../../record-form/selectors"; import { CP_VIOLENCE_TYPE, GBV_VIOLENCE_TYPE } from "./constants"; -const Component = ({ +function Component({ incident, incidentCaseId, incidentCaseIdDisplay, @@ -28,7 +28,7 @@ const Component = ({ recordType, handleCreateIncident, dirty = false -}) => { +}) { const i18n = useI18n(); const [expanded, setExpanded] = useState(false); const handleExpanded = () => { @@ -92,7 +92,7 @@ const Component = ({ ); -}; +} Component.displayName = NAME_PANEL; diff --git a/app/javascript/components/incidents-from-case/components/summary/component.jsx b/app/javascript/components/incidents-from-case/components/summary/component.jsx index 7a01da56bd..ad5023f458 100644 --- a/app/javascript/components/incidents-from-case/components/summary/component.jsx +++ b/app/javascript/components/incidents-from-case/components/summary/component.jsx @@ -5,7 +5,7 @@ import { Grid } from "@mui/material"; import { NAME_SUMMARY } from "../../constants"; -const Component = ({ css, incidentDate, incidentType }) => { +function Component({ css, incidentDate, incidentType }) { return ( @@ -16,7 +16,7 @@ const Component = ({ css, incidentDate, incidentType }) => { ); -}; +} Component.displayName = NAME_SUMMARY; diff --git a/app/javascript/components/incidents-from-case/container.jsx b/app/javascript/components/incidents-from-case/container.jsx index 4a1c9ee58a..2dc4268396 100644 --- a/app/javascript/components/incidents-from-case/container.jsx +++ b/app/javascript/components/incidents-from-case/container.jsx @@ -16,7 +16,7 @@ import css from "./styles.css"; import { NAME } from "./constants"; import IncidentPanel from "./components/panel"; -const Container = ({ +function Container({ handleCreateIncident, record, incidents, @@ -28,7 +28,7 @@ const Container = ({ recordType, primeroModule, dirty = false -}) => { +}) { const i18n = useI18n(); const incidentFromCaseForm = useMemoizedSelector(state => @@ -82,7 +82,7 @@ const Container = ({ {renderIncidents} ); -}; +} Container.displayName = NAME; diff --git a/app/javascript/components/index-filters/component.jsx b/app/javascript/components/index-filters/component.jsx index 6d755befb4..1fdba86bdc 100644 --- a/app/javascript/components/index-filters/component.jsx +++ b/app/javascript/components/index-filters/component.jsx @@ -28,7 +28,7 @@ import { applyFilters, setFilters } from "./action-creators"; import css from "./components/styles.css"; import TabFilters from "./components/tab-filters"; -const Component = ({ recordType, setSelectedRecords, metadata }) => { +function Component({ recordType, setSelectedRecords, metadata }) { const i18n = useI18n(); const dispatch = useDispatch(); const location = useLocation(); @@ -177,7 +177,7 @@ const Component = ({ recordType, setSelectedRecords, metadata }) => { ); -}; +} Component.displayName = "IndexFilters"; diff --git a/app/javascript/components/index-filters/components/actions.jsx b/app/javascript/components/index-filters/components/actions.jsx index e2692a9e54..7dc3cf1c2d 100644 --- a/app/javascript/components/index-filters/components/actions.jsx +++ b/app/javascript/components/index-filters/components/actions.jsx @@ -8,7 +8,7 @@ import { ACTION_BUTTON_TYPES } from "../../action-button/constants"; import css from "./styles.css"; -const Actions = ({ handleSave, handleClear }) => { +function Actions({ handleSave, handleClear }) { const showSave = handleSave && ( { ); -}; +} Actions.propTypes = { handleClear: PropTypes.func.isRequired, diff --git a/app/javascript/components/index-filters/components/filter-category.jsx b/app/javascript/components/index-filters/components/filter-category.jsx index 35b00a4e8b..d8bdb68724 100644 --- a/app/javascript/components/index-filters/components/filter-category.jsx +++ b/app/javascript/components/index-filters/components/filter-category.jsx @@ -8,7 +8,7 @@ import { FILTER_CATEGORY } from "../constants"; import css from "./styles.css"; -const FilterCategory = ({ formMethods }) => { +function FilterCategory({ formMethods }) { const i18n = useI18n(); const options = Object.values(FILTER_CATEGORY).map( elem => ({ @@ -33,7 +33,7 @@ const FilterCategory = ({ formMethods }) => { /> ); -}; +} FilterCategory.displayName = "FilterCategory"; diff --git a/app/javascript/components/index-filters/components/filter-types/checkbox-filter/component.jsx b/app/javascript/components/index-filters/components/filter-types/checkbox-filter/component.jsx index 80fe999b33..86a3a8d735 100644 --- a/app/javascript/components/index-filters/components/filter-types/checkbox-filter/component.jsx +++ b/app/javascript/components/index-filters/components/filter-types/checkbox-filter/component.jsx @@ -21,7 +21,7 @@ import { useMemoizedSelector } from "../../../../../libs"; import { NAME } from "./constants"; -const Component = ({ filter, moreSectionFilters = {}, setMoreSectionFilters, mode, reset, setReset }) => { +function Component({ filter, moreSectionFilters = {}, setMoreSectionFilters, mode, reset, setReset }) { const i18n = useI18n(); const { register, unregister, setValue, user, getValues } = useFormContext(); const valueRef = useRef(); @@ -124,7 +124,7 @@ const Component = ({ filter, moreSectionFilters = {}, setMoreSectionFilters, mod ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/index-filters/components/filter-types/chips-filter/component.jsx b/app/javascript/components/index-filters/components/filter-types/chips-filter/component.jsx index 20b44e9764..64c8a4c8ab 100644 --- a/app/javascript/components/index-filters/components/filter-types/chips-filter/component.jsx +++ b/app/javascript/components/index-filters/components/filter-types/chips-filter/component.jsx @@ -22,7 +22,7 @@ import { useMemoizedSelector } from "../../../../../libs"; import { NAME } from "./constants"; -const Component = ({ filter, moreSectionFilters = {}, setMoreSectionFilters, mode, reset, setReset }) => { +function Component({ filter, moreSectionFilters = {}, setMoreSectionFilters, mode, reset, setReset }) { const i18n = useI18n(); const { register, unregister, setValue, getValues } = useFormContext(); @@ -125,7 +125,7 @@ const Component = ({ filter, moreSectionFilters = {}, setMoreSectionFilters, mod
{renderOptions()}
); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/index-filters/components/filter-types/date-filter/component.jsx b/app/javascript/components/index-filters/components/filter-types/date-filter/component.jsx index 7a98abe04b..39f0f313c8 100644 --- a/app/javascript/components/index-filters/components/filter-types/date-filter/component.jsx +++ b/app/javascript/components/index-filters/components/filter-types/date-filter/component.jsx @@ -16,7 +16,7 @@ import DatePickers from "./date-pickers"; import { getDatesValue } from "./utils"; import { NAME } from "./constants"; -const Component = ({ filter, mode, moreSectionFilters = {}, setMoreSectionFilters, reset, setReset }) => { +function Component({ filter, mode, moreSectionFilters = {}, setMoreSectionFilters, reset, setReset }) { const i18n = useI18n(); const { register, setValue, getValues } = useFormContext(); @@ -118,7 +118,7 @@ const Component = ({ filter, mode, moreSectionFilters = {}, setMoreSectionFilter ); -}; +} Component.propTypes = { filter: PropTypes.object.isRequired, diff --git a/app/javascript/components/index-filters/components/filter-types/date-filter/field-select.jsx b/app/javascript/components/index-filters/components/filter-types/date-filter/field-select.jsx index 8a9e1318ef..d7220d6405 100644 --- a/app/javascript/components/index-filters/components/filter-types/date-filter/field-select.jsx +++ b/app/javascript/components/index-filters/components/filter-types/date-filter/field-select.jsx @@ -5,7 +5,7 @@ import { Select, MenuItem } from "@mui/material"; import css from "../styles.css"; -const Component = ({ handleSelectedField, options, selectedField }) => { +function Component({ handleSelectedField, options, selectedField }) { return (
); -}; +} Component.displayName = "FieldSelect"; diff --git a/app/javascript/components/index-filters/components/filter-types/search.jsx b/app/javascript/components/index-filters/components/filter-types/search.jsx index f055290066..d523506c6d 100644 --- a/app/javascript/components/index-filters/components/filter-types/search.jsx +++ b/app/javascript/components/index-filters/components/filter-types/search.jsx @@ -12,7 +12,7 @@ import css from "./styles.css"; import { registerInput } from "./utils"; import handleFilterChange from "./value-handlers"; -const Search = () => { +function Search() { const i18n = useI18n(); const { register, unregister, setValue } = useFormContext(); @@ -82,7 +82,7 @@ const Search = () => { ); -}; +} Search.displayName = "Search"; diff --git a/app/javascript/components/index-filters/components/filter-types/select-filter/component.jsx b/app/javascript/components/index-filters/components/filter-types/select-filter/component.jsx index da309bd8ce..8bd012f52b 100644 --- a/app/javascript/components/index-filters/components/filter-types/select-filter/component.jsx +++ b/app/javascript/components/index-filters/components/filter-types/select-filter/component.jsx @@ -25,7 +25,7 @@ import { OPTION_TYPES } from "../../../../form/constants"; import { NAME } from "./constants"; import { getOptionName } from "./utils"; -const Component = ({ +function Component({ filter, mode, moreSectionFilters = {}, @@ -33,7 +33,7 @@ const Component = ({ reset, setMoreSectionFilters, setReset -}) => { +}) { const i18n = useI18n(); const formMethods = useFormContext(); const valueRef = useRef(); @@ -201,7 +201,7 @@ const Component = ({ )} ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/index-filters/components/filter-types/switch-filter/component.jsx b/app/javascript/components/index-filters/components/filter-types/switch-filter/component.jsx index c882201d15..993f9d51cd 100644 --- a/app/javascript/components/index-filters/components/filter-types/switch-filter/component.jsx +++ b/app/javascript/components/index-filters/components/filter-types/switch-filter/component.jsx @@ -12,7 +12,7 @@ import handleFilterChange from "../value-handlers"; import { NAME } from "./constants"; -const Component = ({ filter, moreSectionFilters = {}, setMoreSectionFilters, mode, reset, setReset }) => { +function Component({ filter, moreSectionFilters = {}, setMoreSectionFilters, mode, reset, setReset }) { const i18n = useI18n(); const { register, unregister, setValue, getValues } = useFormContext(); const [inputValue, setInputValue] = useState(); @@ -82,7 +82,7 @@ const Component = ({ filter, moreSectionFilters = {}, setMoreSectionFilters, mod ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/index-filters/components/filter-types/toggle-filter/component.jsx b/app/javascript/components/index-filters/components/filter-types/toggle-filter/component.jsx index a0fe5845a2..1d04fc7ab2 100644 --- a/app/javascript/components/index-filters/components/filter-types/toggle-filter/component.jsx +++ b/app/javascript/components/index-filters/components/filter-types/toggle-filter/component.jsx @@ -22,7 +22,7 @@ import { useMemoizedSelector } from "../../../../../libs"; import { NAME } from "./constants"; -const Component = ({ filter, mode, moreSectionFilters = {}, reset, setMoreSectionFilters, setReset }) => { +function Component({ filter, mode, moreSectionFilters = {}, reset, setMoreSectionFilters, setReset }) { const i18n = useI18n(); const { register, unregister, setValue, getValues } = useFormContext(); @@ -121,7 +121,7 @@ const Component = ({ filter, mode, moreSectionFilters = {}, reset, setMoreSectio ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/index-filters/components/more-section.jsx b/app/javascript/components/index-filters/components/more-section.jsx index c85bececcb..99892f93ca 100644 --- a/app/javascript/components/index-filters/components/more-section.jsx +++ b/app/javascript/components/index-filters/components/more-section.jsx @@ -11,7 +11,7 @@ import { ACTION_BUTTON_TYPES } from "../../action-button/constants"; import css from "./styles.css"; import { NAME } from "./constants"; -const MoreSection = ({ +function MoreSection({ allAvailable, defaultFilters, more, @@ -20,7 +20,7 @@ const MoreSection = ({ recordType, setMore, setMoreSectionFilters -}) => { +}) { const moreSectionKeys = Object.keys(moreSectionFilters); const mode = { secondary: true, @@ -78,7 +78,7 @@ const MoreSection = ({ /> ); -}; +} MoreSection.displayName = NAME; diff --git a/app/javascript/components/index-filters/components/panel.jsx b/app/javascript/components/index-filters/components/panel.jsx index ddd9b28168..3cc4473ccc 100644 --- a/app/javascript/components/index-filters/components/panel.jsx +++ b/app/javascript/components/index-filters/components/panel.jsx @@ -14,7 +14,7 @@ import { useThemeHelper } from "../../../libs"; import css from "./styles.css"; -const Panel = ({ filter, getValues, selectedDefaultValueField, handleReset, moreSectionFilters = {}, children }) => { +function Panel({ filter, getValues, selectedDefaultValueField, handleReset, moreSectionFilters = {}, children }) { const { isRTL } = useThemeHelper(); const { name, field_name: fieldName } = filter; @@ -55,7 +55,7 @@ const Panel = ({ filter, getValues, selectedDefaultValueField, handleReset, more {children} ); -}; +} Panel.displayName = "Panel"; diff --git a/app/javascript/components/index-filters/components/tab-filters.jsx b/app/javascript/components/index-filters/components/tab-filters.jsx index 8149fdc39f..2a6ce92d27 100644 --- a/app/javascript/components/index-filters/components/tab-filters.jsx +++ b/app/javascript/components/index-filters/components/tab-filters.jsx @@ -16,7 +16,7 @@ import RecordFilters from "./record-filters"; import css from "./styles.css"; import FilterCategory from "./filter-category"; -const TabFilters = ({ +function TabFilters({ formMethods, handleClear, handleSave, @@ -28,7 +28,7 @@ const TabFilters = ({ setMore, setMoreSectionFilters, setReset -}) => { +}) { const filterCategory = useWatch({ control: formMethods.control, name: "filter_category" }); const filters = useMemoizedSelector(state => getFiltersByRecordType(state, recordType, filterCategory)); const hasPrimeroModuleMRM = useMemoizedSelector(state => hasPrimeroModule(state, MODULES.MRM)); @@ -71,7 +71,7 @@ const TabFilters = ({ /> ); -}; +} TabFilters.displayName = "TabFilters"; diff --git a/app/javascript/components/index-table/cell-renderers/DateCell.jsx b/app/javascript/components/index-table/cell-renderers/DateCell.jsx index a72c350bd1..b64f402333 100644 --- a/app/javascript/components/index-table/cell-renderers/DateCell.jsx +++ b/app/javascript/components/index-table/cell-renderers/DateCell.jsx @@ -8,7 +8,7 @@ import NepaliCalendar from "../../nepali-calendar-input"; import css from "./styles.css"; -const DateCell = ({ value, withTime }) => { +function DateCell({ value, withTime }) { const i18n = useI18n(); if (i18n.locale === LOCALE_KEYS.ne) { @@ -26,7 +26,7 @@ const DateCell = ({ value, withTime }) => { } return <>{i18n.l(`date.formats.${withTime ? "with_time" : "default"}`, value)}; -}; +} DateCell.displayName = "DateCell"; diff --git a/app/javascript/components/index-table/cell-renderers/ToggleIconCell.jsx b/app/javascript/components/index-table/cell-renderers/ToggleIconCell.jsx index 52d3f1daf9..4b585ccff7 100644 --- a/app/javascript/components/index-table/cell-renderers/ToggleIconCell.jsx +++ b/app/javascript/components/index-table/cell-renderers/ToggleIconCell.jsx @@ -12,7 +12,7 @@ import { FlagIcon } from "../../../images/primero-icons"; import css from "./styles.css"; -const ToggleIconCell = ({ value, icon }) => { +function ToggleIconCell({ value, icon }) { if (!value) { return null; } @@ -42,7 +42,7 @@ const ToggleIconCell = ({ value, icon }) => { ); -}; +} ToggleIconCell.displayName = "ToggleIconCell"; ToggleIconCell.propTypes = { diff --git a/app/javascript/components/index-table/component.jsx b/app/javascript/components/index-table/component.jsx index f1ec36da52..d1063d1ecd 100644 --- a/app/javascript/components/index-table/component.jsx +++ b/app/javascript/components/index-table/component.jsx @@ -9,9 +9,9 @@ import { NAME } from "./config"; import { getRecords, getLoading, getErrors } from "./selectors"; import Datatable from "./components/data-table"; -const Component = ( +function Component( props = { bypassInitialFetch: false, canSelectAll: true, showCustomToolbar: false, useReportingLocations: true } -) => { +) { const { recordType, targetRecordType, checkComplete } = props; const data = useMemoizedSelector( state => getRecords(state, recordType, checkComplete), @@ -35,7 +35,7 @@ const Component = ( loadingIndicatorType={loadingIndicatorType} /> ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/index-table/components/data-table.jsx b/app/javascript/components/index-table/components/data-table.jsx index f4c64a52b0..8af0807cd3 100644 --- a/app/javascript/components/index-table/components/data-table.jsx +++ b/app/javascript/components/index-table/components/data-table.jsx @@ -23,7 +23,7 @@ import { useApp } from "../../application"; import TableLoadingIndicator from "./table-loading-indicator"; -const Datatable = ({ +function Datatable({ arrayColumnsToString, bypassInitialFetch, canSelectAll, @@ -47,7 +47,7 @@ const Datatable = ({ title, customToolbarSelect = null, useReportingLocations -}) => { +}) { const dispatch = useDispatch(); const i18n = useI18n(); const { online } = useApp(); @@ -263,7 +263,7 @@ const Datatable = ({ /> ); -}; +} Datatable.displayName = NAME; diff --git a/app/javascript/components/index-table/custom-toolbar-select/component.jsx b/app/javascript/components/index-table/custom-toolbar-select/component.jsx index 148b5a3755..64aa1e82da 100644 --- a/app/javascript/components/index-table/custom-toolbar-select/component.jsx +++ b/app/javascript/components/index-table/custom-toolbar-select/component.jsx @@ -13,7 +13,7 @@ import css from "./styles.css"; import { NAME } from "./constants"; import { selectAllRecords } from "./utils"; -const Component = ({ +function Component({ canSelectAll = false, displayData, fetchRecords, @@ -25,7 +25,7 @@ const Component = ({ selectedRows, setSelectedRecords, totalRecords -}) => { +}) { const { online } = useApp(); const rowsPerPage = perPage > MAX_OFFLINE_ROWS_PER_PAGE && !online ? MAX_OFFLINE_ROWS_PER_PAGE : perPage; const dispatch = useDispatch(); @@ -114,7 +114,7 @@ const Component = ({ ); -}; +} Component.propTypes = { canSelectAll: PropTypes.bool, diff --git a/app/javascript/components/insights-filters/component.js b/app/javascript/components/insights-filters/component.js index b128ce6462..a25d04eb7f 100644 --- a/app/javascript/components/insights-filters/component.js +++ b/app/javascript/components/insights-filters/component.js @@ -41,7 +41,7 @@ import css from "./styles.css"; import { transformFilters } from "./utils"; import validations from "./validations"; -const Component = ({ moduleID, id, subReport, toggleControls }) => { +function Component({ moduleID, id, subReport, toggleControls }) { const isManagedReportScopeAll = useMemoizedSelector(state => getIsManagedReportScopeAll(state)); const canReadUserGroups = usePermissions(RESOURCES.user_groups, READ_RECORDS); const userGroups = useOptions({ source: OPTION_TYPES.INSIGHTS_USER_GROUP_PERMITTED }); @@ -155,7 +155,7 @@ const Component = ({ moduleID, id, subReport, toggleControls }) => { ); -}; +} Component.displayName = "InsightsFilters"; diff --git a/app/javascript/components/insights-filters/components/insight-filter-tags.jsx b/app/javascript/components/insights-filters/components/insight-filter-tags.jsx index 8df7cf04e6..1e347a35b7 100644 --- a/app/javascript/components/insights-filters/components/insight-filter-tags.jsx +++ b/app/javascript/components/insights-filters/components/insight-filter-tags.jsx @@ -17,7 +17,7 @@ import { WORKFLOW } from "../../insights/constants"; import css from "./styles.css"; -const InsightFilterTags = ({ filters = [], moduleID }) => { +function InsightFilterTags({ filters = [], moduleID }) { const i18n = useI18n(); const workflowLabels = useMemoizedSelector(state => getWorkflowLabels(state, moduleID, RECORD_TYPES.cases)); const insightFilters = useMemoizedSelector(state => selectInsightsFilters(state)); @@ -101,7 +101,7 @@ const InsightFilterTags = ({ filters = [], moduleID }) => { })} ); -}; +} InsightFilterTags.displayName = "InsightFilterTags"; diff --git a/app/javascript/components/insights-list/container.jsx b/app/javascript/components/insights-list/container.jsx index 38c98fccdf..6ad41afe75 100644 --- a/app/javascript/components/insights-list/container.jsx +++ b/app/javascript/components/insights-list/container.jsx @@ -16,7 +16,7 @@ import { fetchInsights } from "./action-creators"; import { selectInsights, selectLoading } from "./selectors"; import NAMESPACE from "./namespace"; -const Container = () => { +function Container() { const i18n = useI18n(); const dispatch = useDispatch(); const insights = useMemoizedSelector(state => selectInsights(state)); @@ -60,7 +60,7 @@ const Container = () => { ); -}; +} Container.displayName = "InsightsList"; diff --git a/app/javascript/components/insights-sub-report/components/exporter/exporter.jsx b/app/javascript/components/insights-sub-report/components/exporter/exporter.jsx index 37f8466115..0f1a6fd8ca 100644 --- a/app/javascript/components/insights-sub-report/components/exporter/exporter.jsx +++ b/app/javascript/components/insights-sub-report/components/exporter/exporter.jsx @@ -10,7 +10,7 @@ import css from "./styles.css"; import { downloadFile, tableToCsv } from "./utils"; import { DEFAULT_FILE_NAME, NAME } from "./constants"; -const Exporter = ({ includesGraph = false }) => { +function Exporter({ includesGraph = false }) { const handleClickTableExporter = () => { const csvBlob = new Blob([tableToCsv("table tr")], { type: "text/csv" }); @@ -55,7 +55,7 @@ const Exporter = ({ includesGraph = false }) => { /> ); -}; +} Exporter.displayName = NAME; diff --git a/app/javascript/components/insights-sub-report/components/insights-table-header-sub-items/component.jsx b/app/javascript/components/insights-sub-report/components/insights-table-header-sub-items/component.jsx index 54400ca338..a1101f25d9 100644 --- a/app/javascript/components/insights-sub-report/components/insights-table-header-sub-items/component.jsx +++ b/app/javascript/components/insights-sub-report/components/insights-table-header-sub-items/component.jsx @@ -11,7 +11,7 @@ import { useI18n } from "../../../i18n"; import css from "./styles.css"; import { NAME } from "./constants"; -const InsightsTableHeaderSubItems = ({ addEmptyCell = true, groupedSubItemcolumns }) => { +function InsightsTableHeaderSubItems({ addEmptyCell = true, groupedSubItemcolumns }) { const i18n = useI18n(); if (isEmpty(groupedSubItemcolumns)) { @@ -41,7 +41,7 @@ const InsightsTableHeaderSubItems = ({ addEmptyCell = true, groupedSubItemcolumn )} ); -}; +} InsightsTableHeaderSubItems.displayName = NAME; diff --git a/app/javascript/components/insights-sub-report/components/insights-table-header/component.jsx b/app/javascript/components/insights-sub-report/components/insights-table-header/component.jsx index 30639e9245..a10355db88 100644 --- a/app/javascript/components/insights-sub-report/components/insights-table-header/component.jsx +++ b/app/javascript/components/insights-sub-report/components/insights-table-header/component.jsx @@ -11,7 +11,7 @@ import { buildGroupedSubItemColumns } from "../../utils"; import css from "./styles.css"; import { NAME } from "./constants"; -const InsightsTableHeader = ({ addEmptyCell = true, columns, subColumnItemsSize }) => { +function InsightsTableHeader({ addEmptyCell = true, columns, subColumnItemsSize }) { const groupedSubcolumns = columns.reduce((acc, column) => ({ ...acc, [column.label]: column.items }), {}); const groupedSubItemcolumns = buildGroupedSubItemColumns(columns); const classesEmptyCell = clsx({ [css.emptyCell]: Boolean(subColumnItemsSize) }); @@ -47,7 +47,7 @@ const InsightsTableHeader = ({ addEmptyCell = true, columns, subColumnItemsSize ); -}; +} InsightsTableHeader.displayName = NAME; diff --git a/app/javascript/components/insights-sub-report/container.jsx b/app/javascript/components/insights-sub-report/container.jsx index a46b2c1d00..e63d85b43d 100644 --- a/app/javascript/components/insights-sub-report/container.jsx +++ b/app/javascript/components/insights-sub-report/container.jsx @@ -37,7 +37,7 @@ import css from "./styles.css"; import { setSubReport } from "./action-creators"; import getSubcolumnItems from "./utils/get-subcolumn-items"; -const Component = () => { +function Component() { const { id, subReport } = useParams(); const i18n = useI18n(); const dispatch = useDispatch(); @@ -242,7 +242,7 @@ const Component = () => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/insights/component.jsx b/app/javascript/components/insights/component.jsx index b4eb02309c..9faa013ca4 100644 --- a/app/javascript/components/insights/component.jsx +++ b/app/javascript/components/insights/component.jsx @@ -27,7 +27,7 @@ import { INSIGHTS_CONFIG, NAME, INSIGHTS_EXPORTER_DIALOG, MANAGED_REPORTS, REPOR import css from "./styles.css"; import InsightsExporter from "./components/insights-exporter"; -const Component = ({ routes }) => { +function Component({ routes }) { const { id, moduleID } = useParams(); const i18n = useI18n(); const { pathname } = useLocation(); @@ -116,7 +116,7 @@ const Component = ({ routes }) => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/insights/components/exporter.jsx b/app/javascript/components/insights/components/exporter.jsx index faec8ad430..d63cc54f17 100644 --- a/app/javascript/components/insights/components/exporter.jsx +++ b/app/javascript/components/insights/components/exporter.jsx @@ -10,7 +10,7 @@ import css from "./styles.css"; import { downloadFile, tableToCsv } from "./utils"; import { DEFAULT_FILE_NAME, NAME } from "./constants"; -const Exporter = ({ includesGraph = false }) => { +function Exporter({ includesGraph = false }) { const handleClickTableExporter = () => { const csvBlob = new Blob([tableToCsv("table tr")], { type: "text/csv" }); @@ -55,7 +55,7 @@ const Exporter = ({ includesGraph = false }) => { /> ); -}; +} Exporter.displayName = NAME; diff --git a/app/javascript/components/insights/components/insights-exporter/component.jsx b/app/javascript/components/insights/components/insights-exporter/component.jsx index ac9c5f8a1d..f074bd52c5 100644 --- a/app/javascript/components/insights/components/insights-exporter/component.jsx +++ b/app/javascript/components/insights/components/insights-exporter/component.jsx @@ -18,7 +18,7 @@ import { transformFilters } from "../../../insights-filters/utils"; import { NAME, FORM_ID, EXPORTED_URL, EXPORT_ALL_SUBREPORTS } from "./constants"; import { form } from "./form"; -const Component = ({ close, i18n, open, pending, setPending }) => { +function Component({ close, i18n, open, pending, setPending }) { const dispatch = useDispatch(); const { id } = useParams(); const dialogPending = typeof pending === "object" ? pending.get("pending") : pending; @@ -68,7 +68,7 @@ const Component = ({ close, i18n, open, pending, setPending }) => {
); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/internal-alert/component.jsx b/app/javascript/components/internal-alert/component.jsx index 18b200ca09..599c712b2b 100644 --- a/app/javascript/components/internal-alert/component.jsx +++ b/app/javascript/components/internal-alert/component.jsx @@ -18,7 +18,7 @@ import InternalAlertItem from "./components/item"; import { NAME, SEVERITY } from "./constants"; import css from "./styles.css"; -const Component = ({ title, items = fromJS([]), severity = "info", customIcon }) => { +function Component({ title, items = fromJS([]), severity = "info", customIcon }) { const i18n = useI18n(); const accordionClasses = clsx(css.alert, css[severity]); @@ -90,7 +90,7 @@ const Component = ({ title, items = fromJS([]), severity = "info", customIcon }) {renderItems()} ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/internal-alert/components/dismiss-button/component.jsx b/app/javascript/components/internal-alert/components/dismiss-button/component.jsx index 7e338855e0..4a4e48917e 100644 --- a/app/javascript/components/internal-alert/components/dismiss-button/component.jsx +++ b/app/javascript/components/internal-alert/components/dismiss-button/component.jsx @@ -4,7 +4,7 @@ import PropTypes from "prop-types"; import css from "./styles.css"; -const Component = ({ handler }) => { +function Component({ handler }) { const handlerWrapper = event => { event.stopPropagation(); handler(); @@ -15,7 +15,7 @@ const Component = ({ handler }) => { ); -}; +} Component.displayName = "InternalAlertDismissButton"; Component.propTypes = { diff --git a/app/javascript/components/internal-alert/components/item/component.jsx b/app/javascript/components/internal-alert/components/item/component.jsx index ed347a2715..ee75f64f51 100644 --- a/app/javascript/components/internal-alert/components/item/component.jsx +++ b/app/javascript/components/internal-alert/components/item/component.jsx @@ -4,14 +4,14 @@ import InternalAlertDismissButton from "../dismiss-button"; import css from "./styles.css"; -const Component = ({ item }) => { +function Component({ item }) { return (
{item.get("message")} {item.get("onDismiss") && InternalAlertDismissButton({ handler: item.get("onDismiss") })}
); -}; +} Component.displayName = "InternalAlertItem"; Component.propTypes = { diff --git a/app/javascript/components/jewel/component.jsx b/app/javascript/components/jewel/component.jsx index b2df0181c1..54f4c1a687 100644 --- a/app/javascript/components/jewel/component.jsx +++ b/app/javascript/components/jewel/component.jsx @@ -6,7 +6,7 @@ import { Brightness1 as Circle } from "@mui/icons-material"; import css from "./styles.css"; -const Jewel = ({ value, isForm, isList, isError }) => { +function Jewel({ value, isForm, isList, isError }) { const classes = clsx(css.circleForm, css.error); if (isList) { @@ -38,7 +38,7 @@ const Jewel = ({ value, isForm, isList, isError }) => { )} ); -}; +} Jewel.displayName = "Jewel"; diff --git a/app/javascript/components/key-performance-indicators/component.jsx b/app/javascript/components/key-performance-indicators/component.jsx index 9e9a7cd159..21878e6ca7 100644 --- a/app/javascript/components/key-performance-indicators/component.jsx +++ b/app/javascript/components/key-performance-indicators/component.jsx @@ -25,7 +25,7 @@ import ClientSatisfactionRate from "./components/client-satisfaction-rate"; import SupervisorToCaseworkerRatio from "./components/supervisor-to-caseworker-ratio"; import CaseLoad from "./components/case-load"; -const KeyPerformanceIndicators = () => { +function KeyPerformanceIndicators() { const i18n = useI18n(); const commonDateRanges = CommonDateRanges.from(new Date(), i18n); @@ -184,7 +184,7 @@ const KeyPerformanceIndicators = () => { ); -}; +} KeyPerformanceIndicators.displayName = "KeyPerformanceIndicators"; diff --git a/app/javascript/components/key-performance-indicators/components/as-key-performance-indicator/component.spec.js b/app/javascript/components/key-performance-indicators/components/as-key-performance-indicator/component.spec.js index 60820b08fe..49eb11c796 100644 --- a/app/javascript/components/key-performance-indicators/components/as-key-performance-indicator/component.spec.js +++ b/app/javascript/components/key-performance-indicators/components/as-key-performance-indicator/component.spec.js @@ -10,8 +10,11 @@ import asKeyPerformanceIndicator from "./component"; describe("asKeyPerformanceIndicator()", () => { const identifier = "test"; + // eslint-disable-next-line react/display-name - const Component = () =>

Component

; + function Component() { + return

Component

; + } const permittedAction = "test"; const KPI = asKeyPerformanceIndicator(identifier, {}, permittedAction)(Component); diff --git a/app/javascript/components/key-performance-indicators/components/assessment-status/component.jsx b/app/javascript/components/key-performance-indicators/components/assessment-status/component.jsx index 442ace974b..88dbf35add 100644 --- a/app/javascript/components/key-performance-indicators/components/assessment-status/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/assessment-status/component.jsx @@ -7,7 +7,7 @@ import StackedPercentageBar from "../stacked-percentage-bar"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); return ( @@ -20,7 +20,7 @@ const Component = ({ data, identifier }) => { ]} /> ); -}; +} Component.displayName = "AssessmentStatus"; diff --git a/app/javascript/components/key-performance-indicators/components/average-followup-meetings-per-case/component.jsx b/app/javascript/components/key-performance-indicators/components/average-followup-meetings-per-case/component.jsx index ded80aa19e..553f98b2e3 100644 --- a/app/javascript/components/key-performance-indicators/components/average-followup-meetings-per-case/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/average-followup-meetings-per-case/component.jsx @@ -7,7 +7,7 @@ import SingleAggregateMetric from "../single-aggregate-metric"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); return ( @@ -16,7 +16,7 @@ const Component = ({ data, identifier }) => { label={i18n.t(`key_performance_indicators.${identifier}.label`)} /> ); -}; +} Component.displayName = "AverageFollowupMeetingsPerCase"; diff --git a/app/javascript/components/key-performance-indicators/components/average-referrals/component.jsx b/app/javascript/components/key-performance-indicators/components/average-referrals/component.jsx index ee5e4550b8..319d43cdef 100644 --- a/app/javascript/components/key-performance-indicators/components/average-referrals/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/average-referrals/component.jsx @@ -7,7 +7,7 @@ import SingleAggregateMetric from "../single-aggregate-metric"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); return ( @@ -16,7 +16,7 @@ const Component = ({ data, identifier }) => { label={i18n.t(`key_performance_indicators.${identifier}.label`)} /> ); -}; +} Component.displayName = "AverageReferrals"; diff --git a/app/javascript/components/key-performance-indicators/components/case-closure-rate/component.jsx b/app/javascript/components/key-performance-indicators/components/case-closure-rate/component.jsx index bba12e9127..902dde598d 100644 --- a/app/javascript/components/key-performance-indicators/components/case-closure-rate/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/case-closure-rate/component.jsx @@ -7,7 +7,7 @@ import KpiTable from "../kpi-table"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const columns = [ @@ -31,7 +31,7 @@ const Component = ({ data, identifier }) => { const rows = data.get("data").map(row => columns.map(column => row.get(column.name))); return ; -}; +} Component.displayName = "CaseClosureRate"; diff --git a/app/javascript/components/key-performance-indicators/components/case-load/component.jsx b/app/javascript/components/key-performance-indicators/components/case-load/component.jsx index 7d1b950731..c5de455c2e 100644 --- a/app/javascript/components/key-performance-indicators/components/case-load/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/case-load/component.jsx @@ -7,7 +7,7 @@ import KpiTable from "../kpi-table"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const columns = [ @@ -26,7 +26,7 @@ const Component = ({ data, identifier }) => { const rows = data.get("data").map(row => columns.map(column => column.transform(row.get(column.name)))); return ; -}; +} Component.displayName = "CaseLoad"; diff --git a/app/javascript/components/key-performance-indicators/components/client-satisfaction-rate/component.jsx b/app/javascript/components/key-performance-indicators/components/client-satisfaction-rate/component.jsx index 3dba84b674..99193dce97 100644 --- a/app/javascript/components/key-performance-indicators/components/client-satisfaction-rate/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/client-satisfaction-rate/component.jsx @@ -9,7 +9,7 @@ import { ACTIONS } from "../../../permissions"; import css from "./styles.css"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const rate = data.get("data").get("satisfaction_rate"); @@ -27,7 +27,7 @@ const Component = ({ data, identifier }) => { ]} /> ); -}; +} Component.displayName = "ClientSatisfactionRate"; diff --git a/app/javascript/components/key-performance-indicators/components/completed-case-action-plan/component.jsx b/app/javascript/components/key-performance-indicators/components/completed-case-action-plan/component.jsx index 4bac86490f..fc2eee7901 100644 --- a/app/javascript/components/key-performance-indicators/components/completed-case-action-plan/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/completed-case-action-plan/component.jsx @@ -7,7 +7,7 @@ import StackedPercentageBar from "../stacked-percentage-bar"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); return ( @@ -20,7 +20,7 @@ const Component = ({ data, identifier }) => { ]} /> ); -}; +} Component.displayName = "CompletedCaseActionPlan"; diff --git a/app/javascript/components/key-performance-indicators/components/completed-case-safety-plan/component.jsx b/app/javascript/components/key-performance-indicators/components/completed-case-safety-plan/component.jsx index 6024e54a5f..052e7f0b63 100644 --- a/app/javascript/components/key-performance-indicators/components/completed-case-safety-plan/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/completed-case-safety-plan/component.jsx @@ -7,7 +7,7 @@ import StackedPercentageBar from "../stacked-percentage-bar"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); return ( @@ -20,7 +20,7 @@ const Component = ({ data, identifier }) => { ]} /> ); -}; +} Component.displayName = "CompletedCaseSafetyPlan"; diff --git a/app/javascript/components/key-performance-indicators/components/completed-supervisor-approved-case-action-plan/component.jsx b/app/javascript/components/key-performance-indicators/components/completed-supervisor-approved-case-action-plan/component.jsx index 5fbcb690d9..d1d6ac6d84 100644 --- a/app/javascript/components/key-performance-indicators/components/completed-supervisor-approved-case-action-plan/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/completed-supervisor-approved-case-action-plan/component.jsx @@ -7,7 +7,7 @@ import StackedPercentageBar from "../stacked-percentage-bar"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); return ( @@ -20,7 +20,7 @@ const Component = ({ data, identifier }) => { ]} /> ); -}; +} Component.displayName = "CompletedSupervisorApprovedCaseActionPlan"; diff --git a/app/javascript/components/key-performance-indicators/components/date-range-dialog/component.jsx b/app/javascript/components/key-performance-indicators/components/date-range-dialog/component.jsx index 7ab8193a10..87c98b0911 100644 --- a/app/javascript/components/key-performance-indicators/components/date-range-dialog/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/date-range-dialog/component.jsx @@ -17,7 +17,7 @@ import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns"; import { useI18n } from "../../../i18n"; import { DATE_FORMAT } from "../../../../config"; -const Component = ({ open, onClose, currentRange, setRange }) => { +function Component({ open, onClose, currentRange, setRange }) { const i18n = useI18n(); const [from, setFrom] = useState(currentRange.from); const [to, setTo] = useState(currentRange.to); @@ -68,7 +68,7 @@ const Component = ({ open, onClose, currentRange, setRange }) => { ); -}; +} Component.displayName = "DateRangeDialog"; diff --git a/app/javascript/components/key-performance-indicators/components/date-range-select/component.jsx b/app/javascript/components/key-performance-indicators/components/date-range-select/component.jsx index a10aad7a4d..a1b435e436 100644 --- a/app/javascript/components/key-performance-indicators/components/date-range-select/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/date-range-select/component.jsx @@ -9,7 +9,7 @@ import DateRange from "../../utils/date-range"; import { CUSTOM_RANGE } from "./constants"; -const Component = ({ ranges, selectedRange, withCustomRange, setSelectedRange, disabled, i18n }) => { +function Component({ ranges, selectedRange, withCustomRange, setSelectedRange, disabled, i18n }) { const [showRangePicker, setShowRangePicker] = useState(false); const [customRange, setCustomRange] = useState( @@ -88,7 +88,7 @@ const Component = ({ ranges, selectedRange, withCustomRange, setSelectedRange, d /> ); -}; +} Component.displayName = "DateRangeSelect"; diff --git a/app/javascript/components/key-performance-indicators/components/goal-progress-per-need/component.jsx b/app/javascript/components/key-performance-indicators/components/goal-progress-per-need/component.jsx index ec7459264a..71171b62b2 100644 --- a/app/javascript/components/key-performance-indicators/components/goal-progress-per-need/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/goal-progress-per-need/component.jsx @@ -8,7 +8,7 @@ import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import PercentageCell from "../percentage-cell"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const columns = [ { @@ -27,7 +27,7 @@ const Component = ({ data, identifier }) => { const rows = data.get("data").map(row => columns.map(column => row.get(column.name))); return ; -}; +} Component.displayName = "GoalProgressPerNeed"; diff --git a/app/javascript/components/key-performance-indicators/components/kpi-table/component.jsx b/app/javascript/components/key-performance-indicators/components/kpi-table/component.jsx index 7ad70edb8c..309ee0d5de 100644 --- a/app/javascript/components/key-performance-indicators/components/kpi-table/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/kpi-table/component.jsx @@ -7,7 +7,9 @@ import { DashboardTable } from "../../../dashboard"; // Simple wrapper over DashboardTable to insulate Kpis from future // changes to serve the Dashbaord needs. Can be migrated to MUIDataTable // at some point when the needs differ enough. -const Component = ({ columns, data }) => ; +function Component({ columns, data }) { + return ; +} Component.displayName = "KpiTable"; diff --git a/app/javascript/components/key-performance-indicators/components/number-of-cases/component.jsx b/app/javascript/components/key-performance-indicators/components/number-of-cases/component.jsx index 67645ed902..d8449c37b0 100644 --- a/app/javascript/components/key-performance-indicators/components/number-of-cases/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/number-of-cases/component.jsx @@ -7,7 +7,7 @@ import KpiTable from "../kpi-table"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const columns = [ @@ -31,7 +31,7 @@ const Component = ({ data, identifier }) => { const rows = data.get("data").map(row => columns.map(column => row.get(column.name))); return ; -}; +} Component.displayName = "NumberOfCases"; diff --git a/app/javascript/components/key-performance-indicators/components/number-of-incidents/component.jsx b/app/javascript/components/key-performance-indicators/components/number-of-incidents/component.jsx index 40f1f1be16..3c0b0d5b44 100644 --- a/app/javascript/components/key-performance-indicators/components/number-of-incidents/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/number-of-incidents/component.jsx @@ -7,7 +7,7 @@ import KpiTable from "../kpi-table"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const columns = [ { @@ -30,7 +30,7 @@ const Component = ({ data, identifier }) => { const rows = data.get("data").map(row => columns.map(column => row.get(column.name))); return ; -}; +} Component.displayName = "NumberOfIncidents"; diff --git a/app/javascript/components/key-performance-indicators/components/percentage-cell/component.jsx b/app/javascript/components/key-performance-indicators/components/percentage-cell/component.jsx index 0dfed2ac3f..edfa0b46a1 100644 --- a/app/javascript/components/key-performance-indicators/components/percentage-cell/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/percentage-cell/component.jsx @@ -2,9 +2,9 @@ import TablePercentageBar from "../table-percentage-bar"; -const Component = value => { +function Component(value) { return ; -}; +} Component.displayName = "PercentageCell"; diff --git a/app/javascript/components/key-performance-indicators/components/reporting-delay/component.jsx b/app/javascript/components/key-performance-indicators/components/reporting-delay/component.jsx index a15bb1d7bc..0ae0d93759 100644 --- a/app/javascript/components/key-performance-indicators/components/reporting-delay/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/reporting-delay/component.jsx @@ -8,7 +8,7 @@ import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import PercentageCell from "../percentage-cell"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const columns = [ @@ -38,7 +38,7 @@ const Component = ({ data, identifier }) => { }); return ; -}; +} Component.displayName = "ReportingDelay"; diff --git a/app/javascript/components/key-performance-indicators/components/services-provided/component.jsx b/app/javascript/components/key-performance-indicators/components/services-provided/component.jsx index 589fe4cf5b..993e3eedca 100644 --- a/app/javascript/components/key-performance-indicators/components/services-provided/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/services-provided/component.jsx @@ -7,7 +7,7 @@ import KpiTable from "../kpi-table"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const toColumn = name => ({ @@ -33,7 +33,7 @@ const Component = ({ data, identifier }) => { .map(row => columns.map(column => row.get(column.name))); return ; -}; +} Component.displayName = "ServicesProvided"; diff --git a/app/javascript/components/key-performance-indicators/components/single-aggregate-metric/component.jsx b/app/javascript/components/key-performance-indicators/components/single-aggregate-metric/component.jsx index 46d5e9ff23..c8c8ca3b40 100644 --- a/app/javascript/components/key-performance-indicators/components/single-aggregate-metric/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/single-aggregate-metric/component.jsx @@ -4,7 +4,7 @@ import PropTypes from "prop-types"; import css from "./styles.css"; -const Component = ({ value, label }) => { +function Component({ value, label }) { const shouldTrucate = value?.toFixed && value.toString().indexOf(".") > -1; const displayValue = shouldTrucate ? value.toFixed(1) : value; @@ -14,7 +14,7 @@ const Component = ({ value, label }) => { {label} ); -}; +} Component.displayName = "SingleAggregateMetric"; diff --git a/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/component.jsx b/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/component.jsx index 9f6d062971..b9dd42ee82 100644 --- a/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/component.jsx @@ -6,7 +6,7 @@ import css from "./styles.css"; import StackedPercentageBarMeter from "./components/stacked-percentage-bar-meter"; import StackedPercentageBarLabel from "./components/stacked-percentage-bar-label"; -const Component = ({ percentages, className }) => { +function Component({ percentages, className }) { if (percentages.length > 2) throw new Error("StackedPercentageBar components only support a max of 2 percentages"); const percentagedToRender = percentages.filter(descriptor => descriptor.percentage > 0); @@ -36,7 +36,7 @@ const Component = ({ percentages, className }) => { ); -}; +} Component.displayName = "StackedPercentageBar"; diff --git a/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/components/stacked-percentage-bar-label/component.jsx b/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/components/stacked-percentage-bar-label/component.jsx index 3cf8593be7..92831f5fa7 100644 --- a/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/components/stacked-percentage-bar-label/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/components/stacked-percentage-bar-label/component.jsx @@ -2,7 +2,7 @@ import PropTypes from "prop-types"; -const Component = ({ realPercent, label, index, css }) => { +function Component({ realPercent, label, index, css }) { const percentage = realPercent * 100; const style = { width: percentage > 0 ? `${percentage}%` : "auto" }; @@ -14,7 +14,7 @@ const Component = ({ realPercent, label, index, css }) => {
{label}
); -}; +} Component.displayName = "StackedPercentageBarLabel"; diff --git a/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/components/stacked-percentage-bar-meter/component.jsx b/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/components/stacked-percentage-bar-meter/component.jsx index 30f4cc1102..5250ae6fc7 100644 --- a/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/components/stacked-percentage-bar-meter/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/stacked-percentage-bar/components/stacked-percentage-bar-meter/component.jsx @@ -2,12 +2,12 @@ import PropTypes from "prop-types"; -const Component = ({ realPercent, index, css }) => { +function Component({ realPercent, index, css }) { const percentage = realPercent * 100; const style = { width: `${percentage}%` }; return
; -}; +} Component.displayName = "StackedPercentageBarMeter"; diff --git a/app/javascript/components/key-performance-indicators/components/supervisor-to-caseworker-ratio/component.jsx b/app/javascript/components/key-performance-indicators/components/supervisor-to-caseworker-ratio/component.jsx index abdd35e410..18b2f4bfca 100644 --- a/app/javascript/components/key-performance-indicators/components/supervisor-to-caseworker-ratio/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/supervisor-to-caseworker-ratio/component.jsx @@ -7,7 +7,7 @@ import SingleAggregateMetric from "../single-aggregate-metric"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const supervisors = data.get("data").get("supervisors"); const caseWorkers = data.get("data").get("case_workers"); @@ -18,7 +18,7 @@ const Component = ({ data, identifier }) => { label={i18n.t(`key_performance_indicators.${identifier}.label`)} /> ); -}; +} Component.displayName = "SupervisorToCaseworkerRatio"; diff --git a/app/javascript/components/key-performance-indicators/components/table-percentage-bar/component.jsx b/app/javascript/components/key-performance-indicators/components/table-percentage-bar/component.jsx index a1b96061cd..2fb2aec9f2 100644 --- a/app/javascript/components/key-performance-indicators/components/table-percentage-bar/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/table-percentage-bar/component.jsx @@ -4,7 +4,7 @@ import PropTypes from "prop-types"; import css from "./styles.css"; -const Component = ({ percentage, className }) => { +function Component({ percentage, className }) { const percentageValue = percentage * 100; const isSmall = percentage < 0.1; @@ -22,7 +22,7 @@ const Component = ({ percentage, className }) => {
); -}; +} Component.displayName = "TablePercentageBar"; diff --git a/app/javascript/components/key-performance-indicators/components/time-from-case-open-to-case-close/component.jsx b/app/javascript/components/key-performance-indicators/components/time-from-case-open-to-case-close/component.jsx index 96058de4e3..dfed5bf702 100644 --- a/app/javascript/components/key-performance-indicators/components/time-from-case-open-to-case-close/component.jsx +++ b/app/javascript/components/key-performance-indicators/components/time-from-case-open-to-case-close/component.jsx @@ -7,7 +7,7 @@ import KpiTable from "../kpi-table"; import asKeyPerformanceIndicator from "../as-key-performance-indicator"; import { ACTIONS } from "../../../permissions"; -const Component = ({ data, identifier }) => { +function Component({ data, identifier }) { const i18n = useI18n(); const columns = [ @@ -26,7 +26,7 @@ const Component = ({ data, identifier }) => { const rows = data.get("data").map(row => columns.map(column => column.transform(row.get(column.name)))); return ; -}; +} Component.displayName = "TimeFromCaseOpenToClose"; diff --git a/app/javascript/components/layouts/component.jsx b/app/javascript/components/layouts/component.jsx index fe63f0c492..dc0e0885c8 100644 --- a/app/javascript/components/layouts/component.jsx +++ b/app/javascript/components/layouts/component.jsx @@ -4,13 +4,13 @@ import PropTypes from "prop-types"; import CustomSnackbarProvider from "../custom-snackbar-provider"; -const Component = ({ layout: Layout, children }) => { +function Component({ layout: Layout, children }) { return ( {children} ); -}; +} Component.propTypes = { children: PropTypes.node, diff --git a/app/javascript/components/layouts/components/app-layout/component.jsx b/app/javascript/components/layouts/components/app-layout/component.jsx index 780b3e6e8c..103ea9597a 100644 --- a/app/javascript/components/layouts/components/app-layout/component.jsx +++ b/app/javascript/components/layouts/components/app-layout/component.jsx @@ -18,7 +18,7 @@ import usePushNotifications from "../../../push-notifications-toggle/use-push-no import { NAME } from "./constants"; import css from "./styles.css"; -const Component = ({ children }) => { +function Component({ children }) { const { demo } = useApp(); usePushNotifications(); @@ -48,7 +48,7 @@ const Component = ({ children }) => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/layouts/components/empty-layout/component.jsx b/app/javascript/components/layouts/components/empty-layout/component.jsx index 2d32875be6..32c10de23a 100644 --- a/app/javascript/components/layouts/components/empty-layout/component.jsx +++ b/app/javascript/components/layouts/components/empty-layout/component.jsx @@ -7,7 +7,7 @@ import { useApp } from "../../../application"; import DemoIndicator from "../../../demo-indicator"; import SessionTimeoutDialog from "../../../session-timeout-dialog"; -const Component = ({ children }) => { +function Component({ children }) { const { demo } = useApp(); return ( @@ -17,7 +17,7 @@ const Component = ({ children }) => { ); -}; +} Component.displayName = "EmptyLayout"; diff --git a/app/javascript/components/layouts/components/login-layout/component.jsx b/app/javascript/components/layouts/components/login-layout/component.jsx index ca3ae0d68e..743c5dd45f 100644 --- a/app/javascript/components/layouts/components/login-layout/component.jsx +++ b/app/javascript/components/layouts/components/login-layout/component.jsx @@ -16,7 +16,7 @@ import LoginLayoutFooter from "../login-layout-footer"; import { NAME } from "./constants"; import css from "./styles.css"; -const Component = ({ children }) => { +function Component({ children }) { const mobileDisplay = useMediaQuery(theme => theme.breakpoints.down("sm")); const { demo, hasLoginLogo, useContainedNavStyle } = useApp(); const hasLogos = useMemoizedSelector(state => hasAgencyLogos(state)); @@ -55,7 +55,7 @@ const Component = ({ children }) => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/lightbox/component.jsx b/app/javascript/components/lightbox/component.jsx index cdbd8ba3e5..6d049fab6e 100644 --- a/app/javascript/components/lightbox/component.jsx +++ b/app/javascript/components/lightbox/component.jsx @@ -7,7 +7,7 @@ import CloseIcon from "@mui/icons-material/Close"; import css from "./styles.css"; -const Component = ({ trigger, image }) => { +function Component({ trigger, image }) { const [open, setOpen] = useState(false); const handleClose = () => { @@ -31,7 +31,7 @@ const Component = ({ trigger, image }) => { )} ); -}; +} Component.displayName = "Lightbox"; diff --git a/app/javascript/components/list-icon/component.jsx b/app/javascript/components/list-icon/component.jsx index 731457d2f5..6913a6e862 100644 --- a/app/javascript/components/list-icon/component.jsx +++ b/app/javascript/components/list-icon/component.jsx @@ -30,7 +30,7 @@ import { RegistryRecordIcon } from "../../images/primero-icons"; -const ListIcon = ({ icon }) => { +function ListIcon({ icon }) { switch (icon) { case "home": return ; @@ -83,7 +83,7 @@ const ListIcon = ({ icon }) => { default: return null; } -}; +} ListIcon.displayName = "ListIcon"; diff --git a/app/javascript/components/loading-indicator/components/empty-state.jsx b/app/javascript/components/loading-indicator/components/empty-state.jsx index afb5e50054..03b138043f 100644 --- a/app/javascript/components/loading-indicator/components/empty-state.jsx +++ b/app/javascript/components/loading-indicator/components/empty-state.jsx @@ -6,7 +6,7 @@ import { useI18n } from "../../i18n"; import ListIcon from "../../list-icon"; import css from "../styles.css"; -const EmptyState = ({ emptyMessage, type }) => { +function EmptyState({ emptyMessage, type }) { const i18n = useI18n(); return ( @@ -17,7 +17,7 @@ const EmptyState = ({ emptyMessage, type }) => { ); -}; +} EmptyState.displayName = "EmptyState"; diff --git a/app/javascript/components/loading-indicator/loading.jsx b/app/javascript/components/loading-indicator/loading.jsx index c24662c49b..ee5beffd07 100644 --- a/app/javascript/components/loading-indicator/loading.jsx +++ b/app/javascript/components/loading-indicator/loading.jsx @@ -5,7 +5,7 @@ import PropTypes from "prop-types"; import { NAME } from "./constants"; -const Component = ({ loadingIndicator, loading, classes }) => { +function Component({ loadingIndicator, loading, classes }) { const transitionDelayStyles = { transitionDelay: loading ? "800ms" : "0ms" }; @@ -19,7 +19,7 @@ const Component = ({ loadingIndicator, loading, classes }) => { ) ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/login-dialog/component.jsx b/app/javascript/components/login-dialog/component.jsx index 245936be63..fe2cb32bf5 100644 --- a/app/javascript/components/login-dialog/component.jsx +++ b/app/javascript/components/login-dialog/component.jsx @@ -9,7 +9,7 @@ import utils from "../login/utils"; import { LOGIN_DIALOG } from "./constants"; -const Component = () => { +function Component() { const i18n = useI18n(); const { demo } = useApp(); @@ -35,7 +35,7 @@ const Component = () => { ); -}; +} Component.displayName = "LoginDialog"; diff --git a/app/javascript/components/login/components/idp-selection/components/primero-idp-link.jsx b/app/javascript/components/login/components/idp-selection/components/primero-idp-link.jsx index 203f753170..ffe1ef64ab 100644 --- a/app/javascript/components/login/components/idp-selection/components/primero-idp-link.jsx +++ b/app/javascript/components/login/components/idp-selection/components/primero-idp-link.jsx @@ -12,7 +12,7 @@ import { signIn } from "../auth-provider"; import { useApp } from "../../../../application"; import DisableOffline from "../../../../disable-offline"; -const PrimeroIdpLink = ({ identityProviders, i18n, dispatch, css }) => { +function PrimeroIdpLink({ identityProviders, i18n, dispatch, css }) { const history = useHistory(); const { online } = useApp(); @@ -47,7 +47,7 @@ const PrimeroIdpLink = ({ identityProviders, i18n, dispatch, css }) => { )} ); -}; +} PrimeroIdpLink.displayName = "PrimeroIdpLink"; diff --git a/app/javascript/components/login/components/idp-selection/components/primero-idp-select.jsx b/app/javascript/components/login/components/idp-selection/components/primero-idp-select.jsx index f8b91045df..07c319de95 100644 --- a/app/javascript/components/login/components/idp-selection/components/primero-idp-select.jsx +++ b/app/javascript/components/login/components/idp-selection/components/primero-idp-select.jsx @@ -15,7 +15,7 @@ import { useApp } from "../../../../application"; import { ConditionalWrapper } from "../../../../../libs"; import disableOffline from "../../../../disable-offline"; -const Component = ({ identityProviders, css }) => { +function Component({ identityProviders, css }) { const i18n = useI18n(); const dispatch = useDispatch(); const history = useHistory(); @@ -78,7 +78,7 @@ const Component = ({ identityProviders, css }) => { ); -}; +} Component.propTypes = { css: PropTypes.object, diff --git a/app/javascript/components/login/components/idp-selection/container.jsx b/app/javascript/components/login/components/idp-selection/container.jsx index 90a46630bf..8e9385beb5 100644 --- a/app/javascript/components/login/components/idp-selection/container.jsx +++ b/app/javascript/components/login/components/idp-selection/container.jsx @@ -12,7 +12,7 @@ import css from "./styles.css"; import PrimeroIdpLink from "./components/primero-idp-link"; import PrimeroIdpSelect from "./components/primero-idp-select"; -const Container = () => { +function Container() { const i18n = useI18n(); const dispatch = useDispatch(); @@ -26,7 +26,7 @@ const Container = () => { ); -}; +} Container.displayName = NAME; diff --git a/app/javascript/components/login/components/login-form/component.jsx b/app/javascript/components/login/components/login-form/component.jsx index 2295f82cef..1fc2c98e1e 100644 --- a/app/javascript/components/login/components/login-form/component.jsx +++ b/app/javascript/components/login/components/login-form/component.jsx @@ -25,7 +25,7 @@ import { attemptLogin } from "./action-creators"; import { selectAuthErrors } from "./selectors"; import { form, validationSchema } from "./form"; -const Container = ({ modal = false }) => { +function Container({ modal = false }) { const i18n = useI18n(); const dispatch = useDispatch(); const { demo, online } = useApp(); @@ -97,7 +97,7 @@ const Container = ({ modal = false }) => { {renderForgotPassword} ); -}; +} Container.displayName = NAME; diff --git a/app/javascript/components/login/components/password-reset-dialog/component.jsx b/app/javascript/components/login/components/password-reset-dialog/component.jsx index 6b3b389037..c9ce214fc5 100644 --- a/app/javascript/components/login/components/password-reset-dialog/component.jsx +++ b/app/javascript/components/login/components/password-reset-dialog/component.jsx @@ -10,7 +10,7 @@ import PasswordResetForm from "../password-reset-form"; import { NAME, FORM_ID } from "./constants"; -const Component = ({ open = false, handleCancel, handleSuccess }) => { +function Component({ open = false, handleCancel, handleSuccess }) { const i18n = useI18n(); const saving = useMemoizedSelector(state => getSavingNewPasswordReset(state)); @@ -36,7 +36,7 @@ const Component = ({ open = false, handleCancel, handleSuccess }) => { ); -}; +} Component.displayName = NAME; diff --git a/app/javascript/components/login/components/password-reset-form/component.jsx b/app/javascript/components/login/components/password-reset-form/component.jsx index 47ff833c24..0c09b4f043 100644 --- a/app/javascript/components/login/components/password-reset-form/component.jsx +++ b/app/javascript/components/login/components/password-reset-form/component.jsx @@ -16,7 +16,7 @@ import { getSavingNewPasswordReset } from "../../../pages/admin/users-form/selec import { form, validationSchema } from "./form"; import { FORM_ID } from "./constants"; -const Component = ({ modal = false, handleSubmit }) => { +function Component({ modal = false, handleSubmit }) { const i18n = useI18n(); const dispatch = useDispatch(); @@ -59,7 +59,7 @@ const Component = ({ modal = false, handleSubmit }) => { )} ); -}; +} Component.displayName = "PasswordResetRequest"; diff --git a/app/javascript/components/menu/component.jsx b/app/javascript/components/menu/component.jsx index f6d3fda916..6ce2b8702e 100644 --- a/app/javascript/components/menu/component.jsx +++ b/app/javascript/components/menu/component.jsx @@ -9,7 +9,7 @@ import ActionButton, { ACTION_BUTTON_TYPES } from "../action-button"; import { MenuItems } from "./components"; -const Component = ({ actions = [], disabledCondition = () => {}, showMenu = false }) => { +function Component({ actions = [], disabledCondition = () => {}, showMenu = false }) { const [anchorEl, setAnchorEl] = useState(null); const handleClick = event => { @@ -49,7 +49,7 @@ const Component = ({ actions = [], disabledCondition = () => {}, showMenu = fals ); -}; +} Component.displayName = "Menu"; diff --git a/app/javascript/components/mobile-toolbar/component.jsx b/app/javascript/components/mobile-toolbar/component.jsx index b1c5880f18..dbe1618732 100644 --- a/app/javascript/components/mobile-toolbar/component.jsx +++ b/app/javascript/components/mobile-toolbar/component.jsx @@ -13,7 +13,7 @@ import Jewel from "../jewel"; import css from "./styles.css"; -const MobileToolbar = ({ openDrawer, hasUnsubmittedOfflineChanges = false }) => { +function MobileToolbar({ openDrawer, hasUnsubmittedOfflineChanges = false }) { const { demo } = useApp(); const i18n = useI18n(); @@ -41,7 +41,7 @@ const MobileToolbar = ({ openDrawer, hasUnsubmittedOfflineChanges = false }) => ); -}; +} MobileToolbar.displayName = "MobileToolbar"; diff --git a/app/javascript/components/module-logo/component.jsx b/app/javascript/components/module-logo/component.jsx index f0377f3067..56e6a62ec8 100644 --- a/app/javascript/components/module-logo/component.jsx +++ b/app/javascript/components/module-logo/component.jsx @@ -10,7 +10,7 @@ import css from "./styles.css"; import { getLogo } from "./utils"; import { getModuleLogoID } from "./selectors"; -const ModuleLogo = ({ moduleLogo, white, useModuleLogo }) => { +function ModuleLogo({ moduleLogo, white, useModuleLogo }) { const tabletDisplay = useMediaQuery(theme => theme.breakpoints.only("md")); const moduleLogoID = useMemoizedSelector(state => getModuleLogoID(state)); @@ -30,7 +30,7 @@ const ModuleLogo = ({ moduleLogo, white, useModuleLogo }) => { /> ); -}; +} ModuleLogo.displayName = "ModuleLogo"; diff --git a/app/javascript/components/nav/component.jsx b/app/javascript/components/nav/component.jsx index b1ff0928ae..4a02d27290 100644 --- a/app/javascript/components/nav/component.jsx +++ b/app/javascript/components/nav/component.jsx @@ -31,7 +31,7 @@ import { fetchAlerts } from "./action-creators"; import { getUserId, selectUsername, selectAlerts } from "./selectors"; import MenuEntry from "./components/menu-entry"; -const Nav = () => { +function Nav() { const mobileDisplay = useMediaQuery(theme => theme.breakpoints.down("sm")); const dispatch = useDispatch(); const i18n = useI18n(); @@ -183,7 +183,7 @@ const Nav = () => { ); -}; +} Nav.displayName = NAME; diff --git a/app/javascript/components/nav/component.spec.js b/app/javascript/components/nav/component.spec.js index d535f063e2..47c085cb27 100644 --- a/app/javascript/components/nav/component.spec.js +++ b/app/javascript/components/nav/component.spec.js @@ -7,7 +7,9 @@ import Nav from "./component"; describe("