Skip to content

Commit

Permalink
Bump i18n and cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjalKatiyar committed Jan 23, 2025
1 parent a788f9a commit 12300df
Show file tree
Hide file tree
Showing 83 changed files with 397 additions and 201 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"analyze-mco": "PLUGIN=mco yarn analyze-common && PLUGIN=mco yarn tsx ./analyzeTest.ts",
"analyze-odf": "PLUGIN=odf yarn analyze-common && PLUGIN=odf yarn tsx ./analyzeTest.ts",
"build": "NODE_ENV=production PLUGIN=odf I8N_NS=plugin__odf-console yarn build:plugin",
"build:generate": "yarn clean-${PLUGIN} && tsx ./scripts/versionCheck.mts --plugin ${PLUGIN} && tsx ./scripts/generatePluginPackage.mts --plugin ${PLUGIN}",
"build:plugin": "yarn build:generate && NODE_OPTIONS='--max-old-space-size=4096' yarn tsx node_modules/.bin/webpack -c ./webpack.config.ts",
"build-client": "NODE_ENV=production PLUGIN=client I8N_NS=plugin__odf-client-console yarn build:plugin",
"build-dev": "NODE_ENV=development PLUGIN=odf I8N_NS=plugin__odf-console yarn build:plugin",
"build-mco": "NODE_ENV=production PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn build:plugin",
"build:generate": "yarn clean-${PLUGIN} && tsx ./scripts/versionCheck.mts --plugin ${PLUGIN} && tsx ./scripts/generatePluginPackage.mts --plugin ${PLUGIN}",
"build:plugin": "yarn build:generate && NODE_OPTIONS='--max-old-space-size=4096' yarn tsx node_modules/.bin/webpack -c ./webpack.config.ts",
"clean": "yarn clean-mco && yarn clean-odf",
"clean-client": "cd plugins/client && rm -rf ./dist",
"clean-mco": "cd plugins/mco && rm -rf ./dist",
Expand All @@ -27,10 +27,10 @@
"cypress-merge": "mochawesome-merge ./gui-test-screenshots/cypress_report*.json > ./gui-test-screenshots/cypress.json",
"cypress-postreport": "yarn cypress-merge && yarn cypress-generate",
"dev": "PLUGIN=odf I8N_NS=plugin__odf-console yarn server:plugin",
"dev-client": "PLUGIN=client I8N_NS=plugin__odf-client-console yarn server:plugin",
"dev-mco": "PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn server:plugin",
"dev:c": "yarn ocp-console & PLUGIN=${PLUGIN:=odf} I8N_NS=${I8N_NS} yarn server:plugin & wait",
"dev:no-type-check": "DEV_NO_TYPE_CHECK=true yarn dev",
"dev-client": "PLUGIN=client I8N_NS=plugin__odf-client-console yarn server:plugin",
"dev-mco": "PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn server:plugin",
"export-pos": "./scripts/i18n/export-pos.sh",
"format": "yarn prettier -w .",
"format-test": "yarn prettier -c .",
Expand All @@ -49,8 +49,8 @@
"po-to-i18n": "node ./scripts/i18n/po-to-i18n.js",
"prepare": "husky install",
"serve-local-build": "./http-server.sh ./plugins/odf/dist",
"serve-local-build-mco": "./http-server.sh ./plugins/mco/dist",
"serve-local-build:c": "yarn ocp-console & yarn serve-local-build & wait",
"serve-local-build-mco": "./http-server.sh ./plugins/mco/dist",
"server:plugin": "yarn build:generate && I8N_NS=${I8N_NS} yarn tsx ./node_modules/.bin/webpack serve -c ./webpack.config.ts --progress",
"test": "jest --config=jest/config.js",
"test-coverage": "jest --config=jest/config.js --silent --coverage --coverageReporters text-summary",
Expand Down Expand Up @@ -100,8 +100,8 @@
"fork-ts-checker-webpack-plugin": "^9.0.2",
"fuzzysearch": "^1.0.3",
"history": "^4.9.0",
"i18next": "^20.2.1",
"i18next-conv": "^10.1.0",
"i18next": "^24.2.1",
"i18next-conv": "^15.1.1",
"immer": "^10.0.3",
"is-ip": "^5.0.1",
"js-base64": "^2.1.9",
Expand Down Expand Up @@ -163,7 +163,7 @@
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.17.0",
"comment-json": "4.x",
"cypress": "^13.15.2",
"cypress": "^14.0.0",
"cypress-multi-reporters": "^2.0.4",
"eslint": "^8.57.1",
"eslint-config-airbnb": "^19.0.4",
Expand All @@ -180,7 +180,7 @@
"eventsource": "^1.1.1",
"http-server": "0.12.x",
"husky": "^7.0.0",
"i18next-parser": "9.0.2",
"i18next-parser": "9.1.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ibm/system-connection-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { getAPIVersionForModel, isValidIP } from '@odf/shared/utils';
import { k8sGet } from '@openshift-console/dynamic-plugin-sdk';
import { Select, SelectOption } from '@patternfly/react-core/deprecated';
import { TFunction } from 'i18next';
import * as _ from 'lodash-es';
import { TFunction } from 'react-i18next';
import * as Yup from 'yup';
import {
FormGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import PageHeading from '@odf/shared/heading/page-heading';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { Wizard, WizardStep } from '@patternfly/react-core/deprecated';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { useNavigate } from 'react-router-dom-v5-compat';
import { Text, TextContent, TextVariants } from '@patternfly/react-core';
import { EnrollDiscoveredApplicationFooter } from './footer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
WizardContext,
WizardFooter,
} from '@patternfly/react-core/deprecated';
import { TFunction } from 'i18next';
import * as _ from 'lodash-es';
import { TFunction } from 'react-i18next';
import {
Button,
ButtonVariant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import validationRegEx from '@odf/shared/utils/validation';
import { useYupValidationResolver } from '@odf/shared/yup-validation-resolver';
import { useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
import { SelectOption } from '@patternfly/react-core/deprecated';
import { TFunction } from 'i18next';
import { useForm } from 'react-hook-form';
import { TFunction } from 'react-i18next';
import * as Yup from 'yup';
import {
Alert,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
ListPageFilter,
useListPageFilter,
} from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { Bullseye, Grid, GridItem, Text } from '@patternfly/react-core';
import { Td } from '@patternfly/react-table';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { getValidatedProp } from '@odf/shared/utils';
import { RequestSizeInput } from '@odf/shared/utils/RequestSizeInput';
import { SelectOption } from '@patternfly/react-core/deprecated';
import { TFunction } from 'i18next';
import * as _ from 'lodash-es';
import { TFunction } from 'react-i18next';
import {
Form,
FormGroup,
Expand Down
2 changes: 1 addition & 1 deletion packages/mco/components/drpolicy-list-page/helper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CustomKebabItem } from '@odf/shared/kebab';
import { ModalKeys } from '@odf/shared/modals/types';
import classNames from 'classnames';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { sortable, wrappable } from '@patternfly/react-table';
import { Actions } from '../../constants';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
VirtualizedTable,
useActiveColumns,
} from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import {
Pagination,
PaginationVariant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import {
useK8sWatchResource,
} from '@openshift-console/dynamic-plugin-sdk';
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
import { TFunction } from 'i18next';
import * as _ from 'lodash-es';
import { TFunction } from 'react-i18next';
import {
Progress,
ProgressMeasureLocation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ModalBody, ModalFooter } from '@odf/shared/modals/Modal';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { getErrorMessage } from '@odf/shared/utils';
import { k8sPatch } from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import {
Modal,
Button,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { docLinks } from '@odf/mco/constants/doc';
import { ViewDocumentation } from '@odf/shared/utils';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { Trans } from 'react-i18next';
import { AlertVariant } from '@patternfly/react-core';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { CommonModalProps } from '@odf/shared/modals';
import { getName, getNamespace } from '@odf/shared/selectors';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { AlertProps, AlertVariant } from '@patternfly/react-core';
import { FailoverRelocateModal } from '../failover-relocate-modal';
import { PlacementControlProps } from '../failover-relocate-modal-body';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { ViewDocumentation } from '@odf/shared/utils';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { Trans } from 'react-i18next';
import { AlertVariant } from '@patternfly/react-core';
import { docLinks } from '../../../../constants/doc';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { K8sResourceKind } from '@odf/shared/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { getErrorMessage } from '@odf/shared/utils';
import { k8sPatch } from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import {
Modal,
Button,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
GreenCheckCircleIcon,
RedExclamationCircleIcon,
} from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { Flex, FlexItem } from '@patternfly/react-core';
import { UnknownIcon } from '@patternfly/react-icons';
import { DRActionType, VolumeReplicationHealth } from '../../../../constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SelectOption,
SelectVariant,
} from '@patternfly/react-core/deprecated';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { HelperText, HelperTextItem } from '@patternfly/react-core';
import { checkDRActionReadiness } from '../../../../utils';
import { ErrorMessageType } from './error-messages';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getName } from '@odf/shared/selectors';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { getErrorMessage } from '@odf/shared/utils';
import { Wizard, WizardStep } from '@patternfly/react-core/deprecated';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { AssignPolicyViewFooter } from './helper/assign-policy-view-footer';
import { PVCDetailsWizardContent } from './helper/pvc-details-wizard-content';
import { ReviewAndAssign } from './helper/review-and-assign';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
WizardContext,
WizardFooter,
} from '@patternfly/react-core/deprecated';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import {
Button,
Alert,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getName } from '@odf/shared/selectors';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { getValidatedProp } from '@odf/shared/utils';
import { SelectOption } from '@patternfly/react-core/deprecated';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import {
Form,
FormGroup,
Expand Down
2 changes: 1 addition & 1 deletion packages/mco/constants/acm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';

// Managed cluster region claim
export const MANAGED_CLUSTER_REGION_CLAIM = 'region.open-cluster-management.io';
Expand Down
2 changes: 1 addition & 1 deletion packages/mco/constants/disaster-recovery.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';

// VRG annotations
export const DRPC_NAME_ANNOTATION =
Expand Down
2 changes: 1 addition & 1 deletion packages/mco/utils/disaster-recovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
Operator,
MatchExpression,
} from '@openshift-console/dynamic-plugin-sdk/lib/api/common-types';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { InProgressIcon, UnknownIcon } from '@patternfly/react-icons';
import {
VolumeReplicationHealth,
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/constants/object-storage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';

export enum ServiceType {
MCG = 'Multicloud Object Gateway',
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/dashboards/block-pool/mirroring-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
StatusIconAndText,
useK8sWatchResource,
} from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import * as _ from 'lodash-es';
import { TFunction } from 'react-i18next';
import { Trans } from 'react-i18next';
import { ChartPie, ChartThemeColor } from '@patternfly/react-charts';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/dashboards/block-pool/states.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { global_disabled_color_100 as disabledColor } from '@patternfly/react-to
import { global_palette_blue_300 as blueInfoColor } from '@patternfly/react-tokens/dist/js/global_palette_blue_300';
import { global_palette_green_500 as okColor } from '@patternfly/react-tokens/dist/js/global_palette_green_500';
import { global_warning_color_100 as warningColor } from '@patternfly/react-tokens/dist/js/global_warning_color_100';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { ImageStates } from '../../types';

export const ImageStateLegendMap = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { StorageClusterKind } from '@odf/shared/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import {
Button,
Popover,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { humanizeNumber, getGaugeValue } from '@odf/shared/utils';
import { PrometheusResponse } from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { Link } from 'react-router-dom-v5-compat';

const formatCount = (count: number, t: TFunction) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
Humanize,
PrometheusResponse,
} from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import * as _ from 'lodash-es';
import { TFunction } from 'react-i18next';

