Skip to content

Commit

Permalink
remove history after Core ui empty state update
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanMarcMilletScality committed Jun 6, 2024
1 parent 832b025 commit 501942e
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/react/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const RemoveTrailingSlash = ({ ...rest }) => {

const RedirectToAccount = () => {
// To be replace later by react-query or context
const history = useHistory();

const { account: selectedAccount } = useCurrentAccount();
const { pathname, search } = useLocation();

Expand All @@ -83,7 +83,6 @@ const RedirectToAccount = () => {
link="/create-account"
listedResource={description}
resourceToCreate="Account"
history={history}
></EmptyState>
);
} else {
Expand Down
1 change: 0 additions & 1 deletion src/react/account/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const Accounts = () => {
icon="Account"
link="/create-account"
listedResource={{ singular: 'Account', plural: 'Accounts' }}
history={history}
></EmptyState>
)
) : (
Expand Down
1 change: 0 additions & 1 deletion src/react/databrowser/DataBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export default function DataBrowser() {
<EmptyState
icon="Bucket"
link="/create-account"
history={history}
listedResource={{
singular: 'Bucket',
plural: 'Buckets',
Expand Down
4 changes: 1 addition & 3 deletions src/react/databrowser/buckets/Buckets.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { useLocation, Redirect, useParams, useHistory } from 'react-router-dom';
import { useLocation, Redirect, useParams } from 'react-router-dom';
import { useSelector } from 'react-redux';
import type { AppState } from '../../../types/state';
import BucketDetails from './BucketDetails';
Expand All @@ -20,7 +20,6 @@ import { useListBucketsForCurrentAccount } from '../../next-architecture/domain/
import { useMetricsAdapter } from '../../next-architecture/ui/MetricsAdapterProvider';

export default function Buckets() {
const history = useHistory();
const { pathname } = useLocation();
const metricsAdapter = useMetricsAdapter();
const { buckets } = useListBucketsForCurrentAccount({ metricsAdapter });
Expand Down Expand Up @@ -65,7 +64,6 @@ export default function Buckets() {
return (
<EmptyState
icon="Bucket"
history={history}
link={`/accounts/${account?.Name}/create-bucket`}
listedResource={{
singular: 'Bucket',
Expand Down
1 change: 0 additions & 1 deletion src/react/databrowser/objects/Objects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export default function Objects() {
// return (
// <EmptyState
// icon="Node-backend"
// history={history}
// link={`/buckets/${bucketNameParam}/upload-object`}
// listedResource="Object"
// ></EmptyState>
Expand Down
3 changes: 0 additions & 3 deletions src/react/endpoint/Endpoints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import {
Loader,
EmptyState,
} from '@scality/core-ui';
import { useHistory } from 'react-router-dom';

import { useAccountsLocationsAndEndpoints } from '../next-architecture/domain/business/accounts';
import { useAccountsLocationsEndpointsAdapter } from '../next-architecture/ui/AccountsLocationsEndpointsAdapterProvider';
import EndpointList from './EndpointList';

const Endpoints = () => {
const history = useHistory();
const accountsLocationsEndpointsAdapter =
useAccountsLocationsEndpointsAdapter();
const { accountsLocationsAndEndpoints, status } =
Expand All @@ -39,7 +37,6 @@ const Endpoints = () => {
plural: 'Data Services',
}}
link="/create-dataservice"
history={history}
/>
);
}
Expand Down
1 change: 0 additions & 1 deletion src/react/locations/LocationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ export function LocationsList() {
<EmptyState
icon="Map-marker"
link="/create-location"
history={history}
listedResource={{ singular: 'location', plural: 'locations' }}
/>
);
Expand Down
6 changes: 1 addition & 5 deletions src/react/workflow/Workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { useEffect } from 'react';
import { UseQueryResult, useQuery } from 'react-query';
import { useDispatch } from 'react-redux';
import { Redirect, useHistory, useLocation, useParams } from 'react-router-dom';
import { Redirect, useLocation, useParams } from 'react-router-dom';
import {
BucketWorkflowExpirationV1,
BucketWorkflowTransitionV2,
Expand Down Expand Up @@ -116,7 +116,6 @@ export function useWorkflows(filters?: Filter): UseQueryResult<
}

export default function Workflows() {
const history = useHistory();
const params = useParams<{
workflowId?: string;
}>();
Expand All @@ -141,7 +140,6 @@ export default function Workflows() {
return (
<EmptyState
icon="Workflow"
history={history}
link="/create-account"
listedResource={listedResource}
resourceToCreate="Account"
Expand All @@ -157,7 +155,6 @@ export default function Workflows() {
link={`/accounts/${accountName}/create-bucket`}
listedResource={listedResource}
resourceToCreate="Bucket"
history={history}
></EmptyState>
);
}
Expand Down Expand Up @@ -192,7 +189,6 @@ export default function Workflows() {
icon="Workflow"
link={`/accounts/${accountName}/workflows/create-workflow`}
listedResource={listedResource}
history={history}
></EmptyState>
);
}
Expand Down

0 comments on commit 501942e

Please sign in to comment.