Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO_NOT_MERGE: use GET query instead of post with only type as path param #1540

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

jobs:
test-and-build:
runs-on: it
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
run: |
docker build . --tag=nexus-web:fresh
- name: Start services
run: docker-compose -f ci/docker-compose.yml up -d && sleep 60
run: docker compose -f ci/docker-compose.yml up -d && sleep 60
- name: Copy nexus-web into Cypress container
# avoids permission issue where cypress writes screenshots to host with root as user
# which we can't then delete easily
Expand All @@ -55,4 +55,4 @@ jobs:
# --key ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Cleanup Docker Containers
if: ${{ always() }}
run: docker-compose -f ci/docker-compose.yml down --rmi "local" --volumes
run: docker compose -f ci/docker-compose.yml down --rmi "local" --volumes
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"editor.formatOnSave": true,
"files.eol": "\n"
"files.eol": "\n",
"files.watcherExclude": {
"**/target": true
}
}
Binary file added cypress/downloads/downloads.html
Binary file not shown.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"dependencies": {
"@ant-design/charts": "^1.3.4",
"@ant-design/icons": "^4.4.0",
"@aws-crypto/sha1-browser": "^5.2.0",
"@bbp/nexus-sdk": "1.3.15",
"@bbp/react-nexus": "1.3.15",
"@reduxjs/toolkit": "^1.8.5",
Expand Down Expand Up @@ -148,6 +149,7 @@
"redux-thunk": "^2.3.0",
"resize-observer-polyfill": "^1.5.1",
"showdown": "^1.9.1",
"sparqljs": "^3.7.1",
"string-similarity": "^4.0.4",
"ts-debounce": "^1.0.0",
"ts-invariant": "^0.4.4",
Expand Down
1 change: 1 addition & 0 deletions r1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "detail": "Not Found" }
14 changes: 11 additions & 3 deletions src/shared/components/IDResolution/ResponseViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@ type Props = {
data: any;
header?: string;
showHeader?: boolean;
collapsed?: boolean;
style?: React.CSSProperties;
};

const ResponseViewer = ({ data, showHeader = false, header = '' }: Props) => {
const ResponseViewer = ({
data,
showHeader = false,
header = '',
collapsed = false,
style = {},
}: Props) => {
return (
<ReactJson
collapsed
collapsed={collapsed}
name={showHeader ? header : undefined}
src={data as object}
indentWidth={3}
iconStyle="square"
enableClipboard={false}
displayObjectSize={false}
displayDataTypes={false}
style={{ maxWidth: 'inherit', width: '600px' }}
style={{ maxWidth: 'inherit', width: '600px', ...style }}
/>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/Preview/PDFPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const PDFThumbnail = ({
file={url}
onLoadError={console.error}
renderMode="svg"
options={{ isEvalSupported: false }}
>
<Page
className="pdf-thumbnail-page"
Expand Down
179 changes: 90 additions & 89 deletions src/shared/components/SparqlResultsTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const SparqlResultsTable: React.FunctionComponent<ResultTableProps> = ({
handleClick,
tableLabel,
}) => {
console.log('@@SparqlResultsTable',)
const [selectedColumns, setSelectedColumns] = React.useState<
HeaderProperties | undefined
>(headerProperties);
Expand All @@ -64,102 +65,102 @@ const SparqlResultsTable: React.FunctionComponent<ResultTableProps> = ({
const columnList = [
...(columnsToSelect
? columnsToSelect.map(({ title, dataIndex }) => {
// We can create special renderers for the cells here
let render;
switch (title) {
case 'Created At':
render = (date: string) => (
<span>
<FriendlyTimeAgo date={moment(date)} />
</span>
);
break;
case 'Project':
render = (projectURI: string) => {
if (projectURI) {
const [org, project] = parseProjectUrl(projectURI);
return (
<span>
<b>{org}</b> / {project}
</span>
);
}
return null;
};
break;
default:
render = (value: string) => {
const item = items.find(item => item[dataIndex] === value);
const studioResourceViewLink = item
? `/?_self=${item.self.value}`
: '';
if (isISODate(value)) {
return (
<a href={studioResourceViewLink}>
{getDateString(moment(value))}
</a>
);
}
// We can create special renderers for the cells here
let render;
switch (title) {
case 'Created At':
render = (date: string) => (
<span>
<FriendlyTimeAgo date={moment(date)} />
</span>
);
break;
case 'Project':
render = (projectURI: string) => {
if (projectURI) {
const [org, project] = parseProjectUrl(projectURI);
return (
<span>
<b>{org}</b> / {project}
</span>
);
}
return null;
};
break;
default:
render = (value: string) => {
const item = items.find(item => item[dataIndex] === value);
const studioResourceViewLink = item
? `/?_self=${item.self.value}`
: '';
if (isISODate(value)) {
return (
<a href={studioResourceViewLink}>
{getDateString(moment(value))}
</a>
);
}

return <a href={studioResourceViewLink}>{value}</a>;
};
return <a href={studioResourceViewLink}>{value}</a>;
};

break;
}
break;
}

const distinctValues = filteredItems.reduce((memo, item) => {
const value = item[dataIndex];
if (value && !memo.includes(value)) {
memo.push(value);
}
return memo;
}, [] as any[]);
const distinctValues = filteredItems.reduce((memo, item) => {
const value = item[dataIndex];
if (value && !memo.includes(value)) {
memo.push(value);
}
return memo;
}, [] as any[]);

const filterOptions =
distinctValues.length > MIN_FILTER_LIMIT &&
const filterOptions =
distinctValues.length > MIN_FILTER_LIMIT &&
distinctValues.length < MAX_FILTER_LIMIT
? {
filters: distinctValues.map(value => ({
value,
text: isISODate(value)
? getDateString(moment(value))
: value,
})),
filterMultiple: false,
filteredValue: filteredValues
? filteredValues[dataIndex]
: null,
onFilter: (filterValue: any, item: any) => {
return item[dataIndex] === filterValue;
},
}
: {};
return {
title,
dataIndex,
render,
className: `result-column ${dataIndex}`,
sorter: (
a: {
[key: string]: any;
? {
filters: distinctValues.map(value => ({
value,
text: isISODate(value)
? getDateString(moment(value))
: value,
})),
filterMultiple: false,
filteredValue: filteredValues
? filteredValues[dataIndex]
: null,
onFilter: (filterValue: any, item: any) => {
return item[dataIndex] === filterValue;
},
b: {
[key: string]: any;
}
) => {
const sortA = a[dataIndex];
const sortB = b[dataIndex];
if (sortA < sortB) {
return -1;
}
if (sortA > sortB) {
return 1;
}
return 0;
}
: {};
return {
title,
dataIndex,
render,
className: `result-column ${dataIndex}`,
sorter: (
a: {
[key: string]: any;
},
...filterOptions,
};
})
b: {
[key: string]: any;
}
) => {
const sortA = a[dataIndex];
const sortB = b[dataIndex];
if (sortA < sortB) {
return -1;
}
if (sortA > sortB) {
return 1;
}
return 0;
},
...filterOptions,
};
})
: []),
];

Expand Down
Loading
Loading