@konfuzio/document-validation-ui 0.1.10-dev.4 → 0.1.10-dev.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,132 +0,0 @@
1
- <template>
2
- <section ref="splittingModal" class="splitting-confirmation-modal">
3
- <b-modal
4
- v-model="isModalActive"
5
- class="modal-400"
6
- :width="500"
7
- :can-cancel="[]"
8
- >
9
- <section class="modal-card-body split-modal">
10
- <div class="header">
11
- <StarIcon />
12
- <p class="modal-title">
13
- {{
14
- splittingSuggestions && splittingSuggestions.length > 0
15
- ? $t("split_modal_title")
16
- : $t("prepare_document")
17
- }}
18
- </p>
19
- </div>
20
- <div ref="bodyText" class="content"></div>
21
- </section>
22
- <footer class="modal-card-foot">
23
- <b-button @click="closeModal">
24
- {{ $t("do_it_later") }}
25
- </b-button>
26
- <b-button type="is-primary" @click="handleReviewNow">
27
- {{ $t("review_now") }}
28
- <span class="recommended">{{ recommended }}</span>
29
- </b-button>
30
- </footer>
31
- </b-modal>
32
- </section>
33
- </template>
34
-
35
- <script>
36
- import { mapGetters, mapState } from "vuex";
37
- import StarIcon from "../../assets/images/StarIcon";
38
-
39
- /**
40
- * This component shows a modal to inform the user about auto-splitting suggestions
41
- */
42
- export default {
43
- name: "SplittingSuggestionsModal",
44
- components: {
45
- StarIcon,
46
- },
47
- data() {
48
- return {
49
- isModalActive: false,
50
- recommended: this.$t("recommended"),
51
- };
52
- },
53
- computed: {
54
- ...mapState("document", ["splittingSuggestions", "selectedDocument"]),
55
- ...mapState("edit", ["editMode"]),
56
- ...mapGetters("document", ["waitingForSplittingConfirmation"]),
57
- },
58
- watch: {
59
- splittingSuggestions(newValue) {
60
- if (newValue) {
61
- this.isModalActive = true;
62
- }
63
- },
64
- editMode(newValue) {
65
- if (!newValue) {
66
- this.showModal();
67
- }
68
- },
69
- isModalActive(newValue) {
70
- if (newValue) {
71
- this.$nextTick(() => {
72
- if (
73
- this.splittingSuggestions &&
74
- this.splittingSuggestions.length > 0
75
- ) {
76
- this.$refs.bodyText.innerHTML = this.$t("split_modal_body", {
77
- number_of_split_documents: this.splittingSuggestions.length,
78
- });
79
- } else {
80
- this.$refs.bodyText.innerHTML = this.$t(
81
- "split_modal_no_suggestions"
82
- );
83
- }
84
- });
85
- }
86
- },
87
- },
88
- mounted() {
89
- this.showModal();
90
-
91
- this.$nextTick(() => {
92
- if (this.recommended) {
93
- this.recommended = this.recommended.toUpperCase();
94
- }
95
- });
96
- },
97
- methods: {
98
- showModal() {
99
- if (
100
- this.splittingSuggestions &&
101
- this.waitingForSplittingConfirmation(this.selectedDocument)
102
- ) {
103
- this.isModalActive = true;
104
- }
105
- },
106
- closeModal() {
107
- const updatedDocument = [
108
- {
109
- name: this.selectedDocument.data_file_name,
110
- category: this.selectedDocument.category,
111
- pages: this.selectedDocument.pages,
112
- },
113
- ];
114
-
115
- this.$store.dispatch("edit/editDocument", updatedDocument);
116
-
117
- this.$store.dispatch("display/setCategorizeModalIsActive", false);
118
- this.isModalActive = false;
119
- },
120
- handleReviewNow() {
121
- this.$store.dispatch("edit/enableEditMode");
122
- this.isModalActive = false;
123
- },
124
- },
125
- };
126
- </script>
127
-
128
- <style
129
- scoped
130
- lang="scss"
131
- src="../../assets/scss/splitting_confirmation_modal.scss"
132
- ></style>