Skip to content

Commit b4c5e56

Browse files
authored
Merge pull request #1401 from chhsiao1981/refactor-explorer
replace explorerSlice to reducers.explorer
2 parents 04bb3d1 + b498d14 commit b4c5e56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+353
-311
lines changed

src/components/AddNode/ComputeEnvironment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
SelectList,
55
SelectOption,
66
} from "@patternfly/react-core";
7-
import React, { useContext, useCallback, useState, useEffect } from "react";
7+
import React, { useCallback, useContext, useEffect, useState } from "react";
88
import { useAppSelector } from "../../store/hooks";
99
import { Alert } from "../Antd";
1010
import { AddNodeContext } from "./context";

src/components/AddNode/GuidedConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ import { useAppDispatch, useAppSelector } from "../../store/hooks";
4141
import { fetchParamsAndComputeEnv } from "../../store/plugin/pluginSlice";
4242
import { ClipboardCopyFixed, ErrorAlert } from "../Common";
4343
import ComputeEnvironments from "./ComputeEnvironment";
44+
import { AddNodeContext } from "./context";
4445
import RequiredParam from "./RequiredParam";
4546
import SimpleDropdown from "./SimpleDropdown";
46-
import { AddNodeContext } from "./context";
4747
import { type InputIndex, Types } from "./types";
4848
import { handleGetTokens, unpackParametersIntoString } from "./utils";
4949

src/components/AddNode/ReviewGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { RenderFlexItem } from "../Common";
21
import type { Plugin } from "@fnndsc/chrisapi";
2+
import { RenderFlexItem } from "../Common";
33

