@konfuzio/document-validation-ui 0.1.49-dev.0 → 0.1.49-dev.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.
@@ -28,6 +28,7 @@ const state = {
28
28
  showAnnSetTable: null,
29
29
  showChooseLabelSetModal: null,
30
30
  hideEmptyLabelSets: false,
31
+ showDocumentsNavigation: true,
31
32
  currentSearch: "",
32
33
  searchEnabled: false,
33
34
  searchResults: [],
@@ -298,6 +299,9 @@ const actions = {
298
299
  showAnnSetTable({ commit }, tableSet) {
299
300
  commit("SET_ANN_SET_TABLE", tableSet);
300
301
  },
302
+ showDocumentsNavigation({ commit }, show) {
303
+ commit("SET_SHOW_DOCUMENTS_NAVIGATION", show);
304
+ },
301
305
  showChooseLabelSetModal({ commit }, options) {
302
306
  commit("SET_SHOW_CHOOSE_LABEL_SET_MODAL", options);
303
307
  },
@@ -401,6 +405,10 @@ const mutations = {
401
405
  state.documentActionBar = actionBar;
402
406
  },
403
407
 
408
+ SET_SHOW_DOCUMENTS_NAVIGATION: (state, show) => {
409
+ state.showDocumentsNavigation = show;
410
+ },
411
+
404
412
  SET_ANN_SET_TABLE: (state, tableSet) => {
405
413
  state.showAnnSetTable = tableSet;
406
414
  },
@@ -1147,24 +1147,6 @@ const actions = {
1147
1147
  await dispatch("category/fetchCategories", projectId, {
1148
1148
  root: true,
1149
1149
  });
1150
-
1151
- // get list of documents not reviewed
1152
- await dispatch("project/fetchDocumentList", "is_reviewed=false", {
1153
- root: true,
1154
- });
1155
- }
1156
- if (categoryId && rootState.category.createAvailableListOfDocuments) {
1157
- await dispatch(
1158
- "category/createAvailableDocumentsList",
1159
- {
1160
- categoryId,
1161
- user: rootState.project.currentUser.username,
1162
- poll: false,
1163
- },
1164
- {
1165
- root: true,
1166
- }
1167
- );
1168
1150
  }
1169
1151
  }
1170
1152
  if (isRecalculatingAnnotations) {
@@ -6,7 +6,6 @@ const state = {
6
6
  labelSets: null,
7
7
  currentUser: null,
8
8
  documentsListPath: null,
9
- documentsInProject: null,
10
9
  showAnnotationTranslations: false,
11
10
  };
12
11
 
@@ -58,28 +57,41 @@ const actions = {
58
57
  commit("SET_DOCUMENTS_LIST_PATH", path);
59
58
  },
60
59
 
61
- setDocumentsInProject: ({ commit }, documents) => {
62
- commit("SET_DOCUMENTS_IN_PROJECT", documents);
63
- },
64
-
65
60
  setShowAnnotationTranslations: ({ commit }, show) => {
66
61
  commit("SET_SHOW_ANNOTATION_TRANSLATIONS", show);
67
62
  },
68
63
 
69
- fetchDocumentList: ({ commit, state }, parameters) => {
70
- return myImports
71
- .makeGetPaginatedRequest(
72
- `documents/?project=${state.projectId}&${parameters}`,
73
- true
74
- )
75
- .then((results) => {
76
- if (results) {
77
- commit("SET_DOCUMENTS_IN_PROJECT", results);
78
- }
79
- })
80
- .catch((error) => {
81
- console.log(error, "Could not fetch document list from the backend");
82
- });
64
+ fetchDocumentListWithParameters: ({ commit, state }, parameters) => {
65
+ return new Promise((resolve, reject) => {
66
+ myImports
67
+ .makeGetPaginatedRequest(
68
+ `documents/?project=${state.projectId}&${parameters}`,
69
+ true
70
+ )
71
+ .then((results) => {
72
+ resolve(results);
73
+ })
74
+ .catch((error) => {
75
+ reject();
76
+ console.log(error, "Could not fetch document list from the backend");
77
+ });
78
+ });
79
+ },
80
+ fetchDocumentListForNavigation: ({ commit, state }) => {
81
+ return new Promise((resolve, reject) => {
82
+ myImports
83
+ .makeGetPaginatedRequest(
84
+ `documents/?project=${state.projectId}&is_reviewed=false&fields=id`,
85
+ true
86
+ )
87
+ .then((results) => {
88
+ resolve(results);
89
+ })
90
+ .catch((error) => {
91
+ reject();
92
+ console.log(error, "Could not fetch document list from the backend");
93
+ });
94
+ });
83
95
  },
84
96
  };
85
97
 
@@ -96,9 +108,6 @@ const mutations = {
96
108
  SET_DOCUMENTS_LIST_PATH: (state, path) => {
97
109
  state.documentsListPath = path;
98
110
  },
99
- SET_DOCUMENTS_IN_PROJECT: (state, documents) => {
100
- state.documentsInProject = documents;
101
- },
102
111
  SET_SHOW_ANNOTATION_TRANSLATIONS: (state, show) => {
103
112
  state.showAnnotationTranslations = show;
104
113
  },