Skip to content

Commit 33771ad

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/examples/next-12/next-14.2.26
2 parents 37c2614 + 7e263fb commit 33771ad

File tree

23 files changed

+686
-190
lines changed

23 files changed

+686
-190
lines changed

README.md

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ To run tests:
7171
make tests
7272
```
7373

74-
#### Using your local Sistent Fork in a Project
74+
### Using your local Sistent Fork in a Project
75+
76+
#### Method 1: Manual Installation
7577

7678
1. Install your local Sistent package in the project
7779

@@ -110,16 +112,80 @@ make build
110112
make ui-build
111113
```
112114
113-
Now your project should reflect changes from your local Sistent fork.
115+
Now, your project should reflect changes from your local Sistent fork.
114116
115117
If you want to remove the local Sistent fork from your project, run:
116118
117119
```
118120
npm uninstall @layer5/sistent
119121
```
120122
121-
This will remove the local Sistent package from your project. You will have to install the standard package again after running this command.
123+
This will remove the local Sistent package from your project. You will have to reinstall the official package using this command:
124+
```
125+
npm install @layer5/sistent
126+
```
127+
128+
#### Method 2: Using `npm link`
129+
130+
1. Create a link of your local Sistent fork
131+
132+
```
133+
cd <path-to-sistent-on-local-machine>
134+
135+
npm link
136+
```
137+
138+
This creates a global symlink which points to the local Sistent fork.
139+
140+
2. Link the local Sistent fork to your project
141+
142+
```
143+
npm link @layer5/sistent
144+
```
145+
146+
3.Build your local Sistent fork
147+
148+
After making changes to your fork, run this command in your local Sistent package.
149+
150+
```
151+
make build
152+
```
153+
154+
4. Run the build command in the project where your local Sistent fork is installed.
155+
156+
```
157+
# example, Meshery UI
158+
make ui-build
159+
```
160+
161+
Now, your project should reflect changes from your local Sistent fork.
162+
163+
5. Verify that your local Sistent fork has been correctly linked.
164+
165+
To verify that the correct link has been created, run this command:
166+
167+
```
168+
npm ls -g
122169

170+
# Expected output:
171+
# ├── @layer5/sistent@0.14.11 -> ./../../../../<path-to-local-sistent-fork>
172+
```
173+
174+
To verify that the created link is correctly used in your project, run this command in the directory where you linked the Sistent fork:
175+
176+
```
177+
ls -l node_modules/@layer5/sistent
178+
179+
# Expected output:
180+
# node_modules/@layer5/sistent -> ../../../../../sistent
181+
```
182+
183+
To revert back to the official package, first unlink the package, then install the official package using the following commands:
184+
185+
```
186+
npm unlink @layer5/sistent
187+
npm install @layer5/sistent
188+
```
123189
> [!NOTE]
124190
> Avoid using `type any` in your code. Always specify explicit types to ensure type safety and maintainability.
125191

src/constants/constants.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,21 @@ export const MESHERY_CLOUD_PROD = 'https://cloud.layer5.io';
6767
export const MESHERY_CLOUD_STAGING = 'staging-cloud.layer5.io';
6868
export const MESHERY_CLOUD_WS_PROD = 'cloud-ws.layer5.io';
6969
export const MESHERY_CLOUD_WS_STAGING = 'staging-cloud-ws.layer5.io:6543';
70+
71+
export const EVENT_TYPES = {
72+
SUCCESS: {
73+
type: 'success'
74+
},
75+
DEFAULT: {
76+
type: 'default'
77+
},
78+
INFO: {
79+
type: 'info'
80+
},
81+
WARNING: {
82+
type: 'warning'
83+
},
84+
ERROR: {
85+
type: 'error'
86+
}
87+
};

