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

Commit 7714e8a

Browse files
authored
Merge Develop 1.8.3 #1300
Develop
2 parents e83dc10 + a0e533d commit 7714e8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3247
-1017
lines changed

src/__mocks__/handlers/DataTableContainer/handlers.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,62 @@ export const sparqlViewSingleResult = rest.post(
263263
return res(ctx.status(200), ctx.json(mockResponse));
264264
}
265265
);
266+
267+
export const getMockStudioResource = (givenName: string, self: string) => ({
268+
familyName: {
269+
type: 'literal',
270+
value: 'Archer',
271+
},
272+
givenName: {
273+
type: 'literal',
274+
value: givenName,
275+
},
276+
id: {
277+
type: 'uri',
278+
value: self,
279+
},
280+
self: {
281+
type: 'uri',
282+
value: self,
283+
},
284+
});
285+
286+
export const sparqlViewResultHandler = (
287+
studioRows: ReturnType<typeof getMockStudioResource>[]
288+
) => {
289+
return rest.post(
290+
deltaPath('/views/bbp/agents/graph/sparql'),
291+
(req, res, ctx) => {
292+
const mockResponse = {
293+
head: {
294+
vars: ['self', 'givenName', 'familyName', 'id'],
295+
},
296+
results: {
297+
bindings: [...studioRows],
298+
},
299+
};
300+
301+
return res(ctx.status(200), ctx.json(mockResponse));
302+
}
303+
);
304+
};
305+
306+
export const fetchResourceForDownload = rest.get(
307+
deltaPath(
308+
`/resources/bbp/agents/_/persons%2Fc3358e61-7650-4954-99b7-f7572cbf5d5g`
309+
),
310+
(req, res, ctx) => {
311+
const self = req.url.pathname.slice(req.url.pathname.lastIndexOf('/') + 1);
312+
const mockResponse = {
313+
'@context': [
314+
'https://bluebrain.github.io/nexus/contexts/metadata.json',
315+
'https://bluebrainnexus.io/workflowStep/table-context',
316+
],
317+
'@id': `https://bbp.epfl.ch/neurosciencegraph/data/${self}`,
318+
'@type': 'Resource',
319+
_self: `https://localhost:3000/resources/bbp/agents/_/${self}`,
320+
};
321+
322+
return res(ctx.status(200), ctx.json(mockResponse));
323+
}
324+
);

