Skip to content

Commit 46ddb03

Browse files
authored
Merge branch 'master' into fix/popOver
Signed-off-by: TheFaheem <[email protected]>
2 parents 43b3c2d + 1e89833 commit 46ddb03

File tree

17 files changed

+147
-102
lines changed

17 files changed

+147
-102
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
cache-dependency-path: '**/package-lock.json'
4040
- name: Make changes to pull request
4141
working-directory: ui
42-
run: npm install @layer5/sistent@${{needs.versions-check.outputs.current}}
42+
run: npm install @sistent/sistent@${{needs.versions-check.outputs.current}}
4343
- name: Create Pull Request
4444
id: cpr
4545
uses: peter-evans/create-pull-request@v7
@@ -78,7 +78,7 @@ jobs:
7878
cache-dependency-path: '**/package-lock.json'
7979
- name: Make changes to pull request
8080
working-directory: meshmap
81-
run: npm install @layer5/sistent@${{needs.versions-check.outputs.current}}
81+
run: npm install @sistent/sistent@${{needs.versions-check.outputs.current}}
8282
- name: Create Pull Request
8383
id: cpr
8484
uses: peter-evans/create-pull-request@v7
@@ -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}} --legacy-peer-deps
119+
run: npm install @sistent/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
@@ -155,7 +155,7 @@ jobs:
155155
cache-dependency-path: '**/package-lock.json'
156156
- name: Make changes to pull request
157157
working-directory: ui
158-
run: npm install @layer5/sistent@${{needs.versions-check.outputs.current}}
158+
run: npm install @sistent/sistent@${{needs.versions-check.outputs.current}}
159159
- name: Create Pull Request
160160
id: cpr
161161
uses: peter-evans/create-pull-request@v7

README.md

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
1-
# Layer5 Design System Sistent
1+
# Sistent Design System Sistent
22

