Skip to content

Commit

Permalink
DIGG-488: Updating orgaisation page type and number
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaMunterud committed Dec 2, 2024
1 parent 45b062a commit b69cd2c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
26 changes: 15 additions & 11 deletions components/content/Entryscape/OrganisationPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,23 @@ export const OrganisationPage: FC = () => {
>
{t("pages|organisation_page$org-type")}
</Heading>
<p>{entry.organisationData.orgType}</p>
<p>
{entry.organisationData.orgType ||
t("pages|organisation_page$no-org-type")}
</p>
</div>

{entry.organisationData.orgNo && (
<Heading
className="font-strong text-textSecondary"
level={3}
size={"xxs"}
>
{`${t("pages|organisation_page$org-no")} ${
entry.organisationData.orgNo
}`}
</Heading>
{entry.organisationData.orgNumber && (
<div>
<Heading
className="font-strong text-textSecondary"
level={3}
size={"xxs"}
>
{t("pages|organisation_page$org-no")}
</Heading>
<p>{entry.organisationData.orgClassification}</p>
</div>
)}

{entry.mqaCatalog && (
Expand Down
1 change: 1 addition & 0 deletions locales/en/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
"view-all-concepts": "View all concepts",
"data-info": "Information about the datasets",
"no-contact": "No contact information has been provided",
"no-org-type": "No organisation type has been provided",
"data-info-more": "Lorem ipsum dolor sit amet consectetur. Vitae aenean integer rhoncus enim urna. Eget eu semper ridiculus adipiscing ante enim. Adipiscing id ut sed sed sagittis faucibus nisl. Mi sem praesent id tempus vitae sagittis amet. Et ornare a duis sit odio scelerisque. Sed enim dolor massa dignissim ut. Platea quis proin purus auctor cursus semper dictum ultrices arcu."
},
"os": {
Expand Down
1 change: 1 addition & 0 deletions locales/sv/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
"view-all-concepts": "Visa alla begrepp",
"data-info": "Information om datamängderna",
"no-contact": "Inga kontaktuppgifter har angets",
"no-org-type": "Inget organisationstyp har angetts",
"data-info-more": "Lorem ipsum dolor sit amet consectetur. Vitae aenean integer rhoncus enim urna. Eget eu semper ridiculus adipiscing ante enim. Adipiscing id ut sed sed sagittis faucibus nisl. Mi sem praesent id tempus vitae sagittis amet. Et ornare a duis sit odio scelerisque. Sed enim dolor massa dignissim ut. Platea quis proin purus auctor cursus semper dictum ultrices arcu."
},
"os": {
Expand Down
12 changes: 6 additions & 6 deletions providers/EntrystoreProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ export const EntrystoreProvider: React.FC<EntrystoreProviderProps> = ({
)}`,
},
terms: { total: 0, termsInfo: [] },
orgClassification: metadata.findFirstValue(null, "org:classification"),
orgNumber: metadata.findFirstValue(null, "dcterms:identifier"),
};

const esTerms = new EntryStore(
Expand All @@ -393,9 +395,7 @@ export const EntrystoreProvider: React.FC<EntrystoreProviderProps> = ({
const dcatMeta = await fetchDCATMeta();

if (dcatMeta && dcatMeta.templates.length > 0) {
const publisherTypeUri = entry
.getAllMetadata()
.findFirstValue(null, "dcterms:type");
const publisherTypeUri = metadata.findFirstValue(null, "dcterms:type");

const orgTypeChoices = getTemplateChoices(
dcatMeta,
Expand All @@ -420,13 +420,14 @@ export const EntrystoreProvider: React.FC<EntrystoreProviderProps> = ({
.uriFacet("dcterms:accessRights")
.uriFacet("rdf:type")
.uriFacet("http://data.europa.eu/r5r/hvdCategory")
.uriFacet("https://www.w3.org/ns/org#classification")
.uriFacet("schema:offers")
.uriFacet("dcterms:conformsTo")
.list();

await datasetCounts.getEntries();

rawFacets = datasetCounts.getFacets();

if (rawFacets.length > 0) {
const dataAccessFacet = rawFacets.find(
(f) => f.predicate === "http://purl.org/dc/terms/accessRights",
Expand Down Expand Up @@ -471,8 +472,7 @@ export const EntrystoreProvider: React.FC<EntrystoreProviderProps> = ({
data.datasets.dataInfo[3].total = hvdData;

const feeDataFacet = rawFacets.find(
(f: any) =>
f.predicate === "https://www.w3.org/ns/org#classification",
(f: any) => f.predicate === "http://schema.org/offers",
);
const feeData = feeDataFacet?.valueCount || 0;
data.datasets.dataInfo[4].total = feeData;
Expand Down

0 comments on commit b69cd2c

Please sign in to comment.