Skip to content
Merged
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 src/app/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@

const organisations = organisationData.flatMap(data =>
data.organisations.map(organisation => ({
text: getLocalizedText(organisation.name, i18n.language) + (organisation.alternativeName ? ` (${getLocalizedText(organisation.alternativeName, i18n.language)})` : ""),
text: getLocalizedText(organisation.name, i18n.language) + ('alternativeName' in organisation && organisation.alternativeName ? ` (${getLocalizedText(organisation.alternativeName, i18n.language)})` : ""),
value: organisation.id,
group: `${getLocalizedText(data.name, i18n.language)} (${getLocalizedText(data.abbreviation, i18n.language)})`,
}))
group: getLocalizedText(data.name, i18n.language) + (data.abbreviation ? ` (${getLocalizedText(data.abbreviation, i18n.language)})` : ''),
})).sort((a, b) => a.text.localeCompare(b.text, i18n.language))
);

const { showCountryExtensionVersion, setShowCountryExtensionVersion } =
Expand Down Expand Up @@ -235,7 +235,7 @@
const checkPubliccodeYmlVersion = useCallback((publicCode: PublicCode) => {
const { publiccodeYmlVersion } = publicCode;
setPubliccodeYmlVersion(publiccodeYmlVersion);
}, []);

Check warning on line 238 in src/app/components/Editor.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useCallback has a missing dependency: 'setPubliccodeYmlVersion'. Either include it or remove the dependency array

Check warning on line 238 in src/app/components/Editor.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useCallback has a missing dependency: 'setPubliccodeYmlVersion'. Either include it or remove the dependency array

const checkItCountryExtensionVersion = useCallback(
(publicCode: PublicCode) => {
Expand All @@ -255,7 +255,7 @@

setShowCountryExtensionVersion(countryExtensionVersionVisible);
},
[]

Check warning on line 258 in src/app/components/Editor.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useCallback has a missing dependency: 'setShowCountryExtensionVersion'. Either include it or remove the dependency array

Check warning on line 258 in src/app/components/Editor.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useCallback has a missing dependency: 'setShowCountryExtensionVersion'. Either include it or remove the dependency array
);

useFormPersist("form-values", {
Expand All @@ -267,7 +267,7 @@
checkPubliccodeYmlVersion(pc);
checkItCountryExtensionVersion(pc);
},
[setLanguages]

Check warning on line 270 in src/app/components/Editor.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useCallback has missing dependencies: 'checkItCountryExtensionVersion' and 'checkPubliccodeYmlVersion'. Either include them or remove the dependency array

Check warning on line 270 in src/app/components/Editor.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useCallback has missing dependencies: 'checkItCountryExtensionVersion' and 'checkPubliccodeYmlVersion'. Either include them or remove the dependency array
),
storage: window?.localStorage, // default window.sessionStorage
exclude: [],
Expand Down Expand Up @@ -485,7 +485,7 @@
yamlLoadEventBus.off("loadRemoteYaml", loadRemoteYamlHandler);
yamlLoadEventBus.off("loadFileYaml", loadFileYamlHandler);
};
}, []);

Check warning on line 488 in src/app/components/Editor.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useEffect has missing dependencies: 'loadFileYamlHandler' and 'loadRemoteYamlHandler'. Either include them or remove the dependency array

Check warning on line 488 in src/app/components/Editor.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useEffect has missing dependencies: 'loadFileYamlHandler' and 'loadRemoteYamlHandler'. Either include them or remove the dependency array

