Skip to content

Commit

Permalink
Merge pull request #92 from ScilifelabDataCentre/sort-alphabetically-…
Browse files Browse the repository at this point in the history
…sources

Sorting sources and registers in alphabetical order
  • Loading branch information
JanProgrammierung authored Dec 4, 2024
2 parents 801a58c + 58f9f31 commit 35f0163
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions next-app/src/app/datasources/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ export default function DataPage(): ReactElement {
return (
selectedFilters.dataTypes.length === 0 ||
selectedFilters.dataTypes.some((filter) =>
dataSource.data.some((tag) => tag.toLowerCase() === filter.toLowerCase())
dataSource.data.some(
(tag) => tag.toLowerCase() === filter.toLowerCase()
)
)
);
}
Expand Down Expand Up @@ -197,7 +199,8 @@ export default function DataPage(): ReactElement {
<div className="space-y-8">
{/* Disclaimer */}
<div className="w-full max-w-lg bg-muted border border-neutral rounded-lg p-4 text-sm text-muted-foreground text-left mx-auto">
To access data, researchers may need to obtain ethical approval, submit data requests and set up data management agreements.
To access data, researchers may need to obtain ethical approval,
submit data requests and set up data management agreements.
</div>
{/* Search */}
<div className="space-y-4">
Expand Down Expand Up @@ -286,6 +289,7 @@ export default function DataPage(): ReactElement {
.filter((data) => applyDataTypeFilter(data))
.filter((data) => applyDiseaseTypeFilter(data))
.filter((data) => applySearchBar(data))
.sort((a, b) => a.name.localeCompare(b.name))
.map((item, index) => (
<Card key={index}>
<CardHeader className="bg-muted">
Expand Down
6 changes: 4 additions & 2 deletions next-app/src/app/registries/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ export default function RegistryPage() {
<div className="space-y-8">
{/* Disclaimer */}
<div className="w-full max-w-lg bg-muted border border-neutral rounded-lg p-4 text-sm text-muted-foreground text-left mx-auto">
To access data, researchers may need to obtain ethical approval, submit data requests and set up data management agreements.
</div>
To access data, researchers may need to obtain ethical approval,
submit data requests and set up data management agreements.
</div>
{/* Search */}
<div className="space-y-4">
<label
Expand Down Expand Up @@ -287,6 +288,7 @@ export default function RegistryPage() {
.filter((registry) => applyRegistryCentreFilter(registry))
.filter((registry) => applyRegistryCategoryFilter(registry))
.filter((registry) => applySearchBar(registry))
.sort((a, b) => a.name.localeCompare(b.name))
.map((item, index) => (
<Card key={index}>
<CardHeader className="bg-muted">
Expand Down

0 comments on commit 35f0163

Please sign in to comment.