Skip to content

Commit

Permalink
fix typescript issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MonPote committed Sep 10, 2024
1 parent 9bec7d9 commit e9d2649
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/react/account/AwsPaginatedResourceTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ const AwsPaginatedResourceTable = <ENTITY, PREPARED_ENTITY = ENTITY>({
disabled={queryResult.status !== 'success'}
value={search}
placeholder={'Search'}
disableToggle
onReset={() => {
queryParams.delete(SEARCH_QUERY_PARAM);
history.push(`${match.url}?${queryParams.toString()}`);
Expand Down
13 changes: 7 additions & 6 deletions src/react/actions/__tests__/s3object.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { queryClient } from '../../utils/testUtil';
import * as actions from '../s3object';
import { UPLOADING_OBJECT } from '../s3object';
import * as dispatchAction from './utils/dispatchActionsList';
Expand Down Expand Up @@ -151,7 +152,7 @@ describe.skip('s3object actions', () => {
const asyncTests = [
{
it: 'createFolder: should return expected actions -> test without prefix parameter',
fn: actions.createFolder(BUCKET_NAME, '', FOLDER_NAME),
fn: actions.createFolder(BUCKET_NAME, '', FOLDER_NAME, queryClient),
storeState: initState,
expectedActions: [
createFolderNetworkAction,
Expand All @@ -170,7 +171,7 @@ describe.skip('s3object actions', () => {
},
{
it: 'createFolder: should return expected actions -> test with prefix parameter',
fn: actions.createFolder(BUCKET_NAME, PREFIX, FOLDER_NAME),
fn: actions.createFolder(BUCKET_NAME, PREFIX, FOLDER_NAME, queryClient),
storeState: initState,
expectedActions: [
createFolderNetworkAction,
Expand All @@ -189,7 +190,7 @@ describe.skip('s3object actions', () => {
},
{
it: 'createFolder: should handle error -> test without prefix parameter',
fn: actions.createFolder(BUCKET_NAME, '', FOLDER_NAME),
fn: actions.createFolder(BUCKET_NAME, '', FOLDER_NAME, queryClient),
storeState: errorZenkoState(),
expectedActions: [
createFolderNetworkAction,
Expand All @@ -200,7 +201,7 @@ describe.skip('s3object actions', () => {
},
{
it: 'createFolder: should handle error -> test with prefix parameter',
fn: actions.createFolder(BUCKET_NAME, PREFIX, FOLDER_NAME),
fn: actions.createFolder(BUCKET_NAME, PREFIX, FOLDER_NAME, queryClient),
storeState: errorZenkoState(),
expectedActions: [
createFolderNetworkAction,
Expand All @@ -211,7 +212,7 @@ describe.skip('s3object actions', () => {
},
{
it: 'uploadFiles: should return expected actions -> test without prefix parameter',
fn: actions.uploadFiles(BUCKET_NAME, '', []),
fn: actions.uploadFiles(BUCKET_NAME, '', [], queryClient),
storeState: initState,
expectedActions: [
dispatchAction.CLOSE_OBJECT_UPLOAD_MODAL_ACTION(),
Expand All @@ -230,7 +231,7 @@ describe.skip('s3object actions', () => {
},
{
it: 'uploadFiles: should return expected actions -> test with prefix parameter',
fn: actions.uploadFiles(BUCKET_NAME, PREFIX, []),
fn: actions.uploadFiles(BUCKET_NAME, PREFIX, [], queryClient),
storeState: initState,
expectedActions: [
dispatchAction.CLOSE_OBJECT_UPLOAD_MODAL_ACTION(),
Expand Down
1 change: 1 addition & 0 deletions src/react/locations/__tests__/LocationList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const server = setupServer(
(req, res, ctx) => res(ctx.json({})),
),
rest.post(`${TEST_API_BASE_URL}/`, (req, res, ctx) => {
//@ts-ignore
const params = new URLSearchParams(req.body);
console.log(req.body);

Expand Down
5 changes: 2 additions & 3 deletions src/react/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import { ListObjectVersionsOutput } from 'aws-sdk/clients/s3';
import { InfiniteData } from 'react-query';
import IAMClient from '../js/IAMClient';
import { UiFacingApi } from '../js/managementClient/api';
import { getAccountSeeds } from '../js/vault';
import { notFalsyTypeGuard } from '../types/typeGuards';
import { APIWorkflows, Workflow, Workflows } from '../types/workflow';
Expand All @@ -26,7 +25,7 @@ import {
generateStreamName,
generateTransitionName,
} from './workflow/utils';
import { UiFacingApiWrapper } from 'src/js/managementClient';
import { UiFacingApiWrapper } from '../js/managementClient';

// Copy paste form legacy redux workflow
export const makeWorkflows = (apiWorkflows: APIWorkflows): Workflows => {
Expand Down Expand Up @@ -78,7 +77,7 @@ export const workflowListQuery = (
) => {
return {
queryKey: ['workflowList', accountId, instanceId, rolePathName, filters],
queryFn: async (): Promise<APIWorkflows> => {
queryFn: async () => {
if (onStart) {
onStart();
}
Expand Down
3 changes: 2 additions & 1 deletion src/react/workflow/ReplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import {
renderDestination,
} from './utils';
import { useAuth, useInstanceId } from '../next-architecture/ui/AuthProvider';
import { ReplicationStreamInternalV1 } from '../../js/managementClient/api';

type Props = {
isCreateMode?: boolean;
Expand All @@ -64,7 +65,7 @@ type Props = {

export const disallowedPrefixes = (
bucketName: string,
streams: Replication[],
streams: ReplicationStreamInternalV1[],
) => {
return streams
.filter((s) => {
Expand Down
3 changes: 2 additions & 1 deletion src/react/workflow/Workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
BucketWorkflowExpirationV1,
BucketWorkflowTransitionV2,
ReplicationStreamInternalV1,
SearchWorkflowsListV1,
} from '../../js/managementClient/api';
import { notFalsyTypeGuard } from '../../types/typeGuards';
import { APIWorkflows } from '../../types/workflow';
Expand Down Expand Up @@ -44,7 +45,7 @@ import {
type Filter = string[];

export function useWorkflowsWithSelect<T>(
select: (workflows: APIWorkflows) => T,
select: (workflows: SearchWorkflowsListV1) => T,
filters?: Filter,
): UseQueryResult<T, unknown> {
const mgnt = useManagementClient();
Expand Down

0 comments on commit e9d2649

Please sign in to comment.