Skip to content

Commit 2b606dc

Browse files
Merge pull request #1607 from devtron-labs/chore/build-infra-helpers
chore: move highlight text to common and add base classes
2 parents 46493f6 + 118e17b commit 2b606dc

File tree

3 files changed

+23
-31
lines changed

3 files changed

+23
-31
lines changed

package.json

Lines changed: 1 addition & 1 deletion
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": "0.0.58-beta-8",
7+
"@devtron-labs/devtron-fe-common-lib": "0.0.58-beta-22",
88
"@rjsf/core": "^5.13.3",
99
"@rjsf/utils": "^5.13.3",
1010
"@rjsf/validator-ajv8": "^5.13.3",

src/components/common/helpers/Helpers.tsx

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,34 +1022,6 @@ export const highlightSearchedText = (searchText: string, matchString: string):
10221022
return matchString.replace(regex, highlightText)
10231023
}
10241024

1025-
interface HighlightSearchTextProps {
1026-
/**
1027-
* The text to be highlighted
1028-
*/
1029-
searchText: string
1030-
/**
1031-
* The whole text string
1032-
*/
1033-
text: string
1034-
/**
1035-
* The classes to be applied to the highlighted text
1036-
*/
1037-
highlightClasses?: string
1038-
}
1039-
1040-
export const highlightSearchText = ({ searchText, text, highlightClasses }: HighlightSearchTextProps): string => {
1041-
if (!searchText) {
1042-
return text
1043-
}
1044-
1045-
try {
1046-
const regex = new RegExp(searchText, 'gi')
1047-
return text.replace(regex, (match) => `<span class="${highlightClasses}">${match}</span>`)
1048-
} catch (error) {
1049-
return text
1050-
}
1051-
}
1052-
10531025
export const trackByGAEvent = (category: string, action: string): void => {
10541026
ReactGA.event({
10551027
category: category,

src/css/base.scss

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,8 +1682,16 @@ button.anchor {
16821682
}
16831683

16841684
&.dc__visible-hover--parent:hover {
1685-
.dc__visible-hover--child {
1686-
display: inherit;
1685+
.dc__visible-hover {
1686+
// If we give this class then the element will be visible on hover
1687+
&--child {
1688+
display: inherit;
1689+
}
1690+
1691+
// For hiding a child on hover on parent
1692+
&--hide-child {
1693+
display: none;
1694+
}
16871695
}
16881696
}
16891697
}
@@ -2475,6 +2483,10 @@ textarea,
24752483

24762484
.bc-b50 {
24772485
background-color: var(--B50);
2486+
2487+
&--imp {
2488+
background-color: var(--B50) !important;
2489+
}
24782490
}
24792491

24802492
.c-n50 {
@@ -2742,6 +2754,10 @@ textarea,
27422754
min-width: 116px;
27432755
}
27442756

2757+
.mw-140 {
2758+
min-width: 140px;
2759+
}
2760+
27452761
.mw-232 {
27462762
min-width: 232px;
27472763
}
@@ -3900,6 +3916,10 @@ textarea::placeholder {
39003916
z-index: 4;
39013917
}
39023918

3919+
.dc__zi-5 {
3920+
z-index: 5;
3921+
}
3922+
39033923
.dc__zi-20 {
39043924
z-index: 20;
39053925
}

0 commit comments

Comments
 (0)