@formio/js 5.0.0-dev.5710.e2e8388 → 5.0.0-dev.5711.e2e3657

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.
@@ -1130,7 +1130,7 @@ class Webform extends NestedDataComponent_1.default {
1130
1130
  });
1131
1131
  const displayedErrors = [];
1132
1132
  if (errors.length) {
1133
- errors = lodash_1.default.uniqBy(errors, (error) => error.message);
1133
+ errors = lodash_1.default.uniqBy(errors, (error) => { var _a, _b; return [error.message, (_a = error.component) === null || _a === void 0 ? void 0 : _a.id, (_b = error.context) === null || _b === void 0 ? void 0 : _b.path].join(); });
1134
1134
  const createListItem = (message, index) => {
1135
1135
  var _a, _b, _c;
1136
1136
  const err = errors[index];
@@ -15,11 +15,6 @@ export default class WebformBuilder extends Component {
15
15
  arrayDataComponentPaths: any[];
16
16
  nestedDataComponents: any[];
17
17
  arrayDataComponents: any[];
18
- /**
19
- * Returns the query parameters for the builder existing resources request
20
- * @returns {object} - The object with query parameters.
21
- */
22
- getExistingResourcesQuery(): object;
23
18
  allowDrop(): boolean;
24
19
  addExistingResourceFields(resources: any): void;
25
20
  attachTooltip(component: any, title: any): import("tippy.js").Instance<import("tippy.js").Props>[];
@@ -203,6 +203,20 @@ class WebformBuilder extends Component_1.default {
203
203
  // Need to set up horizontal rearrangement of fields.
204
204
  };
205
205
  this.options.hooks.attachComponent = this.attachComponent.bind(this);
206
+ // Load resources tagged as 'builder'
207
+ const query = {
208
+ params: {
209
+ type: 'resource',
210
+ limit: 1000000,
211
+ select: '_id,title,name,components'
212
+ }
213
+ };
214
+ if (this.options && this.options.resourceTag) {
215
+ query.params.tags = [this.options.resourceTag];
216
+ }
217
+ else if (!this.options || !this.options.hasOwnProperty('resourceTag')) {
218
+ query.params.tags = ['builder'];
219
+ }
206
220
  const formio = new Formio_1.Formio(Formio_1.Formio.projectUrl);
207
221
  const isResourcesDisabled = this.options.builder && this.options.builder.resource === false;
208
222
  formio.loadProject().then((project) => {
@@ -220,7 +234,7 @@ class WebformBuilder extends Component_1.default {
220
234
  });
221
235
  if (!formio.noProject && !isResourcesDisabled && formio.formsUrl) {
222
236
  const resourceOptions = this.options.builder && this.options.builder.resource;
223
- formio.loadForms(this.getExistingResourcesQuery())
237
+ formio.loadForms(query)
224
238
  .then((resources) => {
225
239
  if (resources.length) {
226
240
  this.builder.resource = {
@@ -254,27 +268,6 @@ class WebformBuilder extends Component_1.default {
254
268
  this.nestedDataComponents = [];
255
269
  this.arrayDataComponents = [];
256
270
  }
257
- /**
258
- * Returns the query parameters for the builder existing resources request
259
- * @returns {object} - The object with query parameters.
260
- */
261
- getExistingResourcesQuery() {
262
- // Load resources tagged as 'builder'
263
- const query = {
264
- params: {
265
- type: 'resource',
266
- limit: 1000000,
267
- select: '_id,title,name,components'
268
- }
269
- };
270
- if (this.options && this.options.resourceTag) {
271
- query.params.tags = [this.options.resourceTag];
272
- }
273
- else if (!this.options || !this.options.hasOwnProperty('resourceTag')) {
274
- query.params.tags = ['builder'];
275
- }
276
- return query;
277
- }
278
271
  allowDrop() {
279
272
  return true;
280
273
  }
@@ -1134,7 +1134,7 @@ export default class Webform extends NestedDataComponent {
1134
1134
  });
1135
1135
  const displayedErrors = [];
1136
1136
  if (errors.length) {
1137
- errors = _.uniqBy(errors, (error) => error.message);
1137
+ errors = _.uniqBy(errors, (error) => [error.message, error.component?.id, error.context?.path].join());
1138
1138
  const createListItem = (message, index) => {
1139
1139
  const err = errors[index];
1140
1140
  const messageFromIndex = !_.isUndefined(index) && errors && errors[index];
@@ -15,11 +15,6 @@ export default class WebformBuilder extends Component {
15
15
  arrayDataComponentPaths: any[];
16
16
  nestedDataComponents: any[];
17
17
  arrayDataComponents: any[];
18
- /**
19
- * Returns the query parameters for the builder existing resources request
20
- * @returns {object} - The object with query parameters.
21
- */
22
- getExistingResourcesQuery(): object;
23
18
  allowDrop(): boolean;
24
19
  addExistingResourceFields(resources: any): void;
25
20
  attachTooltip(component: any, title: any): import("tippy.js").Instance<import("tippy.js").Props>[];
@@ -182,6 +182,20 @@ export default class WebformBuilder extends Component {
182
182
  // Need to set up horizontal rearrangement of fields.
183
183
  };
184
184
  this.options.hooks.attachComponent = this.attachComponent.bind(this);
185
+ // Load resources tagged as 'builder'
186
+ const query = {
187
+ params: {
188
+ type: 'resource',
189
+ limit: 1000000,
190
+ select: '_id,title,name,components'
191
+ }
192
+ };
193
+ if (this.options && this.options.resourceTag) {
194
+ query.params.tags = [this.options.resourceTag];
195
+ }
196
+ else if (!this.options || !this.options.hasOwnProperty('resourceTag')) {
197
+ query.params.tags = ['builder'];
198
+ }
185
199
  const formio = new Formio(Formio.projectUrl);
186
200
  const isResourcesDisabled = this.options.builder && this.options.builder.resource === false;
187
201
  formio.loadProject().then((project) => {
@@ -199,7 +213,7 @@ export default class WebformBuilder extends Component {
199
213
  });
200
214
  if (!formio.noProject && !isResourcesDisabled && formio.formsUrl) {
201
215
  const resourceOptions = this.options.builder && this.options.builder.resource;
202
- formio.loadForms(this.getExistingResourcesQuery())
216
+ formio.loadForms(query)
203
217
  .then((resources) => {
204
218
  if (resources.length) {
205
219
  this.builder.resource = {
@@ -233,27 +247,6 @@ export default class WebformBuilder extends Component {
233
247
  this.nestedDataComponents = [];
234
248
  this.arrayDataComponents = [];
235
249
  }
236
- /**
237
- * Returns the query parameters for the builder existing resources request
238
- * @returns {object} - The object with query parameters.
239
- */
240
- getExistingResourcesQuery() {
241
- // Load resources tagged as 'builder'
242
- const query = {
243
- params: {
244
- type: 'resource',
245
- limit: 1000000,
246
- select: '_id,title,name,components'
247
- }
248
- };
249
- if (this.options && this.options.resourceTag) {
250
- query.params.tags = [this.options.resourceTag];
251
- }
252
- else if (!this.options || !this.options.hasOwnProperty('resourceTag')) {
253
- query.params.tags = ['builder'];
254
- }
255
- return query;
256
- }
257
250
  allowDrop() {
258
251
  return true;
259
252
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5710.e2e8388",
3
+ "version": "5.0.0-dev.5711.e2e3657",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {