Skip to content

Commit fbbf8a2

Browse files
committed
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-lib into feat/plugin-policy
2 parents fdfebbb + a0e2669 commit fbbf8a2

File tree

80 files changed

+1604
-435
lines changed

Some content is hidden

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

80 files changed

+1604
-435
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Increment tag for patch or minor
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- closed # Trigger only when a PR is closed (merged or not)
9+
10+
jobs:
11+
tag:
12+
if: github.event.pull_request.merged == true
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Create new tag
21+
env:
22+
TOKEN: ${{ secrets.TAG_CREATION_TOKEN_PUBLIC }}
23+
run: |
24+
echo $TOKEN | gh auth login --with-token
25+
latest_tag=$(git tag | sort -V | tail -n 1)
26+
echo "Latest tag: $latest_tag"
27+
28+
# Extract major and minor versions
29+
version=$(echo $latest_tag | cut -d. -f1-2)
30+
# Extract patch version
31+
patch=$(echo $latest_tag | cut -d. -f3)
32+
# Extract minor version
33+
minor=$(echo $latest_tag | cut -d. -f2)
34+
major=$(echo $latest_tag | cut -d. -f1)
35+
36+
# Check if the incoming branch starts with 'release-candidate-'
37+
incoming_branch="${{ github.head_ref }}"
38+
if [[ "$incoming_branch" == release-candidate-* ]]; then
39+
# Increment minor version and reset patch
40+
new_minor=$((minor+1))
41+
new_tag="$major.$new_minor.0"
42+
echo "New tag will be (minor increment): $new_tag"
43+
else
44+
# Increment patch version
45+
new_tag="$version.$((patch+1))"
46+
echo "New tag will be (patch increment): $new_tag"
47+
fi
48+
49+
git config --global user.email "devops@devtron.ai"
50+
git config --global user.name "systemsdt"
51+
git tag $new_tag
52+
git push origin $new_tag

package-lock.json

Lines changed: 2 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.5.2-beta-5",
3+
"version": "0.5.8-beta-1",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
@@ -83,9 +83,7 @@
8383
"react-dom": "^17.0.2",
8484
"react-draggable": "^4.4.5",
8585
"react-ga4": "^1.4.1",
86-
"react-keybind": "^0.9.4",
8786
"react-mde": "^11.5.0",
88-
"react-router": "^5.3.0",
8987
"react-router-dom": "^5.3.0",
9088
"react-select": "5.8.0",
9189
"rxjs": "^7.8.1",

src/Assets/Icon/ic-warning-y5.svg

Lines changed: 20 additions & 0 deletions
Loading

src/Common/ChartVersionAndTypeSelector.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@
1515
*/
1616

1717
import { useEffect, useState } from 'react'
18+
import { SelectPicker, SelectPickerVariantType } from '@Shared/Components'
1819
import { fetchChartTemplateVersions } from './Common.service'
19-
import { ChartVersionAndTypeSelectorProps, DeploymentChartVersionType } from './Types'
20+
import { ChartVersionAndTypeSelectorProps } from './Types'
2021
import { getFilteredChartVersions, showError } from './Helper'
21-
import { SelectPicker, SelectPickerVariantType } from '@Shared/Components'
22+
23+
interface DeploymentChartVersionType {
24+
chartRefId: number
25+
chartVersion: string
26+
chartType: string
27+
type: number
28+
}
2229

2330
// @TODO: Generalize this component to be used in CodeEditor as Chart selector toolbar
2431
// when the Code Editor is moved to the fe-common-lib

src/Common/CodeEditor/CodeEditor.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import ReactGA from 'react-ga4'
2121
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'
2222
import { configureMonacoYaml } from 'monaco-yaml'
2323

24+
import { ReactComponent as ICWarningY5 } from '@Icons/ic-warning-y5.svg'
2425
import { ReactComponent as Info } from '../../Assets/Icon/ic-info-filled.svg'
2526
import { ReactComponent as ErrorIcon } from '../../Assets/Icon/ic-error-exclamation.svg'
26-
import { ReactComponent as WarningIcon } from '../../Assets/Icon/ic-warning.svg'
2727
import './codeEditor.scss'
2828
import 'monaco-editor'
2929

