Skip to content

Commit

Permalink
minor fix for search bar
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Oct 11, 2024
1 parent 2ad6423 commit 899bc2e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
6 changes: 1 addition & 5 deletions src/components/project/ProjectOptions.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<div v-if="selectedSamples.length" class="row rounded-borders items-center custom-frame1">
<q-btn round flat icon="close" @click="unselectSamples()" />
<div class="row q-pa-md rounded-borders items-center custom-frame1">
<div>
{{ selectedSamples.length }}
<span v-if="selectedSamples.length === 1">{{ $t('projectOptions.sample[0]') }}</span>
Expand Down Expand Up @@ -157,9 +156,6 @@ export default defineComponent({
fileLink.click();
},
unselectSamples() {
this.$emit('unselect');
},
},
});
</script>
12 changes: 1 addition & 11 deletions src/components/project/ProjectTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ export default defineComponent({
name: 'ProjectTable',
emits: ['selected-samples'],
props: {
parentUnselectSamples: {
type: Boolean as PropType<boolean>,
required: true,
},
samples: {
type: Array as PropType<sample_t[]>,
required: true,
Expand Down Expand Up @@ -180,12 +176,6 @@ export default defineComponent({
...mapState(useProjectStore, ['name', 'isAdmin', 'freezed', 'isOwner', 'blindAnnotationMode']),
},
watch: {
parentUnselectSamples(newVal) {
if (newVal) {
this.table.selected = [];
this.getSelectedSamples();
}
},
samples(newVal, oldVal) {
if (newVal !== oldVal) {
this.getSelectedSamples();
Expand All @@ -197,7 +187,7 @@ export default defineComponent({
this.$emit('selected-samples', this.table.selected);
},
searchSamples(rows: sample_t[], terms: any) {
return rows.filter((row) => row.sampleName.toLowerCase().indexOf(terms.toLowerCase) !== -1);
return rows.filter((row) => row.sampleName.toLowerCase().indexOf(terms.toLowerCase()) !== -1);
},
updateBlindAnnotationLevel(sample: sample_t) {
setTimeout(() => {
Expand Down
2 changes: 0 additions & 2 deletions src/pages/Project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,11 @@
:selected-samples="selectedSamples"
:canDeleteFromGithub="isAllowdedToSync && syncGithubRepo !== undefined"
:samples-length="samples.length"
@unselect="unselectSamples = true"
@reload="loadProjectData"
></ProjectOptions>
<ProjectTable
:key="reload"
:samples="samples"
:parent-unselect-samples="unselectSamples"
@selected-samples="getSelectedSamples"
></ProjectTable>
</q-tab-panel>
Expand Down

0 comments on commit 899bc2e

Please sign in to comment.