Skip to content

Commit

Permalink
Created new component for annotation filters
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroDinis committed Dec 19, 2023
1 parent ce67004 commit 73e95f8
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/assets/scss/document_annotations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
overflow: auto;
max-height: 100%;

#annotation-filters {
padding: 16px;
span {
font-size: 14px;
}
}

.annotation-set-group {
.label-set-header {
cursor: pointer;
Expand Down
34 changes: 34 additions & 0 deletions src/components/DocumentAnnotations/AnnotationFilters.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<div id="annotation-filters">
<b-switch v-model="feedbackNeeded" class="is-small"
>Human Feedback needed</b-switch
>
<b-switch v-model="missingAnnotations" class="is-small"
>Missing Annotations</b-switch
>
<b-switch v-model="acceptedAnnotations" class="is-small"
>Accepted Annotations</b-switch
>
</div>
</template>
<script>
import { mapGetters, mapState } from "vuex";
export default {
name: "AnnotationFilters",
data() {
return {
feedbackNeeded: true,
missingAnnotations: true,
acceptedAnnotations: true,
};
},
computed: {},
methods: {},
};
</script>

<style
scoped
lang="scss"
src="../../assets/scss/document_annotations.scss"
></style>
6 changes: 5 additions & 1 deletion src/components/DocumentAnnotations/DocumentAnnotations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
</div>
</div>

<!-- When there's no annotations in the label -->
<!-- When there's no annotation sets -->
<div v-else-if="annotationSets.length === 0" class="empty-annotation-sets">
<EmptyState />
</div>

<div v-else ref="annotationList" :class="['annotation-set-list']">
<AnnotationFilters v-if="isDocumentEditable" />

<div
v-if="Object.entries(annotationSetsInTable()).length > 0"
class="annotation-set-group"
Expand Down Expand Up @@ -148,6 +150,7 @@ import EmptyState from "./EmptyState";
import ExtractingData from "./ExtractingData";
import AnnotationSetActionButtons from "./AnnotationSetActionButtons";
import DocumentLabel from "./DocumentLabel";
import AnnotationFilters from "./AnnotationFilters";
import LoadingAnnotations from "./LoadingAnnotations";
import GridIcon from "../../assets/images/GridIcon";
Expand All @@ -162,6 +165,7 @@ export default {
DocumentLabel,
LoadingAnnotations,
GridIcon,
AnnotationFilters,
},
data() {
return {
Expand Down

0 comments on commit 73e95f8

Please sign in to comment.