return (
<div className="content__editor-wrapper">
Expand Down
5 changes: 5 additions & 0 deletions src/app/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ https://ld.admin.ch/sparql/#query=PREFIX%20schema%3A%20%3Chttp%3A%2F%2Fschema.or
https://ld.admin.ch/sparql/#query=PREFIX%20schema%3A%20%3Chttp%3A%2F%2Fschema.org%2F%3E%0APREFIX%20rdf%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0A%0ASELECT%20DISTINCT%20%3Fdepartment%20%3FnameDepDe%20%3FnameDepFr%20%3FnameDepIt%20%3FnameDepEn%20%3FaltNameDepDe%20%3FaltNameDepFr%20%3FaltNameDepIt%20%3FaltNameDepEn%20%3Foffice%20%3FnameDe%20%3FnameFr%20%3FnameIt%20%3FnameEn%20%3FaltNameDe%20%3FaltNameFr%20%3FaltNameIt%20%3FaltNameEn%20WHERE%20%7B%0A%20%0A%20%20%3Foffice%20schema%3AinDefinedTermSet%20%3Chttps%3A%2F%2Fld.admin.ch%2Foffice%3E.%0A%20%20%3Foffice%20schema%3AparentOrganization%20%3Fdepartment.%0A%0A%20%20OPTIONAL%20%7B%20%3Foffice%20schema%3Aname%20%3FnameDe.%20FILTER(lang(%3FnameDe)%20%3D%20%22de%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Foffice%20schema%3Aname%20%3FnameFr.%20FILTER(lang(%3FnameFr)%20%3D%20%22fr%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Foffice%20schema%3Aname%20%3FnameIt.%20FILTER(lang(%3FnameIt)%20%3D%20%22it%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Foffice%20schema%3Aname%20%3FnameEn.%20FILTER(lang(%3FnameEn)%20%3D%20%22en%22)%20%7D%0A%0A%20%20OPTIONAL%20%7B%20%3Foffice%20schema%3AalternateName%20%3FaltNameDe.%20FILTER(lang(%3FaltNameDe)%20%3D%20%22de%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Foffice%20schema%3AalternateName%20%3FaltNameFr.%20FILTER(lang(%3FaltNameFr)%20%3D%20%22fr%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Foffice%20schema%3AalternateName%20%3FaltNameIt.%20FILTER(lang(%3FaltNameIt)%20%3D%20%22it%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Foffice%20schema%3AalternateName%20%3FaltNameEn.%20FILTER(lang(%3FaltNameEn)%20%3D%20%22en%22)%20%7D%0A%20%20%0A%20%20%3Fdepartment%20schema%3AinDefinedTermSet%20%3Chttps%3A%2F%2Fld.admin.ch%2Fdepartment%3E.%0A%20%20%0A%20%20OPTIONAL%20%7B%20%3Fdepartment%20schema%3Aname%20%3FnameDepDe.%20FILTER(lang(%3FnameDepDe)%20%3D%20%22de%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Fdepartment%20schema%3Aname%20%3FnameDepFr.%20FILTER(lang(%3FnameDepFr)%20%3D%20%22fr%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Fdepartment%20schema%3Aname%20%3FnameDepIt.%20FILTER(lang(%3FnameDepIt)%20%3D%20%22it%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Fdepartment%20schema%3Aname%20%3FnameDepEn.%20FILTER(lang(%3FnameDepEn)%20%3D%20%22en%22)%20%7D%0A%0A%20%20OPTIONAL%20%7B%20%3Fdepartment%20schema%3AalternateName%20%3FaltNameDepDe.%20FILTER(lang(%3FaltNameDepDe)%20%3D%20%22de%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Fdepartment%20schema%3AalternateName%20%3FaltNameDepFr.%20FILTER(lang(%3FaltNameDepFr)%20%3D%20%22fr%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Fdepartment%20schema%3AalternateName%20%3FaltNameDepIt.%20FILTER(lang(%3FaltNameDepIt)%20%3D%20%22it%22)%20%7D%0A%20%20OPTIONAL%20%7B%20%3Fdepartment%20schema%3AalternateName%20%3FaltNameDepEn.%20FILTER(lang(%3FaltNameDepEn)%20%3D%20%22en%22)%20%7D%0A%0A%7D%0A&endpoint=https%3A%2F%2Fld.admin.ch%2Fquery&requestMethod=POST&tabTitle=Query&headers=%7B%7D&contentTypeConstruct=text%2Fturtle&contentTypeSelect=application%2Fsparql-results%2Bjson&outputFormat=table&outputSettings=%7B%22pageSize%22%3A-1%7D
```

- The swiss cantons (`cantons.json`)
```
https://ld.admin.ch/sparql/#query=SELECT%20*%20WHERE%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%3FcantonUri%20a%20%3Chttps%3A%2F%2Fschema.ld.admin.ch%2FCanton%3E%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20OPTIONAL%20%7B%20%3FcantonUri%20%3Chttp%3A%2F%2Fschema.org%2Fname%3E%20%3FnameDe%20.%20FILTER%20(lang(%3FnameDe)%20%3D%20%22de%22)%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20OPTIONAL%20%7B%20%3FcantonUri%20%3Chttp%3A%2F%2Fschema.org%2Fname%3E%20%3FnameFr%20.%20FILTER%20(lang(%3FnameFr)%20%3D%20%22fr%22)%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20OPTIONAL%20%7B%20%3FcantonUri%20%3Chttp%3A%2F%2Fschema.org%2Fname%3E%20%3FnameIt%20.%20FILTER%20(lang(%3FnameIt)%20%3D%20%22it%22)%20%7D%0A%20%20%20%20%20%20%20%20%7D&endpoint=https%3A%2F%2Fld.admin.ch%2Fquery&requestMethod=POST&tabTitle=Query&headers=%7B%7D&contentTypeConstruct=application%2Fn-triples%2C*%2F*%3Bq%3D0.9&contentTypeSelect=application%2Fsparql-results%2Bjson%2C*%2F*%3Bq%3D0.9&outputFormat=table
```

Additionally, some special cases are added in `additional-organisations.json`. These are organisations are part of organisations returned in the above queries and must be added manually. It would be possible to fetch all organisations recursevely with the above queries, but that would yield too many organisations!


Expand Down
Loading
Loading