Skip to content

Commit 978d01d

Browse files
committed
refactor: migrate Pages/App to Pages/Applications & add parseAllSearchParamsForUseUrlFilters
1 parent 4ed3e08 commit 978d01d

File tree

27 files changed

+138
-118
lines changed

27 files changed

+138
-118
lines changed

src/Common/Common.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ import {
4141
GlobalVariableDTO,
4242
GlobalVariableOptionType,
4343
} from './Types'
44-
import { ApiResourceType } from '../Pages'
44+
import { ApiResourceType, STAGE_MAP } from '../Pages'
4545
import { RefVariableType } from './CIPipeline.Types'
46-
import { STAGE_MAP } from '@Pages/App/Trigger/constants'
4746

4847
export const getTeamListMin = (): Promise<TeamList> => {
4948
// ignore active field

src/Common/Drawer/Drawer.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,9 @@
5454
bottom: 0;
5555
}
5656
}
57+
58+
.drawer.disable-transition {
59+
&.left, &.right, &.top, &.bottom {
60+
transition: none;
61+
}
62+
}

src/Common/Drawer/Drawer.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { preventBodyScroll } from '../../Shared'
1919
import { VisibleModal } from '../Modals/VisibleModal'
2020
import './Drawer.scss'
2121

22-
interface drawerInterface {
22+
export interface DrawerProps {
2323
position: 'left' | 'right' | 'bottom' | 'top'
2424
children?: any
2525
backdrop?: boolean
@@ -30,6 +30,7 @@ interface drawerInterface {
3030
height?: string
3131
parentClassName?: string
3232
onEscape?: (e?: any) => void
33+
disableTransition?: boolean
3334
}
3435

3536
export const Drawer = ({
@@ -42,7 +43,8 @@ export const Drawer = ({
4243
parentClassName,
4344
onEscape,
4445
onClose,
45-
}: drawerInterface) => {
46+
disableTransition,
47+
}: DrawerProps) => {
4648
const drawerRef = useRef(null)
4749
useEffect(() => {
4850
setTimeout(() => drawerRef.current?.classList?.add('show'), 1)
@@ -63,7 +65,7 @@ export const Drawer = ({
6365
}
6466
return (
6567
<VisibleModal className="drawer--container" parentClassName={parentClassName || ''} onEscape={onEscape} close={onClose}>
66-
<aside style={style} ref={drawerRef} className={`drawer ${position}`}>
68+
<aside style={style} ref={drawerRef} className={`drawer ${disableTransition ? 'disable-transition' : ''} ${position}`}>
6769
{children}
6870
</aside>
6971
</VisibleModal>

src/Common/Hooks/useUrlFilters/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616

1717
export { default as useUrlFilters } from './useUrlFilters'
1818
export type { UseUrlFiltersProps, UseUrlFiltersReturnType } from './types'
19+
export { parseAllSearchParamsForUseUrlFilters } from './utils'

src/Common/Hooks/useUrlFilters/utils.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ export const setItemInLocalStorageIfKeyExists = (localStorageKey: string, value:
33
localStorage.setItem(localStorageKey, value)
44
}
55
}
6+
7+
export const parseAllSearchParamsForUseUrlFilters = <T,>(params: URLSearchParams) =>
8+
Array.from(params.entries()).reduce((acc, [key, value]) => {
9+
acc[key] = value
10+
return acc
11+
}, {} as T)

src/Pages/App/AppConfiguration/DeploymentTemplate/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Pages/App/AppConfiguration/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Pages/App/AppDetails/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Pages/App/AppDetails/types.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Pages/App/Trigger/index.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)