-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add components for editable Party/IPO/Deontics page
- Loading branch information
Showing
4 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps({ | ||
data: Object | ||
}) | ||
</script> | ||
|
||
<template> | ||
<p>{{ data.metadata["rdfs:label"] }}</p> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps({ | ||
data: Object, | ||
deontics: [], | ||
actions: [] | ||
}) | ||
function getDeonticById(deonticId: string) { | ||
let deontic = props.deontics.find(d => d.identifier === deonticId); | ||
if (deontic) | ||
return deontic.metadata["rdfs:label"] | ||
else | ||
return "N/A" | ||
} | ||
function getActionById(actionId: string) { | ||
let action = props.actions.find(d => d.identifier === actionId); | ||
console.log("actionId:" + actionId) | ||
console.log(action) | ||
if (action) | ||
return action.class | ||
else | ||
return "N/A" | ||
} | ||
</script> | ||
|
||
<script lang="ts"> | ||
import { library } from '@fortawesome/fontawesome-svg-core'; | ||
import { faPen } from '@fortawesome/free-solid-svg-icons'; | ||
import { faXmark } from '@fortawesome/free-solid-svg-icons'; | ||
library.add(faPen) | ||
library.add(faXmark) | ||
</script> | ||
|
||
<template> | ||
<div class="container-fluid mb-4 justify-content-md-center border border-secondary rounded"> | ||
<div class="d-flex justify-content-end"> | ||
<button type="button" class="btn"> | ||
<span class="btn-label"><font-awesome-icon :icon="['fas', 'pen']" /></span> | ||
</button> | ||
<button type="button" class="btn" @click="$emit('partyDeleted', data.identifier)"> | ||
<span class="btn-label"><font-awesome-icon :icon="['fas', 'xmark']"/></span> | ||
</button> | ||
</div> | ||
<div> | ||
<div><span>Label: {{ data.metadata["rdfs:label"] }}</span></div> | ||
<div><span>Class: {{ data.class }}</span></div> | ||
<div><span>Address: {{ data.address }}</span></div> | ||
<span v-if="data.deonticsIssued && data.deonticsIssued.length > 0"> | ||
<p><strong>Deontics Issued: </strong></p> | ||
<ul> | ||
<li v-for="deontic in data.deonticsIssued" :key="deontic"> | ||
<p>{{ getDeonticById(deontic) }}</p> | ||
</li> | ||
</ul> | ||
</span> | ||
<span v-if="data.actionsIsSubject && data.actionsIsSubject.length > 0"> | ||
<p><strong>Subject to following actions: </strong></p> | ||
<ul> | ||
<li v-for="action in data.actionsIsSubject" :key="action"> | ||
<p>{{ getActionById(action) }}</p> | ||
</li> | ||
</ul> | ||
</span> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters