Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Revamp Runtime Parameters in Resource Watcher #590

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "1.7.10",
"version": "1.7.10-beta-1",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
42 changes: 42 additions & 0 deletions src/Common/CodeMirror/Extensions/diffMap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { EditorView, Facet, ViewPlugin } from '@uiw/react-codemirror'

const Theme = EditorView.theme({
'&': { height: '100%', overflowY: 'auto' },
'& .cm-minimap-gutter': { position: 'sticky', right: 0, top: 0 },
'& .cm-minimap-inner': { height: '100%', position: 'absolute', right: 0, top: 0 },
})

export interface MinimapConfig {
create: (view: EditorView) => { dom: HTMLElement }
}

const minimapClass = ViewPlugin.fromClass(
class {
private dom: HTMLElement

constructor(view: EditorView) {
// eslint-disable-next-line no-use-before-define
if (view.state.facet(showDiffMap)) {
this.create(view)
}
}

private create(view: EditorView) {
const dom = document.createElement('div')
dom.classList.add('cm-gutters')
this.dom = dom
view.scrollDOM.insertBefore(this.dom, view.contentDOM.nextSibling)
}

destroy() {
this.dom.remove()
}
},
)

const showDiffMap = Facet.define<MinimapConfig | null, MinimapConfig | null>({
combine: (c) => c.find((o) => o !== null) ?? null,
enables: () => [Theme, minimapClass],
})

export { showDiffMap }
1 change: 1 addition & 0 deletions src/Common/Common.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export const parseRuntimeParams = (response: RuntimeParamsAPIResponseType): Runt
const runtimeParams = (response?.runtimePluginVariables ?? []).map<RuntimePluginVariables>((variable) => ({
...variable,
defaultValue: variable.value,
stepVariableId: variable.stepVariableId || Math.floor(new Date().valueOf() * Math.random())
}))

runtimeParams.push(...envVariables)
Expand Down
149 changes: 0 additions & 149 deletions src/Shared/Components/KeyValueList/KeyValueList.tsx

This file was deleted.

22 changes: 0 additions & 22 deletions src/Shared/Components/KeyValueList/constants.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/Shared/Components/KeyValueList/index.ts

This file was deleted.

73 changes: 0 additions & 73 deletions src/Shared/Components/KeyValueList/types.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const MaterialHistory = ({
return (
// added for consistent typing
// eslint-disable-next-line react/jsx-no-useless-fragment
<div className="flexbox-col dc__gap-12 py-12 px-16">
<div className="flexbox-col dc__gap-12">
{dateKeys.map((date) => {
const historyList = materialHistoryMapWithTime[date]
return (
Expand Down
1 change: 0 additions & 1 deletion src/Shared/Components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export * from './ScannedByToolModal'
export * from './FilterChips'
export * from './ActivityIndicator'
export * from './GenericSectionErrorState'
export * from './KeyValueList'
export * from './InfoIconTippy'
export * from './EditableTextArea'
export * from './Header'
Expand Down
Loading