export const DataConsumersValue = {
[Breakdown.PROVIDERS]: 'PROVIDERS_',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { Phase } from '@odf/ocs/constants';
import { K8sResourceKind } from '@odf/shared/types';
import { K8sResourceKind, PrometheusHealthHandler } from '@odf/shared/types';
import { getGaugeValue } from '@odf/shared/utils';
import { HealthState } from '@openshift-console/dynamic-plugin-sdk';
import {
PrometheusHealthHandler,
SubsystemHealth,
} from '@openshift-console/dynamic-plugin-sdk/lib/extensions/dashboard-types';
import { TFunction } from 'i18next';
import { SubsystemHealth } from '@openshift-console/dynamic-plugin-sdk/lib/extensions/dashboard-types';
import { TFunction } from 'react-i18next';

const nooBaaStatus = (status: string, t: TFunction): SubsystemHealth => {
switch (status) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/dashboards/ocs-system-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
OverviewGrid,
OverviewGridCard,
} from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { useParams } from 'react-router-dom-v5-compat';
import { ODFSystemParams } from '../types';
import { StatusCard as NFSStatusCard } from './network-file-system/status-card/status-card';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ConfigMapKind } from '@odf/shared/types';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { humanizeBinaryBytesWithNegatives, parser } from '@odf/shared/utils';
import { useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { Trans } from 'react-i18next';
import { useParams } from 'react-router-dom-v5-compat';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PrometheusHealthHandler } from '@odf/shared/types';
import { getResiliencyProgress } from '@odf/shared/utils';
import { HealthState } from '@openshift-console/dynamic-plugin-sdk';
import { PrometheusHealthHandler } from '@openshift-console/dynamic-plugin-sdk/lib/extensions/dashboard-types';

