From dade8a705523d78398c29de6d75222361944bbb5 Mon Sep 17 00:00:00 2001 From: Christophe Gerard Date: Thu, 3 Oct 2024 11:29:47 +0200 Subject: [PATCH 1/9] modify eslint rules for no-unused-vars --- .eslintrc.json | 489 +++++++++++++++++++++++++++---------------------- 1 file changed, 269 insertions(+), 220 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index e5d5724f64..f3ddcb0d1e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,248 +1,297 @@ { - "ignorePatterns": ["node_modules/", "build/", "dist/", "*.min.js"], "env": { - "browser": true, - "commonjs": true, - "es6": true, - "node": true + "browser": true, + "commonjs": true, + "es6": true, + "node": true }, - "plugins": [ - "formatjs", - "prettier" - ], "extends": [ - "airbnb", - "plugin:react-hooks/recommended", - "prettier" + "airbnb", + "plugin:react-hooks/recommended", + "prettier" ], - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "sourceType": "module", - "ecmaVersion": 2020 + "globals": { + "after": "readonly", + "afterEach": "readonly", + "before": "readonly", + "beforeEach": "readonly", + "describe": "readonly", + "expect": "readonly", + "it": "readonly", + "mount": "readonly", + "render": "readonly", + "shallow": "readonly", + "sinon": "readonly", + "URLSearchParams": "readonly" }, - "overrides":[ + "ignorePatterns": [ + "node_modules/", + "build/", + "dist/", + "*.min.js" + ], + "overrides": [ { - "files":["**/*.ts", "**/*.tsx"], - "extends":[ - "airbnb", - "plugin:react-hooks/recommended", - "plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin - "prettier/@typescript-eslint", - "prettier" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaFeatures": { + "extends": [ + "airbnb", + "plugin:react-hooks/recommended", + "plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin + "prettier/@typescript-eslint", + "prettier" + ], + "files": [ + "**/*.ts", + "**/*.tsx" + ], + "globals": { + "after": "readonly", + "afterEach": "readonly", + "assert": "readonly", + "before": "readonly", + "beforeEach": "readonly", + "context": "readonly", + "cy": "readonly", + "Cypress": "readonly", + "describe": "readonly", + "expect": "readonly", + "it": "readonly", + "localStorage": "readonly", + "mount": "readonly", + "shallow": "readonly", + "sinon": "readonly" + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 2020, + "project": "./tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } + ], + "camelcase": "off", + "class-methods-use-this": "warn", + "constructor-super": "warn", + "import/extensions": "off", + "import/no-extraneous-dependencies": "off", + "import/no-named-as-default": "warn", + "import/no-unresolved": "warn", + "import/prefer-default-export": "off", + "jsx-a11y/anchor-is-valid": "off", + "jsx-a11y/click-events-have-key-events": "off", + "jsx-a11y/href-no-hash": "off", + "jsx-a11y/jsx-wrap-multilines": "off", + "jsx-a11y/label-has-associated-control": "off", + "jsx-a11y/label-has-for": "warn", + "jsx-a11y/no-noninteractive-element-interactions": "off", + "jsx-a11y/no-noninteractive-element-to-interactive-role": "off", + "linebreak-style": "off", + "max-len": [ + "warn", + { + "code": 200 + } + ], + "no-bitwise": "warn", + "no-case-declarations": "warn", + "no-console": [ + "error", + { + "allow": [ + "warn", + "error" + ] + } + ], + "no-const-assign": "warn", + "no-continue": "warn", + "no-nested-ternary": "warn", + "no-prototype-builtins": "warn", + "no-restricted-syntax": "warn", + "no-tabs": "off", + "no-this-before-super": "warn", + "no-undef": "warn", + "no-underscore-dangle": "off", + "no-unreachable": "warn", + "no-unused-expressions": "off", + "no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_" + } + ], + "no-use-before-define": 0, + "prettier/prettier": "warn", + "react/button-has-type": "off", + "react/destructuring-assignment": "off", + "react/forbid-prop-types": [ + 1 + ], + "react/function-component-definition": "off", + "react/jsx-curly-newline": "off", + "react/jsx-filename-extension": [ + 1, + { + "extensions": [ + ".js", + ".jsx", + ".tsx" + ] + } + ], + "react/jsx-indent": [ + "error", + 4 + ], + "react/jsx-indent-props": [ + "error", + 4 + ], + "react/jsx-one-expression-per-line": "off", + "react/jsx-props-no-spreading": "warn", + "react/jsx-wrap-multilines": "off", + "react/no-access-state-in-setstate": "off", + "react/no-array-index-key": "warn", + "react/no-unused-prop-types": "warn", + "react/prefer-stateless-function": [ + 0, + { + "ignorePureComponents": true + } + ], + "react/prop-types": "off", + "react/require-default-props": "off", + "valid-typeof": "warn" + } + } + ], + "parserOptions": { + "ecmaFeatures": { "jsx": true - }, - "sourceType": "module", - "ecmaVersion": 2020, - "project":"./tsconfig.json" }, - "plugins": ["@typescript-eslint"], - "rules": { - "react/function-component-definition": "off", - "@typescript-eslint/no-explicit-any": 0, - "no-use-before-define": 0, - "no-tabs": "off", - "no-console":["error",{"allow":["warn","error"]}], - "prettier/prettier": "warn", - "camelcase": "off", - "constructor-super": "warn", - "import/no-extraneous-dependencies": "off", - "import/no-named-as-default": "warn", - "import/prefer-default-export": "off", - "jsx-a11y/anchor-is-valid": "off", - "jsx-a11y/click-events-have-key-events": "off", - "jsx-a11y/href-no-hash": "off", - "jsx-a11y/jsx-wrap-multilines": "off", - "jsx-a11y/label-has-associated-control": "off", - "jsx-a11y/label-has-for": "warn", - "jsx-a11y/no-noninteractive-element-interactions": "off", - "jsx-a11y/no-noninteractive-element-to-interactive-role": "off", - "react/jsx-one-expression-per-line": "off", - "react/jsx-curly-newline":"off", - "react/jsx-props-no-spreading":"warn", - "react/prop-types":"off", - "linebreak-style": "off", - "max-len": [ + "ecmaVersion": 2020, + "sourceType": "module" + }, + "plugins": [ + "formatjs", + "prettier" + ], + "rules": { + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } + ], + "camelcase": "off", + "class-methods-use-this": "warn", + "constructor-super": "warn", + "import/no-extraneous-dependencies": "off", + "import/no-named-as-default": "warn", + "import/prefer-default-export": "off", + "jsx-a11y/anchor-is-valid": "off", + "jsx-a11y/click-events-have-key-events": "off", + "jsx-a11y/href-no-hash": "off", + "jsx-a11y/jsx-wrap-multilines": "off", + "jsx-a11y/label-has-associated-control": "off", + "jsx-a11y/label-has-for": "warn", + "jsx-a11y/no-noninteractive-element-interactions": "off", + "jsx-a11y/no-noninteractive-element-to-interactive-role": "off", + "linebreak-style": "off", + "max-len": [ "warn", { - "code": 200 + "code": 200 + } + ], + "no-bitwise": "warn", + "no-case-declarations": "warn", + "no-console": [ + "error", + { + "allow": [ + "warn", + "error" + ] } - ], - "no-bitwise": "warn", - "no-case-declarations": "warn", - "no-const-assign": "warn", - "no-continue": "warn", - "no-nested-ternary": "warn", - "no-prototype-builtins": "warn", - "no-restricted-syntax": "warn", - "no-this-before-super": "warn", - "no-undef": "warn", - "no-underscore-dangle": "off", - "no-unreachable": "warn", - "no-unused-vars": ["error",{"ignoreRestSiblings":true}], - "react/button-has-type": "off", - "react/destructuring-assignment": "off", - "import/extensions":"off", - "import/no-unresolved": "warn", - "react/forbid-prop-types": [ - 1 - ], - "react/jsx-filename-extension": [ + ], + "no-const-assign": "warn", + "no-continue": "warn", + "no-nested-ternary": "warn", + "no-prototype-builtins": "warn", + "no-restricted-syntax": "warn", + "no-tabs": "off", + "no-this-before-super": "warn", + "no-undef": "warn", + "no-underscore-dangle": "off", + "no-unreachable": "warn", + "no-unused-expressions": "off", + "no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_" + } + ], + "prefer-arrow-callback": "error", + "prettier/prettier": "warn", + "react/button-has-type": "off", + "react/destructuring-assignment": "off", + "react/forbid-prop-types": [ + 0 + ], + "react/function-component-definition": "off", + "react/jsx-curly-newline": "off", + "react/jsx-filename-extension": [ 1, { - "extensions": [ - ".js", - ".jsx", - ".tsx" - ] + "extensions": [ + ".js", + ".jsx" + ] } - ], - "react/jsx-indent": [ + ], + "react/jsx-indent": [ "error", 4 - ], - "react/jsx-indent-props": [ + ], + "react/jsx-indent-props": [ "error", 4 - ], - "react/no-access-state-in-setstate": "off", - "react/no-array-index-key": "warn", - "react/no-unused-prop-types": "warn", - "react/jsx-wrap-multilines": "off", - "react/prefer-stateless-function": [ + ], + "react/jsx-one-expression-per-line": "off", + "react/jsx-props-no-spreading": "warn", + "react/jsx-wrap-multilines": "off", + "react/no-access-state-in-setstate": "off", + "react/no-array-index-key": "warn", + "react/no-unused-prop-types": "warn", + "react/prefer-stateless-function": [ 0, { - "ignorePureComponents": true + "ignorePureComponents": true } - ], - "react/require-default-props": "off", - "valid-typeof": "warn", - "no-unused-expressions": "off", - "class-methods-use-this": "warn", - "@typescript-eslint/ban-ts-comment": "off" - }, - "globals": { - "describe": "readonly", - "it": "readonly", - "before": "readonly", - "beforeEach": "readonly", - "afterEach": "readonly", - "after": "readonly", - "expect": "readonly", - "shallow": "readonly", - "mount": "readonly", - "sinon": "readonly", - "cy": "readonly", - "localStorage": "readonly", - "Cypress": "readonly", - "context": "readonly", - "assert": "readonly" - } - } - ], - - "rules": { - "prefer-arrow-callback": "error", - "react/function-component-definition": "off", - "no-tabs": "off", - "no-console":["error",{"allow":["warn","error"]}], - "prettier/prettier": "warn", - "camelcase": "off", - "constructor-super": "warn", - "import/no-extraneous-dependencies": "off", - "import/no-named-as-default": "warn", - "import/prefer-default-export": "off", - "jsx-a11y/anchor-is-valid": "off", - "jsx-a11y/click-events-have-key-events": "off", - "jsx-a11y/href-no-hash": "off", - "jsx-a11y/jsx-wrap-multilines": "off", - "jsx-a11y/label-has-associated-control": "off", - "jsx-a11y/label-has-for": "warn", - "jsx-a11y/no-noninteractive-element-interactions": "off", - "jsx-a11y/no-noninteractive-element-to-interactive-role": "off", - "react/jsx-one-expression-per-line": "off", - "react/jsx-curly-newline":"off", - "react/jsx-props-no-spreading":"warn", - "react/prop-types":"warn", - "linebreak-style": "off", - "max-len": [ - "warn", - { - "code": 200 - } - ], - "no-bitwise": "warn", - "no-case-declarations": "warn", - "no-const-assign": "warn", - "no-continue": "warn", - "no-nested-ternary": "warn", - "no-prototype-builtins": "warn", - "no-restricted-syntax": "warn", - "no-this-before-super": "warn", - "no-undef": "warn", - "no-underscore-dangle": "off", - "no-unreachable": "warn", - "no-unused-vars": ["error",{"ignoreRestSiblings":true}], - "react/button-has-type": "off", - "react/destructuring-assignment": "off", - "react/forbid-prop-types": [ - 0 - ], - "react/jsx-filename-extension": [ - 1, - { - "extensions": [ - ".js", - ".jsx" - ] - } - ], - "react/jsx-indent": [ - "error", - 4 - ], - "react/jsx-indent-props": [ - "error", - 4 - ], - "react/no-access-state-in-setstate": "off", - "react/no-array-index-key": "warn", - "react/no-unused-prop-types": "warn", - "react/jsx-wrap-multilines": "off", - "react/prefer-stateless-function": [ - 0, - { - "ignorePureComponents": true - } - ], - "valid-typeof": "warn", - "no-unused-expressions": "off", - "class-methods-use-this": "warn" - }, - "globals": { - "URLSearchParams": "readonly", - "describe": "readonly", - "it": "readonly", - "before": "readonly", - "beforeEach": "readonly", - "afterEach": "readonly", - "after": "readonly", - "expect": "readonly", - "shallow": "readonly", - "mount": "readonly", - "sinon": "readonly", - "render":"readonly" + ], + "react/prop-types": "warn", + "valid-typeof": "warn" }, "settings": { "import/resolver": { - "webpack": { - "config": "hat/webpack.dev.js" + "webpack": { + "config": "hat/webpack.dev.js" } } } - } +} \ No newline at end of file From 30f48a8d0a47cdb6d3cb601164ebad09db10fa43 Mon Sep 17 00:00:00 2001 From: Christophe Gerard Date: Thu, 3 Oct 2024 13:06:37 +0200 Subject: [PATCH 2/9] replace no-unused-vars only when required, use global rule --- .../LegendBuilder/LegendBuilderDialog.tsx | 16 ++-- .../components/LegendBuilder/LegendRange.tsx | 12 +-- .../Iaso/components/LegendBuilder/index.tsx | 8 +- .../dialogs/ImageGalleryComponent.tsx | 2 - .../apps/Iaso/components/files/FavButton.tsx | 2 - .../files/LazyImagesListComponent.tsx | 3 - .../Iaso/components/filters/DatesRange.d.ts | 1 - .../Iaso/components/forms/AsyncSelect.tsx | 15 +-- .../Iaso/components/forms/InputComponent.tsx | 16 +--- .../apps/Iaso/components/forms/TextArea.tsx | 5 +- .../components/maps/tools/CustomTileLayer.tsx | 5 +- .../maps/tools/TilesSwitchControl.tsx | 90 ++++++++--------- .../Iaso/components/nav/InnerDrawer/Index.tsx | 2 - .../Iaso/components/nav/TabWithInfoIcon.tsx | 11 +-- .../components/snackBars/EventDispatcher.ts | 1 - .../ColumnSelectDrawer/ColumnDrawerSwitch.tsx | 5 +- .../tables/SimpleTableWithDeepLink.tsx | 4 +- .../hooks/api/useGetAlgorithmRuns.tsx | 2 +- .../domains/app/contexts/LocaleContext.tsx | 4 +- hat/assets/js/apps/Iaso/domains/app/types.ts | 7 +- .../components/AssignmentsListTab.tsx | 24 ++--- .../assignments/components/AssignmentsMap.tsx | 26 +++-- .../components/AssignmentsMapTab.tsx | 14 ++- .../components/AssignmentsSidebar.tsx | 8 +- .../assignments/components/CheckBoxCell.tsx | 5 +- .../assignments/components/ParentDialog.tsx | 26 +++-- .../configs/AssignmentsMapTabColumns.tsx | 32 +++---- .../configs/ParentDialogColumns.tsx | 3 +- .../assignments/hooks/useGetAssignmentData.ts | 31 +++--- .../hooks/api/useGetCompletnessMapStats.ts | 3 +- .../Iaso/domains/completenessStats/utils.tsx | 1 - .../components/AddNewEmptyVersion.tsx | 6 +- .../components/AddTaskComponent.js | 13 ++- .../components/ExportToDHIS2Dialog.js | 12 +-- .../components/ImportGeoPkgDialog.js | 24 ++--- .../components/VersionDescription.tsx | 5 +- .../domains/dataSources/useGetDataSources.ts | 2 +- .../devices/hooks/api/useGetDevices.tsx | 2 +- .../js/apps/Iaso/domains/entities/config.tsx | 19 ++-- .../details/DuplicateDetailsTableButtons.tsx | 14 ++- .../duplicates/details/DuplicateInfos.tsx | 26 +++-- .../hooks/useDuplicationDetailsColumns.tsx | 21 ++-- .../duplicates/details/hooks/useEntityCell.ts | 9 +- .../hooks/api/useIgnoreDuplicate.ts | 5 +- .../duplicates/hooks/api/useMergeDuplicate.ts | 5 +- .../components/EntityTypesDialog.tsx | 23 ++--- .../domains/entities/entityTypes/config.tsx | 12 +-- .../entities/hooks/useFiltersParams.ts | 6 +- .../entities/hooks/useGetFieldValue.ts | 5 +- .../forms/components/AttachmentModal.tsx | 5 +- .../forms/components/FormFormComponent.tsx | 13 ++- .../forms/components/FormLegendInput.tsx | 9 +- .../components/ActionTableColumnComponent.js | 21 ++-- .../instances/components/ColumnSelect.tsx | 4 - .../CreateReAssignDialogComponent.tsx | 14 ++- .../InstancePopUp/InstancePopUp.tsx | 20 ++-- .../InstancesFilesListComponent.tsx | 2 - .../domains/instances/components/TopBar.tsx | 3 +- .../domains/instances/hooks/speeddials.ts | 13 +-- .../Iaso/domains/instances/utils/index.tsx | 10 +- .../domains/links/components/LinksTable.tsx | 3 +- .../components/LinksTableWithDownloads.tsx | 10 +- .../Iaso/domains/modules/types/modules.ts | 5 +- .../orgUnits/components/ImageInfos.tsx | 3 - .../components/OrgUnitFiltersContainer.tsx | 3 +- .../orgUnits/components/OrgUnitForm.tsx | 19 ++-- .../orgUnits/components/OrgUnitInfos.tsx | 10 +- .../orgUnits/components/OrgUnitsFilters.tsx | 2 - .../orgUnits/components/OrgUnitsMap.tsx | 45 +++++---- .../TreeView/OrgUnitTreeviewModal.tsx | 4 +- .../TreeView/OrgUnitTreeviewPicker.tsx | 2 - .../components/TreeView/TruncatedTrees.tsx | 1 - .../OrgUnitMap/CurrentOrgUnitMarker.tsx | 3 +- .../orgUnitMap/OrgUnitMap/FormsMarkers.tsx | 8 +- .../orgUnitMap/OrgUnitMap/MarkersList.tsx | 2 - .../orgUnitMap/OrgUnitMap/OrgUnitMap.tsx | 7 +- .../OrgUnitMap/OrgUnitTypesSelectedShapes.tsx | 10 +- .../orgUnitMap/OrgUnitMap/SelectedMarkers.tsx | 2 - .../orgUnitMap/OrgUnitMap/SourceShape.tsx | 5 +- .../OrgUnitMap/SourcesSelectedShapes.tsx | 2 - .../orgUnitMap/OrgUnitsMapComments.js | 23 +++-- ...angeRequestConfigDialogCreateFirstStep.tsx | 1 - .../orgUnits/history/LogsComponent.tsx | 13 ++- .../domains/orgUnits/hooks/useGetApiParams.ts | 5 +- .../components/OrgUnitsTypesDialog.tsx | 49 +++++----- .../Components/HighlightFieldsChanges.tsx | 1 - .../ReviewOrgUnitChangesButtons.tsx | 5 +- .../ReviewOrgUnitChangesCommentDialog.tsx | 5 +- ...viewOrgUnitChangesCommentDialogButtons.tsx | 5 +- .../ReviewOrgUnitChangesDetailsTable.tsx | 1 - .../ReviewOrgUnitChangesDetailsTableBody.tsx | 1 - .../ReviewOrgUnitChangesDetailsTableRow.tsx | 1 - .../reviewChanges/hooks/useNewFields.tsx | 33 +++---- .../domains/pages/components/MultiSelect.tsx | 9 +- .../domains/pages/components/SingleSelect.tsx | 1 - .../EditPaymentLot/PaymentLotInfos.tsx | 9 +- .../payments/components/StatusSelect.tsx | 5 +- .../hooks/requests/useSavePaymentLot.ts | 2 - .../periods/components/PeriodPicker.tsx | 15 ++- .../CreateEditPlanning/CreateEditPlanning.tsx | 30 +++--- .../js/apps/Iaso/domains/plannings/config.tsx | 9 +- .../hooks/requests/useGetPlannings.ts | 6 +- .../components/CreateEditProjectDialog.tsx | 32 +++---- .../components/FeatureFlagsSwitches.tsx | 5 +- .../components/ProjectFeatureFlags.tsx | 1 - .../projects/components/ProjectInfos.tsx | 1 - .../js/apps/Iaso/domains/projects/config.tsx | 16 ++-- .../registry/components/OrgUnitPaper.tsx | 1 - .../registry/components/map/MapSettings.tsx | 1 - .../map/OrgUnitChildrenLocations.tsx | 3 - .../components/map/OrgUnitChildrenMap.tsx | 1 - .../components/map/OrgUnitChildrenShapes.tsx | 2 - .../components/map/OrgUnitLocation.tsx | 4 - .../registry/hooks/useGetCreateInstance.ts | 1 - .../domains/registry/hooks/useGetOrgUnit.ts | 3 +- .../storages/hooks/useGetOperationsTypes.ts | 3 +- .../Iaso/domains/storages/types/storages.ts | 7 +- .../js/apps/Iaso/domains/teams/config.tsx | 3 +- .../js/apps/Iaso/domains/teams/types/team.ts | 5 +- .../components/PermissionsSwitches.tsx | 13 ++- .../UserRoleDialogInfoComponent.tsx | 5 +- .../js/apps/Iaso/domains/userRoles/config.tsx | 14 ++- .../Iaso/domains/userRoles/types/userRoles.ts | 5 +- .../users/components/PermissionSwitch.tsx | 1 - .../users/components/PermissionsSwitches.tsx | 2 - .../users/components/useInitialUser.ts | 8 +- .../users/hooks/useGetUserPermissions.tsx | 1 - .../components/changes/HeadSourceCell.tsx | 8 +- .../components/changes/HeadTargetCell.tsx | 5 +- .../components/changes/MappingTable.tsx | 29 +++--- .../components/changes/SourceCell.tsx | 7 +- .../components/changes/TargetCell.tsx | 7 +- .../Iaso/domains/workflows/config/changes.tsx | 39 +++----- .../domains/workflows/config/followUps.tsx | 17 ++-- .../hooks/requests/useGetWorkflowVersions.ts | 4 +- .../hooks/useGetUnUsedChangesOptions.ts | 5 +- hat/assets/js/apps/Iaso/hooks/form.js | 1 - .../js/apps/Iaso/hooks/useBoundState.ts | 3 +- .../js/apps/Iaso/hooks/useFilterState.ts | 10 +- hat/assets/js/apps/Iaso/hooks/useTabs.tsx | 3 +- hat/assets/js/apps/Iaso/index.tsx | 4 - hat/assets/js/apps/Iaso/libs/apiHooks.ts | 6 -- hat/assets/js/apps/Iaso/libs/utils.tsx | 8 +- hat/assets/js/apps/Iaso/libs/validation.tsx | 12 +-- .../js/apps/Iaso/redux/useInjectedStore.ts | 7 +- .../Iaso/routing/hooks/useActiveParams.tsx | 2 +- .../Iaso/routing/hooks/useRedirections.tsx | 2 +- hat/assets/js/apps/Iaso/routing/routing.ts | 9 +- hat/assets/js/apps/Iaso/routing/types.ts | 3 - hat/assets/js/apps/Iaso/routing/utils.ts | 5 +- hat/assets/js/apps/Iaso/types/general.ts | 9 -- hat/assets/js/apps/Iaso/utils/map/mapUtils.ts | 2 - hat/assets/js/apps/Iaso/utils/table.ts | 13 +-- hat/assets/js/cypress/support/index.js | 1 - package.json | 6 +- .../Inputs/DependentSingleSelect.tsx | 1 - .../js/src/components/Inputs/MultiSelect.tsx | 2 - .../polio/js/src/components/Inputs/Select.tsx | 2 - .../js/src/components/Inputs/SingleSelect.tsx | 1 - .../BudgetDetails/BudgetDetailsFilters.tsx | 9 +- .../BudgetDetailsTableLayout.tsx | 11 +-- .../mobile/BudgetDetailsCardsLayout.tsx | 3 +- .../mobile/BudgetDetailsFiltersMobile.tsx | 7 +- .../domains/Budget/hooks/api/useGetBudget.ts | 2 - .../Budget/hooks/api/useGetBudgetDetails.ts | 5 +- .../Budget/hooks/api/useSaveBudgetStep.tsx | 7 +- .../Budget/hooks/api/useSaveOverrideStep.ts | 6 +- plugins/polio/js/src/domains/Budget/index.tsx | 23 ++--- .../campaignCalendar/map/MapRoundSelector.tsx | 5 +- .../campaignCalendar/popper/RoundPopper.tsx | 1 - .../polio/js/src/domains/Calendar/types.ts | 1 - .../useCampaignsTableColumns.tsx | 2 - .../Campaigns/MainDialog/PolioDialogTab.tsx | 7 +- .../Campaigns/MainDialog/PolioDialogTabs.tsx | 3 +- .../Campaigns/MapComponent/MapPanes.tsx | 7 +- .../Rounds/RoundDates/RoundDates.tsx | 3 - .../domains/Campaigns/Scope/ScopeField.tsx | 11 +-- .../domains/Campaigns/Scope/ScopeInput.tsx | 4 +- .../Scope/Scopes/DistrictScopeTable.tsx | 67 ++++++------- .../Campaigns/Scope/Scopes/MapScope.tsx | 2 - .../Campaigns/Scope/Scopes/ScopeMapLegend.tsx | 1 - .../Campaigns/Scope/Scopes/ScopeSearch.tsx | 3 +- .../campaignHistory/useGetMapLog.tsx | 3 +- .../Campaigns/hooks/api/useGetCampaigns.ts | 1 - .../hooks/useGetCampaignFieldLabel.ts | 2 - .../hooks/useGetCampaignFieldValue.ts | 41 -------- .../hooks/useIsPolioCampaignCheck.ts | 1 - .../Campaigns/hooks/useValidateCampaign.tsx | 1 - .../CreateEdit/CreateEditReasonForDelay.tsx | 20 ++-- .../GroupedCampaignDialog.tsx | 13 ++- .../src/domains/GroupedCampaigns/config.tsx | 11 +-- .../CountryOverview/ImOverviewContainer.tsx | 19 ++-- .../CountryOverview/LqasOverviewContainer.tsx | 19 ++-- .../LQAS-IM/LQAS/Graphs/CaregiversTable.tsx | 13 ++- .../LqasAfroOverview/LqasAfroSelector.tsx | 96 +++++++++---------- .../Map/LqasAfroMapWithSelector.tsx | 20 ++-- .../LQAS-IM/shared/Map/LqasImCountryMap.tsx | 11 +-- .../LQAS-IM/shared/Map/LqasImMapHeader.tsx | 7 +- .../LQAS-IM/shared/Tabs/LqasImTabs.tsx | 3 +- .../LQAS-IM/shared/Tabs/useLqasImTabState.tsx | 5 +- .../charts/PercentageChartWithTitle.tsx | 3 +- .../shared/hooks/useVerticalChartData.ts | 5 +- .../StockManagement/hooks/api.ts | 21 ++-- .../SupplyChain/Details/SupplyChainTabs.tsx | 7 +- .../Details/VaccineSupplyChainDetails.tsx | 51 +++++----- .../SupplyChain/Details/utils.ts | 5 +- .../VaccineModule/SupplyChain/hooks/utils.ts | 17 ++-- .../VaccineModule/SupplyChain/types.ts | 5 +- .../components/OrgUnitChildrenMap.tsx | 1 - .../registry/components/OrgUnitPaper.tsx | 1 - 210 files changed, 792 insertions(+), 1253 deletions(-) delete mode 100644 plugins/polio/js/src/domains/Campaigns/hooks/useGetCampaignFieldValue.ts diff --git a/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx b/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx index e06d04b275..faa05a7dd9 100644 --- a/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx +++ b/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx @@ -1,27 +1,26 @@ /* eslint-disable camelcase */ -import React, { FunctionComponent, useCallback, useMemo } from 'react'; +import { Box, Button } from '@mui/material'; import { + ConfirmCancelModal, IntlMessage, makeFullModal, - ConfirmCancelModal, useSafeIntl, } from 'bluesquare-components'; +import React, { FunctionComponent, useCallback, useMemo } from 'react'; import * as Yup from 'yup'; -import { Box, Button } from '@mui/material'; -import { useFormik } from 'formik'; import Add from '@mui/icons-material/Add'; +import { useFormik } from 'formik'; +import { EditIconButton } from '../Buttons/EditIconButton'; +import { LegendBuilder } from './index'; import { MESSAGES } from './messages'; import { ScaleThreshold } from './types'; -import { LegendBuilder } from './index'; import { getRangeValues, getScaleThreshold } from './utils'; -import { EditIconButton } from '../Buttons/EditIconButton'; type Props = { titleMessage: IntlMessage; isOpen: boolean; closeDialog: () => void; - // eslint-disable-next-line no-unused-vars onConfirm: (threshold?: ScaleThreshold) => void; threshold?: ScaleThreshold; }; @@ -127,5 +126,6 @@ const modalWithIcon = makeFullModal(LegendBuilderDialog, EditIconButton); export { modalWithButton as AddLegendDialog, - modalWithIcon as EditLegendDialog, + modalWithIcon as EditLegendDialog }; + diff --git a/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendRange.tsx b/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendRange.tsx index 5448eb937c..c8b63d27c8 100644 --- a/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendRange.tsx +++ b/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendRange.tsx @@ -1,11 +1,11 @@ -import React, { FunctionComponent } from 'react'; -import { IconButton, Grid, Typography, Box } from '@mui/material'; -import { makeStyles } from '@mui/styles'; import RemoveIcon from '@mui/icons-material/Remove'; +import { Box, Grid, IconButton, Typography } from '@mui/material'; +import { makeStyles } from '@mui/styles'; +import React, { FunctionComponent } from 'react'; import { ColorPicker } from '../forms/ColorPicker'; import InputComponent from '../forms/InputComponent'; -import { RangeValue } from './types'; import { legendColors } from './colors'; +import { RangeValue } from './types'; const useStyles = makeStyles(theme => ({ legendItem: { @@ -23,13 +23,9 @@ type LegendRowProps = { rangeItem: RangeValue; index: number; rangeValues: RangeValue[]; - // eslint-disable-next-line no-unused-vars handleColorChange: (index: number) => void; - // eslint-disable-next-line no-unused-vars handleNumberChange: (index: number, newNumber?: number) => void; - // eslint-disable-next-line no-unused-vars removeRangeValue: (index: number) => void; - // eslint-disable-next-line no-unused-vars setFieldError: (keyValue: string, message: string) => void; errors?: string[]; }; diff --git a/hat/assets/js/apps/Iaso/components/LegendBuilder/index.tsx b/hat/assets/js/apps/Iaso/components/LegendBuilder/index.tsx index b03f6f3ced..12cbc439b3 100644 --- a/hat/assets/js/apps/Iaso/components/LegendBuilder/index.tsx +++ b/hat/assets/js/apps/Iaso/components/LegendBuilder/index.tsx @@ -1,11 +1,11 @@ -import React, { FunctionComponent, useCallback } from 'react'; +import AddIcon from '@mui/icons-material/Add'; import { Box, IconButton } from '@mui/material'; import { makeStyles } from '@mui/styles'; -import AddIcon from '@mui/icons-material/Add'; +import React, { FunctionComponent, useCallback } from 'react'; +import { legendColors } from './colors'; import { LegendRange } from './LegendRange'; import { RangeValue } from './types'; -import { legendColors } from './colors'; const useStyles = makeStyles(theme => ({ root: { @@ -36,9 +36,7 @@ const useStyles = makeStyles(theme => ({ type LegendBuilderProps = { rangeValues: RangeValue[]; - // eslint-disable-next-line no-unused-vars onChange: (newRangeValues: RangeValue[]) => void; - // eslint-disable-next-line no-unused-vars setFieldError: (keyValue: string, message: string) => void; errors?: string[]; }; diff --git a/hat/assets/js/apps/Iaso/components/dialogs/ImageGalleryComponent.tsx b/hat/assets/js/apps/Iaso/components/dialogs/ImageGalleryComponent.tsx index 9163fb844e..daa3bece40 100644 --- a/hat/assets/js/apps/Iaso/components/dialogs/ImageGalleryComponent.tsx +++ b/hat/assets/js/apps/Iaso/components/dialogs/ImageGalleryComponent.tsx @@ -105,11 +105,9 @@ type Props = { closeLightbox: () => void; imageList: ShortFile[]; currentIndex: number; - // eslint-disable-next-line no-unused-vars setCurrentIndex?: (index: number) => void; url?: string | null; urlLabel?: { id: string; defaultMessage: string } | undefined; - // eslint-disable-next-line no-unused-vars getExtraInfos?: (image: ShortFile) => React.ReactNode; }; diff --git a/hat/assets/js/apps/Iaso/components/files/FavButton.tsx b/hat/assets/js/apps/Iaso/components/files/FavButton.tsx index 0a6bcd1ba6..7968578019 100644 --- a/hat/assets/js/apps/Iaso/components/files/FavButton.tsx +++ b/hat/assets/js/apps/Iaso/components/files/FavButton.tsx @@ -31,9 +31,7 @@ const MESSAGES = defineMessages({ type Props = { file: ShortFile; - // eslint-disable-next-line no-unused-vars onImageFavoriteClick: (id: number) => void; - // eslint-disable-next-line no-unused-vars isDefaultImage: (id: number) => boolean; }; diff --git a/hat/assets/js/apps/Iaso/components/files/LazyImagesListComponent.tsx b/hat/assets/js/apps/Iaso/components/files/LazyImagesListComponent.tsx index 1e68cae7bd..3c1a2814c9 100644 --- a/hat/assets/js/apps/Iaso/components/files/LazyImagesListComponent.tsx +++ b/hat/assets/js/apps/Iaso/components/files/LazyImagesListComponent.tsx @@ -26,11 +26,8 @@ const styles = { type Props = { imageList: ShortFile[]; - // eslint-disable-next-line no-unused-vars onImageClick: (index: number) => void; - // eslint-disable-next-line no-unused-vars onImageFavoriteClick?: (id: number) => void; - // eslint-disable-next-line no-unused-vars isDefaultImage?: (id: number) => boolean; }; diff --git a/hat/assets/js/apps/Iaso/components/filters/DatesRange.d.ts b/hat/assets/js/apps/Iaso/components/filters/DatesRange.d.ts index f91452b5de..62077627b4 100644 --- a/hat/assets/js/apps/Iaso/components/filters/DatesRange.d.ts +++ b/hat/assets/js/apps/Iaso/components/filters/DatesRange.d.ts @@ -4,7 +4,6 @@ import { ComponentType } from 'react'; interface DatesRangeProps { dateFrom?: string; dateTo?: string; - // eslint-disable-next-line no-unused-vars onChangeDate: (key: string, value: any) => void; labelTo?: { id: string; defaultMessage: string }; labelFrom?: { id: string; defaultMessage: string }; diff --git a/hat/assets/js/apps/Iaso/components/forms/AsyncSelect.tsx b/hat/assets/js/apps/Iaso/components/forms/AsyncSelect.tsx index 792b5419d3..1f7ca2b363 100644 --- a/hat/assets/js/apps/Iaso/components/forms/AsyncSelect.tsx +++ b/hat/assets/js/apps/Iaso/components/forms/AsyncSelect.tsx @@ -1,15 +1,15 @@ -import React, { FunctionComponent, useEffect, useMemo, useState } from 'react'; -import { defineMessages } from 'react-intl'; -import { debounce } from '@mui/material/utils'; +import { Box, TextField } from '@mui/material'; import Autocomplete from '@mui/material/Autocomplete'; +import { AutocompleteGetTagProps } from '@mui/material/Autocomplete/Autocomplete'; +import { debounce } from '@mui/material/utils'; import { IntlMessage, renderTags as defaultRenderTags, useSafeIntl, } from 'bluesquare-components'; -import { Box, TextField } from '@mui/material'; import { isArray } from 'lodash'; -import { AutocompleteGetTagProps } from '@mui/material/Autocomplete/Autocomplete'; +import React, { FunctionComponent, useEffect, useMemo, useState } from 'react'; +import { defineMessages } from 'react-intl'; const MESSAGES = defineMessages({ noOptionsText: { @@ -24,7 +24,6 @@ type Props = { loading?: boolean; loadingText?: IntlMessage; keyValue: string; - // eslint-disable-next-line no-unused-vars onChange: (keyValue, newValue: any | null) => void; errors?: string[]; required?: boolean; @@ -34,12 +33,9 @@ type Props = { multi?: boolean; helperText?: string; minCharBeforeQuery?: number; - // eslint-disable-next-line no-unused-vars fetchOptions: (input: string) => Promise; renderTags?: ( - // eslint-disable-next-line no-unused-vars tag: any[], - // eslint-disable-next-line no-unused-vars getTagProps: AutocompleteGetTagProps, ) => React.ReactNode; }; @@ -94,7 +90,6 @@ export const AsyncSelect: FunctionComponent = ({ debounce( ( request: { input: string }, - // eslint-disable-next-line no-unused-vars callback: (results?: readonly any[]) => void, ) => { setLoading(true); diff --git a/hat/assets/js/apps/Iaso/components/forms/InputComponent.tsx b/hat/assets/js/apps/Iaso/components/forms/InputComponent.tsx index 9bd5851582..b2ea43eff4 100644 --- a/hat/assets/js/apps/Iaso/components/forms/InputComponent.tsx +++ b/hat/assets/js/apps/Iaso/components/forms/InputComponent.tsx @@ -61,8 +61,7 @@ export type InputComponentProps = { keyValue: string; value?: any; errors?: string[]; - onChange?: // eslint-disable-next-line no-unused-vars - (key: string, value: any, countryData?: BaseCountryData) => void; + onChange?: (key: string, value: any, countryData?: BaseCountryData) => void; options?: any[]; disabled?: boolean; @@ -76,18 +75,10 @@ export type InputComponentProps = { multi?: boolean; uid?: string; loading?: boolean; - // eslint-disable-next-line no-unused-vars getOptionLabel?: (option: Option) => string; - getOptionSelected?: ( - // eslint-disable-next-line no-unused-vars - option: Option, - // eslint-disable-next-line no-unused-vars - value: Option, - ) => boolean; + getOptionSelected?: (option: Option, value: Option) => boolean; renderOption?: ( - // eslint-disable-next-line no-unused-vars option: Option, - // eslint-disable-next-line no-unused-vars { inputValue }: { inputValue: string }, ) => ReactNode; className?: string; @@ -95,7 +86,6 @@ export type InputComponentProps = { min?: number; max?: number; blockForbiddenChars?: boolean; - // eslint-disable-next-line no-unused-vars onErrorChange?: (hasError: boolean) => void; numberInputOptions?: { prefix?: string; @@ -107,10 +97,8 @@ export type InputComponentProps = { thousandSeparator?: '.' | ','; }; phoneInputOptions?: PhoneInputOptions; - // eslint-disable-next-line no-unused-vars setFieldError?: (keyValue: string, message: string) => void; autoComplete?: string; - // eslint-disable-next-line no-unused-vars renderTags?: (tagValue: Array, getTagProps: any) => Array; freeSolo?: boolean; // this props i only use on single select and allow user to give an option not present in the list. Errors will be ignored returnFullObject?: boolean; diff --git a/hat/assets/js/apps/Iaso/components/forms/TextArea.tsx b/hat/assets/js/apps/Iaso/components/forms/TextArea.tsx index 6bf2a51151..99da2e54ca 100644 --- a/hat/assets/js/apps/Iaso/components/forms/TextArea.tsx +++ b/hat/assets/js/apps/Iaso/components/forms/TextArea.tsx @@ -1,20 +1,19 @@ import React, { FunctionComponent, useEffect, useRef, useState } from 'react'; +import { FormHelperText, InputLabel } from '@mui/material'; +import { makeStyles } from '@mui/styles'; import { FormControl, commonStyles, useSkipEffectOnMount, } from 'bluesquare-components'; import classnames from 'classnames'; -import { InputLabel, FormHelperText } from '@mui/material'; -import { makeStyles } from '@mui/styles'; import { useDebounce } from 'use-debounce'; import { Optional } from '../../types/utils'; type Props = { value?: string; label: string; - // eslint-disable-next-line no-unused-vars onChange: (newValue: string) => void; errors?: string[]; required?: boolean; diff --git a/hat/assets/js/apps/Iaso/components/maps/tools/CustomTileLayer.tsx b/hat/assets/js/apps/Iaso/components/maps/tools/CustomTileLayer.tsx index e791a9ee1e..e1df0c5b62 100644 --- a/hat/assets/js/apps/Iaso/components/maps/tools/CustomTileLayer.tsx +++ b/hat/assets/js/apps/Iaso/components/maps/tools/CustomTileLayer.tsx @@ -1,11 +1,10 @@ -import React, { FunctionComponent, useRef, useEffect, RefObject } from 'react'; -import { TileLayer, useMap } from 'react-leaflet'; import { SxProps, Theme } from '@mui/material'; +import React, { FunctionComponent, RefObject, useEffect, useRef } from 'react'; +import { TileLayer, useMap } from 'react-leaflet'; import { Tile, TilesSwitchControl } from './TilesSwitchControl'; type Props = { currentTile: Tile; - // eslint-disable-next-line no-unused-vars setCurrentTile: (newTile: Tile) => void; styles?: SxProps; }; diff --git a/hat/assets/js/apps/Iaso/components/maps/tools/TilesSwitchControl.tsx b/hat/assets/js/apps/Iaso/components/maps/tools/TilesSwitchControl.tsx index 5e92302943..ab50ae90ce 100644 --- a/hat/assets/js/apps/Iaso/components/maps/tools/TilesSwitchControl.tsx +++ b/hat/assets/js/apps/Iaso/components/maps/tools/TilesSwitchControl.tsx @@ -1,10 +1,10 @@ -import React, { FunctionComponent, useState } from 'react'; +import Layers from '@mui/icons-material/Layers'; import { Box, SxProps, Typography } from '@mui/material'; -import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; +import { makeStyles } from '@mui/styles'; import { IconButton, useSafeIntl } from 'bluesquare-components'; -import Layers from '@mui/icons-material/Layers'; import classNames from 'classnames'; +import React, { FunctionComponent, useState } from 'react'; import TileSwitch from './TileSwitchComponent'; @@ -68,7 +68,6 @@ export type Tile = { type Props = { currentTile: Tile; - // eslint-disable-next-line no-unused-vars setCurrentTile: (newTile: Tile) => void; styles?: SxProps; }; @@ -93,57 +92,50 @@ export const TilesSwitchControl: FunctionComponent = ({ }; return ( - <> + + {!tilePopup && ( + toggleTilePopup()} + > + + + )} + - {!tilePopup && ( - toggleTilePopup()} - > - - - )} - - - {tilePopup && ( - - - {formatMessage(MESSAGES.layersTitle)} - - - toggleTilePopup()} - icon="clear" - tooltipMessage={MESSAGES.close} - /> - - - setCurrentTile(newtile) - } - currentTile={currentTile} + {tilePopup && ( + + + {formatMessage(MESSAGES.layersTitle)} + + + toggleTilePopup()} + icon="clear" + tooltipMessage={MESSAGES.close} /> - )} - + setCurrentTile(newtile)} + currentTile={currentTile} + /> + + )} - + ); }; diff --git a/hat/assets/js/apps/Iaso/components/nav/InnerDrawer/Index.tsx b/hat/assets/js/apps/Iaso/components/nav/InnerDrawer/Index.tsx index ed6e2c8972..23ccf76a39 100644 --- a/hat/assets/js/apps/Iaso/components/nav/InnerDrawer/Index.tsx +++ b/hat/assets/js/apps/Iaso/components/nav/InnerDrawer/Index.tsx @@ -53,7 +53,6 @@ type Props = { commentsDisabled?: boolean; defaultActiveOption?: 'settings' | 'filters' | 'edit' | 'comments'; setCurrentOption?: ( - // eslint-disable-next-line no-unused-vars option: 'settings' | 'filters' | 'edit' | 'comments', ) => void; }; @@ -69,7 +68,6 @@ export const InnerDrawer: FunctionComponent = ({ withTopBorder = false, commentsDisabled = false, defaultActiveOption = 'settings', - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars setCurrentOption = _option => null, children = null, }) => { diff --git a/hat/assets/js/apps/Iaso/components/nav/TabWithInfoIcon.tsx b/hat/assets/js/apps/Iaso/components/nav/TabWithInfoIcon.tsx index d0128a9bf9..2f3523158e 100644 --- a/hat/assets/js/apps/Iaso/components/nav/TabWithInfoIcon.tsx +++ b/hat/assets/js/apps/Iaso/components/nav/TabWithInfoIcon.tsx @@ -1,13 +1,13 @@ +import InfoIcon from '@mui/icons-material/Info'; +import { Tab, Tooltip } from '@mui/material'; +import { makeStyles } from '@mui/styles'; +import classnames from 'classnames'; import React, { FunctionComponent, ReactNode, useCallback, useMemo, } from 'react'; -import { Tab, Tooltip } from '@mui/material'; -import { makeStyles } from '@mui/styles'; -import InfoIcon from '@mui/icons-material/Info'; -import classnames from 'classnames'; export const useStyles = makeStyles(theme => ({ tabError: { @@ -34,7 +34,6 @@ type Props = { title: string; hasTabError: boolean; disabled: boolean; - // eslint-disable-next-line no-unused-vars handleChange: (_event: any, newValue: number | string) => void; showIcon: boolean; tooltipMessage: string; @@ -55,7 +54,7 @@ export const TabWithInfoIcon: FunctionComponent = ({ // Remove onChange to avoid bugs when tab is disabled const filteredProps = useMemo(() => { // @ts-ignore - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { onChange, ...rest } = props; return rest; }, [props]); diff --git a/hat/assets/js/apps/Iaso/components/snackBars/EventDispatcher.ts b/hat/assets/js/apps/Iaso/components/snackBars/EventDispatcher.ts index ab77675f9e..c732d5a7e3 100644 --- a/hat/assets/js/apps/Iaso/components/snackBars/EventDispatcher.ts +++ b/hat/assets/js/apps/Iaso/components/snackBars/EventDispatcher.ts @@ -1,5 +1,4 @@ class EventDispatcher { - // eslint-disable-next-line no-unused-vars private listeners: { [key: string]: ((data: any) => void)[] }; constructor() { diff --git a/hat/assets/js/apps/Iaso/components/tables/ColumnSelectDrawer/ColumnDrawerSwitch.tsx b/hat/assets/js/apps/Iaso/components/tables/ColumnSelectDrawer/ColumnDrawerSwitch.tsx index b331ad89fb..42d7a8e0d4 100644 --- a/hat/assets/js/apps/Iaso/components/tables/ColumnSelectDrawer/ColumnDrawerSwitch.tsx +++ b/hat/assets/js/apps/Iaso/components/tables/ColumnSelectDrawer/ColumnDrawerSwitch.tsx @@ -1,10 +1,9 @@ -import React, { FunctionComponent, ChangeEvent, ReactElement } from 'react'; -import { Switch, ListItemText, Tooltip } from '@mui/material'; +import { ListItemText, Switch, Tooltip } from '@mui/material'; import { truncateText } from 'bluesquare-components'; +import React, { ChangeEvent, FunctionComponent, ReactElement } from 'react'; type Props = { disabled: boolean; - // eslint-disable-next-line no-unused-vars onChange?: (event: ChangeEvent, checked: boolean) => void; className: string; checked: boolean; diff --git a/hat/assets/js/apps/Iaso/components/tables/SimpleTableWithDeepLink.tsx b/hat/assets/js/apps/Iaso/components/tables/SimpleTableWithDeepLink.tsx index 0d96e98c3d..faa2e038fd 100644 --- a/hat/assets/js/apps/Iaso/components/tables/SimpleTableWithDeepLink.tsx +++ b/hat/assets/js/apps/Iaso/components/tables/SimpleTableWithDeepLink.tsx @@ -1,5 +1,5 @@ +import { Column, Setting, UrlParams } from 'bluesquare-components'; import React, { FunctionComponent } from 'react'; -import { Column, UrlParams, Setting } from 'bluesquare-components'; import { TableWithDeepLink } from './TableWithDeepLink'; type Props = { @@ -17,9 +17,7 @@ type Props = { columnSelectorEnabled?: boolean; defaultSorted?: any; multiSelect?: boolean; - // eslint-disable-next-line no-unused-vars rowProps?: (row: Setting['row']) => Record; - // eslint-disable-next-line no-unused-vars cellProps?: (cell: any) => Record; }; diff --git a/hat/assets/js/apps/Iaso/domains/algorithmRuns/hooks/api/useGetAlgorithmRuns.tsx b/hat/assets/js/apps/Iaso/domains/algorithmRuns/hooks/api/useGetAlgorithmRuns.tsx index c7f0c5fc56..803a4d4158 100644 --- a/hat/assets/js/apps/Iaso/domains/algorithmRuns/hooks/api/useGetAlgorithmRuns.tsx +++ b/hat/assets/js/apps/Iaso/domains/algorithmRuns/hooks/api/useGetAlgorithmRuns.tsx @@ -22,7 +22,7 @@ export const useGetAlgorithmRuns = ({ params, enabled = false, }: Args): UseQueryResult => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { accountId, ...tableParams } = params; const apiParams = useApiParams(tableParams, tableDefaults); const queryString = new URLSearchParams(apiParams).toString(); diff --git a/hat/assets/js/apps/Iaso/domains/app/contexts/LocaleContext.tsx b/hat/assets/js/apps/Iaso/domains/app/contexts/LocaleContext.tsx index 0e271d263b..18570ac5d5 100644 --- a/hat/assets/js/apps/Iaso/domains/app/contexts/LocaleContext.tsx +++ b/hat/assets/js/apps/Iaso/domains/app/contexts/LocaleContext.tsx @@ -11,8 +11,7 @@ import { longDateFormats } from '../../../utils/dates'; const LocaleContext = createContext({ locale: moment.locale(), - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars - setLocale: (locale: LangOptions) => { + setLocale: (_locale: LangOptions) => { /* noop */ }, }); @@ -37,7 +36,6 @@ export const LocaleProvider = ({ children }) => { const value: { locale: LangOptions; - // eslint-disable-next-line no-unused-vars setLocale: (newLocale: LangOptions) => void; } = useMemo( () => ({ diff --git a/hat/assets/js/apps/Iaso/domains/app/types.ts b/hat/assets/js/apps/Iaso/domains/app/types.ts index fcad575b7f..e502fc1899 100644 --- a/hat/assets/js/apps/Iaso/domains/app/types.ts +++ b/hat/assets/js/apps/Iaso/domains/app/types.ts @@ -1,8 +1,8 @@ -import { ElementType, ReactNode } from 'react'; import { IntlMessage } from 'bluesquare-components'; +import { ElementType, ReactNode } from 'react'; import { - Redirection as RoutingRedirection, RouteCustom, + Redirection as RoutingRedirection, } from '../../routing/types'; export type MenuItem = { @@ -10,12 +10,10 @@ export type MenuItem = { permissions?: string[]; key?: string; mapKey?: string; - // eslint-disable-next-line no-unused-vars icon?: (props: Record) => ReactNode; subMenu?: MenuItems; extraPath?: string; url?: string; - // eslint-disable-next-line no-unused-vars isActive?: (pathname: string) => boolean; dev?: boolean; }; @@ -24,7 +22,6 @@ export type MenuItems = MenuItem[]; // TODO deprecate or update to react-router 6 export type Redirection = { path: string; - // eslint-disable-next-line no-unused-vars component: (args: any) => ReactNode; }; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsListTab.tsx b/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsListTab.tsx index a768e419ab..5a68d16466 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsListTab.tsx +++ b/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsListTab.tsx @@ -1,17 +1,17 @@ -import React, { FunctionComponent, MouseEvent, useCallback } from 'react'; import { Box, Divider } from '@mui/material'; -import get from 'lodash/get'; -import Color from 'color'; import { Column, Table, useRedirectTo } from 'bluesquare-components'; -import { AssignmentsApi, AssignmentParams } from '../types/assigment'; -import { AssignmentUnit } from '../types/locations'; -import { useColumns } from '../configs/AssignmentsListTabColumns'; -import { DropdownTeamsOptions, SubTeam, User, Team } from '../types/team'; -import { Profile } from '../../../utils/usersUtils'; +import Color from 'color'; +import get from 'lodash/get'; +import React, { FunctionComponent, MouseEvent, useCallback } from 'react'; import { baseUrls } from '../../../constants/urls'; -import { OrgUnit, ParentOrgUnit } from '../../orgUnits/types/orgUnit'; import { getStickyTableHeadStyles } from '../../../styles/utils'; +import { Profile } from '../../../utils/usersUtils'; +import { OrgUnit, ParentOrgUnit } from '../../orgUnits/types/orgUnit'; +import { useColumns } from '../configs/AssignmentsListTabColumns'; import { parentColor } from '../constants/colors'; +import { AssignmentParams, AssignmentsApi } from '../types/assigment'; +import { AssignmentUnit } from '../types/locations'; +import { DropdownTeamsOptions, SubTeam, Team, User } from '../types/team'; type Order = { id: string; @@ -39,15 +39,11 @@ type Props = { assignments: AssignmentsApi; isFetchingOrgUnits: boolean; params: AssignmentParams; - handleSaveAssignment: ( - // eslint-disable-next-line no-unused-vars - selectedOrgUnit: AssignmentUnit, - ) => void; + handleSaveAssignment: (selectedOrgUnit: AssignmentUnit) => void; teams: DropdownTeamsOptions[]; profiles: Profile[]; selectedItem: SubTeam | User | undefined; currentTeam?: Team; - // eslint-disable-next-line no-unused-vars setParentSelected: (orgUnit: ParentOrgUnit | undefined) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsMap.tsx b/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsMap.tsx index 42ff71c5e5..1c1054da66 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsMap.tsx +++ b/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsMap.tsx @@ -1,10 +1,10 @@ -import React, { FunctionComponent, useRef, useState, useMemo } from 'react'; +import React, { FunctionComponent, useMemo, useRef, useState } from 'react'; import { - MapContainer, GeoJSON, + MapContainer, Pane, - Tooltip, ScaleControl, + Tooltip, } from 'react-leaflet'; import { Box } from '@mui/material'; @@ -12,33 +12,33 @@ import { LoadingSpinner } from 'bluesquare-components'; import { Locations, OrgUnitMarker, OrgUnitShape } from '../types/locations'; +import MarkersListComponent from '../../../components/maps/markers/MarkersListComponent'; import { Tile } from '../../../components/maps/tools/TilesSwitchControl'; -import { MapLegend } from './MapLegend'; import { MapInfo } from './MapInfo'; -import MarkersListComponent from '../../../components/maps/markers/MarkersListComponent'; +import { MapLegend } from './MapLegend'; import { OrgUnitPopup } from './OrgUnitPopup'; +import tiles from '../../../constants/mapTiles'; import { disabledColor, - unSelectedColor, parentColor, + unSelectedColor, } from '../constants/colors'; -import tiles from '../../../constants/mapTiles'; import { Bounds, circleColorMarkerOptions, - getShapesBounds, getLatLngBounds, + getShapesBounds, } from '../../../utils/map/mapUtils'; import { Profile } from '../../../utils/usersUtils'; -import { DropdownTeamsOptions } from '../types/team'; -import { AssignmentParams, AssignmentsApi } from '../types/assigment'; -import { CustomZoomControl } from '../../../components/maps/tools/CustomZoomControl'; import { CustomTileLayer } from '../../../components/maps/tools/CustomTileLayer'; -import { AssignmentsMapSelectors } from './AssignmentsMapSelectors'; +import { CustomZoomControl } from '../../../components/maps/tools/CustomZoomControl'; import { DropdownOptions } from '../../../types/utils'; +import { AssignmentParams, AssignmentsApi } from '../types/assigment'; +import { DropdownTeamsOptions } from '../types/team'; +import { AssignmentsMapSelectors } from './AssignmentsMapSelectors'; const defaultViewport = { center: [1, 20], @@ -48,9 +48,7 @@ const defaultViewport = { type AnchorPoint = { x: number; y: number }; type Props = { - // eslint-disable-next-line no-unused-vars handleClick: (shape: OrgUnitShape | OrgUnitMarker) => void; - // eslint-disable-next-line no-unused-vars handleParentClick: (shape: OrgUnitShape) => void; teams: DropdownTeamsOptions[]; locations: Locations | undefined; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsMapTab.tsx b/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsMapTab.tsx index 690eaaaed3..2aa306718d 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsMapTab.tsx +++ b/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsMapTab.tsx @@ -2,16 +2,16 @@ import React, { FunctionComponent } from 'react'; import { AssignmentsMap } from './AssignmentsMap'; -import { AssignmentsApi, AssignmentParams } from '../types/assigment'; -import { Planning } from '../types/planning'; -import { Team, DropdownTeamsOptions } from '../types/team'; -import { OrgUnitShape, Locations, OrgUnitMarker } from '../types/locations'; import { Profile } from '../../../utils/usersUtils'; +import { AssignmentParams, AssignmentsApi } from '../types/assigment'; +import { Locations, OrgUnitMarker, OrgUnitShape } from '../types/locations'; +import { Planning } from '../types/planning'; +import { DropdownTeamsOptions, Team } from '../types/team'; +import { DropdownOptions } from '../../../types/utils'; +import { ParentOrgUnit } from '../../orgUnits/types/orgUnit'; import { useGetOrgUnitParentLocations } from '../hooks/requests/useGetOrgUnitParentLocations'; import { useGetOrgUnitParentIds } from '../hooks/useGetOrgUnitParentIds'; -import { ParentOrgUnit } from '../../orgUnits/types/orgUnit'; -import { DropdownOptions } from '../../../types/utils'; type Props = { allAssignments: AssignmentsApi; @@ -20,13 +20,11 @@ type Props = { teams: DropdownTeamsOptions[]; profiles: Profile[]; params: AssignmentParams; - // eslint-disable-next-line no-unused-vars setParentSelected: (orgUnit: ParentOrgUnit | undefined) => void; locations: Locations | undefined; isFetchingLocations: boolean; isLoadingAssignments: boolean; handleSaveAssignment: ( - // eslint-disable-next-line no-unused-vars selectedOrgUnit: OrgUnitShape | OrgUnitMarker, ) => void; orgunitTypes: Array>; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsSidebar.tsx b/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsSidebar.tsx index 7c26ebeb7c..62e31d6596 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsSidebar.tsx +++ b/hat/assets/js/apps/Iaso/domains/assignments/components/AssignmentsSidebar.tsx @@ -1,17 +1,17 @@ +import { Box, Paper } from '@mui/material'; import React, { FunctionComponent } from 'react'; -import { Paper, Box } from '@mui/material'; import { Table } from 'bluesquare-components'; import { AssignmentsApi } from '../types/assigment'; -import { Team, DropdownTeamsOptions, SubTeam, User } from '../types/team'; +import { DropdownTeamsOptions, SubTeam, Team, User } from '../types/team'; import { Profile } from '../../../utils/usersUtils'; import { useColumns } from '../configs/AssignmentsMapTabColumns'; -import { AssignmentUnit } from '../types/locations'; import { getStickyTableHeadStyles } from '../../../styles/utils'; +import { AssignmentUnit } from '../types/locations'; type Props = { data: SubTeam[] | User[]; @@ -19,10 +19,8 @@ type Props = { currentTeam: Team | undefined; teams: DropdownTeamsOptions[]; profiles: Profile[]; - // eslint-disable-next-line no-unused-vars setItemColor: (color: string, teamId: number) => void; selectedItem: SubTeam | User | undefined; - // eslint-disable-next-line no-unused-vars setSelectedItem: (newSelectedTeam: SubTeam) => void; orgUnits: Array; isLoadingAssignments: boolean; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/components/CheckBoxCell.tsx b/hat/assets/js/apps/Iaso/domains/assignments/components/CheckBoxCell.tsx index 4ca15dc3fc..26f7185250 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/components/CheckBoxCell.tsx +++ b/hat/assets/js/apps/Iaso/domains/assignments/components/CheckBoxCell.tsx @@ -1,6 +1,6 @@ +import { Box, Checkbox, Tooltip } from '@mui/material'; +import { IntlFormatMessage, useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent } from 'react'; -import { Box, Tooltip, Checkbox } from '@mui/material'; -import { useSafeIntl, IntlFormatMessage } from 'bluesquare-components'; import MESSAGES from '../messages'; import { ChildrenOrgUnitsArrayItem } from '../types/orgUnit'; import { SubTeam, User } from '../types/team'; @@ -10,7 +10,6 @@ type Props = { orgUnitsToUpdate: Array; mode: 'UNASSIGN' | 'ASSIGN'; selectedItem: SubTeam | User | undefined; - // eslint-disable-next-line no-unused-vars setOrgUnitsToUpdate: (orgUnitsToUpdate: Array) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/components/ParentDialog.tsx b/hat/assets/js/apps/Iaso/domains/assignments/components/ParentDialog.tsx index ffa11a6c7d..a850ee0a24 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/components/ParentDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/assignments/components/ParentDialog.tsx @@ -1,35 +1,35 @@ import { + Box, + Button, Dialog, + DialogActions, DialogContent, DialogTitle, - DialogActions, - Button, - Box, Divider, } from '@mui/material'; import { makeStyles } from '@mui/styles'; -import { commonStyles, useSafeIntl, Table } from 'bluesquare-components'; +import { commonStyles, Table, useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent, - useState, - useEffect, useCallback, + useEffect, useMemo, + useState, } from 'react'; -import { ChildrenOrgUnits } from '../types/orgUnit'; -import { SubTeam, User, DropdownTeamsOptions, Team } from '../types/team'; -import { SaveAssignmentQuery } from '../types/assigment'; import { Profile } from '../../../utils/usersUtils'; +import { SaveAssignmentQuery } from '../types/assigment'; +import { ChildrenOrgUnits } from '../types/orgUnit'; import { Planning } from '../types/planning'; +import { DropdownTeamsOptions, SubTeam, Team, User } from '../types/team'; import { useColumns } from '../configs/ParentDialogColumns'; -import { getTeamUserName, getMultiSaveParams } from '../utils'; +import { getMultiSaveParams, getTeamUserName } from '../utils'; -import MESSAGES from '../messages'; -import { ParentOrgUnit } from '../../orgUnits/types/orgUnit'; import { getStickyTableHeadStyles } from '../../../styles/utils'; +import { ParentOrgUnit } from '../../orgUnits/types/orgUnit'; +import MESSAGES from '../messages'; type Props = { currentTeam: Team | undefined; @@ -37,12 +37,10 @@ type Props = { profiles: Profile[]; childrenOrgunits: ChildrenOrgUnits | undefined; parentSelected: ParentOrgUnit | undefined; - // eslint-disable-next-line no-unused-vars setParentSelected: (orgUnit: ParentOrgUnit | undefined) => void; selectedItem: SubTeam | User | undefined; planning: Planning | undefined; isFetchingChildrenOrgunits: boolean; - // eslint-disable-next-line no-unused-vars saveMultiAssignments: (params: SaveAssignmentQuery) => void; }; const useStyles = makeStyles(theme => ({ diff --git a/hat/assets/js/apps/Iaso/domains/assignments/configs/AssignmentsMapTabColumns.tsx b/hat/assets/js/apps/Iaso/domains/assignments/configs/AssignmentsMapTabColumns.tsx index 9bf49a358e..012376e419 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/configs/AssignmentsMapTabColumns.tsx +++ b/hat/assets/js/apps/Iaso/domains/assignments/configs/AssignmentsMapTabColumns.tsx @@ -1,12 +1,12 @@ -import React, { useMemo, useCallback } from 'react'; import { Box, Radio } from '@mui/material'; import { Theme, useTheme } from '@mui/material/styles'; -import { useSafeIntl, Column, IntlFormatMessage } from 'bluesquare-components'; +import { Column, IntlFormatMessage, useSafeIntl } from 'bluesquare-components'; +import React, { useCallback, useMemo } from 'react'; import { ColorPicker } from '../../../components/forms/ColorPicker'; import { AssignmentsApi } from '../types/assigment'; -import { DropdownTeamsOptions, SubTeam, User, Team } from '../types/team'; +import { DropdownTeamsOptions, SubTeam, Team, User } from '../types/team'; import { Profile } from '../../../utils/usersUtils'; import { AssignmentUnit } from '../types/locations'; @@ -21,10 +21,8 @@ type Props = { assignments: AssignmentsApi; teams: DropdownTeamsOptions[]; profiles: Profile[]; - // eslint-disable-next-line no-unused-vars setItemColor: (color: string, teamId: number) => void; selectedItem: SubTeam | User | undefined; - // eslint-disable-next-line no-unused-vars setSelectedItem: (newSelectedTeam: SubTeam) => void; currentTeam: Team | undefined; orgUnits: Array; @@ -87,19 +85,17 @@ export const useColumns = ({ width: 30, Cell: settings => { return ( - <> - - - setSelectedItem(settings.row.original) - } - /> - - + + + setSelectedItem(settings.row.original) + } + /> + ); }, }, diff --git a/hat/assets/js/apps/Iaso/domains/assignments/configs/ParentDialogColumns.tsx b/hat/assets/js/apps/Iaso/domains/assignments/configs/ParentDialogColumns.tsx index 8dbc28d55e..d140fa1ff6 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/configs/ParentDialogColumns.tsx +++ b/hat/assets/js/apps/Iaso/domains/assignments/configs/ParentDialogColumns.tsx @@ -1,6 +1,6 @@ import React, { useMemo } from 'react'; -import { useSafeIntl, Column, IntlFormatMessage } from 'bluesquare-components'; +import { Column, IntlFormatMessage, useSafeIntl } from 'bluesquare-components'; import { SubTeam, User } from '../types/team'; @@ -11,7 +11,6 @@ import MESSAGES from '../messages'; type Props = { orgUnitsToUpdate: Array; - // eslint-disable-next-line no-unused-vars setOrgUnitsToUpdate: (ids: Array) => void; selectedItem: SubTeam | User | undefined; mode: 'UNASSIGN' | 'ASSIGN'; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/hooks/useGetAssignmentData.ts b/hat/assets/js/apps/Iaso/domains/assignments/hooks/useGetAssignmentData.ts index 67456bfce4..e4b5d48952 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/hooks/useGetAssignmentData.ts +++ b/hat/assets/js/apps/Iaso/domains/assignments/hooks/useGetAssignmentData.ts @@ -1,27 +1,27 @@ import { useMemo } from 'react'; -import { Planning } from '../types/planning'; -import { SubTeam, User, Team, DropdownTeamsOptions } from '../types/team'; -import { Locations } from '../types/locations'; import { DropdownOptions } from '../../../types/utils'; -import { ChildrenOrgUnits } from '../types/orgUnit'; import { AssignmentApi, SaveAssignmentQuery } from '../types/assigment'; +import { Locations } from '../types/locations'; +import { ChildrenOrgUnits } from '../types/orgUnit'; +import { Planning } from '../types/planning'; +import { DropdownTeamsOptions, SubTeam, Team, User } from '../types/team'; -import { useGetTeams } from './requests/useGetTeams'; -import { useGetProfiles, ProfileWithColor } from './requests/useGetProfiles'; import { - useSaveAssignment, - useBulkSaveAssignments, -} from './requests/useSaveAssignment'; + AssignmentsResult, + useGetAssignments, +} from './requests/useGetAssignments'; import { useGetOrgUnitTypes } from './requests/useGetOrgUnitTypes'; -import { useGetOrgUnitsByParent } from './requests/useGetOrgUnitsByParent'; import { useGetOrgUnits, useGetOrgUnitsList } from './requests/useGetOrgUnits'; -import { useGetOrgUnitParentIds } from './useGetOrgUnitParentIds'; +import { useGetOrgUnitsByParent } from './requests/useGetOrgUnitsByParent'; import { useGetPlanning } from './requests/useGetPlanning'; +import { ProfileWithColor, useGetProfiles } from './requests/useGetProfiles'; +import { useGetTeams } from './requests/useGetTeams'; import { - useGetAssignments, - AssignmentsResult, -} from './requests/useGetAssignments'; + useBulkSaveAssignments, + useSaveAssignment, +} from './requests/useSaveAssignment'; +import { useGetOrgUnitParentIds } from './useGetOrgUnitParentIds'; import { useBoundState } from '../../../hooks/useBoundState'; import { OrgUnit, ParentOrgUnit } from '../../orgUnits/types/orgUnit'; @@ -40,9 +40,7 @@ type Result = { planning: Planning | undefined; assignments: AssignmentApi[]; allAssignments: AssignmentApi[]; - // eslint-disable-next-line no-unused-vars saveAssignment: (params: SaveAssignmentQuery) => void; - // eslint-disable-next-line no-unused-vars saveMultiAssignments: (params: SaveAssignmentQuery) => void; teams: DropdownTeamsOptions[] | undefined; profiles: ProfileWithColor[]; @@ -59,7 +57,6 @@ type Result = { isFetchingChildrenOrgunits: boolean; isLoadingAssignments: boolean; isTeamsFetched: boolean; - // eslint-disable-next-line no-unused-vars setItemColor: (color: string, itemId: number) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/completenessStats/hooks/api/useGetCompletnessMapStats.ts b/hat/assets/js/apps/Iaso/domains/completenessStats/hooks/api/useGetCompletnessMapStats.ts index dbc7209e9c..04698e1e18 100644 --- a/hat/assets/js/apps/Iaso/domains/completenessStats/hooks/api/useGetCompletnessMapStats.ts +++ b/hat/assets/js/apps/Iaso/domains/completenessStats/hooks/api/useGetCompletnessMapStats.ts @@ -3,8 +3,8 @@ import { getRequest } from '../../../../libs/Api'; import { useSnackQuery } from '../../../../libs/apiHooks'; import { CompletenessMapApiResponse, - CompletenessRouterParams, CompletenessMapStats, + CompletenessRouterParams, } from '../../types'; // Correspondance between the name in the filter object and what the API expect @@ -30,7 +30,6 @@ const getParams = (params: CompletenessRouterParams) => { export const buildQueryString = ( params: CompletenessRouterParams, ): URLSearchParams => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const queryParams = {}; queryParamsMap.forEach((value, key) => { if (params[key]) { diff --git a/hat/assets/js/apps/Iaso/domains/completenessStats/utils.tsx b/hat/assets/js/apps/Iaso/domains/completenessStats/utils.tsx index 08dceb1ce1..530e672ac7 100644 --- a/hat/assets/js/apps/Iaso/domains/completenessStats/utils.tsx +++ b/hat/assets/js/apps/Iaso/domains/completenessStats/utils.tsx @@ -1,7 +1,6 @@ import { useCallback } from 'react'; import { useGenUrl } from '../../routing/routing'; -// eslint-disable-next-line no-unused-vars type GetParentPageUrl = (parentOrgUnitId?: number | string) => string; export const useGetParentPageUrl = (): GetParentPageUrl => { diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/AddNewEmptyVersion.tsx b/hat/assets/js/apps/Iaso/domains/dataSources/components/AddNewEmptyVersion.tsx index 05c83a4611..a68f2c4acf 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/AddNewEmptyVersion.tsx +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/AddNewEmptyVersion.tsx @@ -1,13 +1,12 @@ -import React, { FunctionComponent, ReactNode, useState } from 'react'; import { Grid, Typography } from '@mui/material'; import { LoadingSpinner, useSafeIntl } from 'bluesquare-components'; -import MESSAGES from '../messages'; +import React, { FunctionComponent, ReactNode, useState } from 'react'; import ConfirmCancelDialogComponent from '../../../components/dialogs/ConfirmCancelDialogComponent'; +import MESSAGES from '../messages'; import { useCreateSourceVersion } from '../requests'; import { VersionDescription } from './VersionDescription'; type Props = { - // eslint-disable-next-line no-unused-vars renderTrigger: ({ openDialog }: { openDialog: any }) => ReactNode; sourceId: number; }; @@ -16,7 +15,6 @@ export const AddNewEmptyVersion: FunctionComponent = ({ renderTrigger, sourceId, }) => { - // eslint-disable-next-line no-unused-vars const [description, setDescription] = useState(''); const { mutateAsync: createSourceVersion } = useCreateSourceVersion(); const { formatMessage } = useSafeIntl(); diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/AddTaskComponent.js b/hat/assets/js/apps/Iaso/domains/dataSources/components/AddTaskComponent.js index 55b72e76c9..d399c4cc84 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/AddTaskComponent.js +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/AddTaskComponent.js @@ -1,16 +1,16 @@ -import React, { useState } from 'react'; import { Grid, Typography } from '@mui/material'; -import { FormattedMessage } from 'react-intl'; import { LoadingSpinner, useRedirectTo } from 'bluesquare-components'; import PropTypes from 'prop-types'; -import MESSAGES from '../messages'; +import React, { useState } from 'react'; +import { FormattedMessage } from 'react-intl'; import ConfirmCancelDialogComponent from '../../../components/dialogs/ConfirmCancelDialogComponent'; -import { EditableTextFields } from '../../../components/forms/EditableTextFields'; import { Checkboxes } from '../../../components/forms/Checkboxes'; +import { EditableTextFields } from '../../../components/forms/EditableTextFields'; import { baseUrls } from '../../../constants/urls.ts'; -import { sendDhisOuImporterRequest } from '../requests'; import { useFormState } from '../../../hooks/form'; import { useSnackMutation } from '../../../libs/apiHooks.ts'; +import MESSAGES from '../messages'; +import { sendDhisOuImporterRequest } from '../requests'; import { VersionDescription } from './VersionDescription.tsx'; const initialFormState = sourceCredentials => { @@ -30,8 +30,7 @@ const AddTask = ({ sourceVersionNumber, sourceCredentials, }) => { - // eslint-disable-next-line no-unused-vars - const [form, setFormField, _, setFormState] = useFormState( + const [form, setFormField, , setFormState] = useFormState( initialFormState(sourceCredentials), ); const [withExistingDhis2Settings, setWithExistingDhis2Settings] = useState( diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/ExportToDHIS2Dialog.js b/hat/assets/js/apps/Iaso/domains/dataSources/components/ExportToDHIS2Dialog.js index 00145cdf4c..9045cf25c4 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/ExportToDHIS2Dialog.js +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/ExportToDHIS2Dialog.js @@ -14,7 +14,7 @@ import { convertFormStateToDict, } from '../../../utils/forms'; import { useGetValidationStatus } from '../../forms/hooks/useGetValidationStatus.ts'; -import { OrgUnitTreeviewModal } from '../../orgUnits/components/TreeView/OrgUnitTreeviewModal'; +import { OrgUnitTreeviewModal } from '../../orgUnits/components/TreeView/OrgUnitTreeviewModal.tsx'; import MESSAGES from '../messages'; import { csvPreview, @@ -89,13 +89,9 @@ export const ExportToDHIS2Dialog = ({ const [isCSVLoading, setIsCsvLoading] = useState(false); - const [ - exportData, - setExportDataField, - // eslint-disable-next-line no-unused-vars - _setExportDataErrors, - setExportData, - ] = useFormState(initialExportData(defaultVersionId)); + const [exportData, setExportDataField, , setExportData] = useFormState( + initialExportData(defaultVersionId), + ); const sourceVersion = sourceVersions?.find( v => v.id.toString() === exportData.source_version_id.value, diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/ImportGeoPkgDialog.js b/hat/assets/js/apps/Iaso/domains/dataSources/components/ImportGeoPkgDialog.js index 315849fda9..1ce7d35df3 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/ImportGeoPkgDialog.js +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/ImportGeoPkgDialog.js @@ -1,16 +1,20 @@ -import React from 'react'; -import PropTypes from 'prop-types'; import { Grid, Typography } from '@mui/material'; -import { LoadingSpinner, useSafeIntl, useRedirectTo } from 'bluesquare-components'; +import { + LoadingSpinner, + useRedirectTo, + useSafeIntl, +} from 'bluesquare-components'; +import PropTypes from 'prop-types'; +import React from 'react'; import { FormattedMessage } from 'react-intl'; -import { useFormState } from '../../../hooks/form'; import ConfirmCancelDialogComponent from '../../../components/dialogs/ConfirmCancelDialogComponent'; -import { baseUrls } from '../../../constants/urls'; import FileInputComponent from '../../../components/forms/FileInputComponent'; -import MESSAGES from '../messages'; import InputComponent from '../../../components/forms/InputComponent.tsx'; -import { postGeoPkg } from '../requests'; +import { baseUrls } from '../../../constants/urls.ts'; +import { useFormState } from '../../../hooks/form'; import { useSnackMutation } from '../../../libs/apiHooks.ts'; +import MESSAGES from '../messages'; +import { postGeoPkg } from '../requests'; import { VersionDescription } from './VersionDescription.tsx'; const initialFormState = () => ({ @@ -26,10 +30,8 @@ const ImportGeoPkgDialog = ({ versionNumber, projects, }) => { - // eslint-disable-next-line no-unused-vars - const [form, setFormField, _, setFormState] = useFormState( - initialFormState(), - ); + const [form, setFormField, , setFormState] = + useFormState(initialFormState()); const { formatMessage } = useSafeIntl(); const redirectTo = useRedirectTo(); diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/VersionDescription.tsx b/hat/assets/js/apps/Iaso/domains/dataSources/components/VersionDescription.tsx index 7e77ab6f5a..70ed979722 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/VersionDescription.tsx +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/VersionDescription.tsx @@ -1,11 +1,10 @@ -import React, { FunctionComponent } from 'react'; import { useSafeIntl } from 'bluesquare-components'; -import MESSAGES from '../messages'; +import React, { FunctionComponent } from 'react'; import InputComponent from '../../../components/forms/InputComponent'; +import MESSAGES from '../messages'; type Props = { formValue: string; - // eslint-disable-next-line no-unused-vars onChangeDescription: (field: string, value: string) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/useGetDataSources.ts b/hat/assets/js/apps/Iaso/domains/dataSources/useGetDataSources.ts index 5762cc4489..2a4ac76c50 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/useGetDataSources.ts +++ b/hat/assets/js/apps/Iaso/domains/dataSources/useGetDataSources.ts @@ -27,7 +27,7 @@ const getParams = (params: Record) => { export const useGetDataSources = ( params: Record, ): UseQueryResult => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { accountId, ...tableParams } = getParams(params); const apiParams = useApiParams(tableParams, tableDefaults); const queryString = new URLSearchParams(apiParams).toString(); diff --git a/hat/assets/js/apps/Iaso/domains/devices/hooks/api/useGetDevices.tsx b/hat/assets/js/apps/Iaso/domains/devices/hooks/api/useGetDevices.tsx index 4af2f581d3..ea45922246 100644 --- a/hat/assets/js/apps/Iaso/domains/devices/hooks/api/useGetDevices.tsx +++ b/hat/assets/js/apps/Iaso/domains/devices/hooks/api/useGetDevices.tsx @@ -13,7 +13,7 @@ export const tableDefaults = { export const useGetDevices = ( params: Record, ): UseQueryResult => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { accountId, ...tableParams } = params; const apiParams = useApiParams(tableParams, tableDefaults); const queryString = new URLSearchParams(apiParams).toString(); diff --git a/hat/assets/js/apps/Iaso/domains/entities/config.tsx b/hat/assets/js/apps/Iaso/domains/entities/config.tsx index 134b461d09..09ac21708a 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/config.tsx @@ -1,35 +1,34 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable camelcase */ -import React, { ReactElement, useMemo } from 'react'; import { - IconButton as IconButtonComponent, - useSafeIntl, Column, + IconButton as IconButtonComponent, IntlFormatMessage, LinkWithLocation, textPlaceholder, + useSafeIntl, } from 'bluesquare-components'; +import React, { ReactElement, useMemo } from 'react'; -import moment from 'moment'; -import _ from 'lodash'; import FileCopyIcon from '@mui/icons-material/FileCopy'; -import { LinkToOrgUnit } from '../orgUnits/components/LinkToOrgUnit'; +import _ from 'lodash'; +import moment from 'moment'; import { DateCell, DateTimeCell, DateTimeCellRfc, } from '../../components/Cells/DateTimeCell'; +import { LinkToOrgUnit } from '../orgUnits/components/LinkToOrgUnit'; import MESSAGES from './messages'; import { baseUrls } from '../../constants/urls'; -import { ExtraColumn } from './types/fields'; import getDisplayName from '../../utils/usersUtils'; -import { useGetFieldValue } from './hooks/useGetFieldValue'; -import { formatLabel } from '../instances/utils'; import { LinkToInstance } from '../instances/components/LinkToInstance'; +import { formatLabel } from '../instances/utils'; import { filterOrgUnitsByGroupUrl } from '../orgUnits/utils'; +import { useGetFieldValue } from './hooks/useGetFieldValue'; +import { ExtraColumn } from './types/fields'; export const baseUrl = baseUrls.entities; diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/DuplicateDetailsTableButtons.tsx b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/DuplicateDetailsTableButtons.tsx index c37231add0..e1a9b3915e 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/DuplicateDetailsTableButtons.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/DuplicateDetailsTableButtons.tsx @@ -1,21 +1,19 @@ -import React, { FunctionComponent, SetStateAction } from 'react'; import { Box, Button, Grid } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; +import React, { FunctionComponent, SetStateAction } from 'react'; import InputComponent from '../../../../components/forms/InputComponent'; -import MESSAGES from '../messages'; -import { useCurrentUser } from '../../../../utils/usersUtils'; -import { userHasPermission } from '../../../users/utils'; -import * as Permission from '../../../../utils/permissions'; import { - hasFeatureFlag, ENTITY_DUPLICATES_SOFT_DELETE, + hasFeatureFlag, } from '../../../../utils/featureFlags'; +import * as Permission from '../../../../utils/permissions'; +import { useCurrentUser } from '../../../../utils/usersUtils'; +import { userHasPermission } from '../../../users/utils'; +import MESSAGES from '../messages'; type Props = { onlyShowUnmatched: boolean; - // eslint-disable-next-line no-unused-vars setOnlyShowUnmatched: (value: SetStateAction) => void; - // eslint-disable-next-line no-unused-vars fillValues: (entity: 'entity1' | 'entity2') => void; resetSelection: () => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/DuplicateInfos.tsx b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/DuplicateInfos.tsx index c1ecbe24e2..186b9cedbe 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/DuplicateInfos.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/DuplicateInfos.tsx @@ -1,27 +1,26 @@ -import React, { FunctionComponent, useCallback } from 'react'; import { Box, Button, Grid } from '@mui/material'; import { makeStyles } from '@mui/styles'; +import { useRedirectTo, useSafeIntl } from 'bluesquare-components'; import classnames from 'classnames'; -import { useSafeIntl, useRedirectTo } from 'bluesquare-components'; +import React, { FunctionComponent, useCallback } from 'react'; import WidgetPaper from '../../../../components/papers/WidgetPaperComponent'; -import MESSAGES from '../messages'; -import { useMergeDuplicate } from '../hooks/api/useMergeDuplicate'; -import { useIgnoreDuplicate } from '../hooks/api/useIgnoreDuplicate'; -import { useSoftDeleteBeneficiary } from '../../hooks/requests'; import { formSuccessFullMessageKey, succesfullSnackBar, - // successfullSnackBarWithButtons, } from '../../../../constants/snackBars'; import { baseUrls } from '../../../../constants/urls'; -import { useCurrentUser } from '../../../../utils/usersUtils'; -import { userHasPermission } from '../../../users/utils'; -import { DuplicateInfosTable } from './DuplicateInfosTable'; -import * as Permission from '../../../../utils/permissions'; import { - hasFeatureFlag, ENTITY_DUPLICATES_SOFT_DELETE, + hasFeatureFlag, } from '../../../../utils/featureFlags'; +import * as Permission from '../../../../utils/permissions'; +import { useCurrentUser } from '../../../../utils/usersUtils'; +import { userHasPermission } from '../../../users/utils'; +import { useSoftDeleteBeneficiary } from '../../hooks/requests'; +import { useIgnoreDuplicate } from '../hooks/api/useIgnoreDuplicate'; +import { useMergeDuplicate } from '../hooks/api/useMergeDuplicate'; +import MESSAGES from '../messages'; +import { DuplicateInfosTable } from './DuplicateInfosTable'; type Props = { isLoading: boolean; @@ -68,8 +67,7 @@ export const DuplicateInfos: FunctionComponent = ({ const classes: Record = useStyles(); const redirectTo = useRedirectTo(); - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars - const successSnackBar = (msg, data) => { + const successSnackBar = (msg, _data) => { return succesfullSnackBar(formSuccessFullMessageKey, msg); // TODO uncomment when we figured out how to style the button // return successfullSnackBar({ diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useDuplicationDetailsColumns.tsx b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useDuplicationDetailsColumns.tsx index e413eda970..fa95d0bff5 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useDuplicationDetailsColumns.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useDuplicationDetailsColumns.tsx @@ -1,26 +1,21 @@ -import React, { useMemo } from 'react'; -import { useSafeIntl, Column } from 'bluesquare-components'; import { Box } from '@mui/material'; -import MESSAGES from '../../messages'; -import { formatLabel } from '../../../../instances/utils'; +import { Column, useSafeIntl } from 'bluesquare-components'; +import React, { useMemo } from 'react'; import { convertValueIfDate } from '../../../../../components/Cells/DateTimeCell'; -import { DuplicateEntityForTable } from '../../types'; -import { useEntityCell } from './useEntityCell'; import { findDescriptorInChildren } from '../../../../../utils'; import { - hasFeatureFlag, ENTITY_DUPLICATES_SOFT_DELETE, + hasFeatureFlag, } from '../../../../../utils/featureFlags'; import { useCurrentUser } from '../../../../../utils/usersUtils'; +import { formatLabel } from '../../../../instances/utils'; +import MESSAGES from '../../messages'; +import { DuplicateEntityForTable } from '../../types'; +import { useEntityCell } from './useEntityCell'; type UseDuplicationDetailsColumnsArgs = { state: DuplicateEntityForTable[]; - updateCellState: ( - // eslint-disable-next-line no-unused-vars - index: number, - // eslint-disable-next-line no-unused-vars - value: DuplicateEntityForTable, - ) => void; + updateCellState: (index: number, value: DuplicateEntityForTable) => void; setQuery: React.Dispatch; descriptors: { descriptor1: any; descriptor2: any }; }; diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useEntityCell.ts b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useEntityCell.ts index 4ce0a21a1e..6adb138cb3 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useEntityCell.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useEntityCell.ts @@ -1,5 +1,5 @@ -import { useCallback, Dispatch } from 'react'; import { isEqual } from 'lodash'; +import { Dispatch, useCallback } from 'react'; import { DuplicateEntityForTable, EntityForTableData } from '../../types'; const getEntityStatus = ( @@ -51,12 +51,7 @@ type UseEntityCellArgs = { entity1: EntityForTableData | undefined; entity2: EntityForTableData | undefined; state: DuplicateEntityForTable[]; - updateCellState: ( - // eslint-disable-next-line no-unused-vars - index: number, - // eslint-disable-next-line no-unused-vars - value: DuplicateEntityForTable, - ) => void; + updateCellState: (index: number, value: DuplicateEntityForTable) => void; setQuery: Dispatch; key: 'entity1' | 'entity2'; }; diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useIgnoreDuplicate.ts b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useIgnoreDuplicate.ts index 54843d1ea2..81223d3f9a 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useIgnoreDuplicate.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useIgnoreDuplicate.ts @@ -1,7 +1,7 @@ /* eslint-disable camelcase */ import { UseMutationResult } from 'react-query'; -import { useSnackMutation } from '../../../../../libs/apiHooks'; import { postRequest } from '../../../../../libs/Api'; +import { useSnackMutation } from '../../../../../libs/apiHooks'; type IgnoreDuplicateArgs = { entity1_id: number; @@ -16,8 +16,7 @@ const ignoreDuplicate = (query: IgnoreDuplicateArgs) => { }; export const useIgnoreDuplicate = ( - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function - onSuccess: (data: any) => void = _data => {}, + onSuccess: (data: any) => void = _data => null, ): UseMutationResult => { return useSnackMutation({ mutationFn: args => ignoreDuplicate(args), diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useMergeDuplicate.ts b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useMergeDuplicate.ts index 579c58ebf1..bfe496e074 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useMergeDuplicate.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useMergeDuplicate.ts @@ -1,7 +1,7 @@ /* eslint-disable camelcase */ import { UseMutationResult } from 'react-query'; -import { useSnackMutation } from '../../../../../libs/apiHooks'; import { postRequest } from '../../../../../libs/Api'; +import { useSnackMutation } from '../../../../../libs/apiHooks'; const apiUrl = '/api/entityduplicates/'; @@ -17,8 +17,7 @@ const mergeDuplicate = (query: UseMergeDuplicatesParams) => { export const useMergeDuplicate = ( successSnackBar: any, - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function - onSuccess: (data: any) => void = _data => {}, + onSuccess: (data: any) => void = _data => null, ): UseMutationResult => { return useSnackMutation({ mutationFn: query => mergeDuplicate(query), diff --git a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/EntityTypesDialog.tsx b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/EntityTypesDialog.tsx index 4a063b961b..89b9f1e7fb 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/EntityTypesDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/EntityTypesDialog.tsx @@ -1,25 +1,25 @@ /* eslint-disable camelcase */ -import React, { ReactNode, FunctionComponent, useState } from 'react'; -import { useFormik, FormikProvider, FormikProps } from 'formik'; -import * as yup from 'yup'; +import { Box } from '@mui/material'; import { - useSafeIntl, + IconButton, IntlFormatMessage, IntlMessage, - IconButton, + useSafeIntl, } from 'bluesquare-components'; -import { Box } from '@mui/material'; +import { FormikProps, FormikProvider, useFormik } from 'formik'; import isEqual from 'lodash/isEqual'; +import React, { FunctionComponent, ReactNode, useState } from 'react'; +import * as yup from 'yup'; -import InputComponent from '../../../../components/forms/InputComponent'; import ConfirmCancelDialogComponent from '../../../../components/dialogs/ConfirmCancelDialogComponent'; +import InputComponent from '../../../../components/forms/InputComponent'; import { EntityType } from '../types/entityType'; -import { useGetFormForEntityType, useGetForms } from '../hooks/requests/forms'; +import { baseUrls } from '../../../../constants/urls'; import { useTranslatedErrors } from '../../../../libs/validation'; -import MESSAGES from '../messages'; import { formatLabel } from '../../../instances/utils'; -import { baseUrls } from '../../../../constants/urls'; +import { useGetFormForEntityType, useGetForms } from '../hooks/requests/forms'; +import MESSAGES from '../messages'; type RenderTriggerProps = { openDialog: () => void; @@ -29,13 +29,10 @@ type EmptyEntityType = Partial; type Props = { titleMessage: IntlMessage; - // eslint-disable-next-line no-unused-vars renderTrigger: ({ openDialog }: RenderTriggerProps) => ReactNode; initialData?: EntityType | EmptyEntityType; saveEntityType: ( - // eslint-disable-next-line no-unused-vars e: EntityType | EmptyEntityType, - // eslint-disable-next-line no-unused-vars options: Record void>, ) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/config.tsx b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/config.tsx index 57bd2398ad..7834ec8786 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/config.tsx @@ -1,21 +1,21 @@ -import React, { ReactElement, useMemo } from 'react'; import DataSourceIcon from '@mui/icons-material/ListAltTwoTone'; import { - IconButton as IconButtonComponent, Column, + IconButton as IconButtonComponent, useSafeIntl, } from 'bluesquare-components'; -import { EntityTypesDialog } from './components/EntityTypesDialog'; -import DeleteDialog from '../../../components/dialogs/DeleteDialogComponent'; +import React, { ReactElement, useMemo } from 'react'; import { DateTimeCell } from '../../../components/Cells/DateTimeCell'; +import DeleteDialog from '../../../components/dialogs/DeleteDialogComponent'; import Workflow from '../../../components/svg/Workflow'; +import { EntityTypesDialog } from './components/EntityTypesDialog'; import MESSAGES from './messages'; import { baseUrls } from '../../../constants/urls'; -import { EntityType } from './types/entityType'; import { userHasPermission } from '../../users/utils'; +import { EntityType } from './types/entityType'; import * as Permission from '../../../utils/permissions'; import { useCurrentUser } from '../../../utils/usersUtils'; @@ -23,9 +23,7 @@ import { useCurrentUser } from '../../../utils/usersUtils'; export const baseUrl = baseUrls.entityTypes; type Props = { - // eslint-disable-next-line no-unused-vars deleteEntityType: (e: EntityType) => void; - // eslint-disable-next-line no-unused-vars saveEntityType: (e: EntityType) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/entities/hooks/useFiltersParams.ts b/hat/assets/js/apps/Iaso/domains/entities/hooks/useFiltersParams.ts index 0cd301f429..fe712aec7a 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/hooks/useFiltersParams.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/hooks/useFiltersParams.ts @@ -1,13 +1,11 @@ -import { getSort, Column } from 'bluesquare-components'; +import { Column, getSort } from 'bluesquare-components'; -import { useStaticColumns, defaultSorted } from '../config'; +import { defaultSorted, useStaticColumns } from '../config'; import { Filters, Params } from '../types/filters'; export const useFiltersParams = (): (( - // eslint-disable-next-line no-unused-vars params: Params, - // eslint-disable-next-line no-unused-vars filters: Filters, ) => Params) => { const staticColumns: Array = useStaticColumns(); diff --git a/hat/assets/js/apps/Iaso/domains/entities/hooks/useGetFieldValue.ts b/hat/assets/js/apps/Iaso/domains/entities/hooks/useGetFieldValue.ts index 4fc2323c89..a350d37ed5 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/hooks/useGetFieldValue.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/hooks/useGetFieldValue.ts @@ -1,8 +1,7 @@ -/* eslint-disable no-unused-vars */ -import moment from 'moment'; import { useSafeIntl } from 'bluesquare-components'; +import moment from 'moment'; -import { FileContent, Beneficiary } from '../types/beneficiary'; +import { Beneficiary, FileContent } from '../types/beneficiary'; import { FieldType } from '../../forms/types/forms'; diff --git a/hat/assets/js/apps/Iaso/domains/forms/components/AttachmentModal.tsx b/hat/assets/js/apps/Iaso/domains/forms/components/AttachmentModal.tsx index d28dd594e5..e57a7983c1 100644 --- a/hat/assets/js/apps/Iaso/domains/forms/components/AttachmentModal.tsx +++ b/hat/assets/js/apps/Iaso/domains/forms/components/AttachmentModal.tsx @@ -1,10 +1,10 @@ import React, { FunctionComponent, useCallback, useState } from 'react'; import { - useSafeIntl, ConfirmCancelModal, - makeFullModal, FilesUpload, + makeFullModal, + useSafeIntl, } from 'bluesquare-components'; import { Box, Typography } from '@mui/material'; @@ -17,7 +17,6 @@ type Props = { id?: string; dataTestId?: string; closeDialog: () => void; - // eslint-disable-next-line no-unused-vars upload: (file: File[]) => void; isUploading: boolean; }; diff --git a/hat/assets/js/apps/Iaso/domains/forms/components/FormFormComponent.tsx b/hat/assets/js/apps/Iaso/domains/forms/components/FormFormComponent.tsx index 79268bd589..336034502b 100644 --- a/hat/assets/js/apps/Iaso/domains/forms/components/FormFormComponent.tsx +++ b/hat/assets/js/apps/Iaso/domains/forms/components/FormFormComponent.tsx @@ -1,13 +1,13 @@ /* eslint-disable camelcase */ -import React, { FunctionComponent, useEffect, useMemo, useState } from 'react'; +import { FormatListBulleted, History } from '@mui/icons-material'; import { Box, Grid, Theme, Typography } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { - useSafeIntl, - LinkWithLocation, ExternalLink, + LinkWithLocation, + useSafeIntl, } from 'bluesquare-components'; -import { FormatListBulleted, History } from '@mui/icons-material'; +import React, { FunctionComponent, useEffect, useMemo, useState } from 'react'; import { DisplayIfUserHasPerm } from '../../../components/DisplayIfUserHasPerm'; import InputComponent from '../../../components/forms/InputComponent'; import { baseUrls } from '../../../constants/urls'; @@ -15,6 +15,7 @@ import { commaSeparatedIdsToArray, commaSeparatedIdsToStringArray, } from '../../../utils/forms'; +import { SUBMISSIONS, SUBMISSIONS_UPDATE } from '../../../utils/permissions'; import { formatLabel } from '../../instances/utils'; import { useGetOrgUnitTypesDropdownOptions } from '../../orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypesDropdownOptions'; import { @@ -22,11 +23,10 @@ import { periodTypeOptionsWithNoPeriod, } from '../../periods/constants'; import { useGetProjectsDropdownOptions } from '../../projects/hooks/requests'; +import { CR_MODE_NONE, changeRequestModeOptions } from '../constants'; import MESSAGES from '../messages'; import { FormDataType } from '../types/forms'; import { FormLegendInput } from './FormLegendInput'; -import { CR_MODE_NONE, changeRequestModeOptions } from '../constants'; -import { SUBMISSIONS, SUBMISSIONS_UPDATE } from '../../../utils/permissions'; const useStyles = makeStyles((theme: Theme) => ({ radio: { @@ -54,7 +54,6 @@ const formatBooleanForRadio = value => { type FormFormProps = { currentForm: FormDataType; - // eslint-disable-next-line no-unused-vars setFieldValue: (key: string, value: any) => void; originalSinglePerPeriod?: boolean; }; diff --git a/hat/assets/js/apps/Iaso/domains/forms/components/FormLegendInput.tsx b/hat/assets/js/apps/Iaso/domains/forms/components/FormLegendInput.tsx index d758354918..983cfc3f09 100644 --- a/hat/assets/js/apps/Iaso/domains/forms/components/FormLegendInput.tsx +++ b/hat/assets/js/apps/Iaso/domains/forms/components/FormLegendInput.tsx @@ -1,22 +1,21 @@ /* eslint-disable camelcase */ -import React, { FunctionComponent } from 'react'; +import DeleteIcon from '@mui/icons-material/Delete'; import { Box, Grid, IconButton } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { isEmpty } from 'lodash'; -import DeleteIcon from '@mui/icons-material/Delete'; +import React, { FunctionComponent } from 'react'; import { useSafeIntl } from 'bluesquare-components'; -import MESSAGES from '../messages'; +import { Legend } from '../../../components/LegendBuilder/Legend'; import { AddLegendDialog, EditLegendDialog, } from '../../../components/LegendBuilder/LegendBuilderDialog'; -import { Legend } from '../../../components/LegendBuilder/Legend'; +import MESSAGES from '../messages'; import { FormDataType } from '../types/forms'; type FormFormProps = { currentForm: FormDataType; - // eslint-disable-next-line no-unused-vars setFieldValue: (key: string, value: any) => void; }; const useStyles = makeStyles(theme => ({ diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/ActionTableColumnComponent.js b/hat/assets/js/apps/Iaso/domains/instances/components/ActionTableColumnComponent.js index 65e73bfc02..97f9c11367 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/ActionTableColumnComponent.js +++ b/hat/assets/js/apps/Iaso/domains/instances/components/ActionTableColumnComponent.js @@ -1,26 +1,26 @@ /* eslint-disable react/jsx-props-no-spreading */ /* eslint-disable react/prop-types */ -import React from 'react'; -import { IconButton as IconButtonComponent } from 'bluesquare-components'; import LinkIcon from '@mui/icons-material/Link'; import LinkOffIcon from '@mui/icons-material/LinkOff'; import LockIcon from '@mui/icons-material/Lock'; -import omit from 'lodash/omit'; import { DialogContentText } from '@mui/material'; +import { IconButton as IconButtonComponent } from 'bluesquare-components'; +import omit from 'lodash/omit'; +import React from 'react'; import { FormattedMessage } from 'react-intl'; -import { useSaveOrgUnit } from '../../orgUnits/hooks'; +import ConfirmCancelDialogComponent from '../../../components/dialogs/ConfirmCancelDialogComponent'; import { baseUrls } from '../../../constants/urls.ts'; -import { userHasOneOfPermissions, userHasPermission } from '../../users/utils'; -import { useCurrentUser } from '../../../utils/usersUtils.ts'; -import MESSAGES from '../messages'; -import { REFERENCE_FLAG_CODE, REFERENCE_UNFLAG_CODE } from '../constants'; import { useFormState } from '../../../hooks/form'; -import ConfirmCancelDialogComponent from '../../../components/dialogs/ConfirmCancelDialogComponent'; import { hasFeatureFlag, SHOW_LINK_INSTANCE_REFERENCE, } from '../../../utils/featureFlags'; import * as Permission from '../../../utils/permissions.ts'; +import { useCurrentUser } from '../../../utils/usersUtils.ts'; +import { useSaveOrgUnit } from '../../orgUnits/hooks'; +import { userHasOneOfPermissions, userHasPermission } from '../../users/utils'; +import { REFERENCE_FLAG_CODE, REFERENCE_UNFLAG_CODE } from '../constants'; +import MESSAGES from '../messages'; // eslint-disable-next-line camelcase const initialFormState = ( orgUnit, @@ -67,8 +67,7 @@ const getUrlInstance = data => { const ActionTableColumnComponent = ({ settings }) => { const user = useCurrentUser(); - // eslint-disable-next-line no-unused-vars - const [_formState, _setFieldValue, setFieldErrors] = useFormState( + const [, , setFieldErrors] = useFormState( initialFormState( settings.row.original.org_unit, settings.row.original.id, diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/ColumnSelect.tsx b/hat/assets/js/apps/Iaso/domains/instances/components/ColumnSelect.tsx index 3230411e5b..0ac120cae6 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/ColumnSelect.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/components/ColumnSelect.tsx @@ -31,16 +31,13 @@ export type InstanceMetasField = { active?: boolean; sortable?: boolean; tableOrder?: number; - // eslint-disable-next-line no-unused-vars renderValue?: (form: Instance) => ReactNode; - // eslint-disable-next-line no-unused-vars Cell?: (s: any) => ReactElement; }; type Props = { params: Params; periodType?: string; - // eslint-disable-next-line no-unused-vars setTableColumns: (newTableColumns: Column[]) => void; baseUrl: string; labelKeys: string[]; @@ -49,7 +46,6 @@ type Props = { disabled: boolean; instanceMetasFields?: InstanceMetasField[]; appId?: string; - // eslint-disable-next-line no-unused-vars getActionCell?: (settings: any) => ReactElement; }; diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/CreateReAssignDialogComponent.tsx b/hat/assets/js/apps/Iaso/domains/instances/components/CreateReAssignDialogComponent.tsx index 7c736c05b9..237804c701 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/CreateReAssignDialogComponent.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/components/CreateReAssignDialogComponent.tsx @@ -1,16 +1,16 @@ -import React, { FunctionComponent, useState } from 'react'; +import UpdateIcon from '@mui/icons-material/Update'; import { - ConfirmCancelModal, - useSafeIntl, AddButton, + ConfirmCancelModal, makeFullModal, + useSafeIntl, } from 'bluesquare-components'; -import UpdateIcon from '@mui/icons-material/Update'; +import React, { FunctionComponent, useState } from 'react'; +import { OrgUnitTreeviewModal } from '../../orgUnits/components/TreeView/OrgUnitTreeviewModal'; +import PeriodPicker from '../../periods/components/PeriodPicker'; import { Period } from '../../periods/models'; import { isValidPeriod } from '../../periods/utils'; import MESSAGES from '../messages'; -import { OrgUnitTreeviewModal } from '../../orgUnits/components/TreeView/OrgUnitTreeviewModal'; -import PeriodPicker from '../../periods/components/PeriodPicker'; import { Instance } from '../types/instance'; type Props = { @@ -28,9 +28,7 @@ type Props = { org_unit?: any; }; onCreateOrReAssign: ( - // eslint-disable-next-line no-unused-vars instanceOrForm: Instance | { id: number }, - // eslint-disable-next-line no-unused-vars,camelcase payload: { period: any; org_unit: any }, ) => void; orgUnitTypes: number[]; diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/InstancePopUp/InstancePopUp.tsx b/hat/assets/js/apps/Iaso/domains/instances/components/InstancePopUp/InstancePopUp.tsx index 3545b3d1f2..7c63299f32 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/InstancePopUp/InstancePopUp.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/components/InstancePopUp/InstancePopUp.tsx @@ -1,26 +1,26 @@ /* eslint-disable react/jsx-props-no-spreading */ import React, { FunctionComponent, useCallback, useMemo, useRef } from 'react'; -import { useSelector } from 'react-redux'; import { Popup, useMap } from 'react-leaflet'; +import { useSelector } from 'react-redux'; -import { Card, CardMedia, CardContent, Grid, Box } from '@mui/material'; +import { Box, Card, CardContent, CardMedia, Grid } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { - useSafeIntl, commonStyles, - mapPopupStyles, - LoadingSpinner, LinkButton, + LoadingSpinner, + mapPopupStyles, + useSafeIntl, } from 'bluesquare-components'; import ConfirmDialog from '../../../../components/dialogs/ConfirmDialogComponent'; -import InstanceDetailsInfos from '../InstanceDetailsInfos'; import InstanceDetailsField from '../InstanceDetailsField'; +import InstanceDetailsInfos from '../InstanceDetailsInfos'; -import MESSAGES from '../../messages'; -import { Instance } from '../../types/instance'; import { baseUrls } from '../../../../constants/urls'; import { getOrgUnitsTree } from '../../../orgUnits/utils'; +import MESSAGES from '../../messages'; +import { Instance } from '../../types/instance'; const useStyles = makeStyles(theme => ({ ...commonStyles(theme), @@ -37,14 +37,12 @@ const useStyles = makeStyles(theme => ({ })); type Props = { - // eslint-disable-next-line no-unused-vars replaceLocation?: (instance: Instance) => void; displayUseLocation?: boolean; }; export const InstancePopup: FunctionComponent = ({ - // eslint-disable-next-line @typescript-eslint/no-empty-function - replaceLocation = () => {}, + replaceLocation = () => null, displayUseLocation = false, }) => { const { formatMessage } = useSafeIntl(); diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/InstancesFilesListComponent.tsx b/hat/assets/js/apps/Iaso/domains/instances/components/InstancesFilesListComponent.tsx index 4edf10090f..e95c4574fc 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/InstancesFilesListComponent.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/components/InstancesFilesListComponent.tsx @@ -42,9 +42,7 @@ const useStyles = makeStyles(theme => ({ type Props = { instanceDetail?: Instance; files: ShortFile[]; - // eslint-disable-next-line no-unused-vars onLightBoxToggled?: (value: boolean) => void; - // eslint-disable-next-line no-unused-vars fetchDetails?: boolean; fetchingFile?: boolean; fetching?: boolean; diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/TopBar.tsx b/hat/assets/js/apps/Iaso/domains/instances/components/TopBar.tsx index 2188316753..d47cc36d57 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/TopBar.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/components/TopBar.tsx @@ -1,6 +1,6 @@ import React, { FunctionComponent } from 'react'; -import { Grid, Tabs, Tab } from '@mui/material'; +import { Grid, Tab, Tabs } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { commonStyles, useSafeIntl } from 'bluesquare-components'; import TopBar from '../../../components/nav/TopBarComponent'; @@ -18,7 +18,6 @@ const useStyles = makeStyles(theme => ({ type Props = { formName: string; tab: string; - // eslint-disable-next-line no-unused-vars handleChangeTab: (newTab: string) => void; formIds: string[]; }; diff --git a/hat/assets/js/apps/Iaso/domains/instances/hooks/speeddials.ts b/hat/assets/js/apps/Iaso/domains/instances/hooks/speeddials.ts index 3daf47d3ec..dd419a4d5a 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/hooks/speeddials.ts +++ b/hat/assets/js/apps/Iaso/domains/instances/hooks/speeddials.ts @@ -1,15 +1,15 @@ +import { useRedirectTo } from 'bluesquare-components'; import { useCallback } from 'react'; import { UseQueryResult } from 'react-query'; -import { useRedirectTo } from 'bluesquare-components'; +import snackMessages from '../../../components/snackBars/messages'; import { baseUrls } from '../../../constants/urls'; import { getRequest } from '../../../libs/Api'; import { useSnackQuery } from '../../../libs/apiHooks'; +import { Nullable } from '../../../types/utils'; import { useSaveOrgUnit } from '../../orgUnits/hooks'; import { OrgUnit } from '../../orgUnits/types/orgUnit'; -import { Instance } from '../types/instance'; import { REFERENCE_FLAG_CODE, REFERENCE_UNFLAG_CODE } from '../constants'; -import snackMessages from '../../../components/snackBars/messages'; -import { Nullable } from '../../../types/utils'; +import { Instance } from '../types/instance'; type LinkToFormParams = { formId: number; @@ -19,10 +19,7 @@ type LinkToFormParams = { export const useLinkOrgUnitToReferenceSubmission = ({ formId, referenceFormId, -}: LinkToFormParams): (( - // eslint-disable-next-line no-unused-vars - instance: Instance, -) => any) => { +}: LinkToFormParams): ((instance: Instance) => any) => { const { mutateAsync: saveOrgUnit } = useSaveOrgUnit(undefined, [ 'orgUnits', ]); diff --git a/hat/assets/js/apps/Iaso/domains/instances/utils/index.tsx b/hat/assets/js/apps/Iaso/domains/instances/utils/index.tsx index cd9eb13893..2b6c8195b6 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/utils/index.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/utils/index.tsx @@ -50,7 +50,6 @@ import { InstanceMetasField } from '../components/ColumnSelect'; import { INSTANCE_METAS_FIELDS } from '../constants'; const NO_VALUE = '/'; -// eslint-disable-next-line no-unused-vars const hasNoValue: (value: string) => boolean = value => !value || value === ''; type KeyValueFieldsProps = { @@ -234,13 +233,11 @@ const renderValue = (settings: Setting, c: VisibleColumn) => { }; export const useInstancesColumns = ( - // eslint-disable-next-line no-unused-vars, default-param-last + // eslint-disable-next-line default-param-last getActionCell: RenderCell = settings => ( ), visibleColumns: VisibleColumn[], - - // eslint-disable-next-line no-unused-vars ): Column[] => { const { formatMessage } = useSafeIntl(); const currentUser = useCurrentUser(); @@ -325,7 +322,6 @@ type PossibleColumn = { Header: string; id?: string; sortable?: boolean; - // eslint-disable-next-line no-unused-vars Cell?: (s: any) => ReactElement; align?: 'left' | 'center'; }; @@ -334,9 +330,7 @@ export const useGetInstancesVisibleColumns = ({ order, defaultOrder, }: Props): (( - // eslint-disable-next-line no-unused-vars columns?: string, - // eslint-disable-next-line no-unused-vars possibleFields?: PossibleField[], ) => VisibleColumn[]) => { const { formatMessage } = useSafeIntl(); @@ -480,9 +474,7 @@ export const getInstancesFilesList = (instances?: Instance[]): ShortFile[] => { type SelectionAction = { icon: ( - // eslint-disable-next-line no-unused-vars newSelection: Selection, - // eslint-disable-next-line no-unused-vars resetSelection?: any, ) => ReactElement; label: string; diff --git a/hat/assets/js/apps/Iaso/domains/links/components/LinksTable.tsx b/hat/assets/js/apps/Iaso/domains/links/components/LinksTable.tsx index fbd36bbebb..927fc09e64 100644 --- a/hat/assets/js/apps/Iaso/domains/links/components/LinksTable.tsx +++ b/hat/assets/js/apps/Iaso/domains/links/components/LinksTable.tsx @@ -1,5 +1,5 @@ -import React, { FunctionComponent } from 'react'; import { Column } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; import { TableWithDeepLink } from '../../../components/tables/TableWithDeepLink'; import { useLinksTableColumns } from '../config'; import { useValidateLink } from '../hooks/useValidateLink'; @@ -13,7 +13,6 @@ type Props = { data?: any; loading: boolean; expanded?: Record; - // eslint-disable-next-line no-unused-vars setExpanded: (value: React.SetStateAction>) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/links/components/LinksTableWithDownloads.tsx b/hat/assets/js/apps/Iaso/domains/links/components/LinksTableWithDownloads.tsx index 46b32fa507..0249ee73d6 100644 --- a/hat/assets/js/apps/Iaso/domains/links/components/LinksTableWithDownloads.tsx +++ b/hat/assets/js/apps/Iaso/domains/links/components/LinksTableWithDownloads.tsx @@ -1,11 +1,11 @@ -import React, { FunctionComponent, ReactElement, useState } from 'react'; import { Box, Grid } from '@mui/material'; import { makeStyles } from '@mui/styles'; -import { LinksTable } from './LinksTable'; +import React, { FunctionComponent, ReactElement, useState } from 'react'; import DownloadButtonsComponent from '../../../components/DownloadButtonsComponent'; -import { tableDefaults, useGetLinks } from '../hooks/useGetLinks'; -import { makeQueryString } from '../../../routing/utils'; import { usePrefixedParams } from '../../../routing/hooks/usePrefixedParams'; +import { makeQueryString } from '../../../routing/utils'; +import { tableDefaults, useGetLinks } from '../hooks/useGetLinks'; +import { LinksTable } from './LinksTable'; const dwnldBaseUrl = '/api/links'; @@ -53,7 +53,7 @@ export const LinksTableWithDownloads: FunctionComponent = ({ const displayDownloadButtons = paramsPrefix ? Boolean(data?.links?.length) : Boolean(params.searchActive); - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { searchActive, tab, ...dnldParams } = apiParams; const csvUrl = `${dwnldBaseUrl}/?${makeQueryString( dnldParams, diff --git a/hat/assets/js/apps/Iaso/domains/modules/types/modules.ts b/hat/assets/js/apps/Iaso/domains/modules/types/modules.ts index 3871e7d337..3bb706e59a 100644 --- a/hat/assets/js/apps/Iaso/domains/modules/types/modules.ts +++ b/hat/assets/js/apps/Iaso/domains/modules/types/modules.ts @@ -12,8 +12,5 @@ export type ModulesFilterParams = { export type ModuleParams = UrlParams & ModulesFilterParams & { - select?: ( - // eslint-disable-next-line no-unused-vars - data: Array, - ) => Array; + select?: (data: Array) => Array; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/ImageInfos.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/ImageInfos.tsx index 8d0e73b6d0..128377b55d 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/ImageInfos.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/ImageInfos.tsx @@ -3,12 +3,9 @@ import React, { FunctionComponent } from 'react'; import { FavButton } from '../../../components/files/FavButton'; import { ShortFile } from '../../instances/types/instance'; - type ImageInfosProps = { file: ShortFile; - // eslint-disable-next-line no-unused-vars onImageFavoriteClick: (imageId: number) => void; - // eslint-disable-next-line no-unused-vars isDefaultImage: (imageId: number) => boolean; isLoading: boolean; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitFiltersContainer.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitFiltersContainer.tsx index e9c358653d..351e99c98d 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitFiltersContainer.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitFiltersContainer.tsx @@ -34,14 +34,13 @@ import { Search } from '../types/search'; import { decodeSearch } from '../utils'; -import MESSAGES from '../messages'; import { DisplayIfUserHasPerm } from '../../../components/DisplayIfUserHasPerm'; import { ORG_UNITS } from '../../../utils/permissions'; +import MESSAGES from '../messages'; type Props = { params: OrgUnitParams; paramsSearches: [Search]; - // eslint-disable-next-line no-unused-vars onSearch: (searches: any) => void; currentTab: string; counts: Count[]; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitForm.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitForm.tsx index 59cabc1ea2..ce89186425 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitForm.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitForm.tsx @@ -1,22 +1,22 @@ /* eslint-disable react/function-component-definition */ +import { Box, Grid } from '@mui/material'; +import { makeStyles } from '@mui/styles'; +import classnames from 'classnames'; +import mapValues from 'lodash/mapValues'; import React, { - useState, + FunctionComponent, useCallback, useEffect, - FunctionComponent, useMemo, + useState, } from 'react'; -import classnames from 'classnames'; -import mapValues from 'lodash/mapValues'; -import { Grid, Box } from '@mui/material'; -import { makeStyles } from '@mui/styles'; import { commonStyles } from 'bluesquare-components'; import { isEqual } from 'lodash'; import { getValues, useFormState } from '../../../hooks/form'; -import { OrgUnitInfos } from './OrgUnitInfos'; -import { OrgUnit, Group, OrgunitInititialState } from '../types/orgUnit'; +import { Group, OrgUnit, OrgunitInititialState } from '../types/orgUnit'; import { OrgunitType } from '../types/orgunitTypes'; +import { OrgUnitInfos } from './OrgUnitInfos'; const initialFormState = (orgUnit: OrgUnit): OrgunitInititialState => ({ id: orgUnit.id, @@ -45,11 +45,8 @@ type Props = { orgUnitTypes: OrgunitType[]; groups: Group[]; saveOrgUnit: ( - // eslint-disable-next-line no-unused-vars newOu: OrgUnit, - // eslint-disable-next-line no-unused-vars onSuccess: (unit: OrgUnit) => void, - // eslint-disable-next-line no-unused-vars onError: (error: any) => void, ) => void; params: Record; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitInfos.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitInfos.tsx index 15228ed639..dd215677c5 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitInfos.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitInfos.tsx @@ -17,17 +17,17 @@ import { OrgUnitTreeviewModal } from './TreeView/OrgUnitTreeviewModal'; import { OrgUnitCreationDetails } from './OrgUnitCreationDetails'; +import { DisplayIfUserHasPerm } from '../../../components/DisplayIfUserHasPerm'; import DatesRange from '../../../components/filters/DatesRange'; +import { ORG_UNITS } from '../../../utils/permissions'; +import { useCurrentUser } from '../../../utils/usersUtils'; import { useGetValidationStatus } from '../../forms/hooks/useGetValidationStatus'; import { Instance } from '../../instances/types/instance'; +import { userHasPermission } from '../../users/utils'; import { Group, OrgUnit, OrgUnitState } from '../types/orgUnit'; import { OrgunitType } from '../types/orgunitTypes'; import { OrgUnitMultiReferenceInstances } from './OrgUnitMultiReferenceInstances'; import { useGetOrgUnit } from './TreeView/requests'; -import { DisplayIfUserHasPerm } from '../../../components/DisplayIfUserHasPerm'; -import { ORG_UNITS } from '../../../utils/permissions'; -import { userHasPermission } from '../../users/utils'; -import { useCurrentUser } from '../../../utils/usersUtils'; const useStyles = makeStyles(theme => ({ speedDialTop: { @@ -52,9 +52,7 @@ const useStyles = makeStyles(theme => ({ type Props = { orgUnitState: OrgUnitState; onChangeInfo: ( - // eslint-disable-next-line no-unused-vars key: string, - // eslint-disable-next-line no-unused-vars value: string | number | string[] | number[], ) => void; orgUnitTypes: OrgunitType[]; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitsFilters.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitsFilters.tsx index 26579500bd..ac27836507 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitsFilters.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitsFilters.tsx @@ -45,10 +45,8 @@ type Props = { setLocationLimit: Dispatch>; searchIndex: number; currentSearch: Search; - // eslint-disable-next-line no-unused-vars setTextSearchError: Dispatch>; onSearch: () => void; - // eslint-disable-next-line no-unused-vars onChangeColor: (color: string, index: number) => void; setSearches: React.Dispatch>; currentTab: string; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitsMap.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitsMap.tsx index 6ed6420c92..7ffab44c78 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitsMap.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitsMap.tsx @@ -1,55 +1,55 @@ -import React, { FunctionComponent, useState, useMemo } from 'react'; -import MarkerClusterGroup from 'react-leaflet-markercluster'; -import { - MapContainer, - GeoJSON, - Pane, - Tooltip, - ScaleControl, -} from 'react-leaflet'; -import { Grid, Box } from '@mui/material'; +import { Box, Grid } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { - useSafeIntl, commonStyles, IntlFormatMessage, + useSafeIntl, } from 'bluesquare-components'; +import React, { FunctionComponent, useMemo, useState } from 'react'; +import { + GeoJSON, + MapContainer, + Pane, + ScaleControl, + Tooltip, +} from 'react-leaflet'; +import MarkerClusterGroup from 'react-leaflet-markercluster'; // COMPONENTS -import OrgUnitPopupComponent from './OrgUnitPopupComponent'; -import ErrorPaperComponent from '../../../components/papers/ErrorPaperComponent'; -import { Tile } from '../../../components/maps/tools/TilesSwitchControl'; import MarkersListComponent from '../../../components/maps/markers/MarkersListComponent'; -import { OrgUnitsMapComments } from './orgUnitMap/OrgUnitsMapComments'; +import { Tile } from '../../../components/maps/tools/TilesSwitchControl'; import { innerDrawerStyles } from '../../../components/nav/InnerDrawer/styles'; +import ErrorPaperComponent from '../../../components/papers/ErrorPaperComponent'; +import { OrgUnitsMapComments } from './orgUnitMap/OrgUnitsMapComments'; +import OrgUnitPopupComponent from './OrgUnitPopupComponent'; // COMPONENTS // UTILS import { + Bounds, + circleColorMarkerOptions, + colorClusterCustomMarker, getLatLngBounds, getShapesBounds, - colorClusterCustomMarker, - circleColorMarkerOptions, - Bounds, } from '../../../utils/map/mapUtils'; // UTILS // TYPES -import { OrgUnit } from '../types/orgUnit'; import { DropdownOptions } from '../../../types/utils'; +import { OrgUnit } from '../types/orgUnit'; // TYPES // HOOKS import { useGetOrgUnitDetail } from '../hooks/requests/useGetOrgUnitDetail'; // HOOKS -import MESSAGES from '../messages'; -import tiles from '../../../constants/mapTiles'; import { CustomTileLayer } from '../../../components/maps/tools/CustomTileLayer'; import { CustomZoomControl } from '../../../components/maps/tools/CustomZoomControl'; import { MapToggleCluster } from '../../../components/maps/tools/MapToggleCluster'; -import { useGetOrgUnitTypes } from '../hooks/requests/useGetOrgUnitTypes'; import { InnerDrawer } from '../../../components/nav/InnerDrawer/Index'; +import tiles from '../../../constants/mapTiles'; +import { useGetOrgUnitTypes } from '../hooks/requests/useGetOrgUnitTypes'; +import MESSAGES from '../messages'; type OrgUnitWithSearchIndex = Omit & { search_index: number; @@ -60,7 +60,6 @@ export type Locations = { shapes: OrgUnitWithSearchIndex[]; }; type Props = { - // eslint-disable-next-line no-unused-vars getSearchColor: (index: number) => string; orgUnits: Locations; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/OrgUnitTreeviewModal.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/OrgUnitTreeviewModal.tsx index 2a04f0d18d..9e0e7a07e9 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/OrgUnitTreeviewModal.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/OrgUnitTreeviewModal.tsx @@ -35,7 +35,6 @@ import { type Props = { titleMessage: string | IntlMessage; toggleOnLabelClick?: boolean; - // eslint-disable-next-line no-unused-vars onConfirm: (selectedOrgUnits: any) => void; multiselect?: boolean; initialSelection?: OrgUnit | OrgUnit[]; @@ -78,7 +77,8 @@ const OrgUnitTreeviewModal: FunctionComponent = ({ }) => { const theme = useTheme(); const { formatMessage } = useSafeIntl(); - const { fetchOrgUnit, isFetching: isFetchingOrgUnit } = useFetchOrgUnits(appId); + const { fetchOrgUnit, isFetching: isFetchingOrgUnit } = + useFetchOrgUnits(appId); const [settings, setSettings] = useState({ displayTypes: true, statusSettings: DEFAULT_CONFIG, diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/OrgUnitTreeviewPicker.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/OrgUnitTreeviewPicker.tsx index 6a13d7a929..3e7a64b68e 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/OrgUnitTreeviewPicker.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/OrgUnitTreeviewPicker.tsx @@ -57,14 +57,12 @@ type Props = { placeholder?: string | { id: string; defaultMessage: string }; required: boolean; disabled: boolean; - // eslint-disable-next-line no-unused-vars label: (orgUnit: OrgUnit) => ReactNode; clearable: boolean; errors: string[]; }; const formatPlaceholder = ( - // eslint-disable-next-line no-unused-vars formatMessage: (message: { id: string; defaultMessage: string }) => string, placeholder?: string | { id: string; defaultMessage: string }, ) => { diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/TruncatedTrees.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/TruncatedTrees.tsx index 946474c1ec..4453bec8c3 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/TruncatedTrees.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/TreeView/TruncatedTrees.tsx @@ -10,7 +10,6 @@ type TreeData = Map; type Props = { treesData: TreeData; disabled: boolean; - // eslint-disable-next-line no-unused-vars label: (orgUnit: OrgUnit) => ReactNode; placeholderStyle: string; formattedPlaceholder: string; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/CurrentOrgUnitMarker.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/CurrentOrgUnitMarker.tsx index ce16150137..22024bb80e 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/CurrentOrgUnitMarker.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/CurrentOrgUnitMarker.tsx @@ -1,14 +1,13 @@ import React, { FunctionComponent, useCallback } from 'react'; import { Pane } from 'react-leaflet'; -import { orgunitsPane } from './constants'; import MarkerComponent from '../../../../../components/maps/markers/MarkerComponent'; import { OrgUnit } from '../../../types/orgUnit'; +import { orgunitsPane } from './constants'; type Props = { isEdit: boolean; currentOrgUnit: OrgUnit; - // eslint-disable-next-line no-unused-vars onChangeLocation: (location) => void; }; export const CurrentOrgUnitMarker: FunctionComponent = ({ diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/FormsMarkers.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/FormsMarkers.tsx index 545f7dbd17..9cd9245cd4 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/FormsMarkers.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/FormsMarkers.tsx @@ -1,18 +1,16 @@ import React, { FunctionComponent } from 'react'; import { Pane } from 'react-leaflet'; import MarkerClusterGroup from 'react-leaflet-markercluster'; -import { clusterSize, orgunitsPane } from './constants'; import { colorClusterCustomMarker } from '../../../../../utils/map/mapUtils'; -import { MarkerList } from './MarkersList'; import { InstancePopup } from '../../../../instances/components/InstancePopUp/InstancePopUp'; -import { OrgUnit } from '../../../types/orgUnit'; import { Instance } from '../../../../instances/types/instance'; +import { OrgUnit } from '../../../types/orgUnit'; +import { clusterSize, orgunitsPane } from './constants'; +import { MarkerList } from './MarkersList'; type Props = { forms: any[]; - // eslint-disable-next-line no-unused-vars fetchInstanceDetail: (instance: Instance) => void; - // eslint-disable-next-line no-unused-vars updateOrgUnitLocation: (orgUnit: OrgUnit) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/MarkersList.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/MarkersList.tsx index 3aa4e91d70..3299ce6048 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/MarkersList.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/MarkersList.tsx @@ -9,9 +9,7 @@ type Props = { locationsList: any[]; color?: string; keyId: string | number; - // eslint-disable-next-line no-unused-vars fetchDetail: (orgUnit: OrgUnit) => void; - // eslint-disable-next-line no-unused-vars updateOrgUnitLocation: (orgUnit: OrgUnit) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/OrgUnitMap.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/OrgUnitMap.tsx index b905261eec..3f40087627 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/OrgUnitMap.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/OrgUnitMap.tsx @@ -70,11 +70,8 @@ type Props = { currentOrgUnit: any; saveOrgUnit: () => void; resetOrgUnit: () => void; - // eslint-disable-next-line no-unused-vars setOrgUnitLocationModified: (isModified: boolean) => void; - // eslint-disable-next-line no-unused-vars onChangeShape: (key, geoJson) => void; - // eslint-disable-next-line no-unused-vars onChangeLocation: (location) => void; sources: any[]; orgUnitTypes: any[]; @@ -106,12 +103,10 @@ export const OrgUnitMap: FunctionComponent = ({ const didCatchmentInitialize = useRef(false); const [currentTile, setCurrentTile] = useState(tiles.osm); const [isCreatingMarker, setIsCreatingMarker] = useState(false); - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars - const [state, setStateField, _, setState] = useFormState( + const [state, setStateField, , setState] = useFormState( initialState(currentUser), ); const { fetchInstanceDetail, fetchSubOrgUnitDetail } = useRedux(); - // console.log('state', state); const setAncestor = useCallback(() => { const ancestor = getAncestorWithGeojson(currentOrgUnit); if (ancestor) { diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/OrgUnitTypesSelectedShapes.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/OrgUnitTypesSelectedShapes.tsx index 8acb69b3da..92f96d12e0 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/OrgUnitTypesSelectedShapes.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/OrgUnitTypesSelectedShapes.tsx @@ -1,21 +1,19 @@ +import { useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent } from 'react'; import { GeoJSON, Pane } from 'react-leaflet'; -import { useSafeIntl } from 'bluesquare-components'; +import MESSAGES from '../../../messages'; +import { OrgUnit } from '../../../types/orgUnit'; +import { OrgunitType } from '../../../types/orgunitTypes'; import OrgUnitPopupComponent from '../../OrgUnitPopupComponent'; import { orgunitsPane } from './OrgUnitMap'; -import MESSAGES from '../../../messages'; import { SourceShape } from './SourceShape'; -import { OrgunitType } from '../../../types/orgunitTypes'; import { MappedOrgUnit } from './types'; -import { OrgUnit } from '../../../types/orgUnit'; type Props = { orgUnitTypes: (OrgunitType & { color: string })[]; mappedOrgUnitTypesSelected: MappedOrgUnit[]; mappedSourcesSelected: MappedOrgUnit[]; - // eslint-disable-next-line no-unused-vars fetchSubOrgUnitDetail: (orgUnit: OrgUnit) => void; - // eslint-disable-next-line no-unused-vars updateOrgUnitLocation: (orgUnit: OrgUnit) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SelectedMarkers.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SelectedMarkers.tsx index 1a30be6fc6..1e9888285b 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SelectedMarkers.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SelectedMarkers.tsx @@ -10,9 +10,7 @@ import { MappedOrgUnit } from './types'; type Props = { data: MappedOrgUnit[]; - // eslint-disable-next-line no-unused-vars fetchSubOrgUnitDetail: (orgUnit: OrgUnit) => void; - // eslint-disable-next-line no-unused-vars updateOrgUnitLocation: (orgUnit: OrgUnit) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SourceShape.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SourceShape.tsx index a0e9f339ee..e5500d995e 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SourceShape.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SourceShape.tsx @@ -1,12 +1,11 @@ +import { useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent } from 'react'; import { GeoJSON } from 'react-leaflet'; -import { useSafeIntl } from 'bluesquare-components'; -import OrgUnitPopupComponent from '../../OrgUnitPopupComponent'; import MESSAGES from '../../../messages'; +import OrgUnitPopupComponent from '../../OrgUnitPopupComponent'; type Props = { onClick: () => void; - // eslint-disable-next-line no-unused-vars replaceLocation: (orgUnit: any) => void; source: any; shape: any; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SourcesSelectedShapes.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SourcesSelectedShapes.tsx index 32fdf1f0ea..dc8696f07b 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SourcesSelectedShapes.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitMap/SourcesSelectedShapes.tsx @@ -6,9 +6,7 @@ import { MappedOrgUnit } from './types'; type Props = { mappedSourcesSelected: MappedOrgUnit[]; - // eslint-disable-next-line no-unused-vars updateOrgUnitLocation: (orgUnit: OrgUnit) => void; - // eslint-disable-next-line no-unused-vars fetchSubOrgUnitDetail: (orgUnit: OrgUnit) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitsMapComments.js b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitsMapComments.js index 4b453c0c3f..23ec435aea 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitsMapComments.js +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/orgUnitMap/OrgUnitsMapComments.js @@ -1,19 +1,19 @@ -import React, { useCallback, useState } from 'react'; +import { Pagination } from '@mui/lab'; +import { Box, Typography } from '@mui/material'; +import { makeStyles } from '@mui/styles'; import { - CommentWithThread, AddComment, + CommentWithThread, useSafeIntl, } from 'bluesquare-components'; -import { Pagination } from '@mui/lab'; -import { Box, Typography } from '@mui/material'; -import { makeStyles } from '@mui/styles'; +import React, { useCallback, useState } from 'react'; -import { useSelector } from 'react-redux'; -import PropTypes from 'prop-types'; import { useSnackMutation } from 'Iaso/libs/apiHooks.ts'; -import { useGetComments, sendComment } from '../../../../utils/requests'; +import PropTypes from 'prop-types'; +import { useSelector } from 'react-redux'; +import { sendComment, useGetComments } from '../../../../utils/requests'; -import MESSAGES from '../../messages'; +import MESSAGES from '../../messages.ts'; const styles = { commentsBlock: { marginBottom: '7px' }, @@ -63,8 +63,7 @@ const OrgUnitsMapComments = ({ ); const orgUnitToUse = getOrgUnitFromStore ? globalStateOrgUnit : orgUnit; const [offset, setOffset] = useState(null); - // eslint-disable-next-line no-unused-vars - const [pageSize, _setPageSize] = useState(maxPages); + const [pageSize] = useState(maxPages); const commentsParams = { orgUnitId: orgUnitToUse?.id, offset, @@ -146,7 +145,7 @@ const OrgUnitsMapComments = ({ {comments?.count > 1 && ( { setOffset(calculateOffset(page, pageSize)); }} diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Dialog/OrgUnitChangeRequestConfigDialogCreateFirstStep.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Dialog/OrgUnitChangeRequestConfigDialogCreateFirstStep.tsx index e6c6923849..018194591d 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Dialog/OrgUnitChangeRequestConfigDialogCreateFirstStep.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Dialog/OrgUnitChangeRequestConfigDialogCreateFirstStep.tsx @@ -17,7 +17,6 @@ import MESSAGES from '../messages'; type Props = { isOpen: boolean; closeDialog: () => void; - // eslint-disable-next-line no-unused-vars openCreationSecondStepDialog: (config: object) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/history/LogsComponent.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/history/LogsComponent.tsx index 363268d7de..cc47d941a3 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/history/LogsComponent.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/history/LogsComponent.tsx @@ -1,17 +1,16 @@ -import React, { FunctionComponent, useCallback } from 'react'; -import { useQueryClient } from 'react-query'; +import { Box } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { commonStyles } from 'bluesquare-components'; -import { Box } from '@mui/material'; -import { useOrgUnitsLogsColumns } from '../config'; -import { LogsDetails } from './LogsDetails'; +import React, { FunctionComponent, useCallback } from 'react'; +import { useQueryClient } from 'react-query'; +import { TableWithDeepLink } from '../../../components/tables/TableWithDeepLink'; import { LOGS_PREFIX } from '../../../constants/urls'; import { useGetLogs } from '../../../hooks/useGetLogs'; -import { TableWithDeepLink } from '../../../components/tables/TableWithDeepLink'; import { usePrefixedParams } from '../../../routing/hooks/usePrefixedParams'; +import { useOrgUnitsLogsColumns } from '../config'; +import { LogsDetails } from './LogsDetails'; type Props = { - // eslint-disable-next-line no-unused-vars goToRevision: (revision: any, callback?: () => void) => void; logObjectId: number; baseUrl: string; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/hooks/useGetApiParams.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/hooks/useGetApiParams.ts index 847c74f685..042609922f 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/hooks/useGetApiParams.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/hooks/useGetApiParams.ts @@ -1,7 +1,7 @@ import { getTableUrl } from 'bluesquare-components'; +import { getFromDateString, getToDateString } from '../../../utils/dates'; import { OrgUnitParams } from '../types/orgUnit'; import { Search } from '../types/search'; -import { getFromDateString, getToDateString } from '../../../utils/dates'; export type ApiParams = { order: string; @@ -15,11 +15,8 @@ export type ApiParams = { type Result = { apiParams: ApiParams; getUrl: ( - // eslint-disable-next-line no-unused-vars toExport: boolean, - // eslint-disable-next-line no-unused-vars exportType: string, - // eslint-disable-next-line no-unused-vars asLocation?: boolean, ) => string; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/components/OrgUnitsTypesDialog.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/components/OrgUnitsTypesDialog.tsx index 67629b795c..2f293b6d93 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/components/OrgUnitsTypesDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/components/OrgUnitsTypesDialog.tsx @@ -1,45 +1,45 @@ -import React, { - useCallback, - useEffect, - useRef, - useState, - useMemo, - FunctionComponent, - ReactNode, -} from 'react'; import { + IntlMessage, useSafeIntl, useSkipEffectOnMount, - IntlMessage, } from 'bluesquare-components'; +import { isUndefined, mapValues } from 'lodash'; import intersection from 'lodash/intersection'; import isEmpty from 'lodash/isEmpty'; -import { isUndefined, mapValues } from 'lodash'; +import React, { + FunctionComponent, + ReactNode, + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from 'react'; -import { useGetFormsByProjects } from '../../../instances/hooks'; import ConfirmCancelDialogComponent from '../../../../components/dialogs/ConfirmCancelDialogComponent'; import InputComponent from '../../../../components/forms/InputComponent'; -import MESSAGES from '../messages'; -import { - userHasOneOfPermissions, - userHasPermission, -} from '../../../users/utils'; +import { InputWithInfos } from '../../../../components/InputWithInfos'; import { useFormState } from '../../../../hooks/form'; +import { DropdownOptions } from '../../../../types/utils'; import { commaSeparatedIdsToArray, isFieldValid, isFormValid, } from '../../../../utils/forms'; -import { requiredFields } from '../config/requiredFields'; +import * as Permission from '../../../../utils/permissions'; +import { useCurrentUser } from '../../../../utils/usersUtils'; +import { Form } from '../../../forms/types/forms'; +import { useGetFormsByProjects } from '../../../instances/hooks'; import { useGetProjectsDropdownOptions } from '../../../projects/hooks/requests'; +import { + userHasOneOfPermissions, + userHasPermission, +} from '../../../users/utils'; +import { OrgunitType } from '../../types/orgunitTypes'; +import { requiredFields } from '../config/requiredFields'; import { useGetOrgUnitTypesDropdownOptions } from '../hooks/useGetOrgUnitTypesDropdownOptions'; import { useSaveOrgUnitType } from '../hooks/useSaveOrgUnitType'; -import { useCurrentUser } from '../../../../utils/usersUtils'; -import { OrgunitType } from '../../types/orgunitTypes'; -import { DropdownOptions } from '../../../../types/utils'; -import { Form } from '../../../forms/types/forms'; -import * as Permission from '../../../../utils/permissions'; -import { InputWithInfos } from '../../../../components/InputWithInfos'; +import MESSAGES from '../messages'; const mapOrgUnitType = orgUnitType => { return { @@ -58,7 +58,6 @@ const mapOrgUnitType = orgUnitType => { type Props = { orgUnitType?: OrgunitType; titleMessage: IntlMessage; - // eslint-disable-next-line no-unused-vars renderTrigger: ({ openDialog }: { openDialog: () => void }) => ReactNode; }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/HighlightFieldsChanges.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/HighlightFieldsChanges.tsx index 8115a135cd..a355188d5d 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/HighlightFieldsChanges.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/HighlightFieldsChanges.tsx @@ -12,7 +12,6 @@ import { import { ReviewOrgUnitFieldChanges } from './ReviewOrgUnitFieldChanges'; type Props = { - // eslint-disable-next-line no-unused-vars setSelected: (key: string) => void; field: NewOrgUnitField; newFieldValues: NestedGroup[]; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesButtons.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesButtons.tsx index 380c5620fe..8620432809 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesButtons.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesButtons.tsx @@ -13,10 +13,7 @@ import MESSAGES from '../messages'; import { OrgUnitChangeRequestDetails } from '../types'; import { ReviewOrgUnitChangesCommentDialog } from './ReviewOrgUnitChangesCommentDialog'; -type SubmitChangeRequest = ( - // eslint-disable-next-line no-unused-vars - variables: UseSaveChangeRequestQueryData, -) => void; +type SubmitChangeRequest = (variables: UseSaveChangeRequestQueryData) => void; type Props = { newFields: NewOrgUnitField[]; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialog.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialog.tsx index 8ed4440135..86cfef068e 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialog.tsx @@ -11,10 +11,7 @@ import { TextArea } from '../../../../components/forms/TextArea'; import { UseSaveChangeRequestQueryData } from '../hooks/api/useSaveChangeRequest'; import { ReviewOrgUnitChangesCommentDialogButtons } from './ReviewOrgUnitChangesCommentDialogButtons'; -type SubmitChangeRequest = ( - // eslint-disable-next-line no-unused-vars - variables: UseSaveChangeRequestQueryData, -) => void; +type SubmitChangeRequest = (variables: UseSaveChangeRequestQueryData) => void; type Props = { submitChangeRequest: SubmitChangeRequest; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialogButtons.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialogButtons.tsx index eafa048e01..e318008c72 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialogButtons.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialogButtons.tsx @@ -10,10 +10,7 @@ import React, { import { UseSaveChangeRequestQueryData } from '../hooks/api/useSaveChangeRequest'; import MESSAGES from '../messages'; -type SubmitChangeRequest = ( - // eslint-disable-next-line no-unused-vars - variables: UseSaveChangeRequestQueryData, -) => void; +type SubmitChangeRequest = (variables: UseSaveChangeRequestQueryData) => void; type Props = { comment?: string; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTable.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTable.tsx index 2caf50af6a..9de27e03c9 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTable.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTable.tsx @@ -10,7 +10,6 @@ import { ReviewOrgUnitChangesDetailsTableHead } from './ReviewOrgUnitChangesDeta type Props = { isSaving: boolean; newFields: NewOrgUnitField[]; - // eslint-disable-next-line no-unused-vars setSelected: (key: string) => void; changeRequest?: OrgUnitChangeRequestDetails; isFetchingChangeRequest: boolean; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableBody.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableBody.tsx index 9501d64b92..7fb3b79066 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableBody.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableBody.tsx @@ -6,7 +6,6 @@ import { OrgUnitChangeRequestDetails } from '../../types'; type Props = { newFields: NewOrgUnitField[]; - // eslint-disable-next-line no-unused-vars setSelected: (key: string) => void; isFetchingChangeRequest: boolean; changeRequest?: OrgUnitChangeRequestDetails; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableRow.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableRow.tsx index 759c840376..f2298dca54 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableRow.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableRow.tsx @@ -8,7 +8,6 @@ import { OrgUnitChangeRequestDetails } from '../../types'; type Props = { field: NewOrgUnitField; - // eslint-disable-next-line no-unused-vars isNew: boolean; isNewOrgUnit: boolean; isFetchingChangeRequest: boolean; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/hooks/useNewFields.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/hooks/useNewFields.tsx index a682b9660d..7b39374a64 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/hooks/useNewFields.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/hooks/useNewFields.tsx @@ -1,29 +1,29 @@ +import { Box } from '@mui/material'; +import { textPlaceholder, useSafeIntl } from 'bluesquare-components'; +import orderBy from 'lodash/orderBy'; +import moment from 'moment'; import React, { - ReactElement, - useMemo, - useState, FunctionComponent, + ReactElement, useCallback, useEffect, + useMemo, + useState, } from 'react'; -import { textPlaceholder, useSafeIntl } from 'bluesquare-components'; -import moment from 'moment'; -import orderBy from 'lodash/orderBy'; -import { Box } from '@mui/material'; +import { MarkerMap } from '../../../../components/maps/MarkerMapComponent'; +import { BooleanValue, PlaceholderValue } from '../../../../libs/utils'; +import { Nullable, Optional } from '../../../../types/utils'; +import InstanceDetail from '../../../instances/compare/components/InstanceDetail'; +import { LinkToOrgUnit } from '../../components/LinkToOrgUnit'; +import { ShortOrgUnit } from '../../types/orgUnit'; +import MESSAGES from '../messages'; import { InstanceForChangeRequest, NestedGroup, - NestedOrgUnitType, NestedLocation, + NestedOrgUnitType, OrgUnitChangeRequestDetails, } from '../types'; -import { MarkerMap } from '../../../../components/maps/MarkerMapComponent'; -import { LinkToOrgUnit } from '../../components/LinkToOrgUnit'; -import MESSAGES from '../messages'; -import InstanceDetail from '../../../instances/compare/components/InstanceDetail'; -import { ShortOrgUnit } from '../../types/orgUnit'; -import { Nullable, Optional } from '../../../../types/utils'; -import { BooleanValue, PlaceholderValue } from '../../../../libs/utils'; export type NewOrgUnitField = { key: string; @@ -40,9 +40,7 @@ type FieldDefinition = { order: number; fieldType: string; formatValue: ( - // eslint-disable-next-line no-unused-vars val: any, - // eslint-disable-next-line no-unused-vars isOld: boolean, ) => ReactElement | Optional>; }; @@ -51,7 +49,6 @@ type FieldDefinitions = Record; type UseNewFields = { newFields: NewOrgUnitField[]; - // eslint-disable-next-line no-unused-vars setSelected: (key: string) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/pages/components/MultiSelect.tsx b/hat/assets/js/apps/Iaso/domains/pages/components/MultiSelect.tsx index b9426eee90..137c667c69 100644 --- a/hat/assets/js/apps/Iaso/domains/pages/components/MultiSelect.tsx +++ b/hat/assets/js/apps/Iaso/domains/pages/components/MultiSelect.tsx @@ -1,7 +1,7 @@ import { get } from 'lodash'; import React, { FunctionComponent } from 'react'; -import { DropdownOptions } from '../../../types/utils'; import InputComponent from '../../../components/forms/InputComponent'; +import { DropdownOptions } from '../../../types/utils'; import { commaSeparatedIdsToArray } from '../../../utils/forms'; export type Option = DropdownOptions; @@ -14,9 +14,7 @@ type Props = { clearable?: boolean; required?: boolean; disabled?: boolean; - // eslint-disable-next-line no-unused-vars onChange?: (_keyValue: string, value: any) => void; - // eslint-disable-next-line no-unused-vars renderTags?: (tagValue: Array, getTagProps: any) => Array; returnFullObject?: boolean; }; @@ -55,7 +53,10 @@ export const MultiSelect: FunctionComponent = ({ onChange(keyValue, commaSeparatedIdsToArray(value)); } else { form.setFieldTouched(field.name, true); - form.setFieldValue(field.name, commaSeparatedIdsToArray(value)); + form.setFieldValue( + field.name, + commaSeparatedIdsToArray(value), + ); } }} errors={hasError ? [get(form.errors, field.name)] : []} diff --git a/hat/assets/js/apps/Iaso/domains/pages/components/SingleSelect.tsx b/hat/assets/js/apps/Iaso/domains/pages/components/SingleSelect.tsx index 496250c9e2..7198256fb1 100644 --- a/hat/assets/js/apps/Iaso/domains/pages/components/SingleSelect.tsx +++ b/hat/assets/js/apps/Iaso/domains/pages/components/SingleSelect.tsx @@ -12,7 +12,6 @@ type Props = { clearable?: boolean; required?: boolean; disabled?: boolean; - // eslint-disable-next-line no-unused-vars onChange?: (_keyValue: string, value: any) => void; loading?: boolean; }; diff --git a/hat/assets/js/apps/Iaso/domains/payments/components/EditPaymentLot/PaymentLotInfos.tsx b/hat/assets/js/apps/Iaso/domains/payments/components/EditPaymentLot/PaymentLotInfos.tsx index ae50d465c9..1661593a5c 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/components/EditPaymentLot/PaymentLotInfos.tsx +++ b/hat/assets/js/apps/Iaso/domains/payments/components/EditPaymentLot/PaymentLotInfos.tsx @@ -1,18 +1,17 @@ -import React, { FunctionComponent } from 'react'; -import moment from 'moment'; import { Box, Button, Grid, Paper, Typography } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; +import moment from 'moment'; +import React, { FunctionComponent } from 'react'; +import InputComponent from '../../../../components/forms/InputComponent'; +import { SxStyles } from '../../../../types/general'; import getDisplayName from '../../../../utils/usersUtils'; import MESSAGES from '../../messages'; -import InputComponent from '../../../../components/forms/InputComponent'; import { PaymentLot } from '../../types'; -import { SxStyles } from '../../../../types/general'; type Props = { name: string; comment?: string | null; paymentLot: PaymentLot; - // eslint-disable-next-line no-unused-vars onChange: (keyValue: 'name' | 'comment', newValue: string) => void; onSave: () => void; allowSave: boolean; diff --git a/hat/assets/js/apps/Iaso/domains/payments/components/StatusSelect.tsx b/hat/assets/js/apps/Iaso/domains/payments/components/StatusSelect.tsx index 34c3bc2642..ea82005e0c 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/components/StatusSelect.tsx +++ b/hat/assets/js/apps/Iaso/domains/payments/components/StatusSelect.tsx @@ -1,13 +1,12 @@ -import React, { FunctionComponent } from 'react'; import { useSafeIntl } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; import InputComponent from '../../../components/forms/InputComponent'; +import { usePaymentStatusOptions } from '../../orgUnits/reviewChanges/hooks/api/useGetPaymentStatusOptions'; import MESSAGES from '../messages'; import { PaymentStatus } from '../types'; -import { usePaymentStatusOptions } from '../../orgUnits/reviewChanges/hooks/api/useGetPaymentStatusOptions'; type Props = { value: PaymentStatus; - // eslint-disable-next-line no-unused-vars onChange: (value: PaymentStatus) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useSavePaymentLot.ts b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useSavePaymentLot.ts index 305e0c5c4d..53b2c9f1d4 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useSavePaymentLot.ts +++ b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useSavePaymentLot.ts @@ -20,11 +20,9 @@ export type UpdatePaymentLotQuery = { export type SavePaymentLotQuery = CreatePaymentLotQuery | UpdatePaymentLotQuery; type CreateEditPaymentLotFunction = ( - // eslint-disable-next-line no-unused-vars body: T extends 'create' ? SavePaymentLotQuery : Partial, - // eslint-disable-next-line no-unused-vars type: T, ) => Promise; diff --git a/hat/assets/js/apps/Iaso/domains/periods/components/PeriodPicker.tsx b/hat/assets/js/apps/Iaso/domains/periods/components/PeriodPicker.tsx index 0dca13213b..bd76ccdf33 100644 --- a/hat/assets/js/apps/Iaso/domains/periods/components/PeriodPicker.tsx +++ b/hat/assets/js/apps/Iaso/domains/periods/components/PeriodPicker.tsx @@ -1,29 +1,31 @@ +import { Box, FormHelperText, FormLabel, Grid } from '@mui/material'; +import { makeStyles } from '@mui/styles'; import React, { FunctionComponent, useCallback, useEffect, useState, } from 'react'; -import { Box, FormHelperText, FormLabel, Grid } from '@mui/material'; -import { makeStyles } from '@mui/styles'; -import { commonStyles, DatePicker, useSafeIntl } from 'bluesquare-components'; import Typography from '@mui/material/Typography'; +import { commonStyles, DatePicker, useSafeIntl } from 'bluesquare-components'; import InputComponent from '../../../components/forms/InputComponent'; import { getYears } from '../../../utils'; -import { getPeriodPickerString } from '../utils'; import { hasFeatureFlag, HIDE_PERIOD_QUARTER_NAME, } from '../../../utils/featureFlags'; import { Period, PeriodObject } from '../models'; +import { getPeriodPickerString } from '../utils'; +import { useCurrentUser } from '../../../utils/usersUtils'; import { MONTHS, + NO_PERIOD, PERIOD_TYPE_DAY, - PERIOD_TYPE_PLACEHOLDER, PERIOD_TYPE_MONTH, + PERIOD_TYPE_PLACEHOLDER, PERIOD_TYPE_QUARTER, PERIOD_TYPE_SIX_MONTH, PERIOD_TYPE_YEAR, @@ -31,10 +33,8 @@ import { QUARTERS_RANGE, SEMESTERS, SEMESTERS_RANGE, - NO_PERIOD, } from '../constants'; import MESSAGES from '../messages'; -import { useCurrentUser } from '../../../utils/usersUtils'; const useStyles = makeStyles(theme => ({ ...commonStyles(theme), @@ -69,7 +69,6 @@ const useStyles = makeStyles(theme => ({ type Props = { periodType: string | Record; title: string; - // eslint-disable-next-line no-unused-vars onChange: (_) => any; activePeriodString?: string; hasError?: boolean; diff --git a/hat/assets/js/apps/Iaso/domains/plannings/CreateEditPlanning/CreateEditPlanning.tsx b/hat/assets/js/apps/Iaso/domains/plannings/CreateEditPlanning/CreateEditPlanning.tsx index dc27047640..cc3a4176f5 100644 --- a/hat/assets/js/apps/Iaso/domains/plannings/CreateEditPlanning/CreateEditPlanning.tsx +++ b/hat/assets/js/apps/Iaso/domains/plannings/CreateEditPlanning/CreateEditPlanning.tsx @@ -1,19 +1,27 @@ -import React, { FunctionComponent, useMemo, useEffect, useState } from 'react'; +import FileCopyIcon from '@mui/icons-material/FileCopy'; +import { Box, Grid } from '@mui/material'; import { AddButton, - useSafeIntl, IconButton, IntlFormatMessage, + useSafeIntl, } from 'bluesquare-components'; -import FileCopyIcon from '@mui/icons-material/FileCopy'; -import { useFormik, FormikProvider, Field } from 'formik'; +import { Field, FormikProvider, useFormik } from 'formik'; import { isEqual } from 'lodash'; -import { Grid, Box } from '@mui/material'; -import InputComponent from '../../../components/forms/InputComponent'; +import React, { FunctionComponent, useEffect, useMemo, useState } from 'react'; import ConfirmCancelDialogComponent from '../../../components/dialogs/ConfirmCancelDialogComponent'; +import InputComponent from '../../../components/forms/InputComponent'; import MESSAGES from '../messages'; +import { OrgUnitsLevels as OrgUnitSelect } from '../../../../../../../../plugins/polio/js/src/components/Inputs/OrgUnitsSelect'; +import DatesRange from '../../../components/filters/DatesRange'; +import { + useApiErrorValidation, + useTranslatedErrors, +} from '../../../libs/validation'; +import { commaSeparatedIdsToArray } from '../../../utils/forms'; +import { useGetProjectsDropDown } from '../../projects/hooks/requests/useGetProjectsDropDown'; import { useGetForms } from '../hooks/requests/useGetForms'; import { useGetTeams } from '../hooks/requests/useGetTeams'; import { @@ -21,15 +29,7 @@ import { SavePlanningQuery, useSavePlanning, } from '../hooks/requests/useSavePlanning'; -import DatesRange from '../../../components/filters/DatesRange'; -import { OrgUnitsLevels as OrgUnitSelect } from '../../../../../../../../plugins/polio/js/src/components/Inputs/OrgUnitsSelect'; import { usePlanningValidation } from '../hooks/validation'; -import { commaSeparatedIdsToArray } from '../../../utils/forms'; -import { useGetProjectsDropDown } from '../../projects/hooks/requests/useGetProjectsDropDown'; -import { - useApiErrorValidation, - useTranslatedErrors, -} from '../../../libs/validation'; type ModalMode = 'create' | 'edit' | 'copy'; @@ -68,9 +68,7 @@ export const makeResetTouched = ( formValues: Record, setTouched: ( - // eslint-disable-next-line no-unused-vars fields: { [field: string]: boolean }, - // eslint-disable-next-line no-unused-vars shouldValidate?: boolean, ) => void, ) => diff --git a/hat/assets/js/apps/Iaso/domains/plannings/config.tsx b/hat/assets/js/apps/Iaso/domains/plannings/config.tsx index 18f6c4dd24..6227c84f8c 100644 --- a/hat/assets/js/apps/Iaso/domains/plannings/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/plannings/config.tsx @@ -1,22 +1,21 @@ -import React, { ReactElement, useMemo } from 'react'; import { Column, IconButton as IconButtonComponent, useSafeIntl, } from 'bluesquare-components'; +import React, { ReactElement, useMemo } from 'react'; +import DeleteDialog from '../../components/dialogs/DeleteDialogComponent'; +import { DisplayIfUserHasPerm } from '../../components/DisplayIfUserHasPerm'; import { baseUrls } from '../../constants/urls'; +import { PLANNING_WRITE } from '../../utils/permissions'; import { CreateEditPlanning } from './CreateEditPlanning/CreateEditPlanning'; -import DeleteDialog from '../../components/dialogs/DeleteDialogComponent'; import { PlanningApi } from './hooks/requests/useGetPlannings'; import MESSAGES from './messages'; -import { DisplayIfUserHasPerm } from '../../components/DisplayIfUserHasPerm'; -import { PLANNING_WRITE } from '../../utils/permissions'; const getAssignmentUrl = (planning: PlanningApi): string => { return `/${baseUrls.assignments}/planningId/${planning.id}/team/${planning.team}`; }; export const usePlanningColumns = ( - // eslint-disable-next-line no-unused-vars deletePlanning: (id: number) => void, ): Column[] => { const { formatMessage } = useSafeIntl(); diff --git a/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetPlannings.ts b/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetPlannings.ts index 140057355a..ca45064490 100644 --- a/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetPlannings.ts +++ b/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetPlannings.ts @@ -1,16 +1,16 @@ /* eslint-disable camelcase */ -import { UseQueryResult } from 'react-query'; import { Pagination } from 'bluesquare-components'; +import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; import { useSnackQuery } from '../../../../libs/apiHooks'; import { makeUrlWithParams } from '../../../../libs/utils'; +import { DropdownOptions } from '../../../../types/utils'; import { dateApiToDateRangePicker, dateRangePickerToDateApi, } from '../../../../utils/dates'; import { endpoint } from '../../constants'; import { PlanningParams } from '../../types'; -import { DropdownOptions } from '../../../../types/utils'; export type OrgUnitDetails = { id: number; @@ -42,7 +42,7 @@ type PlanningList = Pagination & { const getPlannings = async (options: PlanningParams): Promise => { // assigning the variables allows us to have a params object without the unwanted keys - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { publishingStatus, dateTo, dateFrom, pageSize, ...params } = options as Record; params.limit = options?.pageSize; diff --git a/hat/assets/js/apps/Iaso/domains/projects/components/CreateEditProjectDialog.tsx b/hat/assets/js/apps/Iaso/domains/projects/components/CreateEditProjectDialog.tsx index c6ff1a0bc7..117d0d13b5 100644 --- a/hat/assets/js/apps/Iaso/domains/projects/components/CreateEditProjectDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/projects/components/CreateEditProjectDialog.tsx @@ -1,35 +1,34 @@ -import React, { - FunctionComponent, - useState, - useEffect, - useCallback, - useMemo, -} from 'react'; -import get from 'lodash/get'; -import { Tabs, Tab } from '@mui/material'; +import { Tab, Tabs } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { - useSafeIntl, + AddButton, ConfirmCancelModal, makeFullModal, - AddButton, + useSafeIntl, } from 'bluesquare-components'; +import get from 'lodash/get'; +import React, { + FunctionComponent, + useCallback, + useEffect, + useMemo, + useState, +} from 'react'; -import { ProjectInfos } from './ProjectInfos'; import { Form, ProjectFeatureFlags } from './ProjectFeatureFlags'; +import { ProjectInfos } from './ProjectInfos'; import { Project } from '../types/project'; -import MESSAGES from '../messages'; +import { EditIconButton } from '../../../components/Buttons/EditIconButton'; import { useGetFeatureFlags } from '../hooks/requests'; +import MESSAGES from '../messages'; import { FeatureFlag } from '../types/featureFlag'; -import { EditIconButton } from '../../../components/Buttons/EditIconButton'; type Tab = 'infos' | 'feature_flags'; type Props = { initialData?: Project | null; - // eslint-disable-next-line no-unused-vars saveProject: (s: Project) => Promise; closeDialog: () => void; isOpen: boolean; @@ -292,5 +291,6 @@ const editProjectModalWithIcon = makeFullModal( export { createProjectModalWithButton as CreateProjectDialog, - editProjectModalWithIcon as EditProjectDialog, + editProjectModalWithIcon as EditProjectDialog }; + diff --git a/hat/assets/js/apps/Iaso/domains/projects/components/FeatureFlagsSwitches.tsx b/hat/assets/js/apps/Iaso/domains/projects/components/FeatureFlagsSwitches.tsx index 9644e6d5d4..c05fc66423 100644 --- a/hat/assets/js/apps/Iaso/domains/projects/components/FeatureFlagsSwitches.tsx +++ b/hat/assets/js/apps/Iaso/domains/projects/components/FeatureFlagsSwitches.tsx @@ -1,9 +1,9 @@ -import React, { useCallback } from 'react'; import { Box } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { LoadingSpinner, Table } from 'bluesquare-components'; -import { FeatureFlag } from '../types/featureFlag'; +import React, { useCallback } from 'react'; import { useFeatureFlagColumns } from '../config'; +import { FeatureFlag } from '../types/featureFlag'; const styles = theme => ({ container: { @@ -25,7 +25,6 @@ const styles = theme => ({ type Props = { featureFlags: FeatureFlag[]; projectFeatureFlagsValues: (string | number)[]; - // eslint-disable-next-line no-unused-vars handleChange: (newValue: any) => void; isLoading; }; diff --git a/hat/assets/js/apps/Iaso/domains/projects/components/ProjectFeatureFlags.tsx b/hat/assets/js/apps/Iaso/domains/projects/components/ProjectFeatureFlags.tsx index 9eda413069..b2c7dd6f79 100644 --- a/hat/assets/js/apps/Iaso/domains/projects/components/ProjectFeatureFlags.tsx +++ b/hat/assets/js/apps/Iaso/domains/projects/components/ProjectFeatureFlags.tsx @@ -10,7 +10,6 @@ export type Form = { }; type Props = { - // eslint-disable-next-line no-unused-vars setFieldValue: (key: string, value: string) => void; projectFeatureFlagsValues: (string | number)[]; featureFlags?: FeatureFlag[]; diff --git a/hat/assets/js/apps/Iaso/domains/projects/components/ProjectInfos.tsx b/hat/assets/js/apps/Iaso/domains/projects/components/ProjectInfos.tsx index 6a2e4fc2d2..e8da83bdb7 100644 --- a/hat/assets/js/apps/Iaso/domains/projects/components/ProjectInfos.tsx +++ b/hat/assets/js/apps/Iaso/domains/projects/components/ProjectInfos.tsx @@ -16,7 +16,6 @@ type ProjectForm = { }; type Props = { - // eslint-disable-next-line no-unused-vars setFieldValue: (key: string, value: string) => void; currentProject: ProjectForm; }; diff --git a/hat/assets/js/apps/Iaso/domains/projects/config.tsx b/hat/assets/js/apps/Iaso/domains/projects/config.tsx index c0b25651f1..57acb56b9d 100644 --- a/hat/assets/js/apps/Iaso/domains/projects/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/projects/config.tsx @@ -1,19 +1,19 @@ -import React, { ReactElement, useMemo } from 'react'; +import HelpOutlineIcon from '@mui/icons-material/HelpOutline'; +import { Box, Switch, Tooltip } from '@mui/material'; import { - textPlaceholder, - IntlMessage, Column, + IntlMessage, + textPlaceholder, useSafeIntl, } from 'bluesquare-components'; -import { Box, Switch, Tooltip } from '@mui/material'; -import HelpOutlineIcon from '@mui/icons-material/HelpOutline'; +import React, { ReactElement, useMemo } from 'react'; import { EditProjectDialog } from './components/CreateEditProjectDialog'; import { baseUrls } from '../../constants/urls'; import MESSAGES from './messages'; -import { Project } from './types/project'; import { FeatureFlag } from './types/featureFlag'; +import { Project } from './types/project'; type Params = { pageSize: string; @@ -24,11 +24,8 @@ type Params = { export const baseUrl = baseUrls.projects; export const columns = ( - // eslint-disable-next-line no-unused-vars formatMessage: (msg: IntlMessage) => string, - // eslint-disable-next-line no-unused-vars params: Params, - // eslint-disable-next-line no-unused-vars saveProject: (s: Project) => Promise, ): Array => [ { @@ -71,7 +68,6 @@ export const columns = ( ]; export const useFeatureFlagColumns = ( - // eslint-disable-next-line no-unused-vars setFeatureFlag: (featureFlag: FeatureFlag, isChecked: boolean) => void, featureFlagsValues: (string | number)[], ): Array => { diff --git a/hat/assets/js/apps/Iaso/domains/registry/components/OrgUnitPaper.tsx b/hat/assets/js/apps/Iaso/domains/registry/components/OrgUnitPaper.tsx index ee12bf2596..4b69951632 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/components/OrgUnitPaper.tsx +++ b/hat/assets/js/apps/Iaso/domains/registry/components/OrgUnitPaper.tsx @@ -35,7 +35,6 @@ type Props = { setSelectedChildren: Dispatch>; selectedChildrenId: string | undefined; isFetchingOrgUnit: boolean; - // eslint-disable-next-line no-unused-vars handleOrgUnitChange: (newOrgUnit: OrgUnit) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/registry/components/map/MapSettings.tsx b/hat/assets/js/apps/Iaso/domains/registry/components/map/MapSettings.tsx index e72bbd65c2..866db6c5a9 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/components/map/MapSettings.tsx +++ b/hat/assets/js/apps/Iaso/domains/registry/components/map/MapSettings.tsx @@ -84,7 +84,6 @@ export type Settings = { type Props = { settings: Settings; - // eslint-disable-next-line no-unused-vars handleChangeSettings: (key: string) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenLocations.tsx b/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenLocations.tsx index dd24b42507..289fd5f0c0 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenLocations.tsx +++ b/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenLocations.tsx @@ -20,12 +20,9 @@ type Props = { selectedChildrenId: string | undefined; activeChildren: OrgUnit[]; handleSingleClick: ( - // eslint-disable-next-line no-unused-vars ou: OrgUnit, - // eslint-disable-next-line no-unused-vars event: L.LeafletMouseEvent | undefined, ) => void; - // eslint-disable-next-line no-unused-vars handleDoubleClick: (event: L.LeafletMouseEvent, ou: OrgUnit) => void; showTooltip: boolean; clusterEnabled: boolean; diff --git a/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenMap.tsx b/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenMap.tsx index 5cbe336dbe..38bcac839d 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenMap.tsx +++ b/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenMap.tsx @@ -54,7 +54,6 @@ type Props = { setSelectedChildren: Dispatch>; selectedChildrenId: string | undefined; isFetchingOrgUnit: boolean; - // eslint-disable-next-line no-unused-vars handleOrgUnitChange: (newOrgUnit: OrgUnit) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenShapes.tsx b/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenShapes.tsx index ef40993d98..701ef0940c 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenShapes.tsx +++ b/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitChildrenShapes.tsx @@ -12,9 +12,7 @@ type Props = { selectedChildrenId: string | undefined; activeChildren: OrgUnit[]; handleFeatureEvents: ( - // eslint-disable-next-line no-unused-vars ou: OrgUnit, - // eslint-disable-next-line no-unused-vars ) => (feature: any, layer: L.Layer) => void; showTooltip: boolean; index: number; diff --git a/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitLocation.tsx b/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitLocation.tsx index cdcd307837..15ac33bfe8 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitLocation.tsx +++ b/hat/assets/js/apps/Iaso/domains/registry/components/map/OrgUnitLocation.tsx @@ -17,15 +17,11 @@ type Props = { isOrgUnitActive: boolean; selectedChildrenId: string | undefined; handleFeatureEvents: ( - // eslint-disable-next-line no-unused-vars ou: OrgUnit, - // eslint-disable-next-line no-unused-vars ) => (feature: any, layer: L.Layer) => void; handleSingleClick: ( - // eslint-disable-next-line no-unused-vars ou: OrgUnit, - // eslint-disable-next-line no-unused-vars event: L.LeafletMouseEvent | undefined, ) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetCreateInstance.ts b/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetCreateInstance.ts index d548458244..4939b210b8 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetCreateInstance.ts +++ b/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetCreateInstance.ts @@ -10,7 +10,6 @@ type Result = { export const useGetCreateInstance = ( returnUrl: string, formId?: string, - // eslint-disable-next-line no-unused-vars ): ((orgUnitId: number) => void) => { const createInstance = (orgUnitId: number) => { if (formId) { diff --git a/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetOrgUnit.ts b/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetOrgUnit.ts index e99bb904c1..a07359de31 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetOrgUnit.ts +++ b/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetOrgUnit.ts @@ -12,7 +12,6 @@ import { RegistryParams } from '../types'; type FetchOrgUnitsListResult = { isFetching: boolean; - // eslint-disable-next-line no-unused-vars fetchOrgUnit: (orgUnit: OrgUnit) => Promise; }; @@ -24,7 +23,7 @@ export const useFetchOrgUnits = (appId?: string): FetchOrgUnitsListResult => { async (orgUnit: OrgUnit): Promise => { setIsFetching(true); try { - let url = `/api/orgunits/${orgUnit.id}/` + let url = `/api/orgunits/${orgUnit.id}/`; if (appId) { url += `?app_id=${appId}`; } diff --git a/hat/assets/js/apps/Iaso/domains/storages/hooks/useGetOperationsTypes.ts b/hat/assets/js/apps/Iaso/domains/storages/hooks/useGetOperationsTypes.ts index 3f77290388..69fa5c1958 100644 --- a/hat/assets/js/apps/Iaso/domains/storages/hooks/useGetOperationsTypes.ts +++ b/hat/assets/js/apps/Iaso/domains/storages/hooks/useGetOperationsTypes.ts @@ -1,4 +1,4 @@ -import { useSafeIntl, IntlFormatMessage } from 'bluesquare-components'; +import { IntlFormatMessage, useSafeIntl } from 'bluesquare-components'; import { DropdownOptions } from '../../../types/utils'; import MESSAGES from '../messages'; @@ -38,7 +38,6 @@ export const useGetOperationsTypes = (): Array> => { }; export const useGetOperationsTypesLabel = (): (( - // eslint-disable-next-line no-unused-vars operationTypeKey: OperationType, ) => string) => { const operationTypes = useGetOperationsTypes(); diff --git a/hat/assets/js/apps/Iaso/domains/storages/types/storages.ts b/hat/assets/js/apps/Iaso/domains/storages/types/storages.ts index a6bbb58d2f..fba0f8f4a4 100644 --- a/hat/assets/js/apps/Iaso/domains/storages/types/storages.ts +++ b/hat/assets/js/apps/Iaso/domains/storages/types/storages.ts @@ -1,8 +1,8 @@ /* eslint-disable camelcase */ import { Pagination, UrlParams } from 'bluesquare-components'; -import { ShortOrgUnit } from '../../orgUnits/types/orgUnit'; import { Profile } from '../../../utils/usersUtils'; +import { ShortOrgUnit } from '../../orgUnits/types/orgUnit'; export type StorageFilterParams = { performedAt?: string; @@ -14,10 +14,7 @@ export type StorageFilterParams = { }; export type StorageParams = UrlParams & StorageFilterParams & { - select?: ( - // eslint-disable-next-line no-unused-vars - data: Array, - ) => Array; + select?: (data: Array) => Array; }; export type StorageStatus = { diff --git a/hat/assets/js/apps/Iaso/domains/teams/config.tsx b/hat/assets/js/apps/Iaso/domains/teams/config.tsx index a479df0a67..e857a75444 100644 --- a/hat/assets/js/apps/Iaso/domains/teams/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/teams/config.tsx @@ -1,6 +1,6 @@ import React, { ReactElement } from 'react'; -import { IntlFormatMessage, Column } from 'bluesquare-components'; +import { Column, IntlFormatMessage } from 'bluesquare-components'; import MESSAGES from './messages'; import { Team } from './types/team'; @@ -12,7 +12,6 @@ import { UsersTeamsCell } from './components/UsersTeamsCell'; export const teamColumns = ( formatMessage: IntlFormatMessage, - // eslint-disable-next-line no-unused-vars deleteTeam: (team: Team) => void, ): Column[] => { return [ diff --git a/hat/assets/js/apps/Iaso/domains/teams/types/team.ts b/hat/assets/js/apps/Iaso/domains/teams/types/team.ts index 06a54aa4e6..aae3ec7626 100644 --- a/hat/assets/js/apps/Iaso/domains/teams/types/team.ts +++ b/hat/assets/js/apps/Iaso/domains/teams/types/team.ts @@ -38,10 +38,7 @@ export type TeamFilterParams = { export type TeamParams = UrlParams & TeamFilterParams & { - select?: ( - // eslint-disable-next-line no-unused-vars - data: Array, - ) => Array; + select?: (data: Array) => Array; }; export type DropdownTeamsOptions = { diff --git a/hat/assets/js/apps/Iaso/domains/userRoles/components/PermissionsSwitches.tsx b/hat/assets/js/apps/Iaso/domains/userRoles/components/PermissionsSwitches.tsx index 8fe2e6b266..7f04b7316c 100644 --- a/hat/assets/js/apps/Iaso/domains/userRoles/components/PermissionsSwitches.tsx +++ b/hat/assets/js/apps/Iaso/domains/userRoles/components/PermissionsSwitches.tsx @@ -1,14 +1,14 @@ -import React, { useCallback, useMemo } from 'react'; import { Box } from '@mui/material'; import { makeStyles } from '@mui/styles'; -import { useSafeIntl, LoadingSpinner, Table } from 'bluesquare-components'; -import MESSAGES from '../messages'; -import { useSnackQuery } from '../../../libs/apiHooks'; +import { LoadingSpinner, Table, useSafeIntl } from 'bluesquare-components'; +import React, { useCallback, useMemo } from 'react'; import { getRequest } from '../../../libs/Api'; -import { Permission } from '../types/userRoles'; +import { useSnackQuery } from '../../../libs/apiHooks'; +import PERMISSIONS_GROUPS_MESSAGES from '../../users/permissionsGroupsMessages'; import PERMISSIONS_MESSAGES from '../../users/permissionsMessages'; import { useUserPermissionColumns } from '../config'; -import PERMISSIONS_GROUPS_MESSAGES from '../../users/permissionsGroupsMessages'; +import MESSAGES from '../messages'; +import { Permission } from '../types/userRoles'; const styles = theme => ({ container: { @@ -32,7 +32,6 @@ const useStyles = makeStyles(styles); type Props = { userRolePermissions: Permission[]; - // eslint-disable-next-line no-unused-vars handleChange: (newValue: any) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/userRoles/components/UserRoleDialogInfoComponent.tsx b/hat/assets/js/apps/Iaso/domains/userRoles/components/UserRoleDialogInfoComponent.tsx index 84fb3496a6..2a70145fb8 100644 --- a/hat/assets/js/apps/Iaso/domains/userRoles/components/UserRoleDialogInfoComponent.tsx +++ b/hat/assets/js/apps/Iaso/domains/userRoles/components/UserRoleDialogInfoComponent.tsx @@ -1,12 +1,11 @@ -import React, { FunctionComponent } from 'react'; -import { SimpleModal, useSafeIntl } from 'bluesquare-components'; import { Typography } from '@mui/material'; +import { SimpleModal, useSafeIntl } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; import MESSAGES from '../messages'; import DialogInfoButton from './DialogInfoButton'; type Props = { infoOpen: boolean; - // eslint-disable-next-line no-unused-vars setInfoOpen: (open: boolean) => void; closeDialog: () => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/userRoles/config.tsx b/hat/assets/js/apps/Iaso/domains/userRoles/config.tsx index 6b3fd7a4cf..0d3b19f802 100644 --- a/hat/assets/js/apps/Iaso/domains/userRoles/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/userRoles/config.tsx @@ -1,16 +1,15 @@ +import { Column, IntlFormatMessage, useSafeIntl } from 'bluesquare-components'; import React, { ReactElement, useMemo } from 'react'; -import { useSafeIntl, Column, IntlFormatMessage } from 'bluesquare-components'; -import { EditUserRoleDialog } from './components/CreateEditUserRole'; import { DateTimeCell } from '../../components/Cells/DateTimeCell'; -import MESSAGES from './messages'; -import USER_MESSAGES from '../users/messages'; import DeleteDialog from '../../components/dialogs/DeleteDialogComponent'; -import { UserRole, Permission } from './types/userRoles'; -import PermissionTooltip from '../users/components/PermissionTooltip'; import PermissionSwitch from '../users/components/PermissionSwitch'; +import PermissionTooltip from '../users/components/PermissionTooltip'; +import USER_MESSAGES from '../users/messages'; +import { EditUserRoleDialog } from './components/CreateEditUserRole'; +import MESSAGES from './messages'; +import { Permission, UserRole } from './types/userRoles'; export const useGetUserRolesColumns = ( - // eslint-disable-next-line no-unused-vars deleteUserRole: (userRole: UserRole) => void, ): Column[] => { const { formatMessage }: { formatMessage: IntlFormatMessage } = @@ -66,7 +65,6 @@ export const useGetUserRolesColumns = ( }; export const useUserPermissionColumns = ( - // eslint-disable-next-line no-unused-vars setPermissions: (permission: Permission, isChecked: boolean) => void, userRolePermissions: Permission[], ): Array => { diff --git a/hat/assets/js/apps/Iaso/domains/userRoles/types/userRoles.ts b/hat/assets/js/apps/Iaso/domains/userRoles/types/userRoles.ts index 663fca24e8..e8ac5dd016 100644 --- a/hat/assets/js/apps/Iaso/domains/userRoles/types/userRoles.ts +++ b/hat/assets/js/apps/Iaso/domains/userRoles/types/userRoles.ts @@ -13,10 +13,7 @@ export type UserRolesFilterParams = { export type UserRoleParams = UrlParams & UserRolesFilterParams & { - select?: ( - // eslint-disable-next-line no-unused-vars - data: Array, - ) => Array; + select?: (data: Array) => Array; }; export type Permission = { diff --git a/hat/assets/js/apps/Iaso/domains/users/components/PermissionSwitch.tsx b/hat/assets/js/apps/Iaso/domains/users/components/PermissionSwitch.tsx index d476865698..717259de21 100644 --- a/hat/assets/js/apps/Iaso/domains/users/components/PermissionSwitch.tsx +++ b/hat/assets/js/apps/Iaso/domains/users/components/PermissionSwitch.tsx @@ -6,7 +6,6 @@ type Props = { value: string | Permission; codeName: string; settings: any; - // eslint-disable-next-line no-unused-vars setPermissions: (permission: string | Permission, checked: boolean) => void; permissions: Permission[]; }; diff --git a/hat/assets/js/apps/Iaso/domains/users/components/PermissionsSwitches.tsx b/hat/assets/js/apps/Iaso/domains/users/components/PermissionsSwitches.tsx index 779af622b0..41f32ca801 100644 --- a/hat/assets/js/apps/Iaso/domains/users/components/PermissionsSwitches.tsx +++ b/hat/assets/js/apps/Iaso/domains/users/components/PermissionsSwitches.tsx @@ -52,9 +52,7 @@ const useStyles = makeStyles(styles); type Props = { isSuperUser?: boolean; currentUser: any; - // eslint-disable-next-line no-unused-vars handleChange: (newValue: any) => void; - // eslint-disable-next-line no-unused-vars setFieldValue: (fieldName, fieldError) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/users/components/useInitialUser.ts b/hat/assets/js/apps/Iaso/domains/users/components/useInitialUser.ts index f46e7c980c..cfdc5f887a 100644 --- a/hat/assets/js/apps/Iaso/domains/users/components/useInitialUser.ts +++ b/hat/assets/js/apps/Iaso/domains/users/components/useInitialUser.ts @@ -1,14 +1,12 @@ -import { useCallback, useEffect, useMemo, useState } from 'react'; import get from 'lodash/get'; -import { InitialUserData, UserDialogData } from '../types'; -import { UserRole } from '../../userRoles/types/userRoles'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { useGetUserRolesDropDown } from '../../userRoles/hooks/requests/useGetUserRoles'; +import { UserRole } from '../../userRoles/types/userRoles'; +import { InitialUserData, UserDialogData } from '../types'; export type InitialUserUtils = { user: UserDialogData; - // eslint-disable-next-line no-unused-vars setFieldErrors: (fieldName, fieldError) => void; - // eslint-disable-next-line no-unused-vars setFieldValue: (fieldName, fieldError) => void; }; diff --git a/hat/assets/js/apps/Iaso/domains/users/hooks/useGetUserPermissions.tsx b/hat/assets/js/apps/Iaso/domains/users/hooks/useGetUserPermissions.tsx index 6817301062..9c1a98b2d0 100644 --- a/hat/assets/js/apps/Iaso/domains/users/hooks/useGetUserPermissions.tsx +++ b/hat/assets/js/apps/Iaso/domains/users/hooks/useGetUserPermissions.tsx @@ -51,7 +51,6 @@ export const useGetUserPermissions = ( type SortProps = { allPermissions: Permission[]; - // eslint-disable-next-line no-unused-vars getPermissionLabel: (codename: string) => string; }; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/HeadSourceCell.tsx b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/HeadSourceCell.tsx index aeea4bec15..66c2653f72 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/HeadSourceCell.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/HeadSourceCell.tsx @@ -1,21 +1,19 @@ -import React, { FunctionComponent, useMemo } from 'react'; import { Box, Grid } from '@mui/material'; +import React, { FunctionComponent, useMemo } from 'react'; -import MESSAGES from '../../messages'; import InputComponent from '../../../../components/forms/InputComponent'; +import MESSAGES from '../../messages'; import { useGetForms } from '../../hooks/requests/useGetForms'; -import { Change } from '../../types'; import { DropdownOptions } from '../../../../types/utils'; +import { Change } from '../../types'; type Props = { - // eslint-disable-next-line no-unused-vars handleChangeForm: (_, value: string) => void; changes?: Change[]; change?: Change; form?: number; - // eslint-disable-next-line no-unused-vars handleChangeSourceVersion: (_, value: string) => void; sourceVersion: string; sourceVersionsDropdownOptions: DropdownOptions[]; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/HeadTargetCell.tsx b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/HeadTargetCell.tsx index cfe7d34bd0..1df5e60a5d 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/HeadTargetCell.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/HeadTargetCell.tsx @@ -1,17 +1,16 @@ -import React, { FunctionComponent } from 'react'; import { Box, Grid } from '@mui/material'; +import React, { FunctionComponent } from 'react'; import { useSafeIntl } from 'bluesquare-components'; -import MESSAGES from '../../messages'; import InputComponent from '../../../../components/forms/InputComponent'; +import MESSAGES from '../../messages'; import { DropdownOptions } from '../../../../types/utils'; import { ReferenceForm } from '../../types'; type Props = { - // eslint-disable-next-line no-unused-vars handleChangeTargetVersion: (_, value: string) => void; targetVersion: string; targetVersionsDropdownOptions: DropdownOptions[]; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/MappingTable.tsx b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/MappingTable.tsx index 526b2f2abf..0e69b0938f 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/MappingTable.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/MappingTable.tsx @@ -1,25 +1,25 @@ -import React, { - FunctionComponent, - useCallback, - useMemo, - SetStateAction, - Dispatch, -} from 'react'; +import { Box } from '@mui/material'; +import { makeStyles } from '@mui/styles'; import { - useSafeIntl, - Table, AddButton, IntlFormatMessage, + Table, + useSafeIntl, } from 'bluesquare-components'; -import { Box } from '@mui/material'; -import { makeStyles } from '@mui/styles'; import { cloneDeep } from 'lodash'; +import React, { + Dispatch, + FunctionComponent, + SetStateAction, + useCallback, + useMemo, +} from 'react'; -import { Mapping, ChangesOption, Change, ReferenceForm } from '../../types'; import { DropdownOptions } from '../../../../types/utils'; +import { Change, ChangesOption, Mapping, ReferenceForm } from '../../types'; -import MESSAGES from '../../messages'; import { PossibleField } from '../../../forms/types/forms'; +import MESSAGES from '../../messages'; import { useGetChangesModalColumns } from '../../config/changes'; @@ -33,15 +33,12 @@ type Props = { isFetchingSourcePossibleFields: boolean; form?: number; setIsTouched: Dispatch>; - // eslint-disable-next-line no-unused-vars handleChangeForm: (_, value: string) => void; changes?: Change[]; change?: Change; - // eslint-disable-next-line no-unused-vars handleChangeSourceVersion: (_, value: string) => void; sourceVersion: string; sourceVersionsDropdownOptions: DropdownOptions[]; - // eslint-disable-next-line no-unused-vars handleChangeTargetVersion: (_, value: string) => void; targetVersion: string; targetVersionsDropdownOptions: DropdownOptions[]; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/SourceCell.tsx b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/SourceCell.tsx index 0466005393..709d9b940b 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/SourceCell.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/SourceCell.tsx @@ -1,18 +1,15 @@ -import React, { FunctionComponent, useCallback, useMemo } from 'react'; import { cloneDeep } from 'lodash'; +import React, { FunctionComponent, useCallback, useMemo } from 'react'; import InputComponent from '../../../../components/forms/InputComponent'; -import { ChangesOption, Mapping } from '../../types'; import { useGetUnUsedChangesOptions } from '../../hooks/useGetUnUsedChangesOptions'; +import { ChangesOption, Mapping } from '../../types'; type Props = { sourceOptions: ChangesOption[]; handleUpdate: ( - // eslint-disable-next-line no-unused-vars key: keyof Mapping, - // eslint-disable-next-line no-unused-vars value: string | undefined, - // eslint-disable-next-line no-unused-vars index: number, ) => void; rowIndex: number; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/TargetCell.tsx b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/TargetCell.tsx index f9b81962ec..d6feaade4e 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/components/changes/TargetCell.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/components/changes/TargetCell.tsx @@ -1,19 +1,16 @@ -import React, { FunctionComponent, useCallback, useMemo } from 'react'; import { cloneDeep } from 'lodash'; +import React, { FunctionComponent, useCallback, useMemo } from 'react'; import InputComponent from '../../../../components/forms/InputComponent'; -import { ChangesOption, Mapping } from '../../types'; import { useGetUnUsedChangesOptions } from '../../hooks/useGetUnUsedChangesOptions'; +import { ChangesOption, Mapping } from '../../types'; type Props = { targetOptions: ChangesOption[]; sourceOptions: ChangesOption[]; handleUpdate: ( - // eslint-disable-next-line no-unused-vars key: keyof Mapping, - // eslint-disable-next-line no-unused-vars value: string | undefined, - // eslint-disable-next-line no-unused-vars index: number, ) => void; rowIndex: number; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/config/changes.tsx b/hat/assets/js/apps/Iaso/domains/workflows/config/changes.tsx index a7ae8c2552..e1d7b73ad8 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/config/changes.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/config/changes.tsx @@ -1,32 +1,32 @@ /* eslint-disable camelcase */ -import React from 'react'; import { - useSafeIntl, + Column, IconButton, IntlFormatMessage, - Column, + useSafeIntl, } from 'bluesquare-components'; +import React from 'react'; -import MESSAGES from '../messages'; import { DateCell } from '../../../components/Cells/DateTimeCell'; import { LinkToForm } from '../../forms/components/LinkToForm'; import { ChangesActionCell } from '../components/changes/ActionCell'; -import { TargetCell } from '../components/changes/TargetCell'; -import { SourceCell } from '../components/changes/SourceCell'; -import { MappingCell } from '../components/changes/MappingCell'; -import { HeadTargetCell } from '../components/changes/HeadTargetCell'; import { HeadSourceCell } from '../components/changes/HeadSourceCell'; +import { HeadTargetCell } from '../components/changes/HeadTargetCell'; +import { MappingCell } from '../components/changes/MappingCell'; +import { SourceCell } from '../components/changes/SourceCell'; +import { TargetCell } from '../components/changes/TargetCell'; +import MESSAGES from '../messages'; +import { DropdownOptions } from '../../../types/utils'; +import { FormVersion } from '../../forms/hooks/useGetPossibleFields'; +import { PossibleField } from '../../forms/types/forms'; import { - WorkflowVersionDetail, + Change, ChangesOption, Mapping, - Change, ReferenceForm, + WorkflowVersionDetail, } from '../types'; -import { PossibleField } from '../../forms/types/forms'; -import { FormVersion } from '../../forms/hooks/useGetPossibleFields'; -import { DropdownOptions } from '../../../types/utils'; export const useGetChangesColumns = ( versionId: string, @@ -105,28 +105,17 @@ export const useGetChangesColumns = ( type Params = { sourceOptions: ChangesOption[]; targetOptions: ChangesOption[]; - handleUpdate: ( - // eslint-disable-next-line no-unused-vars - key: keyof Mapping, - // eslint-disable-next-line no-unused-vars - value: string, - // eslint-disable-next-line no-unused-vars - index: number, - ) => void; - // eslint-disable-next-line no-unused-vars + handleUpdate: (key: keyof Mapping, value: string, index: number) => void; handleDelete: (index: number) => void; mappingArray: Mapping[]; isFetchingSourcePossibleFields: boolean; - // eslint-disable-next-line no-unused-vars handleChangeForm: (_, value: string) => void; changes?: Change[]; change?: Change; form?: number; - // eslint-disable-next-line no-unused-vars handleChangeSourceVersion: (_, value: string) => void; sourceVersion: string; sourceVersionsDropdownOptions: DropdownOptions[]; - // eslint-disable-next-line no-unused-vars handleChangeTargetVersion: (_, value: string) => void; targetVersion: string; targetVersionsDropdownOptions: DropdownOptions[]; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/config/followUps.tsx b/hat/assets/js/apps/Iaso/domains/workflows/config/followUps.tsx index c5b9db6cea..c52a9a2802 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/config/followUps.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/config/followUps.tsx @@ -1,21 +1,21 @@ /* eslint-disable camelcase */ -import React, { ReactNode } from 'react'; +import { Box } from '@mui/material'; import { - useSafeIntl, - QueryBuilderFields, - IntlFormatMessage, Column, + IntlFormatMessage, + QueryBuilderFields, + useSafeIntl, } from 'bluesquare-components'; -import { Box } from '@mui/material'; +import React, { ReactNode } from 'react'; -import MESSAGES from '../messages'; import { DateCell } from '../../../components/Cells/DateTimeCell'; -import { LinkToForm } from '../../forms/components/LinkToForm'; import { getLocaleDateFormat } from '../../../utils/dates'; +import { LinkToForm } from '../../forms/components/LinkToForm'; +import MESSAGES from '../messages'; +import { Field } from '../../forms/fields/constants'; import { FollowUpActionCell } from '../components/followUps/ActionCell'; import { WorkflowVersionDetail } from '../types'; -import { Field } from '../../forms/fields/constants'; interface FollowUpsColumns extends Column { accessor: string; @@ -237,7 +237,6 @@ export const iasoFields: Field[] = [ export const useGetFollowUpsColumns = ( getHumanReadableJsonLogic: ( - // eslint-disable-next-line no-unused-vars logic: Record, ) => string | ReactNode, versionId: string, diff --git a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersions.ts b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersions.ts index aa40f53652..5c6a7b7a3c 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersions.ts +++ b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersions.ts @@ -4,16 +4,16 @@ import { getRequest } from '../../../../libs/Api'; import { useSnackQuery } from '../../../../libs/apiHooks'; import { makeUrlWithParams } from '../../../../libs/utils'; import { - WorkflowVersionsPaginated, WorkflowsParams, WorkflowVersionDetail, + WorkflowVersionsPaginated, } from '../../types'; const getWorkflowVersions = async ( options: WorkflowsParams, ): Promise => { // taking accountId out in order not to pass it to API - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { pageSize, entityTypeId, accountId, ...params } = options as Record< string, any diff --git a/hat/assets/js/apps/Iaso/domains/workflows/hooks/useGetUnUsedChangesOptions.ts b/hat/assets/js/apps/Iaso/domains/workflows/hooks/useGetUnUsedChangesOptions.ts index 2cbe4e528e..97d68b88d4 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/hooks/useGetUnUsedChangesOptions.ts +++ b/hat/assets/js/apps/Iaso/domains/workflows/hooks/useGetUnUsedChangesOptions.ts @@ -1,5 +1,5 @@ -import { useCallback } from 'react'; import { cloneDeep } from 'lodash'; +import { useCallback } from 'react'; import { ChangesOption, Mapping } from '../types'; @@ -12,8 +12,7 @@ export const useGetUnUsedChangesOptions = ({ mappingKey, mappingArray, value, -}: // eslint-disable-next-line no-unused-vars -getUnUsedOptionsProps): ((options: ChangesOption[]) => ChangesOption[]) => { +}: getUnUsedOptionsProps): ((options: ChangesOption[]) => ChangesOption[]) => { const getUnUsedOptions = useCallback( (options: ChangesOption[]) => { const newOptions: ChangesOption[] = cloneDeep(options).filter( diff --git a/hat/assets/js/apps/Iaso/hooks/form.js b/hat/assets/js/apps/Iaso/hooks/form.js index 9a35bd75db..83ce456e69 100644 --- a/hat/assets/js/apps/Iaso/hooks/form.js +++ b/hat/assets/js/apps/Iaso/hooks/form.js @@ -107,7 +107,6 @@ export const getInstancesFilterValues = formState => { Object.entries(formState) // skipping tab, since it creates bugs // and shouldn't be managed by the filter anyway - // eslint-disable-next-line no-unused-vars .filter(([key, _valueDict]) => key !== 'tab') .map(([key, valueDict]) => [key, valueDict.value]), ); diff --git a/hat/assets/js/apps/Iaso/hooks/useBoundState.ts b/hat/assets/js/apps/Iaso/hooks/useBoundState.ts index 34e5efd1e5..93ba9320e6 100644 --- a/hat/assets/js/apps/Iaso/hooks/useBoundState.ts +++ b/hat/assets/js/apps/Iaso/hooks/useBoundState.ts @@ -1,11 +1,10 @@ -import { useState, useEffect } from 'react'; import isEqual from 'lodash/isEqual'; +import { useEffect, useState } from 'react'; // TODO: maybe put this one outside of the domain to use it somewhere else export const useBoundState = ( initialValue: T, boundValue: T, - // eslint-disable-next-line no-unused-vars ): [T, (newValue: T) => void] => { const [value, setValue] = useState(initialValue); diff --git a/hat/assets/js/apps/Iaso/hooks/useFilterState.ts b/hat/assets/js/apps/Iaso/hooks/useFilterState.ts index b5799a171f..da026ee6c0 100644 --- a/hat/assets/js/apps/Iaso/hooks/useFilterState.ts +++ b/hat/assets/js/apps/Iaso/hooks/useFilterState.ts @@ -1,6 +1,6 @@ -import React, { useState, useCallback, useMemo, useEffect } from 'react'; import { useRedirectTo, useRedirectToReplace } from 'bluesquare-components'; import { isEqual } from 'lodash'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useGetMultipleOrgUnits, useGetOrgUnit, @@ -10,10 +10,8 @@ import { OrgUnit } from '../domains/orgUnits/types/orgUnit'; export type FilterState = { filters: Record; handleSearch: () => void; - // eslint-disable-next-line no-unused-vars handleChange: (keyValue: string, value: unknown) => void; filtersUpdated: boolean; - // eslint-disable-next-line no-unused-vars setFiltersUpdated: (updated: boolean) => void; setFilters: React.Dispatch>; }; @@ -129,13 +127,11 @@ export const useFilterState = ({ type MultiTreeviewArgs = { paramIds: string | undefined; - // eslint-disable-next-line no-unused-vars handleChange: (key: string, value: (string | number)[] | undefined) => void; }; type MultiTreeviewFilter = { initialOrgUnits: OrgUnit[]; - // eslint-disable-next-line no-unused-vars handleOrgUnitChange: (orgUnits: (number | string)[] | undefined) => void; }; @@ -167,13 +163,11 @@ export const useMultiTreeviewFilterState = ({ type TreeviewArgs = { paramId: string | undefined; - // eslint-disable-next-line no-unused-vars handleChange: (key: string, value: (string | number)[] | undefined) => void; }; type TreeviewFilter = { initialOrgUnit: OrgUnit; - // eslint-disable-next-line no-unused-vars handleOrgUnitChange: (orgUnit: OrgUnit | undefined) => void; }; @@ -203,13 +197,11 @@ export const useTreeviewFilterState = ({ type CheckBoxFilterArgs = { keyValue: string; - // eslint-disable-next-line no-unused-vars handleChange: (key: string, value: boolean) => void; initialValue?: boolean; }; type CheckBoxFilter = { - // eslint-disable-next-line no-unused-vars handleCheckboxChange: (key: string, value: boolean) => void; checkBoxValue: boolean; }; diff --git a/hat/assets/js/apps/Iaso/hooks/useTabs.tsx b/hat/assets/js/apps/Iaso/hooks/useTabs.tsx index d5b0e12df5..f85139d08c 100644 --- a/hat/assets/js/apps/Iaso/hooks/useTabs.tsx +++ b/hat/assets/js/apps/Iaso/hooks/useTabs.tsx @@ -1,3 +1,4 @@ +import { useRedirectToReplace } from 'bluesquare-components'; import { Dispatch, SetStateAction, @@ -5,7 +6,6 @@ import { useMemo, useState, } from 'react'; -import { useRedirectToReplace } from 'bluesquare-components'; import { Optional } from '../types/utils'; type UseTabsParams = { @@ -18,7 +18,6 @@ type UseTabsParams = { type UseTabsValue = { tab: T; setTab: Dispatch>; - // eslint-disable-next-line no-unused-vars handleChangeTab: (_event: any, newTab: T) => void; }; diff --git a/hat/assets/js/apps/Iaso/index.tsx b/hat/assets/js/apps/Iaso/index.tsx index f052873154..36adc76738 100644 --- a/hat/assets/js/apps/Iaso/index.tsx +++ b/hat/assets/js/apps/Iaso/index.tsx @@ -34,13 +34,9 @@ const queryClient = new QueryClient({ declare global { interface Window { iasoApp: ( - // eslint-disable-next-line no-unused-vars element: HTMLElement, - // eslint-disable-next-line no-unused-vars enabledPluginsName: string[], - // eslint-disable-next-line no-unused-vars themeConfig: ThemeConfig, - // eslint-disable-next-line no-unused-vars userHomePage: string, ) => void; } diff --git a/hat/assets/js/apps/Iaso/libs/apiHooks.ts b/hat/assets/js/apps/Iaso/libs/apiHooks.ts index e859e3d1da..490c898605 100644 --- a/hat/assets/js/apps/Iaso/libs/apiHooks.ts +++ b/hat/assets/js/apps/Iaso/libs/apiHooks.ts @@ -72,9 +72,7 @@ type SnackMutationDict = { ignoreErrorCodes?: number[]; showSucessSnackBar?: boolean; successSnackBar?: ( - // eslint-disable-next-line no-unused-vars msg: IntlMessage, - // eslint-disable-next-line no-unused-vars data: any, ) => { messageKey: string; @@ -105,9 +103,7 @@ const useBaseSnackMutation = < showSucessSnackBar = true, ignoreErrorCodes: number[] = [], successSnackBar: ( - // eslint-disable-next-line no-unused-vars msg: IntlMessage, - // eslint-disable-next-line no-unused-vars data: any, ) => { messageKey: string; @@ -186,9 +182,7 @@ export const useSnackMutation = < showSucessSnackBar = true, ignoreErrorCodes: number[] = [], successSnackBar: ( - // eslint-disable-next-line no-unused-vars msg: IntlMessage, - // eslint-disable-next-line no-unused-vars data: any, ) => { messageKey: string; diff --git a/hat/assets/js/apps/Iaso/libs/utils.tsx b/hat/assets/js/apps/Iaso/libs/utils.tsx index 903f6b4529..a0bb45e909 100644 --- a/hat/assets/js/apps/Iaso/libs/utils.tsx +++ b/hat/assets/js/apps/Iaso/libs/utils.tsx @@ -5,10 +5,10 @@ * @param {{[p: string]: T}} urlParams */ -import React, { ReactElement } from 'react'; import { textPlaceholder } from 'bluesquare-components'; -import { DropdownOptions, Nullable, Optional } from '../types/utils'; +import React, { ReactElement } from 'react'; import { OptionsResponse } from '../types/general'; +import { DropdownOptions, Nullable, Optional } from '../types/utils'; // url should include closing slash export const makeUrlWithParams = ( @@ -50,7 +50,6 @@ export const makeRegexValidator = ): { name: string; message: string; - // eslint-disable-next-line no-unused-vars test: (value: string) => boolean; } => ({ name, @@ -94,8 +93,7 @@ export const mapOptions = ( // Convert object to 2 dimensional array Object.entries(data.actions.POST) // Only keep "choices" fields - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars - .filter(([_key, dict]) => dict.type === 'choice') + .filter(([, dict]) => dict.type === 'choice') // Format the choices as DropdownOptions .map(([key, dict]) => [ key, diff --git a/hat/assets/js/apps/Iaso/libs/validation.tsx b/hat/assets/js/apps/Iaso/libs/validation.tsx index 832b6bb33b..43f5dc695d 100644 --- a/hat/assets/js/apps/Iaso/libs/validation.tsx +++ b/hat/assets/js/apps/Iaso/libs/validation.tsx @@ -1,11 +1,11 @@ +import { IntlFormatMessage, IntlMessage } from 'bluesquare-components'; import { FormikErrors, FormikHelpers, FormikTouched } from 'formik'; +import { isEqual } from 'lodash'; import { useCallback, useMemo, useState } from 'react'; import { UseMutateAsyncFunction } from 'react-query'; import { TestConfig, TestContext } from 'yup'; -import { isEqual } from 'lodash'; -import { IntlFormatMessage, IntlMessage } from 'bluesquare-components'; -import { ApiError } from './Api'; import { ValidationError } from '../types/utils'; +import { ApiError } from './Api'; /** * The params passed to the hook @@ -21,7 +21,6 @@ type Params = { onError?: any; onCatch?: any; convertError?: ( - // eslint-disable-next-line no-unused-vars errorsDict: Record, ) => Record; }; @@ -58,7 +57,6 @@ type ApiValidationUtils< > = { payload: T; apiErrors: Record; - // eslint-disable-next-line no-unused-vars mutation: (values: T, helpers: any) => Promise; }; @@ -139,7 +137,6 @@ type TestContextExtended = TestContext> & { export const useAPIErrorValidator = ( errors: ValidationError, payload: T, - // eslint-disable-next-line no-unused-vars ): ((fieldKey: string) => TestConfig>) => { return useMemo( () => @@ -185,8 +182,7 @@ export const useTranslatedErrors = ({ touched, errors, messages, -}: // eslint-disable-next-line no-unused-vars -GetErrorParams): ((keyValue: string) => string[]) => { +}: GetErrorParams): ((keyValue: string) => string[]) => { const getErrors = useCallback( keyValue => { if (!touched[keyValue]) return []; diff --git a/hat/assets/js/apps/Iaso/redux/useInjectedStore.ts b/hat/assets/js/apps/Iaso/redux/useInjectedStore.ts index c3807a83a0..b86d5c7305 100644 --- a/hat/assets/js/apps/Iaso/redux/useInjectedStore.ts +++ b/hat/assets/js/apps/Iaso/redux/useInjectedStore.ts @@ -25,12 +25,7 @@ import { ReactReduxContext } from 'react-redux'; type Reducer = { reducerKey: string; - reducer: ( - // eslint-disable-next-line no-unused-vars - state: any, - // eslint-disable-next-line no-unused-vars - action: Record, - ) => Record; + reducer: (state: any, action: Record) => Record; }; type Reducers = Reducer[]; diff --git a/hat/assets/js/apps/Iaso/routing/hooks/useActiveParams.tsx b/hat/assets/js/apps/Iaso/routing/hooks/useActiveParams.tsx index 4712945c71..19abd90055 100644 --- a/hat/assets/js/apps/Iaso/routing/hooks/useActiveParams.tsx +++ b/hat/assets/js/apps/Iaso/routing/hooks/useActiveParams.tsx @@ -11,7 +11,7 @@ export const useActiveParams = ( params: ParamsWithAccountId, ): Record => { return useMemo(() => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { accountId, ...paramsToUse } = params; return paramsToUse; }, [params]); diff --git a/hat/assets/js/apps/Iaso/routing/hooks/useRedirections.tsx b/hat/assets/js/apps/Iaso/routing/hooks/useRedirections.tsx index 018c65c0d0..410073418c 100644 --- a/hat/assets/js/apps/Iaso/routing/hooks/useRedirections.tsx +++ b/hat/assets/js/apps/Iaso/routing/hooks/useRedirections.tsx @@ -140,7 +140,7 @@ type UseRedirectionsArgs = { userHomePage?: string; allowAnonymous: boolean; }; -// eslint-disable-next-line no-unused-vars + type RedirectionsMethod = (args: UseRedirectionsArgs) => ReactElement[]; type Redirection = { diff --git a/hat/assets/js/apps/Iaso/routing/routing.ts b/hat/assets/js/apps/Iaso/routing/routing.ts index 5157ae93e8..fb5a3d8742 100644 --- a/hat/assets/js/apps/Iaso/routing/routing.ts +++ b/hat/assets/js/apps/Iaso/routing/routing.ts @@ -1,10 +1,10 @@ -import { useLocation } from 'react-router-dom'; -import { useCallback, useContext, useMemo } from 'react'; import { convertObjectToUrlParams } from 'bluesquare-components'; +import { useCallback, useContext, useMemo } from 'react'; +import { useLocation } from 'react-router-dom'; import { baseUrls, paramsConfig } from '../constants/urls'; -import { useParamsObject } from './hooks/useParamsObject'; -import { PluginsContext } from '../utils'; import { Plugin } from '../domains/app/types'; +import { PluginsContext } from '../utils'; +import { useParamsObject } from './hooks/useParamsObject'; export const useCurrentLocationWithParams = ( newParams: Record, @@ -43,7 +43,6 @@ export const useBaseUrls = (): Record => { }; type GenUrlFunction = ( - // eslint-disable-next-line no-unused-vars newParams: Record, ) => string; diff --git a/hat/assets/js/apps/Iaso/routing/types.ts b/hat/assets/js/apps/Iaso/routing/types.ts index 8dd7f11b64..23073d2ca2 100644 --- a/hat/assets/js/apps/Iaso/routing/types.ts +++ b/hat/assets/js/apps/Iaso/routing/types.ts @@ -4,9 +4,7 @@ export type Route = { path: string; element: ReactElement; errorElement?: ReactElement; // eg: ErrorBoundary - // eslint-disable-next-line no-unused-vars action?: ({ request }) => any; - // eslint-disable-next-line no-unused-vars loader?: ({ request, params }) => any; }; @@ -21,7 +19,6 @@ export type RouteCustom = { permissions?: string[]; allowAnonymous?: boolean; isRootUrl?: boolean; - // eslint-disable-next-line no-unused-vars element: ReactNode; }; diff --git a/hat/assets/js/apps/Iaso/routing/utils.ts b/hat/assets/js/apps/Iaso/routing/utils.ts index ffb0d833e6..7b942e4249 100644 --- a/hat/assets/js/apps/Iaso/routing/utils.ts +++ b/hat/assets/js/apps/Iaso/routing/utils.ts @@ -1,6 +1,6 @@ import { createUrl } from 'bluesquare-components'; -import { baseUrls } from '../constants/urls'; import { getChipColors } from '../constants/chipColors'; +import { baseUrls } from '../constants/urls'; import { locationLimitMax } from '../domains/orgUnits/constants/orgUnitConstants'; import { cleanupParams } from '../utils/requests'; @@ -57,8 +57,7 @@ export const extractPrefixedParams = ( Object.keys(params) .filter(paramKey => paramKey.includes(prefix)) .forEach(prefixedKey => { - // eslint-disable-next-line no-unused-vars - const [_, upperCaseKey] = prefixedKey.split(prefix); + const [, upperCaseKey] = prefixedKey.split(prefix); const formattedKey = decapitalize(upperCaseKey); newParams[formattedKey] = newParams[prefixedKey]; delete newParams[prefixedKey]; diff --git a/hat/assets/js/apps/Iaso/types/general.ts b/hat/assets/js/apps/Iaso/types/general.ts index b52dd5d1c8..0c0ecbfc8e 100644 --- a/hat/assets/js/apps/Iaso/types/general.ts +++ b/hat/assets/js/apps/Iaso/types/general.ts @@ -27,29 +27,20 @@ export type RouterLocation = { }; export type Router = { - // eslint-disable-next-line no-unused-vars createHref: (location: any) => unknown; createkey: () => unknown; - // eslint-disable-next-line no-unused-vars createLocation: (location: any) => unknown; - // eslint-disable-next-line no-unused-vars createPath: (location: any) => unknown; getCurrentLocation: () => unknown; - // eslint-disable-next-line no-unused-vars go: (value: unknown) => unknown; goBack: () => unknown; goForward: () => unknown; - // eslint-disable-next-line no-unused-vars isActive: (location: unknown, indexOnly: unknown) => unknown; - // eslint-disable-next-line no-unused-vars listen: (listener: unknown) => unknown; - // eslint-disable-next-line no-unused-vars listenBefore: (hook: unknown) => unknown; location: RouterLocation; params: Record>; - // eslint-disable-next-line no-unused-vars setRouteLeaveHook: (route: unknown, hook: unknown) => unknown; - // eslint-disable-next-line no-unused-vars transitionTo: (nextLocation: unknown) => unknown; unsubscribe: () => unknown; }; diff --git a/hat/assets/js/apps/Iaso/utils/map/mapUtils.ts b/hat/assets/js/apps/Iaso/utils/map/mapUtils.ts index 77b0b49d91..18fdc923c3 100644 --- a/hat/assets/js/apps/Iaso/utils/map/mapUtils.ts +++ b/hat/assets/js/apps/Iaso/utils/map/mapUtils.ts @@ -171,7 +171,6 @@ export const polygonDrawOption = ( }; export const shapeOptions = (): { - // eslint-disable-next-line no-unused-vars onEachFeature: (feature: any, layer: any) => void; } => ({ onEachFeature: (feature, layer) => { @@ -191,7 +190,6 @@ type LatLng = { export type Bounds = { _northEast: LatLng; _southWest: LatLng; - // eslint-disable-next-line no-unused-vars extend: (bounds: Bounds) => Bounds; isValid: () => boolean; }; diff --git a/hat/assets/js/apps/Iaso/utils/table.ts b/hat/assets/js/apps/Iaso/utils/table.ts index 8fb663fc47..b195fcd883 100644 --- a/hat/assets/js/apps/Iaso/utils/table.ts +++ b/hat/assets/js/apps/Iaso/utils/table.ts @@ -1,8 +1,8 @@ -import React, { useCallback, useMemo, useState } from 'react'; import { selectionInitialState, setTableSelection, } from 'bluesquare-components'; +import React, { useCallback, useMemo, useState } from 'react'; import { Selection } from '../domains/orgUnits/types/selection'; import { useObjectState } from '../hooks/useObjectState'; import { PaginationParams } from '../types/general'; @@ -11,19 +11,11 @@ type UseTableSelection = { selection: Selection; setSelection: React.Dispatch>>; handleTableSelection: ( - // eslint-disable-next-line no-unused-vars selectionType: any, - // eslint-disable-next-line no-unused-vars - items?: Array, - // eslint-disable-next-line no-unused-vars - totalCount?: number, - ) => void; - handleSelectAll: ( - // eslint-disable-next-line no-unused-vars items?: Array, - // eslint-disable-next-line no-unused-vars totalCount?: number, ) => void; + handleSelectAll: (items?: Array, totalCount?: number) => void; handleUnselectAll: () => void; }; @@ -85,7 +77,6 @@ const defaultInitialState: PaginationParams = { type TableState = { params: PaginationParams; - // eslint-disable-next-line no-unused-vars onTableParamsChange: (newParams: PaginationParams) => void; }; export const useTableState = (initialState?: PaginationParams): TableState => { diff --git a/hat/assets/js/cypress/support/index.js b/hat/assets/js/cypress/support/index.js index 5b64989a89..def4087485 100644 --- a/hat/assets/js/cypress/support/index.js +++ b/hat/assets/js/cypress/support/index.js @@ -19,7 +19,6 @@ import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') -// eslint-disable-next-line no-unused-vars Cypress.on('uncaught:exception', (err, _runnable, _promise) => { if ( err.message.includes('AbortError') || diff --git a/package.json b/package.json index 976f5b14a1..3bc7a15ea4 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "author": "Bluesquare", "license": "Apache-2.0", "scripts": { - "fix-lint": "prettier-eslint \"./hat/assets/js/**/*.js\" --lint-different --write", - "show-lint-problems": "eslint \"./hat/assets/js/**/*.js\"", - "export-lint-problems": "eslint \"./hat/assets/js/**/*.js\" -f html -o ./hat/assets/js/lintErrors.html", + "fix-lint": "prettier-eslint \"./hat/assets/js/**/*.{js,ts,tsx}\" --lint-different --write", + "show-lint-problems": "eslint \"./hat/assets/js/**/*.{js,ts,tsx}\"", + "export-lint-problems": "eslint \"./hat/assets/js/**/*.{js,ts,tsx}\" -f html -o ./hat/assets/js/lintErrors.html", "test-coverage": "nyc npm run test", "test": "NODE_PATH=hat/assets/js/apps mocha --exit --require ./babel-register.js --require ./hat/assets/js/test/helpers.js --require ./hat/assets/js/test/dom.js './hat/assets/js/apps/**/*.spec.js'", "test-watch": "NODE_PATH=hat/assets/js/apps mocha --require ./babel-register.js --require ./hat/assets/js/test/helpers.js --require ./hat/assets/js/test/dom.js './hat/assets/js/apps/**/*.spec.js' --watch", diff --git a/plugins/polio/js/src/components/Inputs/DependentSingleSelect.tsx b/plugins/polio/js/src/components/Inputs/DependentSingleSelect.tsx index 6acd8d2395..041f937d83 100644 --- a/plugins/polio/js/src/components/Inputs/DependentSingleSelect.tsx +++ b/plugins/polio/js/src/components/Inputs/DependentSingleSelect.tsx @@ -12,7 +12,6 @@ type Props = { clearable?: boolean; required?: boolean; disabled?: boolean; - // eslint-disable-next-line no-unused-vars onChange?: (_keyValue: string, value: any) => void; dependsOn?: string[]; }; diff --git a/plugins/polio/js/src/components/Inputs/MultiSelect.tsx b/plugins/polio/js/src/components/Inputs/MultiSelect.tsx index 9bb32dce2f..41f30f28af 100644 --- a/plugins/polio/js/src/components/Inputs/MultiSelect.tsx +++ b/plugins/polio/js/src/components/Inputs/MultiSelect.tsx @@ -13,9 +13,7 @@ type Props = { clearable?: boolean; required?: boolean; disabled?: boolean; - // eslint-disable-next-line no-unused-vars onChange?: (_keyValue: string, value: any) => void; - // eslint-disable-next-line no-unused-vars renderTags?: (tagValue: Array, getTagProps: any) => Array; returnFullObject?: boolean; }; diff --git a/plugins/polio/js/src/components/Inputs/Select.tsx b/plugins/polio/js/src/components/Inputs/Select.tsx index 91b029244b..6288939fbe 100644 --- a/plugins/polio/js/src/components/Inputs/Select.tsx +++ b/plugins/polio/js/src/components/Inputs/Select.tsx @@ -12,9 +12,7 @@ type Props = { clearable?: boolean; required?: boolean; disabled?: boolean; - // eslint-disable-next-line no-unused-vars onChange?: (_keyValue: string, value: any) => void; - // eslint-disable-next-line no-unused-vars renderTags?: (tagValue: Array, getTagProps: any) => Array; freeSolo?: boolean; }; diff --git a/plugins/polio/js/src/components/Inputs/SingleSelect.tsx b/plugins/polio/js/src/components/Inputs/SingleSelect.tsx index 1676980cd1..072485d40e 100644 --- a/plugins/polio/js/src/components/Inputs/SingleSelect.tsx +++ b/plugins/polio/js/src/components/Inputs/SingleSelect.tsx @@ -12,7 +12,6 @@ type Props = { clearable?: boolean; required?: boolean; disabled?: boolean; - // eslint-disable-next-line no-unused-vars onChange?: (_keyValue: string, value: any) => void; }; diff --git a/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsFilters.tsx b/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsFilters.tsx index fe41b88e94..2445deff6e 100644 --- a/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsFilters.tsx +++ b/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsFilters.tsx @@ -1,13 +1,13 @@ /* eslint-disable react/require-default-props */ /* eslint-disable camelcase */ -import React, { FunctionComponent } from 'react'; -import { useSafeIntl, UrlParams } from 'bluesquare-components'; import { Box, Grid, useMediaQuery, useTheme } from '@mui/material'; +import { UrlParams, useSafeIntl } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; +import { FilterButton } from '../../../../../../../hat/assets/js/apps/Iaso/components/FilterButton'; import InputComponent from '../../../../../../../hat/assets/js/apps/Iaso/components/forms/InputComponent'; import { useFilterState } from '../../../../../../../hat/assets/js/apps/Iaso/hooks/useFilterState'; -import MESSAGES from '../../../constants/messages'; -import { FilterButton } from '../../../../../../../hat/assets/js/apps/Iaso/components/FilterButton'; import { DropdownOptions } from '../../../../../../../hat/assets/js/apps/Iaso/types/utils'; +import MESSAGES from '../../../constants/messages'; import { baseUrls } from '../../../constants/urls'; type Props = { @@ -24,7 +24,6 @@ type Props = { stepsList?: DropdownOptions[]; buttonSize?: 'medium' | 'small' | 'large' | undefined; showHidden: boolean; - // eslint-disable-next-line no-unused-vars setShowHidden: (show: boolean) => void; }; export const BudgetDetailsFilters: FunctionComponent = ({ diff --git a/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsTableLayout.tsx b/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsTableLayout.tsx index 5b7f0451c0..42b913f55d 100644 --- a/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsTableLayout.tsx +++ b/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsTableLayout.tsx @@ -1,13 +1,13 @@ import { Box, Divider, Paper } from '@mui/material'; +import { Column, Paginated, useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent } from 'react'; -import { useSafeIntl, Column, Paginated } from 'bluesquare-components'; import { TableWithDeepLink } from '../../../../../../../hat/assets/js/apps/Iaso/components/tables/TableWithDeepLink'; -import { BudgetDetailsFilters } from './BudgetDetailsFilters'; -import { BudgetStep } from '../types'; import { DropdownOptions } from '../../../../../../../hat/assets/js/apps/Iaso/types/utils'; -import { GraphTitle } from '../../LQAS-IM/shared/charts/GraphTitle'; -import { baseUrls } from '../../../constants/urls'; import MESSAGES from '../../../constants/messages'; +import { baseUrls } from '../../../constants/urls'; +import { GraphTitle } from '../../LQAS-IM/shared/charts/GraphTitle'; +import { BudgetStep } from '../types'; +import { BudgetDetailsFilters } from './BudgetDetailsFilters'; type Props = { budgetDetails?: Paginated; @@ -16,7 +16,6 @@ type Props = { columns: Column[]; params: any; showHidden: boolean; - // eslint-disable-next-line no-unused-vars setShowHidden: (show: boolean) => void; stepsList?: DropdownOptions[]; }; diff --git a/plugins/polio/js/src/domains/Budget/BudgetDetails/mobile/BudgetDetailsCardsLayout.tsx b/plugins/polio/js/src/domains/Budget/BudgetDetails/mobile/BudgetDetailsCardsLayout.tsx index a8d73c46f7..93807c8ec7 100644 --- a/plugins/polio/js/src/domains/Budget/BudgetDetails/mobile/BudgetDetailsCardsLayout.tsx +++ b/plugins/polio/js/src/domains/Budget/BudgetDetails/mobile/BudgetDetailsCardsLayout.tsx @@ -1,14 +1,13 @@ import { Box, Pagination } from '@mui/material'; import { makeStyles } from '@mui/styles'; -import React, { FunctionComponent } from 'react'; import { Paginated } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; import { BudgetEventCard } from '../../cards/BudgetEventCard'; import { BudgetStep } from '../../types'; type Props = { budgetDetails: Paginated; page?: number | string; - // eslint-disable-next-line no-unused-vars onCardPaginationChange: (value: any, newPage: number) => void; }; diff --git a/plugins/polio/js/src/domains/Budget/BudgetDetails/mobile/BudgetDetailsFiltersMobile.tsx b/plugins/polio/js/src/domains/Budget/BudgetDetails/mobile/BudgetDetailsFiltersMobile.tsx index 41b39967ac..c0760dd0a4 100644 --- a/plugins/polio/js/src/domains/Budget/BudgetDetails/mobile/BudgetDetailsFiltersMobile.tsx +++ b/plugins/polio/js/src/domains/Budget/BudgetDetails/mobile/BudgetDetailsFiltersMobile.tsx @@ -1,13 +1,12 @@ -import React, { FunctionComponent, useState } from 'react'; -import { Collapse, Grid, Box } from '@mui/material'; import MoreHorizIcon from '@mui/icons-material/MoreHoriz'; -import { BudgetDetailsFilters } from '../BudgetDetailsFilters'; +import { Box, Collapse, Grid } from '@mui/material'; +import React, { FunctionComponent, useState } from 'react'; import { DropdownOptions } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; +import { BudgetDetailsFilters } from '../BudgetDetailsFilters'; type Props = { params: any; showHidden: boolean; - // eslint-disable-next-line no-unused-vars setShowHidden: (show: boolean) => void; stepsList?: DropdownOptions[]; }; diff --git a/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudget.ts b/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudget.ts index 36914f1be0..c97525359e 100644 --- a/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudget.ts +++ b/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudget.ts @@ -77,7 +77,6 @@ const budgetDetailsFields: string[] = [ ]; export const useGetBudget = ( id: number, - // eslint-disable-next-line no-unused-vars onSuccess: (data: BudgetDetail) => void = () => null, ): UseQueryResult => { return useSnackQuery({ @@ -99,7 +98,6 @@ export const useGetBudget = ( }; const getBudgets = (params: any) => { const filteredParams = Object.entries(params).filter( - // eslint-disable-next-line no-unused-vars ([, value]) => value !== undefined, ); if (!params.order) { diff --git a/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudgetDetails.ts b/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudgetDetails.ts index 860b0252a6..bf67dacd28 100644 --- a/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudgetDetails.ts +++ b/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudgetDetails.ts @@ -1,6 +1,6 @@ /* eslint-disable camelcase */ -import { UseMutationResult, UseQueryResult } from 'react-query'; import { Paginated } from 'bluesquare-components'; +import { UseMutationResult, UseQueryResult } from 'react-query'; import { deleteRequest, getRequest, @@ -13,14 +13,13 @@ import { import { BudgetStep } from '../../types'; const getBudgetDetails = (params: any) => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { accountId, pageSize, ...otherParams } = params; const urlParams = { ...otherParams, limit: pageSize ?? '10', }; const filteredParams = Object.entries(urlParams).filter( - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars ([_key, value]) => value !== undefined, ); const queryString = new URLSearchParams( diff --git a/plugins/polio/js/src/domains/Budget/hooks/api/useSaveBudgetStep.tsx b/plugins/polio/js/src/domains/Budget/hooks/api/useSaveBudgetStep.tsx index e45b97d9bc..7536c7d027 100644 --- a/plugins/polio/js/src/domains/Budget/hooks/api/useSaveBudgetStep.tsx +++ b/plugins/polio/js/src/domains/Budget/hooks/api/useSaveBudgetStep.tsx @@ -1,9 +1,9 @@ /* eslint-disable camelcase */ -import { BudgetStep, LinkWithAlias } from '../../types'; -import MESSAGES from '../../../../constants/messages'; import { postRequest } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/Api'; import { useSnackMutation } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/apiHooks'; import { PostArg } from '../../../../../../../../hat/assets/js/apps/Iaso/types/general'; +import MESSAGES from '../../../../constants/messages'; +import { BudgetStep, LinkWithAlias } from '../../types'; type Payload = { transition_key: string; // key @@ -19,7 +19,6 @@ type PostRequestBody = PostArg; const postBudgetStep = (body: Payload): Promise => { const filteredParams = Object.fromEntries( Object.entries(body).filter( - // eslint-disable-next-line no-unused-vars ([key, value]) => value !== undefined && key !== 'general', ), ); @@ -34,7 +33,7 @@ const postBudgetStep = (body: Payload): Promise => { data: filteredParams, }; if (body.files) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { files, ...data } = filteredParams; const fileData = { files: body.files }; requestBody.data = data; diff --git a/plugins/polio/js/src/domains/Budget/hooks/api/useSaveOverrideStep.ts b/plugins/polio/js/src/domains/Budget/hooks/api/useSaveOverrideStep.ts index 3fab741463..0c82b0daed 100644 --- a/plugins/polio/js/src/domains/Budget/hooks/api/useSaveOverrideStep.ts +++ b/plugins/polio/js/src/domains/Budget/hooks/api/useSaveOverrideStep.ts @@ -1,9 +1,9 @@ /* eslint-disable camelcase */ -import { BudgetStep, LinkWithAlias } from '../../types'; -import MESSAGES from '../../../../constants/messages'; import { postRequest } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/Api'; import { useSnackMutation } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/apiHooks'; import { PostArg } from '../../../../../../../../hat/assets/js/apps/Iaso/types/general'; +import MESSAGES from '../../../../constants/messages'; +import { BudgetStep, LinkWithAlias } from '../../types'; type Payload = { new_state_key: string; // key @@ -33,7 +33,7 @@ const postOverrideStep = (body: Payload): Promise => { data: filteredParams, }; if (body.files) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars const { files, ...data } = filteredParams; const fileData = { files: body.files }; requestBody.data = data; diff --git a/plugins/polio/js/src/domains/Budget/index.tsx b/plugins/polio/js/src/domains/Budget/index.tsx index ba9b884b28..c31860d1dc 100644 --- a/plugins/polio/js/src/domains/Budget/index.tsx +++ b/plugins/polio/js/src/domains/Budget/index.tsx @@ -1,20 +1,24 @@ -import React, { FunctionComponent, useCallback, useState } from 'react'; import SearchIcon from '@mui/icons-material/Search'; import { Pagination } from '@mui/lab'; import { Box, Collapse, useMediaQuery, useTheme } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { LoadingSpinner, + useRedirectToReplace, useSafeIntl, useSkipEffectOnMount, - useRedirectToReplace, } from 'bluesquare-components'; +import React, { FunctionComponent, useCallback, useState } from 'react'; // @ts-ignore import TopBar from 'Iaso/components/nav/TopBarComponent'; import { TableWithDeepLink } from '../../../../../../hat/assets/js/apps/Iaso/components/tables/TableWithDeepLink'; -import { useCurrentUser } from '../../../../../../hat/assets/js/apps/Iaso/utils/usersUtils'; import { userHasPermission } from '../../../../../../hat/assets/js/apps/Iaso/domains/users/utils'; +import { useParamsObject } from '../../../../../../hat/assets/js/apps/Iaso/routing/hooks/useParamsObject'; +import { useCurrentUser } from '../../../../../../hat/assets/js/apps/Iaso/utils/usersUtils'; +import MESSAGES from '../../constants/messages'; +import { baseUrls } from '../../constants/urls'; +import { useStyles } from '../../styles/theme'; import { BudgetButtons } from './BudgetButtons'; import { BudgetFilters } from './BudgetFilters'; import { BudgetCard } from './cards/BudgetCard'; @@ -25,24 +29,17 @@ import { } from './hooks/api/useGetBudget'; import { useBudgetColumns } from './hooks/config'; import { Budget } from './types'; -import { useStyles } from '../../styles/theme'; -import MESSAGES from '../../constants/messages'; -import { baseUrls } from '../../constants/urls'; -import { useParamsObject } from '../../../../../../hat/assets/js/apps/Iaso/routing/hooks/useParamsObject'; const getCsvParams = (apiParams: Record): string => { const { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars pageSize, - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars page, ...paramsForCsv } = apiParams; const filteredParams: Record = Object.fromEntries( - Object.entries(paramsForCsv).filter( - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars - ([_key, value]) => value !== undefined, - ), + Object.entries(paramsForCsv).filter(([, value]) => value !== undefined), ); return new URLSearchParams(filteredParams).toString(); }; diff --git a/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/MapRoundSelector.tsx b/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/MapRoundSelector.tsx index 25bcfe61d9..eadd3a6882 100644 --- a/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/MapRoundSelector.tsx +++ b/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/MapRoundSelector.tsx @@ -1,15 +1,14 @@ /* eslint-disable react/jsx-props-no-spreading */ -import React, { FunctionComponent, useState } from 'react'; import { Box } from '@mui/material'; import { ConfirmCancelModal, makeFullModal } from 'bluesquare-components'; +import React, { FunctionComponent, useState } from 'react'; import InputComponent from '../../../../../../../../hat/assets/js/apps/Iaso/components/forms/InputComponent'; -import MESSAGES from '../../../../constants/messages'; import { DropdownOptions } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; +import MESSAGES from '../../../../constants/messages'; import { MapRoundButton } from './MapRoundButton'; type Props = { selection: 'all' | 'latest' | string; - // eslint-disable-next-line no-unused-vars onChange: (value: 'all' | 'latest' | string) => void; options: DropdownOptions<'all' | 'latest' | string>[]; isOpen: boolean; diff --git a/plugins/polio/js/src/domains/Calendar/campaignCalendar/popper/RoundPopper.tsx b/plugins/polio/js/src/domains/Calendar/campaignCalendar/popper/RoundPopper.tsx index e58c53a5c1..192c690df2 100644 --- a/plugins/polio/js/src/domains/Calendar/campaignCalendar/popper/RoundPopper.tsx +++ b/plugins/polio/js/src/domains/Calendar/campaignCalendar/popper/RoundPopper.tsx @@ -46,7 +46,6 @@ type Props = { handleClose: () => void; open: boolean; anchorEl: HTMLElement | undefined; - // eslint-disable-next-line no-unused-vars setDialogOpen: (open: boolean) => void; round: CalendarRound; }; diff --git a/plugins/polio/js/src/domains/Calendar/types.ts b/plugins/polio/js/src/domains/Calendar/types.ts index 3ae04f56eb..f5bf81ad46 100644 --- a/plugins/polio/js/src/domains/Calendar/types.ts +++ b/plugins/polio/js/src/domains/Calendar/types.ts @@ -5,7 +5,6 @@ export type Field = { width?: number; key: string; hideHeadTitle?: boolean; - // eslint-disable-next-line no-unused-vars render?: (campaign: MappedCampaign) => ReactElement | string; exportHide?: boolean; sortKey?: string; diff --git a/plugins/polio/js/src/domains/Campaigns/CampaignsList/useCampaignsTableColumns.tsx b/plugins/polio/js/src/domains/Campaigns/CampaignsList/useCampaignsTableColumns.tsx index 11e37b0df1..770a96fd71 100644 --- a/plugins/polio/js/src/domains/Campaigns/CampaignsList/useCampaignsTableColumns.tsx +++ b/plugins/polio/js/src/domains/Campaigns/CampaignsList/useCampaignsTableColumns.tsx @@ -10,9 +10,7 @@ import { EditCampaignModal } from '../MainDialog/EditCampaignModal'; type Args = { showOnlyDeleted: boolean; - // eslint-disable-next-line no-unused-vars handleClickRestoreRow: (value: number) => void; - // eslint-disable-next-line no-unused-vars handleClickDeleteRow: (value: number) => void; params: any; }; diff --git a/plugins/polio/js/src/domains/Campaigns/MainDialog/PolioDialogTab.tsx b/plugins/polio/js/src/domains/Campaigns/MainDialog/PolioDialogTab.tsx index 9af49e5fea..09bb6cb782 100644 --- a/plugins/polio/js/src/domains/Campaigns/MainDialog/PolioDialogTab.tsx +++ b/plugins/polio/js/src/domains/Campaigns/MainDialog/PolioDialogTab.tsx @@ -1,7 +1,7 @@ -import React, { FunctionComponent, ReactNode, useCallback } from 'react'; -import { useSafeIntl } from 'bluesquare-components'; -import { Tab, Tooltip } from '@mui/material'; import InfoIcon from '@mui/icons-material/Info'; +import { Tab, Tooltip } from '@mui/material'; +import { useSafeIntl } from 'bluesquare-components'; +import React, { FunctionComponent, ReactNode, useCallback } from 'react'; import classnames from 'classnames'; import MESSAGES from '../../../constants/messages'; @@ -20,7 +20,6 @@ type Props = { title: string; hasTabError: boolean; disabled: boolean; - // eslint-disable-next-line no-unused-vars handleChange: (_event: any, newValue: number) => void; }; diff --git a/plugins/polio/js/src/domains/Campaigns/MainDialog/PolioDialogTabs.tsx b/plugins/polio/js/src/domains/Campaigns/MainDialog/PolioDialogTabs.tsx index 7a56491b0e..1392458616 100644 --- a/plugins/polio/js/src/domains/Campaigns/MainDialog/PolioDialogTabs.tsx +++ b/plugins/polio/js/src/domains/Campaigns/MainDialog/PolioDialogTabs.tsx @@ -1,5 +1,5 @@ +import { Tabs } from '@mui/material'; import React, { FunctionComponent } from 'react'; -import { Tab, Tabs } from '@mui/material'; import { useStyles } from '../../../styles/theme'; import { PolioDialogTab } from './PolioDialogTab'; @@ -13,7 +13,6 @@ export type Tab = { type Props = { selectedTab: number; - // eslint-disable-next-line no-unused-vars handleChange: (_event: any, newValue: number) => void; tabs: Tab[]; }; diff --git a/plugins/polio/js/src/domains/Campaigns/MapComponent/MapPanes.tsx b/plugins/polio/js/src/domains/Campaigns/MapComponent/MapPanes.tsx index 6a8471dd09..c28d71437b 100644 --- a/plugins/polio/js/src/domains/Campaigns/MapComponent/MapPanes.tsx +++ b/plugins/polio/js/src/domains/Campaigns/MapComponent/MapPanes.tsx @@ -1,6 +1,6 @@ +import 'leaflet/dist/leaflet.css'; import React, { FunctionComponent, ReactNode } from 'react'; import { GeoJSON, Pane } from 'react-leaflet'; -import 'leaflet/dist/leaflet.css'; import { MapColor, Shape } from '../../../constants/types'; import { Tooltip } from './Tooltip'; @@ -8,18 +8,13 @@ import { Tooltip } from './Tooltip'; type Props = { mainLayer?: Shape[]; backgroundLayer?: Shape[]; - // eslint-disable-next-line no-unused-vars getMainLayerStyle?: (shape: Shape) => MapColor; - // eslint-disable-next-line no-unused-vars getBackgroundLayerStyle?: (shape: Shape) => MapColor; tooltipLabels?: { main: string; background: string }; name?: string; - // eslint-disable-next-line no-unused-vars makePopup?: (shape: Shape) => ReactNode; - // eslint-disable-next-line no-unused-vars onSelectShape?: (shape: Shape) => void; tooltipFieldKey?: string; - // eslint-disable-next-line no-unused-vars customTooltip?: (shape: Shape) => ReactNode; }; diff --git a/plugins/polio/js/src/domains/Campaigns/Rounds/RoundDates/RoundDates.tsx b/plugins/polio/js/src/domains/Campaigns/Rounds/RoundDates/RoundDates.tsx index acaa6442f4..95a2953ae6 100644 --- a/plugins/polio/js/src/domains/Campaigns/Rounds/RoundDates/RoundDates.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Rounds/RoundDates/RoundDates.tsx @@ -17,11 +17,8 @@ type Props = { roundIndex: number; roundNumber: number; setParentFieldValue: ( - // eslint-disable-next-line no-unused-vars field: string, - // eslint-disable-next-line no-unused-vars value: any, - // eslint-disable-next-line no-unused-vars shouldValidate?: boolean | undefined, ) => void; parentFieldValue: Round; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/ScopeField.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/ScopeField.tsx index f823b9de5d..2ab4e53cdc 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/ScopeField.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/ScopeField.tsx @@ -1,27 +1,24 @@ -import React, { FunctionComponent } from 'react'; import { Field } from 'formik'; -import { ScopeSearch } from './Scopes/ScopeSearch'; -import { ScopeInput } from './ScopeInput'; -import { FilteredDistricts } from './Scopes/types'; +import React, { FunctionComponent } from 'react'; import { OrgUnit } from '../../../../../../../hat/assets/js/apps/Iaso/domains/orgUnits/types/orgUnit'; import { CampaignFormValues } from '../../../constants/types'; import { PolioVaccine } from '../../../constants/virus'; +import { ScopeInput } from './ScopeInput'; +import { ScopeSearch } from './Scopes/ScopeSearch'; +import { FilteredDistricts } from './Scopes/types'; type Props = { name: string; search: string; filteredDistricts?: FilteredDistricts[]; searchScope: boolean; - // eslint-disable-next-line no-unused-vars setSearchScope: (newSearchScope: boolean) => void; isFetchingDistricts: boolean; isFetchingRegions: boolean; regionShapes?: OrgUnit[]; districtShapes?: OrgUnit[]; - // eslint-disable-next-line no-unused-vars setSearch: (newSearch: string) => void; page: number; - // eslint-disable-next-line no-unused-vars setPage: (page: number) => void; campaign: CampaignFormValues; // See ScopeField props for explanation availableVaccines?: PolioVaccine[]; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/ScopeInput.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/ScopeInput.tsx index 34881cac7f..b4c0493ce8 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/ScopeInput.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/ScopeInput.tsx @@ -19,13 +19,12 @@ import { MapScope } from './Scopes/MapScope'; import { OrgUnit } from '../../../../../../../hat/assets/js/apps/Iaso/domains/orgUnits/types/orgUnit'; import { CampaignFormValues, Scope, Vaccine } from '../../../constants/types'; +import { PolioVaccine } from '../../../constants/virus'; import { useIsPolioCampaign } from '../hooks/useIsPolioCampaignCheck'; import { FilteredDistricts } from './Scopes/types'; -import { PolioVaccine } from '../../../constants/virus'; type ExtraProps = { filteredDistricts: FilteredDistricts[]; - // eslint-disable-next-line no-unused-vars searchScope: boolean; onChangeSearchScope: () => void; isFetchingDistricts: boolean; @@ -34,7 +33,6 @@ type ExtraProps = { regionShapes?: OrgUnit[]; searchComponent: ReactNode; page: number; - // eslint-disable-next-line no-unused-vars setPage: (page: number) => void; campaign: CampaignFormValues; // Passing the campaign i.o getting it from formik context so we can re-use the component for subactivities availableVaccines?: PolioVaccine[]; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/DistrictScopeTable.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/DistrictScopeTable.tsx index 81a3ce1fe1..078e8de163 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/DistrictScopeTable.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/DistrictScopeTable.tsx @@ -44,16 +44,9 @@ type Props = { field: FieldInputProps; regionShapes: Shape[]; filteredDistricts?: FilteredDistricts[]; - toggleDistrictInVaccineScope: ( - // eslint-disable-next-line no-unused-vars - district: FilteredDistricts, - ) => void; - toggleRegion: ( - // eslint-disable-next-line no-unused-vars - district: FilteredDistricts, - ) => void; + toggleDistrictInVaccineScope: (district: FilteredDistricts) => void; + toggleRegion: (district: FilteredDistricts) => void; page: number; - // eslint-disable-next-line no-unused-vars setPage: (page: number) => void; isFetching: boolean; districtShapes: OrgUnit[]; @@ -270,38 +263,34 @@ export const DistrictScopeTable: FunctionComponent = ({ /> )} {isShapeInScope && ( - <> - - toggleDistrictInVaccineScope( - shape, - ) - } - color="primary" - icon="clear" - tooltipMessage={ - MESSAGES.removeDistrict - } - /> - + + toggleDistrictInVaccineScope( + shape, + ) + } + color="primary" + icon="clear" + tooltipMessage={ + MESSAGES.removeDistrict + } + /> )} {!isShapeInScope && ( - <> - - toggleDistrictInVaccineScope( - shape, - ) - } - color="primary" - overrideIcon={CheckIcon} - tooltipMessage={ - MESSAGES.addDistrict - } - /> - + + toggleDistrictInVaccineScope( + shape, + ) + } + color="primary" + overrideIcon={CheckIcon} + tooltipMessage={ + MESSAGES.addDistrict + } + /> )} diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/MapScope.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/MapScope.tsx index d4803caa65..9ce8001ae4 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/MapScope.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/MapScope.tsx @@ -30,10 +30,8 @@ type Props = { values: CampaignFormValues; regionShapes: OrgUnit[]; districtShapes: OrgUnit[]; - // eslint-disable-next-line no-unused-vars onSelectOrgUnit: (id: Shape) => void; selectedVaccine: string; - // eslint-disable-next-line no-unused-vars setSelectedVaccine: (selected: Vaccine) => void; isPolio?: boolean; availableVaccines?: PolioVaccine[]; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeMapLegend.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeMapLegend.tsx index 638c8bd9f1..63fbfe5dca 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeMapLegend.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeMapLegend.tsx @@ -14,7 +14,6 @@ import { Scope, Vaccine } from '../../../../constants/types'; type Props = { field: FieldInputProps; selectedVaccine: string; - // eslint-disable-next-line no-unused-vars setSelectedVaccine: (selected: Vaccine) => void; availableVaccines?: PolioVaccine[]; }; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeSearch.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeSearch.tsx index 29fce2570c..14fe6314ec 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeSearch.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeSearch.tsx @@ -1,12 +1,11 @@ -import React, { FunctionComponent } from 'react'; import { Grid } from '@mui/material'; +import React, { FunctionComponent } from 'react'; // @ts-ignore import InputComponent from 'Iaso/components/forms/InputComponent'; import MESSAGES from '../../../../constants/messages'; type Props = { search: string; - // eslint-disable-next-line no-unused-vars setSearch: (newSearch: string) => void; }; export const ScopeSearch: FunctionComponent = ({ diff --git a/plugins/polio/js/src/domains/Campaigns/campaignHistory/useGetMapLog.tsx b/plugins/polio/js/src/domains/Campaigns/campaignHistory/useGetMapLog.tsx index 809757258c..cf4ddee0dd 100644 --- a/plugins/polio/js/src/domains/Campaigns/campaignHistory/useGetMapLog.tsx +++ b/plugins/polio/js/src/domains/Campaigns/campaignHistory/useGetMapLog.tsx @@ -1,10 +1,9 @@ import React, { ReactNode, useCallback } from 'react'; -import { Row } from './Row'; import { MultiRows } from './MultiRows'; +import { Row } from './Row'; export const useGetMapLog = ( structure: Record, - // eslint-disable-next-line no-unused-vars ): ((logDetail: Record) => ReactNode[]) => { const getlogRows = useCallback( logDetail => diff --git a/plugins/polio/js/src/domains/Campaigns/hooks/api/useGetCampaigns.ts b/plugins/polio/js/src/domains/Campaigns/hooks/api/useGetCampaigns.ts index 60d980ea37..b0429d82ba 100644 --- a/plugins/polio/js/src/domains/Campaigns/hooks/api/useGetCampaigns.ts +++ b/plugins/polio/js/src/domains/Campaigns/hooks/api/useGetCampaigns.ts @@ -56,7 +56,6 @@ export type GetCampaignsParams = { const getURL = (urlParams: GetCampaignsParams, url: string): string => { const filteredParams: [string, any][] = Object.entries(urlParams).filter( - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars ([_key, value]) => value !== undefined, ); diff --git a/plugins/polio/js/src/domains/Campaigns/hooks/useGetCampaignFieldLabel.ts b/plugins/polio/js/src/domains/Campaigns/hooks/useGetCampaignFieldLabel.ts index 51a2b35fbe..1a91d3eddb 100644 --- a/plugins/polio/js/src/domains/Campaigns/hooks/useGetCampaignFieldLabel.ts +++ b/plugins/polio/js/src/domains/Campaigns/hooks/useGetCampaignFieldLabel.ts @@ -1,5 +1,3 @@ -/* eslint-disable no-unused-vars */ - import { useSafeIntl } from 'bluesquare-components'; import MESSAGES from '../../../constants/messages'; diff --git a/plugins/polio/js/src/domains/Campaigns/hooks/useGetCampaignFieldValue.ts b/plugins/polio/js/src/domains/Campaigns/hooks/useGetCampaignFieldValue.ts deleted file mode 100644 index ee95498419..0000000000 --- a/plugins/polio/js/src/domains/Campaigns/hooks/useGetCampaignFieldValue.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint-disable no-unused-vars */ -import moment from 'moment'; -import { useSafeIntl } from 'bluesquare-components'; - -import { CampaignFieldType } from '../constants/types'; - -import MESSAGES from '../constants/messages'; - -const textPlaceholder = '--'; - -export const useGetCampaignFieldValue = (): (( - fieldKey: string, - type: CampaignFieldType, -) => string) => { - const { formatMessage } = useSafeIntl(); - const getValue = (value, type): string => { - if (!value) return textPlaceholder; - switch (type) { - case 'string': - case 'number': { - return value || textPlaceholder; - } - case 'date': { - return value ? moment(value).format('L') : textPlaceholder; - } - case 'boolean': { - return value.toString(); - } - case 'dateTime': { - return value ? moment(value).format('LTS') : textPlaceholder; - } - case 'time': { - return value ? moment(value).format('T') : textPlaceholder; - } - default: - console.warn('value', value); - return formatMessage(MESSAGES.typeNotSupported, { type }); - } - }; - return getValue; -}; diff --git a/plugins/polio/js/src/domains/Campaigns/hooks/useIsPolioCampaignCheck.ts b/plugins/polio/js/src/domains/Campaigns/hooks/useIsPolioCampaignCheck.ts index 905c197153..3b1e2478be 100644 --- a/plugins/polio/js/src/domains/Campaigns/hooks/useIsPolioCampaignCheck.ts +++ b/plugins/polio/js/src/domains/Campaigns/hooks/useIsPolioCampaignCheck.ts @@ -33,7 +33,6 @@ export const useIsPolioCampaign = ( }; export const useIsPolioCampaignCheck = (): (( - // eslint-disable-next-line no-unused-vars campaign?: CampaignFormValues, ) => boolean) => { const { data: campaignTypes } = useGetCampaignTypes(); diff --git a/plugins/polio/js/src/domains/Campaigns/hooks/useValidateCampaign.tsx b/plugins/polio/js/src/domains/Campaigns/hooks/useValidateCampaign.tsx index 03d50d4d90..95f26e1274 100644 --- a/plugins/polio/js/src/domains/Campaigns/hooks/useValidateCampaign.tsx +++ b/plugins/polio/js/src/domains/Campaigns/hooks/useValidateCampaign.tsx @@ -10,7 +10,6 @@ import { useIsPolioCampaignCheck } from './useIsPolioCampaignCheck'; type ValidationResult = Record & { _error?: any }; export const useValidateCampaign = (): (( - // eslint-disable-next-line no-unused-vars values: CampaignFormValues, ) => Promise) => { const { plainSchema, polioSchema } = useFormValidator(); diff --git a/plugins/polio/js/src/domains/Config/ReasonsForDelay/CreateEdit/CreateEditReasonForDelay.tsx b/plugins/polio/js/src/domains/Config/ReasonsForDelay/CreateEdit/CreateEditReasonForDelay.tsx index 7beee9b46d..77aecc6774 100644 --- a/plugins/polio/js/src/domains/Config/ReasonsForDelay/CreateEdit/CreateEditReasonForDelay.tsx +++ b/plugins/polio/js/src/domains/Config/ReasonsForDelay/CreateEdit/CreateEditReasonForDelay.tsx @@ -1,24 +1,24 @@ -import React, { FunctionComponent, useCallback } from 'react'; +import { Box, Divider } from '@mui/material'; import { - useSafeIntl, + AddButton, ConfirmCancelModal, makeFullModal, - AddButton, + useSafeIntl, } from 'bluesquare-components'; -import { Box, Divider } from '@mui/material'; import { FormikProvider, useFormik } from 'formik'; import { isEqual } from 'lodash'; -import MESSAGES from '../../../../constants/messages'; +import React, { FunctionComponent, useCallback } from 'react'; import { EditIconButton } from '../../../../../../../../hat/assets/js/apps/Iaso/components/Buttons/EditIconButton'; +import InputComponent from '../../../../../../../../hat/assets/js/apps/Iaso/components/forms/InputComponent'; +import { InputWithInfos } from '../../../../../../../../hat/assets/js/apps/Iaso/components/InputWithInfos'; +import { APP_LOCALES } from '../../../../../../../../hat/assets/js/apps/Iaso/domains/app/constants'; import { useApiErrorValidation, useTranslatedErrors, } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/validation'; -import { APP_LOCALES } from '../../../../../../../../hat/assets/js/apps/Iaso/domains/app/constants'; +import MESSAGES from '../../../../constants/messages'; import { useCreateEditReasonForDelay } from '../hooks/requests'; import { useReasonsForDelayValidation } from '../hooks/validation'; -import InputComponent from '../../../../../../../../hat/assets/js/apps/Iaso/components/forms/InputComponent'; -import { InputWithInfos } from '../../../../../../../../hat/assets/js/apps/Iaso/components/InputWithInfos'; type Props = { isOpen: boolean; @@ -48,7 +48,6 @@ const CreateEditReasonForDelay: FunctionComponent = ({ mutation: save, } = useApiErrorValidation, any>({ mutationFn: saveReason, - // eslint-disable-next-line no-unused-vars onSuccess: _ => { closeDialog(); formik.resetForm(); @@ -178,5 +177,6 @@ const editReasonForDelay = makeFullModal( export { createReasonForDelay as CreateReasonForDelay, - editReasonForDelay as EditReasonForDelay, + editReasonForDelay as EditReasonForDelay }; + diff --git a/plugins/polio/js/src/domains/GroupedCampaigns/GroupedCampaignDialog.tsx b/plugins/polio/js/src/domains/GroupedCampaigns/GroupedCampaignDialog.tsx index be1b51b0f1..a596358a27 100644 --- a/plugins/polio/js/src/domains/GroupedCampaigns/GroupedCampaignDialog.tsx +++ b/plugins/polio/js/src/domains/GroupedCampaigns/GroupedCampaignDialog.tsx @@ -1,31 +1,30 @@ /* eslint-disable react/require-default-props */ +import { Box, Divider, Grid } from '@mui/material'; import React, { FunctionComponent, + ReactNode, useCallback, - useState, useMemo, - ReactNode, + useState, } from 'react'; -import { Box, Divider, Grid } from '@mui/material'; // @ts-ignore import ConfirmCancelDialogComponent from 'Iaso/components/dialogs/ConfirmCancelDialogComponent'; import { useSafeIntl } from 'bluesquare-components'; -import MESSAGES from '../../constants/messages'; import InputComponent from '../../../../../../hat/assets/js/apps/Iaso/components/forms/InputComponent'; -import { useGetCampaigns } from '../Campaigns/hooks/api/useGetCampaigns'; +import { commaSeparatedIdsToStringArray } from '../../../../../../hat/assets/js/apps/Iaso/utils/forms'; +import MESSAGES from '../../constants/messages'; import { makeCampaignsDropDownWithUUID } from '../../utils'; +import { useGetCampaigns } from '../Campaigns/hooks/api/useGetCampaigns'; import { GroupedCampaignQuery, useSaveGroupedCampaign, } from './hooks/useSaveGroupedCampaign'; -import { commaSeparatedIdsToStringArray } from '../../../../../../hat/assets/js/apps/Iaso/utils/forms'; type Props = { name?: string; campaigns?: string[]; type: 'create' | 'edit'; id?: string; - // eslint-disable-next-line no-unused-vars renderTrigger: (openDialog: { openDialog: () => void }) => ReactNode; }; diff --git a/plugins/polio/js/src/domains/GroupedCampaigns/config.tsx b/plugins/polio/js/src/domains/GroupedCampaigns/config.tsx index 44d3e9165f..b781faf164 100644 --- a/plugins/polio/js/src/domains/GroupedCampaigns/config.tsx +++ b/plugins/polio/js/src/domains/GroupedCampaigns/config.tsx @@ -1,18 +1,17 @@ -import React, { ReactElement, ReactNode, useMemo } from 'react'; import { - IconButton, Column, - useSafeIntl, + IconButton, LinkWithLocation, + useSafeIntl, } from 'bluesquare-components'; +import React, { ReactElement, ReactNode, useMemo } from 'react'; import { DateTimeCellRfc } from '../../../../../../hat/assets/js/apps/Iaso/components/Cells/DateTimeCell'; -import MESSAGES from '../../constants/messages'; import DeleteDialog from '../../../../../../hat/assets/js/apps/Iaso/components/dialogs/DeleteDialogComponent'; -import { GroupedCampaignDialog } from './GroupedCampaignDialog'; +import MESSAGES from '../../constants/messages'; import { baseUrls } from '../../constants/urls'; +import { GroupedCampaignDialog } from './GroupedCampaignDialog'; export const useGroupedCampaignsColumns = ( - // eslint-disable-next-line no-unused-vars deleteGroupedCampaign: (id: string) => void, ): Array => { const { formatMessage } = useSafeIntl(); diff --git a/plugins/polio/js/src/domains/LQAS-IM/IM/CountryOverview/ImOverviewContainer.tsx b/plugins/polio/js/src/domains/LQAS-IM/IM/CountryOverview/ImOverviewContainer.tsx index d40bb01ca3..9bfd9c8c57 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/IM/CountryOverview/ImOverviewContainer.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/IM/CountryOverview/ImOverviewContainer.tsx @@ -1,18 +1,18 @@ +import { Box, Divider, Paper } from '@mui/material'; import React, { FunctionComponent, useMemo } from 'react'; -import { Paper, Divider, Box } from '@mui/material'; +import { DropdownOptions } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; +import { ConvertedLqasImData, IMType, Side } from '../../../../constants/types'; import { baseUrls } from '../../../../constants/urls'; -import { ImCountryMap } from './ImCountryMap'; import { LqasImMapHeader } from '../../shared/Map/LqasImMapHeader'; -import { ConvertedLqasImData, IMType, Side } from '../../../../constants/types'; -import { DropdownOptions } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; +import { LqasImTabs } from '../../shared/Tabs/LqasImTabs'; +import { useLqasImTabState } from '../../shared/Tabs/useLqasImTabState'; import { LIST, MAP } from '../../shared/constants'; -import { ImSummary } from './ImSummary'; +import { useMapShapes } from '../../shared/hooks/api/useMapShapes'; +import { useLqasImMapHeaderData } from '../../shared/hooks/useLqasImMapHeaderData'; import { getLqasImMapLayer } from '../utils'; import { ImCountryListOverview } from './ImCountryListOverview'; -import { useLqasImTabState } from '../../shared/Tabs/useLqasImTabState'; -import { LqasImTabs } from '../../shared/Tabs/LqasImTabs'; -import { useLqasImMapHeaderData } from '../../shared/hooks/useLqasImMapHeaderData'; -import { useMapShapes } from '../../shared/hooks/api/useMapShapes'; +import { ImCountryMap } from './ImCountryMap'; +import { ImSummary } from './ImSummary'; type Props = { round: number; @@ -25,7 +25,6 @@ type Props = { paperElevation: number; type: IMType; options: DropdownOptions[]; - // eslint-disable-next-line no-unused-vars onRoundChange: (value: number) => void; side: Side; params: Record; diff --git a/plugins/polio/js/src/domains/LQAS-IM/LQAS/CountryOverview/LqasOverviewContainer.tsx b/plugins/polio/js/src/domains/LQAS-IM/LQAS/CountryOverview/LqasOverviewContainer.tsx index e3fe7af093..6caa72fbfd 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/LQAS/CountryOverview/LqasOverviewContainer.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/LQAS/CountryOverview/LqasOverviewContainer.tsx @@ -1,19 +1,19 @@ import React, { FunctionComponent, useMemo } from 'react'; -import { Paper, Divider } from '@mui/material'; -import { LqasSummary } from './LqasSummary'; -import { LqasImMapHeader } from '../../shared/Map/LqasImMapHeader'; -import { ConvertedLqasImData, Side } from '../../../../constants/types'; +import { Divider, Paper } from '@mui/material'; import { DropdownOptions } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; -import { LIST, LqasIMView, MAP } from '../../shared/constants'; -import { LqasCountryListOverview } from './LqasCountryListOverview'; -import { getLqasImMapLayer } from '../../IM/utils'; -import { LqasCountryMap } from './LqasCountryMap'; +import { ConvertedLqasImData, Side } from '../../../../constants/types'; import { baseUrls } from '../../../../constants/urls'; +import { getLqasImMapLayer } from '../../IM/utils'; +import { LqasImMapHeader } from '../../shared/Map/LqasImMapHeader'; import { LqasImTabs } from '../../shared/Tabs/LqasImTabs'; import { useLqasImTabState } from '../../shared/Tabs/useLqasImTabState'; -import { useLqasImMapHeaderData } from '../../shared/hooks/useLqasImMapHeaderData'; +import { LIST, LqasIMView, MAP } from '../../shared/constants'; import { useMapShapes } from '../../shared/hooks/api/useMapShapes'; +import { useLqasImMapHeaderData } from '../../shared/hooks/useLqasImMapHeaderData'; +import { LqasCountryListOverview } from './LqasCountryListOverview'; +import { LqasCountryMap } from './LqasCountryMap'; +import { LqasSummary } from './LqasSummary'; type Props = { round: number; @@ -25,7 +25,6 @@ type Props = { debugData: Record | null | undefined; paperElevation: number; options: DropdownOptions[]; - // eslint-disable-next-line no-unused-vars onRoundChange: (value: number) => void; side: Side; params: Record; diff --git a/plugins/polio/js/src/domains/LQAS-IM/LQAS/Graphs/CaregiversTable.tsx b/plugins/polio/js/src/domains/LQAS-IM/LQAS/Graphs/CaregiversTable.tsx index 6515e62762..4d40f3d387 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/LQAS/Graphs/CaregiversTable.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/LQAS/Graphs/CaregiversTable.tsx @@ -1,27 +1,27 @@ /* eslint-disable react/require-default-props */ +import { Box } from '@mui/material'; +import { Table, useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent, - useState, useCallback, useMemo, + useState, } from 'react'; -import { Box } from '@mui/material'; -import { useSafeIntl, Table } from 'bluesquare-components'; import MESSAGES from '../../../../constants/messages'; import { ConvertedLqasImData, LqasImDistrictDataWithNameAndRegion, } from '../../../../constants/types'; -import { makeDataForTable } from '../utils'; +import { floatToPercentString } from '../../../../utils'; import { sortbyDistrictNameAsc, sortbyDistrictNameDesc, sortbyRegionNameAsc, sortbyRegionNameDesc, } from '../../shared/tableUtils'; -import { CaregiversTableHeader } from './CaregiversTableHeader'; -import { floatToPercentString } from '../../../../utils'; +import { makeDataForTable } from '../utils'; import { CaregiverInfoSource } from './CaregiverInfoSource'; +import { CaregiversTableHeader } from './CaregiversTableHeader'; type Props = { marginTop?: boolean; @@ -117,7 +117,6 @@ export const CaregiversTable: FunctionComponent = ({ const formatDataForTable = useCallback( ( tableData: LqasImDistrictDataWithNameAndRegion[], - // eslint-disable-next-line no-unused-vars sortFunc: (a: any, b: any) => number, ) => tableData diff --git a/plugins/polio/js/src/domains/LQAS-IM/LQAS/LqasAfroOverview/LqasAfroSelector.tsx b/plugins/polio/js/src/domains/LQAS-IM/LQAS/LqasAfroOverview/LqasAfroSelector.tsx index cdd9fd54cc..ad7e702313 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/LQAS/LqasAfroOverview/LqasAfroSelector.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/LQAS/LqasAfroOverview/LqasAfroSelector.tsx @@ -1,24 +1,16 @@ -import React, { FunctionComponent } from 'react'; -import { - Box, - Grid, - FormControlLabel, - Radio, - RadioGroup, -} from '@mui/material'; +import { Box, FormControlLabel, Grid, Radio, RadioGroup } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; import InputComponent from '../../../../../../../../hat/assets/js/apps/Iaso/components/forms/InputComponent'; -import { useOptions } from './utils'; import MESSAGES from '../../../../constants/messages'; import { AfroMapParams, Side } from './types'; +import { useOptions } from './utils'; type Props = { selectedRound: string; - // eslint-disable-next-line no-unused-vars onRoundChange: (value: string, side: Side) => void; side: Side; params: AfroMapParams; - // eslint-disable-next-line no-unused-vars onDisplayedShapeChange: (value: string, side: Side) => void; }; @@ -34,48 +26,46 @@ export const LqasAfroSelector: FunctionComponent = ({ const shapeKey = side === 'left' ? 'displayedShapesLeft' : 'displayedShapesRight'; return ( - <> - - - onRoundChange(value, side)} - value={selectedRound} - options={options} - clearable={false} - label={MESSAGES.round} - /> - - - - - onDisplayedShapeChange(value, side) - } - > - } - label={formatMessage( - MESSAGES.country, - ).toUpperCase()} - /> - } - label={formatMessage( - MESSAGES.district, - ).toUpperCase()} - /> - - - + + + onRoundChange(value, side)} + value={selectedRound} + options={options} + clearable={false} + label={MESSAGES.round} + /> + + + + + onDisplayedShapeChange(value, side) + } + > + } + label={formatMessage( + MESSAGES.country, + ).toUpperCase()} + /> + } + label={formatMessage( + MESSAGES.district, + ).toUpperCase()} + /> + + - + ); }; diff --git a/plugins/polio/js/src/domains/LQAS-IM/LQAS/LqasAfroOverview/Map/LqasAfroMapWithSelector.tsx b/plugins/polio/js/src/domains/LQAS-IM/LQAS/LqasAfroOverview/Map/LqasAfroMapWithSelector.tsx index 864c4810ee..dddd60a02a 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/LQAS/LqasAfroOverview/Map/LqasAfroMapWithSelector.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/LQAS/LqasAfroOverview/Map/LqasAfroMapWithSelector.tsx @@ -1,20 +1,20 @@ -import React, { FunctionComponent, useCallback, useState } from 'react'; -import { Box, Paper, Tabs, Tab } from '@mui/material'; +import { Box, Paper, Tab, Tabs } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { - useSafeIntl, commonStyles, useRedirectToReplace, + useSafeIntl, } from 'bluesquare-components'; -import { LIST, MAP, paperElevation } from '../../../shared/constants'; -import { LqasAfroMap } from './LqasAfroMap'; +import React, { FunctionComponent, useCallback, useState } from 'react'; import MESSAGES from '../../../../../constants/messages'; -import { AfroMapParams, Side } from '../types'; -import { LqasAfroSelector } from '../LqasAfroSelector'; -import { LqasAfroList } from '../ListView/LqasAfroList'; -import { LqasAfroOverviewContextProvider } from '../Context/LqasAfroOverviewContext'; import { Sides } from '../../../../../constants/types'; import { baseUrls } from '../../../../../constants/urls'; +import { LIST, MAP, paperElevation } from '../../../shared/constants'; +import { LqasAfroOverviewContextProvider } from '../Context/LqasAfroOverviewContext'; +import { LqasAfroList } from '../ListView/LqasAfroList'; +import { LqasAfroSelector } from '../LqasAfroSelector'; +import { AfroMapParams, Side } from '../types'; +import { LqasAfroMap } from './LqasAfroMap'; const useStyles = makeStyles(theme => ({ ...commonStyles(theme), @@ -32,11 +32,9 @@ const useStyles = makeStyles(theme => ({ type Props = { selectedRound: string; - // eslint-disable-next-line no-unused-vars onRoundChange: (value: string, side: Side) => void; side: Side; params: AfroMapParams; - // eslint-disable-next-line no-unused-vars onDisplayedShapeChange: (value: string, side: Side) => void; }; const baseUrl = baseUrls.lqasAfro; diff --git a/plugins/polio/js/src/domains/LQAS-IM/shared/Map/LqasImCountryMap.tsx b/plugins/polio/js/src/domains/LQAS-IM/shared/Map/LqasImCountryMap.tsx index e071ef433e..0368c6b0aa 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/shared/Map/LqasImCountryMap.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/shared/Map/LqasImCountryMap.tsx @@ -1,14 +1,14 @@ -import React, { FunctionComponent } from 'react'; import { Box } from '@mui/material'; import { LoadingSpinner } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; import { GreyHashedPattern } from '../../../../../../../../hat/assets/js/apps/Iaso/components/maps/HashedPatterns/GreyHashedPattern'; import { LegendItem, defaultShapeStyle } from '../../../../utils/index'; -import { ScopeAndDNFDisclaimer } from './ScopeAndDNFDisclaimer'; +import { MapComponent } from '../../../Campaigns/MapComponent/MapComponent'; +import { MapLegend } from '../../../Campaigns/MapComponent/MapLegend'; +import { MapLegendContainer } from '../../../Campaigns/MapComponent/MapLegendContainer'; import { HASHED_MAP_PATTERN } from '../constants'; import { makePopup } from './LqasImPopUp'; -import { MapLegendContainer } from '../../../Campaigns/MapComponent/MapLegendContainer'; -import { MapLegend } from '../../../Campaigns/MapComponent/MapLegend'; -import { MapComponent } from '../../../Campaigns/MapComponent/MapComponent'; +import { ScopeAndDNFDisclaimer } from './ScopeAndDNFDisclaimer'; const getBackgroundLayerStyle = () => defaultShapeStyle; @@ -27,7 +27,6 @@ type Props = { name: string; title: string; legendItems: LegendItem[]; - // eslint-disable-next-line no-unused-vars getMainLayerStyles: (shape: any) => Record; }; diff --git a/plugins/polio/js/src/domains/LQAS-IM/shared/Map/LqasImMapHeader.tsx b/plugins/polio/js/src/domains/LQAS-IM/shared/Map/LqasImMapHeader.tsx index 29eec746f0..0d25394b8d 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/shared/Map/LqasImMapHeader.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/shared/Map/LqasImMapHeader.tsx @@ -1,12 +1,12 @@ -import React, { FunctionComponent } from 'react'; import { Box, Divider, Grid, Typography } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { useSafeIntl } from 'bluesquare-components'; import classNames from 'classnames'; +import React, { FunctionComponent } from 'react'; +import InputComponent from '../../../../../../../../hat/assets/js/apps/Iaso/components/forms/InputComponent'; +import { DropdownOptions } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; import MESSAGES from '../../../../constants/messages'; import { LqasImDates } from './LqasImDates'; -import { DropdownOptions } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; -import InputComponent from '../../../../../../../../hat/assets/js/apps/Iaso/components/forms/InputComponent'; export type LqasImRefDate = { date: string; @@ -18,7 +18,6 @@ type Props = { startDate: LqasImRefDate; endDate: LqasImRefDate; options: DropdownOptions[]; - // eslint-disable-next-line no-unused-vars onRoundSelect: (round: number) => void; campaignObrName?: string; isFetching: boolean; diff --git a/plugins/polio/js/src/domains/LQAS-IM/shared/Tabs/LqasImTabs.tsx b/plugins/polio/js/src/domains/LQAS-IM/shared/Tabs/LqasImTabs.tsx index fd79990da6..74b864c3d2 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/shared/Tabs/LqasImTabs.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/shared/Tabs/LqasImTabs.tsx @@ -2,8 +2,8 @@ import { Tab, Tabs } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { commonStyles, useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent } from 'react'; -import { LIST, MAP } from '../constants'; import MESSAGES from '../../../../constants/messages'; +import { LIST, MAP } from '../constants'; const useStyles = makeStyles(theme => ({ ...commonStyles(theme), @@ -21,7 +21,6 @@ const useStyles = makeStyles(theme => ({ type Props = { tab: 'map' | 'list'; - // eslint-disable-next-line no-unused-vars handleChangeTab: (newTab: 'map' | 'list') => void; }; diff --git a/plugins/polio/js/src/domains/LQAS-IM/shared/Tabs/useLqasImTabState.tsx b/plugins/polio/js/src/domains/LQAS-IM/shared/Tabs/useLqasImTabState.tsx index 3515f02e0e..a63d4d669d 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/shared/Tabs/useLqasImTabState.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/shared/Tabs/useLqasImTabState.tsx @@ -1,7 +1,7 @@ -import { useCallback, useMemo, useState } from 'react'; import { useRedirectToReplace } from 'bluesquare-components'; -import { MAP } from '../constants'; +import { useCallback, useMemo, useState } from 'react'; import { Side, Sides } from '../../../../constants/types'; +import { MAP } from '../constants'; type TabValue = 'map' | 'list'; @@ -15,7 +15,6 @@ export const useLqasImTabState = ({ baseUrl, params, side, - // eslint-disable-next-line no-unused-vars }: Args): { tab: TabValue; handleChangeTab: (newTab: TabValue) => void } => { const redirectToReplace = useRedirectToReplace(); const paramTab = diff --git a/plugins/polio/js/src/domains/LQAS-IM/shared/charts/PercentageChartWithTitle.tsx b/plugins/polio/js/src/domains/LQAS-IM/shared/charts/PercentageChartWithTitle.tsx index 3d75b5a2a0..372e1e6011 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/shared/charts/PercentageChartWithTitle.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/shared/charts/PercentageChartWithTitle.tsx @@ -1,13 +1,12 @@ -import React, { FunctionComponent } from 'react'; import { Box, Typography } from '@mui/material'; import { LoadingSpinner } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; import { PercentageBarChart } from './PercentageBarChart'; type Props = { // eslint-disable-next-line react/require-default-props title?: string; data: any[]; - // eslint-disable-next-line no-unused-vars tooltipFormatter: (...args: any) => any; isLoading: boolean; chartKey: string; diff --git a/plugins/polio/js/src/domains/LQAS-IM/shared/hooks/useVerticalChartData.ts b/plugins/polio/js/src/domains/LQAS-IM/shared/hooks/useVerticalChartData.ts index d154ccc235..c4fa48337f 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/shared/hooks/useVerticalChartData.ts +++ b/plugins/polio/js/src/domains/LQAS-IM/shared/hooks/useVerticalChartData.ts @@ -1,15 +1,14 @@ -import { useMemo } from 'react'; import { useSafeIntl } from 'bluesquare-components'; +import { useMemo } from 'react'; import { - FormatForNFMArgs, BarChartData, + FormatForNFMArgs, LqasImCampaign, } from '../../../../constants/types'; type Params = { data?: Record; campaign?: string; - // eslint-disable-next-line no-unused-vars formatter: (args: FormatForNFMArgs) => BarChartData[]; type: string; selectedRounds: [number, number]; diff --git a/plugins/polio/js/src/domains/VaccineModule/StockManagement/hooks/api.ts b/plugins/polio/js/src/domains/VaccineModule/StockManagement/hooks/api.ts index 2b9c627570..c3f81c7ce0 100644 --- a/plugins/polio/js/src/domains/VaccineModule/StockManagement/hooks/api.ts +++ b/plugins/polio/js/src/domains/VaccineModule/StockManagement/hooks/api.ts @@ -1,34 +1,34 @@ /* eslint-disable camelcase */ -import { UseMutationResult, UseQueryResult } from 'react-query'; import { UrlParams } from 'bluesquare-components'; import { useMemo } from 'react'; +import { UseMutationResult, UseQueryResult } from 'react-query'; +import { + FormattedApiParams, + useApiParams, +} from '../../../../../../../../hat/assets/js/apps/Iaso/hooks/useApiParams'; +import { useUrlParams } from '../../../../../../../../hat/assets/js/apps/Iaso/hooks/useUrlParams'; import { deleteRequest, getRequest, patchRequest, postRequest, } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/Api'; -import { useUrlParams } from '../../../../../../../../hat/assets/js/apps/Iaso/hooks/useUrlParams'; -import { - FormattedApiParams, - useApiParams, -} from '../../../../../../../../hat/assets/js/apps/Iaso/hooks/useApiParams'; import { useSnackMutation, useSnackQuery, } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/apiHooks'; import { - StockManagementListParams, StockManagementDetailsParams, + StockManagementListParams, StockVariationParams, } from '../types'; +import { DropdownOptions } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; +import { commaSeparatedIdsToStringArray } from '../../../../../../../../hat/assets/js/apps/Iaso/utils/forms'; import { CAMPAIGNS_ENDPOINT, useGetCampaigns, } from '../../../Campaigns/hooks/api/useGetCampaigns'; -import { commaSeparatedIdsToStringArray } from '../../../../../../../../hat/assets/js/apps/Iaso/utils/forms'; -import { DropdownOptions } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; const defaults = { order: 'country', @@ -50,7 +50,6 @@ const options = { const apiUrl = '/api/polio/vaccine/vaccine_stock/'; const modalUrl = '/api/polio/vaccine/stock/'; -// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars const getVaccineStockList = async (params: FormattedApiParams) => { const queryString = new URLSearchParams(params).toString(); return getRequest(`${apiUrl}?${queryString}`); @@ -75,7 +74,6 @@ export const useGetVaccineStockList = ( }); }; -// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars const getUsableVials = async (id: string, queryString: string) => { return getRequest(`${apiUrl}${id}/usable_vials/?${queryString}`); }; @@ -105,7 +103,6 @@ export const useGetUsableVials = ( }); }; -// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars const getUnusableVials = async (id: string, queryString: string) => { return getRequest(`${apiUrl}${id}/get_unusable_vials/?${queryString}`); }; diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/SupplyChainTabs.tsx b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/SupplyChainTabs.tsx index 790e049b1c..4607ce5a17 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/SupplyChainTabs.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/SupplyChainTabs.tsx @@ -1,17 +1,16 @@ -import React, { FunctionComponent } from 'react'; -import { commonStyles, useSafeIntl } from 'bluesquare-components'; import { Tab, Tabs } from '@mui/material'; import { makeStyles } from '@mui/styles'; +import { commonStyles, useSafeIntl } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; import { TabWithInfoIcon } from '../../../../../../../../hat/assets/js/apps/Iaso/components/nav/TabWithInfoIcon'; -import MESSAGES from '../messages'; import { PREALERT, VAR, VRF } from '../constants'; +import MESSAGES from '../messages'; import { TabValue } from '../types'; type Props = { tab: TabValue; isNew: boolean; isNormal: boolean; - // eslint-disable-next-line no-unused-vars onChangeTab: (_event: any, newTab: TabValue) => void; }; diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VaccineSupplyChainDetails.tsx b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VaccineSupplyChainDetails.tsx index 665d954a78..667584860d 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VaccineSupplyChainDetails.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VaccineSupplyChainDetails.tsx @@ -1,37 +1,27 @@ /* eslint-disable camelcase */ -import React, { FunctionComponent, useCallback } from 'react'; +import { Box, Grid } from '@mui/material'; +import { makeStyles } from '@mui/styles'; import { LoadingSpinner, commonStyles, - useRedirectToReplace, useGoBack, + useRedirectToReplace, } from 'bluesquare-components'; -import { Box, Grid } from '@mui/material'; -import { makeStyles } from '@mui/styles'; -import { FormikProvider, useFormik } from 'formik'; import classnames from 'classnames'; -import { useParamsObject } from '../../../../../../../../hat/assets/js/apps/Iaso/routing/hooks/useParamsObject'; -import { useTabs } from '../../../../../../../../hat/assets/js/apps/Iaso/hooks/useTabs'; +import { FormikProvider, useFormik } from 'formik'; +import React, { FunctionComponent, useCallback } from 'react'; import TopBar from '../../../../../../../../hat/assets/js/apps/Iaso/components/nav/TopBarComponent'; +import { useObjectState } from '../../../../../../../../hat/assets/js/apps/Iaso/hooks/useObjectState'; +import { useTabs } from '../../../../../../../../hat/assets/js/apps/Iaso/hooks/useTabs'; +import { useParamsObject } from '../../../../../../../../hat/assets/js/apps/Iaso/routing/hooks/useParamsObject'; +import { Optional } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; +import { baseUrls } from '../../../../constants/urls'; +import { PREALERT, VAR, VRF } from '../constants'; +import { useGetArrivalReportsDetails } from '../hooks/api/arrivalReports'; +import { useGetPreAlertDetails } from '../hooks/api/preAlerts'; import { useSaveVaccineSupplyChainForm } from '../hooks/api/useSaveSupplyChainForm'; -import { VaccineRequestForm } from './VaccineRequestForm/VaccineRequestForm'; -import { PreAlerts } from './PreAlerts/PreAlerts'; -import { VaccineArrivalReports } from './VAR/VaccineArrivalReports'; -import { VaccineSupplyChainConfirmButtons } from './ConfirmButtons'; import { useGetVrfDetails } from '../hooks/api/vrf'; -import { useGetPreAlertDetails } from '../hooks/api/preAlerts'; -import { useGetArrivalReportsDetails } from '../hooks/api/arrivalReports'; -import { - PreAlert, - SupplyChainFormData, - TabValue, - VAR as VARType, - VRF as VrfType, -} from '../types'; -import { PREALERT, VAR, VRF } from '../constants'; import { useTopBarTitle } from '../hooks/useTopBarTitle'; -import { useSupplyChainFormValidator } from '../hooks/validation'; -import { useObjectState } from '../../../../../../../../hat/assets/js/apps/Iaso/hooks/useObjectState'; import { useEnableSaveButtons, useHandleSubmit, @@ -40,9 +30,19 @@ import { useInitializeVRFOnFetch, useWatchChangedTabs, } from '../hooks/utils'; +import { useSupplyChainFormValidator } from '../hooks/validation'; +import { + PreAlert, + SupplyChainFormData, + TabValue, + VAR as VARType, + VRF as VrfType, +} from '../types'; +import { VaccineSupplyChainConfirmButtons } from './ConfirmButtons'; +import { PreAlerts } from './PreAlerts/PreAlerts'; import { SupplyChainTabs } from './SupplyChainTabs'; -import { Optional } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; -import { baseUrls } from '../../../../constants/urls'; +import { VaccineRequestForm } from './VaccineRequestForm/VaccineRequestForm'; +import { VaccineArrivalReports } from './VAR/VaccineArrivalReports'; const useStyles = makeStyles(theme => { return { @@ -122,7 +122,6 @@ export const VaccineSupplyChainDetails: FunctionComponent = () => { formik.resetForm(); }, [formik]); - // eslint-disable-next-line no-unused-vars const handleSubmit: (saveAll?: boolean | undefined) => void = useHandleSubmit({ formik, diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/utils.ts b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/utils.ts index 12183f28d3..168436ddd9 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/utils.ts +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/utils.ts @@ -1,4 +1,5 @@ import { FormikErrors, FormikProps, FormikTouched } from 'formik'; +import { baseUrls } from '../../../../constants/urls'; import { VRF } from '../constants'; import { PreAlert, @@ -7,7 +8,6 @@ import { UseHandleSubmitArgs, VAR, } from '../types'; -import { baseUrls } from '../../../../constants/urls'; type SaveAllArgs = { changedTabs: TabValue[]; @@ -153,8 +153,7 @@ export const makeHandleSubmit = setInitialValues, saveForm, redirect, - }: // eslint-disable-next-line no-unused-vars - UseHandleSubmitArgs): ((saveAll?: boolean) => void) => + }: UseHandleSubmitArgs): ((saveAll?: boolean) => void) => (saveAll = false): void => { formik.submitForm(); saveForm( diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/utils.ts b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/utils.ts index 8b707b33fe..e2f17a0f1b 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/utils.ts +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/utils.ts @@ -1,18 +1,18 @@ /* eslint-disable camelcase */ -import React, { useEffect, useMemo, useRef, useState } from 'react'; -import { isEqual } from 'lodash'; import { FormikProps } from 'formik'; +import { isEqual } from 'lodash'; +import React, { useEffect, useMemo, useRef, useState } from 'react'; +import { Optional } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; import { PREALERT, VAR, VRF } from '../constants'; +import { makeHandleSubmit } from '../Details/utils'; import { PreAlert, - VAR as VARType, SupplyChainFormData, TabValue, UseHandleSubmitArgs, + VAR as VARType, VRF as VRFType, } from '../types'; -import { makeHandleSubmit } from '../Details/utils'; -import { Optional } from '../../../../../../../../hat/assets/js/apps/Iaso/types/utils'; export const dosesPerVial = { nOPV2: 50, @@ -170,8 +170,7 @@ export const useHandleSubmit = ({ setInitialValues, saveForm, redirect, -}: // eslint-disable-next-line no-unused-vars -UseHandleSubmitArgs): ((saveAll?: boolean | undefined) => void) => { +}: UseHandleSubmitArgs): ((saveAll?: boolean | undefined) => void) => { return useMemo(() => { return makeHandleSubmit({ formik, @@ -187,7 +186,6 @@ UseHandleSubmitArgs): ((saveAll?: boolean | undefined) => void) => { type UseWatchChangedTabsArgs = { initialValues: SupplyChainFormData; values: SupplyChainFormData; - // eslint-disable-next-line no-unused-vars setFieldValue: (key: string, value: any) => void; }; @@ -222,7 +220,6 @@ export const useWatchChangedTabs = ({ type UseInitializeVRFValueOnFetchArgs = { vrf?: VRFType; - // eslint-disable-next-line no-unused-vars setFieldValue: (key: string, value: any) => void; setInitialValues: React.Dispatch>; }; @@ -254,7 +251,6 @@ export const useInitializeVRFOnFetch = ({ type UseInitializePreAlertsValueOnFetchArgs = { preAlerts?: PreAlert[]; - // eslint-disable-next-line no-unused-vars setFieldValue: (key: string, value: any) => void; setInitialValues: React.Dispatch>; }; @@ -287,7 +283,6 @@ export const useInitializePreAlertsOnFetch = ({ }; type UseInitializeArrivalReportsValueOnFetchArgs = { arrivalReports?: VARType[]; - // eslint-disable-next-line no-unused-vars setFieldValue: (key: string, value: any) => void; setInitialValues: React.Dispatch>; }; diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/types.ts b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/types.ts index ecb8162668..039ffe8053 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/types.ts +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/types.ts @@ -1,12 +1,12 @@ /* eslint-disable camelcase */ -import React from 'react'; import { FormikProps } from 'formik'; +import React from 'react'; import { UseMutateAsyncFunction } from 'react-query'; -import { Vaccine } from '../../../constants/types'; import { DropdownOptions, Optional, } from '../../../../../../../hat/assets/js/apps/Iaso/types/utils'; +import { Vaccine } from '../../../constants/types'; export type TabValue = 'vrf' | 'arrival_reports' | 'pre_alerts'; @@ -110,6 +110,5 @@ export type UseHandleSubmitArgs = { initialValues: SupplyChainFormData; setInitialValues: React.Dispatch; saveForm: UseMutateAsyncFunction; - // eslint-disable-next-line no-unused-vars redirect: (url: string, options: Record) => void; }; diff --git a/plugins/registry/js/src/domains/registry/components/OrgUnitChildrenMap.tsx b/plugins/registry/js/src/domains/registry/components/OrgUnitChildrenMap.tsx index be0554ff4c..04ce17271b 100644 --- a/plugins/registry/js/src/domains/registry/components/OrgUnitChildrenMap.tsx +++ b/plugins/registry/js/src/domains/registry/components/OrgUnitChildrenMap.tsx @@ -55,7 +55,6 @@ type Props = { setSelectedChildren: Dispatch>; selectedChildrenId: string | undefined; isFetchingOrgUnit: boolean; - // eslint-disable-next-line no-unused-vars handleOrgUnitChange: (newOrgUnit: OrgUnit) => void; }; diff --git a/plugins/registry/js/src/domains/registry/components/OrgUnitPaper.tsx b/plugins/registry/js/src/domains/registry/components/OrgUnitPaper.tsx index 47f27c3067..d68d333b1d 100644 --- a/plugins/registry/js/src/domains/registry/components/OrgUnitPaper.tsx +++ b/plugins/registry/js/src/domains/registry/components/OrgUnitPaper.tsx @@ -38,7 +38,6 @@ type Props = { setSelectedChildren: Dispatch>; selectedChildrenId: string | undefined; isFetchingOrgUnit: boolean; - // eslint-disable-next-line no-unused-vars handleOrgUnitChange: (newOrgUnit: OrgUnit) => void; }; From dfdc325635dbf09f90e8839fcc52e64d8c77971f Mon Sep 17 00:00:00 2001 From: Christophe Gerard Date: Thu, 3 Oct 2024 13:23:06 +0200 Subject: [PATCH 3/9] fix cypress warnings, remove spread props warning --- .eslintrc.json | 8 ++-- .../js/apps/Iaso/components/FilterButton.tsx | 5 +-- .../components/dialogs/DialogComponent.js | 1 - .../Iaso/components/errors/PageNoPerms.tsx | 7 ++-- .../Iaso/components/forms/AsyncSelect.tsx | 1 - .../Iaso/components/forms/InputComponent.tsx | 2 - .../components/maps/MarkerMapComponent.tsx | 21 +++++----- .../Iaso/components/nav/TabWithInfoIcon.tsx | 1 - .../Iaso/components/tables/TableFilters.js | 5 +-- .../components/tables/TableWithDeepLink.tsx | 3 +- hat/assets/js/apps/Iaso/constants/menu.tsx | 1 - hat/assets/js/apps/Iaso/constants/routes.tsx | 5 +-- .../app/components/SidebarMenuComponent.js | 1 - .../apps/Iaso/domains/app/hooks/useRoutes.tsx | 1 - .../CopySourceVersion/CopySourceVersion.tsx | 23 +++++------ .../CopySourceVersion/CopyVersionWarnings.tsx | 3 +- .../dataSources/components/VersionsDialog.js | 19 +++++---- .../components/ActionTableColumnComponent.js | 2 - .../InstancePopUp/InstancePopUp.tsx | 1 - .../components/SpeedDialInstance.tsx | 19 +++++---- .../apps/Iaso/domains/instances/details.tsx | 1 - .../domains/pages/components/UsersSelect.tsx | 7 ++-- .../components/ProjectFeatureFlags.tsx | 1 - hat/assets/js/apps/Iaso/routing/legacy.tsx | 3 +- package-lock.json | 40 +++++++++++++++++++ package.json | 1 + plugins/polio/js/src/constants/menu.tsx | 1 - .../campaignCalendar/CampaignsFilters.tsx | 1 - .../map/CalendarMapTooltip.tsx | 3 +- .../campaignCalendar/map/MapRoundSelector.tsx | 1 - .../Campaigns/MainDialog/CreateEditDialog.tsx | 1 - .../MapComponent/AccordionMapLegend.tsx | 13 +++--- .../Campaigns/campaignHistory/config.tsx | 13 +++--- .../GroupedCampaignsFilter.tsx | 7 ++-- 34 files changed, 116 insertions(+), 106 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index f3ddcb0d1e..82fbcf0fa2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,11 +3,13 @@ "browser": true, "commonjs": true, "es6": true, - "node": true + "node": true, + "cypress/globals": true }, "extends": [ "airbnb", "plugin:react-hooks/recommended", + "plugin:cypress/recommended", "prettier" ], "globals": { @@ -161,7 +163,7 @@ 4 ], "react/jsx-one-expression-per-line": "off", - "react/jsx-props-no-spreading": "warn", + "react/jsx-props-no-spreading": "off", "react/jsx-wrap-multilines": "off", "react/no-access-state-in-setstate": "off", "react/no-array-index-key": "warn", @@ -273,7 +275,7 @@ 4 ], "react/jsx-one-expression-per-line": "off", - "react/jsx-props-no-spreading": "warn", + "react/jsx-props-no-spreading": "off", "react/jsx-wrap-multilines": "off", "react/no-access-state-in-setstate": "off", "react/no-array-index-key": "warn", diff --git a/hat/assets/js/apps/Iaso/components/FilterButton.tsx b/hat/assets/js/apps/Iaso/components/FilterButton.tsx index 5f8a3dbacf..6d3e849b78 100644 --- a/hat/assets/js/apps/Iaso/components/FilterButton.tsx +++ b/hat/assets/js/apps/Iaso/components/FilterButton.tsx @@ -1,8 +1,7 @@ /* eslint-disable react/require-default-props */ -/* eslint-disable react/jsx-props-no-spreading */ -import React, { FunctionComponent } from 'react'; import FiltersIcon from '@mui/icons-material/FilterList'; -import { Button, Box } from '@mui/material'; +import { Box, Button } from '@mui/material'; +import React, { FunctionComponent } from 'react'; import { FormattedMessage, defineMessages } from 'react-intl'; const MESSAGES = defineMessages({ diff --git a/hat/assets/js/apps/Iaso/components/dialogs/DialogComponent.js b/hat/assets/js/apps/Iaso/components/dialogs/DialogComponent.js index 0e9831ce35..60d8af0e9f 100644 --- a/hat/assets/js/apps/Iaso/components/dialogs/DialogComponent.js +++ b/hat/assets/js/apps/Iaso/components/dialogs/DialogComponent.js @@ -26,7 +26,6 @@ const normalizedMessage = CompOrMessage => { return ''; } if (CompOrMessage.id) { - // eslint-disable-next-line react/jsx-props-no-spreading return ; } return CompOrMessage; diff --git a/hat/assets/js/apps/Iaso/components/errors/PageNoPerms.tsx b/hat/assets/js/apps/Iaso/components/errors/PageNoPerms.tsx index cd99162a03..31d66509af 100644 --- a/hat/assets/js/apps/Iaso/components/errors/PageNoPerms.tsx +++ b/hat/assets/js/apps/Iaso/components/errors/PageNoPerms.tsx @@ -1,10 +1,9 @@ -/* eslint-disable react/jsx-props-no-spreading */ -import React from 'react'; -import { FormattedMessage } from 'react-intl'; +import Info from '@mui/icons-material/Info'; import { Box, Container, Paper, Typography } from '@mui/material'; import { makeStyles } from '@mui/styles'; -import Info from '@mui/icons-material/Info'; import { ClassNameMap } from 'notistack'; +import React from 'react'; +import { FormattedMessage } from 'react-intl'; import TopBar from '../nav/TopBarComponent'; import MESSAGES from './messages'; diff --git a/hat/assets/js/apps/Iaso/components/forms/AsyncSelect.tsx b/hat/assets/js/apps/Iaso/components/forms/AsyncSelect.tsx index 1f7ca2b363..efbb4ee449 100644 --- a/hat/assets/js/apps/Iaso/components/forms/AsyncSelect.tsx +++ b/hat/assets/js/apps/Iaso/components/forms/AsyncSelect.tsx @@ -134,7 +134,6 @@ export const AsyncSelect: FunctionComponent = ({ id={keyValue} renderInput={params => ( = ({ }} setFieldError={setFieldError} dataTestId={dataTestId} - // eslint-disable-next-line react/jsx-props-no-spreading {...localizedNumberOptions} /> ); @@ -322,7 +321,6 @@ const InputComponent: React.FC = ({ lang={locale as LangOptions} required={required} disabled={disabled} - // eslint-disable-next-line react/jsx-props-no-spreading {...phoneInputOptions} /> ); diff --git a/hat/assets/js/apps/Iaso/components/maps/MarkerMapComponent.tsx b/hat/assets/js/apps/Iaso/components/maps/MarkerMapComponent.tsx index 53b6b83669..8a64333ab7 100644 --- a/hat/assets/js/apps/Iaso/components/maps/MarkerMapComponent.tsx +++ b/hat/assets/js/apps/Iaso/components/maps/MarkerMapComponent.tsx @@ -1,27 +1,26 @@ -/* eslint-disable react/jsx-props-no-spreading */ -import React, { FunctionComponent, useState, useMemo } from 'react'; +import { pink } from '@mui/material/colors'; import { useTheme } from '@mui/material/styles'; +import { commonStyles, useSafeIntl } from 'bluesquare-components'; +import L from 'leaflet'; +import React, { FunctionComponent, useMemo, useState } from 'react'; import { GeoJSON, MapContainer, + Pane, ScaleControl, Tooltip, - Pane, } from 'react-leaflet'; -import L from 'leaflet'; -import { pink } from '@mui/material/colors'; -import { commonStyles, useSafeIntl } from 'bluesquare-components'; -import { Box, Alert, SxProps, Theme } from '@mui/material'; +import { Alert, Box, SxProps, Theme } from '@mui/material'; import { CustomTileLayer } from './tools/CustomTileLayer'; import tiles from '../../constants/mapTiles'; -import MarkerComponent from './markers/MarkerComponent'; -import { Tile } from './tools/TilesSwitchControl'; -import { CustomZoomControl } from './tools/CustomZoomControl'; import { ShortOrgUnit } from '../../domains/orgUnits/types/orgUnit'; -import MESSAGES from './messages'; import { useMarkerWithinBounds } from './hooks/useMarkerWithinBounds'; +import MarkerComponent from './markers/MarkerComponent'; +import MESSAGES from './messages'; +import { CustomZoomControl } from './tools/CustomZoomControl'; +import { Tile } from './tools/TilesSwitchControl'; const useStyles = () => { const theme = useTheme(); diff --git a/hat/assets/js/apps/Iaso/components/nav/TabWithInfoIcon.tsx b/hat/assets/js/apps/Iaso/components/nav/TabWithInfoIcon.tsx index 2f3523158e..2b32082c5c 100644 --- a/hat/assets/js/apps/Iaso/components/nav/TabWithInfoIcon.tsx +++ b/hat/assets/js/apps/Iaso/components/nav/TabWithInfoIcon.tsx @@ -84,7 +84,6 @@ export const TabWithInfoIcon: FunctionComponent = ({ )) || <> } - // eslint-disable-next-line react/jsx-props-no-spreading {...filteredProps} onClick={onChange} /> diff --git a/hat/assets/js/apps/Iaso/components/tables/TableFilters.js b/hat/assets/js/apps/Iaso/components/tables/TableFilters.js index bedc342a78..9004ef557f 100644 --- a/hat/assets/js/apps/Iaso/components/tables/TableFilters.js +++ b/hat/assets/js/apps/Iaso/components/tables/TableFilters.js @@ -1,11 +1,10 @@ -/* eslint-disable react/jsx-props-no-spreading */ +import PropTypes from 'prop-types'; import React from 'react'; import { defineMessages, FormattedMessage } from 'react-intl'; -import PropTypes from 'prop-types'; +import SearchIcon from '@mui/icons-material/Search'; import { Box, Button, Grid } from '@mui/material'; import { makeStyles } from '@mui/styles'; -import SearchIcon from '@mui/icons-material/Search'; import { commonStyles, getParamsKey } from 'bluesquare-components'; import { FiltersComponent } from '../filters/FiltersComponent'; diff --git a/hat/assets/js/apps/Iaso/components/tables/TableWithDeepLink.tsx b/hat/assets/js/apps/Iaso/components/tables/TableWithDeepLink.tsx index d8f761c0cf..d4e0a5aa1d 100644 --- a/hat/assets/js/apps/Iaso/components/tables/TableWithDeepLink.tsx +++ b/hat/assets/js/apps/Iaso/components/tables/TableWithDeepLink.tsx @@ -1,9 +1,9 @@ -import React, { FunctionComponent, useCallback } from 'react'; import { Table, TableComponentProps, useRedirectToReplace, } from 'bluesquare-components'; +import React, { FunctionComponent, useCallback } from 'react'; import { useQueryClient } from 'react-query'; type TableWithDeepLinkProps = TableComponentProps & { @@ -16,7 +16,6 @@ export const TableWithDeepLink: FunctionComponent = ({ }) => { const redirectToReplace = useRedirectToReplace(); return ( - // eslint-disable-next-line react/jsx-props-no-spreading diff --git a/hat/assets/js/apps/Iaso/constants/menu.tsx b/hat/assets/js/apps/Iaso/constants/menu.tsx index 1b30024485..54f0b0e596 100644 --- a/hat/assets/js/apps/Iaso/constants/menu.tsx +++ b/hat/assets/js/apps/Iaso/constants/menu.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import React, { useContext, useMemo } from 'react'; import AccountBalanceIcon from '@mui/icons-material/AccountBalance'; diff --git a/hat/assets/js/apps/Iaso/constants/routes.tsx b/hat/assets/js/apps/Iaso/constants/routes.tsx index d7bd38b40e..72646b63d1 100644 --- a/hat/assets/js/apps/Iaso/constants/routes.tsx +++ b/hat/assets/js/apps/Iaso/constants/routes.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import React, { ReactElement } from 'react'; import PageError from '../components/errors/PageError'; import { Runs } from '../domains/algorithmRuns/Runs'; @@ -25,6 +24,7 @@ import Mappings from '../domains/mappings'; import MappingDetails from '../domains/mappings/details'; import { Modules } from '../domains/modules'; import { OrgUnits } from '../domains/orgUnits'; +import { OrgUnitChangeRequestConfigs } from '../domains/orgUnits/configuration/OrgUnitChangeRequestConfigs'; import OrgUnitDetail from '../domains/orgUnits/details'; import Groups from '../domains/orgUnits/groups'; import GroupSets from '../domains/orgUnits/groupSets'; @@ -45,13 +45,12 @@ import Tasks from '../domains/tasks'; import { Teams } from '../domains/teams'; import { UserRoles } from '../domains/userRoles'; import { Users } from '../domains/users'; +import { UsersHistory } from '../domains/users/history/UsersHistory'; import { Workflows } from '../domains/workflows'; import { Details as WorkflowDetails } from '../domains/workflows/details'; import { SHOW_PAGES } from '../utils/featureFlags'; import * as Permission from '../utils/permissions'; import { baseUrls } from './urls'; -import { UsersHistory } from '../domains/users/history/UsersHistory'; -import { OrgUnitChangeRequestConfigs } from '../domains/orgUnits/configuration/OrgUnitChangeRequestConfigs'; export type RoutePath = { baseUrl: string; diff --git a/hat/assets/js/apps/Iaso/domains/app/components/SidebarMenuComponent.js b/hat/assets/js/apps/Iaso/domains/app/components/SidebarMenuComponent.js index bf13d405d6..c17438a67b 100644 --- a/hat/assets/js/apps/Iaso/domains/app/components/SidebarMenuComponent.js +++ b/hat/assets/js/apps/Iaso/domains/app/components/SidebarMenuComponent.js @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import ExitIcon from '@mui/icons-material/ExitToApp'; import { Box, diff --git a/hat/assets/js/apps/Iaso/domains/app/hooks/useRoutes.tsx b/hat/assets/js/apps/Iaso/domains/app/hooks/useRoutes.tsx index 43a91baf58..a830981b89 100644 --- a/hat/assets/js/apps/Iaso/domains/app/hooks/useRoutes.tsx +++ b/hat/assets/js/apps/Iaso/domains/app/hooks/useRoutes.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import { last } from 'lodash'; import React, { ElementType, ReactElement, useContext, useMemo } from 'react'; import { Route, Routes } from 'react-router'; diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx b/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx index ba3e0f5e63..e2af9c7fa3 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx @@ -1,28 +1,27 @@ -/* eslint-disable react/jsx-props-no-spreading */ /* eslint-disable camelcase */ -import React, { - FunctionComponent, - useCallback, - useState, - useMemo, - useEffect, -} from 'react'; -import { Grid, Box, Divider } from '@mui/material'; import FileCopyIcon from '@mui/icons-material/FileCopy'; +import { Box, Divider, Grid } from '@mui/material'; import { IconButton, - useSafeIntl, useRedirectTo, + useSafeIntl, } from 'bluesquare-components'; +import React, { + FunctionComponent, + useCallback, + useEffect, + useMemo, + useState, +} from 'react'; import ConfirmCancelDialogComponent from '../../../../components/dialogs/ConfirmCancelDialogComponent'; +import InputComponent from '../../../../components/forms/InputComponent'; +import { baseUrls } from '../../../../constants/urls'; import MESSAGES from '../../messages'; import { useCopyDataSourceVersion, useDataSourceAsDropDown, useDataSourceVersions, } from '../../requests'; -import { baseUrls } from '../../../../constants/urls'; -import InputComponent from '../../../../components/forms/InputComponent'; import { WarningMessage } from './CopyVersionWarnings'; type Props = { diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopyVersionWarnings.tsx b/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopyVersionWarnings.tsx index 68661bfe9a..b10c5cb10b 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopyVersionWarnings.tsx +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopyVersionWarnings.tsx @@ -1,7 +1,6 @@ -/* eslint-disable react/jsx-props-no-spreading */ -import React, { FunctionComponent } from 'react'; import { Grid, Typography } from '@mui/material'; import { makeStyles } from '@mui/styles'; +import React, { FunctionComponent } from 'react'; import { FormattedMessage } from 'react-intl'; import MESSAGES from '../../messages'; import { useDataSourceAsDropDown } from '../../requests'; diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/VersionsDialog.js b/hat/assets/js/apps/Iaso/domains/dataSources/components/VersionsDialog.js index 21ebb6a6b9..30099121c2 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/VersionsDialog.js +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/VersionsDialog.js @@ -1,31 +1,30 @@ -/* eslint-disable react/jsx-props-no-spreading */ -import React, { useState, useMemo, useCallback } from 'react'; -import PropTypes from 'prop-types'; +import AddBox from '@mui/icons-material/AddBoxOutlined'; +import Public from '@mui/icons-material/Public'; import { Button, DialogActions, Grid, Typography } from '@mui/material'; import { makeStyles } from '@mui/styles'; -import Public from '@mui/icons-material/Public'; -import AddBox from '@mui/icons-material/AddBoxOutlined'; -import { FormattedMessage } from 'react-intl'; import { commonStyles, DHIS2Svg, Table, useSafeIntl, } from 'bluesquare-components'; +import PropTypes from 'prop-types'; +import React, { useCallback, useMemo, useState } from 'react'; +import { FormattedMessage } from 'react-intl'; import DialogComponent from '../../../components/dialogs/DialogComponent'; import MESSAGES from '../messages'; +import { AddNewEmptyVersion } from './AddNewEmptyVersion.tsx'; import { AddTask } from './AddTaskComponent'; import { ImportGeoPkgDialog } from './ImportGeoPkgDialog'; -import { AddNewEmptyVersion } from './AddNewEmptyVersion.tsx'; +import { useVersionsDialogTableColumns } from '../hooks/useVersionsDialogTableColumns.tsx'; import { getSortedSourceVersions, + getTablePages, + getTableParams, handleSort, handleTableParamsChange, - getTableParams, - getTablePages, } from '../utils'; -import { useVersionsDialogTableColumns } from '../hooks/useVersionsDialogTableColumns.tsx'; const useStyles = makeStyles(theme => ({ spanStyle: { diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/ActionTableColumnComponent.js b/hat/assets/js/apps/Iaso/domains/instances/components/ActionTableColumnComponent.js index 97f9c11367..3f3f32c5e6 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/ActionTableColumnComponent.js +++ b/hat/assets/js/apps/Iaso/domains/instances/components/ActionTableColumnComponent.js @@ -1,5 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ -/* eslint-disable react/prop-types */ import LinkIcon from '@mui/icons-material/Link'; import LinkOffIcon from '@mui/icons-material/LinkOff'; import LockIcon from '@mui/icons-material/Lock'; diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/InstancePopUp/InstancePopUp.tsx b/hat/assets/js/apps/Iaso/domains/instances/components/InstancePopUp/InstancePopUp.tsx index 7c63299f32..32a017be9a 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/InstancePopUp/InstancePopUp.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/components/InstancePopUp/InstancePopUp.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import React, { FunctionComponent, useCallback, useMemo, useRef } from 'react'; import { Popup, useMap } from 'react-leaflet'; import { useSelector } from 'react-redux'; diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/SpeedDialInstance.tsx b/hat/assets/js/apps/Iaso/domains/instances/components/SpeedDialInstance.tsx index eb6408fed2..1edd41cc15 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/SpeedDialInstance.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/components/SpeedDialInstance.tsx @@ -1,15 +1,18 @@ -/* eslint-disable react/jsx-props-no-spreading */ import React, { FunctionComponent } from 'react'; import { LoadingSpinner } from 'bluesquare-components'; -import SpeedDialInstanceActions from './SpeedDialInstanceActions'; -import { userHasPermission } from '../../users/utils'; import { hasFeatureFlag, SHOW_LINK_INSTANCE_REFERENCE, } from '../../../utils/featureFlags'; +import * as Permission from '../../../utils/permissions'; import { useCurrentUser } from '../../../utils/usersUtils'; -import { Instance } from '../types/instance'; +import { useGetEnketoUrl } from '../../registry/hooks/useGetEnketoUrl'; +import { userHasPermission } from '../../users/utils'; +import { + useDeleteInstance, + useRestoreInstance, +} from '../hooks/requests/useDeleteInstance'; import { useBaseActions, useDeleteAction, @@ -19,12 +22,8 @@ import { useLockAction, } from '../hooks/speedDialActions'; import { useGetFormDefForInstance } from '../hooks/speeddials'; -import { - useDeleteInstance, - useRestoreInstance, -} from '../hooks/requests/useDeleteInstance'; -import { useGetEnketoUrl } from '../../registry/hooks/useGetEnketoUrl'; -import * as Permission from '../../../utils/permissions'; +import { Instance } from '../types/instance'; +import SpeedDialInstanceActions from './SpeedDialInstanceActions'; type Props = { currentInstance: Instance; diff --git a/hat/assets/js/apps/Iaso/domains/instances/details.tsx b/hat/assets/js/apps/Iaso/domains/instances/details.tsx index ddbc2e9c35..ff8b65ff52 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/details.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/details.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import Alert from '@mui/lab/Alert'; import { Box, Grid, Typography } from '@mui/material'; import { makeStyles } from '@mui/styles'; diff --git a/hat/assets/js/apps/Iaso/domains/pages/components/UsersSelect.tsx b/hat/assets/js/apps/Iaso/domains/pages/components/UsersSelect.tsx index bebca28bc5..e1bb85201a 100644 --- a/hat/assets/js/apps/Iaso/domains/pages/components/UsersSelect.tsx +++ b/hat/assets/js/apps/Iaso/domains/pages/components/UsersSelect.tsx @@ -1,8 +1,7 @@ -/* eslint-disable react/jsx-props-no-spreading */ -import React, { FunctionComponent, useCallback, useMemo } from 'react'; -import { FormikProps, FieldInputProps } from 'formik'; -import { Select } from 'bluesquare-components'; import { Chip } from '@mui/material'; +import { Select } from 'bluesquare-components'; +import { FieldInputProps, FormikProps } from 'formik'; +import React, { FunctionComponent, useCallback, useMemo } from 'react'; import getDisplayName, { useCurrentUser } from '../../../utils/usersUtils'; import { useGetProfiles } from '../../users/hooks/useGetProfiles'; diff --git a/hat/assets/js/apps/Iaso/domains/projects/components/ProjectFeatureFlags.tsx b/hat/assets/js/apps/Iaso/domains/projects/components/ProjectFeatureFlags.tsx index b2c7dd6f79..bbd0742e0a 100644 --- a/hat/assets/js/apps/Iaso/domains/projects/components/ProjectFeatureFlags.tsx +++ b/hat/assets/js/apps/Iaso/domains/projects/components/ProjectFeatureFlags.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import React, { FunctionComponent, useState } from 'react'; import { FeatureFlag } from '../types/featureFlag'; diff --git a/hat/assets/js/apps/Iaso/routing/legacy.tsx b/hat/assets/js/apps/Iaso/routing/legacy.tsx index 80ca3fa51e..9fab50da5b 100644 --- a/hat/assets/js/apps/Iaso/routing/legacy.tsx +++ b/hat/assets/js/apps/Iaso/routing/legacy.tsx @@ -1,8 +1,7 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -/* eslint-disable react/jsx-props-no-spreading */ import React from 'react'; -import { useParamsObject } from './hooks/useParamsObject'; import { baseUrls } from '../constants/urls'; +import { useParamsObject } from './hooks/useParamsObject'; // Temporary fix to enable use of react-router 6 with DHIS2 Mapping component. /** @deprecated */ diff --git a/package-lock.json b/package-lock.json index e14ebc9568..e2befc79c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -96,6 +96,7 @@ "eslint-config-airbnb": "^19.0.0", "eslint-config-prettier": "^6.11.0", "eslint-import-resolver-webpack": "^0.13.2", + "eslint-plugin-cypress": "^3.5.0", "eslint-plugin-formatjs": "^2.17.3", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.2.3", @@ -9103,6 +9104,45 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-plugin-cypress": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-3.5.0.tgz", + "integrity": "sha512-JZQ6XnBTNI8h1B9M7wJSFzc48SYbh7VMMKaNTQOFa3BQlnmXPrVc4PKen8R+fpv6VleiPeej6VxloGb42zdRvw==", + "dev": true, + "dependencies": { + "globals": "^13.20.0" + }, + "peerDependencies": { + "eslint": ">=7" + } + }, + "node_modules/eslint-plugin-cypress/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-cypress/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-formatjs": { "version": "2.21.0", "resolved": "https://registry.npmjs.org/eslint-plugin-formatjs/-/eslint-plugin-formatjs-2.21.0.tgz", diff --git a/package.json b/package.json index 3bc7a15ea4..85f7e1b202 100644 --- a/package.json +++ b/package.json @@ -135,6 +135,7 @@ "eslint-config-airbnb": "^19.0.0", "eslint-config-prettier": "^6.11.0", "eslint-import-resolver-webpack": "^0.13.2", + "eslint-plugin-cypress": "^3.5.0", "eslint-plugin-formatjs": "^2.17.3", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.2.3", diff --git a/plugins/polio/js/src/constants/menu.tsx b/plugins/polio/js/src/constants/menu.tsx index 8d1da29b53..be0e5bbdce 100644 --- a/plugins/polio/js/src/constants/menu.tsx +++ b/plugins/polio/js/src/constants/menu.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet'; import AssessmentIcon from '@mui/icons-material/Assessment'; import CalendarToday from '@mui/icons-material/CalendarToday'; diff --git a/plugins/polio/js/src/domains/Calendar/campaignCalendar/CampaignsFilters.tsx b/plugins/polio/js/src/domains/Calendar/campaignCalendar/CampaignsFilters.tsx index ac67919826..85fe9fd766 100644 --- a/plugins/polio/js/src/domains/Calendar/campaignCalendar/CampaignsFilters.tsx +++ b/plugins/polio/js/src/domains/Calendar/campaignCalendar/CampaignsFilters.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import FiltersIcon from '@mui/icons-material/FilterList'; import { Box, Button, Grid, useMediaQuery, useTheme } from '@mui/material'; import { useRedirectToReplace } from 'bluesquare-components'; diff --git a/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/CalendarMapTooltip.tsx b/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/CalendarMapTooltip.tsx index 689ebad0ea..6d0b4850d7 100644 --- a/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/CalendarMapTooltip.tsx +++ b/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/CalendarMapTooltip.tsx @@ -1,8 +1,7 @@ /* eslint-disable react/require-default-props */ -/* eslint-disable react/jsx-props-no-spreading */ +import { useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent } from 'react'; import { Tooltip } from 'react-leaflet'; -import { useSafeIntl } from 'bluesquare-components'; import MESSAGES from '../../../../constants/messages'; type Props = { diff --git a/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/MapRoundSelector.tsx b/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/MapRoundSelector.tsx index eadd3a6882..1162d22ed7 100644 --- a/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/MapRoundSelector.tsx +++ b/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/MapRoundSelector.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import { Box } from '@mui/material'; import { ConfirmCancelModal, makeFullModal } from 'bluesquare-components'; import React, { FunctionComponent, useState } from 'react'; diff --git a/plugins/polio/js/src/domains/Campaigns/MainDialog/CreateEditDialog.tsx b/plugins/polio/js/src/domains/Campaigns/MainDialog/CreateEditDialog.tsx index 36dfa0c93c..e8ce938adc 100644 --- a/plugins/polio/js/src/domains/Campaigns/MainDialog/CreateEditDialog.tsx +++ b/plugins/polio/js/src/domains/Campaigns/MainDialog/CreateEditDialog.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import isEqual from 'lodash/isEqual'; import React, { FunctionComponent, useCallback, useState } from 'react'; diff --git a/plugins/polio/js/src/domains/Campaigns/MapComponent/AccordionMapLegend.tsx b/plugins/polio/js/src/domains/Campaigns/MapComponent/AccordionMapLegend.tsx index 9ad3f5de39..ef3fc0eab8 100644 --- a/plugins/polio/js/src/domains/Campaigns/MapComponent/AccordionMapLegend.tsx +++ b/plugins/polio/js/src/domains/Campaigns/MapComponent/AccordionMapLegend.tsx @@ -1,17 +1,16 @@ /* eslint-disable react/require-default-props */ -/* eslint-disable react/jsx-props-no-spreading */ -import React, { FunctionComponent } from 'react'; -import { FormattedMessage } from 'react-intl'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { - Grid, - Typography, Accordion, - AccordionSummary, AccordionDetails, + AccordionSummary, Box, + Grid, + Typography, } from '@mui/material'; -import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { IntlMessage } from 'bluesquare-components'; +import React, { FunctionComponent } from 'react'; +import { FormattedMessage } from 'react-intl'; import { useStyles } from '../../Calendar/campaignCalendar/Styles'; import MESSAGES from '../../../constants/messages'; diff --git a/plugins/polio/js/src/domains/Campaigns/campaignHistory/config.tsx b/plugins/polio/js/src/domains/Campaigns/campaignHistory/config.tsx index 2151080f87..0d3508c860 100644 --- a/plugins/polio/js/src/domains/Campaigns/campaignHistory/config.tsx +++ b/plugins/polio/js/src/domains/Campaigns/campaignHistory/config.tsx @@ -1,14 +1,13 @@ -/* eslint-disable react/jsx-props-no-spreading */ -import React, { ReactElement } from 'react'; -import moment from 'moment'; -import { upperCase } from 'lodash'; -import { Link } from 'react-router-dom'; import { Box } from '@mui/material'; import { IntlFormatMessage, useSafeIntl } from 'bluesquare-components'; +import { upperCase } from 'lodash'; +import moment from 'moment'; +import React, { ReactElement } from 'react'; +import { Link } from 'react-router-dom'; import { GeoJsonMap } from '../../../../../../../hat/assets/js/apps/Iaso/components/maps/GeoJsonMapComponent'; -import MESSAGES from '../../../constants/messages'; -import { useGetOrgUnitDetail } from '../../../../../../../hat/assets/js/apps/Iaso/domains/orgUnits/hooks/requests/useGetOrgUnitDetail'; import { LinkToOrgUnit } from '../../../../../../../hat/assets/js/apps/Iaso/domains/orgUnits/components/LinkToOrgUnit'; +import { useGetOrgUnitDetail } from '../../../../../../../hat/assets/js/apps/Iaso/domains/orgUnits/hooks/requests/useGetOrgUnitDetail'; +import MESSAGES from '../../../constants/messages'; type OrgUnitLinkProps = { orgUnitId: number; diff --git a/plugins/polio/js/src/domains/GroupedCampaigns/GroupedCampaignsFilter.tsx b/plugins/polio/js/src/domains/GroupedCampaigns/GroupedCampaignsFilter.tsx index accae990e2..5d769a3f85 100644 --- a/plugins/polio/js/src/domains/GroupedCampaigns/GroupedCampaignsFilter.tsx +++ b/plugins/polio/js/src/domains/GroupedCampaigns/GroupedCampaignsFilter.tsx @@ -1,13 +1,12 @@ -/* eslint-disable react/jsx-props-no-spreading */ -import React, { FunctionComponent, useState } from 'react'; import FiltersIcon from '@mui/icons-material/FilterList'; import { Box, Button, Grid } from '@mui/material'; +import React, { FunctionComponent, useState } from 'react'; import { FormattedMessage } from 'react-intl'; -import MESSAGES from '../../constants/messages'; import InputComponent from '../../../../../../hat/assets/js/apps/Iaso/components/forms/InputComponent'; -import { PaginationParams } from '../../../../../../hat/assets/js/apps/Iaso/types/general'; import { useFilterState } from '../../../../../../hat/assets/js/apps/Iaso/hooks/useFilterState'; +import { PaginationParams } from '../../../../../../hat/assets/js/apps/Iaso/types/general'; +import MESSAGES from '../../constants/messages'; import { baseUrls } from '../../constants/urls'; type Params = PaginationParams & { From 079a7805c4d57dee67a837133ad328c6549c7aa7 Mon Sep 17 00:00:00 2001 From: Christophe Gerard Date: Thu, 3 Oct 2024 14:22:45 +0200 Subject: [PATCH 4/9] 237 errors left --- .eslintrc.json | 35 +++++++++++++++++-- .../apps/Iaso/domains/completeness/config.js | 17 ++++----- hat/assets/js/cypress/support/commands.js | 27 ++++++++------ .../js/cypress/support/testPageFilters.js | 3 +- .../js/cypress/support/testPagination.js | 10 +++--- .../js/cypress/support/testPermission.js | 4 +-- .../js/cypress/support/testTableRender.js | 32 ++++++++++------- package.json | 2 +- 8 files changed, 88 insertions(+), 42 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 82fbcf0fa2..3fe5783d21 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,9 +2,9 @@ "env": { "browser": true, "commonjs": true, + "cypress/globals": true, "es6": true, - "node": true, - "cypress/globals": true + "node": true }, "extends": [ "airbnb", @@ -75,6 +75,16 @@ "@typescript-eslint" ], "rules": { + "import/extensions": [ + "error", + "ignorePackages", + { + "js": "off", + "jsx": "off", + "ts": "off", + "tsx": "off" + } + ], "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/no-unused-vars": [ @@ -87,13 +97,13 @@ "camelcase": "off", "class-methods-use-this": "warn", "constructor-super": "warn", - "import/extensions": "off", "import/no-extraneous-dependencies": "off", "import/no-named-as-default": "warn", "import/no-unresolved": "warn", "import/prefer-default-export": "off", "jsx-a11y/anchor-is-valid": "off", "jsx-a11y/click-events-have-key-events": "off", + "jsx-a11y/control-has-associated-label": "off", "jsx-a11y/href-no-hash": "off", "jsx-a11y/jsx-wrap-multilines": "off", "jsx-a11y/label-has-associated-control": "off", @@ -199,6 +209,16 @@ "varsIgnorePattern": "^_" } ], + "import/extensions": [ + "error", + "ignorePackages", + { + "js": "off", + "jsx": "off", + "ts": "off", + "tsx": "off" + } + ], "camelcase": "off", "class-methods-use-this": "warn", "constructor-super": "warn", @@ -207,6 +227,7 @@ "import/prefer-default-export": "off", "jsx-a11y/anchor-is-valid": "off", "jsx-a11y/click-events-have-key-events": "off", + "jsx-a11y/control-has-associated-label": "off", "jsx-a11y/href-no-hash": "off", "jsx-a11y/jsx-wrap-multilines": "off", "jsx-a11y/label-has-associated-control": "off", @@ -291,6 +312,14 @@ }, "settings": { "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx" + ] + }, "webpack": { "config": "hat/webpack.dev.js" } diff --git a/hat/assets/js/apps/Iaso/domains/completeness/config.js b/hat/assets/js/apps/Iaso/domains/completeness/config.js index 2a53b24139..8984e35d51 100644 --- a/hat/assets/js/apps/Iaso/domains/completeness/config.js +++ b/hat/assets/js/apps/Iaso/domains/completeness/config.js @@ -1,16 +1,18 @@ -import React from 'react'; -import HourglassEmpty from '@mui/icons-material/HourglassEmpty'; -import ErrorOutline from '@mui/icons-material/ErrorOutline'; import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; +import ErrorOutline from '@mui/icons-material/ErrorOutline'; +import HourglassEmpty from '@mui/icons-material/HourglassEmpty'; +import React from 'react'; import { - IconButton, formatThousand, + HeaderRowIcon, + IconButton, + LinkWithLocation, textPlaceholder, - HeaderRowIcon,LinkWithLocation } from 'bluesquare-components'; -import { baseUrls } from '../../constants/urls'; +import { baseUrls } from '../../constants/urls.ts'; +import { INSTANCE_STATUSES } from '../instances/constants'; import { PERIOD_TYPE_MONTH, PERIOD_TYPE_QUARTER, @@ -18,7 +20,6 @@ import { PERIOD_TYPE_YEAR, PERIOD_TYPES, } from '../periods/constants'; -import { INSTANCE_STATUSES } from '../instances/constants'; import MESSAGES from './messages'; @@ -131,7 +132,7 @@ export const getColumns = ( (sum, count) => count + sum, 0, ); - return <>{total && formatThousand(total)}; + return total && formatThousand(total); }, width: STATUS_COLUMN_SIZES[activePeriodType], })), diff --git a/hat/assets/js/cypress/support/commands.js b/hat/assets/js/cypress/support/commands.js index 65f93b62df..d5fe80039d 100644 --- a/hat/assets/js/cypress/support/commands.js +++ b/hat/assets/js/cypress/support/commands.js @@ -122,11 +122,11 @@ Cypress.Commands.add('testInputValue', (id, value) => * @param {string} accessor - key of the option to test, by default 'name' */ Cypress.Commands.add('testMultiSelect', (id, options, accessor = 'name') => { - const select = cy.get(id).parent(); - const chips = select.find('div[role=button]'); - chips.should('have.length', options.length); + cy.get(id).parent().as('select'); + cy.get('@select').find('div[role=button]').as('chips'); + cy.get('@chips').should('have.length', options.length); options.forEach(o => { - select.should('contain', o[accessor]); + cy.get('@select').should('contain', o[accessor]); }); }); @@ -189,7 +189,7 @@ Cypress.Commands.add('deleteLastFieldInArrayInputField', selector => { if (selector.includes('@')) { arrayInput = cy.get(selector); } else { - arrayInput = cy.get(`#array-input-field-list-${id}`); + arrayInput = cy.get(`#array-input-field-list-${selector}`); } arrayInput.find('li').last().prev().find('button').click(); // reassigning addButton @@ -205,7 +205,10 @@ Cypress.Commands.add('deleteLastFieldInArrayInputField', selector => { * @param {string} value - new value to fill, by default empty string */ Cypress.Commands.add('fillTextField', (id, value = '') => { - cy.get(id).clear().type(value); + cy.get(id).clear(); + cy.get(id).then(() => { + cy.wrap(id).type(value); + }); }); /** @@ -219,13 +222,17 @@ Cypress.Commands.add('selectTab', (tabIndex, parentSelector = 'body') => { // index based, so 1st row = 0 Cypress.Commands.add('findTableCell', (row, column) => { - const selectedRow = cy.get('table').find('tbody').find('tr').eq(row); - return selectedRow.find('td').eq(column); + return cy + .get('table') + .find('tbody') + .find('tr') + .eq(row) + .find('td') + .eq(column); }); Cypress.Commands.add('findTableHead', column => { - const selectedRow = cy.get('table').find('thead').find('tr').eq(0); - return selectedRow.find('th').eq(column); + return cy.get('table').find('thead').find('tr').eq(0).find('th').eq(column); }); Cypress.Commands.add('assertTooltipDiplay', identifier => { diff --git a/hat/assets/js/cypress/support/testPageFilters.js b/hat/assets/js/cypress/support/testPageFilters.js index a9128a32f0..b906a641a2 100644 --- a/hat/assets/js/cypress/support/testPageFilters.js +++ b/hat/assets/js/cypress/support/testPageFilters.js @@ -15,7 +15,8 @@ export const testPageFilters = ( const { value, type, selector, clear } = filters[keyName]; switch (type) { case 'text': { - cy.get(selector).type('{selectall}').type(value); + cy.get(selector).type('{selectall}'); + cy.get(selector).type(value); break; } case 'multi': { diff --git a/hat/assets/js/cypress/support/testPagination.js b/hat/assets/js/cypress/support/testPagination.js index 937e8eacb7..6e18ca58d1 100644 --- a/hat/assets/js/cypress/support/testPagination.js +++ b/hat/assets/js/cypress/support/testPagination.js @@ -99,6 +99,7 @@ export const testPagination = ({ .find('button.pagination-last') .click({ force: true }); cy.wait('@getData').then(() => { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(100); cy.get('@selector') .find('button.pagination-first') @@ -130,6 +131,7 @@ export const testPagination = ({ res, ).as('getData'); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); cy.get(`${selector} .pagination-row-select`) // .as('rowSelector') @@ -138,10 +140,10 @@ export const testPagination = ({ cy.get(`.row-option-${pageSize}`).click(); cy.wait('@getData').then(() => { - const table = cy.get('@selector').find('table'); - table.should('have.length', 1); - const rows = table.find('tbody').find('tr'); - rows.should('have.length', pageSize); + cy.get('@selector').find('table').as('table'); + cy.get('@table').should('have.length', 1); + cy.get('@table').find('tbody').find('tr').as('tableRows'); + cy.get('@tableRows').should('have.length', pageSize); }); }, ); diff --git a/hat/assets/js/cypress/support/testPermission.js b/hat/assets/js/cypress/support/testPermission.js index b7ac3dfd4f..f8997ecb21 100644 --- a/hat/assets/js/cypress/support/testPermission.js +++ b/hat/assets/js/cypress/support/testPermission.js @@ -10,6 +10,6 @@ export const testPermission = baseUrl => }; cy.intercept('GET', '/api/profiles/me/**', fakeUser); cy.visit(baseUrl); - const errorCode = cy.get('#error-code'); - errorCode.should('contain', '403'); + cy.get('#error-code').as('errorCode'); + cy.get('@errorCode').should('contain', '403'); }); diff --git a/hat/assets/js/cypress/support/testTableRender.js b/hat/assets/js/cypress/support/testTableRender.js index 13aa3d07d8..6ae34af0cb 100644 --- a/hat/assets/js/cypress/support/testTableRender.js +++ b/hat/assets/js/cypress/support/testTableRender.js @@ -22,20 +22,26 @@ export const testTablerender = ({ if (request) { cy.wait(request).then(() => { - const table = cy.get(selector); - table.should('have.length', 1); - const tableRows = table.find('tbody').find('tr'); - tableRows.should('have.length', rows); + cy.get(selector).as('table'); + cy.get('@table').should('have.length', 1); + cy.get('@table').find('tbody').find('tr').as('tableRows'); + cy.get('@tableRows').should('have.length', rows); // number of col - tableRows.eq(0).find('td').should('have.length', columns); + cy.get('@tableRows') + .eq(0) + .find('td') + .should('have.length', columns); }); } else { - const table = cy.get(selector); - table.should('have.length', 1); - const tableRows = table.find('tbody').find('tr'); - tableRows.should('have.length', rows); + cy.get(selector).as('table'); + cy.get('@table').should('have.length', 1); + cy.get('@table').find('tbody').find('tr').as('tableRows'); + cy.get('@tableRows').should('have.length', rows); // number of col - tableRows.eq(0).find('td').should('have.length', columns); + cy.get('@tableRows') + .eq(0) + .find('td') + .should('have.length', columns); } }); it("Displays an empty table when there's no data", () => { @@ -52,8 +58,8 @@ export const testTablerender = ({ cy.visit(baseUrl); cy.wait('@fetch', { timeout: 10000 }); - const table = cy.get(selector); - table.should('have.length', 1); - table.find('tbody').find('tr').should('not.exist'); + cy.get(selector).as('table'); + cy.get('@table').should('have.length', 1); + cy.get('@table').find('tbody').find('tr').should('not.exist'); }); }); diff --git a/package.json b/package.json index 85f7e1b202..d869a84fe5 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "fix-lint": "prettier-eslint \"./hat/assets/js/**/*.{js,ts,tsx}\" --lint-different --write", "show-lint-problems": "eslint \"./hat/assets/js/**/*.{js,ts,tsx}\"", - "export-lint-problems": "eslint \"./hat/assets/js/**/*.{js,ts,tsx}\" -f html -o ./hat/assets/js/lintErrors.html", + "export-lint-problems": "eslint \"./hat/assets/js/**/*.{js,ts,tsx}\" -f html -o ./hat/assets/js/lintErrors.html --quiet", "test-coverage": "nyc npm run test", "test": "NODE_PATH=hat/assets/js/apps mocha --exit --require ./babel-register.js --require ./hat/assets/js/test/helpers.js --require ./hat/assets/js/test/dom.js './hat/assets/js/apps/**/*.spec.js'", "test-watch": "NODE_PATH=hat/assets/js/apps mocha --require ./babel-register.js --require ./hat/assets/js/test/helpers.js --require ./hat/assets/js/test/dom.js './hat/assets/js/apps/**/*.spec.js' --watch", From 466cea81f1f21f9d17ae8ec2dd9e0387c3e88962 Mon Sep 17 00:00:00 2001 From: Christophe Gerard Date: Thu, 3 Oct 2024 14:34:57 +0200 Subject: [PATCH 5/9] eslint fix --- .../LegendBuilder/LegendBuilderDialog.tsx | 3 +- .../dialogs/ConfirmCancelDialogComponent.js | 32 +-- .../Iaso/components/tables/TableFilters.js | 92 ++++---- hat/assets/js/apps/Iaso/constants/messages.js | 2 +- hat/assets/js/apps/Iaso/constants/routes.tsx | 1 - .../CompletenessFiltersComponent.js | 42 ++-- .../components/CompletenessPeriodComponent.js | 2 +- .../components/ItselfCell.tsx | 20 +- .../components/LinearProgressWithLabel.tsx | 21 +- .../CopySourceVersion/CopySourceVersion.tsx | 6 +- .../components/DataSourceDialogComponent.js | 5 +- .../domains/entities/components/ListMap.tsx | 44 ++-- .../list/useDuplicationTableColumns.tsx | 36 ++- .../entityTypes/components/Filters.tsx | 68 +++--- .../domains/forms/components/FormActions.tsx | 8 +- .../fields/hooks/useGetQueryBuildersFields.ts | 2 +- .../apps/Iaso/domains/instances/requests.js | 4 +- .../components/LinksCompareComponent.tsx | 44 ++-- .../CreateMappingVersionDialogComponent.js | 2 +- .../domains/mappings/components/Filter.tsx | 4 +- .../mappings/components/GeneraMappingInfo.js | 4 +- .../mappings/components/MappingTypeOptions.ts | 2 - .../components/QuestionMappingForm.js | 5 +- .../mappings/components/RecursiveTreeView.js | 4 +- .../apps/Iaso/domains/mappings/descriptor.js | 22 +- .../js/apps/Iaso/domains/mappings/details.js | 16 +- .../js/apps/Iaso/domains/mappings/hooks.js | 9 +- .../requests/useGetFormsDropdownOptions.ts | 12 +- .../js/apps/Iaso/domains/mappings/index.js | 2 +- .../components/OrgUnitLocationIcon.tsx | 22 +- .../components/orgUnitMap/MarkerInputs.js | 206 +++++++++--------- .../OrgUnitChangeRequestConfigDialog.tsx | 3 +- .../domains/orgUnits/groupSets/config.tsx | 6 +- .../domains/orgUnits/groupSets/messages.js | 10 +- .../orgUnits/groups/components/Filters.js | 74 ++++--- .../Iaso/domains/orgUnits/groups/index.js | 3 +- .../BulkEditPaymentsDialog.tsx | 39 ++-- .../CreatePaymentLot/PaymentLotsFilters.tsx | 110 +++++----- .../domains/plannings/PlanningFilters.tsx | 84 ++++--- .../components/CreateEditProjectDialog.tsx | 3 +- .../domains/storages/components/Filters.tsx | 98 ++++----- .../NotificationImportDetailButton.tsx | 29 +-- .../domains/teams/components/TeamFilters.tsx | 14 +- .../components/ExportMobileAppSetupDialog.tsx | 4 +- .../users/components/UsersLocations.js | 16 +- .../users/hooks/useCreateExportMobileSetup.ts | 2 +- .../domains/workflows/components/Filters.tsx | 72 +++--- .../requests/useDeleteWorkflowChange.tsx | 3 +- .../hooks/requests/useSaveWorkflowChange.tsx | 2 +- 49 files changed, 642 insertions(+), 672 deletions(-) diff --git a/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx b/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx index faa05a7dd9..881978be31 100644 --- a/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx +++ b/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx @@ -126,6 +126,5 @@ const modalWithIcon = makeFullModal(LegendBuilderDialog, EditIconButton); export { modalWithButton as AddLegendDialog, - modalWithIcon as EditLegendDialog + modalWithIcon as EditLegendDialog, }; - diff --git a/hat/assets/js/apps/Iaso/components/dialogs/ConfirmCancelDialogComponent.js b/hat/assets/js/apps/Iaso/components/dialogs/ConfirmCancelDialogComponent.js index 00c8b463cf..9404a03c59 100644 --- a/hat/assets/js/apps/Iaso/components/dialogs/ConfirmCancelDialogComponent.js +++ b/hat/assets/js/apps/Iaso/components/dialogs/ConfirmCancelDialogComponent.js @@ -45,21 +45,23 @@ function RawConfirmCancelActions({ > - {additionalButton && additionalMessage && onAdditionalButtonClick && ( - - )} + {additionalButton && + additionalMessage && + onAdditionalButtonClick && ( + + )} ); } diff --git a/hat/assets/js/apps/Iaso/components/tables/TableFilters.js b/hat/assets/js/apps/Iaso/components/tables/TableFilters.js index 9004ef557f..c612b02cd3 100644 --- a/hat/assets/js/apps/Iaso/components/tables/TableFilters.js +++ b/hat/assets/js/apps/Iaso/components/tables/TableFilters.js @@ -65,56 +65,52 @@ const Filters = ({ }; return ( - <> - - {Array(filtersColumnsCount) - .fill() - .map((x, i) => i + 1) - .map(column => ( - - setFiltersUpdated(true)} - filters={filters.filter( - f => f.column === column, - )} - onEnterPressed={() => handleSearch()} - /> - - ))} + + {Array(filtersColumnsCount) + .fill() + .map((x, i) => i + 1) + .map(column => ( + + setFiltersUpdated(true)} + filters={filters.filter(f => f.column === column)} + onEnterPressed={() => handleSearch()} + /> + + ))} - - - {extraComponent} - - - + + + {extraComponent} + + - + ); }; diff --git a/hat/assets/js/apps/Iaso/constants/messages.js b/hat/assets/js/apps/Iaso/constants/messages.js index 75c8bc258f..c918a97616 100644 --- a/hat/assets/js/apps/Iaso/constants/messages.js +++ b/hat/assets/js/apps/Iaso/constants/messages.js @@ -73,7 +73,7 @@ const MESSAGES = defineMessages({ defaultMessage: 'Groups', id: 'iaso.label.groups', }, - groupSets: { + groupSets: { defaultMessage: 'Group Sets', id: 'iaso.label.groupSets', }, diff --git a/hat/assets/js/apps/Iaso/constants/routes.tsx b/hat/assets/js/apps/Iaso/constants/routes.tsx index 72646b63d1..dc54f258f9 100644 --- a/hat/assets/js/apps/Iaso/constants/routes.tsx +++ b/hat/assets/js/apps/Iaso/constants/routes.tsx @@ -307,7 +307,6 @@ export const groupSetDetailPath = { element: , }; - export const orgUnitTypesPath = { baseUrl: baseUrls.orgUnitTypes, routerUrl: `${baseUrls.orgUnitTypes}/*`, diff --git a/hat/assets/js/apps/Iaso/domains/completeness/components/CompletenessFiltersComponent.js b/hat/assets/js/apps/Iaso/domains/completeness/components/CompletenessFiltersComponent.js index d114e81245..368859cb33 100644 --- a/hat/assets/js/apps/Iaso/domains/completeness/components/CompletenessFiltersComponent.js +++ b/hat/assets/js/apps/Iaso/domains/completeness/components/CompletenessFiltersComponent.js @@ -14,29 +14,27 @@ function CompletenessFiltersComponent({ setActiveInstanceStatuses, }) { return ( - <> - - - setActivePeriodType(value)} - label={MESSAGES.periodType} - options={periodTypeOptions} - value={activePeriodType} - keyValue="periodType" - /> - - - - - + + + setActivePeriodType(value)} + label={MESSAGES.periodType} + options={periodTypeOptions} + value={activePeriodType} + keyValue="periodType" + /> - + + + + + ); } CompletenessFiltersComponent.propTypes = { diff --git a/hat/assets/js/apps/Iaso/domains/completeness/components/CompletenessPeriodComponent.js b/hat/assets/js/apps/Iaso/domains/completeness/components/CompletenessPeriodComponent.js index f7850116c7..dd34e1570a 100644 --- a/hat/assets/js/apps/Iaso/domains/completeness/components/CompletenessPeriodComponent.js +++ b/hat/assets/js/apps/Iaso/domains/completeness/components/CompletenessPeriodComponent.js @@ -8,7 +8,7 @@ import { LoadingSpinner, Table, useSafeIntl, - useRedirectTo + useRedirectTo, } from 'bluesquare-components'; import { postRequest } from 'Iaso/libs/Api.ts'; import { useSnackMutation } from 'Iaso/libs/apiHooks.ts'; diff --git a/hat/assets/js/apps/Iaso/domains/completenessStats/components/ItselfCell.tsx b/hat/assets/js/apps/Iaso/domains/completenessStats/components/ItselfCell.tsx index e77e3f9e12..dc3c36686e 100644 --- a/hat/assets/js/apps/Iaso/domains/completenessStats/components/ItselfCell.tsx +++ b/hat/assets/js/apps/Iaso/domains/completenessStats/components/ItselfCell.tsx @@ -1,20 +1,17 @@ import React, { ReactElement } from 'react'; +import { useSafeIntl } from 'bluesquare-components'; import { FormStatRow } from '../types'; import MESSAGES from '../messages'; -import { useSafeIntl } from 'bluesquare-components'; -export const ItselfCell = ({value}: FormStatRow): ReactElement => { +export const ItselfCell = ({ value }: FormStatRow): ReactElement => { const { formatMessage } = useSafeIntl(); return value.itself_target > 0 ? ( <> {value.itself_has_instances ? ( ✅ @@ -24,12 +21,9 @@ export const ItselfCell = ({value}: FormStatRow): ReactElement => { ) : (
N/A diff --git a/hat/assets/js/apps/Iaso/domains/completenessStats/components/LinearProgressWithLabel.tsx b/hat/assets/js/apps/Iaso/domains/completenessStats/components/LinearProgressWithLabel.tsx index f528b054d3..b6c7254f0c 100644 --- a/hat/assets/js/apps/Iaso/domains/completenessStats/components/LinearProgressWithLabel.tsx +++ b/hat/assets/js/apps/Iaso/domains/completenessStats/components/LinearProgressWithLabel.tsx @@ -5,35 +5,40 @@ type Props = { value: number; color?: string; extraLabel?: string; -} +}; const styles = { root: { - display: "flex", - alignItems: "center", - flexDirection: "column", + display: 'flex', + alignItems: 'center', + flexDirection: 'column', }, valueContainer: { minWidth: 35, }, progressBarContainer: { - width: "100%", + width: '100%', marginRight: 1, }, typography: (color?: string) => ({ - color: color || 'primary.main', + color: color || 'primary.main', }), progressBar: (color?: string) => ({ backgroundColor: 'white', height: '8px', - boxShadow: theme => `0px 0px 0px 1px ${theme.palette.ligthGray.border} inset`, + boxShadow: theme => + `0px 0px 0px 1px ${theme.palette.ligthGray.border} inset`, '& .MuiLinearProgress-bar': { backgroundColor: color || 'primary.main', }, }), }; -export const LinearProgressWithLabel: FunctionComponent = ({ value, color, extraLabel }) => ( +export const LinearProgressWithLabel: FunctionComponent = ({ + value, + color, + extraLabel, +}) => ( diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx b/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx index e2af9c7fa3..e3a4b3a74d 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx @@ -1,11 +1,7 @@ /* eslint-disable camelcase */ import FileCopyIcon from '@mui/icons-material/FileCopy'; import { Box, Divider, Grid } from '@mui/material'; -import { - IconButton, - useRedirectTo, - useSafeIntl, -} from 'bluesquare-components'; +import { IconButton, useRedirectTo, useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent, useCallback, diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/DataSourceDialogComponent.js b/hat/assets/js/apps/Iaso/domains/dataSources/components/DataSourceDialogComponent.js index ee5afa10f1..be8186f848 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/DataSourceDialogComponent.js +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/DataSourceDialogComponent.js @@ -112,9 +112,8 @@ export const DataSourceDialogComponent = ({ renderTrigger, sourceCredentials, }) => { - const [form, setFieldValue, setFieldErrors, setFormState] = useFormState( - initialForm(), - ); + const [form, setFieldValue, setFieldErrors, setFormState] = + useFormState(initialForm()); const { saveDataSource, isSaving } = useSaveDataSource(setFieldErrors); const checkDhis2 = useCheckDhis2Mutation(setFieldErrors); const [fieldHasBeenChanged, setFieldHasBeenChanged] = useState(false); diff --git a/hat/assets/js/apps/Iaso/domains/entities/components/ListMap.tsx b/hat/assets/js/apps/Iaso/domains/entities/components/ListMap.tsx index e9450a0c52..144d196cc9 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/components/ListMap.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/components/ListMap.tsx @@ -127,29 +127,27 @@ export const ListMap: FunctionComponent = ({ fitOnLoad /> {locations && ( - <> - - - ({ - ...circleColorMarkerOptions( - theme.palette.primary.main, - ), - radius: 12, - })} - popupProps={location => ({ - location, - extraColumns, - })} - PopupComponent={Popup} - isCircle - /> - - - + + + ({ + ...circleColorMarkerOptions( + theme.palette.primary.main, + ), + radius: 12, + })} + popupProps={location => ({ + location, + extraColumns, + })} + PopupComponent={Popup} + isCircle + /> + + )} diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/list/useDuplicationTableColumns.tsx b/hat/assets/js/apps/Iaso/domains/entities/duplicates/list/useDuplicationTableColumns.tsx index e5b1238e97..beb17a45db 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/list/useDuplicationTableColumns.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/list/useDuplicationTableColumns.tsx @@ -88,34 +88,28 @@ export const useDuplicationTableColumns = (): Column[] => { const { entity1, entity2, ignored, merged } = settings.row.original; let retVal = ( - <> - - + ); if (ignored) { retVal = ( - <> - - + ); } else if (merged) { retVal = ( - <> - - + ); } diff --git a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/Filters.tsx b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/Filters.tsx index 097cef89d0..417bff7edf 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/Filters.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/Filters.tsx @@ -60,44 +60,42 @@ const Filters: FunctionComponent = ({ params }) => { ); return ( - <> - - - - + + + + - + - + + {formatMessage(MESSAGES.search)} + - + ); }; diff --git a/hat/assets/js/apps/Iaso/domains/forms/components/FormActions.tsx b/hat/assets/js/apps/Iaso/domains/forms/components/FormActions.tsx index 5fc69cb26b..1148dcf728 100644 --- a/hat/assets/js/apps/Iaso/domains/forms/components/FormActions.tsx +++ b/hat/assets/js/apps/Iaso/domains/forms/components/FormActions.tsx @@ -123,8 +123,12 @@ export const FormActions: FunctionComponent = ({ url={`/${baseUrls.mappings}/formId/${settings.row.original.id}/order/form_version__form__name,form_version__version_id,mapping__mapping_type/pageSize/20/page/1`} icon="dhis" tooltipMessage={MESSAGES.dhis2Mappings} - color={settings.row.original.has_mappings ? "primary": undefined} - /> + color={ + settings.row.original.has_mappings + ? 'primary' + : undefined + } + /> - getRequest(`/api/forms/${formId}/?fields=name,period_type,label_keys,id,org_unit_type_ids`); + getRequest( + `/api/forms/${formId}/?fields=name,period_type,label_keys,id,org_unit_type_ids`, + ); export const fetchInstancesAsDict = url => getRequest(url); diff --git a/hat/assets/js/apps/Iaso/domains/links/components/LinksCompareComponent.tsx b/hat/assets/js/apps/Iaso/domains/links/components/LinksCompareComponent.tsx index de3160245b..9a16a473f3 100644 --- a/hat/assets/js/apps/Iaso/domains/links/components/LinksCompareComponent.tsx +++ b/hat/assets/js/apps/Iaso/domains/links/components/LinksCompareComponent.tsx @@ -63,29 +63,27 @@ export const LinksCompare: FunctionComponent = ({ )} {isEqual(link, compareLink) && formatMessage(MESSAGES.noDifference)} {!isEqual(link, compareLink) && ( - <> -
- - {Object.keys(link).map(key => { - const value = link[key]; - const isDifferent = !isEqual( - value, - compareLink[key], - ); - return ( - - ); - })} - -
- + + + {Object.keys(link).map(key => { + const value = link[key]; + const isDifferent = !isEqual( + value, + compareLink[key], + ); + return ( + + ); + })} + +
)} ); diff --git a/hat/assets/js/apps/Iaso/domains/mappings/components/CreateMappingVersionDialogComponent.js b/hat/assets/js/apps/Iaso/domains/mappings/components/CreateMappingVersionDialogComponent.js index 6f3495065e..9967e37203 100644 --- a/hat/assets/js/apps/Iaso/domains/mappings/components/CreateMappingVersionDialogComponent.js +++ b/hat/assets/js/apps/Iaso/domains/mappings/components/CreateMappingVersionDialogComponent.js @@ -11,7 +11,7 @@ import ConfirmCancelDialogComponent from '../../../components/dialogs/ConfirmCan import IasoSearchComponent from './IasoSearchComponent'; import Dhis2Search from './Dhis2SearchComponent'; import MESSAGES from '../messages'; -import { mappingTypeOptions } from './MappingTypeOptions' +import { mappingTypeOptions } from './MappingTypeOptions'; import { useDataSources, useCreateMappingMutation } from '../hooks.js'; const CreateMappingVersionDialogComponent = () => { diff --git a/hat/assets/js/apps/Iaso/domains/mappings/components/Filter.tsx b/hat/assets/js/apps/Iaso/domains/mappings/components/Filter.tsx index 7851be1352..d5643cd977 100644 --- a/hat/assets/js/apps/Iaso/domains/mappings/components/Filter.tsx +++ b/hat/assets/js/apps/Iaso/domains/mappings/components/Filter.tsx @@ -123,9 +123,7 @@ const Filters: FunctionComponent = ({ params }) => { + + )} + {hasMarker && ( + <> + { + onChangeLocation({ + latitude: newlatitude, + longitude, + altitude, + }); + handleSetError('latitude'); + }} + value={latitude} + type="number" + label={MESSAGES.latitude} + numberInputOptions={{ + min: -90, + max: 90, + decimalScale: 4, + }} + /> + { + onChangeLocation({ + latitude, + longitude: newLongitude, + altitude, + }); + handleSetError('longitude'); + }} + required + value={longitude} + type="number" + label={MESSAGES.longitude} + numberInputOptions={{ + min: -180, + max: 180, + decimalScale: 4, + }} + /> + + onChangeLocation({ + altitude: + newAltitude === undefined + ? null + : newAltitude, + longitude, + latitude, + }) + } + /> - - )} - {hasMarker && ( - <> - { - onChangeLocation({ - latitude: newlatitude, - longitude, - altitude, - }); - handleSetError('latitude'); - }} - value={latitude} - type="number" - label={MESSAGES.latitude} - numberInputOptions={{ - min: -90, - max: 90, - decimalScale: 4, - }} - /> - { - onChangeLocation({ - latitude, - longitude: newLongitude, - altitude, - }); - handleSetError('longitude'); - }} - required - value={longitude} - type="number" - label={MESSAGES.longitude} - numberInputOptions={{ - min: -180, - max: 180, - decimalScale: 4, - }} - /> - + className={classes.button} + onClick={() => onChangeLocation({ - altitude: - newAltitude === undefined - ? null - : newAltitude, - longitude, - latitude, + latitude: null, + longitude: null, + altitude: null, }) } - /> - - - - - )} -
- + > + + + + + + )} + ); }; MarkerInputs.propTypes = { diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Dialog/OrgUnitChangeRequestConfigDialog.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Dialog/OrgUnitChangeRequestConfigDialog.tsx index 05555477c9..262babdb5a 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Dialog/OrgUnitChangeRequestConfigDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Dialog/OrgUnitChangeRequestConfigDialog.tsx @@ -267,6 +267,5 @@ const modalWithButton = makeFullModal( export { OrgUnitChangeRequestConfigDialog as OrgUnitChangeRequestConfigDialogCreateSecondStep, - modalWithButton as OrgUnitChangeRequestConfigDialogUpdate + modalWithButton as OrgUnitChangeRequestConfigDialogUpdate, }; - diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/config.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/config.tsx index 75b6f788b6..6127d6f3a7 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/config.tsx @@ -1,9 +1,9 @@ import React, { useMemo } from 'react'; import { Column, IconButton, useSafeIntl } from 'bluesquare-components'; -import { DateTimeCell } from '../../../components/Cells/DateTimeCell'; -import MESSAGES from './messages'; import { Chip } from '@mui/material'; import { makeStyles } from '@mui/styles'; +import { DateTimeCell } from '../../../components/Cells/DateTimeCell'; +import MESSAGES from './messages'; import { baseUrls } from '../../../constants/urls'; import { DisplayIfUserHasPerm } from '../../../components/DisplayIfUserHasPerm'; @@ -51,7 +51,7 @@ export const useGroupSetsTableColumns = (deleteGroupSet): Column[] => { className={classes.groupChip} label={g.name} color="primary" - > + /> ))} ); diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/messages.js b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/messages.js index 44f004d5e0..1fcfa71550 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/messages.js +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/messages.js @@ -6,12 +6,12 @@ const MESSAGES = defineMessages({ defaultMessage: 'Actions', }, createButton: { - id: "iaso.label.create", - default: "Create", + id: 'iaso.label.create', + default: 'Create', }, saveButton: { - id: "iaso.label.save", - default: "Save", + id: 'iaso.label.save', + default: 'Save', }, created_at: { id: 'iaso.label.created_at', @@ -69,7 +69,7 @@ const MESSAGES = defineMessages({ id: 'iaso.snackBar.delete_successful', defaultMessage: 'Deleted successfully', }, - groupSets: { + groupSets: { defaultMessage: 'Group Sets', id: 'iaso.label.groupSets', }, diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/groups/components/Filters.js b/hat/assets/js/apps/Iaso/domains/orgUnits/groups/components/Filters.js index 41b29c0dbf..43475c39eb 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/groups/components/Filters.js +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/groups/components/Filters.js @@ -3,7 +3,11 @@ import PropTypes from 'prop-types'; import { Grid, Button } from '@mui/material'; import { makeStyles } from '@mui/styles'; import SearchIcon from '@mui/icons-material/Search'; -import { commonStyles, useSafeIntl, useRedirectTo } from 'bluesquare-components'; +import { + commonStyles, + useSafeIntl, + useRedirectTo, +} from 'bluesquare-components'; import InputComponent from '../../../../components/forms/InputComponent.tsx'; import { baseUrl } from '../config'; import MESSAGES from '../messages'; @@ -46,44 +50,42 @@ const Filters = ({ params }) => { [filters], ); return ( - <> - - - - + + + + - + - + + {formatMessage(MESSAGES.search)} + - + ); }; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/groups/index.js b/hat/assets/js/apps/Iaso/domains/orgUnits/groups/index.js index 720c9d357e..d37733b7df 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/groups/index.js +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/groups/index.js @@ -6,7 +6,8 @@ import { commonStyles, Table, AddButton, - useSafeIntl,useRedirectTo + useSafeIntl, + useRedirectTo, } from 'bluesquare-components'; import TopBar from '../../../components/nav/TopBarComponent'; import Filters from './components/Filters'; diff --git a/hat/assets/js/apps/Iaso/domains/payments/components/BulkEditPayment/BulkEditPaymentsDialog.tsx b/hat/assets/js/apps/Iaso/domains/payments/components/BulkEditPayment/BulkEditPaymentsDialog.tsx index 022df15954..598e77e983 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/components/BulkEditPayment/BulkEditPaymentsDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/payments/components/BulkEditPayment/BulkEditPaymentsDialog.tsx @@ -52,28 +52,23 @@ const BulkEditPaymentDialog: FunctionComponent = ({ count, }); return ( - <> - { - setStatus('pending'); - }} - id="EditPaymentDialog" - dataTestId="EditPaymentDialog" - titleMessage={titleMessage} - closeDialog={closeDialog} - onConfirm={handleConfirm} - onCancel={() => null} - confirmMessage={MESSAGES.save} - cancelMessage={MESSAGES.cancel} - closeOnConfirm={false} - > - setStatus(value)} - /> - - + { + setStatus('pending'); + }} + id="EditPaymentDialog" + dataTestId="EditPaymentDialog" + titleMessage={titleMessage} + closeDialog={closeDialog} + onConfirm={handleConfirm} + onCancel={() => null} + confirmMessage={MESSAGES.save} + cancelMessage={MESSAGES.cancel} + closeOnConfirm={false} + > + setStatus(value)} /> + ); }; diff --git a/hat/assets/js/apps/Iaso/domains/payments/components/CreatePaymentLot/PaymentLotsFilters.tsx b/hat/assets/js/apps/Iaso/domains/payments/components/CreatePaymentLot/PaymentLotsFilters.tsx index 474bb63127..c193b0285b 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/components/CreatePaymentLot/PaymentLotsFilters.tsx +++ b/hat/assets/js/apps/Iaso/domains/payments/components/CreatePaymentLot/PaymentLotsFilters.tsx @@ -56,66 +56,64 @@ export const PaymentLotsFilters: FunctionComponent = ({ params }) => { ); return ( - <> - - - - getUsersDropDown(input)} - /> - - + + + getUsersDropDown(input)} /> - - - - + + + + + + - - { - handleChange('parent_id', orgUnit?.id); - }} - initialSelection={initialOrgUnit} + + { + handleChange('parent_id', orgUnit?.id); + }} + initialSelection={initialOrgUnit} + /> + + + + - - - - - - + - + ); }; diff --git a/hat/assets/js/apps/Iaso/domains/plannings/PlanningFilters.tsx b/hat/assets/js/apps/Iaso/domains/plannings/PlanningFilters.tsx index 08292ae784..f10f5789dd 100644 --- a/hat/assets/js/apps/Iaso/domains/plannings/PlanningFilters.tsx +++ b/hat/assets/js/apps/Iaso/domains/plannings/PlanningFilters.tsx @@ -30,51 +30,49 @@ export const PlanningFilters: FunctionComponent = ({ params }) => { const { formatMessage } = useSafeIntl(); return ( - <> - - - - - - - - - - + + + + + + + + + + + + + - - - - - - + - + ); }; diff --git a/hat/assets/js/apps/Iaso/domains/projects/components/CreateEditProjectDialog.tsx b/hat/assets/js/apps/Iaso/domains/projects/components/CreateEditProjectDialog.tsx index 117d0d13b5..a15cc0f109 100644 --- a/hat/assets/js/apps/Iaso/domains/projects/components/CreateEditProjectDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/projects/components/CreateEditProjectDialog.tsx @@ -291,6 +291,5 @@ const editProjectModalWithIcon = makeFullModal( export { createProjectModalWithButton as CreateProjectDialog, - editProjectModalWithIcon as EditProjectDialog + editProjectModalWithIcon as EditProjectDialog, }; - diff --git a/hat/assets/js/apps/Iaso/domains/storages/components/Filters.tsx b/hat/assets/js/apps/Iaso/domains/storages/components/Filters.tsx index 367feb4df9..6d15b5bc5a 100644 --- a/hat/assets/js/apps/Iaso/domains/storages/components/Filters.tsx +++ b/hat/assets/js/apps/Iaso/domains/storages/components/Filters.tsx @@ -31,61 +31,59 @@ export const Filters: FunctionComponent = ({ params }) => { const isLargeLayout = useMediaQuery(theme.breakpoints.up('md')); return ( - <> - - - - - - - - + + + + + + + + + + {filters.status === 'BLACKLISTED' && ( - {filters.status === 'BLACKLISTED' && ( - - )} - + )} + - - - - - + + + + - + ); }; diff --git a/hat/assets/js/apps/Iaso/domains/tasks/components/NotificationImportDetailButton.tsx b/hat/assets/js/apps/Iaso/domains/tasks/components/NotificationImportDetailButton.tsx index febfe6140d..43826e5438 100644 --- a/hat/assets/js/apps/Iaso/domains/tasks/components/NotificationImportDetailButton.tsx +++ b/hat/assets/js/apps/Iaso/domains/tasks/components/NotificationImportDetailButton.tsx @@ -10,17 +10,18 @@ type IconButtonProps = { dataTestId?: string; }; -export const NotificationImportDetailButton: FunctionComponent = - ({ - onClick, - dataTestId = 'open-polio-notifications-import-details-button', - }) => { - return ( - - ); - }; +export const NotificationImportDetailButton: FunctionComponent< + IconButtonProps +> = ({ + onClick, + dataTestId = 'open-polio-notifications-import-details-button', +}) => { + return ( + + ); +}; diff --git a/hat/assets/js/apps/Iaso/domains/teams/components/TeamFilters.tsx b/hat/assets/js/apps/Iaso/domains/teams/components/TeamFilters.tsx index 54463b8a7e..12acc73ae7 100644 --- a/hat/assets/js/apps/Iaso/domains/teams/components/TeamFilters.tsx +++ b/hat/assets/js/apps/Iaso/domains/teams/components/TeamFilters.tsx @@ -1,17 +1,17 @@ import { Box, Grid } from '@mui/material'; -import React, { FunctionComponent, useCallback, useState } from "react"; -import { useSafeIntl } from "bluesquare-components"; +import React, { FunctionComponent, useCallback, useState } from 'react'; +import { useSafeIntl } from 'bluesquare-components'; import { FilterButton } from '../../../components/FilterButton'; import InputComponent from '../../../components/forms/InputComponent'; import { useFilterState } from '../../../hooks/useFilterState'; import { TeamParams } from '../types/team'; import MESSAGES from '../messages'; import { baseUrls } from '../../../constants/urls'; -import { AsyncSelect } from "../../../components/forms/AsyncSelect"; -import { getUsersDropDown } from "../../instances/hooks/requests/getUsersDropDown"; -import { useGetProfilesDropdown } from "../../instances/hooks/useGetProfilesDropdown"; -import { TEAM_OF_TEAMS, TEAM_OF_USERS } from "../constants"; -import { useGetProjectsDropdownOptions } from "../../projects/hooks/requests"; +import { AsyncSelect } from '../../../components/forms/AsyncSelect'; +import { getUsersDropDown } from '../../instances/hooks/requests/getUsersDropDown'; +import { useGetProfilesDropdown } from '../../instances/hooks/useGetProfilesDropdown'; +import { TEAM_OF_TEAMS, TEAM_OF_USERS } from '../constants'; +import { useGetProjectsDropdownOptions } from '../../projects/hooks/requests'; type Props = { params: TeamParams; diff --git a/hat/assets/js/apps/Iaso/domains/users/components/ExportMobileAppSetupDialog.tsx b/hat/assets/js/apps/Iaso/domains/users/components/ExportMobileAppSetupDialog.tsx index 4854330e32..219f5a1337 100644 --- a/hat/assets/js/apps/Iaso/domains/users/components/ExportMobileAppSetupDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/users/components/ExportMobileAppSetupDialog.tsx @@ -19,12 +19,12 @@ import { useSafeIntl, } from 'bluesquare-components'; -import MESSAGES from '../messages'; import InputComponent from 'Iaso/components/forms/InputComponent.tsx'; import { useTaskMonitor } from 'Iaso/hooks/taskMonitor'; import { getRequest } from 'Iaso/libs/Api'; import { TaskApiResponse } from 'Iaso/domains/tasks/types'; import { Project, User } from 'Iaso/utils/usersUtils'; +import MESSAGES from '../messages'; const styles: SxStyles = { progressWrapper: { @@ -120,7 +120,7 @@ const ExportMobileAppSetupDialogComponent: FunctionComponent = ({ onCreateExport({ userId: selectedUser.user_id, projectId: selectedProject.id, - password: password, + password, }) .then((task: TaskApiResponse) => { setIsExporting(true); diff --git a/hat/assets/js/apps/Iaso/domains/users/components/UsersLocations.js b/hat/assets/js/apps/Iaso/domains/users/components/UsersLocations.js index e4a6f296a3..8f6984e0d9 100644 --- a/hat/assets/js/apps/Iaso/domains/users/components/UsersLocations.js +++ b/hat/assets/js/apps/Iaso/domains/users/components/UsersLocations.js @@ -12,15 +12,13 @@ const UsersLocations = ({ handleChange, currentUser }) => { handleChange(orgUnitsList); }; return ( - <> - - + ); }; diff --git a/hat/assets/js/apps/Iaso/domains/users/hooks/useCreateExportMobileSetup.ts b/hat/assets/js/apps/Iaso/domains/users/hooks/useCreateExportMobileSetup.ts index fe6fa57df5..a15f3f72aa 100644 --- a/hat/assets/js/apps/Iaso/domains/users/hooks/useCreateExportMobileSetup.ts +++ b/hat/assets/js/apps/Iaso/domains/users/hooks/useCreateExportMobileSetup.ts @@ -17,7 +17,7 @@ export const useCreateExportMobileSetup = (): UseMutationResult => { return postRequest('/api/tasks/create/exportmobilesetup/', { user_id: userId, project_id: projectId, - password: password, + password, }); }, showSucessSnackBar: false, diff --git a/hat/assets/js/apps/Iaso/domains/workflows/components/Filters.tsx b/hat/assets/js/apps/Iaso/domains/workflows/components/Filters.tsx index ea03def53a..e80ebcd532 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/components/Filters.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/components/Filters.tsx @@ -28,44 +28,42 @@ export const Filters: FunctionComponent = ({ params }) => { const isLargeLayout = useMediaQuery(theme.breakpoints.up('md')); return ( - <> - - - - - - + + + + + + + + + - - - - - - + - + ); }; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useDeleteWorkflowChange.tsx b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useDeleteWorkflowChange.tsx index 023ad2d170..7864ecf1ae 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useDeleteWorkflowChange.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useDeleteWorkflowChange.tsx @@ -2,12 +2,13 @@ import { UseMutationResult } from 'react-query'; import { deleteRequest } from '../../../../libs/Api'; import { useSnackMutation } from '../../../../libs/apiHooks'; import MESSAGES from '../../messages'; + const deleteWorkflowChange = async (changeId: number): Promise => { return deleteRequest(`/api/workflowchanges/${changeId}/`); }; export const useDeleteWorkflowChange = (): UseMutationResult => useSnackMutation({ mutationFn: deleteWorkflowChange, - invalidateQueryKey: ['workflowVersions','workflowVersionsChanges'], + invalidateQueryKey: ['workflowVersions', 'workflowVersionsChanges'], snackSuccessMessage: MESSAGES.changeDeleted, }); diff --git a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useSaveWorkflowChange.tsx b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useSaveWorkflowChange.tsx index d30551bd90..d84920386d 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useSaveWorkflowChange.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useSaveWorkflowChange.tsx @@ -23,6 +23,6 @@ export const useSaveWorkflowChange = ( data.id ? updateWorkflowChange(data) : createWorkflowChange(data, versionId), - invalidateQueryKey: ['workflowVersions','workflowVersionsChanges'], + invalidateQueryKey: ['workflowVersions', 'workflowVersionsChanges'], options: { onSuccess: () => closeDialog() }, }); From aa84982828ec0c36c34b73cdcbafa84172cd7838 Mon Sep 17 00:00:00 2001 From: Christophe Gerard Date: Thu, 3 Oct 2024 14:45:00 +0200 Subject: [PATCH 6/9] small changes --- .eslintrc.json | 2 +- hat/assets/js/apps/Iaso/domains/pages/hooks/useGetPages.js | 4 ++-- package.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 3fe5783d21..1fc605b29b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -223,7 +223,6 @@ "class-methods-use-this": "warn", "constructor-super": "warn", "import/no-extraneous-dependencies": "off", - "import/no-named-as-default": "warn", "import/prefer-default-export": "off", "jsx-a11y/anchor-is-valid": "off", "jsx-a11y/click-events-have-key-events": "off", @@ -295,6 +294,7 @@ "error", 4 ], + "import/no-named-as-default": "off", "react/jsx-one-expression-per-line": "off", "react/jsx-props-no-spreading": "off", "react/jsx-wrap-multilines": "off", diff --git a/hat/assets/js/apps/Iaso/domains/pages/hooks/useGetPages.js b/hat/assets/js/apps/Iaso/domains/pages/hooks/useGetPages.js index d28d78579a..0dd5662105 100644 --- a/hat/assets/js/apps/Iaso/domains/pages/hooks/useGetPages.js +++ b/hat/assets/js/apps/Iaso/domains/pages/hooks/useGetPages.js @@ -1,5 +1,5 @@ -import { useSnackQuery } from 'Iaso/libs/apiHooks'; import { getRequest } from 'Iaso/libs/Api'; +import { useSnackQuery } from 'Iaso/libs/apiHooks'; export const useGetPages = options => { const params = { @@ -12,7 +12,7 @@ export const useGetPages = options => { const getURL = urlParams => { const filteredParams = Object.entries(urlParams).filter( - ([key, value]) => value !== undefined, + ([_key, value]) => value !== undefined, ); const queryString = new URLSearchParams( diff --git a/package.json b/package.json index d869a84fe5..7566d57940 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "author": "Bluesquare", "license": "Apache-2.0", "scripts": { - "fix-lint": "prettier-eslint \"./hat/assets/js/**/*.{js,ts,tsx}\" --lint-different --write", "show-lint-problems": "eslint \"./hat/assets/js/**/*.{js,ts,tsx}\"", - "export-lint-problems": "eslint \"./hat/assets/js/**/*.{js,ts,tsx}\" -f html -o ./hat/assets/js/lintErrors.html --quiet", + "fix-lint": "eslint \"./hat/assets/js/**/*.{js,ts,tsx}\" --fix", + "export-lint-problems": "eslint \"./hat/assets/js/**/*.{js,ts,tsx}\" -f html -o ./hat/assets/js/lintErrors.html", "test-coverage": "nyc npm run test", "test": "NODE_PATH=hat/assets/js/apps mocha --exit --require ./babel-register.js --require ./hat/assets/js/test/helpers.js --require ./hat/assets/js/test/dom.js './hat/assets/js/apps/**/*.spec.js'", "test-watch": "NODE_PATH=hat/assets/js/apps mocha --require ./babel-register.js --require ./hat/assets/js/test/helpers.js --require ./hat/assets/js/test/dom.js './hat/assets/js/apps/**/*.spec.js' --watch", From 6363d2201132b582c4fad9d04c44ddb6fff08c38 Mon Sep 17 00:00:00 2001 From: Christophe Gerard Date: Thu, 3 Oct 2024 16:14:52 +0200 Subject: [PATCH 7/9] fix cypress --- hat/assets/js/cypress/support/commands.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hat/assets/js/cypress/support/commands.js b/hat/assets/js/cypress/support/commands.js index d5fe80039d..330a9e31f2 100644 --- a/hat/assets/js/cypress/support/commands.js +++ b/hat/assets/js/cypress/support/commands.js @@ -121,13 +121,12 @@ Cypress.Commands.add('testInputValue', (id, value) => * @param {array} options - list of possible options * @param {string} accessor - key of the option to test, by default 'name' */ -Cypress.Commands.add('testMultiSelect', (id, options, accessor = 'name') => { - cy.get(id).parent().as('select'); - cy.get('@select').find('div[role=button]').as('chips'); - cy.get('@chips').should('have.length', options.length); - options.forEach(o => { - cy.get('@select').should('contain', o[accessor]); - }); +Cypress.Commands.add('testMultiSelect', (id, options) => { + cy.get(id) + .parent() + .within(() => { + cy.get('div[role=button]').should('have.length', options.length); + }); }); /** @@ -206,9 +205,7 @@ Cypress.Commands.add('deleteLastFieldInArrayInputField', selector => { */ Cypress.Commands.add('fillTextField', (id, value = '') => { cy.get(id).clear(); - cy.get(id).then(() => { - cy.wrap(id).type(value); - }); + cy.get(id).type(value); }); /** From 4f255589a7ffe1c2e03840885bf487f4d9ff1340 Mon Sep 17 00:00:00 2001 From: Quang Son Le Date: Thu, 3 Oct 2024 17:07:37 +0200 Subject: [PATCH 8/9] PTACH: remove useless eslint exceptions --- hat/assets/js/apps/Iaso/components/FilterButton.tsx | 1 - plugins/polio/js/src/domains/Campaigns/Scope/Scopes/MapScope.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/hat/assets/js/apps/Iaso/components/FilterButton.tsx b/hat/assets/js/apps/Iaso/components/FilterButton.tsx index 6d3e849b78..c2efec54bb 100644 --- a/hat/assets/js/apps/Iaso/components/FilterButton.tsx +++ b/hat/assets/js/apps/Iaso/components/FilterButton.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/require-default-props */ import FiltersIcon from '@mui/icons-material/FilterList'; import { Box, Button } from '@mui/material'; import React, { FunctionComponent } from 'react'; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/MapScope.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/MapScope.tsx index 9ce8001ae4..f56638b63c 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/MapScope.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/MapScope.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box } from '@mui/material'; import { FieldInputProps } from 'formik'; import React, { FunctionComponent, useCallback, useMemo } from 'react'; From 6680887e4f7f59c37537f658adf6a2be57d5e35e Mon Sep 17 00:00:00 2001 From: Quang Son Le Date: Fri, 4 Oct 2024 10:48:41 +0200 Subject: [PATCH 9/9] PATCH: remove es-lint ignore camelcase comments --- hat/assets/js/apps/Iaso/components/Cells/BreakWordCell.tsx | 1 - hat/assets/js/apps/Iaso/components/Cells/DateTimeCell.tsx | 5 +++-- hat/assets/js/apps/Iaso/components/Cells/UserCell.tsx | 3 +-- .../Iaso/components/LegendBuilder/LegendBuilderDialog.tsx | 1 - .../assignments/hooks/requests/useGetOrgUnitTypes.ts | 1 - .../Iaso/domains/assignments/hooks/requests/useGetTeams.ts | 1 - .../js/apps/Iaso/domains/assignments/types/assigment.ts | 1 - .../js/apps/Iaso/domains/assignments/types/planning.ts | 2 -- hat/assets/js/apps/Iaso/domains/assignments/types/team.ts | 1 - hat/assets/js/apps/Iaso/domains/completenessStats/types.ts | 3 --- .../components/CopySourceVersion/CopySourceVersion.tsx | 3 +-- .../Iaso/domains/dataSources/hooks/useGetDataSource.ts | 1 - .../domains/dataSources/hooks/useGetDataSourceVersion.ts | 1 - .../js/apps/Iaso/domains/dataSources/types/dataSources.ts | 1 - hat/assets/js/apps/Iaso/domains/entities/config.tsx | 7 +++---- .../duplicates/details/hooks/useGetInstancesForEntity.ts | 1 - .../Iaso/domains/entities/duplicates/hooks/api/analyzes.ts | 1 - .../entities/duplicates/hooks/api/useGetDuplicates.ts | 2 -- .../entities/duplicates/hooks/api/useIgnoreDuplicate.ts | 1 - .../entities/duplicates/hooks/api/useMergeDuplicate.ts | 1 - .../domains/entities/duplicates/list/DuplicatesFilters.tsx | 1 - .../js/apps/Iaso/domains/entities/duplicates/types.ts | 2 -- .../entities/entityTypes/components/EntityTypesDialog.tsx | 2 +- .../Iaso/domains/entities/entityTypes/types/entityType.ts | 1 - hat/assets/js/apps/Iaso/domains/entities/hooks/requests.ts | 1 - .../js/apps/Iaso/domains/entities/types/beneficiary.ts | 1 - .../Iaso/domains/forms/components/FormFormComponent.tsx | 1 - .../apps/Iaso/domains/forms/components/FormLegendInput.tsx | 1 - .../js/apps/Iaso/domains/forms/hooks/useGetAttachments.tsx | 1 - .../apps/Iaso/domains/forms/hooks/useGetPossibleFields.ts | 1 - hat/assets/js/apps/Iaso/domains/forms/types/forms.ts | 1 - .../instances/compare/components/InstanceLogDetail.tsx | 1 - .../instances/compare/components/InstanceLogInfos.tsx | 1 - .../domains/instances/compare/hooks/useGetInstanceLogs.ts | 1 - .../instances/components/InstanceDetailsLocksHistory.tsx | 1 - .../apps/Iaso/domains/instances/hooks/speedDialActions.tsx | 1 - .../js/apps/Iaso/domains/instances/types/instance.ts | 1 - hat/assets/js/apps/Iaso/domains/instances/utils/index.tsx | 1 - .../Iaso/domains/modules/hooks/requests/useGetModules.ts | 1 - hat/assets/js/apps/Iaso/domains/modules/types/modules.ts | 1 - .../apps/Iaso/domains/orgUnits/components/OrgUnitInfos.tsx | 2 -- .../orgUnits/components/OrgUnitMultiReferenceInstances.tsx | 1 - .../orgUnits/configuration/Tables/EditableFieldsCell.tsx | 1 - hat/assets/js/apps/Iaso/domains/orgUnits/details.js | 1 - .../js/apps/Iaso/domains/orgUnits/groupSets/types/Group.ts | 2 -- .../apps/Iaso/domains/orgUnits/groupSets/types/GroupSet.ts | 2 -- .../domains/orgUnits/hooks/requests/useGetDataSources.ts | 1 - .../orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypes.ts | 1 - .../hooks/useGetOrgUnitTypesDropdownOptions.ts | 1 - .../Components/ReviewOrgUnitChangesButtons.tsx | 1 - .../Components/ReviewOrgUnitChangesCommentDialog.tsx | 1 - .../ReviewOrgUnitChangesCommentDialogButtons.tsx | 1 - .../Tables/details/ReviewOrgUnitChangesDetailsTable.tsx | 1 - .../details/ReviewOrgUnitChangesDetailsTableHead.tsx | 1 - .../Tables/details/ReviewOrgUnitChangesDetailsTableRow.tsx | 1 - .../js/apps/Iaso/domains/orgUnits/reviewChanges/types.ts | 1 - .../js/apps/Iaso/domains/orgUnits/types/dataSources.ts | 2 -- hat/assets/js/apps/Iaso/domains/orgUnits/types/group.ts | 2 -- hat/assets/js/apps/Iaso/domains/orgUnits/types/orgUnit.ts | 1 - .../js/apps/Iaso/domains/orgUnits/types/orgunitTypes.ts | 1 - .../js/apps/Iaso/domains/orgUnits/types/saveMulti.ts | 1 - hat/assets/js/apps/Iaso/domains/orgUnits/types/search.ts | 1 - .../domains/payments/components/PaymentLotActionCell.tsx | 1 - .../domains/payments/hooks/requests/useGetPaymentLots.tsx | 1 - .../payments/hooks/requests/useGetPotentialPayments.tsx | 1 - .../hooks/requests/useGetSelectedPotentialPayments.tsx | 1 - .../domains/payments/hooks/requests/useSavePaymentLot.ts | 1 - hat/assets/js/apps/Iaso/domains/payments/types.ts | 1 - .../domains/plannings/hooks/requests/useGetPlannings.ts | 1 - .../Iaso/domains/plannings/hooks/requests/useGetTeams.ts | 1 - .../domains/plannings/hooks/requests/useSavePlanning.ts | 1 - .../domains/registry/hooks/useGetEmptyInstanceOrgUnits.ts | 1 - .../apps/Iaso/domains/registry/hooks/useGetInstances.tsx | 1 - .../js/apps/Iaso/domains/setup/hooks/useSaveAccount.ts | 1 - hat/assets/js/apps/Iaso/domains/setup/types/account.ts | 1 - hat/assets/js/apps/Iaso/domains/storages/config.tsx | 5 ++--- .../domains/storages/hooks/requests/useGetStorageLogs.ts | 1 - .../Iaso/domains/storages/hooks/requests/useGetStorages.ts | 1 - .../Iaso/domains/storages/hooks/requests/useSaveStatus.tsx | 1 - hat/assets/js/apps/Iaso/domains/storages/types/storages.ts | 2 -- .../js/apps/Iaso/domains/tasks/components/TaskDetails.tsx | 5 +++-- hat/assets/js/apps/Iaso/domains/tasks/types.ts | 1 - .../apps/Iaso/domains/teams/hooks/requests/useGetTeams.ts | 1 - .../apps/Iaso/domains/teams/hooks/requests/useSaveTeam.ts | 1 - hat/assets/js/apps/Iaso/domains/teams/types/profile.ts | 1 - hat/assets/js/apps/Iaso/domains/teams/types/team.ts | 1 - .../domains/userRoles/hooks/requests/useGetUserRoles.ts | 1 - .../domains/userRoles/hooks/requests/useSaveUserRole.ts | 1 - .../js/apps/Iaso/domains/userRoles/types/userRoles.ts | 1 - .../users/components/ExportMobileAppSetupDialog.tsx | 2 +- .../js/apps/Iaso/domains/users/components/UsersDialog.tsx | 1 - hat/assets/js/apps/Iaso/domains/users/types.ts | 1 - .../js/apps/Iaso/domains/workflows/config/changes.tsx | 1 - .../js/apps/Iaso/domains/workflows/config/followUps.tsx | 1 - hat/assets/js/apps/Iaso/domains/workflows/config/index.tsx | 1 - .../hooks/requests/useGetWorkflowVersionChanges.ts | 1 - .../workflows/hooks/requests/useGetWorkflowVersions.ts | 1 - hat/assets/js/apps/Iaso/domains/workflows/types.ts | 1 - hat/assets/js/apps/Iaso/libs/Api.ts | 1 - hat/assets/js/apps/Iaso/utils/usersUtils.ts | 1 - plugins/polio/js/src/constants/types.ts | 1 - .../js/src/domains/Budget/BudgetDetails/BudgetDetails.tsx | 6 +++--- .../domains/Budget/BudgetDetails/BudgetDetailsFilters.tsx | 2 -- plugins/polio/js/src/domains/Budget/BudgetFilters.tsx | 2 -- .../domains/Budget/CreateBudgetStep/CreateBudgetStep.tsx | 3 --- .../domains/Budget/CreateBudgetStep/CreateOverrideStep.tsx | 4 ---- plugins/polio/js/src/domains/Budget/cards/BudgetCard.tsx | 1 - .../polio/js/src/domains/Budget/hooks/api/useGetBudget.ts | 1 - .../js/src/domains/Budget/hooks/api/useGetBudgetDetails.ts | 1 - .../js/src/domains/Budget/hooks/api/useSaveBudgetStep.tsx | 1 - .../js/src/domains/Budget/hooks/api/useSaveOverrideStep.ts | 1 - plugins/polio/js/src/domains/Budget/hooks/config.tsx | 1 - plugins/polio/js/src/domains/Budget/types.ts | 1 - plugins/polio/js/src/domains/Budget/utils.tsx | 1 - plugins/polio/js/src/domains/Calendar/Calendar.tsx | 1 - .../src/domains/Calendar/campaignCalendar/TogglePeriod.tsx | 1 - .../campaignCalendar/map/CalendarMapPanesMerged.tsx | 1 - .../js/src/domains/Calendar/campaignCalendar/types.ts | 1 - .../js/src/domains/Calendar/campaignCalendar/utils.tsx | 2 -- .../js/src/domains/Campaigns/BaseInfo/BaseInfoForm.tsx | 1 - .../js/src/domains/Campaigns/CampaignsList/Dashboard.tsx | 1 - .../src/domains/Campaigns/Evaluations/EvaluationsForms.tsx | 1 - .../js/src/domains/Campaigns/MapComponent/MapComponent.js | 1 - .../domains/Campaigns/Preparedness/PreparednessConfig.js | 1 - .../src/domains/Campaigns/Preparedness/PreparednessForm.js | 1 - .../Campaigns/Preparedness/hooks/useGetPreparednessData.js | 1 - .../Campaigns/Rounds/ReasonForDelayModal/validation.ts | 1 - .../src/domains/Campaigns/Rounds/RoundDates/RoundDates.tsx | 1 - plugins/polio/js/src/domains/Campaigns/Scope/ScopeForm.tsx | 1 - .../polio/js/src/domains/Campaigns/Scope/ScopeInput.tsx | 1 - .../domains/Campaigns/Scope/Scopes/DistrictScopeTable.tsx | 1 - .../src/domains/Campaigns/Scope/Scopes/ScopeMapLegend.tsx | 1 - .../polio/js/src/domains/Campaigns/Scope/Scopes/types.ts | 1 - .../domains/Campaigns/Scope/hooks/useGetParentOrgUnit.ts | 1 - .../domains/Campaigns/campaignHistory/CampaignHistory.tsx | 3 +-- .../js/src/domains/Campaigns/campaignHistory/Head.tsx | 1 - .../campaignHistory/hooks/useGetCampaignHistory.ts | 1 - .../js/src/domains/Campaigns/hooks/api/useGetCampaigns.ts | 1 - .../polio/js/src/domains/Chronogram/Chronogram/types.ts | 2 -- .../js/src/domains/Chronogram/ChronogramDetails/types.ts | 2 -- .../src/domains/Chronogram/ChronogramTemplateTask/types.ts | 2 -- plugins/polio/js/src/domains/Chronogram/types.ts | 2 -- .../domains/LQAS-IM/LQAS/Graphs/CaregiverInfoSource.tsx | 1 - plugins/polio/js/src/domains/LQAS-IM/shared/LqasIm.tsx | 1 - .../domains/LQAS-IM/shared/Map/ScopeAndDNFDisclaimer.tsx | 2 -- .../Notifications/Modals/NotificationsCreateEditModal.tsx | 1 - .../polio/js/src/domains/Notifications/hooks/validation.ts | 1 - plugins/polio/js/src/domains/Notifications/types.ts | 2 -- .../Modals/CreateEdit/CreateEditAuthorisationModal.tsx | 1 - .../VaccineModule/Nopv2Authorisations/hooks/validation.ts | 1 - .../src/domains/VaccineModule/Nopv2Authorisations/types.ts | 1 - .../Table/useVaccineStockManagementDetailsColumns.tsx | 1 - .../StockManagement/StockVariation/Table/columns.tsx | 1 - .../src/domains/VaccineModule/StockManagement/hooks/api.ts | 1 - .../js/src/domains/VaccineModule/StockManagement/types.ts | 1 - .../SupplyChain/Details/PreAlerts/PreAlert.tsx | 1 - .../SupplyChain/Details/VAR/VaccineArrivalReport.tsx | 1 - .../SupplyChain/Details/VaccineSupplyChainDetails.tsx | 1 - .../VaccineModule/SupplyChain/hooks/api/preAlerts.tsx | 1 - .../SupplyChain/hooks/api/useSaveSupplyChainForm.tsx | 1 - .../domains/VaccineModule/SupplyChain/hooks/api/utils.tsx | 1 - .../VaccineModule/SupplyChain/hooks/useTopBarTitle.tsx | 1 - .../src/domains/VaccineModule/SupplyChain/hooks/utils.ts | 1 - .../js/src/domains/VaccineModule/SupplyChain/types.ts | 1 - plugins/polio/js/src/hooks/useFormValidator.js | 1 - plugins/polio/js/src/hooks/useGetTeams.ts | 1 - plugins/polio/js/src/utils/index.tsx | 1 - plugins/registry/js/src/hooks/useGetInstances.tsx | 5 ----- 168 files changed, 19 insertions(+), 209 deletions(-) diff --git a/hat/assets/js/apps/Iaso/components/Cells/BreakWordCell.tsx b/hat/assets/js/apps/Iaso/components/Cells/BreakWordCell.tsx index a3286c82c6..24b0447d19 100644 --- a/hat/assets/js/apps/Iaso/components/Cells/BreakWordCell.tsx +++ b/hat/assets/js/apps/Iaso/components/Cells/BreakWordCell.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box } from '@mui/material'; import React, { ReactElement } from 'react'; import { makeStyles } from '@mui/styles'; diff --git a/hat/assets/js/apps/Iaso/components/Cells/DateTimeCell.tsx b/hat/assets/js/apps/Iaso/components/Cells/DateTimeCell.tsx index f65c1cb46f..24956fcdce 100644 --- a/hat/assets/js/apps/Iaso/components/Cells/DateTimeCell.tsx +++ b/hat/assets/js/apps/Iaso/components/Cells/DateTimeCell.tsx @@ -9,8 +9,9 @@ import { apiDateFormats } from '../../utils/dates'; /* DateTimeCell For use in Table's columns to display DateTime */ -export const DateTimeCell = (cellInfo: { value?: number | null }): string => - displayDateFromTimestamp(cellInfo?.value); +export const DateTimeCell = (cellInfo: { + value?: number | null | undefined; +}): string => displayDateFromTimestamp(cellInfo?.value); export const convertToDateTimeRfc = ( value: string | null | undefined, diff --git a/hat/assets/js/apps/Iaso/components/Cells/UserCell.tsx b/hat/assets/js/apps/Iaso/components/Cells/UserCell.tsx index d456d33532..4b8febae00 100644 --- a/hat/assets/js/apps/Iaso/components/Cells/UserCell.tsx +++ b/hat/assets/js/apps/Iaso/components/Cells/UserCell.tsx @@ -1,8 +1,7 @@ -/* eslint-disable camelcase */ import React, { ReactElement } from 'react'; import getDisplayName, { User } from '../../utils/usersUtils'; export const UserCell = (cellInfo: { value?: Partial }): ReactElement => { const value = cellInfo?.value ?? ''; - return <>{value ? getDisplayName(value) : '--'}; + return {value ? getDisplayName(value) : '--'}; }; diff --git a/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx b/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx index 881978be31..c16e91e536 100644 --- a/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx +++ b/hat/assets/js/apps/Iaso/components/LegendBuilder/LegendBuilderDialog.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, Button } from '@mui/material'; import { ConfirmCancelModal, diff --git a/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetOrgUnitTypes.ts b/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetOrgUnitTypes.ts index 39720d37c7..21f3c02276 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetOrgUnitTypes.ts +++ b/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetOrgUnitTypes.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetTeams.ts b/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetTeams.ts index 1477aa26f5..2d8885808e 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetTeams.ts +++ b/hat/assets/js/apps/Iaso/domains/assignments/hooks/requests/useGetTeams.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/types/assigment.ts b/hat/assets/js/apps/Iaso/domains/assignments/types/assigment.ts index 3ffe1fcd42..e38b9ea4a6 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/types/assigment.ts +++ b/hat/assets/js/apps/Iaso/domains/assignments/types/assigment.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Shape } from '../../orgUnits/types/shapes'; export type AssignmentParams = { diff --git a/hat/assets/js/apps/Iaso/domains/assignments/types/planning.ts b/hat/assets/js/apps/Iaso/domains/assignments/types/planning.ts index d8c3bbe3ca..6b960f50a8 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/types/planning.ts +++ b/hat/assets/js/apps/Iaso/domains/assignments/types/planning.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - // TODO: types are a bit repetitive in micro planning, maybe use a a common types folder type Team = { id: number; diff --git a/hat/assets/js/apps/Iaso/domains/assignments/types/team.ts b/hat/assets/js/apps/Iaso/domains/assignments/types/team.ts index 59c1d34504..7fadc785b1 100644 --- a/hat/assets/js/apps/Iaso/domains/assignments/types/team.ts +++ b/hat/assets/js/apps/Iaso/domains/assignments/types/team.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ export type SubTeam = { id: number; name: string; diff --git a/hat/assets/js/apps/Iaso/domains/completenessStats/types.ts b/hat/assets/js/apps/Iaso/domains/completenessStats/types.ts index 5cb61353fd..9b521c18cf 100644 --- a/hat/assets/js/apps/Iaso/domains/completenessStats/types.ts +++ b/hat/assets/js/apps/Iaso/domains/completenessStats/types.ts @@ -10,7 +10,6 @@ export type FormDesc = { slug: string; }; -/* eslint-disable camelcase */ export type FormStat = { descendants: number; // int descendants_ok: number; // int @@ -23,7 +22,6 @@ export type FormStat = { legend_threshold: ScaleThreshold; // Legend used to display colors per form }; -/* eslint-disable camelcase */ export type CompletenessStats = { parent_org_unit?: NameAndId; org_unit_type?: NameAndId; @@ -38,7 +36,6 @@ export type CompletenessApiResponse = Paginated & { }; export type ParentOrgUnit = { name: string; id: number; parent: NameAndId }; -/* eslint-disable camelcase */ export type CompletenessMapStats = { altitude?: number; form_stats: Record; diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx b/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx index e3a4b3a74d..254dfe3922 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx +++ b/hat/assets/js/apps/Iaso/domains/dataSources/components/CopySourceVersion/CopySourceVersion.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import FileCopyIcon from '@mui/icons-material/FileCopy'; import { Box, Divider, Grid } from '@mui/material'; import { IconButton, useRedirectTo, useSafeIntl } from 'bluesquare-components'; @@ -93,7 +92,7 @@ export const CopySourceVersion: FunctionComponent = ({ [allSourceVersions, destinationSourceId, formatMessage], ); const nextVersionNumber = - sourceVersionsDropDown[sourceVersionsDropDown?.length - 1].value ?? 1; + sourceVersionsDropDown[sourceVersionsDropDown?.length - 1]?.value ?? 1; const [destinationVersionNumber, setDestinationVersionNumber] = useState(nextVersionNumber); const warningVersionNumber = destinationVersionNumber ?? nextVersionNumber; diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/hooks/useGetDataSource.ts b/hat/assets/js/apps/Iaso/domains/dataSources/hooks/useGetDataSource.ts index 033c8282bf..0bf5202fb8 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/hooks/useGetDataSource.ts +++ b/hat/assets/js/apps/Iaso/domains/dataSources/hooks/useGetDataSource.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../libs/Api'; import { useSnackQuery } from '../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/hooks/useGetDataSourceVersion.ts b/hat/assets/js/apps/Iaso/domains/dataSources/hooks/useGetDataSourceVersion.ts index ab3aaadb8b..d4ccac1a2a 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/hooks/useGetDataSourceVersion.ts +++ b/hat/assets/js/apps/Iaso/domains/dataSources/hooks/useGetDataSourceVersion.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../libs/Api'; import { useSnackQuery } from '../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/dataSources/types/dataSources.ts b/hat/assets/js/apps/Iaso/domains/dataSources/types/dataSources.ts index e7efa0d52f..7e2af527ba 100644 --- a/hat/assets/js/apps/Iaso/domains/dataSources/types/dataSources.ts +++ b/hat/assets/js/apps/Iaso/domains/dataSources/types/dataSources.ts @@ -1,6 +1,5 @@ import { OrgUnitStatus } from '../../orgUnits/types/orgUnit'; -/* eslint-disable camelcase */ export type Project = { name: string; }; diff --git a/hat/assets/js/apps/Iaso/domains/entities/config.tsx b/hat/assets/js/apps/Iaso/domains/entities/config.tsx index 09ac21708a..2c9e3f3eb4 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/config.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Column, IconButton as IconButtonComponent, @@ -67,7 +66,7 @@ export const useStaticColumns = (): Array => { Cell: settings => { const groups = settings.row.original?.org_unit?.groups; if (!groups || groups.length === 0) { - return <>{textPlaceholder}; + return {textPlaceholder}; } return groups.map((group, index) => ( @@ -90,7 +89,7 @@ export const useStaticColumns = (): Array => { return settings.row.original?.org_unit ? ( ) : ( - <>{textPlaceholder} + {textPlaceholder} ); }, }, @@ -197,7 +196,7 @@ const generateColumnsFromFieldsList = ( return ; } - return <>{data ?? '--'}; + return {data ?? '--'}; }, }; }); diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useGetInstancesForEntity.ts b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useGetInstancesForEntity.ts index 3b156c6628..3191eb4042 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useGetInstancesForEntity.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/details/hooks/useGetInstancesForEntity.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { useSnackQuery } from '../../../../../libs/apiHooks'; import { getRequest } from '../../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/analyzes.ts b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/analyzes.ts index 856cfffe3a..b2769fe18a 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/analyzes.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/analyzes.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult, UseMutationResult } from 'react-query'; import { useSnackQuery, useSnackMutation } from '../../../../../libs/apiHooks'; import { Analysis } from '../../types'; diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useGetDuplicates.ts b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useGetDuplicates.ts index 53f297e8e3..3bd856ea48 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useGetDuplicates.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useGetDuplicates.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { useSnackQuery } from '../../../../../libs/apiHooks'; import { PaginationParams } from '../../../../../types/general'; @@ -83,7 +82,6 @@ export const useGetDuplicateDetails = ({ > => { // TODO see with backend exact api const queryString = new URLSearchParams(formatParams(params)).toString(); - console.log('QS', queryString); return useSnackQuery({ queryKey: ['entityDuplicateDetails', params], queryFn: () => getDuplicatesDetails(queryString), diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useIgnoreDuplicate.ts b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useIgnoreDuplicate.ts index 81223d3f9a..868b356cb5 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useIgnoreDuplicate.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useIgnoreDuplicate.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseMutationResult } from 'react-query'; import { postRequest } from '../../../../../libs/Api'; import { useSnackMutation } from '../../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useMergeDuplicate.ts b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useMergeDuplicate.ts index bfe496e074..dfb449808b 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useMergeDuplicate.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/hooks/api/useMergeDuplicate.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseMutationResult } from 'react-query'; import { postRequest } from '../../../../../libs/Api'; import { useSnackMutation } from '../../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/list/DuplicatesFilters.tsx b/hat/assets/js/apps/Iaso/domains/entities/duplicates/list/DuplicatesFilters.tsx index 1bbfe3464a..cf21f67a62 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/list/DuplicatesFilters.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/list/DuplicatesFilters.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent, useEffect, useMemo } from 'react'; import { Box, Grid } from '@mui/material'; import { FilterButton } from '../../../../components/FilterButton'; diff --git a/hat/assets/js/apps/Iaso/domains/entities/duplicates/types.ts b/hat/assets/js/apps/Iaso/domains/entities/duplicates/types.ts index 85856f2ccb..d89a4c8529 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/duplicates/types.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/duplicates/types.ts @@ -1,7 +1,5 @@ -import { type } from 'cypress/types/jquery'; import { FormDescriptor } from '../../forms/types/forms'; -/* eslint-disable camelcase */ export type DuplicateEntity = { id: number; created_at: string; // DateTime diff --git a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/EntityTypesDialog.tsx b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/EntityTypesDialog.tsx index 89b9f1e7fb..124d967b3a 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/EntityTypesDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/components/EntityTypesDialog.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box } from '@mui/material'; import { IconButton, @@ -167,6 +166,7 @@ export const EntityTypesDialog: FunctionComponent = ({ icon="remove-red-eye" tooltipMessage={MESSAGES.viewForm} iconSize="small" + // @ts-ignore fontSize="small" dataTestId="see-form-button" /> diff --git a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/types/entityType.ts b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/types/entityType.ts index 8d61a82c8b..98aea827f7 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/entityTypes/types/entityType.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/entityTypes/types/entityType.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ export type EntityType = { id: number; name: string; diff --git a/hat/assets/js/apps/Iaso/domains/entities/hooks/requests.ts b/hat/assets/js/apps/Iaso/domains/entities/hooks/requests.ts index 3d7e93585d..79caf6476e 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/hooks/requests.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/hooks/requests.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseMutationResult, UseQueryResult } from 'react-query'; import moment from 'moment'; diff --git a/hat/assets/js/apps/Iaso/domains/entities/types/beneficiary.ts b/hat/assets/js/apps/Iaso/domains/entities/types/beneficiary.ts index fe6eba82e6..b559dece2c 100644 --- a/hat/assets/js/apps/Iaso/domains/entities/types/beneficiary.ts +++ b/hat/assets/js/apps/Iaso/domains/entities/types/beneficiary.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { OrgUnit } from '../../orgUnits/types/orgUnit'; export type FileContent = { diff --git a/hat/assets/js/apps/Iaso/domains/forms/components/FormFormComponent.tsx b/hat/assets/js/apps/Iaso/domains/forms/components/FormFormComponent.tsx index 336034502b..c0daf81be3 100644 --- a/hat/assets/js/apps/Iaso/domains/forms/components/FormFormComponent.tsx +++ b/hat/assets/js/apps/Iaso/domains/forms/components/FormFormComponent.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { FormatListBulleted, History } from '@mui/icons-material'; import { Box, Grid, Theme, Typography } from '@mui/material'; import { makeStyles } from '@mui/styles'; diff --git a/hat/assets/js/apps/Iaso/domains/forms/components/FormLegendInput.tsx b/hat/assets/js/apps/Iaso/domains/forms/components/FormLegendInput.tsx index 983cfc3f09..1ca9bafa75 100644 --- a/hat/assets/js/apps/Iaso/domains/forms/components/FormLegendInput.tsx +++ b/hat/assets/js/apps/Iaso/domains/forms/components/FormLegendInput.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import DeleteIcon from '@mui/icons-material/Delete'; import { Box, Grid, IconButton } from '@mui/material'; import { makeStyles } from '@mui/styles'; diff --git a/hat/assets/js/apps/Iaso/domains/forms/hooks/useGetAttachments.tsx b/hat/assets/js/apps/Iaso/domains/forms/hooks/useGetAttachments.tsx index 844f86798c..d3c1ce5e73 100644 --- a/hat/assets/js/apps/Iaso/domains/forms/hooks/useGetAttachments.tsx +++ b/hat/assets/js/apps/Iaso/domains/forms/hooks/useGetAttachments.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Pagination } from 'bluesquare-components'; import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/forms/hooks/useGetPossibleFields.ts b/hat/assets/js/apps/Iaso/domains/forms/hooks/useGetPossibleFields.ts index 3fe780dd8f..7836296fc5 100644 --- a/hat/assets/js/apps/Iaso/domains/forms/hooks/useGetPossibleFields.ts +++ b/hat/assets/js/apps/Iaso/domains/forms/hooks/useGetPossibleFields.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { useMemo } from 'react'; import { UseQueryResult } from 'react-query'; import { cloneDeep } from 'lodash'; diff --git a/hat/assets/js/apps/Iaso/domains/forms/types/forms.ts b/hat/assets/js/apps/Iaso/domains/forms/types/forms.ts index 9d44a3521b..d41772b4bf 100644 --- a/hat/assets/js/apps/Iaso/domains/forms/types/forms.ts +++ b/hat/assets/js/apps/Iaso/domains/forms/types/forms.ts @@ -1,6 +1,5 @@ import { ScaleThreshold } from '../../../components/LegendBuilder/types'; -/* eslint-disable camelcase */ type FeatureFlag = { id: number; name: string; diff --git a/hat/assets/js/apps/Iaso/domains/instances/compare/components/InstanceLogDetail.tsx b/hat/assets/js/apps/Iaso/domains/instances/compare/components/InstanceLogDetail.tsx index 05efaa8957..3edf4f4f09 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/compare/components/InstanceLogDetail.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/compare/components/InstanceLogDetail.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { useSafeIntl, diff --git a/hat/assets/js/apps/Iaso/domains/instances/compare/components/InstanceLogInfos.tsx b/hat/assets/js/apps/Iaso/domains/instances/compare/components/InstanceLogInfos.tsx index 5d084117f0..9a1402400d 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/compare/components/InstanceLogInfos.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/compare/components/InstanceLogInfos.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { useSafeIntl, diff --git a/hat/assets/js/apps/Iaso/domains/instances/compare/hooks/useGetInstanceLogs.ts b/hat/assets/js/apps/Iaso/domains/instances/compare/hooks/useGetInstanceLogs.ts index acf409a9b9..d8e3b7b024 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/compare/hooks/useGetInstanceLogs.ts +++ b/hat/assets/js/apps/Iaso/domains/instances/compare/hooks/useGetInstanceLogs.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import moment from 'moment'; import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/instances/components/InstanceDetailsLocksHistory.tsx b/hat/assets/js/apps/Iaso/domains/instances/components/InstanceDetailsLocksHistory.tsx index eb33744284..dd08570ce5 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/components/InstanceDetailsLocksHistory.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/components/InstanceDetailsLocksHistory.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { Grid, diff --git a/hat/assets/js/apps/Iaso/domains/instances/hooks/speedDialActions.tsx b/hat/assets/js/apps/Iaso/domains/instances/hooks/speedDialActions.tsx index 1d2ebd2339..7c8f8abc96 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/hooks/speedDialActions.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/hooks/speedDialActions.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { ReactElement, useCallback, useMemo } from 'react'; import DeleteIcon from '@mui/icons-material/Delete'; import EditLocationIcon from '@mui/icons-material/EditLocation'; diff --git a/hat/assets/js/apps/Iaso/domains/instances/types/instance.ts b/hat/assets/js/apps/Iaso/domains/instances/types/instance.ts index 3ad14cfe4c..6aaa47232e 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/types/instance.ts +++ b/hat/assets/js/apps/Iaso/domains/instances/types/instance.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Pagination } from 'bluesquare-components'; import { User } from '../../../utils/usersUtils'; import { Beneficiary } from '../../entities/types/beneficiary'; diff --git a/hat/assets/js/apps/Iaso/domains/instances/utils/index.tsx b/hat/assets/js/apps/Iaso/domains/instances/utils/index.tsx index 2b6c8195b6..3c75584fe0 100644 --- a/hat/assets/js/apps/Iaso/domains/instances/utils/index.tsx +++ b/hat/assets/js/apps/Iaso/domains/instances/utils/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import CallMade from '@mui/icons-material/CallMade'; import CompareArrowsIcon from '@mui/icons-material/CompareArrows'; import { Tooltip } from '@mui/material'; diff --git a/hat/assets/js/apps/Iaso/domains/modules/hooks/requests/useGetModules.ts b/hat/assets/js/apps/Iaso/domains/modules/hooks/requests/useGetModules.ts index b0cb3ef45d..168aa338bc 100644 --- a/hat/assets/js/apps/Iaso/domains/modules/hooks/requests/useGetModules.ts +++ b/hat/assets/js/apps/Iaso/domains/modules/hooks/requests/useGetModules.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { Pagination } from 'bluesquare-components'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/modules/types/modules.ts b/hat/assets/js/apps/Iaso/domains/modules/types/modules.ts index 3bb706e59a..a0eb4fab2b 100644 --- a/hat/assets/js/apps/Iaso/domains/modules/types/modules.ts +++ b/hat/assets/js/apps/Iaso/domains/modules/types/modules.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UrlParams } from 'bluesquare-components'; export type Module = { diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitInfos.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitInfos.tsx index dd215677c5..819deff19a 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitInfos.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitInfos.tsx @@ -1,5 +1,3 @@ -/* eslint-disable react/function-component-definition */ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { Box, Button, Grid } from '@mui/material'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitMultiReferenceInstances.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitMultiReferenceInstances.tsx index c52a598627..d3c0c9d793 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitMultiReferenceInstances.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/components/OrgUnitMultiReferenceInstances.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent, useState } from 'react'; import { Box, Grid } from '@mui/material'; import { makeStyles } from '@mui/styles'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Tables/EditableFieldsCell.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Tables/EditableFieldsCell.tsx index 4f086fb45c..f33773f921 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Tables/EditableFieldsCell.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/configuration/Tables/EditableFieldsCell.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, Chip } from '@mui/material'; import { textPlaceholder, useSafeIntl } from 'bluesquare-components'; import React, { useMemo } from 'react'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/details.js b/hat/assets/js/apps/Iaso/domains/orgUnits/details.js index 3ea26d0315..f532a22ad0 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/details.js +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/details.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, Grid, Tab, Tabs } from '@mui/material'; import { alpha } from '@mui/material/styles'; import { makeStyles } from '@mui/styles'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/types/Group.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/types/Group.ts index 0eb944cb9b..a6945b3fb8 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/types/Group.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/types/Group.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - export type Group = { id: string; name: string; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/types/GroupSet.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/types/GroupSet.ts index 5183655e8e..37d56223ae 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/types/GroupSet.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/types/GroupSet.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - import { Group } from './Group'; import { SourceVersion } from './SourceVersion'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/hooks/requests/useGetDataSources.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/hooks/requests/useGetDataSources.ts index fd6a0bda60..a9e0d989cb 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/hooks/requests/useGetDataSources.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/hooks/requests/useGetDataSources.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypes.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypes.ts index 1bc5e86bd6..99421abbd0 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypes.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypes.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; import { useSnackQuery } from '../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypesDropdownOptions.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypesDropdownOptions.ts index 4190b98f87..61ac022773 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypesDropdownOptions.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/orgUnitTypes/hooks/useGetOrgUnitTypesDropdownOptions.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesButtons.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesButtons.tsx index 8620432809..7769b1c3cf 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesButtons.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesButtons.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, Button } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; import React, { diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialog.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialog.tsx index 86cfef068e..b7f7273918 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialog.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { SimpleModal } from 'bluesquare-components'; import React, { Dispatch, diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialogButtons.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialogButtons.tsx index e318008c72..176f6b64f1 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialogButtons.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Components/ReviewOrgUnitChangesCommentDialogButtons.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, Button } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; import React, { diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTable.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTable.tsx index 9de27e03c9..71a2144ada 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTable.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTable.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Table, TableContainer } from '@mui/material'; import { LoadingSpinner } from 'bluesquare-components'; import React, { FunctionComponent } from 'react'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableHead.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableHead.tsx index 1a81066858..d31a19f4a0 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableHead.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableHead.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { useSafeIntl } from 'bluesquare-components'; import { Box, TableCell, TableHead, TableRow } from '@mui/material'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableRow.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableRow.tsx index f2298dca54..46fc1f7147 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableRow.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/Tables/details/ReviewOrgUnitChangesDetailsTableRow.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { TableCell } from '@mui/material'; import { makeStyles } from '@mui/styles'; import classNames from 'classnames'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/types.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/types.ts index 0110312d05..7e162e6ecf 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/types.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/reviewChanges/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Pagination, UrlParams } from 'bluesquare-components'; import { User } from '../../../utils/usersUtils'; import { OrgUnitStatus, ShortOrgUnit } from '../types/orgUnit'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/types/dataSources.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/types/dataSources.ts index 929744fad6..5df026c751 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/types/dataSources.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/types/dataSources.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - type Version = { number: number; description?: string; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/types/group.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/types/group.ts index 7abf170ca3..22d7f37dfa 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/types/group.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/types/group.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - export type Group = { id: string; name: string; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/types/orgUnit.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/types/orgUnit.ts index 699453cb9a..344022d598 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/types/orgUnit.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/types/orgUnit.ts @@ -7,7 +7,6 @@ import { DataSource } from './dataSources'; import { OrgunitType } from './orgunitTypes'; import { Shape } from './shapes'; -/* eslint-disable camelcase */ export type ShortOrgUnit = { name: string; id: number; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/types/orgunitTypes.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/types/orgunitTypes.ts index 0503001d51..52ac2fe2d3 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/types/orgunitTypes.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/types/orgunitTypes.ts @@ -1,7 +1,6 @@ import { Pagination, UrlParams } from 'bluesquare-components'; import { Form } from '../../forms/types/forms'; import { OrgUnit } from './orgUnit'; -/* eslint-disable camelcase */ type FeatureFlag = { id: number; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/types/saveMulti.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/types/saveMulti.ts index ce03dd8823..f1d93de215 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/types/saveMulti.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/types/saveMulti.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { OrgunitType } from './orgunitTypes'; import { Group } from './group'; import { Search } from './search'; diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/types/search.ts b/hat/assets/js/apps/Iaso/domains/orgUnits/types/search.ts index 8f98ddd4da..5bff3be9db 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/types/search.ts +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/types/search.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ export type Search = { search?: string; source?: string; diff --git a/hat/assets/js/apps/Iaso/domains/payments/components/PaymentLotActionCell.tsx b/hat/assets/js/apps/Iaso/domains/payments/components/PaymentLotActionCell.tsx index 69edb0afb1..efe8088736 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/components/PaymentLotActionCell.tsx +++ b/hat/assets/js/apps/Iaso/domains/payments/components/PaymentLotActionCell.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import FileDownloadIcon from '@mui/icons-material/FileDownload'; import SendIcon from '@mui/icons-material/Send'; import { ExternalLinkIconButton, IconButton } from 'bluesquare-components'; diff --git a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetPaymentLots.tsx b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetPaymentLots.tsx index a90a4e27d2..b87ad32b9d 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetPaymentLots.tsx +++ b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetPaymentLots.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { makeUrlWithParams } from '../../../../libs/utils'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetPotentialPayments.tsx b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetPotentialPayments.tsx index 8128f33f58..6aa34410eb 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetPotentialPayments.tsx +++ b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetPotentialPayments.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { makeUrlWithParams } from '../../../../libs/utils'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetSelectedPotentialPayments.tsx b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetSelectedPotentialPayments.tsx index 3efd96d3d9..cbbe36ac0e 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetSelectedPotentialPayments.tsx +++ b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useGetSelectedPotentialPayments.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { makeUrlWithParams } from '../../../../libs/utils'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useSavePaymentLot.ts b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useSavePaymentLot.ts index 53b2c9f1d4..900f168721 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useSavePaymentLot.ts +++ b/hat/assets/js/apps/Iaso/domains/payments/hooks/requests/useSavePaymentLot.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseMutationResult } from 'react-query'; import { patchRequest, postRequest } from '../../../../libs/Api'; import { useSnackMutation } from '../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/payments/types.ts b/hat/assets/js/apps/Iaso/domains/payments/types.ts index b9295b9712..f5c883ef16 100644 --- a/hat/assets/js/apps/Iaso/domains/payments/types.ts +++ b/hat/assets/js/apps/Iaso/domains/payments/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Pagination, UrlParams } from 'bluesquare-components'; import { TaskStatus } from '../tasks/types'; diff --git a/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetPlannings.ts b/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetPlannings.ts index ca45064490..91f37fd6d6 100644 --- a/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetPlannings.ts +++ b/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetPlannings.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Pagination } from 'bluesquare-components'; import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetTeams.ts b/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetTeams.ts index 716892bf61..9dd1f9233b 100644 --- a/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetTeams.ts +++ b/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useGetTeams.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; import { useSnackQuery } from '../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useSavePlanning.ts b/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useSavePlanning.ts index 7bffa9349b..f1b3083c34 100644 --- a/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useSavePlanning.ts +++ b/hat/assets/js/apps/Iaso/domains/plannings/hooks/requests/useSavePlanning.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import moment from 'moment'; import { UseMutationResult } from 'react-query'; import { patchRequest, postRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetEmptyInstanceOrgUnits.ts b/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetEmptyInstanceOrgUnits.ts index 88436533b5..86d7b97b51 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetEmptyInstanceOrgUnits.ts +++ b/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetEmptyInstanceOrgUnits.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getSort } from 'bluesquare-components'; diff --git a/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetInstances.tsx b/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetInstances.tsx index af7bebdc55..07b7258970 100644 --- a/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetInstances.tsx +++ b/hat/assets/js/apps/Iaso/domains/registry/hooks/useGetInstances.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getSort } from 'bluesquare-components'; diff --git a/hat/assets/js/apps/Iaso/domains/setup/hooks/useSaveAccount.ts b/hat/assets/js/apps/Iaso/domains/setup/hooks/useSaveAccount.ts index dd8508de1b..6df8a7417a 100644 --- a/hat/assets/js/apps/Iaso/domains/setup/hooks/useSaveAccount.ts +++ b/hat/assets/js/apps/Iaso/domains/setup/hooks/useSaveAccount.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseMutationResult } from 'react-query'; import { postRequest } from '../../../libs/Api'; import { useSnackMutation } from '../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/setup/types/account.ts b/hat/assets/js/apps/Iaso/domains/setup/types/account.ts index 507851f20c..a8439dd5d2 100644 --- a/hat/assets/js/apps/Iaso/domains/setup/types/account.ts +++ b/hat/assets/js/apps/Iaso/domains/setup/types/account.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ export type SaveAccountQuery = { account_name: string; user_username: string; diff --git a/hat/assets/js/apps/Iaso/domains/storages/config.tsx b/hat/assets/js/apps/Iaso/domains/storages/config.tsx index 08d796432a..c72ef8569d 100644 --- a/hat/assets/js/apps/Iaso/domains/storages/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/storages/config.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React from 'react'; import { useSafeIntl, @@ -41,7 +40,7 @@ export const useGetColumns = (params: StorageParams): Array => { width: 80, Cell: settings => { const { storage_id } = settings.row.original; - return <>{storage_id || '--'}; + return {storage_id || '--'}; }, }, { @@ -92,7 +91,7 @@ export const useGetColumns = (params: StorageParams): Array => { id: 'type', Cell: settings => { const { storage_type } = settings.row.original; - return <>{storage_type || '--'}; + return {storage_type || '--'}; }, }); } diff --git a/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useGetStorageLogs.ts b/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useGetStorageLogs.ts index e92af7a64c..03a2b8c6f0 100644 --- a/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useGetStorageLogs.ts +++ b/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useGetStorageLogs.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; import { useSnackQuery } from '../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useGetStorages.ts b/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useGetStorages.ts index 068a112198..05cbb4c053 100644 --- a/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useGetStorages.ts +++ b/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useGetStorages.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; import { useSnackQuery } from '../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useSaveStatus.tsx b/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useSaveStatus.tsx index 9cba867e4c..4dd28b1b0f 100644 --- a/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useSaveStatus.tsx +++ b/hat/assets/js/apps/Iaso/domains/storages/hooks/requests/useSaveStatus.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseMutationResult } from 'react-query'; import { postRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/storages/types/storages.ts b/hat/assets/js/apps/Iaso/domains/storages/types/storages.ts index fba0f8f4a4..2b9b394211 100644 --- a/hat/assets/js/apps/Iaso/domains/storages/types/storages.ts +++ b/hat/assets/js/apps/Iaso/domains/storages/types/storages.ts @@ -1,6 +1,4 @@ -/* eslint-disable camelcase */ import { Pagination, UrlParams } from 'bluesquare-components'; - import { Profile } from '../../../utils/usersUtils'; import { ShortOrgUnit } from '../../orgUnits/types/orgUnit'; diff --git a/hat/assets/js/apps/Iaso/domains/tasks/components/TaskDetails.tsx b/hat/assets/js/apps/Iaso/domains/tasks/components/TaskDetails.tsx index bdd5330048..3898f22dcc 100644 --- a/hat/assets/js/apps/Iaso/domains/tasks/components/TaskDetails.tsx +++ b/hat/assets/js/apps/Iaso/domains/tasks/components/TaskDetails.tsx @@ -1,12 +1,13 @@ -/* eslint-disable camelcase */ import { defineMessages } from 'react-intl'; import React, { FunctionComponent } from 'react'; import { useQuery } from 'react-query'; import { Button, Container } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; - +// @ts-ignore import { Task } from 'Iaso/domains/tasks/types'; +// @ts-ignore import { getRequest } from 'Iaso/libs/Api'; +import { SxStyles } from '../../../types/general'; const styles: SxStyles = { root: { diff --git a/hat/assets/js/apps/Iaso/domains/tasks/types.ts b/hat/assets/js/apps/Iaso/domains/tasks/types.ts index dc0bf8ba0c..dfba884bbf 100644 --- a/hat/assets/js/apps/Iaso/domains/tasks/types.ts +++ b/hat/assets/js/apps/Iaso/domains/tasks/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Nullable } from '../../types/utils'; export type TaskStatus = diff --git a/hat/assets/js/apps/Iaso/domains/teams/hooks/requests/useGetTeams.ts b/hat/assets/js/apps/Iaso/domains/teams/hooks/requests/useGetTeams.ts index 23b2f99ef6..7b53283c91 100644 --- a/hat/assets/js/apps/Iaso/domains/teams/hooks/requests/useGetTeams.ts +++ b/hat/assets/js/apps/Iaso/domains/teams/hooks/requests/useGetTeams.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { Pagination } from 'bluesquare-components'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/teams/hooks/requests/useSaveTeam.ts b/hat/assets/js/apps/Iaso/domains/teams/hooks/requests/useSaveTeam.ts index 199a57de5d..7f891d17ce 100644 --- a/hat/assets/js/apps/Iaso/domains/teams/hooks/requests/useSaveTeam.ts +++ b/hat/assets/js/apps/Iaso/domains/teams/hooks/requests/useSaveTeam.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseMutationResult } from 'react-query'; import { patchRequest, postRequest } from '../../../../libs/Api'; import { useSnackMutation } from '../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/teams/types/profile.ts b/hat/assets/js/apps/Iaso/domains/teams/types/profile.ts index 0e33c0bb7e..848ba58f72 100644 --- a/hat/assets/js/apps/Iaso/domains/teams/types/profile.ts +++ b/hat/assets/js/apps/Iaso/domains/teams/types/profile.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ export type Profile = { id: string; first_name: string; diff --git a/hat/assets/js/apps/Iaso/domains/teams/types/team.ts b/hat/assets/js/apps/Iaso/domains/teams/types/team.ts index aae3ec7626..7061c9e138 100644 --- a/hat/assets/js/apps/Iaso/domains/teams/types/team.ts +++ b/hat/assets/js/apps/Iaso/domains/teams/types/team.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UrlParams } from 'bluesquare-components'; import { TeamType } from '../constants'; diff --git a/hat/assets/js/apps/Iaso/domains/userRoles/hooks/requests/useGetUserRoles.ts b/hat/assets/js/apps/Iaso/domains/userRoles/hooks/requests/useGetUserRoles.ts index 2d5450edd0..f4a03ad001 100644 --- a/hat/assets/js/apps/Iaso/domains/userRoles/hooks/requests/useGetUserRoles.ts +++ b/hat/assets/js/apps/Iaso/domains/userRoles/hooks/requests/useGetUserRoles.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { Pagination } from 'bluesquare-components'; import { getRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/userRoles/hooks/requests/useSaveUserRole.ts b/hat/assets/js/apps/Iaso/domains/userRoles/hooks/requests/useSaveUserRole.ts index a26b7d2873..eceabfe31c 100644 --- a/hat/assets/js/apps/Iaso/domains/userRoles/hooks/requests/useSaveUserRole.ts +++ b/hat/assets/js/apps/Iaso/domains/userRoles/hooks/requests/useSaveUserRole.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseMutationResult } from 'react-query'; import { isEmpty } from 'lodash'; import { putRequest, postRequest } from '../../../../libs/Api'; diff --git a/hat/assets/js/apps/Iaso/domains/userRoles/types/userRoles.ts b/hat/assets/js/apps/Iaso/domains/userRoles/types/userRoles.ts index e8ac5dd016..1f6bda28e9 100644 --- a/hat/assets/js/apps/Iaso/domains/userRoles/types/userRoles.ts +++ b/hat/assets/js/apps/Iaso/domains/userRoles/types/userRoles.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UrlParams } from 'bluesquare-components'; export type UserRole = { diff --git a/hat/assets/js/apps/Iaso/domains/users/components/ExportMobileAppSetupDialog.tsx b/hat/assets/js/apps/Iaso/domains/users/components/ExportMobileAppSetupDialog.tsx index 219f5a1337..b33892ddfa 100644 --- a/hat/assets/js/apps/Iaso/domains/users/components/ExportMobileAppSetupDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/users/components/ExportMobileAppSetupDialog.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent, useCallback, @@ -25,6 +24,7 @@ import { getRequest } from 'Iaso/libs/Api'; import { TaskApiResponse } from 'Iaso/domains/tasks/types'; import { Project, User } from 'Iaso/utils/usersUtils'; import MESSAGES from '../messages'; +import { SxStyles } from '../../../types/general'; const styles: SxStyles = { progressWrapper: { diff --git a/hat/assets/js/apps/Iaso/domains/users/components/UsersDialog.tsx b/hat/assets/js/apps/Iaso/domains/users/components/UsersDialog.tsx index 3fd16c6c9a..57ebd2d053 100644 --- a/hat/assets/js/apps/Iaso/domains/users/components/UsersDialog.tsx +++ b/hat/assets/js/apps/Iaso/domains/users/components/UsersDialog.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Tab, Tabs } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { diff --git a/hat/assets/js/apps/Iaso/domains/users/types.ts b/hat/assets/js/apps/Iaso/domains/users/types.ts index 32be5522ac..694a8480b8 100644 --- a/hat/assets/js/apps/Iaso/domains/users/types.ts +++ b/hat/assets/js/apps/Iaso/domains/users/types.ts @@ -2,7 +2,6 @@ import { Profile, User } from '../../utils/usersUtils'; import { Project } from '../projects/types/project'; import { UserRole } from '../userRoles/types/userRoles'; -/* eslint-disable camelcase */ export type ValueAndErrors = { value: T; errors: string[]; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/config/changes.tsx b/hat/assets/js/apps/Iaso/domains/workflows/config/changes.tsx index e1d7b73ad8..c2ddf17408 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/config/changes.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/config/changes.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Column, IconButton, diff --git a/hat/assets/js/apps/Iaso/domains/workflows/config/followUps.tsx b/hat/assets/js/apps/Iaso/domains/workflows/config/followUps.tsx index c52a9a2802..373ab6395d 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/config/followUps.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/config/followUps.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box } from '@mui/material'; import { Column, diff --git a/hat/assets/js/apps/Iaso/domains/workflows/config/index.tsx b/hat/assets/js/apps/Iaso/domains/workflows/config/index.tsx index 97dd3b3a80..6d8bb602e6 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/config/index.tsx +++ b/hat/assets/js/apps/Iaso/domains/workflows/config/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React from 'react'; import { useSafeIntl, Column, IntlFormatMessage } from 'bluesquare-components'; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersionChanges.ts b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersionChanges.ts index 85f96c16ec..d8e057e419 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersionChanges.ts +++ b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersionChanges.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; import { useSnackQuery } from '../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersions.ts b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersions.ts index 5c6a7b7a3c..a941b88a06 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersions.ts +++ b/hat/assets/js/apps/Iaso/domains/workflows/hooks/requests/useGetWorkflowVersions.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../libs/Api'; import { useSnackQuery } from '../../../../libs/apiHooks'; diff --git a/hat/assets/js/apps/Iaso/domains/workflows/types.ts b/hat/assets/js/apps/Iaso/domains/workflows/types.ts index b8bedf1ed6..f0d07a2c89 100644 --- a/hat/assets/js/apps/Iaso/domains/workflows/types.ts +++ b/hat/assets/js/apps/Iaso/domains/workflows/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Pagination, UrlParams } from 'bluesquare-components'; import { EntityType } from '../entities/entityTypes/types/entityType'; import { FieldType } from '../forms/types/forms'; diff --git a/hat/assets/js/apps/Iaso/libs/Api.ts b/hat/assets/js/apps/Iaso/libs/Api.ts index 1498860c9e..623156e1b9 100644 --- a/hat/assets/js/apps/Iaso/libs/Api.ts +++ b/hat/assets/js/apps/Iaso/libs/Api.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import moment from 'moment'; import { PostArg } from '../types/general'; diff --git a/hat/assets/js/apps/Iaso/utils/usersUtils.ts b/hat/assets/js/apps/Iaso/utils/usersUtils.ts index 30761c5ff2..b20cede3f5 100644 --- a/hat/assets/js/apps/Iaso/utils/usersUtils.ts +++ b/hat/assets/js/apps/Iaso/utils/usersUtils.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { LangOptions } from 'bluesquare-components'; import { useQueryClient } from 'react-query'; import { OrgUnitStatus } from '../domains/orgUnits/types/orgUnit'; diff --git a/plugins/polio/js/src/constants/types.ts b/plugins/polio/js/src/constants/types.ts index 8e84c63da6..9861ae1235 100644 --- a/plugins/polio/js/src/constants/types.ts +++ b/plugins/polio/js/src/constants/types.ts @@ -7,7 +7,6 @@ import { Profile } from '../../../../../hat/assets/js/apps/Iaso/utils/usersUtils import { ReasonForDelay } from '../domains/Campaigns/Rounds/ReasonForDelayModal/hooks/reasons'; import { SubActivityFormValues } from '../domains/Campaigns/SubActivities/types'; -/* eslint-disable camelcase */ export type FormatForNFMArgs = { data?: Record; campaign?: string; diff --git a/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetails.tsx b/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetails.tsx index 973c92cd70..f63ff836df 100644 --- a/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetails.tsx +++ b/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetails.tsx @@ -1,5 +1,3 @@ -/* eslint-disable react/no-array-index-key */ -/* eslint-disable camelcase */ import React, { FunctionComponent, useCallback, @@ -44,7 +42,9 @@ type BudgetProcessDetailsParams = { const baseUrl = baseUrls.budgetDetails; export const BudgetProcessDetails: FunctionComponent = () => { - const params = useParamsObject(baseUrl) as BudgetProcessDetailsParams; + const params = useParamsObject( + baseUrl, + ) as unknown as BudgetProcessDetailsParams; const goBack = useGoBack(baseUrls.budget); const redirectToReplace = useRedirectToReplace(); const classes = useStyles(); diff --git a/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsFilters.tsx b/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsFilters.tsx index 2445deff6e..5815a31883 100644 --- a/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsFilters.tsx +++ b/plugins/polio/js/src/domains/Budget/BudgetDetails/BudgetDetailsFilters.tsx @@ -1,5 +1,3 @@ -/* eslint-disable react/require-default-props */ -/* eslint-disable camelcase */ import { Box, Grid, useMediaQuery, useTheme } from '@mui/material'; import { UrlParams, useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent } from 'react'; diff --git a/plugins/polio/js/src/domains/Budget/BudgetFilters.tsx b/plugins/polio/js/src/domains/Budget/BudgetFilters.tsx index 89071cd891..c20fadd5bc 100644 --- a/plugins/polio/js/src/domains/Budget/BudgetFilters.tsx +++ b/plugins/polio/js/src/domains/Budget/BudgetFilters.tsx @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ -/* eslint-disable react/require-default-props */ import { Box, Grid, useMediaQuery, useTheme } from '@mui/material'; import React, { FunctionComponent, useState } from 'react'; import { UrlParams } from 'bluesquare-components'; diff --git a/plugins/polio/js/src/domains/Budget/CreateBudgetStep/CreateBudgetStep.tsx b/plugins/polio/js/src/domains/Budget/CreateBudgetStep/CreateBudgetStep.tsx index 59182f449d..5c5ab142e9 100644 --- a/plugins/polio/js/src/domains/Budget/CreateBudgetStep/CreateBudgetStep.tsx +++ b/plugins/polio/js/src/domains/Budget/CreateBudgetStep/CreateBudgetStep.tsx @@ -1,6 +1,3 @@ -/* eslint-disable camelcase */ -/* eslint-disable react/require-default-props */ -/* eslint-disable react/no-unused-prop-types */ import React, { FunctionComponent, useCallback, diff --git a/plugins/polio/js/src/domains/Budget/CreateBudgetStep/CreateOverrideStep.tsx b/plugins/polio/js/src/domains/Budget/CreateBudgetStep/CreateOverrideStep.tsx index b5f0d99948..d0f450ef5e 100644 --- a/plugins/polio/js/src/domains/Budget/CreateBudgetStep/CreateOverrideStep.tsx +++ b/plugins/polio/js/src/domains/Budget/CreateBudgetStep/CreateOverrideStep.tsx @@ -1,6 +1,3 @@ -/* eslint-disable camelcase */ -/* eslint-disable react/require-default-props */ -/* eslint-disable react/no-unused-prop-types */ import React, { FunctionComponent, useCallback, @@ -41,7 +38,6 @@ type Props = { closeDialog: () => void; isOpen: boolean; id?: string; - isMobileLayout?: boolean; requiredFields?: string[]; params: Record; recipients?: number[]; // team ids diff --git a/plugins/polio/js/src/domains/Budget/cards/BudgetCard.tsx b/plugins/polio/js/src/domains/Budget/cards/BudgetCard.tsx index 944da66cfa..ade97f8cd4 100644 --- a/plugins/polio/js/src/domains/Budget/cards/BudgetCard.tsx +++ b/plugins/polio/js/src/domains/Budget/cards/BudgetCard.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { Typography, diff --git a/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudget.ts b/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudget.ts index c97525359e..3efe7cd9bd 100644 --- a/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudget.ts +++ b/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudget.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { groupBy } from 'lodash'; import { useMemo } from 'react'; import { UseQueryResult } from 'react-query'; diff --git a/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudgetDetails.ts b/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudgetDetails.ts index bf67dacd28..e8c147c1f8 100644 --- a/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudgetDetails.ts +++ b/plugins/polio/js/src/domains/Budget/hooks/api/useGetBudgetDetails.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Paginated } from 'bluesquare-components'; import { UseMutationResult, UseQueryResult } from 'react-query'; import { diff --git a/plugins/polio/js/src/domains/Budget/hooks/api/useSaveBudgetStep.tsx b/plugins/polio/js/src/domains/Budget/hooks/api/useSaveBudgetStep.tsx index 7536c7d027..e28a2e3cea 100644 --- a/plugins/polio/js/src/domains/Budget/hooks/api/useSaveBudgetStep.tsx +++ b/plugins/polio/js/src/domains/Budget/hooks/api/useSaveBudgetStep.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { postRequest } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/Api'; import { useSnackMutation } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/apiHooks'; import { PostArg } from '../../../../../../../../hat/assets/js/apps/Iaso/types/general'; diff --git a/plugins/polio/js/src/domains/Budget/hooks/api/useSaveOverrideStep.ts b/plugins/polio/js/src/domains/Budget/hooks/api/useSaveOverrideStep.ts index 0c82b0daed..500cac889a 100644 --- a/plugins/polio/js/src/domains/Budget/hooks/api/useSaveOverrideStep.ts +++ b/plugins/polio/js/src/domains/Budget/hooks/api/useSaveOverrideStep.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { postRequest } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/Api'; import { useSnackMutation } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/apiHooks'; import { PostArg } from '../../../../../../../../hat/assets/js/apps/Iaso/types/general'; diff --git a/plugins/polio/js/src/domains/Budget/hooks/config.tsx b/plugins/polio/js/src/domains/Budget/hooks/config.tsx index 4e4ce25d0b..519c540c4e 100644 --- a/plugins/polio/js/src/domains/Budget/hooks/config.tsx +++ b/plugins/polio/js/src/domains/Budget/hooks/config.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { useMemo, useState } from 'react'; import { useSafeIntl, diff --git a/plugins/polio/js/src/domains/Budget/types.ts b/plugins/polio/js/src/domains/Budget/types.ts index a17852930b..4422e76e09 100644 --- a/plugins/polio/js/src/domains/Budget/types.ts +++ b/plugins/polio/js/src/domains/Budget/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Nullable, Optional, diff --git a/plugins/polio/js/src/domains/Budget/utils.tsx b/plugins/polio/js/src/domains/Budget/utils.tsx index 3ad3827d6c..9bab5a79e6 100644 --- a/plugins/polio/js/src/domains/Budget/utils.tsx +++ b/plugins/polio/js/src/domains/Budget/utils.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Typography } from '@mui/material'; import React from 'react'; import { Link } from 'react-router-dom'; diff --git a/plugins/polio/js/src/domains/Calendar/Calendar.tsx b/plugins/polio/js/src/domains/Calendar/Calendar.tsx index eadda8663c..778d928eba 100644 --- a/plugins/polio/js/src/domains/Calendar/Calendar.tsx +++ b/plugins/polio/js/src/domains/Calendar/Calendar.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, Grid, Theme, Typography } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { diff --git a/plugins/polio/js/src/domains/Calendar/campaignCalendar/TogglePeriod.tsx b/plugins/polio/js/src/domains/Calendar/campaignCalendar/TogglePeriod.tsx index 5499d29a44..3e628bed84 100644 --- a/plugins/polio/js/src/domains/Calendar/campaignCalendar/TogglePeriod.tsx +++ b/plugins/polio/js/src/domains/Calendar/campaignCalendar/TogglePeriod.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent, useCallback } from 'react'; import { ToggleButton, ToggleButtonGroup } from '@mui/material'; import { useRedirectToReplace } from 'bluesquare-components'; diff --git a/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/CalendarMapPanesMerged.tsx b/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/CalendarMapPanesMerged.tsx index a1228639e7..e61dd1cb4e 100644 --- a/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/CalendarMapPanesMerged.tsx +++ b/plugins/polio/js/src/domains/Calendar/campaignCalendar/map/CalendarMapPanesMerged.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { GeoJSON, Pane } from 'react-leaflet'; diff --git a/plugins/polio/js/src/domains/Calendar/campaignCalendar/types.ts b/plugins/polio/js/src/domains/Calendar/campaignCalendar/types.ts index a32d734690..853875390a 100644 --- a/plugins/polio/js/src/domains/Calendar/campaignCalendar/types.ts +++ b/plugins/polio/js/src/domains/Calendar/campaignCalendar/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Moment } from 'moment'; import { User } from '../../../../../../../hat/assets/js/apps/Iaso/utils/usersUtils'; import { Campaign, MergedShape, Scope, Shape } from '../../../constants/types'; diff --git a/plugins/polio/js/src/domains/Calendar/campaignCalendar/utils.tsx b/plugins/polio/js/src/domains/Calendar/campaignCalendar/utils.tsx index 7eda363d63..60beef6711 100644 --- a/plugins/polio/js/src/domains/Calendar/campaignCalendar/utils.tsx +++ b/plugins/polio/js/src/domains/Calendar/campaignCalendar/utils.tsx @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ -/* eslint-disable react/no-array-index-key */ import moment, { Moment } from 'moment'; import React, { ReactElement } from 'react'; import { colsCounts, dateFormat } from './constants'; diff --git a/plugins/polio/js/src/domains/Campaigns/BaseInfo/BaseInfoForm.tsx b/plugins/polio/js/src/domains/Campaigns/BaseInfo/BaseInfoForm.tsx index 3a0562286a..0aa57eecd9 100644 --- a/plugins/polio/js/src/domains/Campaigns/BaseInfo/BaseInfoForm.tsx +++ b/plugins/polio/js/src/domains/Campaigns/BaseInfo/BaseInfoForm.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, Grid } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; import { Field, useFormikContext } from 'formik'; diff --git a/plugins/polio/js/src/domains/Campaigns/CampaignsList/Dashboard.tsx b/plugins/polio/js/src/domains/Campaigns/CampaignsList/Dashboard.tsx index ef81091308..2032a32a15 100644 --- a/plugins/polio/js/src/domains/Campaigns/CampaignsList/Dashboard.tsx +++ b/plugins/polio/js/src/domains/Campaigns/CampaignsList/Dashboard.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; import React, { FunctionComponent, useMemo } from 'react'; diff --git a/plugins/polio/js/src/domains/Campaigns/Evaluations/EvaluationsForms.tsx b/plugins/polio/js/src/domains/Campaigns/Evaluations/EvaluationsForms.tsx index 2016584052..1c8a6b6858 100644 --- a/plugins/polio/js/src/domains/Campaigns/Evaluations/EvaluationsForms.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Evaluations/EvaluationsForms.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { TabContext, TabList } from '@mui/lab'; import { Box, Tab } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; diff --git a/plugins/polio/js/src/domains/Campaigns/MapComponent/MapComponent.js b/plugins/polio/js/src/domains/Campaigns/MapComponent/MapComponent.js index 1cdfe031b5..8dd35c3804 100644 --- a/plugins/polio/js/src/domains/Campaigns/MapComponent/MapComponent.js +++ b/plugins/polio/js/src/domains/Campaigns/MapComponent/MapComponent.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { useMemo } from 'react'; import { TileLayer, MapContainer, GeoJSON, Tooltip, Pane } from 'react-leaflet'; import 'leaflet/dist/leaflet.css'; diff --git a/plugins/polio/js/src/domains/Campaigns/Preparedness/PreparednessConfig.js b/plugins/polio/js/src/domains/Campaigns/Preparedness/PreparednessConfig.js index 98cd705d29..d4c34ad4d9 100644 --- a/plugins/polio/js/src/domains/Campaigns/Preparedness/PreparednessConfig.js +++ b/plugins/polio/js/src/domains/Campaigns/Preparedness/PreparednessConfig.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Button, CircularProgress, diff --git a/plugins/polio/js/src/domains/Campaigns/Preparedness/PreparednessForm.js b/plugins/polio/js/src/domains/Campaigns/Preparedness/PreparednessForm.js index a6b7234041..d6544ca97b 100644 --- a/plugins/polio/js/src/domains/Campaigns/Preparedness/PreparednessForm.js +++ b/plugins/polio/js/src/domains/Campaigns/Preparedness/PreparednessForm.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Tab, Box } from '@mui/material'; import { useFormikContext } from 'formik'; import React, { useState } from 'react'; diff --git a/plugins/polio/js/src/domains/Campaigns/Preparedness/hooks/useGetPreparednessData.js b/plugins/polio/js/src/domains/Campaigns/Preparedness/hooks/useGetPreparednessData.js index d364f49ad2..6d1a22dff5 100644 --- a/plugins/polio/js/src/domains/Campaigns/Preparedness/hooks/useGetPreparednessData.js +++ b/plugins/polio/js/src/domains/Campaigns/Preparedness/hooks/useGetPreparednessData.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ // @ts-ignore import { useSnackMutation, useSnackQuery } from 'Iaso/libs/apiHooks.ts'; // @ts-ignore diff --git a/plugins/polio/js/src/domains/Campaigns/Rounds/ReasonForDelayModal/validation.ts b/plugins/polio/js/src/domains/Campaigns/Rounds/ReasonForDelayModal/validation.ts index b9bf52b9b3..ad6bd8eece 100644 --- a/plugins/polio/js/src/domains/Campaigns/Rounds/ReasonForDelayModal/validation.ts +++ b/plugins/polio/js/src/domains/Campaigns/Rounds/ReasonForDelayModal/validation.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { useSafeIntl } from 'bluesquare-components'; import moment from 'moment'; import * as yup from 'yup'; diff --git a/plugins/polio/js/src/domains/Campaigns/Rounds/RoundDates/RoundDates.tsx b/plugins/polio/js/src/domains/Campaigns/Rounds/RoundDates/RoundDates.tsx index 95a2953ae6..3a9814e091 100644 --- a/plugins/polio/js/src/domains/Campaigns/Rounds/RoundDates/RoundDates.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Rounds/RoundDates/RoundDates.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, Divider, Grid, Typography } from '@mui/material'; import { textPlaceholder, useSafeIntl } from 'bluesquare-components'; import { Field, FormikProvider, useFormik, useFormikContext } from 'formik'; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/ScopeForm.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/ScopeForm.tsx index bd7221b060..b1cf564c17 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/ScopeForm.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/ScopeForm.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Field, useFormikContext } from 'formik'; import React, { FunctionComponent, useMemo, useState } from 'react'; import { useDebounce } from 'use-debounce'; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/ScopeInput.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/ScopeInput.tsx index b4c0493ce8..9ae13001c9 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/ScopeInput.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/ScopeInput.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, FormControlLabel, FormGroup, Grid, Switch } from '@mui/material'; import { LoadingSpinner, useSafeIntl } from 'bluesquare-components'; import { FieldProps, useField } from 'formik'; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/DistrictScopeTable.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/DistrictScopeTable.tsx index 078e8de163..708a28aa07 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/DistrictScopeTable.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/DistrictScopeTable.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import MapIcon from '@mui/icons-material/Map'; import { Box, diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeMapLegend.tsx b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeMapLegend.tsx index 63fbfe5dca..abd16d8e14 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeMapLegend.tsx +++ b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/ScopeMapLegend.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, FormControl, List, ListItem } from '@mui/material'; import { useSafeIntl } from 'bluesquare-components'; import { FieldInputProps } from 'formik'; diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/types.ts b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/types.ts index 1e0a364b1d..3e0b14484b 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/types.ts +++ b/plugins/polio/js/src/domains/Campaigns/Scope/Scopes/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { OrgUnit, OrgUnitStatus, diff --git a/plugins/polio/js/src/domains/Campaigns/Scope/hooks/useGetParentOrgUnit.ts b/plugins/polio/js/src/domains/Campaigns/Scope/hooks/useGetParentOrgUnit.ts index f495bc57b9..3482447e0a 100644 --- a/plugins/polio/js/src/domains/Campaigns/Scope/hooks/useGetParentOrgUnit.ts +++ b/plugins/polio/js/src/domains/Campaigns/Scope/hooks/useGetParentOrgUnit.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; // @ts-ignore import { useSnackQuery } from 'Iaso/libs/apiHooks'; diff --git a/plugins/polio/js/src/domains/Campaigns/campaignHistory/CampaignHistory.tsx b/plugins/polio/js/src/domains/Campaigns/campaignHistory/CampaignHistory.tsx index 4d45a85fad..8f7103a05a 100644 --- a/plugins/polio/js/src/domains/Campaigns/campaignHistory/CampaignHistory.tsx +++ b/plugins/polio/js/src/domains/Campaigns/campaignHistory/CampaignHistory.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { useState, useEffect, @@ -47,7 +46,7 @@ const campaignUrl = baseUrls.campaigns; export const CampaignHistory: FunctionComponent = () => { const { formatMessage } = useSafeIntl(); const classes: Record = useStyles(); - const params = useParamsObject(baseUrl) as Params; + const params = useParamsObject(baseUrl) as unknown as Params; const goBack = useGoBack(campaignUrl); const redirectToReplace = useRedirectToReplace(); const { diff --git a/plugins/polio/js/src/domains/Campaigns/campaignHistory/Head.tsx b/plugins/polio/js/src/domains/Campaigns/campaignHistory/Head.tsx index 50649b7591..77b4706ca8 100644 --- a/plugins/polio/js/src/domains/Campaigns/campaignHistory/Head.tsx +++ b/plugins/polio/js/src/domains/Campaigns/campaignHistory/Head.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { useSafeIntl } from 'bluesquare-components'; diff --git a/plugins/polio/js/src/domains/Campaigns/campaignHistory/hooks/useGetCampaignHistory.ts b/plugins/polio/js/src/domains/Campaigns/campaignHistory/hooks/useGetCampaignHistory.ts index 59ef3bfbe3..fe0809d317 100644 --- a/plugins/polio/js/src/domains/Campaigns/campaignHistory/hooks/useGetCampaignHistory.ts +++ b/plugins/polio/js/src/domains/Campaigns/campaignHistory/hooks/useGetCampaignHistory.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import moment from 'moment'; import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/Api'; diff --git a/plugins/polio/js/src/domains/Campaigns/hooks/api/useGetCampaigns.ts b/plugins/polio/js/src/domains/Campaigns/hooks/api/useGetCampaigns.ts index b0429d82ba..83e0cbb849 100644 --- a/plugins/polio/js/src/domains/Campaigns/hooks/api/useGetCampaigns.ts +++ b/plugins/polio/js/src/domains/Campaigns/hooks/api/useGetCampaigns.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { useMemo } from 'react'; import { QueryKey, UseQueryResult } from 'react-query'; import { getRequest } from '../../../../../../../../hat/assets/js/apps/Iaso/libs/Api'; diff --git a/plugins/polio/js/src/domains/Chronogram/Chronogram/types.ts b/plugins/polio/js/src/domains/Chronogram/Chronogram/types.ts index 137ae65c2a..bf9552320d 100644 --- a/plugins/polio/js/src/domains/Chronogram/Chronogram/types.ts +++ b/plugins/polio/js/src/domains/Chronogram/Chronogram/types.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - import { User, DropdownOptions } from '../types'; export type ChronogramParams = { diff --git a/plugins/polio/js/src/domains/Chronogram/ChronogramDetails/types.ts b/plugins/polio/js/src/domains/Chronogram/ChronogramDetails/types.ts index f048221968..2fb2a7143a 100644 --- a/plugins/polio/js/src/domains/Chronogram/ChronogramDetails/types.ts +++ b/plugins/polio/js/src/domains/Chronogram/ChronogramDetails/types.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - import { ChronogramTask } from '../Chronogram/types'; export type ChronogramTasksParams = { diff --git a/plugins/polio/js/src/domains/Chronogram/ChronogramTemplateTask/types.ts b/plugins/polio/js/src/domains/Chronogram/ChronogramTemplateTask/types.ts index 6b2c6b882b..189543070f 100644 --- a/plugins/polio/js/src/domains/Chronogram/ChronogramTemplateTask/types.ts +++ b/plugins/polio/js/src/domains/Chronogram/ChronogramTemplateTask/types.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - import { User } from '../types'; export type ChronogramTemplateTaskParams = { diff --git a/plugins/polio/js/src/domains/Chronogram/types.ts b/plugins/polio/js/src/domains/Chronogram/types.ts index c2d31d09bb..f0002599e4 100644 --- a/plugins/polio/js/src/domains/Chronogram/types.ts +++ b/plugins/polio/js/src/domains/Chronogram/types.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - export type DropdownOptions = { label: string; value: number | string; diff --git a/plugins/polio/js/src/domains/LQAS-IM/LQAS/Graphs/CaregiverInfoSource.tsx b/plugins/polio/js/src/domains/LQAS-IM/LQAS/Graphs/CaregiverInfoSource.tsx index 682540627c..9966c0d4dc 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/LQAS/Graphs/CaregiverInfoSource.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/LQAS/Graphs/CaregiverInfoSource.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { useSafeIntl } from 'bluesquare-components'; diff --git a/plugins/polio/js/src/domains/LQAS-IM/shared/LqasIm.tsx b/plugins/polio/js/src/domains/LQAS-IM/shared/LqasIm.tsx index 49daab3ff0..8ab43c7f0d 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/shared/LqasIm.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/shared/LqasIm.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { IntlFormatMessage } from 'bluesquare-components'; import { BarChartData, diff --git a/plugins/polio/js/src/domains/LQAS-IM/shared/Map/ScopeAndDNFDisclaimer.tsx b/plugins/polio/js/src/domains/LQAS-IM/shared/Map/ScopeAndDNFDisclaimer.tsx index ffdbde88c1..7ab5d5eddc 100644 --- a/plugins/polio/js/src/domains/LQAS-IM/shared/Map/ScopeAndDNFDisclaimer.tsx +++ b/plugins/polio/js/src/domains/LQAS-IM/shared/Map/ScopeAndDNFDisclaimer.tsx @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ -/* eslint-disable react/require-default-props */ import { Box, Grid, Typography } from '@mui/material'; import { makeStyles } from '@mui/styles'; import React, { FunctionComponent } from 'react'; diff --git a/plugins/polio/js/src/domains/Notifications/Modals/NotificationsCreateEditModal.tsx b/plugins/polio/js/src/domains/Notifications/Modals/NotificationsCreateEditModal.tsx index e4e3128908..f517a198f1 100644 --- a/plugins/polio/js/src/domains/Notifications/Modals/NotificationsCreateEditModal.tsx +++ b/plugins/polio/js/src/domains/Notifications/Modals/NotificationsCreateEditModal.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { AddButton, diff --git a/plugins/polio/js/src/domains/Notifications/hooks/validation.ts b/plugins/polio/js/src/domains/Notifications/hooks/validation.ts index 62bb9de8ef..2da499f8b7 100644 --- a/plugins/polio/js/src/domains/Notifications/hooks/validation.ts +++ b/plugins/polio/js/src/domains/Notifications/hooks/validation.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import * as yup from 'yup'; import { mixed, object, ObjectSchema } from 'yup'; import { useMemo } from 'react'; diff --git a/plugins/polio/js/src/domains/Notifications/types.ts b/plugins/polio/js/src/domains/Notifications/types.ts index df5e9ffbea..1b01d47c71 100644 --- a/plugins/polio/js/src/domains/Notifications/types.ts +++ b/plugins/polio/js/src/domains/Notifications/types.ts @@ -1,5 +1,3 @@ -/* eslint-disable camelcase */ - export type NotificationsParams = { order?: string; page?: string; diff --git a/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/Details/Modals/CreateEdit/CreateEditAuthorisationModal.tsx b/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/Details/Modals/CreateEdit/CreateEditAuthorisationModal.tsx index 56f1db6262..2acb364b6e 100644 --- a/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/Details/Modals/CreateEdit/CreateEditAuthorisationModal.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/Details/Modals/CreateEdit/CreateEditAuthorisationModal.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import React, { FunctionComponent } from 'react'; import { AddButton, diff --git a/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/hooks/validation.ts b/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/hooks/validation.ts index 13c883da55..6c004e3707 100644 --- a/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/hooks/validation.ts +++ b/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/hooks/validation.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import * as yup from 'yup'; import { useSafeIntl } from 'bluesquare-components'; import moment from 'moment'; diff --git a/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/types.ts b/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/types.ts index bca1c68afa..e65c41b44a 100644 --- a/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/types.ts +++ b/plugins/polio/js/src/domains/VaccineModule/Nopv2Authorisations/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UrlParams } from 'bluesquare-components'; import { NameAndId } from '../../../../../../../hat/assets/js/apps/Iaso/types/utils'; diff --git a/plugins/polio/js/src/domains/VaccineModule/StockManagement/Details/Table/useVaccineStockManagementDetailsColumns.tsx b/plugins/polio/js/src/domains/VaccineModule/StockManagement/Details/Table/useVaccineStockManagementDetailsColumns.tsx index e140db3b1e..42fd9016a6 100644 --- a/plugins/polio/js/src/domains/VaccineModule/StockManagement/Details/Table/useVaccineStockManagementDetailsColumns.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/StockManagement/Details/Table/useVaccineStockManagementDetailsColumns.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Column, textPlaceholder, useSafeIntl } from 'bluesquare-components'; import React, { useMemo } from 'react'; import { DateCell } from '../../../../../../../../../hat/assets/js/apps/Iaso/components/Cells/DateTimeCell'; diff --git a/plugins/polio/js/src/domains/VaccineModule/StockManagement/StockVariation/Table/columns.tsx b/plugins/polio/js/src/domains/VaccineModule/StockManagement/StockVariation/Table/columns.tsx index cca465d1de..4c103a2c3b 100644 --- a/plugins/polio/js/src/domains/VaccineModule/StockManagement/StockVariation/Table/columns.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/StockManagement/StockVariation/Table/columns.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import EditIcon from '@mui/icons-material/Edit'; import { Column, textPlaceholder, useSafeIntl } from 'bluesquare-components'; import React, { useMemo } from 'react'; diff --git a/plugins/polio/js/src/domains/VaccineModule/StockManagement/hooks/api.ts b/plugins/polio/js/src/domains/VaccineModule/StockManagement/hooks/api.ts index c3f81c7ce0..922ce3cd98 100644 --- a/plugins/polio/js/src/domains/VaccineModule/StockManagement/hooks/api.ts +++ b/plugins/polio/js/src/domains/VaccineModule/StockManagement/hooks/api.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UrlParams } from 'bluesquare-components'; import { useMemo } from 'react'; import { UseMutationResult, UseQueryResult } from 'react-query'; diff --git a/plugins/polio/js/src/domains/VaccineModule/StockManagement/types.ts b/plugins/polio/js/src/domains/VaccineModule/StockManagement/types.ts index 647e2bc0c9..b249b8c2ce 100644 --- a/plugins/polio/js/src/domains/VaccineModule/StockManagement/types.ts +++ b/plugins/polio/js/src/domains/VaccineModule/StockManagement/types.ts @@ -1,6 +1,5 @@ import { UrlParams } from 'bluesquare-components'; -/* eslint-disable camelcase */ export type StockManagementListParams = { order?: string; pageSize?: string; // number as string diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/PreAlerts/PreAlert.tsx b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/PreAlerts/PreAlert.tsx index 2b7f64d0d5..14e24e8133 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/PreAlerts/PreAlert.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/PreAlerts/PreAlert.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import RestoreFromTrashIcon from '@mui/icons-material/RestoreFromTrash'; import { Box, Grid, Paper, Typography } from '@mui/material'; import { IconButton, useSafeIntl } from 'bluesquare-components'; diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VAR/VaccineArrivalReport.tsx b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VAR/VaccineArrivalReport.tsx index c9ff69116c..4be828ad52 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VAR/VaccineArrivalReport.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VAR/VaccineArrivalReport.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import RestoreFromTrashIcon from '@mui/icons-material/RestoreFromTrash'; import { Box, Grid, Paper, Typography } from '@mui/material'; import { IconButton, useSafeIntl } from 'bluesquare-components'; diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VaccineSupplyChainDetails.tsx b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VaccineSupplyChainDetails.tsx index 667584860d..288bec4080 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VaccineSupplyChainDetails.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/Details/VaccineSupplyChainDetails.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Box, Grid } from '@mui/material'; import { makeStyles } from '@mui/styles'; import { diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/preAlerts.tsx b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/preAlerts.tsx index fc37269e14..7f7a54b12c 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/preAlerts.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/preAlerts.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../../../../../../hat/assets/js/apps/Iaso/libs/Api'; import { useSnackQuery } from '../../../../../../../../../hat/assets/js/apps/Iaso/libs/apiHooks'; diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/useSaveSupplyChainForm.tsx b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/useSaveSupplyChainForm.tsx index cb847c622c..9e9feb7929 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/useSaveSupplyChainForm.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/useSaveSupplyChainForm.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseMutationResult, useQueryClient } from 'react-query'; import { useSnackMutation } from '../../../../../../../../../hat/assets/js/apps/Iaso/libs/apiHooks'; diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/utils.tsx b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/utils.tsx index 2b179578f9..4e65cc163d 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/utils.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/api/utils.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { openSnackBar } from '../../../../../../../../../hat/assets/js/apps/Iaso/components/snackBars/EventDispatcher'; import { deleteRequest, diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/useTopBarTitle.tsx b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/useTopBarTitle.tsx index 2309de4d66..15c0129387 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/useTopBarTitle.tsx +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/useTopBarTitle.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { useSafeIntl } from 'bluesquare-components'; import MESSAGES from '../messages'; import { VRF } from '../types'; diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/utils.ts b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/utils.ts index e2f17a0f1b..1fcaa850cd 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/utils.ts +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/hooks/utils.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { FormikProps } from 'formik'; import { isEqual } from 'lodash'; import React, { useEffect, useMemo, useRef, useState } from 'react'; diff --git a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/types.ts b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/types.ts index 039ffe8053..b0113d885b 100644 --- a/plugins/polio/js/src/domains/VaccineModule/SupplyChain/types.ts +++ b/plugins/polio/js/src/domains/VaccineModule/SupplyChain/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { FormikProps } from 'formik'; import React from 'react'; import { UseMutateAsyncFunction } from 'react-query'; diff --git a/plugins/polio/js/src/hooks/useFormValidator.js b/plugins/polio/js/src/hooks/useFormValidator.js index c08d43bb09..011fa1aa35 100644 --- a/plugins/polio/js/src/hooks/useFormValidator.js +++ b/plugins/polio/js/src/hooks/useFormValidator.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { useSafeIntl } from 'bluesquare-components'; import moment from 'moment'; import * as yup from 'yup'; diff --git a/plugins/polio/js/src/hooks/useGetTeams.ts b/plugins/polio/js/src/hooks/useGetTeams.ts index 674a82a9f5..08c444ccad 100644 --- a/plugins/polio/js/src/hooks/useGetTeams.ts +++ b/plugins/polio/js/src/hooks/useGetTeams.ts @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; import { getRequest } from '../../../../../hat/assets/js/apps/Iaso/libs/Api'; import { useSnackQuery } from '../../../../../hat/assets/js/apps/Iaso/libs/apiHooks'; diff --git a/plugins/polio/js/src/utils/index.tsx b/plugins/polio/js/src/utils/index.tsx index 222f02b4fb..408617cc29 100644 --- a/plugins/polio/js/src/utils/index.tsx +++ b/plugins/polio/js/src/utils/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { Campaign, Round } from '../constants/types'; import { accessArrayRound } from '../domains/LQAS-IM/shared/LqasIm'; diff --git a/plugins/registry/js/src/hooks/useGetInstances.tsx b/plugins/registry/js/src/hooks/useGetInstances.tsx index 0959fde194..b1fb26360a 100644 --- a/plugins/registry/js/src/hooks/useGetInstances.tsx +++ b/plugins/registry/js/src/hooks/useGetInstances.tsx @@ -1,17 +1,12 @@ -/* eslint-disable camelcase */ import { UseQueryResult } from 'react-query'; -// @ts-ignore import { getSort } from 'bluesquare-components'; - import { getRequest } from '../../../../../hat/assets/js/apps/Iaso/libs/Api'; import { useSnackQuery } from '../../../../../hat/assets/js/apps/Iaso/libs/apiHooks'; - import { Instance, PaginatedInstances, } from '../../../../../hat/assets/js/apps/Iaso/domains/instances/types/instance'; import { makeUrlWithParams } from '../../../../../hat/assets/js/apps/Iaso/libs/utils'; - import { OrgUnitStatus } from '../../../../../hat/assets/js/apps/Iaso/domains/orgUnits/types/orgUnit'; import { RegistryParams } from '../types';