Skip to content

Commit

Permalink
Merge pull request #439 from diggsweden/DIGG-429
Browse files Browse the repository at this point in the history
Digg 429
  • Loading branch information
AlessandroGasperini authored Jun 28, 2024
2 parents 6bb44aa + b1f8a13 commit 166623d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
15 changes: 7 additions & 8 deletions components/content/Entryscape/SpecificationPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import useTranslation from "next-translate/useTranslation";
import { FC, useContext, useEffect, useState } from "react";
import { FC, useContext, useEffect } from "react";
import { EntrystoreContext } from "@/providers/EntrystoreProvider";
import { SettingsContext } from "@/providers/SettingsProvider";
import { useRouter } from "next/router";
Expand All @@ -8,7 +8,6 @@ import { hemvist, keyword, linkBase } from "@/utilities";
import { Container } from "@/components/layout/Container";
import { Heading } from "@/components/global/Typography/Heading";
import { Preamble } from "@/components/global/Typography/Preamble";
import { Button } from "@/components/global/Button";

export const SpecificationPage: FC<{
curi?: string;
Expand All @@ -18,10 +17,10 @@ export const SpecificationPage: FC<{
const entry = useContext(EntrystoreContext);
const { lang, t } = useTranslation();
const { pathname } = useRouter() || {};
const [showAllDatasets, setShowAllDatasets] = useState(false);
const relatedDatasets = showAllDatasets
? entry.conformsTo
: entry.conformsTo?.slice(0, 4);
// const [showAllDatasets, setShowAllDatasets] = useState(false);
// const relatedDatasets = showAllDatasets
// ? entry.conformsTo
// : entry.conformsTo?.slice(0, 4);

/**
* Async load scripts requiered for EntryScape blocks,
Expand Down Expand Up @@ -343,7 +342,7 @@ export const SpecificationPage: FC<{
data-entryscape-filterpredicates="dcterms:title,dcterms:description,dcat:distribution,dcterms:publisher,prof:hasResource,adms:prev,dcat:keyword"
></div>
</div>
{entry.conformsTo && entry.conformsTo.length > 0 && (
{/* {entry.conformsTo && entry.conformsTo.length > 0 && (
<div>
<span className="rdformsLabel">
{t("pages|specification_page$related_datasets")}
Expand Down Expand Up @@ -371,7 +370,7 @@ export const SpecificationPage: FC<{
/>
)}
</div>
)}
)} */}
</div>
</div>
</div>
Expand Down
45 changes: 22 additions & 23 deletions components/content/Search/SearchFilters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,29 +247,28 @@ export const SearchFilters: React.FC<SearchFilterProps> = ({
}
>
<div className="absolute z-10 mr-lg mt-sm max-h-[600px] w-full overflow-y-auto bg-white shadow-md md:max-w-[330px]">
{searchMode == "datasets" ||
(searchMode == "specifications" && (
//only render on searchpage
<>
{isLicense ? (
<MarkAll
search={search}
toggleKey={key}
title={t(`filters|allchecktext$${key}`)}
/>
) : (
<FilterSearch
filterKey={key}
filter={inputFilter}
setFilter={setInputFilter}
fetchMore={() =>
shouldFetchMore &&
search.fetchMoreFacets(key)
}
/>
)}
</>
))}
{(searchMode === "datasets" ||
searchMode === "specifications") && (
<>
{isLicense ? (
<MarkAll
search={search}
toggleKey={key}
title={t(`filters|allchecktext$${key}`)}
/>
) : (
<FilterSearch
filterKey={key}
filter={inputFilter}
setFilter={setInputFilter}
fetchMore={() =>
shouldFetchMore &&
search.fetchMoreFacets(key)
}
/>
)}
</>
)}

{facetValues.map(
(facetValue: SearchFacetValue, index: number) => {
Expand Down

0 comments on commit 166623d

Please sign in to comment.