Skip to content

Commit 283c3e1

Browse files
authored
Merge branch 'master' into fix-share
2 parents 5763094 + 0320125 commit 283c3e1

File tree

19 files changed

+87
-36
lines changed

19 files changed

+87
-36
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ Find out more on the <a href="https://layer5.io/community">Layer5 community</a>.
9191
<br /><br /><br /><br />
9292

9393
</p>
94-
9594
<div>&nbsp;</div>
9695

9796
<a href="https://slack.meshery.io">

src/custom/CatalogDetail/ActionButton.tsx

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,31 +76,13 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
7676
width: '100%'
7777
}}
7878
>
79-
<ActionButton
80-
sx={{
81-
borderRadius: '0.2rem',
82-
backgroundColor: 'transparent',
83-
border: `1px solid ${theme.palette.border.normal}`,
84-
gap: '10px',
85-
color: theme.palette.text.default
86-
}}
87-
onClick={() =>
88-
cleanedType === VIEWS
89-
? downloadYaml(details.pattern_file, details.name)
90-
: downloadPattern(details.id, details.name, getDownloadUrl)
91-
}
92-
>
93-
<Download width={24} height={24} fill={theme.palette.icon.default} />
94-
Download
95-
</ActionButton>
96-
9779
{cleanedType !== FILTERS && (
9880
<ActionButton
9981
sx={{
82+
backgroundColor: showOpenPlaygroundAction ? 'transparent' : undefined,
83+
color: theme.palette.text.default,
10084
borderRadius: '0.2rem',
10185
gap: '10px',
102-
color: theme.palette.text.default,
103-
backgroundColor: 'transparent',
10486
border: `1px solid ${theme.palette.border.normal}`
10587
}}
10688
onClick={() => handleClone(details?.name, details?.id)}
@@ -116,6 +98,23 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
11698
)}
11799
</ActionButton>
118100
)}
101+
<ActionButton
102+
sx={{
103+
borderRadius: '0.2rem',
104+
backgroundColor: 'transparent',
105+
border: `1px solid ${theme.palette.border.normal}`,
106+
gap: '10px',
107+
color: theme.palette.text.default
108+
}}
109+
onClick={() =>
110+
cleanedType === VIEWS
111+
? downloadYaml(details.pattern_file, details.name)
112+
: downloadPattern(details.id, details.name, getDownloadUrl)
113+
}
114+
>
115+
<Download width={24} height={24} fill={theme.palette.icon.default} />
116+
Download
117+
</ActionButton>
119118
</div>
120119
)}
121120

