Skip to content

Commit

Permalink
refactor: update useBasenameRelativeNavigate import to use @scality/m…
Browse files Browse the repository at this point in the history
…odule-federation
  • Loading branch information
hervedombya committed Jan 17, 2025
1 parent 3f8a2d8 commit f9a3d8e
Show file tree
Hide file tree
Showing 38 changed files with 38 additions and 37 deletions.
1 change: 1 addition & 0 deletions jestSetupAfterEnv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,5 @@ jest.mock('@scality/module-federation', () => ({
ShellHooksProvider: ({ children }) => <>{children}</>,
useShellHooks: () => mockShellHooks,
useShellAlerts: () => mockShellAlerts,
useBasenameRelativeNavigate: jest.fn(() => jest.fn()),
}));
2 changes: 1 addition & 1 deletion src/react/FederableApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ZenkoUI from './ZenkoUI';
import React, { useEffect, useMemo } from 'react';
import { XCoreLibraryProvider } from './next-architecture/ui/XCoreLibraryProvider';
import zenkoUIReducer from './reducers';
import { useBasenameRelativeNavigate } from './ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { ShellHooksProvider } from '@scality/module-federation';

//@ts-expect-error fix this when you are working on it
Expand Down
2 changes: 1 addition & 1 deletion src/react/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import AccountContent from './account/AccountContent';
import BucketCreate from './databrowser/buckets/BucketCreate';
import DataBrowser from './databrowser/DataBrowser';
import LocationEditor from './locations/LocationEditor';
import { useBasenameRelativeNavigate } from './ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import Workflows from './workflow/Workflows';
import CreateWorkflow from './workflow/CreateWorkflow';
import Objects from './databrowser/objects/Objects';
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/AccountDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import AccountPoliciesList from './AccountPoliciesList';
import AccountUserList from './AccountUserList';
import Properties from './details/Properties';
import { useEffect } from 'react';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

const variantMapping = {
healthy: 'statusHealthy',
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/AccountList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useMetricsAdapter } from '../next-architecture/ui/MetricsAdapterProvide
import { getDataUsedColumn } from '../next-architecture/ui/metrics/DataUsedColumn';
import { TableHeaderWrapper } from '../ui-elements/Table';
import { useAuthGroups } from '../utils/hooks';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

function useAutoAssumeRoleUponAccountDeletion({
accounts,
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/AccountPoliciesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ApiError } from '../../types/actions';
import { AWS_PAGINATED_ENTITIES } from '../utils/IAMhooks';
import { ListPoliciesResponse, Policy } from 'aws-sdk/clients/iam';
import { CoreUIColumn } from 'react-table';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

const EditButton = ({
policyName,
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/AccountRoleSelectButtonAndModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useDataServiceRole,
useSetAssumedRole,
} from '../DataServiceRoleProvider';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { CustomModal as Modal, ModalBody } from '../ui-elements/Modal';
import { AccountSelectorButton } from '../ui-elements/Table';
import { regexArn, SCALITY_INTERNAL_ROLES, useAccounts } from '../utils/hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/AccountUserAccessKeys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
useAwsPaginatedEntities,
} from '../utils/IAMhooks';
import AccountUserSecretKeyModal from './AccountUserSecretKeyModal';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

const CreatedOnCell = (rowValue) => {
const outdatedAlert = useAccessKeyOutdatedStatus(rowValue);
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/AccountUserList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ApiError } from '../../types/actions';
import { User } from 'aws-sdk/clients/iam';
import { FormattedDateTime, Icon, spacing } from '@scality/core-ui';
import { Row } from 'react-table';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

type InternalUser = {
userName: string;
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/AccountUserSecretKeyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useMutation, useQueryClient } from 'react-query';
import { getUserAccessKeysQuery } from '../queries';
import styled from 'styled-components';
import { useCurrentAccount } from '../DataServiceRoleProvider';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
type Props = {
IAMUserName: string;
};
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import AccountList from './AccountList';
import { MultiAccountsIcon } from './MultiAccountsIcon';
import { useConfig } from '../next-architecture/ui/ConfigProvider';
import { VEEAM_FEATURE } from '../../js/config';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import AccountContent from './AccountContent';

Check warning on line 24 in src/react/account/Accounts.tsx

View workflow job for this annotation

GitHub Actions / tests

'AccountContent' is defined but never used

const Accounts = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/AwsPaginatedResourceTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
useAwsPaginatedEntities,
} from '../utils/IAMhooks';
import { useQueryParams } from '../utils/hooks';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

