Skip to content

Commit 80299a4

Browse files
authored
Merge pull request #239 from devtron-labs/feat/global-config-revamp
feat: Gobal Config Revamp
2 parents 30e4d61 + e386e80 commit 80299a4

File tree

5 files changed

+31
-28
lines changed

5 files changed

+31
-28
lines changed

package-lock.json

Lines changed: 2 additions & 2 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.2.5",
3+
"version": "0.2.7",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/CustomTagSelector/TagDetails.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const TagDetails = ({
3030
removeTag,
3131
tabIndex = 1,
3232
suggestedTagsOptions,
33+
hidePropagateTag,
3334
}: TagDetailType) => {
3435
const keyRef = useRef(null)
3536
const valueRef = useRef(null)
@@ -56,13 +57,15 @@ export const TagDetails = ({
5657
}
5758
return (
5859
<div className="flexbox mb-8">
59-
<div
60-
className={`dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ${tagData.propagate ? 'bcn-7' : ''} ${tagData.key.startsWith('devtron.ai/') ? 'cursor-not-allowed bcn-1' : ''}`}
61-
onClick={propagateTagToResource}
62-
data-testid={`propagate-tag-${index}`}
63-
>
64-
<InjectTag className={`icon-dim-20 mt-4 ${tagData.propagate ? 'scn-0' : ''}`} />
65-
</div>
60+
{!hidePropagateTag && (
61+
<div
62+
className={`dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ${tagData.propagate ? 'bcn-7' : ''} ${tagData.key.startsWith('devtron.ai/') ? 'cursor-not-allowed bcn-1' : ''}`}
63+
onClick={propagateTagToResource}
64+
data-testid={`propagate-tag-${index}`}
65+
>
66+
<InjectTag className={`icon-dim-20 mt-4 ${tagData.propagate ? 'scn-0' : ''}`} />
67+
</div>
68+
)}
6669
<TagLabelValueSelector
6770
selectedTagIndex={index}
6871
tagData={tagData}

src/Common/CustomTagSelector/TagLabelSelect.tsx

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { DEFAULT_TAG_DATA } from '../Constants'
2020
import { TagLabelSelectType } from './Types'
2121
import { TagDetails } from './TagDetails'
2222

23-
export const TagLabelSelect = ({ isCreateApp, labelTags, setLabelTags, tabIndex = 0 }: TagLabelSelectType) => {
23+
export const TagLabelSelect = ({ isCreateApp, labelTags, setLabelTags, tabIndex = 0, hidePropagateTag }: TagLabelSelectType) => {
2424
const setTagData = (index, tagValue): void => {
2525
const _tags = [...labelTags]
2626
const _tagValue = tagValue
@@ -46,29 +46,27 @@ export const TagLabelSelect = ({ isCreateApp, labelTags, setLabelTags, tabIndex
4646
return (
4747
<div>
4848
<div className="flexbox dc__content-space mb-8">
49-
<span>Tags</span>
50-
<PropagateTagInfo isCreateApp={isCreateApp} />
51-
</div>
52-
<div>
5349
<div
5450
className="dc_width-max-content cb-5 fw-6 fs-13 flexbox mr-20 mb-8 cursor"
5551
onClick={addNewTag}
5652
data-testid="add-tag-button"
5753
>
58-
<Add className="icon-dim-20 fcb-5" /> Add tag
59-
</div>
60-
<div className="mb-8" data-testid="tag-rows-container">
61-
{labelTags?.map((tagData, index) => (
62-
<TagDetails
63-
key={`tag-${index}`}
64-
index={index}
65-
tagData={tagData}
66-
setTagData={setTagData}
67-
removeTag={removeTag}
68-
tabIndex={tabIndex + (index + 2)}
69-
/>
70-
))}
54+
<Add className="icon-dim-20 fcb-5" /> Add
7155
</div>
56+
{!hidePropagateTag && <PropagateTagInfo isCreateApp={isCreateApp} />}
57+
</div>
58+
<div className="mb-8" data-testid="tag-rows-container">
59+
{labelTags?.map((tagData, index) => (
60+
<TagDetails
61+
key={`tag-${index}`}
62+
index={index}
63+
tagData={tagData}
64+
setTagData={setTagData}
65+
removeTag={removeTag}
66+
tabIndex={tabIndex + (index + 2)}
67+
hidePropagateTag={hidePropagateTag}
68+
/>
69+
))}
7270
</div>
7371
</div>
7472
)

src/Common/CustomTagSelector/Types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export interface TagLabelSelectType {
4646
selectedProjectId?: number
4747
suggestedTagsOptions?: SuggestedTagOptionType[]
4848
reloadProjectTags?: boolean
49+
hidePropagateTag?: boolean
4950
}
5051

5152
export interface TagDetailType {
@@ -55,6 +56,7 @@ export interface TagDetailType {
5556
removeTag?: (index: number) => void
5657
tabIndex?: number
5758
suggestedTagsOptions?: SuggestedTagOptionType[]
59+
hidePropagateTag?: boolean
5860
}
5961

6062
export interface TagLabelValueSelectorType {

0 commit comments

Comments
 (0)