src/custom/Carousel/style.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,31 @@ export const CarouselButton = styled('button')(({ theme }) => ({
1717
color: '#fff'
1818
},
1919
'&:first-of-type': {
20-
left: '-1.2rem'
20+
left: '-0.5rem'
2121
},
2222
'&:last-of-type': {
23-
right: '-1.2rem'
23+
right: '-0.5rem'
2424
}
2525
}));
2626

2727
export const CarouselWrapper = styled('div')({
2828
display: 'flex',
2929
alignItems: 'center',
3030
width: '100%',
31-
position: 'relative'
31+
position: 'relative',
32+
padding: '0 3rem'
3233
});
3334

3435
export const CarouselContainer = styled('div')({
3536
display: 'flex',
3637
overflowX: 'auto',
3738
scrollBehavior: 'smooth',
3839
scrollSnapType: 'x mandatory',
39-
gap: '1rem',
40-
padding: '1rem 0',
40+
gap: '0.5rem',
41+
paddingBottom: '1rem',
4142
width: '100%',
43+
msOverflowStyle: 'none',
44+
scrollbarWidth: 'none',
4245
'&::-webkit-scrollbar': {
4346
display: 'none'
4447
},

src/custom/CatalogDesignTable/DesignTableColumnConfig.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { Lock, Public } from '@mui/icons-material';
2-
import RemoveCircleIcon from '@mui/icons-material/RemoveCircle';
32
import { Theme } from '@mui/material';
43
import { MUIDataTableColumn, MUIDataTableMeta } from 'mui-datatables';
54
import { Typography } from '../../base';
65
import { PLAYGROUND_MODES } from '../../constants/constants';
7-
import { ChainIcon, CopyIcon, KanvasIcon, PublishIcon } from '../../icons';
6+
import { ChainIcon, CopyIcon, KanvasIcon, MoveFileIcon, PublishIcon } from '../../icons';
87
import Download from '../../icons/Download/Download';
98
import { downloadPattern, slugify } from '../CatalogDetail/helper';
109
import { RESOURCE_TYPES } from '../CatalogDetail/types';
@@ -267,14 +266,10 @@ export const createDesignsColumnsConfig = ({
267266
},
268267

269268
{
270-
title: isFromWorkspaceTable ? 'Move Design' : 'Delete',
271-
disabled: isFromWorkspaceTable ? !isRemoveAllowed : !isDeleteAllowed,
269+
title: 'Delete',
270+
disabled: !isDeleteAllowed,
272271
onClick: () => handleDeleteModal(rowData)(),
273-
icon: isFromWorkspaceTable ? (
274-
<RemoveCircleIcon style={{ color: theme?.palette.icon.default }} />
275-
) : (
276-
<L5DeleteIcon />
277-
)
272+
icon: <L5DeleteIcon />
278273
}
279274
].filter((a) => a?.hidden != true);
280275

@@ -299,6 +294,17 @@ export const createDesignsColumnsConfig = ({
299294
icon: <CopyIcon width={24} height={24} fill={theme?.palette.icon.secondary} />
300295
};
301296

297+
const moveAction = {
298+
title: 'Move Design',
299+
disabled: !isRemoveAllowed,
300+
onClick: () => handleDeleteModal(rowData)(),
301+
icon: <MoveFileIcon />
302+
};
303+
304+
if (isFromWorkspaceTable) {
305+
actionsList.splice(0, 0, moveAction);
306+
}
307+
302308
if (rowData.visibility === 'published') {
303309
actionsList.splice(0, 0, cloneAction);
304310
actionsList.splice(2, 0, unpublishAction);

src/custom/Modal/index.tsx

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import React, { useRef, useState } from 'react';
33
import { Box, Dialog, IconButton, Paper, Typography } from '../../base';
44
import { ContainedButton, OutlinedButton, TextButton } from '../../base/Button/Button';
55
import { iconLarge, iconMedium } from '../../constants/iconsSizes';
6-
import { CloseIcon, InfoCircleIcon } from '../../icons';
6+
import { CloseIcon, FullScreenIcon, InfoCircleIcon } from '../../icons';
7+
import FullScreenExitIcon from '../../icons/Fullscreen/FullScreenExitIcon';
78
import { darkModalGradient, lightModalGradient } from '../../theme/colors/colors';
89
import { CustomTooltip } from '../CustomTooltip';
910

@@ -12,6 +13,7 @@ interface ModalProps extends DialogProps {
1213
title: string;
1314
headerIcon?: React.ReactNode;
1415
reactNode?: React.ReactNode;
16+
isFullScreenModeAllowed?: boolean;
1517
}
1618

1719
interface ModalFooterProps {
@@ -56,6 +58,20 @@ const StyledDialog = styled(Dialog)`
5658
}
5759
`;
5860

61+
const FullscreenButton = styled(FullScreenIcon)(({ theme }) => ({
62+
height: '2.25rem',
63+
width: '2.25rem',
64+
fill: theme.palette.common.white,
65+
cursor: 'pointer'
66+
}));
67+
68+
const FullscreenExitButton = styled(FullScreenExitIcon)(({ theme }) => ({
69+
height: '2.25rem',
70+
width: '2.25rem',
71+
fill: theme.palette.common.white,
72+
cursor: 'pointer'
73+
}));
74+
5975
export const ModalStyledHeader = styled('div')(({ theme }) => ({
6076
background: theme.palette.mode === 'light' ? lightModalGradient.header : darkModalGradient.header,
6177
color: '#eee',
@@ -103,7 +119,8 @@ export const useModal = ({ headerIcon }: { headerIcon: React.ReactNode }): UseMo
103119
export const ModalBody = styled(Paper)(({ theme }) => ({
104120
padding: '1rem',
105121
backgroundColor: theme.palette.background.surfaces,
106-
overflowY: 'auto'
122+
overflowY: 'auto',
123+
height: '100%'
107124
}));
108125

109126
const StyledFooter = styled('div', {
@@ -135,16 +152,22 @@ export const Modal: React.FC<ModalProps> = ({
135152
reactNode,
136153
children,
137154
maxWidth = 'xs',
155+
isFullScreenModeAllowed,
138156
...props
139157
}) => {
158+
const [fullScreen, setFullScreen] = useState(false);
159+
const toggleFullScreen = () => {
160+
setFullScreen((prev) => !prev);
161+
};
140162
return (
141163
<StyledDialog
142-
fullWidth={true}
143164
maxWidth={maxWidth}
144165
open={open}
145166
onClose={closeModal}
146167
aria-labelledby="alert-dialog-slide-title"
147168
aria-describedby="alert-dialog-slide-description"
169+
fullScreen={fullScreen}
170+
fullWidth={!fullScreen}
148171
{...props}
149172
>
150173
{title && (
@@ -153,9 +176,20 @@ export const Modal: React.FC<ModalProps> = ({
153176
<Typography component={'div'} variant="h6">
154177
{title}
155178
</Typography>
156-
<CloseBtn onClick={closeModal}>
157-
<CloseIcon {...iconLarge} fill="#fff"></CloseIcon>
158-
</CloseBtn>
179+
<div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}>
180+
{isFullScreenModeAllowed && (
181+
<CustomTooltip title={fullScreen ? 'Exit Fullscreen' : 'Enter Fullscreen'}>
182+
{fullScreen ? (
183+
<FullscreenExitButton onClick={toggleFullScreen} />
184+
) : (
185+
<FullscreenButton onClick={toggleFullScreen} />
186+
)}
187+
</CustomTooltip>
188+
)}
189+
<CloseBtn onClick={closeModal}>
190+
<CloseIcon {...iconLarge} fill="#fff"></CloseIcon>
191+
</CloseBtn>
192+
</div>
159193
</ModalStyledHeader>
160194
)}
161195

0 commit comments

Comments
 (0)