Skip to content

Commit

Permalink
Apply prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
skodapetr committed Aug 16, 2024
1 parent d47a174 commit fbafac1
Show file tree
Hide file tree
Showing 37 changed files with 717 additions and 528 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Validátor lokálních katalogů otevřených dat (LKODů)

Tento repozitář obsahuje validátor lokálních katalogů otevřených dat na základě otevřené formální normy [Rozhraní katalogů otevřených dat: DCAT-AP-CZ](https://ofn.gov.cz/rozhraní-katalogů-otevřených-dat/2021-01-11/), tj. dle rozhraní DCAT-AP Dokumenty a DCAT-AP SPARQL Endpoint.
Pro správnou funkci LKOD je třeba, aby jeho přístupový bod LKOD implementoval [techniku CORS](https://opendata.gov.cz/špatná-praxe:chybějící-cors).

Expand All @@ -9,23 +10,30 @@ Alternativně je možné validátor [spustit lokálně mimo prohlížeč](#lokal
Na validátor se dá odkázat i s URL přístupového bodu v parametru `catalog`, např. [`https://datagov-cz.github.io/lkod-validator/#catalog=https://data.dia.gov.cz/sparql`](https://datagov-cz.github.io/lkod-validator/?catalog=https://data.dia.gov.cz/sparql), což přímo spustí validaci.

## Lokální instalace a spuštění

Narozdíl od běhu v prohlížeči lokální běh nemá problém přečístá katalogy, které nemají správně nastavenou techniku CORS.
Výsledek validate lokálního běhu a běhu v prohlížeči se tak může lišit!

## Požadavky

Pro instalaci je třeba mít k dispozici:

- [Node.js](https://nodejs.org/en) verze 20 nebo novější

## Instalace

Nejprve je třeba provést stažení tohoto repositáře a instalaci závislostí.

```bash
git clone https://github.com/datagov-cz/lkod-validator.git
cd lkod-validator
npm ci
```

Následně je možné validaci pustit pomocí následujícího příkazu.

```bash
npm run --silent validate https://raw.githubusercontent.com/jakubklimek/lkod-test/main/katalog.jsonld
```
Program následně vypíše výsledek validace ve formátu JSON na standartní výstup.

Program následně vypíše výsledek validace ve formátu JSON na standartní výstup.
2 changes: 1 addition & 1 deletion client/application/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function Application() {
mode: prefersDarkMode ? "dark" : "light",
},
}),
[prefersDarkMode]
[prefersDarkMode],
);
return (
<ThemeProvider theme={theme}>
Expand Down
2 changes: 1 addition & 1 deletion client/application/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const useRerender = () => {
}, [name]);

console.log(
`Component ${name} rerender with props: ${JSON.stringify(props)} `
`Component ${name} rerender with props: ${JSON.stringify(props)} `,
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";

import { Report } from "../validator-service";

export function CanNotConvertToRdf(props: { report: Report.LocalCatalogReport }) {
export function CanNotConvertToRdf(props: {
report: Report.LocalCatalogReport;
}) {
const { t } = useTranslation();

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";

import { Report } from "../validator-service";

export function CanNotDetermineContentType({ report }: { report: Report.LocalCatalogReport }) {
export function CanNotDetermineContentType({
report,
}: {
report: Report.LocalCatalogReport;
}) {
const { t } = useTranslation();

let content: React.ReactNode = null;
Expand All @@ -23,10 +27,15 @@ export function CanNotDetermineContentType({ report }: { report: Report.LocalCat
content = (
<div>
<div>{t("ui.can-not-determine-content-type-status-summary")}</div>
<div>{t("ui.can-not-determine-content-type-status-suggestion-{status-code}-{content-type}", {
"status-code": report.loadingFailure?.contentTypeStatusCode,
"content-type": report.loadingFailure?.headerContentType ?? "",
})}</div>
<div>
{t(
"ui.can-not-determine-content-type-status-suggestion-{status-code}-{content-type}",
{
"status-code": report.loadingFailure?.contentTypeStatusCode,
"content-type": report.loadingFailure?.headerContentType ?? "",
},
)}
</div>
</div>
);
}
Expand All @@ -37,4 +46,3 @@ export function CanNotDetermineContentType({ report }: { report: Report.LocalCat
</div>
);
}

Loading

0 comments on commit fbafac1

Please sign in to comment.