Skip to content

Commit 807e212

Browse files
Add Other Maps
1 parent a151e44 commit 807e212

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

bcap/src/bcap/components/pages/details/ArchaeologicalSite/ArchaeologicalSiteDetails.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ const typedHriaData = computed(
151151
/>
152152
<Section9
153153
:data="typedCurrentData?.aliased_data?.related_documents"
154-
:loading="siteDataLoading"
154+
:hria-data="typedHriaData"
155+
:loading="siteDataLoading || hriaDataLoading"
155156
:force-collapsed="props.forceCollapsed"
156157
:show-audit-fields="props.showAuditFields"
157158
:edit-log-data="props.editLogData"

bcap/src/bcap/components/pages/details/ArchaeologicalSite/sections/DetailsSection9.vue

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ import { useTileEditLog } from '@/bcgov_arches_common/composables/useTileEditLog
77
import type { EditLogData } from '@/bcgov_arches_common/types.ts';
88
import 'primeicons/primeicons.css';
99
import type { RelatedDocumentsTile } from '@/bcap/schema/ArchaeologySiteSchema.ts';
10+
import type {
11+
HriaDiscontinuedDataSchema,
12+
OtherMapsTile,
13+
} from '@/bcap/schema/HriaDiscontinuedDataSchema.ts';
1014
import type { ColumnDefinition } from '@/bcgov_arches_common/components/StandardDataTable/types.ts';
1115
1216
const props = withDefaults(
1317
defineProps<{
1418
data: RelatedDocumentsTile | undefined;
19+
hriaData?: HriaDiscontinuedDataSchema;
1520
loading?: boolean;
1621
languageCode?: string;
1722
forceCollapsed?: boolean;
@@ -24,6 +29,7 @@ const props = withDefaults(
2429
forceCollapsed: undefined,
2530
editLogData: () => ({}),
2631
showAuditFields: false,
32+
hriaData: undefined,
2733
},
2834
);
2935
@@ -82,15 +88,15 @@ const imagesColumns = computed<ColumnDefinition[]>(() => {
8288
8389
const otherMapsColumns = computed<ColumnDefinition[]>(() => {
8490
return [
85-
{ field: 'map_name', label: 'Map Name' },
86-
{ field: 'map_scale', label: 'Map Scale' },
91+
{ field: 'other_maps_map_name', label: 'Map Name' },
92+
{ field: 'other_maps_map_scale', label: 'Map Scale' },
8793
{
88-
field: 'entered_on',
94+
field: 'other_maps_modified_on',
8995
label: 'Modified On',
9096
visible: props.showAuditFields,
9197
},
9298
{
93-
field: 'entered_by',
99+
field: 'other_maps_modified_by',
94100
label: 'Modified By',
95101
visible: props.showAuditFields,
96102
},
@@ -117,10 +123,15 @@ const { processedData: siteImagesTableData } = useTileEditLog(
117123
118124
const hasImages = computed(() => siteImagesTableData.value.length > 0);
119125
126+
const otherMapsData = computed<OtherMapsTile[]>(() => {
127+
const hriaData = props.hriaData as HriaDiscontinuedDataSchema | undefined;
128+
const maps = hriaData?.aliased_data?.other_maps;
129+
if (!maps) return [];
130+
return Array.isArray(maps) ? maps : [maps];
131+
});
132+
120133
const hasOtherMaps = computed(() => {
121-
return (
122-
currentData.value?.other_maps && currentData.value.other_maps.length > 0
123-
);
134+
return otherMapsData.value.length > 0;
124135
});
125136
</script>
126137

@@ -201,7 +212,7 @@ const hasOtherMaps = computed(() => {
201212
<template #sectionContent>
202213
<StandardDataTable
203214
v-if="hasOtherMaps"
204-
:table-data="currentData?.other_maps ?? []"
215+
:table-data="otherMapsData"
205216
:column-definitions="otherMapsColumns"
206217
:initial-sort-field-index="2"
207218
/>

bcap/src/bcap/schema/HriaDiscontinuedDataSchema.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ export interface DiscontinuedAddressAttributesTile extends AliasedTileData {
110110
};
111111
}
112112

113+
// aliased_data.other_maps[] (semantic)
114+
export interface OtherMapsTile extends AliasedTileData {
115+
aliased_data: {
116+
other_maps_map_name: StringValue; // string (i18n)
117+
other_maps_map_scale: StringValue; // string (i18n)
118+
other_maps_modified_on: DateValue; // date
119+
other_maps_modified_by: ResourceInstanceListValue; // resource-instance-list (contributor)
120+
};
121+
}
122+
113123
// ====================================================================
114124
// Top-level object for THIS JSON
115125
// ====================================================================
@@ -121,6 +131,7 @@ export interface HriaDiscontinuedDataSchema extends AliasedTileData {
121131
hria_jursidiction_and_tenure?: HriaJurisdictionAndTenureTile[];
122132
chronology?: ChronologyTile[];
123133
site_dimensions?: SiteDimensionsTile;
134+
other_maps?: OtherMapsTile[];
124135
};
125136

126137
graph_has_different_publication: boolean;

0 commit comments

Comments
 (0)