export const getDataResiliencyState: PrometheusHealthHandler = (
responses,
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/modals/storage-pool/modal-footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';
import { useNavigate } from 'react-router-dom-v5-compat';
import {
ActionGroup,
Expand Down
2 changes: 1 addition & 1 deletion packages/ocs/utils/ceph-health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { STATE_PRIORITY } from '@odf/shared/dashboards/status-card/states';
import { K8sResourceKind, ResourceHealthHandler } from '@odf/shared/types';
import { HealthState } from '@openshift-console/dynamic-plugin-sdk';
import { SubsystemHealth } from '@openshift-console/dynamic-plugin-sdk/lib/extensions/dashboard-types';
import { TFunction } from 'i18next';
import * as _ from 'lodash-es';
import { TFunction } from 'react-i18next';

export type WatchCephResource = {
ceph: K8sResourceKind;
Expand Down
8 changes: 3 additions & 5 deletions packages/ocs/utils/noobaa-health.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { PrometheusHealthHandler } from '@odf/shared/types';
import { getGaugeValue } from '@odf/shared/utils';
import {
HealthState,
K8sResourceCommon,
} from '@openshift-console/dynamic-plugin-sdk';
import {
PrometheusHealthHandler,
SubsystemHealth,
} from '@openshift-console/dynamic-plugin-sdk/lib/extensions/dashboard-types';
import { TFunction } from 'i18next';
import { SubsystemHealth } from '@openshift-console/dynamic-plugin-sdk/lib/extensions/dashboard-types';
import { TFunction } from 'react-i18next';

const parseNoobaaStatus = (status: string, t: TFunction): SubsystemHealth => {
switch (status) {
Expand Down
Loading

0 comments on commit 12300df

Please sign in to comment.