const WithTooltipWhileLoading = ({
children,
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/UpdateAccountPolicy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useCurrentAccount } from '../DataServiceRoleProvider';
import { regexArn } from '../utils/hooks';
import { CommonPolicyLayout } from './AccountEditCommonLayout';
import { MouseEvent } from 'react';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

type FormValues = {
policyName: string;
Expand Down
2 changes: 1 addition & 1 deletion src/react/account/details/properties/AccountInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Table, * as T from '../../../ui-elements/TableKeyValue';
import { useAuthGroups, useRolePathName } from '../../../utils/hooks';
import { removeRoleArnStored } from '../../../utils/localStorage';
import SecretKeyModal from './SecretKeyModal';
import { useBasenameRelativeNavigate } from '../../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { useShellHooks } from '@scality/module-federation';

const TableContainer = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
Wrap,
spacing,
} from '@scality/core-ui';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

type AttachmentStatus = 'Waiting for confirmation' | 'Error' | 'Success';

Expand Down
2 changes: 1 addition & 1 deletion src/react/actions/s3bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { handleAWSClientError, handleAWSError } from './error';
import { networkEnd, networkStart } from './network';
import { getClients } from '../utils/actions';
import { History } from 'history';

Check warning on line 11 in src/react/actions/s3bucket.ts

View workflow job for this annotation

GitHub Actions / tests

'History' is defined but never used
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

export function getBucketInfoSuccess(
info: BucketInfo,
Expand Down
2 changes: 1 addition & 1 deletion src/react/actions/s3object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { Marker, ZenkoClient } from '../../types/zenko';
import { getClients } from '../utils/actions';
import { newSearchListing } from '.';
import { QueryClient } from 'react-query';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

export const UPLOADING_OBJECT = 'Uploading object(s)';
export function listObjectsSuccess(
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/DataBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { AppContainer, EmptyState, Icon } from '@scality/core-ui';
import { Box } from '@scality/core-ui/dist/next';
import { useS3Client } from '../next-architecture/ui/S3ClientProvider';
import Loader from '../ui-elements/Loader';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { useConfig } from '../next-architecture/ui/ConfigProvider';

export default function DataBrowser() {
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/buckets/BucketCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
import { useAccountsLocationsEndpointsAdapter } from '../../next-architecture/ui/AccountsLocationsEndpointsAdapterProvider';
import { useAccountsLocationsAndEndpoints } from '../../next-architecture/domain/business/accounts';
import { useConfig } from '../../next-architecture/ui/ConfigProvider';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

const helpNonAsyncLocation =
'Selected Storage Location does not support Async Metadata updates.';
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/buckets/BucketList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { TableHeaderWrapper } from '../../ui-elements/Table';
import { useAuthGroups, useQueryParams } from '../../utils/hooks';
import { getLocationIngestionState } from '../../utils/storageOptions';
import { BucketLocationNameAndType } from '../../workflow/SourceBucketOption';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
const SEARCH_QUERY_PARAM = 'search';

type Props = {
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/buckets/ObjectLockSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ObjectLockRetentionSettings, {
} from './ObjectLockRetentionSettings';
import { clearError, editDefaultRetention, getBucketInfo } from '../../actions';
import { convertToBucketInfo } from '../../locations/utils';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { RetentionMode } from '../../../types/s3';

const schema = Joi.object(objectLockRetentionSettingsValidationRules);
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/buckets/details/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
getLocationType,
} from '../../../utils/storageOptions';
import { useWorkflows } from '../../../workflow/Workflows';
import { useBasenameRelativeNavigate } from '../../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

function capitalize(string: string) {
return string.toLowerCase().replace(/^\w/, (c) => {
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/buckets/details/Workflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { makeWorkflows } from '../../../queries';
import { NameLinkContaner } from '../../../ui-elements/NameLink';
import { WorkflowTypeIcon } from '../../../workflow/WorkflowList';
import { useWorkflowsWithSelect } from '../../../workflow/Workflows';
import { useBasenameRelativeNavigate } from '../../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

const TableAction = styled.div`
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/objects/ObjectListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { parseRestore } from '../../reducers/s3';
import { useAccountsLocationsAndEndpoints } from '../../next-architecture/domain/business/accounts';
import { useAccountsLocationsEndpointsAdapter } from '../../next-architecture/ui/AccountsLocationsEndpointsAdapterProvider';
import { EmptyCell } from '@scality/core-ui/dist/components/tablev2/Tablev2.component';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

type CellProps = {
row: {
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/objects/ObjectLockSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
} from './utils';
import { AppState } from '../../../types/state';
import { useCurrentAccount } from '../../DataServiceRoleProvider';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { RetentionMode } from '../../../types/s3';

const Joi = JoiImport.extend(DateExtension);
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/objects/Objects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import ObjectUpload from './ObjectUpload';
import { usePrefixWithSlash, useQueryParams } from '../../utils/hooks';
import { AppContainer, TwoPanelLayout } from '@scality/core-ui';
import ObjectHead from './ObjectHead';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

export default function Objects() {
const dispatch = useDispatch();
Expand Down
2 changes: 1 addition & 1 deletion src/react/databrowser/objects/details/Properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
VEEAM_OBJECT_KEY,
VEEAM_SYSTEM_KEY,
} from '../../../ui-elements/Veeam/VeeamConstants';
import { useBasenameRelativeNavigate } from '../../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

type Props = {
objectMetadata: ObjectMetadata & { lockStatus?: ObjectEntity['lockStatus'] };
Expand Down
2 changes: 1 addition & 1 deletion src/react/endpoint/EndpointCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { renderLocation } from '../locations/utils';
import { useAccountsLocationsAndEndpoints } from '../next-architecture/domain/business/accounts';
import { useAccountsLocationsEndpointsAdapter } from '../next-architecture/ui/AccountsLocationsEndpointsAdapterProvider';
import { useInstanceId } from '../next-architecture/ui/AuthProvider';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

const BannerMessageList = styled.ul`
margin: ${spacing.r8} 0;
Expand Down
2 changes: 1 addition & 1 deletion src/react/endpoint/EndpointList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from './AdvancedMetricsButton';
import { DeleteEndpoint } from './DeleteEndpoint';
import { TableHeaderWrapper } from '../ui-elements/Table';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
type CellProps = {
row: {
original: Endpoint;
Expand Down
2 changes: 1 addition & 1 deletion src/react/locations/LocationEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
newLocationForm,
} from './utils';
import { Loader as LoaderCoreUI } from '@scality/core-ui';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { useShellHooks } from '@scality/module-federation';

//Temporary hack waiting for the layout
Expand Down
2 changes: 1 addition & 1 deletion src/react/locations/LocationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { PauseAndResume } from './PauseAndResume';
import { getLocationDeletionBlocker } from './utils';
import styled from 'styled-components';
import { TableHeaderWrapper } from '../ui-elements/Table';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { useConfig } from '../next-architecture/ui/ConfigProvider';
import { useShellHooks } from '@scality/module-federation';

Expand Down
2 changes: 1 addition & 1 deletion src/react/ui-elements/SelectAccountIAMRole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import { AccountsLocationsEndpointsAdapterProvider } from '../next-architecture/ui/AccountsLocationsEndpointsAdapterProvider';
import { getListRolesQuery } from '../queries';
import { SCALITY_IAM_ROLES, regexArn } from '../utils/hooks';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

class NoOpMetricsAdapter implements IMetricsAdapter {
async listBucketsLatestUsedCapacity(
Expand Down
2 changes: 1 addition & 1 deletion src/react/ui-elements/Veeam/VeeamConfiguration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { accountNameValidationSchema } from '../../../react/account/AccountCreat
import { useAccountsLocationsAndEndpoints } from '../../../react/next-architecture/domain/business/accounts';
import { useAccountsLocationsEndpointsAdapter } from '../../..//react/next-architecture/ui/AccountsLocationsEndpointsAdapterProvider';
import { VeeamLogo } from './VeeamLogo';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

const schema = Joi.object({
accountName: accountNameValidationSchema,
Expand Down
2 changes: 1 addition & 1 deletion src/react/ui-elements/Veeam/VeeamSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useAuthGroups } from '../../utils/hooks';
import { HideCredential } from '../Hide';
import { useGetS3ServicePoint } from './useGetS3ServicePoint';
import { VEEAM_OFFICE_365_V8 } from './VeeamConstants';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

type VeeamSummaryProps = {
accountName: string;
Expand Down
2 changes: 1 addition & 1 deletion src/react/ui-elements/Veeam/VeeamTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import styled, { useTheme } from 'styled-components';
import { VeeamSkipModal } from './VeeamSkipModal';
import { VEEAM_STEPS, VeeamStepsIndexes } from './VeeamSteps';
import { useMutationTableData } from './useMutationTableData';
import { useBasenameRelativeNavigate } from '../../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';

export const ListItem = styled.li`
padding: 0.5rem;
Expand Down
2 changes: 1 addition & 1 deletion src/react/workflow/ConfigurationTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import {
removeEmptyTagKeys,
} from './utils';
import { useWorkflows } from './Workflows';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { useShellHooks } from '@scality/module-federation';

type Props = {
Expand Down
2 changes: 1 addition & 1 deletion src/react/workflow/CreateWorkflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import {
prepareTransitionQuery,
removeEmptyTagKeys,
} from './utils';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { useParams } from 'react-router';
import { useShellHooks } from '@scality/module-federation';

Expand Down
2 changes: 1 addition & 1 deletion src/react/workflow/WorkflowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Workflows } from '../../types/workflow';
import { Workflow } from '../../types/workflow';
import { TableHeaderWrapper } from '../ui-elements/Table';
import { TextTransformer } from '../ui-elements/Utility';
import { useBasenameRelativeNavigate } from '../ShellHooksContext';
import { useBasenameRelativeNavigate } from '@scality/module-federation';
import { useParams } from 'react-router';

const SEARCH_QUERY_PARAM = 'search';
Expand Down

0 comments on commit f9a3d8e

Please sign in to comment.