Skip to content

Commit a5c1f73

Browse files
#RI-3644-fix data undefined
1 parent 54c65cc commit a5c1f73

File tree

5 files changed

+33
-18
lines changed

5 files changed

+33
-18
lines changed

redisinsight/ui/src/pages/databaseAnalysis/components/summary-per-data/SummaryPerData.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const SummaryPerData = ({ data, loading }: Props) => {
3131
})
3232

3333
useEffect(() => {
34-
if (data) {
34+
if (data && totalMemory && totalKeys) {
3535
setMemoryData(totalMemory?.types?.map(getChartData) as ChartData[])
3636
setKeysData(totalKeys?.types?.map(getChartData) as ChartData[])
3737
}
@@ -46,7 +46,7 @@ const SummaryPerData = ({ data, loading }: Props) => {
4646
)
4747
}
4848

49-
if ((!totalMemory || memoryData.length === 0) && (!totalKeys || keysData.length === 0)) {
49+
if ((!totalMemory || memoryData?.length === 0) && (!totalKeys || keysData?.length === 0)) {
5050
return null
5151
}
5252

redisinsight/ui/src/pages/databaseAnalysis/components/top-keys/Table.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const Table = (props: Props) => {
9595
truncateText: true,
9696
render: (name: string) => {
9797
const tooltipContent = formatLongName(name)
98+
const cellContent = name.substring(0, 200)
9899
return (
99100
<div data-testid="top-keys-table-name" className={cx(styles.delimiter, 'truncateText')}>
100101
<EuiToolTip
@@ -107,7 +108,7 @@ const Table = (props: Props) => {
107108
style={{ height: 'auto' }}
108109
onClick={() => handleRedirect(name)}
109110
>
110-
{name}
111+
{cellContent}
111112
</EuiButtonEmpty>
112113
</EuiToolTip>
113114
</div>

redisinsight/ui/src/pages/databaseAnalysis/components/top-keys/styles.module.scss

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,22 @@
5353
}
5454

5555
:global {
56-
.euiTableRowCell:first-child,
57-
.euiTableHeaderCell:first-child {
56+
.euiTableRowCell:first-child {
5857
padding-left: 12px;
5958
}
6059

61-
.euiTableRowCell:last-child,
62-
.euiTableHeaderCell:last-child {
60+
.euiTableRowCell:last-child {
6361
padding-right: 12px;
6462
}
6563

64+
.euiTableHeaderCell:first-child .euiTableCellContent {
65+
padding-left: 24px;
66+
}
67+
68+
.euiTableHeaderCell:last-child .euiTableCellContent {
69+
padding-right: 24px;
70+
}
71+
6672
.euiTableHeaderCell {
6773
min-width: 42px;
6874
background-color: var(--euiColorEmptyShade);
@@ -103,12 +109,12 @@
103109
}
104110
}
105111

106-
.euiTableCellContent {
107-
padding: 12px 12px 12px 12px;
112+
.euiTableRowCell .euiTableCellContent {
113+
padding: 10px;
108114
font: normal normal normal 14px/24px Graphik;
109115

110116
&:global(.dataType) {
111-
padding: 12px 6px 4px;
117+
padding: 10px 6px 2px;
112118
}
113119
}
114120

redisinsight/ui/src/pages/databaseAnalysis/components/top-namespace/Table.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ const NameSpacesTable = (props: Props) => {
117117
className: 'nsp-cell',
118118
render: (nsp: string, { types }: { types: any[] }) => {
119119
const filterType = types.length > 1 ? null : types[0].type
120-
const tooltipContent = formatLongName(`${nsp}${delimiter}*`)
120+
const textWithDelimiter = `${nsp}${delimiter}*`
121+
const cellContent = textWithDelimiter?.substring(0, 200)
122+
const tooltipContent = formatLongName(textWithDelimiter)
121123
return (
122124
<div className={cx(styles.delimiter, 'truncateText')}>
123125
<EuiToolTip
@@ -129,7 +131,7 @@ const NameSpacesTable = (props: Props) => {
129131
className={styles.link}
130132
onClick={() => handleRedirect(nsp, filterType)}
131133
>
132-
{`${nsp}${delimiter}*`}
134+
{cellContent}
133135
</EuiButtonEmpty>
134136
</EuiToolTip>
135137
</div>

redisinsight/ui/src/pages/databaseAnalysis/components/top-namespace/styles.module.scss

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,22 @@
100100
height: 42px;
101101
}
102102

103-
.euiTableRowCell:first-child,
104-
.euiTableHeaderCell:first-child {
103+
.euiTableRowCell:first-child {
105104
padding-left: 12px;
106105
}
107106

108-
.euiTableRowCell:last-child,
109-
.euiTableHeaderCell:last-child {
107+
.euiTableRowCell:last-child {
110108
padding-right: 12px;
111109
}
112110

111+
.euiTableHeaderCell:first-child .euiTableCellContent {
112+
padding-left: 24px;
113+
}
114+
115+
.euiTableHeaderCell:last-child .euiTableCellContent {
116+
padding-right: 24px;
117+
}
118+
113119
.euiTableHeaderCell {
114120
min-width: 42px;
115121
background-color: var(--euiColorEmptyShade);
@@ -155,11 +161,11 @@
155161
}
156162

157163
.euiTableCellContent {
158-
padding: 12px;
164+
padding: 10px;
159165
font: normal normal normal 14px/24px Graphik;
160166

161167
&:global(.dataType) {
162-
padding: 12px 6px 4px;
168+
padding: 10px 6px 2px;
163169
}
164170
}
165171

0 commit comments

Comments
 (0)