Skip to content

Commit

Permalink
Fix #4026
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Oct 11, 2024
1 parent 497e7bc commit 000daca
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv

- Unify objects task [#970]
- Attribution to ObservationMatrix
- New biological association task [#4026]

### Changed

Expand All @@ -21,6 +22,7 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv
- New dichotomous key: Radial annotator is not loading the correct data [#4076]

[#970]: https://github.com/SpeciesFileGroup/taxonworks/issues/4074
[#4026]: https://github.com/SpeciesFileGroup/taxonworks/issues/4026
[#4074]: https://github.com/SpeciesFileGroup/taxonworks/issues/4074
[#4076]: https://github.com/SpeciesFileGroup/taxonworks/issues/4076

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ import '../vue/tasks/observation_matrices/import_nexus/main.js'
import '../vue/tasks/dwc_occurrences/filter/main.js'
import '../vue/tasks/unify/objects/main.js'
import '../vue/tasks/images/new_filename_depicting_image/main.js'
import '../vue/tasks/biological_associations/new_biological_association/main.js'
import '../vue/tasks/biological_associations/new/main.js'
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@
<span v-else>New record</span>
</div>
<div class="horizontal-center-content middle gap-small">
<label class="middle">
<input
v-model="store.autosave"
type="checkbox"
/>
Autosave
</label>
<VBtn
medium
color="create"
Expand Down Expand Up @@ -61,7 +54,10 @@
/>
<PanelCitation />
</div>
<TableResults :list="store.biologicalAssociations" />
<TableResults
:list="store.biologicalAssociations"
@select="store.setBiologicalAssociation"
/>
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
<th>Subject</th>
<th>Relationship</th>
<th>Object</th>
<th>Citation</th>
<th class="w-2" />
</tr>
</thead>
<tbody>
<tr
v-for="item in list"
:key="item.id"
@click="() => emit('select', item)"
>
<td v-html="item.subject.object_tag" />
<td v-html="item.relationship.object_tag" />
<td v-html="item.object.object_tag" />
<td v-html="item.citation.object_label" />
<td>
<div>
<VBtn
Expand Down Expand Up @@ -46,4 +49,6 @@ defineProps({
default: () => []
}
})
const emit = defineEmits(['select'])
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ function makeBiologicalAssociationItem(item) {
relationship: {
id: item.biological_relationship_id,
object_tag: item.biological_relationship.object_tag
}
},
citation: item.citations?.[0] || makeCitation()
}
}

Expand Down Expand Up @@ -72,8 +73,7 @@ export const useStore = defineStore('NewBiologicalAssociation', {
object: null,
subject: null,
relationship: null,
isLoading: false,
autosave: true
isLoading: false
}),

getters: {
Expand All @@ -88,6 +88,14 @@ export const useStore = defineStore('NewBiologicalAssociation', {
},

actions: {
setBiologicalAssociation(ad) {
this.biologicalAssociation = makeBiologicalAssociation(ad)
this.object = ad.object
this.subject = ad.subject
this.relationship = ad.relationship
this.citation = ad.citation
},

async loadRecentBiologicalAssociations() {
BiologicalAssociation.where({
recent: true,
Expand Down

0 comments on commit 000daca

Please sign in to comment.