Skip to content

Commit cdad74c

Browse files
Fix showing/hiding audit columns
1 parent 365eb87 commit cdad74c

File tree

9 files changed

+183
-54
lines changed

9 files changed

+183
-54
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@ const typedHriaData = computed(
9191
:hria-data="typedHriaData"
9292
:loading="siteDataLoading"
9393
:force-collapsed="props.forceCollapsed"
94+
:show-audit-fields="props.showAuditFields"
9495
:edit-log-data="props.editLogData"
9596
/>
9697
<Section3
9798
:data="typedSiteVisitData"
9899
:loading="siteVisitDataLoading"
99100
:force-collapsed="props.forceCollapsed"
101+
:show-audit-fields="props.showAuditFields"
100102
:edit-log-data="props.editLogData"
101103
/>
102104
<Section4
@@ -108,13 +110,15 @@ const typedHriaData = computed(
108110
:hria-data="typedHriaData"
109111
:loading="siteDataLoading"
110112
:force-collapsed="props.forceCollapsed"
113+
:show-audit-fields="props.showAuditFields"
111114
:edit-log-data="props.editLogData"
112115
/>
113116
<Section5
114117
:data="typedCurrentData?.aliased_data?.site_boundary"
115118
:hria-data="typedHriaData"
116119
:loading="siteDataLoading || hriaDataLoading"
117120
:force-collapsed="props.forceCollapsed"
121+
:show-audit-fields="props.showAuditFields"
118122
:edit-log-data="props.editLogData"
119123
/>
120124
<Section6
@@ -123,13 +127,15 @@ const typedHriaData = computed(
123127
:hria-data="typedHriaData"
124128
:loading="siteDataLoading"
125129
:force-collapsed="props.forceCollapsed"
130+
:show-audit-fields="props.showAuditFields"
126131
:edit-log-data="props.editLogData"
127132
/>
128133
<Section7
129134
:data="typedCurrentData?.aliased_data?.ancestral_remains"
130135
:site-visit-data="typedSiteVisitData"
131136
:loading="siteDataLoading || siteVisitDataLoading"
132137
:force-collapsed="props.forceCollapsed"
138+
:show-audit-fields="props.showAuditFields"
133139
:edit-log-data="props.editLogData"
134140
/>
135141
<Section8

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

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ const props = withDefaults(
2424
languageCode?: string;
2525
forceCollapsed?: boolean;
2626
editLogData?: EditLogData;
27+
showAuditFields?: boolean;
2728
}>(),
2829
{
2930
languageCode: 'en',
3031
forceCollapsed: undefined,
3132
editLogData: () => ({}),
33+
showAuditFields: false,
3234
},
3335
);
3436
@@ -65,7 +67,7 @@ const siteDecisionColumns = [
6567
{ field: 'recommended_by', label: 'Recommended By' },
6668
];
6769
68-
const authorityColumns = [
70+
const authorityColumns = computed(() => [
6971
{ field: 'responsible_government', label: 'Government' },
7072
{ field: 'authority_legal_instrument', label: 'Legal Instrument' },
7173
{ field: 'legislative_act', label: 'Act/Section' },
@@ -74,19 +76,35 @@ const authorityColumns = [
7476
{ field: 'authority_start_date', label: 'Start Date' },
7577
{ field: 'authority_end_date', label: 'Expiry Date' },
7678
{ field: 'authority_description', label: 'Description' },
77-
{ field: EDIT_LOG_FIELDS.ENTERED_ON, label: 'Entered On' },
78-
{ field: EDIT_LOG_FIELDS.ENTERED_BY, label: 'Entered By' },
79-
];
79+
{
80+
field: EDIT_LOG_FIELDS.ENTERED_ON,
81+
label: 'Entered On',
82+
visible: props.showAuditFields,
83+
},
84+
{
85+
field: EDIT_LOG_FIELDS.ENTERED_BY,
86+
label: 'Entered By',
87+
visible: props.showAuditFields,
88+
},
89+
]);
8090
81-
const siteNamesColumns = [
91+
const siteNamesColumns = computed(() => [
8292
{ field: 'name', label: 'Site Name' },
8393
{ field: 'name_type', label: 'Site Name Type' },
8494
{ field: 'name_remarks', label: 'Site Name Remarks' },
8595
{ field: 'assigned_or_reported_date', label: 'Date Assigned or Reported' },
8696
{ field: 'assigned_or_reported_by', label: 'Assigned or Reported By' },
87-
{ field: EDIT_LOG_FIELDS.ENTERED_ON, label: 'Entered On' },
88-
{ field: EDIT_LOG_FIELDS.ENTERED_BY, label: 'Entered By' },
89-
];
97+
{
98+
field: EDIT_LOG_FIELDS.ENTERED_ON,
99+
label: 'Entered On',
100+
visible: props.showAuditFields,
101+
},
102+
{
103+
field: EDIT_LOG_FIELDS.ENTERED_BY,
104+
label: 'Entered By',
105+
visible: props.showAuditFields,
106+
},
107+
]);
90108
91109
type IdFieldKey = (typeof id_fields)[number];
92110

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

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ const props = withDefaults(
2525
languageCode?: string;
2626
forceCollapsed?: boolean;
2727
editLogData?: EditLogData;
28+
showAuditFields?: boolean;
2829
}>(),
2930
{
3031
languageCode: 'en',
3132
loading: false,
3233
forceCollapsed: undefined,
3334
editLogData: () => ({}),
35+
showAuditFields: false,
3436
},
3537
);
3638
@@ -61,11 +63,19 @@ const tenureColumns = [
6163
{ field: 'tenure_description', label: 'Tenure Description' },
6264
];
6365
64-
const elevationCommentsColumns = [
66+
const elevationCommentsColumns = computed(() => [
6567
{ field: 'elevation_comments', label: 'Elevation Remarks', isHtml: true },
66-
{ field: EDIT_LOG_FIELDS.ENTERED_ON, label: 'Entered On' },
67-
{ field: EDIT_LOG_FIELDS.ENTERED_BY, label: 'Entered By' },
68-
];
68+
{
69+
field: EDIT_LOG_FIELDS.ENTERED_ON,
70+
label: 'Entered On',
71+
visible: props.showAuditFields,
72+
},
73+
{
74+
field: EDIT_LOG_FIELDS.ENTERED_BY,
75+
label: 'Entered By',
76+
visible: props.showAuditFields,
77+
},
78+
]);
6979
7080
const discontinuedTenureColumns = [
7181
{ field: 'jurisdiction', label: 'Jurisdiction' },
@@ -76,21 +86,37 @@ const discontinuedTenureColumns = [
7686
{ field: 'modified_by', label: 'Modified By' },
7787
];
7888
79-
const tenureRemarksColumns = [
89+
const tenureRemarksColumns = computed(() => [
8090
{ field: 'tenure_remarks', label: 'Tenure Remarks' },
81-
{ field: EDIT_LOG_FIELDS.ENTERED_ON, label: 'Entered On' },
82-
{ field: EDIT_LOG_FIELDS.ENTERED_BY, label: 'Entered By' },
83-
];
91+
{
92+
field: EDIT_LOG_FIELDS.ENTERED_ON,
93+
label: 'Entered On',
94+
visible: props.showAuditFields,
95+
},
96+
{
97+
field: EDIT_LOG_FIELDS.ENTERED_BY,
98+
label: 'Entered By',
99+
visible: props.showAuditFields,
100+
},
101+
]);
84102
85-
const addressRemarksColumns = [
103+
const addressRemarksColumns = computed(() => [
86104
{
87105
field: 'address_and_legal_description_remarks',
88106
label: 'Address and Legal Description Remarks',
89107
isHtml: true,
90108
},
91-
{ field: EDIT_LOG_FIELDS.ENTERED_ON, label: 'Entered On' },
92-
{ field: EDIT_LOG_FIELDS.ENTERED_BY, label: 'Entered By' },
93-
];
109+
{
110+
field: EDIT_LOG_FIELDS.ENTERED_ON,
111+
label: 'Entered On',
112+
visible: props.showAuditFields,
113+
},
114+
{
115+
field: EDIT_LOG_FIELDS.ENTERED_BY,
116+
label: 'Entered By',
117+
visible: props.showAuditFields,
118+
},
119+
]);
94120
95121
const discontinuedAddressColumns = [
96122
{ field: 'street_number', label: 'Street Number' },

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

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ const props = withDefaults(
2121
languageCode?: string;
2222
forceCollapsed?: boolean;
2323
editLogData?: EditLogData;
24+
showAuditFields?: boolean;
2425
}>(),
2526
{
2627
languageCode: 'en',
2728
loading: false,
2829
forceCollapsed: undefined,
2930
editLogData: () => ({}),
31+
showAuditFields: false,
3032
},
3133
);
3234
@@ -157,28 +159,44 @@ const discontinuedDimensionsColumns = [
157159
{ field: 'modified_by', label: 'Modified By' },
158160
];
159161
160-
const siteBoundaryDescriptionColumns = [
162+
const siteBoundaryDescriptionColumns = computed(() => [
161163
{
162164
field: 'site_boundary_description',
163165
label: 'Site Boundary Description',
164166
isHtml: true,
165167
},
166-
{ field: EDIT_LOG_FIELDS.ENTERED_ON, label: 'Entered On' },
167-
{ field: EDIT_LOG_FIELDS.ENTERED_BY, label: 'Entered By' },
168-
];
168+
{
169+
field: EDIT_LOG_FIELDS.ENTERED_ON,
170+
label: 'Entered On',
171+
visible: props.showAuditFields,
172+
},
173+
{
174+
field: EDIT_LOG_FIELDS.ENTERED_BY,
175+
label: 'Entered By',
176+
visible: props.showAuditFields,
177+
},
178+
]);
169179
170-
const currentSpatialAccuracyColumns = [
180+
const currentSpatialAccuracyColumns = computed(() => [
171181
{ field: 'latest_edit_type', label: 'Edit Type' },
172182
{ field: 'accuracy_remarks', label: 'Accuracy Remarks' },
173-
{ field: EDIT_LOG_FIELDS.ENTERED_ON, label: 'Edited On' },
174-
{ field: EDIT_LOG_FIELDS.ENTERED_BY, label: 'Edited By' },
175-
];
183+
{
184+
field: EDIT_LOG_FIELDS.ENTERED_ON,
185+
label: 'Entered On',
186+
visible: props.showAuditFields,
187+
},
188+
{
189+
field: EDIT_LOG_FIELDS.ENTERED_BY,
190+
label: 'Entered By',
191+
visible: props.showAuditFields,
192+
},
193+
]);
176194
177195
const historicalSpatialAccuracyColumns = [
178196
{ field: 'source_notes', label: 'Source Notes' },
179197
{ field: 'accuracy_remarks', label: 'Accuracy Remarks' },
180-
{ field: 'entered_on', label: 'Edited On' },
181-
{ field: 'entered_by', label: 'Edited By' },
198+
{ field: 'entered_on', label: 'Edited On', visible: props.showAuditFields },
199+
{ field: 'entered_by', label: 'Edited By', visible: props.showAuditFields },
182200
];
183201
</script>
184202

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ const props = withDefaults(
2222
languageCode?: string;
2323
forceCollapsed?: boolean;
2424
editLogData?: EditLogData;
25+
showAuditFields?: boolean;
2526
}>(),
2627
{
2728
siteVisitData: () => [],
2829
hriaData: undefined,
2930
languageCode: 'en',
3031
forceCollapsed: undefined,
3132
editLogData: () => ({}),
33+
showAuditFields: false,
3234
},
3335
);
3436
@@ -45,11 +47,19 @@ const typologyColumns = [
4547
{ field: 'typology_descriptor', label: 'Descriptor' },
4648
];
4749
48-
const typologyRemarksColumns = [
50+
const typologyRemarksColumns = computed(() => [
4951
{ field: 'site_typology_remarks', label: 'Site Typology Remarks' },
50-
{ field: EDIT_LOG_FIELDS.ENTERED_ON, label: 'Entered On' },
51-
{ field: EDIT_LOG_FIELDS.ENTERED_BY, label: 'Entered By' },
52-
];
52+
{
53+
field: EDIT_LOG_FIELDS.ENTERED_ON,
54+
label: 'Entered On',
55+
visible: props.showAuditFields,
56+
},
57+
{
58+
field: EDIT_LOG_FIELDS.ENTERED_BY,
59+
label: 'Entered By',
60+
visible: props.showAuditFields,
61+
},
62+
]);
5363
5464
const featureColumns = [
5565
{ field: 'archaeological_feature', label: 'Feature Type' },

bcap/src/bcap/components/pages/details/SiteVisit/SiteVisitDetails.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ const props = withDefaults(
2727
string,
2828
{ entered_on: string | null; entered_by: string | null }
2929
>;
30+
showAuditFields?: boolean;
3031
}>(),
3132
{
3233
languageCode: 'en',
3334
forceCollapsed: undefined,
3435
editLogData: () => ({}),
36+
showAuditFields: false,
3537
},
3638
);
3739
@@ -68,12 +70,14 @@ const { data: hriaData } = useRelatedResourceData<HriaDiscontinuedDataSchema>(
6870
:data="current || undefined"
6971
:loading="loading"
7072
:force-collapsed="props.forceCollapsed"
73+
:show-audit-fields="props.showAuditFields"
7174
:edit-log-data="props.editLogData"
7275
/>
7376
<Section3
7477
:data="current || undefined"
7578
:loading="loading"
7679
:force-collapsed="props.forceCollapsed"
80+
:show-audit-fields="props.showAuditFields"
7781
:edit-log-data="props.editLogData"
7882
/>
7983
<Section4
@@ -91,6 +95,7 @@ const { data: hriaData } = useRelatedResourceData<HriaDiscontinuedDataSchema>(
9195
:data="current || undefined"
9296
:loading="loading"
9397
:force-collapsed="props.forceCollapsed"
98+
:show-audit-fields="props.showAuditFields"
9499
:edit-log-data="props.editLogData"
95100
/>
96101
<Section7

bcap/src/bcap/components/pages/details/SiteVisit/sections/SiteVisitDetailsSection2.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ const props = withDefaults(
1717
data: SiteVisitSchema | undefined;
1818
loading?: boolean;
1919
editLogData?: EditLogData;
20+
showAuditFields?: boolean;
2021
}>(),
2122
{
2223
loading: false,
2324
editLogData: () => ({}),
25+
showAuditFields: false,
2426
},
2527
);
2628
@@ -48,15 +50,23 @@ const hasNewNames = computed(() => {
4850
return newNamesTableData.value && newNamesTableData.value.length > 0;
4951
});
5052
51-
const newNameColumns = [
53+
const newNameColumns = computed(() => [
5254
{ field: 'name', label: 'Site Name' },
5355
{ field: 'name_type', label: 'Site Name Type' },
5456
{ field: 'name_remarks', label: 'Site Name Remarks' },
5557
{ field: 'assigned_or_reported_date', label: 'Date Assigned or Reported' },
5658
{ field: 'assigned_or_reported_by', label: 'Assigned or Reported By' },
57-
{ field: EDIT_LOG_FIELDS.ENTERED_ON, label: 'Entered On' },
58-
{ field: EDIT_LOG_FIELDS.ENTERED_BY, label: 'Entered By' },
59-
];
59+
{
60+
field: EDIT_LOG_FIELDS.ENTERED_ON,
61+
label: 'Entered On',
62+
visible: props.showAuditFields,
63+
},
64+
{
65+
field: EDIT_LOG_FIELDS.ENTERED_BY,
66+
label: 'Entered By',
67+
visible: props.showAuditFields,
68+
},
69+
]);
6070
6171
const tempNumberText = computed(() => {
6272
const tempNum = tempNumberData.value?.aliased_data?.temporary_number;

0 commit comments

Comments
 (0)