File tree 4 files changed +16
-5
lines changed
src/custom/ResourceDetailFormatters
4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import {
35
35
StyledEnvironmentVariablesCode ,
36
36
StyledEnvironmentVariablesPre ,
37
37
StyledTitle ,
38
+ TextValue ,
38
39
Wrap
39
40
} from './styles' ;
40
41
import {
@@ -201,7 +202,7 @@ export const OperatorDynamicFormatter: React.FC<OperatorDynamicFormatterProps> =
201
202
return (
202
203
< >
203
204
< ElementData >
204
- { data }
205
+ < TextValue > { data } </ TextValue >
205
206
{ regex . test ( data ) && < CopyToClipboard data = { data } /> }
206
207
</ ElementData >
207
208
</ >
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export const Title = styled('span')({
52
52
fontFamily : 'Qanelas Soft, sans-serif'
53
53
} ) ;
54
54
55
- export const ElementData = styled ( 'span ' ) ( {
55
+ export const ElementData = styled ( 'div ' ) ( {
56
56
display : 'flex' ,
57
57
alignItems : 'center' ,
58
58
justifyContent : 'space-between' ,
@@ -184,14 +184,21 @@ export const EnvironmentVariableValue = styled('span')({
184
184
export const CodeFormatterPre = styled ( 'pre' ) ( ( { theme } ) => ( {
185
185
backgroundColor : theme . palette . mode === 'light' ? '#e9eff1' : '#212121' ,
186
186
color : theme . palette . text . primary ,
187
- width : '100%' ,
188
187
wordWrap : 'break-word' ,
189
188
overflowWrap : 'break-word' ,
190
189
wordBreak : 'break-all' ,
191
190
margin : 0 ,
192
- padding : '0.5rem'
191
+ padding : '0.5rem' ,
192
+ maxWidth : '-moz-available'
193
193
} ) ) ;
194
194
195
+ export const TextValue = styled ( Box ) ( {
196
+ whiteSpace : 'nowrap' ,
197
+ textOverflow : 'ellipsis' ,
198
+ width : 'inherit' ,
199
+ overflow : 'hidden'
200
+ } ) ;
201
+
195
202
export const CodeFormatterCode = styled ( 'code' ) ( ( { theme } ) => ( {
196
203
backgroundColor : theme . palette . mode === 'light' ? '#e9eff1' : '#212121' ,
197
204
color : theme . palette . text . primary ,
Original file line number Diff line number Diff line change @@ -264,4 +264,5 @@ export interface GetResourceCleanDataProps {
264
264
dispatchMsgToEditor ?: ( msg : any ) => void ;
265
265
activeLabels ?: string [ ] ;
266
266
showStatus ?: boolean ;
267
+ container ?: any ;
267
268
}
Original file line number Diff line number Diff line change @@ -67,13 +67,15 @@ export const useResourceCleanData = () => {
67
67
resource,
68
68
activeLabels,
69
69
dispatchMsgToEditor,
70
- showStatus = true
70
+ showStatus = true ,
71
+ container
71
72
} : GetResourceCleanDataProps ) => {
72
73
const parsedStatus = resource ?. status ?. attribute && JSON . parse ( resource ?. status ?. attribute ) ;
73
74
const parsedSpec = resource ?. spec ?. attribute && JSON . parse ( resource ?. spec . attribute ) ;
74
75
const numberStates = structureNumberStates ( parsedStatus , parsedSpec ) ;
75
76
const kind = resource ?. kind ?? resource ?. component ?. kind ;
76
77
const cleanData = {
78
+ container : container ,
77
79
age : getAge ( resource ?. metadata ?. creationTimestamp ) ,
78
80
kind : kind ,
79
81
status : showStatus && getStatus ( parsedStatus ) ,
You can’t perform that action at this time.
0 commit comments