Skip to content
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
4a2ff35
feat: add support for other strategies in OverrideStrategyTippyContent
AbhishekA1509 Oct 24, 2024
0c96409
feat: add Enterprise Tag
AbhishekA1509 Oct 24, 2024
468f212
feat: add patch merge strategy type
AbhishekA1509 Oct 24, 2024
81d14a9
feat: add non-scaling-stroke on icons related to dt
AbhishekA1509 Oct 24, 2024
6d0697c
feat: add UNPROCESSABLE_CONTENT in API_STATUS_CODE
AbhishekA1509 Oct 24, 2024
caaa07c
refactor: update CodeEditor component to use schemaURI instead of cha…
AbhishekA1509 Oct 24, 2024
8794393
feat: add mergeTemplate as mandatory key in case of override
AbhishekA1509 Oct 25, 2024
b4cd5da
fix: use useEffectAfterMount to setCode instead of useEffect
Elessar1802 Nov 8, 2024
18e0a80
Merge branch 'develop' into feat/patch-dt
AbhishekA1509 Nov 12, 2024
9bd8bf6
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Nov 12, 2024
9ffc7a4
feat: add getNullValueFromType util func
Elessar1802 Nov 12, 2024
bb7d1dc
chore: version bump
Elessar1802 Nov 12, 2024
95a6b2c
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Nov 12, 2024
a2684bf
chore: use type format for exporting types
Elessar1802 Nov 12, 2024
5d6210b
Merge branch 'develop' into feat/patch-dt
AbhishekA1509 Nov 13, 2024
8bdd2ca
chore: update version to 1.0.3-beta-2 in package.json and package-loc…
AbhishekA1509 Nov 13, 2024
c7dd2a8
feat: add DEFAULT_JSON_SCHEMA_URI constant and set default schemaURI …
AbhishekA1509 Nov 13, 2024
8483915
Merge branch 'feat/patch-dt' of github.com:devtron-labs/devtron-fe-co…
Elessar1802 Nov 13, 2024
b905a42
Merge branch 'feat/patch-dt' of github.com:devtron-labs/devtron-fe-co…
Elessar1802 Nov 13, 2024
0f364b4
refactor: streamline DeploymentTemplateConfigCommonState by consolida…
AbhishekA1509 Nov 13, 2024
44dabaa
chore: update version to 1.0.3-beta-7 in package.json and package-loc…
AbhishekA1509 Nov 13, 2024
422657a
Merge branch 'feat/patch-dt' of github.com:devtron-labs/devtron-fe-co…
Elessar1802 Nov 14, 2024
541d111
Merge branch 'feat/patch-dt' of github.com:devtron-labs/devtron-fe-co…
RohitRaj011 Nov 14, 2024
2218fe4
chore: remove unused imports in code editor
Elessar1802 Nov 14, 2024
46a83b3
feat: add default merge strategy flag
AbhishekA1509 Nov 14, 2024
e04a58e
fix: allow mergedTemplate to be null in DeploymentTemplateConfigCommo…
AbhishekA1509 Nov 14, 2024
fb89c7f
refactor: useForm - triggerDirty reset option, ConfigDatum - types add
RohitRaj011 Nov 15, 2024
7ee317d
Merge branch 'feat/patch-dt' of github.com:devtron-labs/devtron-fe-co…
RohitRaj011 Nov 15, 2024
e4ab2c2
chore: version bump
RohitRaj011 Nov 15, 2024
fa4f2f5
fix: review comments
Elessar1802 Nov 21, 2024
46e17ff
Merge pull request #393 from devtron-labs/feat/rjsf-field-selector
Elessar1802 Nov 21, 2024
74cf9f4
feat: add types to support loading merged template and mergedTemplate…
AbhishekA1509 Nov 22, 2024
48f792a
Merge branch 'feat/patch-dt' of github.com:devtron-labs/devtron-fe-co…
RohitRaj011 Nov 22, 2024
81d80f7
Merge branch 'develop' into feat/patch-dt
AbhishekA1509 Nov 22, 2024
77d9bc9
Merge branch 'feat/patch-dt' of github.com:devtron-labs/devtron-fe-co…
RohitRaj011 Nov 22, 2024
96becb8
chore: version bump
RohitRaj011 Nov 22, 2024
284495f
fix: await post in getDeploymentManifest to showError
AbhishekA1509 Nov 24, 2024
a5b3e9e
feat: Collapsible List - add support to clear query params while navi…
RohitRaj011 Nov 26, 2024
6b0214a
fix: applyCompareDiffOnUneditedDocument - function updating original …
RohitRaj011 Nov 27, 2024
310e5bf
chore: version bump
RohitRaj011 Nov 27, 2024
b831f31
Merge branch 'feat/patch-dt' of github.com:devtron-labs/devtron-fe-co…
RohitRaj011 Nov 29, 2024
914b3d4
chore: version bump
RohitRaj011 Nov 29, 2024
4b4dfbc
fix: ResizableTagTextArea - incorrect null check for dependentRef pro…
RohitRaj011 Nov 29, 2024
9e48d0d
chore: version bump
RohitRaj011 Nov 29, 2024
6050954
refactor: types update
RohitRaj011 Dec 2, 2024
ea4eb30
chore: version bump
RohitRaj011 Dec 2, 2024
7e65cdf
Merge branch 'develop' into feat/patch-dt
AbhishekA1509 Dec 3, 2024
713af0d
Merge branch 'feat/patch-dt' of github.com:devtron-labs/devtron-fe-co…
RohitRaj011 Dec 3, 2024
601fe08
chore: version bump
RohitRaj011 Dec 3, 2024
07a0abd
fix: add null check for markdown
AbhishekA1509 Dec 3, 2024
375c291
Merge pull request #434 from devtron-labs/fix/markdown-null-check
AbhishekA1509 Dec 4, 2024
80e3dff
Merge pull request #421 from devtron-labs/feat/cm-secret-patch-dry-run
RohitRaj011 Dec 4, 2024
c70dbf8
chore: version bump
RohitRaj011 Dec 4, 2024
1f2fd13
Merge branch 'develop' into feat/patch-dt
AbhishekA1509 Dec 5, 2024
293d1e8
bump version to 1.2.3-beta-2 in package.json and package-lock.json
AbhishekA1509 Dec 5, 2024
17f9e15
chore: update to common beta-6
AbhishekA1509 Dec 5, 2024
651787c
bump version to 1.2.3-beta-7 in package.json
AbhishekA1509 Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.0.3",
"version": "1.0.3-beta-7",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/Assets/Icon/ic-file-code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/Assets/Icon/ic-medal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions src/Assets/Icon/ic-stamp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions src/Assets/Icon/ic-visibility-on.svg