44
interface PluginDetailsProps {
55
generatedCommand: string;

src/components/AddNode/SimpleDropdown.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ import {
88
TextInput,
99
} from "@patternfly/react-core";
1010
import React, { useContext, useEffect } from "react";
11-
import { CloseIcon } from "../Icons";
12-
import type { SimpleDropdownProps, SimpleDropdownState } from "./types";
13-
import { unPackForKeyValue } from "./utils";
14-
1511
import { v4 } from "uuid";
12+
import { CloseIcon } from "../Icons";
1613
import { AddNodeContext } from "./context";
14+
import type { SimpleDropdownProps, SimpleDropdownState } from "./types";
1715
import { Types } from "./types";
16+
import { unPackForKeyValue } from "./utils";
1817

1918
function getInitialState() {
2019
return {

src/components/AddNode/reducer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { produce } from "immer";
22
import { getInitialNodeState } from "../context";
3-
import { Types, type AddNodeState, type InputType } from "../types";
3+
import { type AddNodeState, type InputType, Types } from "../types";
44

55
export const addNodeReducer = produce((draft: AddNodeState, action: any) => {
66
switch (action.type) {

src/components/AddNode/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { InputType, InputIndex } from "./types";
21
import type { PluginParameter } from "@fnndsc/chrisapi";
32
import { v4 } from "uuid";
3+
import type { InputIndex, InputType } from "./types";
44

55
export const unPackForKeyValue = (input: InputIndex) => {
66
const flag = input ? input.flag : "";
@@ -99,7 +99,8 @@ export const handleGetTokens = (
9999
const dictionary: InputIndex = {};
100100
let requiredInput: InputType = {};
101101
let dropdownInput: InputType = {};
102-
let specialCharIndex = undefined;
102+
// biome-ignore lint/suspicious/noImplicitAnyLet: <explanation>
103+
let specialCharIndex;
103104

104105
const flags = totalParams?.map((param) => param.data.flag);
105106
const helperValues = totalParams?.map((param) => {

src/components/Antd/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export {
88
Dropdown,
99
Form,
1010
List,
11+
type MenuProps,
12+
notification,
1113
Popconfirm,
1214
Popover,
1315
Space,
@@ -16,6 +18,4 @@ export {
1618
Tag,
1719
Tree,
1820
Typography,
19-
notification,
20-
type MenuProps,
2121
} from "antd";

src/components/CreateFeed/BasicInformation.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import type React from "react";
2-
import { useState, useEffect, useContext, useRef, useCallback } from "react";
1+
import type { Tag } from "@fnndsc/chrisapi";
32
import {
43
Form,
54
FormGroup,
6-
TextInput,
75
TextArea,
6+
TextInput,
87
useWizardContext,
98
} from "@patternfly/react-core";
9+
import type React from "react";
10+
import { useCallback, useContext, useEffect, useRef, useState } from "react";
1011
import { Typeahead } from "react-bootstrap-typeahead";
1112
import { CreateFeedContext } from "./context";
12-
import type { Tag } from "@fnndsc/chrisapi";
1313
import { Types } from "./types/feed";
1414
import { fetchTagList } from "./utils";
1515

src/components/CreateFeed/ChooseConfig.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ import {
1818
Tooltip,
1919
useWizardContext,
2020
} from "@patternfly/react-core";
21-
import { Alert, Steps, notification } from "../Antd";
2221
import React, { useCallback, useContext, useEffect, useState } from "react";
2322
import { useAppSelector } from "../../store/hooks";
24-
import GuidedConfig from "../AddNode/GuidedConfig";
2523
import { AddNodeContext } from "../AddNode/context";
24+
import GuidedConfig from "../AddNode/GuidedConfig";
2625
import {
2726
Types as AddNodeTypes,
2827
type chooseConfigProps,
2928
} from "../AddNode/types";
29+
import { Alert, notification, Steps } from "../Antd";
3030
import DragAndUpload from "../DragFileUpload";
3131
import { SettingsIcon, DeleteIcon as TrashIcon, UploadIcon } from "../Icons";
3232
import ChrisFileSelect from "./ChrisFileSelect";
33+
import { CreateFeedContext } from "./context";
3334
import DataPacks from "./DataPacks";
3435
import { FileList } from "./HelperComponent";
3536
import LocalFileUpload from "./LocalFileUpload";
36-
import { CreateFeedContext } from "./context";
37-
import { Types } from "./types/feed";
37+
import { type ChRISFeed, Types } from "./types/feed";
3838

3939
const ChooseConfig = ({
4040
handleFileUpload,
@@ -334,10 +334,9 @@ const ChooseConfig = ({
334334

335335
const fileList =
336336
chrisFiles.length > 0
337-
? chrisFiles.map((file: string, index: number) => (
338-
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
337+
? chrisFiles.map((chrisFile: ChRISFeed, index: number) => (
339338
<React.Fragment key={index}>
340-
<FileList file={file} index={index} />
339+
<FileList file={chrisFile.filename} index={index} />
341340
</React.Fragment>
342341
))
343342
: null;

src/components/CreateFeed/ChrisFileSelect.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
import React, { useState, useContext, useCallback, useEffect } from "react";
2-
import { CreateFeedContext } from "./context";
31
import { useWizardContext } from "@patternfly/react-core";
2+
import { isEmpty } from "lodash";
43
import type { EventDataNode, Key } from "rc-tree/lib/interface";
5-
import { Tree, notification } from "../Antd";
6-
4+
import React, { useCallback, useContext, useEffect, useState } from "react";
5+
import { notification, Tree } from "../Antd";
6+
import { CreateFeedContext } from "./context";
77
import {
8-
Types,
9-
type Info,
10-
type DataBreadcrumb,
11-
type ChrisFileSelectProp,
128
type CheckedKeys,
9+
type ChrisFileSelectProp,
10+
type DataBreadcrumb,
11+
type Info,
12+
Types,
1313
} from "./types/feed";
1414
import { generateTreeNodes, getNewTreeData } from "./utils";
15-
import { isEmpty } from "lodash";
1615

1716
const { DirectoryTree } = Tree;
1817

0 commit comments

Comments
 (0)