Skip to content

Commit 97966a8

Browse files
Merge pull request #2881 from devtron-labs/feat/command-bar
feat: command bar
2 parents 2fca72f + 20325ee commit 97966a8

File tree

129 files changed

+10063
-11940
lines changed

Some content is hidden

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

129 files changed

+10063
-11940
lines changed

.eslintignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.test.tsx
55
.eslintrc.js
66
vite.config.mts
7+
scripts/
78

89
# The following files have eslint errors/warnings
910
src/Pages/GlobalConfigurations/Authorization/APITokens/__tests__/ApiTokens.test.tsx
@@ -101,10 +102,7 @@ src/components/app/details/testViewer/TestRunDetails.tsx
101102
src/components/app/details/testViewer/TestRunList.tsx
102103
src/components/app/details/triggerView/EmptyStateCIMaterial.tsx
103104
src/components/app/details/triggerView/MaterialSource.tsx
104-
src/components/app/details/triggerView/TriggerView.tsx
105105
src/components/app/details/triggerView/__tests__/triggerview.test.tsx
106-
src/components/app/details/triggerView/cdMaterial.tsx
107-
src/components/app/details/triggerView/ciMaterial.tsx
108106
src/components/app/details/triggerView/ciWebhook.service.ts
109107
src/components/app/details/triggerView/config.ts
110108
src/components/app/details/triggerView/workflow.service.ts

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ yalc.lock
5252
!.yarn/sdks
5353
!.yarn/versions
5454
.pnp.*
55+
56+
.env.secrets
57+
scripts/

index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import url('https://fonts.googleapis.com/css2?family=Inconsolata&display=swap');
33
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700;900&display=swap');
44
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');
5+
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:[email protected]&display=swap');
56

67
/*
78
* Although this is duplicated but this would help us with consistent loader in case

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.19.0",
7+
"@devtron-labs/devtron-fe-common-lib": "1.19.0-pre-6",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",
@@ -19,7 +19,6 @@
1919
"dayjs": "^1.11.8",
2020
"dompurify": "^3.2.4",
2121
"fast-json-patch": "^3.1.1",
22-
"flexsearch": "^0.6.32",
2322
"jsonpath-plus": "^10.3.0",
2423
"moment": "^2.29.4",
2524
"query-string": "^7.1.1",
@@ -49,6 +48,7 @@
4948
"lint": "tsc --noEmit && eslint 'src/**/*.{js,jsx,ts,tsx}' --max-warnings 0",
5049
"lint-fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
5150
"start": "vite --open",
51+
"dev": "node scripts/secrets-mgr.js",
5252
"build": "NODE_OPTIONS=--max_old_space_size=8192 vite build",
5353
"serve": "vite preview",
5454
"build-light": "NODE_OPTIONS=--max_old_space_size=8192 GENERATE_SOURCEMAP=false vite build",

src/Pages/ChartStore/ChartDetails/ChartDetailsAbout.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,18 @@ export const ChartDetailsAbout = ({ chartDetails, isLoading }: ChartDetailsAbout
134134
return (
135135
<div className="flexbox-col dc__gap-20 mw-none">
136136
<div className="flexbox-col dc__gap-12">
137-
<ImageWithFallback
138-
imageProps={{
139-
src: icon,
140-
alt: 'chart-icon',
141-
className: 'br-6',
142-
height: 48,
143-
width: 48,
144-
}}
145-
fallbackImage={<Icon name="ic-helm" color="N700" size={48} />}
146-
/>
137+
<div className="h-48 dc__mxw-200">
138+
<ImageWithFallback
139+
imageProps={{
140+
src: icon,
141+
alt: 'chart-icon',
142+
className: 'br-6',
143+
height: '100%',
144+
width: 'auto',
145+
}}
146+
fallbackImage={<Icon name="ic-helm" color="N700" size={48} />}
147+
/>
148+
</div>
147149
<h2 className="m-0 fs-16 lh-24 fw-6 cn-9">{name}</h2>
148150
<p className="m-0 fs-13 lh-20 cn-9">{description}</p>
149151
</div>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { useEffect, useState } from 'react'
2+
3+
import { useRegisterShortcut, UseRegisterShortcutProvider } from '@devtron-labs/devtron-fe-common-lib'
4+
5+
import CommandBarBackdrop from './CommandBarBackdrop'
6+
import { SHORT_CUTS } from './constants'
7+
8+
import './CommandBar.scss'
9+
10+
const CommandBar = () => {
11+
const [showCommandBar, setShowCommandBar] = useState(false)
12+
const { registerShortcut, unregisterShortcut } = useRegisterShortcut()
13+
14+
const handleOpen = () => {
15+
setShowCommandBar(true)
16+
}
17+
18+
const handleClose = () => {
19+
setShowCommandBar(false)
20+
}
21+
22+
useEffect(() => {
23+
const { keys } = SHORT_CUTS.OPEN_COMMAND_BAR
24+
25+
registerShortcut({
26+
keys,
27+
description: SHORT_CUTS.OPEN_COMMAND_BAR.description,
28+
callback: handleOpen,
29+
})
30+
31+
return () => {
32+
unregisterShortcut(keys)
33+
}
34+
}, [])
35+
36+
if (!showCommandBar) {
37+
return null
38+
}
39+
40+
return (
41+
<UseRegisterShortcutProvider ignoreTags={[]}>
42+
<CommandBarBackdrop handleClose={handleClose} />
43+
</UseRegisterShortcutProvider>
44+
)
45+
}
46+
47+
export default CommandBar
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.command-bar {
2+
&__container {
3+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.04), 0 2px 8px 0 rgba(0, 0, 0, 0.04), 0 3px 17px 0 rgba(0, 0, 0, 0.04), 0 4px 30px 0 rgba(0, 0, 0, 0.13), 0 8px 48px 0 rgba(0, 0, 0, 0.15);
4+
5+
&--selected-item {
6+
background: var(--bg-hover);
7+
}
8+
9+
.search-bar {
10+
&:focus-within {
11+
border: none !important;
12+
}
13+
14+
&:hover {
15+
background: transparent !important;
16+
}
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)