@konfuzio/document-validation-ui 0.1.10-dev.7 → 0.1.10-dev.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.10-dev.7",
3
+ "version": "0.1.10-dev.9",
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;
@@ -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 {
@@ -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;
@@ -43,12 +42,6 @@ $purple: #7b61ff;
43
42
  $purple-low-opacity: rgba(123, 97, 255, 0.08);
44
43
  $text-color: #1a1a1a;
45
44
 
46
- :root {
47
- --primary-color: #{$konfuzio-green};
48
- --primary-button: 4px;
49
- --top-bar-background: #{$white};
50
- }
51
-
52
45
  $primary: var(--primary-color);
53
46
  $hover-style: brightness(0.8) contrast(160%) grayscale(0.4);
54
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>
@@ -5,6 +5,7 @@
5
5
  v-model="selectedSet"
6
6
  aria-role="list"
7
7
  :class="[
8
+ 'annotation-dropdown',
8
9
  'no-padding-bottom',
9
10
  setsList.length === 0 ? 'no-padding-top' : '',
10
11
  ]"
@@ -69,7 +70,7 @@
69
70
  v-model="selectedLabel"
70
71
  aria-role="list"
71
72
  :disabled="!labels || labels.length === 0"
72
- class="label-dropdown"
73
+ class="label-dropdown annotation-dropdown"
73
74
  >
74
75
  <template #trigger>
75
76
  <b-button
@@ -63,11 +63,11 @@
63
63
  "selected": "ausgewählt",
64
64
  "rotate_selected": "Ausgewählte Seite drehen",
65
65
  "edit_not_available": "Dokumente mit dem Status 'Vorbereitung', 'Training' oder 'Test' sowie Dokumente mit dem Status 'Geprüft' können nicht bearbeitet werden.",
66
- "rotate_split_reorder": "Rotate, split or reorder",
67
- "rename_and_categorize": "Rename and Categorize",
66
+ "rotate_split_reorder": "Rotieren, teilen oder sortieren",
67
+ "rename_and_categorize": "Umbenennen und kategorisieren",
68
68
  "submit": "Senden",
69
- "next": "Next: Rename and Categorize",
70
- "back_to_annotations": "Back to annotation view",
69
+ "next": "Nächster Schritt: Umbenennen und kategorisieren",
70
+ "back_to_annotations": "Züruck zur Hauptansicht",
71
71
  "select_label": "Label auswählen",
72
72
  "select_annotation_set": "Wähle Annotation Set",
73
73
  "accept": "Akzeptieren",
package/src/main.js CHANGED
@@ -1,10 +1,7 @@
1
1
  import Vue from "vue";
2
2
  import Buefy from "buefy";
3
- import "buefy/dist/buefy.css";
4
3
  import VueKonva from "vue-konva";
5
4
  import App from "./components/App";
6
- import * as Sentry from "@sentry/vue";
7
- import { Integrations } from "@sentry/tracing";
8
5
  import i18n from "./i18n";
9
6
  import store from "./store";
10
7
  import { library } from "@fortawesome/fontawesome-svg-core";
@@ -59,27 +56,6 @@ Vue.use(Buefy, {
59
56
  });
60
57
  Vue.use(VueObserveVisibility);
61
58
 
62
- // Sentry config
63
- if (process.env.NODE_ENV != "development") {
64
- Sentry.init({
65
- Vue,
66
- dsn: process.env.VUE_APP_SENTRY_DSN,
67
- integrations: [new Integrations.BrowserTracing()],
68
- environment: process.env.VUE_APP_SENTRY_ENVIRONMENT,
69
-
70
- // We recommend adjusting this value in production, or using tracesSampler
71
- // for finer control
72
- tracesSampleRate: 1.0,
73
-
74
- // If false, errors won't show up in devtools
75
- logErrors: true,
76
-
77
- tracingOptions: {
78
- trackComponents: true,
79
- },
80
- });
81
- }
82
-
83
59
  /**
84
60
  * Main entrypoint for the App
85
61
  */