Skip to content

Commit 3a18882

Browse files
committed
fix(wire-format): flip sistent consumer reads of meshery wire to canonical camelCase (Phase 7c)
Sistent components consume meshery / meshery-cloud wire payloads. Per the ecosystem identifier-naming contract (TypeScript property: camelCase everywhere, see meshery/schemas docs/identifier-naming-contributor-guide.md), the consumer reads must match the canonical camelCase wire keys that meshery-cloud emits post Phase 4. This change is a surgical field-rename sweep — no behavioural or structural change. Flipped (45 sites across 20 files): Catalog / design wire (Pattern, MesheryPattern, CatalogContent): catalog_data → catalogData content_class → contentClass published_version → publishedVersion pattern_file → patternFile Pagination wire (MesheryViewPage / TeamsPage / EnvironmentsPage / DesignsPage / UsersPage / EventsPage): total_count → totalCount Role wire (Role): role_name → roleName (response read in InviteUserModal only; the `order: 'role_name asc'` request parameter is left as-is until the cloud server adds dual-accept on the sort key) Component / model wire (Component): display_name → displayName Files touched: • src/custom/CustomCatalog/CustomCard.tsx — Pattern interface • src/custom/CustomCatalog/Helper.ts — getVersion() reads • src/custom/CatalogDetail/OverviewSection.tsx • src/custom/CatalogDetail/RelatedDesigns.tsx • src/custom/CatalogDetail/LeftPanel.tsx • src/custom/CatalogDetail/CaveatsSection.tsx • src/custom/CatalogDetail/ActionButton.tsx • src/custom/CatalogCard/CatalogCard.tsx • src/custom/PerformersSection/PerformersSection.tsx • src/custom/Workspaces/WorkspaceTeamsTable.tsx • src/custom/Workspaces/WorkspaceViewsTable.tsx • src/custom/Workspaces/EnvironmentTable.tsx • src/custom/Workspaces/WorkspaceRecentActivityModal.tsx (also flipped EventsResponse type) • src/custom/Workspaces/DesignTable.tsx • src/custom/Workspaces/hooks/useDesignAssignment.tsx • src/custom/Workspaces/hooks/useEnvironmentAssignment.tsx • src/custom/Workspaces/hooks/useTeamAssignment.tsx • src/custom/Workspaces/hooks/useViewsAssignment.tsx • src/custom/UsersTable/UsersTable.tsx — totalCount only • src/custom/DashboardWidgets/GettingStartedWidget/InviteUserModal.tsx Intentionally retained (sistent-internal contracts, not meshery wire): • src/hooks/useRoomActivity.ts — `provider_url`, `data.user_map` are sistent's collaboration WebSocket signaling protocol identifiers, not meshery wire fields. The signaling server (meshery-cloud collaboration endpoint) speaks this protocol with sistent and is independent of the REST API wire-format contract. • src/custom/CollaboratorAvatarGroup/CollaboratorAvatarGroup.tsx `User.border_color` is part of sistent's exported `Users` prop shape (the sistent API surface that consumers pass in). Flipping this would be a public API break, not a wire-format alignment. Already retained-as-deferred per prior phases (still deferred, no change): • src/custom/UsersTable/UsersTable.tsx — `fullUser.organization_with_user_roles?.role_names` deferred until the containing response type is migrated upstream (existing inline TODO). • src/custom/TeamTable/TeamTableConfiguration.tsx — `team_names` / `team_name` deferred until meshery-cloud bulk-delete handler lands dual-accept on the request body (existing PR #1431 / cascade-10 decision). Verified locally: tsc --noEmit (no new errors vs baseline of 105 pre-existing errors), npm run lint (clean), npm test (21/21 passing), npm run build (success). Refs: meshery/schemas docs/identifier-naming-contributor-guide.md Signed-off-by: Lee Calcote <leecalcote@gmail.com>
1 parent 27c7f00 commit 3a18882

20 files changed

Lines changed: 45 additions & 45 deletions

src/custom/CatalogCard/CatalogCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const CatalogCard: React.FC<CatalogCardProps> = ({
7373
return (
7474
<DesignCard outerStyles={outerStyles} onClick={onCardClick}>
7575
<DesignInnerCard className="innerCard">
76-
<ClassWrap catalogClassName={pattern?.catalog_data?.content_class} />
76+
<ClassWrap catalogClassName={pattern?.catalogData?.contentClass} />
7777
<DesignType>{patternType}</DesignType>
7878
<DesignDetailsDiv>
7979
<DesignName

src/custom/CatalogDetail/ActionButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
108108
}}
109109
onClick={() =>
110110
cleanedType === VIEWS
111-
? downloadYaml(details.pattern_file, details.name)
111+
? downloadYaml(details.patternFile, details.name)
112112
: downloadPattern(details.id, details.name, getDownloadUrl)
113113
}
114114
>

src/custom/CatalogDetail/CaveatsSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ const CaveatsSection: React.FC<CaveatsSectionProps> = ({ details }) => {
1414
<ContentHeading>
1515
<h2 style={{ margin: '0' }}>CAVEATS AND CONSIDERATIONS</h2>
1616
</ContentHeading>
17-
{details?.catalog_data?.patternCaveats ? (
17+
{details?.catalogData?.patternCaveats ? (
1818
<ContentDetailsText style={{ whiteSpace: 'normal', fontFamily: 'inherit' }}>
1919
<RenderMarkdown
20-
content={decodeURIComponent(details.catalog_data.patternCaveats || '')}
20+
content={decodeURIComponent(details.catalogData.patternCaveats || '')}
2121
/>
2222
</ContentDetailsText>
2323
) : (

src/custom/CatalogDetail/LeftPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const LeftPanel: React.FC<LeftPanelProps> = ({
7575
cardWidth="100%"
7676
>
7777
<CatalogCardDesignLogo
78-
imgURL={details?.catalog_data?.imageURL}
78+
imgURL={details?.catalogData?.imageURL}
7979
height={'100%'}
8080
width={'100%'}
8181
zoomEffect={true}
@@ -103,7 +103,7 @@ const LeftPanel: React.FC<LeftPanelProps> = ({
103103
<TechnologySection
104104
technologySVGPath={technologySVGPath}
105105
technologySVGSubpath={technologySVGSubpath}
106-
technologies={details.catalog_data?.compatibility || []}
106+
technologies={details.catalogData?.compatibility || []}
107107
/>
108108
)}
109109
<LearningSection filteredAcademyData={filteredAcademyData} />

src/custom/CatalogDetail/OverviewSection.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ const OverviewSection: React.FC<OverviewSectionProps> = ({
8282
xs: 6
8383
}}
8484
>
85-
{details?.catalog_data?.content_class && (
85+
{details?.catalogData?.contentClass && (
8686
<ContentRow>
8787
<ContentClassInfo
88-
contentClass={details.catalog_data.content_class}
88+
contentClass={details.catalogData.contentClass}
8989
classes={classes}
9090
/>
9191
</ContentRow>
@@ -111,8 +111,8 @@ const OverviewSection: React.FC<OverviewSectionProps> = ({
111111
{showContentDetails ? (
112112
<ContentRow>
113113
<h2 style={{ margin: '0' }}>WHAT DOES THIS DESIGN DO?</h2>
114-
{details?.catalog_data?.patternInfo ? (
115-
<PatternInfo text={decodeURIComponent(details.catalog_data.patternInfo)} />
114+
{details?.catalogData?.patternInfo ? (
115+
<PatternInfo text={decodeURIComponent(details.catalogData.patternInfo)} />
116116
) : (
117117
<div>No description available</div>
118118
)}

src/custom/CatalogDetail/RelatedDesigns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const RelatedDesigns: React.FC<RelatedDesignsProps> = ({
6060
cardTechnologies={true}
6161
>
6262
<CatalogCardDesignLogo
63-
imgURL={pattern?.catalog_data?.imageURL}
63+
imgURL={pattern?.catalogData?.imageURL}
6464
height={'5.5rem'}
6565
width={'100%'}
6666
zoomEffect={false}

src/custom/CustomCatalog/CustomCard.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const DesignCardUrl = styled('a')(() => ({
4040
export interface Pattern {
4141
id: string;
4242
userId: string;
43-
pattern_file: string;
43+
patternFile: string;
4444
user: {
4545
firstName: string;
4646
lastName: string;
@@ -61,11 +61,11 @@ export interface Pattern {
6161
technologies?: string[];
6262
updatedAt?: string;
6363
};
64-
catalog_data?: {
65-
content_class?: string;
64+
catalogData?: {
65+
contentClass?: string;
6666
imageURL?: string[];
6767
compatibility?: string[];
68-
published_version?: string;
68+
publishedVersion?: string;
6969
type?: string;
7070
patternInfo?: string;
7171
patternCaveats?: string;
@@ -135,7 +135,7 @@ const CustomCatalogCard: React.FC<CatalogCardProps> = ({
135135
};
136136
const theme = useTheme();
137137

138-
const technologies = pattern.catalog_data?.compatibility || [];
138+
const technologies = pattern.catalogData?.compatibility || [];
139139
const techlimit = 5;
140140
const [availableTechnologies, setAvailableTechnologies] = useState<string[]>([]);
141141
const version = getVersion(pattern);
@@ -172,9 +172,9 @@ const CustomCatalogCard: React.FC<CatalogCardProps> = ({
172172
<CardFront shouldFlip={shouldFlip} isDetailed={isDetailed}>
173173
{isDetailed && (
174174
<>
175-
<ClassWrap catalogClassName={pattern?.catalog_data?.content_class ?? ''} />
175+
<ClassWrap catalogClassName={pattern?.catalogData?.contentClass ?? ''} />
176176
<DesignType>{patternType}</DesignType>
177-
<DesignName hasRibbon={!!pattern?.catalog_data?.content_class}>
177+
<DesignName hasRibbon={!!pattern?.catalogData?.contentClass}>
178178
{pattern.name}
179179
</DesignName>
180180
</>

src/custom/CustomCatalog/Helper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ export const DEFAULT_DESIGN_VERSION = '0.0.0';
7979
export const getVersion = (design: Pattern) => {
8080
switch (design.visibility) {
8181
case 'published':
82-
return design?.catalog_data?.published_version || DEFAULT_DESIGN_VERSION;
82+
return design?.catalogData?.publishedVersion || DEFAULT_DESIGN_VERSION;
8383
case 'public':
8484
case 'private':
85-
return getWorkingVersionFromPatternFile(design.pattern_file);
85+
return getWorkingVersionFromPatternFile(design.patternFile);
8686
default:
87-
return getWorkingVersionFromPatternFile(design.pattern_file);
87+
return getWorkingVersionFromPatternFile(design.patternFile);
8888
}
8989
};

src/custom/DashboardWidgets/GettingStartedWidget/InviteUserModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@ export default function UserInviteModal({
131131
const organizationRoles: string[] = [];
132132

133133
if (providerRolesData) {
134-
providerRolesData?.roles?.forEach((role: { role_name: string }) =>
135-
providerRoles.push(role?.role_name)
134+
providerRolesData?.roles?.forEach((role: { roleName: string }) =>
135+
providerRoles.push(role?.roleName)
136136
);
137137
setAvailableProviderRoles(providerRoles);
138138
}
139139

140140
if (organizationRolesData) {
141-
organizationRolesData?.roles?.forEach((role: { role_name: string }) =>
142-
organizationRoles.push(role?.role_name)
141+
organizationRolesData?.roles?.forEach((role: { roleName: string }) =>
142+
organizationRoles.push(role?.roleName)
143143
);
144144
setAvailableOrgRoles(organizationRoles);
145145
}

src/custom/PerformersSection/PerformersSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const processQueryData = (
216216
pattern: pattern,
217217
userName: pattern.user?.firstName || 'Unknown',
218218
id: config.id,
219-
status: pattern?.catalog_data?.content_class
219+
status: pattern?.catalogData?.contentClass
220220
};
221221
};
222222

0 commit comments

Comments
 (0)