@konfuzio/document-validation-ui 0.1.5-pre-release-1 → 0.1.5-styles-refactor
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/dist/css/app.css +1 -1
- package/dist/index.html +1 -1
- package/dist/js/app.js +1 -1
- package/dist/js/app.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/api.js +31 -21
- package/src/assets/images/ServerImage.vue +7 -6
- package/src/assets/scss/main.scss +666 -7
- package/src/assets/scss/variables.scss +0 -657
- package/src/components/App.vue +3 -2
- package/src/components/DocumentAnnotations/AnnotationContent.vue +1 -1
- package/src/components/DocumentEdit/DocumentEdit.vue +9 -13
- package/src/components/DocumentPage/DocumentPage.vue +9 -7
- package/src/components/DocumentPage/ScrollingDocument.vue +32 -2
- package/src/components/DocumentPage/ScrollingPage.vue +4 -5
- package/src/components/DocumentThumbnails/DocumentThumbnails.vue +14 -11
- package/src/store/display.js +7 -0
- package/src/store/document.js +17 -12
- package/src/store/edit.js +2 -2
package/package.json
CHANGED
package/src/.DS_Store
CHANGED
|
Binary file
|
package/src/api.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
-
import {
|
|
3
|
-
cacheAdapterEnhancer
|
|
4
|
-
} from 'axios-extensions';
|
|
2
|
+
import { cacheAdapterEnhancer } from "axios-extensions";
|
|
5
3
|
|
|
6
4
|
let HTTP, IMG_REQUEST, authToken;
|
|
7
5
|
const DEFAULT_URL = "https://app.konfuzio.com";
|
|
@@ -10,40 +8,52 @@ axios.defaults.xsrfCookieName = "csrftoken";
|
|
|
10
8
|
axios.defaults.xsrfHeaderName = "X-CSRFToken";
|
|
11
9
|
|
|
12
10
|
HTTP = axios.create({
|
|
13
|
-
baseURL: process.env.VUE_APP_API_URL || `${DEFAULT_URL}/api/v3
|
|
11
|
+
baseURL: process.env.VUE_APP_API_URL || `${DEFAULT_URL}/api/v3/`,
|
|
14
12
|
});
|
|
15
13
|
|
|
16
14
|
IMG_REQUEST = axios.create({
|
|
17
15
|
baseURL: process.env.VUE_APP_DOCUMENT_IMAGES_URL || `${DEFAULT_URL}`,
|
|
18
16
|
responseType: "blob",
|
|
19
|
-
adapter: cacheAdapterEnhancer(axios.defaults.adapter)
|
|
17
|
+
adapter: cacheAdapterEnhancer(axios.defaults.adapter),
|
|
20
18
|
});
|
|
21
19
|
|
|
22
20
|
const setAuthToken = (token) => {
|
|
23
21
|
authToken = token;
|
|
24
|
-
}
|
|
22
|
+
};
|
|
25
23
|
|
|
26
24
|
const getInterceptorConfig = (config) => {
|
|
27
25
|
if (authToken) {
|
|
28
|
-
config.headers[
|
|
26
|
+
config.headers["Authorization"] = `Token ${authToken}`;
|
|
29
27
|
}
|
|
30
28
|
return config;
|
|
31
|
-
}
|
|
29
|
+
};
|
|
32
30
|
|
|
33
|
-
HTTP.interceptors.request.use(getInterceptorConfig,
|
|
34
|
-
error
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
);
|
|
31
|
+
HTTP.interceptors.request.use(getInterceptorConfig, (error) => {
|
|
32
|
+
return Promise.reject(error);
|
|
33
|
+
});
|
|
38
34
|
|
|
39
|
-
IMG_REQUEST.interceptors.request.use(getInterceptorConfig,
|
|
40
|
-
error
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
)
|
|
35
|
+
IMG_REQUEST.interceptors.request.use(getInterceptorConfig, (error) => {
|
|
36
|
+
return Promise.reject(error);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const makeImageRequest = (imageURL) => {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
if (process.env.NODE_ENV === "test") {
|
|
42
|
+
reject("Running unit tests!");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
IMG_REQUEST.get(imageURL)
|
|
46
|
+
.then((response) => {
|
|
47
|
+
return response.data;
|
|
48
|
+
})
|
|
49
|
+
.then((myBlob) => {
|
|
50
|
+
resolve(myBlob);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
};
|
|
44
54
|
|
|
45
55
|
export default {
|
|
46
56
|
HTTP,
|
|
47
|
-
|
|
48
|
-
setAuthToken
|
|
49
|
-
};
|
|
57
|
+
makeImageRequest,
|
|
58
|
+
setAuthToken,
|
|
59
|
+
};
|
|
@@ -17,11 +17,11 @@ export default {
|
|
|
17
17
|
},
|
|
18
18
|
height: {
|
|
19
19
|
default: null,
|
|
20
|
-
type:
|
|
20
|
+
type: String,
|
|
21
21
|
},
|
|
22
22
|
width: {
|
|
23
23
|
default: null,
|
|
24
|
-
type:
|
|
24
|
+
type: String,
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
data() {
|
|
@@ -40,10 +40,8 @@ export default {
|
|
|
40
40
|
methods: {
|
|
41
41
|
loadImage() {
|
|
42
42
|
if (!this.imageUrl) return;
|
|
43
|
-
return api
|
|
44
|
-
.
|
|
45
|
-
return response.data;
|
|
46
|
-
})
|
|
43
|
+
return api
|
|
44
|
+
.makeImageRequest(this.imageUrl)
|
|
47
45
|
.then((myBlob) => {
|
|
48
46
|
this.$refs.imgTag.src = URL.createObjectURL(myBlob);
|
|
49
47
|
if (this.height) {
|
|
@@ -53,6 +51,9 @@ export default {
|
|
|
53
51
|
this.$refs.imgTag.style.width = this.width;
|
|
54
52
|
}
|
|
55
53
|
this.loaded = true;
|
|
54
|
+
})
|
|
55
|
+
.catch((error) => {
|
|
56
|
+
this.loaded = false;
|
|
56
57
|
});
|
|
57
58
|
},
|
|
58
59
|
},
|