Skip to content

Commit

Permalink
Merge pull request #44 from ConductionNL/development
Browse files Browse the repository at this point in the history
Development to main
  • Loading branch information
remko48 authored Oct 23, 2024
2 parents 4035e2c + 6fe787a commit 4a47262
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
24 changes: 14 additions & 10 deletions src/modals/objectAuditTrail/ViewObjectAuditTrail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ import { objectStore, navigationStore } from '../../store/store.js'
<h4>Changes:</h4>
<ul>
<li v-for="(change, key) in auditTrail.changed" :key="key">
<strong>{{ key }}:</strong>
<span>Old: {{ change.old }}</span>
<span>New: {{ change.new }}</span>
<strong>{{ key }}:</strong><br>
<span>Old: {{ change.old ?? 'N/A' }}</span><br>
<span>New: {{ change.new ?? 'N/A' }}</span>
</li>
</ul>
</div>

<div class="navigation-buttons">
<NcButton @click="navigateTo('schema', auditTrail.schema)">
Go to Schema {{ auditTrail.schema }}
<NcButton>
Go to linked Schema
</NcButton>
<NcButton @click="navigateTo('register', auditTrail.register)">
Go to Register {{ auditTrail.register }}
<NcButton>
Go to linked Register
</NcButton>
<NcButton @click="navigateTo('object', auditTrail.object)">
Go to Object {{ auditTrail.object }}
<NcButton>
Go to linked Object
</NcButton>
</div>
</div>
Expand Down Expand Up @@ -89,10 +89,14 @@ export default {
.audit-item {
border-bottom: 1px solid #ccc;
padding: 10px 0;
padding: 0 0 10px 0;
margin: 0 0 10px 0;
}
.navigation-buttons {
margin-top: 10px;
display: flex;
gap: 10px;
justify-content: center;
}
</style>
3 changes: 3 additions & 0 deletions src/store/modules/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export const useObjectStore = defineStore('object', {
})
const data = await response.json()
this.setObjectItem(data)
this.getAuditTrails(data.id)

return data
} catch (err) {
console.error(err)
Expand Down Expand Up @@ -138,6 +140,7 @@ export const useObjectStore = defineStore('object', {

this.refreshObjectList()
this.setObjectItem(data)
this.getAuditTrails(data.id)

return { response, data }
},
Expand Down
6 changes: 3 additions & 3 deletions src/views/object/ObjectDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ import { objectStore, navigationStore } from '../../store/store.js'
</div>
</BTab>
<BTab title="Audit Trails">
<div v-if="auditTrails.length">
<NcListItem v-for="(auditTrail, key) in auditTrails"
<div v-if="objectStore.auditTrails.length">
<NcListItem v-for="(auditTrail, key) in objectStore.auditTrails"
:key="key"
:name="new Date(auditTrail.created).toLocaleString()"
:bold="false"
Expand All @@ -87,7 +87,7 @@ import { objectStore, navigationStore } from '../../store/store.js'
</template>
</NcListItem>
</div>
<div v-if="!auditTrails.length">
<div v-if="!objectStore.auditTrails.length">
No audit trails found
</div>
</BTab>
Expand Down

0 comments on commit 4a47262

Please sign in to comment.