Skip to content

Commit

Permalink
exclude metadata in studio update payload
Browse files Browse the repository at this point in the history
exclude metadata in studio update payload
  • Loading branch information
bilalesi authored Feb 22, 2024
2 parents bc4d321 + fd47e7b commit 4dffd48
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/pages/StudiosPage/StudiosPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,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
32 changes: 19 additions & 13 deletions src/shared/containers/ResourceViewActionsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const ResourceViewActionsContainer: React.FC<{
};
const [view, setView] = React.useState<Resource | null>(null);
const subapp = useOrganisationsSubappContext();

React.useEffect(() => {
const encodedResourceId = encodeURIComponent(resource['@id']);
nexus.Resource.tags(orgLabel, projectLabel, encodedResourceId).then(
Expand All @@ -151,6 +152,7 @@ const ResourceViewActionsContainer: React.FC<{
}
);
}, [resource, latestResource]);

const redirectToQueryTab = React.useCallback(() => {
if (view) {
const base = `/${subapp.namespace}/${orgLabel}/${projectLabel}`;
Expand Down Expand Up @@ -190,22 +192,26 @@ const ResourceViewActionsContainer: React.FC<{
items={[...Array(latestResource?._rev).keys()]
.map(k => k + 1)
.sort((a, b) => b - a)
.map(rev => (
<Menu.Item
key={rev}
onClick={() => {
goToResource(orgLabel, projectLabel, resource['@id'], rev);
}}
>
Revision {rev}
{revisionLabels(rev).length > 0 &&
` (${revisionLabels(rev).join(', ')})`}
</Menu.Item>
))}
</Menu>
.map(rev => {
const revison = `Revision ${rev} ${
revisionLabels(rev).length > 0
? revisionLabels(rev).join(', ')
: ''
}`;
return {
key: rev,
title: `Revison ${rev}`,
label: revison,
};
})}
onClick={({ key: rev }) =>
goToResource(orgLabel, projectLabel, resource['@id'], Number(rev))
}
/>
),
[resource, latestResource, tags]
);

React.useEffect(() => {
const dataPanelLS: TResourceTableData = JSON.parse(
localStorage.getItem(DATA_PANEL_STORAGE)!
Expand Down
12 changes: 11 additions & 1 deletion src/shared/styles/route-layout.scss
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 Expand Up @@ -246,4 +256,4 @@
span {
margin-left: 20px;
}
}
}
6 changes: 4 additions & 2 deletions src/subapps/studioLegacy/containers/StudioContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Resource } from '@bbp/nexus-sdk/es';
import { useNexusContext, AccessControl } from '@bbp/react-nexus';
import { Empty, message } from 'antd';
import { useHistory } from 'react-router';
import omitBy from 'lodash/omitBy';

import EditStudio from '../components/EditStudio';
import StudioHeader from '../components/StudioHeader';
import StudioReactContext from '../contexts/StudioContext';
Expand Down Expand Up @@ -114,7 +116,7 @@ const StudioContainer: React.FunctionComponent = () => {
studioId,
studioResource._rev,
{
...studioResource,
...omitBy(studioResource, (_, key) => key.trim().startsWith('_')),
label,
description,
plugins,
Expand Down Expand Up @@ -145,7 +147,7 @@ const StudioContainer: React.FunctionComponent = () => {
onSave={updateStudio}
onSaveImage={saveImage(nexus, orgLabel, projectLabel)}
markdownViewer={MarkdownViewerContainer}
></EditStudio>
/>
);
return (
<>
Expand Down

0 comments on commit 4dffd48

Please sign in to comment.