src/pages/HomePage/HomePage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const Home: React.FunctionComponent = () => {
99
const oidc = useSelector((state: RootState) => state.oidc);
1010
const userAuthenticated = oidc && !!oidc.user?.id_token;
1111
if (!userAuthenticated) {
12-
console.log('@@not authenticated');
1312
return <IdentityPage />;
1413
}
1514

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { MyData } from '../../shared/canvas';
2+
3+
const MyDataPage = () => {
4+
return (
5+
<div className="my-data-view view-container" style={{ padding: '0 1em' }}>
6+
<MyData />
7+
</div>
8+
);
9+
};
10+
11+
export default MyDataPage;

src/pages/OrganizationProjectsPage/OrganizationProjectsPage.tsx

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ const SHOULD_INCLUDE_DEPRECATED = true;
4848
type TOrganizationOptions = {
4949
orgLabel: string;
5050
};
51+
type TProjectResponseCommonExtended = ProjectResponseCommon & {
52+
_markedForDeletion: boolean;
53+
};
5154
interface TPageOptions {
5255
sort: TSort;
5356
}
@@ -75,6 +78,7 @@ type TProjectItem = {
7578
updatedAt: Date;
7679
organization: string;
7780
nexus: NexusClient;
81+
toDelete: boolean;
7882
};
7983
const fetchOrganizationDetails = async ({
8084
nexus,
@@ -151,6 +155,7 @@ const ProjectItem = ({
151155
access,
152156
organization,
153157
nexus,
158+
toDelete,
154159
}: TProjectItem) => {
155160
const { data } = useQuery({
156161
queryKey: ['datesets', { orgLabel: organization, projectLabel: title }],
@@ -166,7 +171,21 @@ const ProjectItem = ({
166171
<div className="org">
167172
<Link to={to}>
168173
<h3>
169-
{title}{' '}
174+
{toDelete && (
175+
<span style={{ verticalAlign: 'top', margin: '0 3px' }}>
176+
<LoadingOutlined
177+
style={{
178+
fontSize: 12,
179+
color: '#dc7943',
180+
verticalAlign: 'middle',
181+
}}
182+
/>
183+
</span>
184+
)}
185+
{title}
186+
{toDelete && (
187+
<span className="deletion-tag">Project being deleted</span>
188+
)}
170189
{deprected && (
171190
<span className="depreacted-tag">
172191
<DeprecatedIcon /> deprecated
@@ -181,15 +200,15 @@ const ProjectItem = ({
181200
<div>Datasets</div>
182201
<div>{(datasets && formatNumber(datasets)) ?? '0'}</div>
183202
</div>
184-
<div className="statistics_item" />
185-
<div className="statistics_item">
186-
<div>Created</div>
187-
<div>{timeago(createdAt)}</div>
188-
</div>
189203
<div className="statistics_item">
190204
<div>Last update</div>
191205
<div>{timeago(updatedAt)}</div>
192206
</div>
207+
<div className="statistics_item">
208+
<div>Created</div>
209+
<div>{timeago(createdAt)}</div>
210+
</div>
211+
<div className="statistics_item" />
193212
</div>
194213
<div className="redirection">
195214
<Link to={to}>
@@ -267,10 +286,9 @@ const OrganizationProjectsPage: React.FC<{}> = ({}) => {
267286
});
268287
const total =
269288
data && data.pages ? ((data.pages[0] as ProjectList)?._total as number) : 0;
270-
const dataSource: ProjectResponseCommon[] =
271-
data && data.pages
272-
? data.pages.map(page => (page as ProjectList)._results).flat()
273-
: [];
289+
const dataSource: TProjectResponseCommonExtended[] = (data && data.pages
290+
? data.pages.map(page => (page as ProjectList)._results).flat()
291+
: []) as TProjectResponseCommonExtended[];
274292
if (!query.trim().length) {
275293
totalProjectsRef.current = total;
276294
}
@@ -323,6 +341,7 @@ const OrganizationProjectsPage: React.FC<{}> = ({}) => {
323341
onCreateClick={() => updateCreateModelVisibility(true)}
324342
permissions={['projects/create']}
325343
path={[`/${orgLabel}`]}
344+
supTitle="Organization"
326345
/>
327346
<div className="route-body">
328347
<div className="route-body-container">
@@ -372,13 +391,14 @@ const OrganizationProjectsPage: React.FC<{}> = ({}) => {
372391
itemLayout="horizontal"
373392
loadMore={LoadMore}
374393
dataSource={dataSource}
375-
renderItem={(item: ProjectResponseCommon) => {
394+
renderItem={(item: TProjectResponseCommonExtended) => {
376395
const to = `/orgs/${item._organizationLabel}/${item._label}`;
377396
return (
378397
<ProjectItem
379398
{...{
380399
to,
381400
nexus,
401+
toDelete: item._markedForDeletion,
382402
title: item._label,
383403
organization: item._organizationLabel,
384404
deprected: item._deprecated,

src/pages/ProjectPage/ProjectPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ const ProjectView: React.FunctionComponent = () => {
338338
description: project.description || '',
339339
base: project.base,
340340
vocab: project.vocab,
341+
_deprecated: project._deprecated,
341342
}}
342343
apiMappings={project.apiMappings}
343344
mode="edit"

src/pages/ProjectPage/styles.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import '../../shared/lib.less';
22

33
.project-view {
4+
margin-top: 60px;
45
.view-container {
56
max-width: 100%;
67
}

src/pages/ProjectsPage/ProjectsPage.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const ProjectItem = ({
104104
<div className="org">
105105
<Link to={to}>
106106
<h3>
107-
{title}{' '}
107+
{title} <span className="organization-tag">{orgLabel}</span>
108108
{deprected && (
109109
<span className="depreacted-tag">
110110
<DeprecatedIcon /> deprecated
@@ -119,15 +119,15 @@ const ProjectItem = ({
119119
<div>Datasets</div>
120120
<div>{(datasets && formatNumber(datasets)) || '0'}</div>
121121
</div>
122-
<div className="statistics_item" />
123-
<div className="statistics_item">
124-
<div>Created</div>
125-
<div>{timeago(createdAt)}</div>
126-
</div>
127122
<div className="statistics_item">
128123
<div>Last update</div>
129124
<div>{timeago(updatedAt)}</div>
130125
</div>
126+
<div className="statistics_item">
127+
<div>Created</div>
128+
<div>{timeago(createdAt)}</div>
129+
</div>
130+
<div className="statistics_item" />
131131
</div>
132132
<div className="redirection">
133133
<Link to={to}>

src/shared/App.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.view-container {
77
padding: 2em 1rem;
88
// max-width: @maxConstrainedItemWidth;
9-
margin: 0 auto;
9+
margin: 52px auto 0;
1010
display: flex;
1111
background: #f5f5f5 !important;
1212
&.-unconstrained-width {

src/shared/RouteHeader/RouteHeader.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type TProps = {
1515
onCreateClick?(): void;
1616
permissions?: string[];
1717
path?: string[];
18+
supTitle?: string;
1819
};
1920

2021
const RouteHeader = ({
@@ -27,6 +28,7 @@ const RouteHeader = ({
2728
onCreateClick,
2829
permissions = [],
2930
path = ['/'],
31+
supTitle,
3032
}: TProps) => {
3133
const { layoutSettings } = useSelector((state: RootState) => state.config);
3234
return (
@@ -36,6 +38,7 @@ const RouteHeader = ({
3638
>
3739
<img src={bg} alt={alt} style={{ ...imgCss }} />
3840
<div className="title">
41+
{supTitle && <h4>{supTitle}</h4>}
3942
<h2>{title}</h2>
4043
<p>{extra}</p>
4144
</div>

src/shared/RouteHeader/styles.less

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@
1818

1919
.title {
2020
padding-left: 14%;
21-
21+
h4 {
22+
text-transform: uppercase;
23+
color: #ffffff;
24+
font-weight: 200;
25+
font-size: 16px;
26+
}
2227
h2 {
2328
position: relative;
2429
font-family: 'Titillium Web';
2530
z-index: 10;
2631
font-style: normal;
2732
font-weight: 700;
2833
font-size: 70px;
29-
line-height: 100%;
34+
line-height: 74px;
3035
color: #ffffff;
3136
margin-bottom: 10px;
3237
}

0 commit comments

Comments
 (0)