Skip to content

Commit e3d33e4

Browse files
Merge branch 'master' into fileupload
2 parents 03a10df + 1d3db29 commit e3d33e4

18 files changed

Lines changed: 225 additions & 500 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
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.
44

5+
## Naming conventions
6+
7+
Sistent components that surface API data (tables, form fields, charts) must use the camelCase-on-the-wire identifiers defined by the Meshery / Layer5 ecosystem contract. See the [identifier-naming contributor guide](https://github.com/meshery/schemas/blob/master/docs/identifier-naming-contributor-guide.md) in `meshery/schemas` — the reader-friendly 26-row naming directory with before/after and do/don't examples — before adding props, column keys, or query-arg types that map to a Meshery or Layer5 Cloud response shape.
8+
59
## Contributing to Sistent
610

711
### Prerequisites

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sistent/sistent",
3-
"version": "0.19.1",
3+
"version": "0.20.0",
44
"description": "Reusable React Components and SVG Icons library",
55
"repository": {
66
"type": "git",
@@ -46,7 +46,7 @@
4646
"@emotion/cache": "^11.14.0",
4747
"@eslint/eslintrc": "^3.3.5",
4848
"@eslint/js": "^10.0.1",
49-
"@meshery/schemas": "^1.1.1",
49+
"@meshery/schemas": "^1.2.0",
5050
"@mui/icons-material": "^7.3.9",
5151
"@reduxjs/toolkit": "^2.11.2",
5252
"@testing-library/dom": "^10.4.1",

src/custom/CatalogCard/CatalogCard.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,23 @@ const CatalogCard: React.FC<CatalogCardProps> = ({
9191
<MetricsContainerFront>
9292
<MetricsDiv>
9393
<DownloadIcon width={18} height={18} />
94-
<MetricsCount>{pattern.download_count}</MetricsCount>
94+
<MetricsCount>{pattern.downloadCount}</MetricsCount>
9595
</MetricsDiv>
9696
<MetricsDiv>
9797
<CloneIcon width={18} height={18} fill={'#51636B'} />
98-
<MetricsCount>{pattern.clone_count}</MetricsCount>
98+
<MetricsCount>{pattern.cloneCount}</MetricsCount>
9999
</MetricsDiv>
100100
<MetricsDiv>
101101
<OpenIcon width={18} height={18} fill={'#51636B'} />
102-
<MetricsCount>{pattern.view_count}</MetricsCount>
102+
<MetricsCount>{pattern.viewCount}</MetricsCount>
103103
</MetricsDiv>
104104
<MetricsDiv>
105105
<DeploymentsIcon width={18} height={18} />
106-
<MetricsCount>{pattern.deployment_count}</MetricsCount>
106+
<MetricsCount>{pattern.deploymentCount}</MetricsCount>
107107
</MetricsDiv>
108108
<MetricsDiv>
109109
<ShareIcon width={18} height={18} fill={'#51636B'} />
110-
<MetricsCount>{pattern.share_count}</MetricsCount>
110+
<MetricsCount>{pattern.shareCount}</MetricsCount>
111111
</MetricsDiv>
112112
</MetricsContainerFront>
113113
</DesignInnerCard>

src/custom/CatalogDesignTable/columnConfig.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ export const colViews: ColView[] = [
2929
['lastName', 'na'],
3030
['createdAt', 'na'],
3131
['updatedAt', 'l'],
32-
['design_type', 'xs'],
32+
['designType', 'xs'],
3333
['class', 'l'],
34-
['view_count', 'na'],
35-
['download_count', 'na'],
36-
['clone_count', 'na'],
37-
['deployment_count', 'na'],
38-
['share_count', 'na'],
34+
['viewCount', 'na'],
35+
['downloadCount', 'na'],
36+
['cloneCount', 'na'],
37+
['deploymentCount', 'na'],
38+
['shareCount', 'na'],
3939
['actions', 'xs']
4040
];
4141

@@ -169,7 +169,7 @@ export const createDesignColumns = ({
169169
}
170170
},
171171
{
172-
name: 'design_type',
172+
name: 'designType',
173173
label: 'Type',
174174
options: {
175175
filter: true,
@@ -187,39 +187,39 @@ export const createDesignColumns = ({
187187
}
188188
},
189189
{
190-
name: 'view_count',
190+
name: 'viewCount',
191191
label: 'Opens',
192192
options: {
193193
filter: false,
194194
sort: true
195195
}
196196
},
197197
{
198-
name: 'download_count',
198+
name: 'downloadCount',
199199
label: 'Downloads',
200200
options: {
201201
filter: false,
202202
sort: true
203203
}
204204
},
205205
{
206-
name: 'clone_count',
206+
name: 'cloneCount',
207207
label: 'Clones',
208208
options: {
209209
filter: false,
210210
sort: true
211211
}
212212
},
213213
{
214-
name: 'deployment_count',
214+
name: 'deploymentCount',
215215
label: 'Deploys',
216216
options: {
217217
filter: false,
218218
sort: true
219219
}
220220
},
221221
{
222-
name: 'share_count',
222+
name: 'shareCount',
223223
label: 'Shares',
224224
options: {
225225
filter: false,

src/custom/CatalogDetail/MetricsDisplay.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ interface MetricsDisplayProps {
1414

1515
const MetricsDisplay: React.FC<MetricsDisplayProps> = ({ details }) => {
1616
const metrics: MetricItem[] = [
17-
{ label: 'Opens', value: details.view_count },
18-
{ label: 'Downloads', value: details.download_count },
19-
{ label: 'Deploys', value: details.deployment_count },
20-
{ label: 'Clones', value: details.clone_count },
21-
{ label: 'Shares', value: details.share_count }
17+
{ label: 'Opens', value: details.viewCount },
18+
{ label: 'Downloads', value: details.downloadCount },
19+
{ label: 'Deploys', value: details.deploymentCount },
20+
{ label: 'Clones', value: details.cloneCount },
21+
{ label: 'Shares', value: details.shareCount }
2222
];
2323

2424
return (

src/custom/CatalogDetail/RightPanel.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ const RightPanel: React.FC<RightPanelProps> = ({
6161
handleVisibilityChange
6262
}) => {
6363
const cleanedType = type.replace('my-', '').replace(/s$/, '');
64-
const { data: userProfile } = useGetUserProfileByIdQuery({
65-
id: details.userId
66-
});
64+
// Skip the lookup when the card has no owner id — firing with an empty or
65+
// undefined id reaches the server and surfaces a 400/404 that, upstream,
66+
// leaks a plain-text body which RTK Query cannot parse as JSON.
67+
const { data: userProfile } = useGetUserProfileByIdQuery(
68+
{ id: details.userId },
69+
{ skip: !details.userId }
70+
);
6771

6872
return (
6973
<div>

src/custom/CustomCatalog/CustomCard.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ export interface Pattern {
4949
lastName?: string;
5050
avatarUrl: string;
5151
name: string;
52-
download_count: number;
53-
clone_count: number;
54-
view_count: number;
55-
deployment_count: number;
56-
share_count: number;
52+
downloadCount: number;
53+
cloneCount: number;
54+
viewCount: number;
55+
deploymentCount: number;
56+
shareCount: number;
5757
userData?: {
5858
version?: string;
5959
avatarUrl?: string;
@@ -198,11 +198,11 @@ const CustomCatalogCard: React.FC<CatalogCardProps> = ({
198198
{isDetailed && (
199199
<MetricsContainerFront isDetailed={isDetailed}>
200200
{[
201-
{ Icon: DownloadIcon, count: pattern.download_count },
202-
{ Icon: CloneIcon, count: pattern.clone_count },
203-
{ Icon: OpenIcon, count: pattern.view_count },
204-
{ Icon: DeploymentsIcon, count: pattern.deployment_count },
205-
{ Icon: ShareIcon, count: pattern.share_count }
201+
{ Icon: DownloadIcon, count: pattern.downloadCount },
202+
{ Icon: CloneIcon, count: pattern.cloneCount },
203+
{ Icon: OpenIcon, count: pattern.viewCount },
204+
{ Icon: DeploymentsIcon, count: pattern.deploymentCount },
205+
{ Icon: ShareIcon, count: pattern.shareCount }
206206
].map(({ Icon, count }, index) => (
207207
<MetricsDiv key={index}>
208208
<Icon

src/custom/PerformersSection/PerformersSection.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,27 @@ const METRICS: Record<MetricType, MetricConfig> = {
7676
view: {
7777
label: 'Most Opens',
7878
id: 'open',
79-
countKey: 'view_count'
79+
countKey: 'viewCount'
8080
},
8181
clone: {
8282
label: 'Most Clones',
8383
id: 'clone',
84-
countKey: 'clone_count'
84+
countKey: 'cloneCount'
8585
},
8686
download: {
8787
label: 'Most Downloads',
8888
id: 'download',
89-
countKey: 'download_count'
89+
countKey: 'downloadCount'
9090
},
9191
deployment: {
9292
label: 'Most Deploys',
9393
id: 'deployments',
94-
countKey: 'deployment_count'
94+
countKey: 'deploymentCount'
9595
},
9696
share: {
9797
label: 'Most Shares',
9898
id: 'share',
99-
countKey: 'share_count'
99+
countKey: 'shareCount'
100100
}
101101
};
102102

src/custom/ResponsiveDataTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ const ResponsiveDataTable = ({
212212
'createdAt',
213213
'deletedAt',
214214
'lastLoginTime',
215-
'joined_at',
216-
'last_run',
217-
'next_run'
215+
'joinedAt',
216+
'lastRun',
217+
'nextRun'
218218
].includes(col.name)
219219
) {
220220
col.options.customBodyRender = (value: string | number | boolean | object) => {

0 commit comments

Comments
 (0)