Skip to content

Commit

Permalink
more fixes for id changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesamcl committed Nov 14, 2024
1 parent 16a88bf commit 0d55b21
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
6 changes: 4 additions & 2 deletions webapp/grebi_api/src/main/java/uk/ac/ebi/grebi/GrebiApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ static void run(
ctx.result(gson.toJson(res));
})
.get("/api/v1/subgraphs/{subgraph}/nodes/{nodeId}/incoming_edges", ctx -> {
var nodeId = new String(Base64.getUrlDecoder().decode(ctx.pathParam("nodeId")));
var page_num = Objects.requireNonNullElse(ctx.queryParam("page"), "0");
var size = Objects.requireNonNullElse(ctx.queryParam("size"), "10");
var sortBy = Objects.requireNonNullElse(ctx.queryParam("sortBy"), "grebi:type");
Expand All @@ -123,7 +124,7 @@ static void run(
q.addFacetField(facet);
}

q.addFilter("grebi:to", Set.of(ctx.pathParam("nodeId")),
q.addFilter("grebi:toNodeId", Set.of(nodeId),
/* this is actually a string field so this is an exact match */ SearchType.CASE_INSENSITIVE_TOKENS,
false);

Expand Down Expand Up @@ -158,6 +159,7 @@ static void run(
);
})
.get("/api/v1/subgraphs/{subgraph}/nodes/{nodeId}/outgoing_edges", ctx -> {
var nodeId = new String(Base64.getUrlDecoder().decode(ctx.pathParam("nodeId")));
var page_num = Objects.requireNonNullElse(ctx.queryParam("page"), "0");
var size = Objects.requireNonNullElse(ctx.queryParam("size"), "10");
var sortBy = Objects.requireNonNullElse(ctx.queryParam("sortBy"), "grebi:type");
Expand All @@ -171,7 +173,7 @@ static void run(
q.addFacetField(facet);
}

q.addFilter("grebi:fromNodeId", Set.of(ctx.pathParam("nodeId")),
q.addFilter("grebi:fromNodeId", Set.of(nodeId),
/* this is actually a string field so this is an exact match */ SearchType.CASE_INSENSITIVE_TOKENS,
false);

Expand Down
29 changes: 12 additions & 17 deletions webapp/grebi_ui/src/frontends/ebi/pages/EbiNodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,20 @@ export default function EbiNodePage() {
</Helmet>
<main className="container mx-auto px-4 pt-1">
<SearchBox subgraph={subgraph} />
<div className="text-center">
<div className="text-center pb-2">
<Typography variant="h5">{pageTitle} {
node.extractType()?.long && <span style={{textTransform:'uppercase', fontVariant:'small-caps',fontWeight:'bold',fontSize:'small',verticalAlign:'middle',marginLeft:'12px'}}>{node.extractType()?.long}</span>}</Typography>
<div>
{node.getSourceIds().map(id => <span
className="bg-grey-default rounded-sm font-mono py-1 pl-2 ml-1 my-2 text-sm"
>{id.value}
<button
onClick={() => {
copyToClipboard(id.value);
}}
>
&nbsp;
<i className="icon icon-common icon-copy icon-spacer" />
</button>
</span>)}
</div>
</div>
<Typography>{pageDesc}</Typography>
</div>
<Grid container spacing={0.5} direction="row" alignItems={"center"} justifyContent={"center"} className="pb-2">
{node.getSourceIds().map(id => <Grid item>
<div className="bg-grey-default rounded-sm font-mono pl-1" style={{fontSize:'x-small'}}>
{id.value} <button onClick={() => { copyToClipboard(id.value); }} >
<i className="icon icon-common icon-copy icon-spacer" />
</button>
</div>
</Grid>)}
</Grid>
<Typography className="text-center pb-2">{pageDesc}</Typography>
<Grid container spacing={1} direction="row">
<Grid item xs={2}>
<Tabs orientation="vertical" variant="scrollable" value={tab} aria-label="basic tabs example" className="border-green" sx={{ borderRight: 1, borderColor: 'divider' }} onChange={(e, tab) => setSearchParams({tab})}>
Expand Down

0 comments on commit 0d55b21

Please sign in to comment.