Skip to content

Commit 565211d

Browse files
committed
Fixed lint errors
1 parent 43a31e5 commit 565211d

File tree

11 files changed

+27
-32
lines changed

11 files changed

+27
-32
lines changed

src/App.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Separator } from "@/components/ui/separator"
21
import { useEffect } from "react"
32
import { RequestPanel } from "./components/RequestPanel"
43
import { ResponsePanel } from "./components/ResponsePanel"
@@ -9,17 +8,12 @@ import { useTabs } from "./hooks/useTabs"
98
import { useUrlParams } from "./hooks/useUrlParams"
109
import { useRequest } from "./hooks/useRequest"
1110
import { useHistory } from "./hooks/useHistory"
12-
import { HistoryItem, Tab, AuthConfig } from "./types"
11+
import { HistoryItem, Tab } from "./types"
1312
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels"
1413
import { Toaster } from "sonner"
1514
import { getRequestNameFromUrl } from "./utils/url"
1615
import { UpdateChecker } from './components/UpdateChecker'
1716

18-
const defaultAuth: AuthConfig = {
19-
type: 'none',
20-
addTo: 'header'
21-
}
22-
2317
function App() {
2418
const { history, addHistoryItem, removeHistoryItem, clearHistory } = useHistory()
2519
const {

src/components/CollectionsPanel.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ export const CollectionsPanel = forwardRef<HTMLButtonElement, CollectionsPanelPr
296296
cookies: request.cookies,
297297
loading: false,
298298
response: null,
299-
isEditing: false
299+
isEditing: false,
300+
testScripts: request.testScripts || [],
301+
testAssertions: request.testAssertions || [],
302+
testResults: request.testResults || null
300303
});
301304
});
302305
onOpenChange(false);
@@ -350,7 +353,10 @@ export const CollectionsPanel = forwardRef<HTMLButtonElement, CollectionsPanelPr
350353
cookies: request.cookies,
351354
loading: false,
352355
response: null,
353-
isEditing: false
356+
isEditing: false,
357+
testScripts: request.testScripts || [],
358+
testAssertions: request.testAssertions || [],
359+
testResults: request.testResults || null
354360
});
355361
onOpenChange(false);
356362
}}

src/components/EnvironmentPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface EnvironmentPanelProps {
1515
onOpenChange: (open: boolean) => void
1616
}
1717

18-
export const EnvironmentPanel = forwardRef<HTMLDivElement, EnvironmentPanelProps>(
18+
export const EnvironmentPanel = forwardRef<HTMLButtonElement, EnvironmentPanelProps>(
1919
({ open, onOpenChange }, ref) => {
2020
return (
2121
<Sheet open={open} onOpenChange={onOpenChange}>

src/components/HistoryPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Input } from "@/components/ui/input"
66
import { Trash2, Search, RotateCcw } from "lucide-react"
77
import { useState, useMemo } from "react"
88
import { cn } from "@/lib/utils"
9-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
9+
import { TooltipProvider } from "@/components/ui/tooltip"
1010
import {
1111
ContextMenu,
1212
ContextMenuContent,

src/components/RequestPanel.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ export function RequestPanel({
165165
contentType,
166166
auth,
167167
cookies,
168+
testScripts,
169+
testAssertions,
170+
testResults
168171
}
169172

170173
addRequest(collectionId, requestData)
@@ -186,6 +189,9 @@ export function RequestPanel({
186189
contentType,
187190
auth,
188191
cookies,
192+
testScripts,
193+
testAssertions,
194+
testResults
189195
}
190196

191197
// Add collection and get its ID

src/components/SettingsPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface SettingsPanelProps {
1919
onOpenChange: (open: boolean) => void
2020
}
2121

22-
export const SettingsPanel = forwardRef<HTMLDivElement, SettingsPanelProps>(
22+
export const SettingsPanel = forwardRef<HTMLButtonElement, SettingsPanelProps>(
2323
({ open, onOpenChange }, ref) => {
2424
const { jsonViewer, updateJSONViewerSettings } = useSettings()
2525

src/components/TestPanel.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,11 @@ function CodeEditor({ value, onChange, className = "" }: {
3030
onChange: (value: string) => void
3131
className?: string
3232
}) {
33-
const [isFocused, setIsFocused] = useState(false)
34-
3533
return (
3634
<div className={`relative font-mono text-sm rounded-md border ${className}`}>
3735
<Textarea
3836
value={value}
3937
onChange={(e) => onChange(e.target.value)}
40-
onFocus={() => setIsFocused(true)}
41-
onBlur={() => setIsFocused(false)}
4238
className="absolute inset-0 bg-transparent text-transparent caret-white resize-none font-mono text-sm p-4 z-10"
4339
spellCheck={false}
4440
/>

src/hooks/useTabs.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect } from 'react'
2-
import { Tab, AuthConfig, TestScript, TestAssertion, TestResult } from '@/types'
2+
import { Tab, AuthConfig } from '@/types'
33
import { getRequestNameFromUrl } from '@/utils/url'
44

55
const DEFAULT_HEADERS = [
@@ -15,19 +15,6 @@ const DEFAULT_AUTH: AuthConfig = {
1515
addTo: 'header'
1616
}
1717

18-
// Utility function to get clean tab name from URL
19-
const getCleanTabName = (url: string): string => {
20-
try {
21-
// Remove query parameters
22-
const urlWithoutQuery = url.split('?')[0]
23-
// Get last part of path
24-
const lastPart = urlWithoutQuery.split('/').pop()
25-
return lastPart || "New Request"
26-
} catch (error) {
27-
return "New Request"
28-
}
29-
}
30-
3118
export function useTabs() {
3219
const [activeTab, setActiveTab] = useState<string>("")
3320
const [tabs, setTabs] = useState<Tab[]>([])

src/store/collections.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export interface SavedRequest {
2424
contentType: string
2525
auth: Tab['auth']
2626
cookies: Tab['cookies']
27+
testScripts: Tab['testScripts']
28+
testAssertions: Tab['testAssertions']
29+
testResults: Tab['testResults']
2730
createdAt: Date
2831
updatedAt: Date
2932
}

src/utils/codeSnippets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AuthConfig, AuthType, Header, Cookie } from "@/types"
1+
import { AuthConfig, Header, Cookie } from "@/types"
22

33
interface RequestData {
44
method: string

0 commit comments

Comments
 (0)