Skip to content

Commit

Permalink
- ADD: Added "is not null" filter.
Browse files Browse the repository at this point in the history
- ADD: Added trait reference images.
- FIX: Fixed Bluesky link.
-
  • Loading branch information
sebastian-raubach committed Jan 14, 2025
1 parent a4416e4 commit 8ce965c
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/charts/TaxonomySankey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default {
const genusSpecies = {}
data.forEach(t => {
if (t.subtaxa && t.species) {
if (t.subtaxa && t.species && t.count > 1) {
source.push(labelArray.indexOf(t.species))
target.push(labelArray.indexOf(t.subtaxa))
value.push(+t.count)
Expand Down
4 changes: 2 additions & 2 deletions src/components/map/LocationMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ export default {
navigateToGermplasm: function (location) {
// Navigate to the germplasm overview page and filter on location
const filter = [{
column: 'location',
column: 'locationId',
comparator: 'equals',
operator: 'and',
values: [location.locationName]
values: [location.locationId]
}]
this.$router.push({
name: Pages.germplasm,
Expand Down
6 changes: 6 additions & 0 deletions src/components/tables/GermplasmTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ export default {
type: String,
sortable: true,
label: this.$t('tableColumnSubtaxa')
}, {
key: 'locationId',
type: Number,
sortable: true,
label: this.$t('tableColumnGermplasmLocationId'),
class: 'd-none'
}, {
key: 'location',
type: String,
Expand Down
13 changes: 12 additions & 1 deletion src/components/tables/ImageTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
<b-button @click="showImageExif(data.item)"><MdiIcon :path="mdiImageText" /> {{ $t('buttonShow') }}</b-button>
</template>
</template>
<!-- Show whether it's a trait reference image. -->
<template v-slot:cell(imageIsReference)="data">
<span class="text-nowrap text-primary" v-b-tooltip.hover :title="$t('tableTooltipImagesIsReference')" v-if="data.item.imageIsReference === true"><MdiIcon :path="mdiBookInformationVariant"/> <span> {{ data.item.collaborators }}</span></span>
<MdiIcon :path="mdiBookInformationVariant" className="text-muted" v-else/>
</template>
<!-- Reference name -->
<template v-slot:cell(referenceName)="data">
<!-- Germplasm -->
Expand Down Expand Up @@ -63,7 +68,7 @@ import { getHighContrastTextColor } from '@/mixins/colors'
import { getImageUrl } from '@/mixins/image'
import { Pages } from '@/mixins/pages'
import { mdiImageText } from '@mdi/js'
import { mdiBookInformationVariant, mdiImageText } from '@mdi/js'
export default {
name: 'ImageTable',
Expand All @@ -76,6 +81,7 @@ export default {
Pages,
imageTypes,
mdiImageText,
mdiBookInformationVariant,
options: {
idColumn: 'imageId',
tableName: 'images'
Expand Down Expand Up @@ -115,6 +121,11 @@ export default {
type: String,
sortable: true,
label: this.$t('tableColumnImageDescription')
}, {
key: 'imageIsReference',
type: Boolean,
sortable: true,
label: this.$t('tableColumnImageIsReference')
}, {
key: 'imagePath',
type: String,
Expand Down
4 changes: 2 additions & 2 deletions src/components/tables/LocationTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ export default {
navigateToGermplasm: function (location) {
// Set up the filter
const filter = [{
column: 'location',
column: 'locationId',
comparator: 'equals',
operator: 'and',
values: [location.locationName]
values: [location.locationId]
}]
// Redirect to germplasm page filtered by location
this.$router.push({
Expand Down
14 changes: 7 additions & 7 deletions src/components/tables/TableFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ export default {
mdiPlus,
id: uuidv4(),
validComparatorsForType: {
Boolean: ['equals', 'isNull'],
dataType: ['equals', 'isNull'],
locationType: ['equals', 'isNull'],
entityType: ['equals', 'isNull'],
json: ['jsonSearch', 'isNull'],
Boolean: ['equals', 'isNull', 'isNotNull'],
dataType: ['equals', 'isNull', 'isNotNull'],
locationType: ['equals', 'isNull', 'isNotNull'],
entityType: ['equals', 'isNull', 'isNotNull'],
json: ['jsonSearch', 'isNull', 'isNotNull'],
jsonObject: ['jsonSearch'],
Number: ['equals', 'between', 'lessThan', 'greaterThan', 'lessOrEquals', 'greaterOrEquals', 'inSet', 'isNull'],
Date: ['equals', 'between', 'lessThan', 'greaterThan', 'lessOrEquals', 'greaterOrEquals', 'isNull']
Number: ['equals', 'between', 'lessThan', 'greaterThan', 'lessOrEquals', 'greaterOrEquals', 'inSet', 'isNull', 'isNotNull'],
Date: ['equals', 'between', 'lessThan', 'greaterThan', 'lessOrEquals', 'greaterOrEquals', 'isNull', 'isNotNull']
},
filter: null,
tempFilter: [],
Expand Down
4 changes: 4 additions & 0 deletions src/mixins/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ const comparators = {
text: () => i18n.t('comparatorsIsNull'),
value: 0
},
isNotNull: {
text: () => i18n.t('comparatorsIsNotNull'),
value: 0
},
between: {
text: () => i18n.t('comparatorsBetween'),
values: 2
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/i18n/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"comparatorsGreaterThanOrEquals": "Greater than or equals",
"comparatorsInSet": "In set",
"comparatorsIsNull": "Is null/missing",
"comparatorsIsNotNull": "Is not null/missing",
"comparatorsLessThan": "Less than",
"comparatorsLessThanOrEquals": "Less than or equals",
"comparatorsJsonSearch": "JSON contains",
Expand Down Expand Up @@ -816,7 +817,7 @@
"pageLocationsMapsClimateOverlaysOpacity": "Overlay opacity",
"pageLocationsMapsClusteredText": "This map shows the locations clustered into groups. The numbers on the cluster nodes as well as their size and color represent the number of clustered locations. Clicking on a cluster node will expand this cluster and zoom in.",
"pageLocationsMapsClusteredTitle": "Clustered locations",
"pageLocationsMapsHeatmappedText": "The map below represents the density of locations with colors on a gradient. The gradient ranges from a low density (represented by the color white) to a high density (represented by the color blue). Zooming in will cause the density to dissipate.",
"pageLocationsMapsHeatmappedText": "The map below represents the density of locations with colors on a gradient. The gradient ranges from a low density (represented by the color purple) to a high density (represented by the color yellow). Zooming in will cause the density to dissipate.",
"pageLocationsMapsHeatmappedTitle": "Heatmapped locations",
"pageLocationsMapsText": "Filtering the table will adjust the maps below. You can use this to, e.g., only look at trial sites or only locations from a specific country.",
"pageLocationsMapsTitle": "Maps",
Expand Down Expand Up @@ -1192,6 +1193,7 @@
"tableColumnGermplasmId": "Id",
"tableColumnGermplasmInstitutions": "Institutions",
"tableColumnGermplasmImageCount": "Images",
"tableColumnGermplasmLocationId": "Location Id",
"tableColumnGermplasmLocation": "Location",
"tableColumnGermplasmName": "Germplasm name",
"tableColumnGermplasmDisplayName": "Display name",
Expand Down Expand Up @@ -1219,6 +1221,7 @@
"tableColumnImageReferenceName": "Reference name",
"tableColumnImageReferenceTable": "Reference type",
"tableColumnImageTags": "Tags",
"tableColumnImageIsReference": "Is reference image",
"tableColumnInstitutionAddress": "Institution address",
"tableColumnInstitutionId": "Institution id",
"tableColumnInstitutionCode": "Institution code",
Expand Down Expand Up @@ -1359,6 +1362,7 @@
"tableTooltipProjectDelete": "Delete project",
"tableTooltipProjectEdit" :"Edit project",
"tableTooltipInstitutionDatasetsAll": "All datasets",
"tableTooltipImagesIsReference": "Is reference image",
"tableColumnUserFeedbackId": "Id",
"tableColumnUserFeedbackType": "Feedback type",
"tableColumnUserFeedbackSeverity": "Severity",
Expand Down
2 changes: 1 addition & 1 deletion src/views/DashboardContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<ul class="nav col-md-4 justify-content-center justify-content-md-end list-unstyled d-flex">
<li class="ml-3"><a class="text-muted" href="https://ics.hutton.ac.uk/get-germinate"><MdiIcon :size="24" :path="mdiWeb" /></a></li>
<li class="ml-3"><a class="text-muted" href="https://bsky.app/profile/germinatehub.bsky.social"><MdiIcon :size="24" :path="bskyIcon" /></a></li>
<li class="ml-3"><a class="text-muted" href="https://bsky.app/profile/germinate.hutton.ac.uk"><MdiIcon :size="24" :path="bskyIcon" /></a></li>
<li class="ml-3"><a class="text-muted" href="https://twitter.com/GerminateHub"><MdiIcon :size="24" :path="mdiTwitter" /></a></li>
<li class="ml-3"><a class="text-muted" href="https://github.com/germinateplatform"><MdiIcon :size="24" :path="mdiGithub" /></a></li>
</ul>
Expand Down

0 comments on commit 8ce965c

Please sign in to comment.