This file was deleted.

8 changes: 4 additions & 4 deletions src/Common/CodeEditor/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
InformationBarProps,
} from './types'
import { CodeEditorReducer, initialState } from './CodeEditor.reducer'
import { MODES } from '../Constants'
import { DEFAULT_JSON_SCHEMA_URI, MODES } from '../Constants'

const CodeEditorContext = React.createContext(null)

Expand Down Expand Up @@ -76,7 +76,7 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
customLoader,
focus,
validatorSchema,
chartVersion,
schemaURI = DEFAULT_JSON_SCHEMA_URI,
isKubernetes = true,
cleanData = false,
onBlur,
Expand Down Expand Up @@ -230,7 +230,7 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
isKubernetes,
schemas: [
{
uri: `https://github.com/devtron-labs/devtron/tree/main/scripts/devtron-reference-helm-charts/reference-chart_${chartVersion}/schema.json`, // id of the first schema
uri: schemaURI,
fileMatch: ['*'], // associate with our model
schema: validatorSchema,
},
Expand All @@ -240,7 +240,7 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
config.dispose()
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [validatorSchema, chartVersion])
}, [validatorSchema, schemaURI])
useEffect(() => {
if (!editorRef.current) {
return
Expand Down
2 changes: 1 addition & 1 deletion src/Common/CodeEditor/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface CodeEditorBaseInterface {
validatorSchema?: any
isKubernetes?: boolean
cleanData?: boolean
chartVersion?: any
schemaURI?: string
/**
* If true, disable the in-built search of monaco editor
* @default false
Expand Down
2 changes: 2 additions & 0 deletions src/Common/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const Host = window?.__ORCHESTRATOR_ROOT__ ?? '/orchestrator'
export const DOCUMENTATION_HOME_PAGE = 'https://docs.devtron.ai'
export const DOCUMENTATION_VERSION = '/v/v0.7'
export const DISCORD_LINK = 'https://discord.devtron.ai/'
export const DEFAULT_JSON_SCHEMA_URI = 'https://json-schema.org/draft/2020-12/schema'
export const DOCUMENTATION = {
APP_METRICS: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/applications/app-details/app-metrics`,
APP_TAGS: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/applications/create-application#tags`,
Expand Down Expand Up @@ -513,6 +514,7 @@ export const API_STATUS_CODES = {
NOT_FOUND: 404,
EXPECTATION_FAILED: 417,
LOCKED: 423,
UNPROCESSABLE_CONTENT: 422,
}

export enum SERVER_MODE {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ interface BaseDeploymentTemplateConfigState {
mergeStrategy?: never
}

interface EnvironmentOverrideDeploymentTemplateConfigState {
type EnvironmentOverrideDeploymentTemplateConfigState = {
chartConfig?: never
isOverridden: boolean
environmentConfig: EnvironmentConfigType
Expand All @@ -136,7 +136,7 @@ interface EnvironmentOverrideDeploymentTemplateConfigState {

export interface DeploymentTemplateConfigCommonState extends SelectedChartDetailsType {
/**
* The first ever state of the deployment template
* The first ever state of the deployment template on editor
*/
originalTemplate: Record<string, string>
isAppMetricsEnabled: boolean
Expand All @@ -146,6 +146,22 @@ export interface DeploymentTemplateConfigCommonState extends SelectedChartDetail
latestDraft?: DraftMetadataDTO
editorTemplate: string
editorTemplateWithoutLockedKeys: string
// Have added the mergedTemplate states in base as well so as to have a single source of truth to get the final template
/**
* This final template to be applied on the deployment in string format
* In current editor, this may be null initially
*/
mergedTemplate: string | null
/**
* This final template to be applied on the deployment without locked keys in string format
* In current editor, this may be null initially
*/
mergedTemplateWithoutLockedKeys: string | null
/**
* This final template to be applied on the deployment in object format
* In current editor, this may be null initially
*/
mergedTemplateObject: Record<string, string> | null
}

export type DeploymentTemplateConfigState = DeploymentTemplateConfigCommonState &
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
const OverrideStrategyTippyContent = () => (
import { OverrideStrategyTippyContentProps } from './types'

const OverrideStrategyTippyContent = ({ children }: OverrideStrategyTippyContentProps) => (
<div className="p-12 flexbox-col dc__gap-20">
<p className="m-0 fs-13 lh-20 cn-9 fw-4">
Merge strategy determines how environment configurations are combined with inherited configurations
configurations. Choose the strategy that best suits your needs:
</p>

<ul className="pl-12 m-0-imp">
{children}

<li className="m-0 fs-13 lh-20 cn-9 fw-4">
<strong className="m-0 fw-6">Replace:</strong>&nbsp;Overwrites inherited values with
environment-specific ones. Use when you want to completely change inherited settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ export enum ConfigToolbarPopupNodeType {
DISCARD_DRAFT = 'discardDraft',
EDIT_HISTORY = 'editHistory',
}

export interface OverrideStrategyTippyContentProps {
/**
* Would be rendered as li conveying the information about the merge strategy
*/
children?: ReactNode
}
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ const getDiffHeading = <DeploymentTemplate extends boolean>(
if (isApprovalPending) {
return (
<div className="flexbox dc__align-items-center dc__gap-8 ">
<ICStamp className="icon-dim-16" />
<ICStamp className="icon-dim-16 scv-5 dc__no-shrink" />
<span className="fs-12 fw-6 cv-5">Approval pending</span>
</div>
)
Expand Down
10 changes: 10 additions & 0 deletions src/Shared/Components/EnterpriseTag/EnterpriseTag.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ReactComponent as ICMedal } from '@Icons/ic-medal.svg'

const EnterpriseTag = () => (
<div className="px-4 py-2 flex dc__gap-2 br-4 ey-2 bcy-1 dc__no-shrink">
<ICMedal className="icon-dim-12 dc__no-shrink scy-7" />
<span className="cy-7 fs-11 fw-6 lh-16">Enterprise</span>
</div>
)

export default EnterpriseTag
1 change: 1 addition & 0 deletions src/Shared/Components/EnterpriseTag/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as EnterpriseTag } from './EnterpriseTag.component'
1 change: 1 addition & 0 deletions src/Shared/Components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ export * from './Collapse'
export * from './Security'
export * from './Button'
export * from './InvalidYAMLTippy'
export * from './EnterpriseTag'
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

import { OverrideMergeStrategyType } from '@Pages/Applications'

export interface customEnv {
SENTRY_ENV?: string
SENTRY_ERROR_ENABLED?: boolean
Expand Down Expand Up @@ -88,6 +90,7 @@ export interface customEnv {
FEATURE_PROMO_EMBEDDED_MODAL_TITLE?: string
FEATURE_PROMO_EMBEDDED_IFRAME_URL?: string
FEATURE_BULK_RESTART_WORKLOADS_FROM_RB: string
FEATURE_DEFAULT_MERGE_STRATEGY?: OverrideMergeStrategyType
}
declare global {
interface Window {
Expand Down