Skip to content

Commit df32123

Browse files
authored
Merge branch 'master' into feat/panel
2 parents b13ff72 + fdb745a commit df32123

33 files changed

+692
-68
lines changed

.github/workflows/bump-meshery-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
cache: "npm"
117117
cache-dependency-path: '**/package-lock.json'
118118
- name: Make changes to pull request
119-
run: npm install @layer5/sistent@${{needs.versions-check.outputs.current}}
119+
run: npm install @layer5/sistent@${{needs.versions-check.outputs.current}} --legacy-peer-deps
120120
- name: Create Pull Request
121121
id: cpr
122122
uses: peter-evans/create-pull-request@v7

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/base/Pagination/Pagination.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
import { Pagination as MuiPagination, PaginationProps as MuiPaginationProps } from '@mui/material';
1+
import {
2+
Pagination as MuiPagination,
3+
PaginationItem as MuiPaginationItem,
4+
PaginationProps as MuiPaginationProps
5+
} from '@mui/material';
26
import React from 'react';
37

48
const Pagination = React.forwardRef<HTMLDivElement, MuiPaginationProps>((props, ref) => {
59
return <MuiPagination {...props} ref={ref} />;
610
});
711

12+
export { MuiPaginationItem as PaginationItem };
813
export default Pagination;

src/base/Pagination/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PaginationProps } from '@mui/material';
2-
import Pagination from './Pagination';
2+
import Pagination, { PaginationItem } from './Pagination';
33

4-
export { Pagination };
4+
export { Pagination, PaginationItem };
55
export type { PaginationProps };

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/style.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ export const RedirectLink = styled(Link)(({ theme }) => ({
264264
export const ShareButtonGroup = styled(ButtonGroup)({
265265
boxShadow: 'none',
266266
border: 'none',
267-
outline: 'none',
268-
height: '76%'
267+
outline: 'none'
269268
});
270269

271270
export const ShareButton = styled(Button)(({ theme }) => ({

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/Prompt/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import PromptComponent from './promt-component';
2-
1+
import PromptComponent, { PROMPT_VARIANTS } from './promt-component';
2+
export { PROMPT_VARIANTS, PromptComponent };
33
export default PromptComponent;

src/custom/Prompt/promt-component.tsx

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
2-
import { Typography } from '../../base';
2+
import { Checkbox, FormControlLabel, Typography } from '../../base';
33
import { useTheme } from '../../theme';
44
import { Modal, ModalBody, ModalButtonPrimary, ModalButtonSecondary, ModalFooter } from '../Modal';
55
import { ActionComponent, Subtitle } from './style';
@@ -26,6 +26,8 @@ interface State {
2626
showInfoIcon?: string;
2727
variant?: PromptVariant;
2828
headerIcon?: React.ReactNode;
29+
showCheckbox?: boolean;
30+
isChecked?: boolean;
2931
}
3032

3133
interface ShowParams {
@@ -34,11 +36,13 @@ interface ShowParams {
3436
primaryOption: string;
3537
variant: PromptVariant;
3638
showInfoIcon?: string;
39+
showCheckbox?: boolean;
3740
headerIcon?: React.ReactNode;
3841
}
3942

4043
export interface PromptRef {
4144
show: (params: ShowParams) => Promise<string>;
45+
getCheckboxState: () => boolean;
4246
}
4347

4448
const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) => {
@@ -49,7 +53,9 @@ const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) =>
4953
primaryOption: '',
5054
showInfoIcon: '',
5155
variant,
52-
headerIcon: undefined
56+
headerIcon: undefined,
57+
isChecked: false,
58+
showCheckbox: false
5359
});
5460

5561
/* This ref is used to store the resolve and reject functions of the promise returned by the show method */
@@ -67,7 +73,8 @@ const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) =>
6773
setState({
6874
...params,
6975
isOpen: true,
70-
showInfoIcon: params.showInfoIcon || ''
76+
showInfoIcon: params.showInfoIcon || '',
77+
showCheckbox: !!params.showCheckbox
7178
});
7279
});
7380
};
@@ -77,11 +84,20 @@ const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) =>
7784
setState((prevState) => ({ ...prevState, isOpen: false }));
7885
};
7986

87+
const handleCheckboxChange = () => {
88+
setState((prevState) => ({ ...prevState, isChecked: !prevState.isChecked }));
89+
};
90+
91+
const getCheckboxState = () => {
92+
return !!state.isChecked;
93+
};
94+
8095
useImperativeHandle(ref, () => ({
81-
show
96+
show,
97+
getCheckboxState
8298
}));
8399

84-
const { isOpen, primaryOption, title, subtitle, showInfoIcon, headerIcon } = state;
100+
const { isOpen, primaryOption, title, subtitle, showInfoIcon, headerIcon, showCheckbox } = state;
85101
const { resolve } = promiseInfoRef.current;
86102

87103
return (
@@ -96,10 +112,28 @@ const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) =>
96112
{subtitle && (
97113
<ModalBody>
98114
<Subtitle id="alert-dialog-description" variant="body1" component="div">
99-
<Typography variant="body1" component="div">
115+
<Typography
116+
variant="body1"
117+
component="div"
118+
style={{
119+
color: theme.palette.text.primary
120+
}}
121+
>
100122
{subtitle}
101123
</Typography>
102124
</Subtitle>
125+
{showCheckbox && (
126+
<FormControlLabel
127+
control={
128+
<Checkbox
129+
checked={getCheckboxState()}
130+
onChange={handleCheckboxChange}
131+
color="primary"
132+
/>
133+
}
134+
label={<span style={{ fontSize: '1rem' }}>Do not show again</span>}
135+
/>
136+
)}
103137
</ModalBody>
104138
)}
105139
<ModalFooter variant="filled" helpText={showInfoIcon}>

0 commit comments

Comments
 (0)