@@ -7,11 +7,16 @@ import { useTileEditLog } from '@/bcgov_arches_common/composables/useTileEditLog
77import type { EditLogData } from ' @/bcgov_arches_common/types.ts' ;
88import ' primeicons/primeicons.css' ;
99import type { RelatedDocumentsTile } from ' @/bcap/schema/ArchaeologySiteSchema.ts' ;
10+ import type {
11+ HriaDiscontinuedDataSchema ,
12+ OtherMapsTile ,
13+ } from ' @/bcap/schema/HriaDiscontinuedDataSchema.ts' ;
1014import type { ColumnDefinition } from ' @/bcgov_arches_common/components/StandardDataTable/types.ts' ;
1115
1216const 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
8389const 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
118124const 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+
120133const 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 />
0 commit comments