@konfuzio/document-validation-ui 0.1.49-dev.0 → 0.1.49-dev.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.
@@ -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
  },