@konfuzio/document-validation-ui 0.1.6-multi-ann-set → 0.1.6-multi-ann-set-2

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 (28) 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/package.json +1 -1
  6. package/src/assets/scss/main.scss +1 -1
  7. package/src/assets/scss/multi_ann_table_overlay.scss +1 -7
  8. package/src/components/App.vue +7 -2
  9. package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +31 -13
  10. package/src/components/DocumentAnnotations/AnnotationContent.vue +5 -3
  11. package/src/components/DocumentAnnotations/AnnotationRow.vue +2 -1
  12. package/src/components/DocumentAnnotations/AnnotationSetActionButtons.vue +3 -3
  13. package/src/components/DocumentAnnotations/CategorizeModal.vue +5 -1
  14. package/src/components/DocumentAnnotations/DocumentAnnotations.vue +8 -16
  15. package/src/components/DocumentAnnotations/EmptyAnnotation.vue +5 -2
  16. package/src/components/DocumentPage/DocumentPage.vue +27 -8
  17. package/src/components/DocumentPage/DocumentToolbar.vue +6 -2
  18. package/src/components/DocumentPage/MultiAnnSelection.vue +1 -1
  19. package/src/components/DocumentPage/NewAnnotation.vue +1 -1
  20. package/src/components/DocumentTopBar/DocumentName.vue +6 -1
  21. package/src/components/DocumentTopBar/DocumentTopBar.vue +9 -9
  22. package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +4 -3
  23. package/src/components/DocumentTopBar/KeyboardActionsDescription.vue +6 -2
  24. package/src/components/DocumentsList/DocumentsList.vue +11 -2
  25. package/src/store/category.js +1 -1
  26. package/src/store/document.js +10 -1
  27. package/src/store/edit.js +6 -2
  28. package/src/utils/utils.js +13 -0
@@ -54,7 +54,7 @@ const actions = {
54
54
  */
55
55
  fetchDocumentList: ({ commit, rootState }, categoryId) => {
56
56
  return HTTP.get(
57
- `documents/?category=${categoryId}&assignee=${rootState.project.currentUser}`
57
+ `documents/?category=${categoryId}&assignee=${rootState.project.currentUser}&limit=100`
58
58
  )
59
59
  .then((response) => {
60
60
  if (response.data.results) {
@@ -30,6 +30,7 @@ const state = {
30
30
  selectedEntities: null,
31
31
  serverError: false,
32
32
  splittingSuggestions: null,
33
+ documentIsReviewed: false,
33
34
  };
34
35
 
35
36
  const getters = {
@@ -702,6 +703,9 @@ const actions = {
702
703
  setSplittingSuggestions: ({ commit }, value) => {
703
704
  commit("SET_SPLITTING_SUGGESTIONS", value);
704
705
  },
706
+ setDocumentIsReviewed: ({ commit }, value) => {
707
+ commit("SET_DOCUMENT_IS_REVIEWED", value);
708
+ },
705
709
 
706
710
  /**
707
711
  * Actions that use HTTP requests always return the axios promise,
@@ -732,11 +736,13 @@ const actions = {
732
736
  if (response.data.pages.length > 0) {
733
737
  dispatch("fetchDocumentPage", initialPage);
734
738
  }
739
+
735
740
  // set information on the store
736
741
  commit("SET_ANNOTATION_SETS", annotationSets);
737
742
  commit("SET_ANNOTATIONS", annotations);
738
743
  commit("SET_LABELS", labels);
739
744
  commit("SET_SELECTED_DOCUMENT", response.data);
745
+ commit("SET_DOCUMENT_IS_REVIEWED", response.data.is_reviewed);
740
746
  commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
741
747
 
742
748
  if (rootState.project.projectId) {
@@ -1242,7 +1248,7 @@ const mutations = {
1242
1248
  },
1243
1249
  SET_SELECTED_DOCUMENT: (state, document) => {
1244
1250
  if (document.is_reviewed === true) {
1245
- state.publicView = true;
1251
+ state.documentIsReviewed = true;
1246
1252
  }
1247
1253
  state.selectedDocument = document;
1248
1254
 
@@ -1312,6 +1318,9 @@ const mutations = {
1312
1318
  SET_SPLITTING_SUGGESTIONS: (state, array) => {
1313
1319
  state.splittingSuggestions = array;
1314
1320
  },
1321
+ SET_DOCUMENT_IS_REVIEWED: (state, value) => {
1322
+ state.documentIsReviewed = value;
1323
+ },
1315
1324
  };
1316
1325
 
1317
1326
  export default {
package/src/store/edit.js CHANGED
@@ -1,5 +1,9 @@
1
1
  import myImports from "../api";
2
- import { getURLQueryParam, navigateToNewDocumentURL } from "../utils/utils";
2
+ import {
3
+ getURLQueryParam,
4
+ navigateToNewDocumentURL,
5
+ getURLPath,
6
+ } from "../utils/utils";
3
7
 
4
8
  const HTTP = myImports.HTTP;
5
9
 
@@ -164,7 +168,7 @@ const actions = {
164
168
  dispatch("document/setSplittingSuggestions", null, { root: true });
165
169
 
166
170
  if (newId !== oldId) {
167
- if (getURLQueryParam("document")) {
171
+ if (getURLQueryParam("document") || getURLPath("docs")) {
168
172
  navigateToNewDocumentURL(oldId, newId);
169
173
  } else {
170
174
  await dispatch("document/setDocId", newId, {
@@ -5,12 +5,25 @@ export function sleep(duration) {
5
5
  export function getURLQueryParam(param) {
6
6
  const queryString = window.location.search;
7
7
  const urlParams = new URLSearchParams(queryString);
8
+
8
9
  if (urlParams.has(param)) {
9
10
  return urlParams.get(param);
10
11
  }
11
12
  return undefined;
12
13
  }
13
14
 
15
+ export function getURLPath(value) {
16
+ const path = window.location.pathname;
17
+
18
+ if (!path.includes(value)) return;
19
+
20
+ const id = path.split(value)[1].split("/")[1];
21
+
22
+ if (id === "") return;
23
+
24
+ return id;
25
+ }
26
+
14
27
  export function navigateToNewDocumentURL(oldId, newId) {
15
28
  const url = window.location.href;
16
29
  const newUrl = url.replace(oldId, newId);