diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ec1eb763..cb4cb7eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ You can also check the [release page](https://github.com/visualize-admin/visuali - Map: - area & symbol layers now use the same approach as for segment field (optional select element), to be more consistent across the app - it's now possible to use discrete color mapping in symbol layer +- Errors: + - Make missing timeFormat error message more explicit ## [3.9.6] - 2022-10-12 diff --git a/app/components/hint.tsx b/app/components/hint.tsx index b5816d382..9547c4985 100644 --- a/app/components/hint.tsx +++ b/app/components/hint.tsx @@ -158,7 +158,14 @@ export const LoadingDataError = ({ message }: { message?: string }) => ( {message ? ( -
+      
         {message}
       
) : null} diff --git a/app/docs/rdf-to-visualize.mdx b/app/docs/rdf-to-visualize.mdx index 7ab89dbaa..6cf232e0f 100644 --- a/app/docs/rdf-to-visualize.mdx +++ b/app/docs/rdf-to-visualize.mdx @@ -118,7 +118,7 @@ called _Shared dimensions_, and their values will be fetched outside the cube. | `?dimension cube:meta/dataKind schema:GeoCoordinates` | `dim.dataKind = "GeoCoordinates"` | | `?dimension cube:meta/dataKind schema:GeoShape` | `dim.dataKind = "GeoShape"` | -ℹ️ Temporal dimensions can be interactively filtered with a _time range slider_ +ℹ️ Temporal dimensions can be interactively filtered with a _time range slider_. **Important note**: in order to be able to properly parse temporal dimension, make sure it's scale it set to Interval! ℹ️ GeoCoordinates dimensions can be shown on a map as _points_ diff --git a/app/graphql/resolvers/index.ts b/app/graphql/resolvers/index.ts index b988616c4..2f1328e80 100644 --- a/app/graphql/resolvers/index.ts +++ b/app/graphql/resolvers/index.ts @@ -189,7 +189,15 @@ export const resolvers: Resolvers = { TemporalDimension: { ...mkDimensionResolvers("TemporalDimension"), timeUnit: ({ data: { timeUnit } }) => timeUnit!, - timeFormat: ({ data: { timeFormat } }) => timeFormat!, + timeFormat: ({ data }) => { + if (data.timeFormat === undefined) { + throw new Error( + `Time format couldn't be retrieved for ${data.name}. Make sure it's set up properly in the Cube Creator – if it is, make sure that the interval scale is selected for this dimension (or remove time description if it's not a temporal dimension).` + ); + } + + return data.timeFormat; + }, }, GeoCoordinatesDimension: { ...mkDimensionResolvers("GeoCoordinatesDimension"),