@piveau/dpi 0.1.0-beta.5 → 0.1.0-beta.7
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/assets/dpi.css +1 -1
- package/dist/data-provider-interface/DataProviderInterface.vue2.js +45 -40
- package/dist/data-provider-interface/HappyFlowComponents/HomeTable.vue.js +15 -15
- package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/AdditionalsSubModal.vue.js +15 -14
- package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/DistributionModal.vue.js +73 -32
- package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/FindabilityChips.vue.js +26 -24
- package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/HVDSwitch.vue.js +23 -22
- package/dist/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +88 -85
- package/dist/data-provider-interface/components/DistributionSimplePage.vue.js +382 -382
- package/dist/data-provider-interface/components/ReviewAndPublishPage.vue.js +183 -174
- package/dist/data-provider-interface/composables/useDpiContext.js +5 -7
- package/dist/data-provider-interface/composables/useDpiEditMode.js +15 -13
- package/dist/data-provider-interface/composables/useDpiSimpleLoader.js +7 -7
- package/dist/data-provider-interface/store/index.js +32 -0
- package/dist/data-provider-interface/store/modules/authStore.js +301 -0
- package/dist/data-provider-interface/store/modules/catalogueDetailsStore.js +34 -0
- package/dist/data-provider-interface/store/modules/cataloguesStore.js +256 -0
- package/dist/data-provider-interface/store/modules/datasetDetailsStore.js +644 -0
- package/dist/data-provider-interface/store/modules/datasetsStore.js +361 -0
- package/dist/data-provider-interface/store/{dpiStore.js → modules/dpiStore.js} +11 -12
- package/dist/data-provider-interface/store/modules/snackbarStore.js +45 -0
- package/dist/data-provider-interface/views/InputPage.vue.js +100 -99
- package/dist/index.js +4 -4
- package/dist/utils/draftApi.js +33 -0
- package/dist/utils/helpers.js +36 -22
- package/dist/utils/identifiersApi.js +16 -0
- package/dist/utils/jwt.js +7 -0
- package/package.json +6 -4
- package/dist/data-provider-interface/store/modules/formSchemaStore.js +0 -94
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
const u = {
|
|
2
|
+
/**
|
|
3
|
+
* @property catalogs
|
|
4
|
+
* @type Array
|
|
5
|
+
* @description An array of catalogs.
|
|
6
|
+
*/
|
|
7
|
+
catalogs: [],
|
|
8
|
+
datasetCounts: {},
|
|
9
|
+
loading: !1,
|
|
10
|
+
searchParameters: {
|
|
11
|
+
query: "",
|
|
12
|
+
fields: void 0,
|
|
13
|
+
limit: 10,
|
|
14
|
+
offset: 0,
|
|
15
|
+
facets: [],
|
|
16
|
+
facetOperator: "AND",
|
|
17
|
+
facetGroupOperator: "AND",
|
|
18
|
+
sort: "relevance+desc,modified+desc,title+asc"
|
|
19
|
+
},
|
|
20
|
+
availableFacets: [],
|
|
21
|
+
page: 1,
|
|
22
|
+
pageCount: 1,
|
|
23
|
+
catalogsCount: 0
|
|
24
|
+
}, r = {
|
|
25
|
+
getCatalogs: (e) => e.catalogs,
|
|
26
|
+
getCatalogsCount: (e) => e.catalogsCount,
|
|
27
|
+
getQuery: (e) => e.searchParameters.query,
|
|
28
|
+
getFields: (e) => e.searchParameters.fields,
|
|
29
|
+
getLimit: (e) => e.searchParameters.limit,
|
|
30
|
+
getLoading: (e) => e.loading,
|
|
31
|
+
getOffset: (e) => e.searchParameters.offset,
|
|
32
|
+
getFacets: (e) => e.searchParameters.facets,
|
|
33
|
+
getFacetOperator: (e) => e.searchParameters.facetOperator,
|
|
34
|
+
getFacetGroupOperator: (e) => e.searchParameters.facetGroupOperator,
|
|
35
|
+
getAvailableFacets: (e) => [
|
|
36
|
+
...e.availableFacets,
|
|
37
|
+
{
|
|
38
|
+
id: "erpd",
|
|
39
|
+
items: [
|
|
40
|
+
{ count: void 0, id: "true", title: "yes" },
|
|
41
|
+
{ count: void 0, id: "false", title: "no" }
|
|
42
|
+
],
|
|
43
|
+
title: "ERPD"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
getPage: (e) => e.page,
|
|
47
|
+
getPageCount: (e) => e.pageCount,
|
|
48
|
+
getSort: (e) => e.searchParameters.sort
|
|
49
|
+
}, E = {
|
|
50
|
+
/**
|
|
51
|
+
* @description Load all catalogs matching the given parameters.
|
|
52
|
+
* @param commit
|
|
53
|
+
* @param state
|
|
54
|
+
* @param options {Object} - Given search parameters
|
|
55
|
+
* @param options.query {String} - The given query string
|
|
56
|
+
* @param options.fields {String} - The given fields
|
|
57
|
+
* @param options.facets {Array} - The active facets
|
|
58
|
+
* @param options.limit {Number} - The maximum amount of catalogs to fetch
|
|
59
|
+
* @param options.page {Number} - The current page
|
|
60
|
+
* @param options.sort {String} - The sort method to use
|
|
61
|
+
* @param options.append {Boolean} - Decides whether current catalogs in state will be replaced or fetched catalogs appended.
|
|
62
|
+
*/
|
|
63
|
+
loadCatalogs({ commit: e, state: a }, {
|
|
64
|
+
query: t = r.getQuery(a),
|
|
65
|
+
fields: o = r.getFields(a),
|
|
66
|
+
limit: c = r.getLimit(a),
|
|
67
|
+
page: l = r.getPage(a),
|
|
68
|
+
sort: g = r.getSort(a),
|
|
69
|
+
facetOperator: S = r.getFacetOperator(a),
|
|
70
|
+
facetGroupOperator: T = r.getFacetGroupOperator(a),
|
|
71
|
+
facets: _ = r.getFacets(a),
|
|
72
|
+
append: i = !1
|
|
73
|
+
}) {
|
|
74
|
+
return e("SET_LOADING", !0), new Promise((P, n) => {
|
|
75
|
+
this.$catalogService.get(t, o, c, l, g, S, T, _).then((s) => {
|
|
76
|
+
e("SET_FIEELDS", s.fields), e("SET_AVAILABLE_FACETS", s.availableFacets), e("SET_catalogS_COUNT", s.catalogsCount), e(i ? "ADD_catalogS" : "SET_catalogS", s.catalogs), e("SET_LOADING", !1), P();
|
|
77
|
+
}).catch((s) => {
|
|
78
|
+
console.error(s), e("SET_LOADING", !1), n(s);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* @description Loads more catalogs.
|
|
84
|
+
* @param commit
|
|
85
|
+
* @param state
|
|
86
|
+
* @param {number} amount - The amount of catalogs to add.
|
|
87
|
+
*/
|
|
88
|
+
loadAdditionalCatalogs({ commit: e, state: a }) {
|
|
89
|
+
const t = r.getPage(a);
|
|
90
|
+
E.loadCatalogs({ commit: e, state: a }, { page: t, append: !0 });
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* @description Autocomplete a query String by using a autocompletion service
|
|
94
|
+
* @param commit
|
|
95
|
+
* @param q {String} The Query to autocomplete
|
|
96
|
+
*/
|
|
97
|
+
autocompleteQuery({ commit: e }, a) {
|
|
98
|
+
if (typeof this.$catalogService.autocomplete == "function")
|
|
99
|
+
return new Promise((t, o) => {
|
|
100
|
+
this.$catalogService.autocomplete(a).then((c) => {
|
|
101
|
+
t(c);
|
|
102
|
+
}).catch((c) => {
|
|
103
|
+
o(c);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* @description Replace the current state facets by the given facets
|
|
109
|
+
* @param commit
|
|
110
|
+
* @param facets {Array} - The given facets
|
|
111
|
+
*/
|
|
112
|
+
setFacets({ commit: e }, a) {
|
|
113
|
+
a && e("SET_FACETS", a);
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* @description Add the given facet to the states facets.
|
|
117
|
+
* @param commit
|
|
118
|
+
* @param params {Object} - The wrapped action parameters.
|
|
119
|
+
* @param params.field {String} - The field of the given facet
|
|
120
|
+
* @param params.facet {String} - The facet to add
|
|
121
|
+
*/
|
|
122
|
+
addFacet({ commit: e }, { field: a, facet: t }) {
|
|
123
|
+
e("ADD_FACET", { field: a, facet: t });
|
|
124
|
+
},
|
|
125
|
+
/**
|
|
126
|
+
* @description Remove the given facet from the states facets.
|
|
127
|
+
* @param commit
|
|
128
|
+
* @param params {Object} - The wrapped action parameters.
|
|
129
|
+
* @param params.field {String} - The field of the given facet
|
|
130
|
+
* @param params.facet {String} - The facet to remove
|
|
131
|
+
*/
|
|
132
|
+
removeFacet({ commit: e }, { field: a, facet: t }) {
|
|
133
|
+
e("REMOVE_FACET", { field: a, facet: t });
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* @description Remove the given facet from the states facets.
|
|
137
|
+
* @param commit
|
|
138
|
+
* @param operator {String} - The facet operator to set. Possible Operators : ['AND', 'OR'].
|
|
139
|
+
*/
|
|
140
|
+
setFacetOperator({ commit: e }, a) {
|
|
141
|
+
e("SET_FACET_OPERATOR", a);
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* @description Remove the given facet from the states facets.
|
|
145
|
+
* @param commit
|
|
146
|
+
* @param operator {String} - The facet operator to set. Possible Operators : ['AND', 'OR'].
|
|
147
|
+
*/
|
|
148
|
+
setFacetGroupOperator({ commit: e }, a) {
|
|
149
|
+
e("SET_FACET_GROUP_OPERATOR", a);
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* @description Handles page changes by through URL query.
|
|
153
|
+
* @param commit
|
|
154
|
+
* @param state
|
|
155
|
+
* @param page {String} The given page number as a String
|
|
156
|
+
*/
|
|
157
|
+
setPage({ commit: e }, a) {
|
|
158
|
+
e("SET_PAGE", a);
|
|
159
|
+
},
|
|
160
|
+
setPageCount({ commit: e }, a) {
|
|
161
|
+
e("SET_PAGE_COUNT", a);
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* @description Replace the current state query by the given query
|
|
165
|
+
* @param commit
|
|
166
|
+
* @param query {String} - The given query
|
|
167
|
+
*/
|
|
168
|
+
setQuery({ commit: e }, a) {
|
|
169
|
+
e("SET_QUERY", a);
|
|
170
|
+
},
|
|
171
|
+
setFields({ commit: e }, a) {
|
|
172
|
+
e("SET_FIELDS", a);
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* @description Replace the current sort method
|
|
176
|
+
* @param commit
|
|
177
|
+
* @param sort {String} - The given sort method to use now
|
|
178
|
+
*/
|
|
179
|
+
setSort({ commit: e }, a) {
|
|
180
|
+
e("SET_SORT", a);
|
|
181
|
+
},
|
|
182
|
+
setLimit({ commit: e }, a = 10) {
|
|
183
|
+
e("SET_LIMIT", a);
|
|
184
|
+
},
|
|
185
|
+
setLoading({ commit: e }, a) {
|
|
186
|
+
e("SET_LOADING", a);
|
|
187
|
+
},
|
|
188
|
+
setCatalogs({ commit: e }, a) {
|
|
189
|
+
e("SET_catalogS", a);
|
|
190
|
+
},
|
|
191
|
+
setCatalogsCount({ commit: e }, a) {
|
|
192
|
+
e("SET_catalogS_COUNT", a);
|
|
193
|
+
}
|
|
194
|
+
}, A = {
|
|
195
|
+
SET_catalogS(e, a) {
|
|
196
|
+
e.catalogs = a;
|
|
197
|
+
},
|
|
198
|
+
ADD_catalogS(e, a) {
|
|
199
|
+
e.catalogs = e.catalogs.concat(a);
|
|
200
|
+
},
|
|
201
|
+
SET_LIMIT(e, a) {
|
|
202
|
+
e.searchParameters.limit = a;
|
|
203
|
+
},
|
|
204
|
+
SET_OFFSET(e, a) {
|
|
205
|
+
e.searchParameters.offset = a;
|
|
206
|
+
},
|
|
207
|
+
SET_FACETS(e, a) {
|
|
208
|
+
e.searchParameters.facets = a;
|
|
209
|
+
},
|
|
210
|
+
ADD_FACET(e, { field: a, facet: t }) {
|
|
211
|
+
Object.prototype.hasOwnProperty.call(e.searchParameters.facets, a) ? e.searchParameters.facets[a].push(t) : e.searchParameters.facets[a] = [t];
|
|
212
|
+
},
|
|
213
|
+
REMOVE_FACET(e, { field: a, facet: t }) {
|
|
214
|
+
const o = e.searchParameters.facets[a].indexOf(t);
|
|
215
|
+
e.searchParameters.facets[a].splice(o, 1);
|
|
216
|
+
},
|
|
217
|
+
SET_AVAILABLE_FACETS(e, a) {
|
|
218
|
+
e.availableFacets = a;
|
|
219
|
+
},
|
|
220
|
+
SET_catalogS_COUNT(e, a) {
|
|
221
|
+
e.catalogsCount = a;
|
|
222
|
+
},
|
|
223
|
+
SET_FACET_OPERATOR(e, a) {
|
|
224
|
+
e.searchParameters.facetOperator = a;
|
|
225
|
+
},
|
|
226
|
+
SET_FACET_GROUP_OPERATOR(e, a) {
|
|
227
|
+
e.searchParameters.facetGroupOperator = a;
|
|
228
|
+
},
|
|
229
|
+
SET_PAGE(e, a) {
|
|
230
|
+
e.page = a;
|
|
231
|
+
},
|
|
232
|
+
SET_PAGE_COUNT(e, a) {
|
|
233
|
+
e.pageCount = a;
|
|
234
|
+
},
|
|
235
|
+
SET_QUERY(e, a) {
|
|
236
|
+
e.searchParameters.query = a;
|
|
237
|
+
},
|
|
238
|
+
SET_FIELDS(e, a) {
|
|
239
|
+
e.searchParameters.fields = a;
|
|
240
|
+
},
|
|
241
|
+
SET_SORT(e, a) {
|
|
242
|
+
e.searchParameters.sort = a;
|
|
243
|
+
},
|
|
244
|
+
SET_LOADING(e, a) {
|
|
245
|
+
e.loading = a;
|
|
246
|
+
}
|
|
247
|
+
}, O = {
|
|
248
|
+
namespaced: !0,
|
|
249
|
+
state: u,
|
|
250
|
+
actions: E,
|
|
251
|
+
mutations: A,
|
|
252
|
+
getters: r
|
|
253
|
+
};
|
|
254
|
+
export {
|
|
255
|
+
O as default
|
|
256
|
+
};
|