Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit c7e4c8c

Browse files
authored
omit the resource metadata from the update endpoint
fix: omit the resource metadata from the update endpoint
2 parents 188d55b + 1aceaea commit c7e4c8c

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/pages/StudiosPage/StudiosPage.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const StudioItem = ({
124124
)}
125125
</h3>
126126
</Link>
127-
<p>{description}</p>
127+
<p className="description">{description}</p>
128128
</div>
129129
<div className="statistics studios-list-item">
130130
<div className="statistics_item">

src/shared/styles/route-layout.less

+10
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
text-align: center;
133133
vertical-align: middle;
134134
}
135+
135136
.depreacted-tag {
136137
font-family: 'Titillium Web';
137138
font-style: normal;
@@ -143,6 +144,7 @@
143144
margin: 0 3px;
144145
vertical-align: middle;
145146
}
147+
146148
.deletion-tag {
147149
font-family: 'Titillium Web';
148150
font-style: normal;
@@ -168,6 +170,14 @@
168170
}
169171
}
170172

173+
.description {
174+
overflow: hidden;
175+
display: -webkit-box;
176+
-webkit-box-orient: vertical;
177+
-webkit-line-clamp: 2;
178+
line-clamp: 2;
179+
}
180+
171181
.statistics {
172182
display: grid;
173183
grid-template-columns: 1fr 1fr;

src/subapps/studioLegacy/containers/StudioContainer.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import * as React from 'react';
22
import { Resource } from '@bbp/nexus-sdk';
33
import { useNexusContext, AccessControl } from '@bbp/react-nexus';
44
import { Empty, message } from 'antd';
5+
import { omitBy } from 'lodash';
56
import { useHistory } from 'react-router';
7+
68
import EditStudio from '../components/EditStudio';
79
import StudioHeader from '../components/StudioHeader';
810
import StudioReactContext from '../contexts/StudioContext';
@@ -114,7 +116,9 @@ const StudioContainer: React.FunctionComponent = () => {
114116
studioId,
115117
studioResource._rev,
116118
{
117-
...studioResource,
119+
// remove the metadata from the payload, delta do full update
120+
// and not accept the metadata fields to be in the payload
121+
...omitBy(studioResource, (_, key) => key.trim().startsWith('_')),
118122
label,
119123
description,
120124
plugins,
@@ -145,7 +149,7 @@ const StudioContainer: React.FunctionComponent = () => {
145149
onSave={updateStudio}
146150
onSaveImage={saveImage(nexus, orgLabel, projectLabel)}
147151
markdownViewer={MarkdownViewerContainer}
148-
></EditStudio>
152+
/>
149153
);
150154
return (
151155
<>

0 commit comments

Comments
 (0)