@konfuzio/document-validation-ui 0.1.7 → 0.1.8-pre-release-1

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.7",
3
+ "version": "0.1.8-pre-release-1",
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
  };
@@ -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,17 @@ 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;
33
+
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;
24
41
 
25
- .dv-ui-theme {
26
42
  button {
27
43
  &.is-primary {
28
44
  background-color: $primary !important;
@@ -275,7 +291,7 @@ body {
275
291
  }
276
292
 
277
293
  .b-checkbox.checkbox {
278
- .check {
294
+ input[type="checkbox"] + .check {
279
295
  background-color: $white;
280
296
  }
281
297
  &:hover input[type="checkbox"]:not(:disabled) + .check {
@@ -1,6 +1,3 @@
1
- /* Theme */
2
-
3
- $konfuzio-green: #41af85;
4
1
  $green: #4bb543;
5
2
  $green-low-opacity: rgba(75, 181, 67, 0.11);
6
3
  $green-border: #67d19f;
@@ -30,7 +27,7 @@ $detail: #e2e3e4;
30
27
  $dark: #2f3032;
31
28
  $full-black: #000;
32
29
 
33
- $white: #fff;
30
+ $white: var(--white);
34
31
  $low-opacity-white: rgba(255, 255, 255, 0.1);
35
32
 
36
33
  $yellow: #ffd600;
@@ -41,12 +38,6 @@ $purple: #7b61ff;
41
38
  $purple-low-opacity: rgba(123, 97, 255, 0.08);
42
39
  $text-color: #1a1a1a;
43
40
 
44
- :root {
45
- --primary-color: #{$konfuzio-green};
46
- --primary-button: 4px;
47
- --top-bar-background: #{$white};
48
- }
49
-
50
41
  $primary: var(--primary-color);
51
42
  $hover-style: brightness(0.8) contrast(160%) grayscale(0.4);
52
43
  $font-family: "Inter", sans-serif;
@@ -5,6 +5,8 @@
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";
@@ -39,6 +41,30 @@ export default {
39
41
  required: false,
40
42
  default: "false",
41
43
  },
44
+ // eslint-disable-next-line vue/prop-name-casing
45
+ sentry_dsn: {
46
+ type: String,
47
+ required: false,
48
+ default: "",
49
+ },
50
+ // eslint-disable-next-line vue/prop-name-casing
51
+ sentry_env: {
52
+ type: String,
53
+ required: false,
54
+ default: "",
55
+ },
56
+ // eslint-disable-next-line vue/prop-name-casing
57
+ api_url: {
58
+ type: String,
59
+ required: false,
60
+ default: "",
61
+ },
62
+ // eslint-disable-next-line vue/prop-name-casing
63
+ image_url: {
64
+ type: String,
65
+ required: false,
66
+ default: "",
67
+ },
42
68
  locale: {
43
69
  type: String,
44
70
  required: false,
@@ -93,13 +119,40 @@ export default {
93
119
  },
94
120
  },
95
121
  created() {
122
+ // Sentry config
123
+ if (process.env.NODE_ENV != "development") {
124
+ Sentry.init({
125
+ Vue,
126
+ dsn: process.env.VUE_APP_SENTRY_DSN,
127
+ integrations: [new Integrations.BrowserTracing()],
128
+ environment: process.env.VUE_APP_SENTRY_ENVIRONMENT,
129
+
130
+ // We recommend adjusting this value in production, or using tracesSampler
131
+ // for finer control
132
+ tracesSampleRate: 1.0,
133
+
134
+ // If false, errors won't show up in devtools
135
+ logErrors: true,
136
+
137
+ tracingOptions: {
138
+ trackComponents: true,
139
+ },
140
+ });
141
+ }
142
+
96
143
  // locale config
97
144
  if (this.locale && this.locale !== "") {
98
145
  this.$i18n.locale = this.locale;
99
146
  }
100
147
 
101
- // user token config
148
+ // api config
102
149
  API.setAuthToken(this.userToken);
150
+ if (this.api_url !== "") {
151
+ API.setApiUrl(this.api_url);
152
+ }
153
+ if (this.image_url !== "") {
154
+ API.setImageUrl(this.image_url);
155
+ }
103
156
 
104
157
  // document and project config
105
158
  Promise.all([
@@ -128,4 +181,4 @@ export default {
128
181
  };
129
182
  </script>
130
183
 
131
- <style lang="scss" src="../assets/scss/main.scss"></style>
184
+ <style lang="scss" src="../assets/scss/theme.scss"></style>
package/src/main.js CHANGED
@@ -1,6 +1,5 @@
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
5
  import * as Sentry from "@sentry/vue";