Skip to content
This repository was archived by the owner on Feb 28, 2026. It is now read-only.

Commit 8537d19

Browse files
authored
Merge pull request #116 from sanyamjain04/improved-code-quality
improve code quality
2 parents 17234fb + ae3e364 commit 8537d19

10 files changed

Lines changed: 12 additions & 31 deletions

File tree

frontend/src/components/dbfragments/cheatsheet/cheatsheet.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import styles from './cheatsheet.module.scss'
21
import React, { useRef, useState } from 'react'
32
import { DBConnType } from '../../../data/defaults'
43
import CheatsheetCommand from './command'

frontend/src/components/dbfragments/query.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import styles from './query.module.scss'
22
import React, { useContext, useEffect, useState } from 'react'
33
import toast from 'react-hot-toast'
4-
import { DBConnection, DBQuery, DBQueryData, DBQueryResult, Tab } from '../../data/models'
4+
import { DBConnection, DBQueryData, DBQueryResult, Tab } from '../../data/models'
55
import QueryEditor from './queryeditor/queryeditor'
66
import { selectDBConnection } from '../../redux/dbConnectionSlice'
77
import { useAppDispatch, useAppSelector } from '../../redux/hooks'
@@ -14,10 +14,7 @@ import { closeTab, updateActiveTab } from '../../redux/tabsSlice'
1414
import TabContext from '../layouts/tabcontext'
1515

1616

17-
type DBQueryPropType = {
18-
}
19-
20-
const DBQueryFragment = (_: DBQueryPropType) => {
17+
const DBQueryFragment = () => {
2118

2219
const dispatch = useAppDispatch()
2320

frontend/src/components/dbfragments/showmodel.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import { useAppSelector } from '../../redux/hooks'
55
import TabContext from '../layouts/tabcontext'
66
import DataModel from './datamodel/datamodel'
77

8-
type DBShowModelPropType = {
9-
10-
}
11-
12-
const DBShowModelFragment = (_: DBShowModelPropType) => {
8+
const DBShowModelFragment = () => {
139

1410
const dbConnection: DBConnection | undefined = useAppSelector(selectDBConnection)
1511
const currentTab: Tab = useContext(TabContext)!

frontend/src/components/dbfragments/table/addmodal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styles from './table.module.scss'
22
import React, { useContext, useState } from 'react'
33
import { ApiResult, AddDataResponse, DBConnection, DBQueryData, Tab } from '../../../data/models'
44
import toast from 'react-hot-toast'
5-
import { useAppDispatch, useAppSelector } from '../../../redux/hooks'
5+
import { useAppDispatch } from '../../../redux/hooks'
66
import { addDBData, setQueryData } from '../../../redux/dataModelSlice'
77
import { DBConnType } from '../../../data/defaults'
88
import TabContext from '../../layouts/tabcontext'

frontend/src/components/layouts/applayout.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { FunctionComponent, useEffect } from 'react'
1+
import React, { FunctionComponent } from 'react'
22
import Header from './header'
33
import Footer from './footer'
44
import Sidebar from './sidebar'
@@ -7,11 +7,7 @@ import { useAppSelector } from '../../redux/hooks';
77
import { selectIsShowingSidebar } from '../../redux/configSlice';
88
import TabsBar from './tabsbar';
99

10-
type PageLayoutPropType = {
11-
12-
}
13-
14-
const AppLayout: FunctionComponent<PageLayoutPropType> = () => {
10+
const AppLayout: FunctionComponent = () => {
1511

1612
const location = useLocation()
1713

frontend/src/components/layouts/footer.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import Constants from '../../constants'
55
import { useEffect } from 'react'
66
import { checkConnection, selectDBConnection, selectIsDBConnected, getDBDataModels, resetDBDataModels } from '../../redux/dbConnectionSlice'
77

8-
9-
type FooterPropType = {}
10-
11-
const Footer = (_: FooterPropType) => {
8+
const Footer = () => {
129

1310
const navigate = useNavigate()
1411
const location = useLocation()

frontend/src/components/layouts/header.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import { selectProjects } from '../../redux/projectsSlice'
1010
import { selectDBConnection } from '../../redux/dbConnectionSlice'
1111
import utils from '../../lib/utils'
1212

13-
declare var window: any;
14-
15-
type HeaderPropType = {}
16-
17-
const Header = (_: HeaderPropType) => {
13+
const Header = () => {
1814

1915
let location = useLocation()
2016
const navigate = useNavigate()

frontend/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface ConstantsType {
1515
}
1616

1717
declare global {
18-
var CONFIG: {
18+
const CONFIG: {
1919
API_HOST: string;
2020
}
2121
}

frontend/src/redux/allDBConnectionsSlice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const getAllDBConnections = createAsyncThunk(
4242

4343
export const addNewDBConn = createAsyncThunk(
4444
'allDBConnections/addNewDBConn',
45-
async (payload: AddDBConnPayload, { rejectWithValue, getState }: any) => {
45+
async (payload: AddDBConnPayload, { rejectWithValue }: any) => {
4646
const response = await eventService.addNewDBConn(payload)
4747
if (response.success) {
4848
const dbConn = response.success ? response.data : null
@@ -60,7 +60,7 @@ export const allDBConnectionSlice = createSlice({
6060
name: 'allDBConnections',
6161
initialState,
6262
reducers: {
63-
reset: (state) => initialState
63+
reset: () => initialState
6464
},
6565
extraReducers: (builder) => {
6666
builder

frontend/src/redux/projectsSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const projectsSlice = createSlice({
113113
name: 'projects',
114114
initialState,
115115
reducers: {
116-
reset: (state) => initialState
116+
reset: () => initialState
117117
},
118118
extraReducers: (builder) => {
119119
builder

0 commit comments

Comments
 (0)