Skip to content

Commit

Permalink
omit the resource metadata from the update endpoint
Browse files Browse the repository at this point in the history
fix: omit the resource metadata from the update endpoint
  • Loading branch information
bilalesi authored Feb 20, 2024
2 parents 188d55b + 1aceaea commit c7e4c8c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pages/StudiosPage/StudiosPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const StudioItem = ({
)}
</h3>
</Link>
<p>{description}</p>
<p className="description">{description}</p>
</div>
<div className="statistics studios-list-item">
<div className="statistics_item">
Expand Down
10 changes: 10 additions & 0 deletions src/shared/styles/route-layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
text-align: center;
vertical-align: middle;
}

.depreacted-tag {
font-family: 'Titillium Web';
font-style: normal;
Expand All @@ -143,6 +144,7 @@
margin: 0 3px;
vertical-align: middle;
}

.deletion-tag {
font-family: 'Titillium Web';
font-style: normal;
Expand All @@ -168,6 +170,14 @@
}
}

.description {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
line-clamp: 2;
}

.statistics {
display: grid;
grid-template-columns: 1fr 1fr;
Expand Down
8 changes: 6 additions & 2 deletions src/subapps/studioLegacy/containers/StudioContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import * as React from 'react';
import { Resource } from '@bbp/nexus-sdk';
import { useNexusContext, AccessControl } from '@bbp/react-nexus';
import { Empty, message } from 'antd';
import { omitBy } from 'lodash';
import { useHistory } from 'react-router';

import EditStudio from '../components/EditStudio';
import StudioHeader from '../components/StudioHeader';
import StudioReactContext from '../contexts/StudioContext';
Expand Down Expand Up @@ -114,7 +116,9 @@ const StudioContainer: React.FunctionComponent = () => {
studioId,
studioResource._rev,
{
...studioResource,
// remove the metadata from the payload, delta do full update
// and not accept the metadata fields to be in the payload
...omitBy(studioResource, (_, key) => key.trim().startsWith('_')),
label,
description,
plugins,
Expand Down Expand Up @@ -145,7 +149,7 @@ const StudioContainer: React.FunctionComponent = () => {
onSave={updateStudio}
onSaveImage={saveImage(nexus, orgLabel, projectLabel)}
markdownViewer={MarkdownViewerContainer}
></EditStudio>
/>
);
return (
<>
Expand Down

0 comments on commit c7e4c8c

Please sign in to comment.