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

Commit 8707038

Browse files
committed
1 parent 7747b3e commit 8707038

File tree

4 files changed

+41
-29
lines changed

4 files changed

+41
-29
lines changed

src/shared/containers/ResourceViewActionsContainer.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@ const ResourceViewActionsContainer: React.FC<{
6666
const redirectToQueryTab = React.useCallback(() => {
6767
if (view) {
6868
const base = `/${subapp.namespace}/${orgLabel}/${projectLabel}`;
69-
const href = `${base}/query/${encodeURIComponent(
70-
view['@id']
71-
)}`;
69+
const href = `${base}/query/${encodeURIComponent(view['@id'])}`;
7270
return href;
7371
}
74-
return "";
72+
return '';
7573
}, [view]);
7674

7775
const self = resource._self;

src/shared/containers/ResourceViewContainer.tsx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ const ResourceViewContainer: React.FunctionComponent<{
124124
}
125125
) => {
126126
const { revision, tab, expanded } = opt;
127-
const pushRoute = `/${orgLabel}/${projectLabel}/resources/${resourceId}${revision ? `?rev=${revision}` : ''
128-
}${expanded ? '&expanded=true' : ''}${tab ? tab : ''}`;
127+
const pushRoute = `/${orgLabel}/${projectLabel}/resources/${resourceId}${
128+
revision ? `?rev=${revision}` : ''
129+
}${expanded ? '&expanded=true' : ''}${tab ? tab : ''}`;
129130
history.push(pushRoute, location.state);
130131
};
131132

@@ -143,12 +144,12 @@ const ResourceViewContainer: React.FunctionComponent<{
143144
busy: boolean;
144145
resource: Resource | null;
145146
error:
146-
| (Error & {
147-
action?: 'update' | 'view';
148-
rejections?: { reason: string }[];
149-
wasUpdated?: boolean;
150-
})
151-
| null;
147+
| (Error & {
148+
action?: 'update' | 'view';
149+
rejections?: { reason: string }[];
150+
wasUpdated?: boolean;
151+
})
152+
| null;
152153
}>({
153154
busy: false,
154155
resource: null,
@@ -274,7 +275,7 @@ const ResourceViewContainer: React.FunctionComponent<{
274275
busy: true,
275276
});
276277
try {
277-
const options = tag ? { tag: tag.toString(), } : { rev: Number(rev), };
278+
const options = tag ? { tag: tag.toString() } : { rev: Number(rev) };
278279
const resource = (await nexus.Resource.get(
279280
orgLabel,
280281
projectLabel,
@@ -284,11 +285,11 @@ const ResourceViewContainer: React.FunctionComponent<{
284285
const selectedResource: Resource =
285286
rev || tag
286287
? ((await nexus.Resource.get(
287-
orgLabel,
288-
projectLabel,
289-
resourceId,
290-
options
291-
)) as Resource)
288+
orgLabel,
289+
projectLabel,
290+
resourceId,
291+
options
292+
)) as Resource)
292293
: resource;
293294

294295
const expandedResources = (await nexus.Resource.get(
@@ -556,8 +557,9 @@ const ResourceViewContainer: React.FunctionComponent<{
556557
<>
557558
<div className="resource-details">
558559
<Helmet
559-
title={`${resource ? getResourceLabel(resource) : resourceId
560-
} | ${projectLabel} | ${orgLabel} | Nexus Web`}
560+
title={`${
561+
resource ? getResourceLabel(resource) : resourceId
562+
} | ${projectLabel} | ${orgLabel} | Nexus Web`}
561563
meta={[
562564
{
563565
name: 'description',
@@ -612,8 +614,8 @@ const ResourceViewContainer: React.FunctionComponent<{
612614
</>
613615
}
614616
/>
615-
) :
616-
(<>
617+
) : (
618+
<>
617619
{resource && (
618620
<ResourceViewActionsContainer
619621
resource={resource}
@@ -696,7 +698,8 @@ const ResourceViewContainer: React.FunctionComponent<{
696698
)}
697699
</>
698700
)}
699-
</>)}
701+
</>
702+
)}
700703
</Spin>
701704
</div>
702705
</>

src/subapps/admin/views/ElasticSearchQueryView.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ const ElasticSearchQueryView: React.FunctionComponent = (): JSX.Element => {
4545

4646
React.useEffect(() => {
4747
history.replace(
48-
`/${subapp.namespace
48+
`/${
49+
subapp.namespace
4950
}/${orgLabel}/${projectLabel}/query/${encodeURIComponent(selectedView)}`
5051
);
5152
}, [selectedView]);
5253
const menu = (
5354
<Row gutter={3} justify="space-between" align="middle">
54-
<Col flex='auto'>
55+
<Col flex="auto">
5556
<Select
5657
value={selectedView as string}
5758
onChange={v => setSelectedView(v)}
@@ -75,7 +76,11 @@ const ElasticSearchQueryView: React.FunctionComponent = (): JSX.Element => {
7576
</Select>
7677
</Col>
7778
<Col flex="100px">
78-
<Link to={`/${orgLabel}/${projectLabel}/resources/${encodeURIComponent(viewId)}`}>
79+
<Link
80+
to={`/${orgLabel}/${projectLabel}/resources/${encodeURIComponent(
81+
viewId
82+
)}`}
83+
>
7984
<Button>Open View Resource</Button>
8085
</Link>
8186
</Col>

src/subapps/admin/views/SparqlQueryView.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ const SparqlQueryView: React.FunctionComponent = (): JSX.Element => {
4040

4141
React.useEffect(() => {
4242
history.replace(
43-
`/${ subapp.namespace }/${orgLabel}/${projectLabel}/query/${encodeURIComponent(selectedView)}`
43+
`/${
44+
subapp.namespace
45+
}/${orgLabel}/${projectLabel}/query/${encodeURIComponent(selectedView)}`
4446
);
4547
}, [selectedView]);
4648
const menu = (
4749
<Row gutter={3} justify="space-between" align="middle">
48-
<Col flex='auto'>
50+
<Col flex="auto">
4951
<Select
5052
value={selectedView as string}
5153
onChange={v => setSelectedView(v)}
@@ -69,7 +71,11 @@ const SparqlQueryView: React.FunctionComponent = (): JSX.Element => {
6971
</Select>
7072
</Col>
7173
<Col flex="100px">
72-
<Link to={`/${orgLabel}/${projectLabel}/resources/${encodeURIComponent(viewId)}`}>
74+
<Link
75+
to={`/${orgLabel}/${projectLabel}/resources/${encodeURIComponent(
76+
viewId
77+
)}`}
78+
>
7379
<Button>Open View Resource</Button>
7480
</Link>
7581
</Col>

0 commit comments

Comments
 (0)