3-
The Sistent Design System from Layer5 provides the open source building blocks to design and implement consistent, accessible, and delightful product experiences.
4-
5-
<hr>
6-
<h3 align="center"> --> Visit <a href="https://layer5.io/projects/sistent">https://layer5.io/projects/sistent</a></h3>
7-
<hr>
8-
9-
## Using Sistent
10-
11-
Visit the Sistent website for further instructions.
12-
13-
### Brand
14-
15-
- Layer5 Brand Guide ([PDF](https://layer5.io/brand/brand-guide.pdf))
16-
- [Layer5 Logos](https://layer5.io/company/brand) (more assets available in shared Community drive).
17-
18-
### Components and Packages
19-
20-
- Design System components in React.js
3+
The Sistent Design System provides the open source building blocks to design and implement consistent, accessible, and delightful product experiences. Visit the <a href="https://layer5.io/projects/sistent">project website</a> for more information.
214

225
## Contributing to Sistent
236

@@ -94,7 +77,7 @@ npm install <path-to-sistent-on-local-machine>
9477
This will update your Sistent dependency to:
9578
9679
```
97-
"@layer5/sistent" : "file:../../sistent"
80+
"@sistent/sistent" : "file:../../sistent"
9881
```
9982
10083
2. Build your local Sistent fork
@@ -117,12 +100,13 @@ Now, your project should reflect changes from your local Sistent fork.
117100
If you want to remove the local Sistent fork from your project, run:
118101
119102
```
120-
npm uninstall @layer5/sistent
103+
npm uninstall @sistent/sistent
121104
```
122105
123106
This will remove the local Sistent package from your project. You will have to reinstall the official package using this command:
107+
124108
```
125-
npm install @layer5/sistent
109+
npm install @sistent/sistent
126110
```
127111
128112
#### Method 2: Using `npm link`
@@ -140,7 +124,7 @@ This creates a global symlink which points to the local Sistent fork.
140124
2. Link the local Sistent fork to your project
141125
142126
```
143-
npm link @layer5/sistent
127+
npm link @sistent/sistent
144128
```
145129
146130
3.Build your local Sistent fork
@@ -168,24 +152,25 @@ To verify that the correct link has been created, run this command:
168152
npm ls -g
169153

170154
# Expected output:
171-
# ├── @layer5/sistent@0.14.11 -> ./../../../../<path-to-local-sistent-fork>
155+
# ├── @sistent/sistent@0.14.11 -> ./../../../../<path-to-local-sistent-fork>
172156
```
173157
174158
To verify that the created link is correctly used in your project, run this command in the directory where you linked the Sistent fork:
175159
176160
```
177-
ls -l node_modules/@layer5/sistent
161+
ls -l node_modules/@sistent/sistent
178162

179163
# Expected output:
180-
# node_modules/@layer5/sistent -> ../../../../../sistent
164+
# node_modules/@sistent/sistent -> ../../../../../sistent
181165
```
182166
183167
To revert back to the official package, first unlink the package, then install the official package using the following commands:
184168
185169
```
186-
npm unlink @layer5/sistent
187-
npm install @layer5/sistent
170+
npm unlink @sistent/sistent
171+
npm install @sistent/sistent
188172
```
173+
189174
> [!NOTE]
190175
> Avoid using `type any` in your code. Always specify explicit types to ensure type safety and maintainability.
191176
@@ -228,4 +213,4 @@ Find out more on the <a href="https://layer5.io/community">Layer5 community</a>.
228213
✔️<em><strong>Explore more</strong></em> in the <a href="https://layer5.io/community/handbook">Community Handbook</a>.<br />
229214
</p>
230215
<p align="center">
231-
<i>Not sure where to start?</i> Grab an open issue with the <a href="https://github.com/issues?q=is%3Aopen+is%3Aissue+archived%3Afalse+org%3Alayer5io+org%3Ameshery+org%3Alayer5labs+org%3Aservice-mesh-performance+org%3Aservice-mesh-patterns+label%3A%22help+wanted%22+">help-wanted label</a>.</p>
216+
<i>Not sure where to start?</i> Grab an open issue with the <a href="https://github.com/issues?q=is%3Aopen+is%3Aissue+archived%3Afalse+(org%3Alayer5io+OR+org%3Ameshery+OR+org%3Alayer5labs+OR+org%3Aservice-mesh-performance+OR+org%3Aservice-mesh-patterns+OR+org%3Ameshery-extensions)+label%3A%22help+wanted%22">help-wanted label</a>.</p>

site/gatsby-browser.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react";
22
import { ThemeProvider } from './src/components/Theme';
33
import './src/styles/global.css';
4-
import React from "react";
54

65
export const wrapRootElement = ({ element }) => <ThemeProvider>{element}</ThemeProvider>;

site/package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/custom/CatalogFilterSection/CatalogFilterSidebar.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,10 @@ import { Box, Drawer, Typography } from '../../base';
55
import { CloseIcon } from '../../icons';
66
import { darkTeal } from '../../theme';
77
import { darkModalGradient, lightModalGradient } from '../../theme/colors/colors';
8+
import { CustomTooltip } from '../CustomTooltip';
89
import { CloseBtn } from '../Modal';
910
import CatalogFilterSidebarState from './CatalogFilterSidebarState';
10-
import {
11-
FilterButton,
12-
FilterDrawerDiv,
13-
FilterText,
14-
FiltersCardDiv,
15-
FiltersDrawerHeader
16-
} from './style';
11+
import { FilterButton, FilterDrawerDiv, FiltersCardDiv, FiltersDrawerHeader } from './style';
1712

1813
export interface FilterOption {
1914
value: string;
@@ -109,13 +104,14 @@ const CatalogFilterSidebar: React.FC<CatalogFilterSidebarProps> = ({
109104
/>
110105
</FiltersCardDiv>
111106
<FilterDrawerDiv>
112-
<FilterButton variant="contained" onClick={handleDrawerOpen}>
113-
<FilterAltIcon
114-
style={{ height: '28px', width: '28px' }}
115-
fill={theme.palette.text.default}
116-
/>
117-
<FilterText>Filters</FilterText>
118-
</FilterButton>
107+
<CustomTooltip title="Filters" placement="bottom">
108+
<FilterButton variant="contained" onClick={handleDrawerOpen}>
109+
<FilterAltIcon
110+
style={{ height: '28px', width: '28px' }}
111+
fill={theme.palette.text.default}
112+
/>
113+
</FilterButton>
114+
</CustomTooltip>
119115

120116
<Drawer
121117
anchor="bottom"

src/custom/CustomCatalog/Helper.ts

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ const getValidSvgPaths = async (
4242
return validSvgPaths;
4343
};
4444

45+
// Parses the pattern file content (YAML) and returns the version field.
46+
// If parsing fails or version is missing, returns the default version.
47+
const getWorkingVersionFromPatternFile = (patternFileContent: string) => {
48+
try {
49+
const patternFile = jsyaml.load(patternFileContent);
50+
return patternFile?.version || DEFAULT_DESIGN_VERSION;
51+
} catch (e) {
52+
console.error('Failed to parse pattern file to get version:', e);
53+
return DEFAULT_DESIGN_VERSION;
54+
}
55+
};
56+
4557
interface HandleImageProps {
4658
technologies: string[];
4759
basePath?: string;
@@ -60,15 +72,18 @@ export const handleImage = async ({
6072
};
6173
export const DEFAULT_DESIGN_VERSION = '0.0.0';
6274

75+
// Returns the version of a design based on its visibility.
76+
// - For 'published' designs, returns the stable published version.
77+
// - For 'public' or 'private', returns the working version from the pattern file.
78+
// - Defaults to the working version if visibility is unrecognized.
6379
export const getVersion = (design: Pattern) => {
64-
if (design.visibility === 'public') {
65-
return design?.catalog_data?.published_version || DEFAULT_DESIGN_VERSION;
66-
}
67-
try {
68-
const patternFile = jsyaml.load(design.pattern_file);
69-
return patternFile?.version || DEFAULT_DESIGN_VERSION;
70-
} catch (e) {
71-
console.error(e);
72-
return DEFAULT_DESIGN_VERSION;
80+
switch (design.visibility) {
81+
case 'published':
82+
return design?.catalog_data?.published_version || DEFAULT_DESIGN_VERSION;
83+
case 'public':
84+
case 'private':
85+
return getWorkingVersionFromPatternFile(design.pattern_file);
86+
default:
87+
return getWorkingVersionFromPatternFile(design.pattern_file);
7388
}
7489
};

src/custom/ErrorBoundary/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The `ErrorBoundary` component is designed to catch errors that occur within its
99
Wrap your component with the `ErrorBoundary`:
1010

1111
```tsx
12-
import { ErrorBoundary } from '@layer5/sistent';
12+
import { ErrorBoundary } from '@sistent/sistent';
1313

1414
const MyComponent = () => {
1515
// Your component logic
@@ -43,7 +43,7 @@ const MyComponent = () => {
4343
Wrap your component using `withErrorBoundary`:
4444

4545
```tsx
46-
import { withErrorBoundary } from '@layer5/sistent';
46+
import { withErrorBoundary } from '@sistent/sistent';
4747

4848
const MyComponent = withErrorBoundary(() => {
4949
return {
@@ -61,7 +61,7 @@ const MyComponent = withErrorBoundary(() => {
6161
Wrap your component using withSuppressedErrorBoundary:
6262

6363
```tsx
64-
import { withSuppressedErrorBoundary } from '@layer5/sistent';
64+
import { withSuppressedErrorBoundary } from '@sistent/sistent';
6565

6666
const MyComponent = withSuppressedErrorBoundary(() => {
6767
return {

src/custom/Modal/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ export const ModalBody = styled(Paper)(({ theme }) => ({
121121
padding: '1rem',
122122
backgroundColor: theme.palette.background.surfaces,
123123
overflowY: 'auto',
124-
height: '100%'
124+
height: '100%',
125+
scrollbarWidth: 'none',
126+
'&::-webkit-scrollbar': {
127+
display: 'none'
128+
},
129+
'-ms-overflow-style': 'none'
125130
}));
126131

127132
const StyledFooter = styled('div', {

src/custom/PerformersSection/PerformersSection.tsx

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { memo, useMemo } from 'react';
33
import { Box, Button } from '../../base';
44
import { iconXSmall } from '../../constants/iconsSizes';
55
import { LeaderBoardIcon, TropyIcon } from '../../icons';
6-
import { useTheme } from '../../theme';
6+
import { useMediaQuery, useTheme } from '../../theme';
77
import { Carousel } from '../Carousel';
88
import { Pattern } from '../CustomCatalog/CustomCard';
99
import { ErrorBoundary } from '../ErrorBoundary';
@@ -228,6 +228,7 @@ const PerformersSection: React.FC<PerformersSectionProps> = ({
228228
}) => {
229229
const theme = useTheme();
230230
const { queries, isLoading, hasError } = useMetricQueries(useGetCatalogFilters);
231+
const smallScreen = useMediaQuery(theme.breakpoints.down('sm'));
231232

232233
const stats = useMemo(
233234
() =>
@@ -265,14 +266,31 @@ const PerformersSection: React.FC<PerformersSectionProps> = ({
265266
style={{
266267
height: '2rem',
267268
width: '2rem',
268-
color: theme.palette.icon.secondary
269+
color: theme.palette.icon.secondary,
270+
display: smallScreen ? 'none' : 'inline-flex'
269271
}}
270272
/>
271273
</Box>
272274
{onOpenLeaderboard && (
273-
<Button variant="contained" onClick={() => onOpenLeaderboard()}>
274-
Open Leaderboard
275-
</Button>
275+
<div>
276+
<Button variant="contained" onClick={() => onOpenLeaderboard()}>
277+
<TropyIcon
278+
style={{
279+
height: '2rem',
280+
width: '2rem',
281+
display: smallScreen ? 'inline-flex' : 'none'
282+
}}
283+
/>
284+
<p
285+
style={{
286+
margin: 0,
287+
display: smallScreen ? 'none' : 'inline-flex'
288+
}}
289+
>
290+
Open Leaderboard
291+
</p>
292+
</Button>
293+
</div>
276294
)}
277295
</TitleBox>
278296
<CardsContainer>

src/custom/PerformersSection/PerformersToogleButton.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ interface PerformersSectionButtonProps {
1010
handleClick: () => void;
1111
}
1212

13+
interface OpenLeaderBoardButtonProps {
14+
handleClick: () => void;
15+
}
16+
1317
const PerformersSectionButton: React.FC<PerformersSectionButtonProps> = ({ open, handleClick }) => {
1418
const theme = useTheme();
1519

@@ -21,7 +25,7 @@ const PerformersSectionButton: React.FC<PerformersSectionButtonProps> = ({ open,
2125
onClick={handleClick}
2226
sx={{
2327
height: '3.7rem',
24-
padding: '0.3rem'
28+
padding: '0.3rem 1rem 0.3rem 0.3rem'
2529
}}
2630
style={{
2731
backgroundColor: open ? undefined : theme.palette.background.constant?.disabled
@@ -35,6 +39,24 @@ const PerformersSectionButton: React.FC<PerformersSectionButtonProps> = ({ open,
3539
);
3640
};
3741

42+
const OpenLeaderBoardButton: React.FC<OpenLeaderBoardButtonProps> = ({ handleClick }) => {
43+
return (
44+
<CustomTooltip title={'Open Leaderboard'} placement="bottom">
45+
<Button
46+
variant="contained"
47+
onClick={handleClick}
48+
sx={{
49+
height: '3.7rem',
50+
padding: '0.3rem',
51+
display: { xs: 'inline-flex', sm: 'none' }
52+
}}
53+
>
54+
<TropyIcon style={{ height: '2rem', width: '2rem' }} />
55+
</Button>
56+
</CustomTooltip>
57+
);
58+
};
59+
3860
export const StateCardSekeleton = () => {
3961
return (
4062
<CardSkeleton>
@@ -53,4 +75,4 @@ export const StateCardSekeleton = () => {
5375
</CardSkeleton>
5476
);
5577
};
56-
export default PerformersSectionButton;
78+
export { OpenLeaderBoardButton, PerformersSectionButton };

0 commit comments

Comments
 (0)