src/custom/CatalogDetail/SocialSharePopper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const SocialSharePopper: React.FC<SocialSharePopperProps> = ({
8383
size="small"
8484
onClick={() => handleCopyUrl(cleanedType, details?.name, details?.id)}
8585
>
86-
<ChainIcon height={'24'} width={'24'} fill={theme.palette.icon.inverse} />
86+
<ChainIcon height={'24'} width={'24'} fill={theme.palette.text.constant?.white} />
8787
</ShareSideButton>
8888
</CustomTooltip>
8989
</ShareButtonGroup>

src/custom/Markdown/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
BasicAnchorMarkdown,
66
StyledMarkdown,
77
StyledMarkdownBlockquote,
8+
StyledMarkdownCode,
89
StyledMarkdownH1,
910
StyledMarkdownH2,
1011
StyledMarkdownH3,
@@ -54,7 +55,8 @@ export const RenderMarkdown: React.FC<RenderMarkdownProps> = ({ content }) => {
5455
li: ({ ...props }) => <StyledMarkdownLi>{props.children}</StyledMarkdownLi>,
5556
th: ({ ...props }) => <StyledMarkdownTh>{props.children}</StyledMarkdownTh>,
5657
td: ({ ...props }) => <StyledMarkdownTd>{props.children}</StyledMarkdownTd>,
57-
pre: ({ ...props }) => <StyledMarkdownPre>{props.children}</StyledMarkdownPre>
58+
pre: ({ ...props }) => <StyledMarkdownPre>{props.children}</StyledMarkdownPre>,
59+
code: ({ ...props }) => <StyledMarkdownCode>{props.children}</StyledMarkdownCode>
5860
}}
5961
>
6062
{content}

src/custom/Markdown/style.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,12 @@ export const StyledMarkdownPre = styled('pre')(({ theme }) => ({
9898
whiteSpace: 'pre-line',
9999
fontFamily: 'inherit'
100100
}));
101+
102+
export const StyledMarkdownCode = styled('code')(({ theme }) => ({
103+
background: theme.palette.background.code,
104+
whiteSpace: 'pre-line',
105+
padding: '1.5px',
106+
paddingInline: '5px',
107+
fontFamily: 'inherit',
108+
borderRadius: 3
109+
}));

src/custom/ResourceDetailFormatters/Formatter.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
StyledEnvironmentVariablesCode,
3636
StyledEnvironmentVariablesPre,
3737
StyledTitle,
38+
TextValue,
3839
Wrap
3940
} from './styles';
4041
import {
@@ -201,7 +202,7 @@ export const OperatorDynamicFormatter: React.FC<OperatorDynamicFormatterProps> =
201202
return (
202203
<>
203204
<ElementData>
204-
{data}
205+
<TextValue>{data}</TextValue>
205206
{regex.test(data) && <CopyToClipboard data={data} />}
206207
</ElementData>
207208
</>

src/custom/ResourceDetailFormatters/styles.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const Title = styled('span')({
5252
fontFamily: 'Qanelas Soft, sans-serif'
5353
});
5454

55-
export const ElementData = styled('span')({
55+
export const ElementData = styled('div')({
5656
display: 'flex',
5757
alignItems: 'center',
5858
justifyContent: 'space-between',
@@ -184,14 +184,21 @@ export const EnvironmentVariableValue = styled('span')({
184184
export const CodeFormatterPre = styled('pre')(({ theme }) => ({
185185
backgroundColor: theme.palette.mode === 'light' ? '#e9eff1' : '#212121',
186186
color: theme.palette.text.primary,
187-
width: '100%',
188187
wordWrap: 'break-word',
189188
overflowWrap: 'break-word',
190189
wordBreak: 'break-all',
191190
margin: 0,
192-
padding: '0.5rem'
191+
padding: '0.5rem',
192+
maxWidth: '-moz-available'
193193
}));
194194

195+
export const TextValue = styled(Box)({
196+
whiteSpace: 'nowrap',
197+
textOverflow: 'ellipsis',
198+
width: 'inherit',
199+
overflow: 'hidden'
200+
});
201+
195202
export const CodeFormatterCode = styled('code')(({ theme }) => ({
196203
backgroundColor: theme.palette.mode === 'light' ? '#e9eff1' : '#212121',
197204
color: theme.palette.text.primary,

src/custom/ResourceDetailFormatters/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,4 +264,5 @@ export interface GetResourceCleanDataProps {
264264
dispatchMsgToEditor?: (msg: any) => void;
265265
activeLabels?: string[];
266266
showStatus?: boolean;
267+
container?: any;
267268
}

src/custom/ResourceDetailFormatters/useResourceCleanData.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,15 @@ export const useResourceCleanData = () => {
6767
resource,
6868
activeLabels,
6969
dispatchMsgToEditor,
70-
showStatus = true
70+
showStatus = true,
71+
container
7172
}: GetResourceCleanDataProps) => {
7273
const parsedStatus = resource?.status?.attribute && JSON.parse(resource?.status?.attribute);
7374
const parsedSpec = resource?.spec?.attribute && JSON.parse(resource?.spec.attribute);
7475
const numberStates = structureNumberStates(parsedStatus, parsedSpec);
7576
const kind = resource?.kind ?? resource?.component?.kind;
7677
const cleanData = {
78+
container: container,
7779
age: getAge(resource?.metadata?.creationTimestamp),
7880
kind: kind,
7981
status: showStatus && getStatus(parsedStatus),

src/custom/ShareModal/ShareModal.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,14 @@ const ShareModal: React.FC<ShareModalProps> = ({
257257
<PublicIcon
258258
width={24}
259259
height={24}
260+
fill={theme.palette.icon.default}
260261
stroke={theme.palette.mode === 'dark' ? WHITE : BLACK}
261262
/>
262263
) : (
263264
<LockIcon
264265
width={24}
265266
height={24}
267+
fill={theme.palette.icon.default}
266268
stroke={theme.palette.mode === 'dark' ? WHITE : BLACK}
267269
/>
268270
)}
@@ -289,7 +291,13 @@ const ShareModal: React.FC<ShareModalProps> = ({
289291
</MenuItem>
290292
))}
291293
</CustomSelect>
292-
<Typography component="span" variant="body2">
294+
<Typography
295+
sx={{
296+
color: theme.palette.text.secondary
297+
}}
298+
component="span"
299+
variant="body2"
300+
>
293301
{selectedOption === SHARE_MODE.PRIVATE ? options.PRIVATE : options.PUBLIC}
294302
</Typography>
295303
</div>

0 commit comments

Comments
 (0)