diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ee8b94e5..3bab35c7 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -15,8 +15,28 @@ on: - main jobs: + changes: + name: Check changed files + runs-on: ubuntu-latest + + outputs: + src: ${{ steps.filter.outputs.src }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + src: + - '!content/**' + validate: name: Validate + needs: [changes] + if: ${{ needs.changes.outputs.src == 'true' }} runs-on: ${{ matrix.os }} timeout-minutes: 60 @@ -99,7 +119,8 @@ jobs: retention-days: 30 build-deploy: - if: ${{ github.event_name == 'push' }} + name: Build and deploy + if: ${{ always() && github.event_name == 'push' }} needs: [validate] uses: ./.github/workflows/build-deploy.yml secrets: inherit diff --git a/components/data-graph.vue b/components/data-graph.vue index b07a35b3..7681e291 100644 --- a/components/data-graph.vue +++ b/components/data-graph.vue @@ -8,6 +8,7 @@ import { colors } from "../project.config.json"; const props = defineProps<{ networkData: NetworkEntity; searchNode: string; + detailNode?: string; }>(); const graph = new Graph(); @@ -62,5 +63,10 @@ function getNodeColor(nodeClass: string) { diff --git a/components/data-map-view.vue b/components/data-map-view.vue index 2cab6c7e..8bd21b68 100644 --- a/components/data-map-view.vue +++ b/components/data-map-view.vue @@ -16,12 +16,17 @@ const route = useRoute(); const t = useTranslations(); const currentView = useGetCurrentView(); +const { getUnprefixedId } = useIdPrefix(); const searchFiltersSchema = v.object({ category: v.fallback(v.picklist(categories), "entityName"), search: v.fallback(v.string(), ""), }); +const detailEntityId = computed(() => { + return route.params.id as string; +}); + const searchFilters = computed(() => { return v.parse(searchFiltersSchema, route.query); }); @@ -48,7 +53,7 @@ const { data, isPending, isPlaceholderData } = useGetSearchResults( : [], show: ["geometry", "when"], centroid: true, - system_classes: ["place", "object_location"], + system_classes: ["place"], limit: 0, }; }), @@ -141,6 +146,34 @@ watch(data, () => { */ popover.value = null; }); + +watchEffect(() => { + const entity = entities.value.find((feature) => { + const id = getUnprefixedId(feature["@id"]); + return id === detailEntityId.value; + }); + + if (entity) { + let coordinates = null; + + if (entity.geometry.type === "GeometryCollection") { + coordinates = entity.geometry.geometries.find((g) => { + return g.type === "Point"; + })?.coordinates as [number, number] | undefined; + } + + if (entity.geometry.type === "Point") { + coordinates = entity.geometry.coordinates as unknown as [number, number]; + } + + popover.value = { + coordinates: + coordinates ?? + (turf.center(createFeatureCollection([entity])).geometry.coordinates as [number, number]), + entities: [entity], + }; + } +});