@konfuzio/document-validation-ui 0.1.10-dev.1 → 0.1.10-dev.11

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.
Files changed (35) hide show
  1. package/dist/css/app.css +1 -1
  2. package/dist/index.html +1 -1
  3. package/dist/js/app.js +1 -1
  4. package/dist/js/app.js.map +1 -1
  5. package/dist/js/chunk-vendors.js +1 -1
  6. package/package.json +1 -1
  7. package/src/api.js +10 -0
  8. package/src/assets/scss/document_category.scss +1 -0
  9. package/src/assets/scss/document_edit.scss +27 -7
  10. package/src/assets/scss/document_name.scss +1 -1
  11. package/src/assets/scss/document_top_bar.scss +4 -0
  12. package/src/assets/scss/new_annotation.scss +14 -3
  13. package/src/assets/scss/{main.scss → theme.scss} +26 -17
  14. package/src/assets/scss/variables.scss +1 -7
  15. package/src/components/App.vue +56 -2
  16. package/src/components/DocumentAnnotations/DocumentAnnotations.vue +0 -11
  17. package/src/components/DocumentCategory.vue +2 -2
  18. package/src/components/DocumentDashboard.vue +3 -15
  19. package/src/components/DocumentEdit/DocumentEdit.vue +80 -25
  20. package/src/components/DocumentEdit/EditPages.vue +5 -3
  21. package/src/components/DocumentEdit/{SplitOverview.vue → RenameAndCategorize.vue} +9 -8
  22. package/src/components/DocumentEdit/index.js +1 -1
  23. package/src/components/DocumentPage/NewAnnotation.vue +2 -1
  24. package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +66 -30
  25. package/src/locales/de.json +5 -5
  26. package/src/locales/en.json +5 -5
  27. package/src/locales/es.json +18 -18
  28. package/src/main.js +0 -24
  29. package/src/store/document.js +14 -12
  30. package/src/store/edit.js +30 -14
  31. package/dist/css/chunk-vendors.css +0 -5
  32. package/src/assets/scss/categorize_modal.scss +0 -45
  33. package/src/assets/scss/splitting_confirmation_modal.scss +0 -41
  34. package/src/components/DocumentAnnotations/CategorizeModal.vue +0 -247
  35. package/src/components/DocumentModals/SplittingSuggestionsModal.vue +0 -132
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.10-dev.1",
3
+ "version": "0.1.10-dev.11",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
package/src/api.js CHANGED
@@ -21,6 +21,14 @@ const setAuthToken = (token) => {
21
21
  authToken = token;
22
22
  };
23
23
 
