From 40e56d9f79d7c4124a370af07ed5e0b08090b521 Mon Sep 17 00:00:00 2001 From: Jean-Marc Millet Date: Wed, 4 Sep 2024 11:25:42 +0200 Subject: [PATCH] remove unused set_zenko_client_action remove dispatch of setZenkoClient to avoid error when uploading object. --- .../actions/__tests__/utils/dispatchActionsList.ts | 8 -------- src/react/actions/__tests__/zenko.test.ts | 8 -------- src/react/actions/auth.ts | 11 ----------- src/react/actions/zenko.ts | 10 ---------- 4 files changed, 37 deletions(-) diff --git a/src/react/actions/__tests__/utils/dispatchActionsList.ts b/src/react/actions/__tests__/utils/dispatchActionsList.ts index 944a383f5..d24619c6d 100644 --- a/src/react/actions/__tests__/utils/dispatchActionsList.ts +++ b/src/react/actions/__tests__/utils/dispatchActionsList.ts @@ -74,14 +74,6 @@ export const SET_MANAGEMENT_CLIENT_ACTION: SetManagementClientAction = { //@ts-expect-error fix this when you are working on it managementClient: new MockManagementClient(), }; -export function SET_ZENKO_CLIENT_ACTION( - zenkoClient: ZenkoClientInterface, -): SetZenkoClientAction { - return { - type: 'SET_ZENKO_CLIENT', - zenkoClient, - }; -} export const SET_STS_CLIENT_ACTION: SetSTSClientAction = { type: 'SET_STS_CLIENT', stsClient: new MockSTSClient(), diff --git a/src/react/actions/__tests__/zenko.test.ts b/src/react/actions/__tests__/zenko.test.ts index 57d6bc54a..0a4c28c57 100644 --- a/src/react/actions/__tests__/zenko.test.ts +++ b/src/react/actions/__tests__/zenko.test.ts @@ -48,15 +48,7 @@ describe.skip('zenko actions', () => { SignedUrl: '', }, ]; - const mock = new MockZenkoClient(); const syncTests = [ - { - it: 'should return SET_ZENKO_CLIENT action', - //@ts-expect-error fix this when you are working on it - fn: actions.setZenkoClient(mock), - //@ts-expect-error fix this when you are working on it - expectedActions: [dispatchAction.SET_ZENKO_CLIENT_ACTION(mock)], - }, { it: 'should return ZENKO_CLEAR_ERROR action', fn: actions.zenkoClearError(), diff --git a/src/react/actions/auth.ts b/src/react/actions/auth.ts index b53c277c8..7db0face3 100644 --- a/src/react/actions/auth.ts +++ b/src/react/actions/auth.ts @@ -21,7 +21,6 @@ import { handleErrorMessage, loadInstanceLatestStatus, networkAuthFailure, - setZenkoClient, } from './index'; export function setOIDCLogout(logout: OidcLogoutFunction): SetOIDCLogoutAction { return { @@ -84,16 +83,6 @@ export function loadAppConfig(config: AppConfig, user): ThunkNonStateAction { }), ), ); - dispatch( - setZenkoClient( - new ZenkoClient( - config.zenkoEndpoint, - config.iamInternalFQDN, - config.s3InternalFQDN, - config.basePath, - ), - ), - ); dispatch(loadConfigSuccess()); dispatch(loadClients()); return Promise.resolve(); diff --git a/src/react/actions/zenko.ts b/src/react/actions/zenko.ts index 1249152f9..504f3d860 100644 --- a/src/react/actions/zenko.ts +++ b/src/react/actions/zenko.ts @@ -1,7 +1,6 @@ import { DispatchFunction, GetStateFunction, - SetZenkoClientAction, ThunkNonStatePromisedAction, ThunkStatePromisedAction, ZenkoAppendSearchListAction, @@ -15,7 +14,6 @@ import { SearchResultList, Site, ZenkoClientError, - ZenkoClient as ZenkoClientInterface, } from '../../types/zenko'; import { ListObjectVersionsOutput } from 'aws-sdk/clients/s3'; import { handleAWSClientError, handleAWSError } from './error'; @@ -74,14 +72,6 @@ export function appendSearchListing( list, }; } -export function setZenkoClient( - zenkoClient: ZenkoClientInterface, -): SetZenkoClientAction { - return { - type: 'SET_ZENKO_CLIENT', - zenkoClient, - }; -} function _isFolder(key: string): boolean { return key.substr(key.length - 1) === '/';