@@ -348,7 +348,7 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
348348
<CodeEditorPlaceholder customLoader={customLoader} />
349349
) : (
350350
<>
351-
{shebang && <div className="shebang">{shebang}</div>}
351+
{shebang && <div className="code-editor__shebang">{shebang}</div>}
352352
{state.diffMode ? (
353353
<MonacoDiffEditor
354354
original={
@@ -452,7 +452,7 @@ const ValidationError = () => {
452452

453453
const Warning: React.FC<InformationBarProps> = (props) => (
454454
<div className={`code-editor__warning ${props.className || ''}`}>
455-
<WarningIcon className="code-editor__information-info-icon" />
455+
<ICWarningY5 className="code-editor__information-info-icon" />
456456
{props.text}
457457
{props.children}
458458
</div>
@@ -476,7 +476,7 @@ const Information: React.FC<InformationBarProps> = (props) => (
476476

477477
const Clipboard = () => {
478478
const { state } = useCodeEditorContext()
479-
return <ClipboardButton content={state.code} rootClassName="bcn-1" iconSize={20} />
479+
return <ClipboardButton content={state.code} iconSize={16} />
480480
}
481481

482482
const SplitPane = ({}) => {

src/Common/CodeEditor/codeEditor.scss

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,6 @@
105105
min-height: 300px;
106106
}
107107

108-
.code-editor__warning {
109-
font-size: 12px;
110-
font-weight: 400;
111-
line-height: 1.33;
112-
letter-spacing: normal;
113-
color: var(--Y700);
114-
height: auto;
115-
padding: 8px 16px;
116-
border-bottom: 1px solid #d6dbdf;
117-
background-color: var(--Y100);
118-
}
119-
120108
.code-editor__information {
121109
font-size: 12px;
122110
font-weight: 400;
@@ -171,3 +159,9 @@
171159
z-index: 9;
172160
}
173161
}
162+
163+
.code-editor__shebang {
164+
padding: 0 52px;
165+
color: #151515;
166+
opacity: 0.6;
167+
}

src/Common/Constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const DOCUMENTATION_HOME_PAGE = 'https://docs.devtron.ai'
2424
export const DOCUMENTATION_VERSION = '/v/v0.7'
2525
export const DISCORD_LINK = 'https://discord.devtron.ai/'
2626
export const DOCUMENTATION = {
27+
APP_METRICS: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/applications/app-details/app-metrics`,
2728
APP_TAGS: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/applications/create-application#tags`,
2829
APP_OVERVIEW_TAGS: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/applications/overview#manage-tags`,
2930
BLOB_STORAGE: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/getting-started/install/installation-configuration#configuration-of-blob-storage`,
@@ -65,11 +66,13 @@ export const URLS = {
6566
GLOBAL_CONFIG_SCOPED_VARIABLES: '/global-config/scoped-variables',
6667
GLOBAL_CONFIG_DEPLOYMENT_CHARTS_LIST: '/global-config/deployment-charts',
6768
NETWORK_STATUS_INTERFACE: '/network-status-interface',
69+
CONFIG_DRIFT: 'config-drift',
6870
}
6971

7072
export const ROUTES = {
7173
APP: 'app',
7274
APP_ARTIFACT_PROMOTE_MATERIAL: 'app/artifact/promotion-request/material',
75+
APP_TEMPLATE_DATA: 'app/template/data',
7376
PROJECT_LIST_MIN: 'team/autocomplete',
7477
USER_CHECK_ROLE: 'user/check/roles',
7578
IMAGE_TAGGING: 'app/image-tagging',
@@ -507,6 +510,7 @@ export const API_STATUS_CODES = {
507510
PERMISSION_DENIED: 403,
508511
NOT_FOUND: 404,
509512
EXPECTATION_FAILED: 417,
513+
LOCKED: 423,
510514
}
511515

512516
export enum SERVER_MODE {

src/Common/Helper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ export const powerSetOfSubstringsFromStart = (strings: string[], regex: RegExp)
642642
return _keys
643643
})
644644

645-
export const convertJSONPointerToJSONPath = (pointer: string) => pointer.replace(/\//g, '.').replace(/\./, '$.')
645+
export const convertJSONPointerToJSONPath = (pointer: string) => pointer.replace(/\/([\*0-9]+)\//g, '[$1].').replace(/\//g, '.').replace(/\./, '$.')
646646

647647
export const flatMapOfJSONPaths = (
648648
paths: string[],

src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcut.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616

1717
import { useContext } from 'react'
18-
import { context } from './UseRegisterShortcutContext'
18+
import { UseRegisterShortcutContext } from './UseRegisterShortcutContext'
1919

20-
const useRegisterShortcut = () => useContext(context)
20+
const useRegisterShortcut = () => useContext(UseRegisterShortcutContext)
2121

2222
export default useRegisterShortcut

0 commit comments

Comments
 (0)