24
+ const setApiUrl = (url) => {
25
+ HTTP.defaults.baseURL = url;
26
+ };
27
+
28
+ const setImageUrl = (url) => {
29
+ IMG_REQUEST.defaults.baseURL = url;
30
+ };
31
+
24
32
  const getInterceptorConfig = (config) => {
25
33
  if (authToken) {
26
34
  config.headers["Authorization"] = `Token ${authToken}`;
@@ -54,6 +62,8 @@ const makeImageRequest = (imageURL) => {
54
62
 
55
63
  export default {
56
64
  HTTP,
65
+ setApiUrl,
66
+ setImageUrl,
57
67
  makeImageRequest,
58
68
  setAuthToken,
59
69
  };
@@ -2,6 +2,7 @@
2
2
 
3
3
  .category-chooser {
4
4
  cursor: pointer;
5
+ height: 100%;
5
6
 
6
7
  &.split-mode {
7
8
  border: 1px solid $grey-outline;
@@ -3,7 +3,7 @@
3
3
  .document-edit {
4
4
  display: flex;
5
5
  flex: 1;
6
- background-color: $background;
6
+ background-color: $light-grey-background;
7
7
 
8
8
  .pages-section {
9
9
  width: 100%;
@@ -14,6 +14,22 @@
14
14
  flex-direction: column;
15
15
  justify-content: space-between;
16
16
 
17
+ .grid-header {
18
+ height: 60px;
19
+ background-color: $background;
20
+ border-bottom: $component-border;
21
+ display: flex;
22
+ align-items: center;
23
+
24
+ .header-title {
25
+ color: $text-color;
26
+ font-weight: 600;
27
+ font-size: 18px;
28
+ line-height: 18px;
29
+ padding-left: 28px;
30
+ }
31
+ }
32
+
17
33
  .document-grid {
18
34
  padding: 32px;
19
35
  display: flex;
@@ -236,18 +252,18 @@
236
252
  }
237
253
  }
238
254
 
239
- &.split-overview-component {
255
+ &.rename-and-categorize-component {
240
256
  background-color: $background;
241
257
  min-width: 600px;
242
258
 
243
- .split-overview-section {
259
+ .rename-and-categorize-section {
244
260
  padding-left: 30px;
245
261
  padding-right: 10px;
246
262
  overflow-y: scroll;
247
263
  width: 100%;
248
264
  }
249
265
 
250
- .split-overview {
266
+ .rename-and-categorize {
251
267
  margin-top: 20px;
252
268
  img {
253
269
  height: 30px !important;
@@ -263,7 +279,7 @@
263
279
  cursor: pointer;
264
280
 
265
281
  .back-btn-section {
266
- padding-top: 5px;
282
+ padding-top: 4px;
267
283
  }
268
284
 
269
285
  .back-text {
@@ -274,7 +290,7 @@
274
290
  }
275
291
  }
276
292
 
277
- .overview-title {
293
+ .rename-and-categorize-title {
278
294
  color: $text-color;
279
295
  font-size: 16px;
280
296
  font-weight: 600;
@@ -291,7 +307,7 @@
291
307
  gap: 20px;
292
308
  padding-bottom: 40px;
293
309
 
294
- .overview-thumbnails {
310
+ .rename-and-categorize-thumbnails {
295
311
  display: flex;
296
312
  align-items: center;
297
313
  justify-content: center;
@@ -318,6 +334,10 @@
318
334
  5px 5px $white, 6px 6px $detail;
319
335
  }
320
336
  }
337
+
338
+ &:hover {
339
+ cursor: pointer;
340
+ }
321
341
  }
322
342
  }
323
343
  }
@@ -1,7 +1,7 @@
1
1
  @import "./imports.scss";
2
2
 
3
3
  .document-name-component {
4
- flex: 3;
4
+ flex: 1;
5
5
  display: flex;
6
6
  align-items: center;
7
7
  justify-content: center;
@@ -119,6 +119,10 @@
119
119
  display: flex;
120
120
  align-items: center;
121
121
  margin-right: 16px;
122
+
123
+ .edit-mode-btn {
124
+ font-size: 14px;
125
+ }
122
126
  }
123
127
  }
124
128
  }
@@ -12,6 +12,7 @@
12
12
  z-index: 40;
13
13
  color: $white;
14
14
  padding: 8px;
15
+ cursor: default;
15
16
 
16
17
  .popup-input {
17
18
  background-color: $text-color;
@@ -59,9 +60,15 @@
59
60
  left: 0;
60
61
  }
61
62
 
62
- .annotation-dropdowns {
63
- display: flex;
64
- flex-direction: column;
63
+ .annotation-dropdown {
64
+ border-radius: 12px;
65
+ border: 1px solid $grey-low-opacity !important;
66
+
67
+ .button.is-text {
68
+ box-shadow: none !important;
69
+ color: $white !important;
70
+ background-color: transparent !important;
71
+ }
65
72
  }
66
73
 
67
74
  .annotation-buttons {
@@ -70,6 +77,10 @@
70
77
  flex-direction: row;
71
78
  gap: 2px;
72
79
 
80
+ .button.is-text {
81
+ color: $white !important;
82
+ }
83
+
73
84
  .cancel-button {
74
85
  color: $white;
75
86
 
@@ -1,9 +1,21 @@
1
+ @use "sass:meta";
1
2
  @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");
2
3
  @import "./imports.scss";
3
4
 
4
- body {
5
+ :root {
6
+ --konfuzio-green: #41af85;
7
+ --white: #fff;
8
+ --primary-color: var(--konfuzio-green);
9
+ --primary-button: 4px;
10
+ --top-bar-background: var(--white);
11
+ }
12
+
13
+ .dv-ui-app-container {
14
+ @include meta.load-css("../../../node_modules/buefy/dist/buefy.css");
15
+ display: flex;
16
+ height: 100%;
17
+ flex-direction: column;
5
18
  margin: 0;
6
- font-family: $font-family;
7
19
 
8
20
  .overlay {
9
21
  height: 100%;
@@ -16,13 +28,16 @@ body {
16
28
  overflow-x: hidden;
17
29
  }
18
30
 
19
- .dv-ui-app-container {
20
- display: flex;
21
- height: 100%;
22
- flex-direction: column;
23
- }
31
+ &.dv-ui-theme {
32
+ font-family: $font-family;
24
33
 
25
- .dv-ui-theme {
34
+ -webkit-font-smoothing: antialiased;
35
+ text-rendering: optimizeLegibility;
36
+ -webkit-text-size-adjust: 100%;
37
+ -moz-text-size-adjust: 100%;
38
+ -ms-text-size-adjust: 100%;
39
+ text-size-adjust: 100%;
40
+ box-sizing: border-box;
26
41
  button {
27
42
  &.is-primary {
28
43
  background-color: $primary !important;
@@ -37,6 +52,7 @@ body {
37
52
  }
38
53
  }
39
54
 
55
+ // TODO: custom classes should have the styles under the component file
40
56
  &.missing-decline-btn {
41
57
  font-size: 14px;
42
58
  color: $grey-blue !important;
@@ -56,11 +72,6 @@ body {
56
72
  }
57
73
  }
58
74
 
59
- &:not(.is-text, .is-primary, .missing-btn) {
60
- background-color: $white;
61
- color: $text-color;
62
- }
63
-
64
75
  &.is-text {
65
76
  text-decoration: none;
66
77
 
@@ -220,8 +231,6 @@ body {
220
231
  }
221
232
 
222
233
  .dropdown {
223
- height: 100%;
224
-
225
234
  &.no-padding-bottom {
226
235
  .dropdown-content {
227
236
  padding-bottom: 0;
@@ -246,6 +255,7 @@ body {
246
255
  .dropdown-menu {
247
256
  padding-top: 0px;
248
257
  min-width: 40px;
258
+ width: 100%;
249
259
  }
250
260
 
251
261
  a.dropdown-item {
@@ -520,7 +530,7 @@ body {
520
530
  }
521
531
  }
522
532
 
523
- &.finish-review {
533
+ &.no-right-margin {
524
534
  .tooltip-content {
525
535
  right: 0 !important;
526
536
  }
@@ -564,7 +574,6 @@ body {
564
574
 
565
575
  &.bottom-aligned {
566
576
  width: 100%;
567
- bottom: 10px;
568
577
 
569
578
  .tooltip-content {
570
579
  &::before {
@@ -1,6 +1,5 @@
1
1
  /* Theme */
2
2
 
3
- $konfuzio-green: #41af85;
4
3
  $green: #4bb543;
5
4
  $green-low-opacity: rgba(75, 181, 67, 0.11);
6
5
  $green-border: #67d19f;
@@ -27,6 +26,7 @@ $grey-darker: #101828;
27
26
  $grey-hover: #fafafa;
28
27
  $grey-blue: #667085;
29
28
  $detail: #e2e3e4;
29
+ $light-grey-background: #f7f7f7;
30
30
 
31
31
  $dark: #2f3032;
32
32
  $full-black: #000;
@@ -42,12 +42,6 @@ $purple: #7b61ff;
42
42
  $purple-low-opacity: rgba(123, 97, 255, 0.08);
43
43
  $text-color: #1a1a1a;
44
44
 
45
- :root {
46
- --primary-color: #{$konfuzio-green};
47
- --primary-button: 4px;
48
- --top-bar-background: #{$white};
49
- }
50
-
51
45
  $primary: var(--primary-color);
52
46
  $hover-style: brightness(0.8) contrast(160%) grayscale(0.4);
53
47
  $font-family: "Inter", sans-serif;
@@ -5,9 +5,12 @@
5
5
  </div>
6
6
  </template>
7
7
  <script>
8
+ import Vue from "vue";
9
+ import * as Sentry from "@sentry/vue";
8
10
  import DocumentDashboard from "./DocumentDashboard";
9
11
  import { DocumentsList } from "./DocumentsList";
10
12
  import { getURLQueryParam, getURLPath } from "../utils/utils";
13
+ import { Integrations } from "@sentry/tracing";
11
14
  import API from "../api";
12
15
 
13
16
  export default {
@@ -39,6 +42,30 @@ export default {
39
42
  required: false,
40
43
  default: "false",
41
44
  },
45
+ // eslint-disable-next-line vue/prop-name-casing
46
+ sentry_dsn: {
47
+ type: String,
48
+ required: false,
49
+ default: "",
50
+ },
51
+ // eslint-disable-next-line vue/prop-name-casing
52
+ sentry_env: {
53
+ type: String,
54
+ required: false,
55
+ default: "",
56
+ },
57
+ // eslint-disable-next-line vue/prop-name-casing
58
+ api_url: {
59
+ type: String,
60
+ required: false,
61
+ default: "",
62
+ },
63
+ // eslint-disable-next-line vue/prop-name-casing
64
+ image_url: {
65
+ type: String,
66
+ required: false,
67
+ default: "",
68
+ },
42
69
  locale: {
43
70
  type: String,
44
71
  required: false,
@@ -93,13 +120,40 @@ export default {
93
120
  },
94
121
  },
95
122
  created() {
123
+ // Sentry config
124
+ if (process.env.NODE_ENV != "development") {
125
+ Sentry.init({
126
+ Vue,
127
+ dsn: process.env.VUE_APP_SENTRY_DSN,
128
+ integrations: [new Integrations.BrowserTracing()],
129
+ environment: process.env.VUE_APP_SENTRY_ENVIRONMENT,
130
+
131
+ // We recommend adjusting this value in production, or using tracesSampler
132
+ // for finer control
133
+ tracesSampleRate: 1.0,
134
+
135
+ // If false, errors won't show up in devtools
136
+ logErrors: true,
137
+
138
+ tracingOptions: {
139
+ trackComponents: true,
140
+ },
141
+ });
142
+ }
143
+
96
144
  // locale config
97
145
  if (this.locale && this.locale !== "") {
98
146
  this.$i18n.locale = this.locale;
99
147
  }
100
148
 
101
- // user token config
149
+ // api config
102
150
  API.setAuthToken(this.userToken);
151
+ if (this.api_url !== "") {
152
+ API.setApiUrl(this.api_url);
153
+ }
154
+ if (this.image_url !== "") {
155
+ API.setImageUrl(this.image_url);
156
+ }
103
157
 
104
158
  // document and project config
105
159
  Promise.all([
@@ -128,4 +182,4 @@ export default {
128
182
  };
129
183
  </script>
130
184
 
131
- <style lang="scss" src="../assets/scss/main.scss"></style>
185
+ <style lang="scss" src="../assets/scss/theme.scss"></style>
@@ -14,18 +14,10 @@
14
14
 
15
15
  <!-- When there's no annotations in the label -->
16
16
  <div v-else-if="annotationSets.length === 0">
17
- <CategorizeModal
18
- v-if="
19
- !publicView &&
20
- !isDocumentReviewed &&
21
- !waitingForSplittingConfirmation(selectedDocument)
22
- "
23
- />
24
17
  <EmptyState />
25
18
  </div>
26
19
 
27
20
  <div v-else :class="['annotation-set-list']">
28
- <CategorizeModal v-if="!publicView || !isDocumentReviewed" />
29
21
  <div
30
22
  v-if="Object.entries(annotationSetsInTable()).length > 0"
31
23
  class="annotation-set-group"
@@ -114,7 +106,6 @@ import ExtractingData from "./ExtractingData";
114
106
  import AnnotationSetActionButtons from "./AnnotationSetActionButtons";
115
107
  import DocumentLabel from "./DocumentLabel";
116
108
  import LoadingAnnotations from "./LoadingAnnotations";
117
- import CategorizeModal from "./CategorizeModal";
118
109
  import GridIcon from "../../assets/images/GridIcon";
119
110
 
120
111
  /**
@@ -127,7 +118,6 @@ export default {
127
118
  AnnotationSetActionButtons,
128
119
  DocumentLabel,
129
120
  LoadingAnnotations,
130
- CategorizeModal,
131
121
  GridIcon,
132
122
  },
133
123
  data() {
@@ -157,7 +147,6 @@ export default {
157
147
  "numberOfAnnotationSetGroup",
158
148
  "emptyLabelsLength",
159
149
  "annotationsWithPendingReviewLength",
160
- "waitingForSplittingConfirmation",
161
150
  "annotationSetsToShowInList",
162
151
  "annotationSetsInTable",
163
152
  "isDocumentReviewed",
@@ -168,7 +168,7 @@ export default {
168
168
 
169
169
  handleChangeCategory(category) {
170
170
  // handling the category change will be different based on
171
- // the dropdown being on the topbar or the split overview
171
+ // the dropdown being on the topbar or the Rename and Categorize view
172
172
  const updatedCategory = {
173
173
  category: category.id,
174
174
  };
@@ -192,7 +192,7 @@ export default {
192
192
  return;
193
193
  }
194
194
 
195
- // Send the category ID to the split overview
195
+ // Send the category ID to the Rename and Categorize view
196
196
  // to update the new document category
197
197
  this.$emit("category-change", this.page, category.id);
198
198
  },
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <div class="dashboard">
3
3
  <DocumentTopBar />
4
- <div :class="['dashboard-viewer', splitOverview ? 'edit-mode' : '']">
4
+ <div :class="['dashboard-viewer', renameAndCategorize ? 'edit-mode' : '']">
5
5
  <DocumentThumbnails v-if="!editMode" ref="documentPages" />
6
6
  <ScrollingDocument ref="scrollingDocument" class="dashboard-document" />
7
7
  <DocumentAnnotations v-if="!editMode" ref="annotations" />
8
- <DocumentEdit v-else ref="editView" />
8
+ <DocumentEdit v-if="editMode" ref="editView" />
9
9
 
10
10
  <MultiAnnotationTableOverlay
11
11
  v-if="showAnnSetTable"
@@ -34,15 +34,6 @@
34
34
  {{ $t("resolution_not_supported") }}
35
35
  </div>
36
36
  </div>
37
- <div
38
- v-if="
39
- selectedDocument &&
40
- waitingForSplittingConfirmation(selectedDocument) &&
41
- !documentBeingSplit
42
- "
43
- >
44
- <SplittingSuggestionsModal />
45
- </div>
46
37
  </div>
47
38
  </template>
48
39
 
@@ -59,7 +50,6 @@ import { DocumentEdit } from "./DocumentEdit";
59
50
  import ErrorMessage from "./ErrorMessage";
60
51
  import NotOptimizedViewportModal from "../components/DocumentModals/NotOptimizedViewportModal";
61
52
  import DocumentErrorModal from "../components/DocumentModals/DocumentErrorModal";
62
- import SplittingSuggestionsModal from "../components/DocumentModals/SplittingSuggestionsModal";
63
53
 
64
54
  /**
65
55
  * This component shows the PDF pages in a scrolling component and
@@ -76,7 +66,6 @@ export default {
76
66
  ErrorMessage,
77
67
  NotOptimizedViewportModal,
78
68
  DocumentErrorModal,
79
- SplittingSuggestionsModal,
80
69
  MultiAnnotationTableOverlay,
81
70
  },
82
71
  data() {
@@ -103,9 +92,8 @@ export default {
103
92
  "selectedDocument",
104
93
  "splittingSuggestions",
105
94
  ]),
106
- ...mapState("edit", ["editMode", "splitOverview", "documentBeingSplit"]),
95
+ ...mapState("edit", ["editMode", "renameAndCategorize"]),
107
96
  ...mapGetters("display", ["isMinimumWidth"]),
108
- ...mapGetters("document", ["waitingForSplittingConfirmation"]),
109
97
  },
110
98
 
111
99
  watch: {