@valtimo/connector-management 4.15.2-next-main.13 → 4.15.3-next-main.14

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.
@@ -949,6 +949,9 @@ MultiValueConnectorPropertyComponent.propDecorators = {
949
949
  valuesSet: [{ type: Output }]
950
950
  };
951
951
 
952
+ const ɵ0$1 = {
953
+ 'custom': 'values = window[\'productRequestDefinitions\'][row.caseDefinitionKey] || []'
954
+ };
952
955
  const editProductAanvragenConnectorForm = {
953
956
  display: 'wizard',
954
957
  settings: {
@@ -992,13 +995,13 @@ const editProductAanvragenConnectorForm = {
992
995
  tableView: false
993
996
  },
994
997
  {
995
- title: 'connectorForm.productaanvraag.step0.typeMapping.panelTitle',
996
- collapsible: false,
997
- key: 'connectorFormProductaanvraagStep0TypeMappingsPanelTitle',
998
- type: 'panel',
999
- label: 'Panel',
1000
- input: false,
1001
- tableView: false,
998
+ key: 'productAanvraagTypes',
999
+ type: 'editgrid',
1000
+ input: true,
1001
+ validate: {
1002
+ minLength: 1,
1003
+ },
1004
+ customClass: 'edit-grid-component',
1002
1005
  components: [
1003
1006
  {
1004
1007
  label: 'connectorForm.productaanvraag.step0.typeMapping.productAanvraagType.label',
@@ -1009,7 +1012,7 @@ const editProductAanvragenConnectorForm = {
1009
1012
  },
1010
1013
  key: 'productAanvraagType',
1011
1014
  type: 'textfield',
1012
- input: true
1015
+ input: true,
1013
1016
  },
1014
1017
  {
1015
1018
  label: 'connectorForm.productaanvraag.step0.typeMapping.caseDefinitionKey.label',
@@ -1026,17 +1029,19 @@ const editProductAanvragenConnectorForm = {
1026
1029
  {
1027
1030
  label: 'connectorForm.productaanvraag.step0.typeMapping.processDefinitionKey.label',
1028
1031
  widget: 'choicesjs',
1029
- placeholder: 'connectorForm.productaanvraag.step0.typeMapping.processDefinitionKey.placeholder',
1030
1032
  tableView: true,
1031
- validate: {
1032
- required: true
1033
- },
1033
+ dataSrc: 'custom',
1034
+ data: ɵ0$1,
1035
+ dataType: 'string',
1036
+ refreshOn: 'row.caseDefinitionKey',
1037
+ clearOnRefresh: true,
1034
1038
  key: 'processDefinitionKey',
1035
1039
  type: 'select',
1036
1040
  input: true,
1037
- refreshOn: 'caseDefinitionKey',
1038
- clearOnRefresh: true,
1039
- disabled: true
1041
+ validate: {
1042
+ required: true
1043
+ },
1044
+ placeholder: 'connectorForm.productaanvraag.step0.typeMapping.processDefinitionKey.placeholder',
1040
1045
  }
1041
1046
  ]
1042
1047
  }
@@ -1470,55 +1475,29 @@ class EditProductAanvragenConnectorComponent {
1470
1475
  this.formRefresh$ = new Subject();
1471
1476
  this.formDefinition$ = new BehaviorSubject(undefined);
1472
1477
  this.translatedFormDefinition$ = this.formDefinition$.pipe(map((definition) => this.formTranslationService.translateForm(definition)));
1473
- this.caseDefinitionId$ = new BehaviorSubject('');
1478
+ this.caseDefinitionOptions = [];
1479
+ this.processDocumentDefinitionOptions = {};
1474
1480
  this.options = {
1475
1481
  disableAlerts: true
1476
1482
  };
1477
1483
  this.mapCaseDefinitionKeyComponent = (component) => {
1478
- var _a;
1479
1484
  if (component.key === 'caseDefinitionKey') {
1480
- const definitionOptions = (_a = this.documentDefinitions) === null || _a === void 0 ? void 0 : _a.content.map((definition) => ({ label: definition.id.name, value: definition.id.name }));
1481
- return Object.assign(Object.assign({}, component), { disabled: false, data: { values: definitionOptions } });
1482
- }
1483
- return component;
1484
- };
1485
- this.mapProcessDefinitionKeyComponent = (component) => {
1486
- var _a;
1487
- if (component.key === 'processDefinitionKey') {
1488
- const processOptions = this.processDocumentDefinitions.map((definition) => ({ label: definition.processName, value: definition.id.processDefinitionKey }));
1489
- if (((_a = this.processDocumentDefinitions) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1490
- return Object.assign(Object.assign({}, component), { disabled: false, data: { values: processOptions } });
1491
- }
1492
- else {
1493
- return Object.assign(Object.assign({}, component), { disabled: true, data: { values: [] } });
1494
- }
1485
+ return Object.assign(Object.assign({}, component), { disabled: false, data: { values: this.caseDefinitionOptions } });
1495
1486
  }
1496
1487
  return component;
1497
1488
  };
1498
1489
  }
1499
1490
  ngOnInit() {
1491
+ window['productRequestDefinitions'] = {};
1500
1492
  this.openFormDefinitionSubscription();
1501
1493
  this.formDefinition$.next(editProductAanvragenConnectorForm);
1502
- this.loadDocumentDefinitions();
1494
+ this.loadDefinitions();
1503
1495
  }
1504
1496
  ngOnDestroy() {
1505
1497
  var _a, _b;
1506
1498
  (_a = this.formDefinitionSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
1507
1499
  (_b = this.translateSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
1508
1500
  }
1509
- onChange(object) {
1510
- var _a;
1511
- const caseDefinitionKeyValue = (_a = object === null || object === void 0 ? void 0 : object.data) === null || _a === void 0 ? void 0 : _a.caseDefinitionKey;
1512
- const currentCaseDefinitionId = this.caseDefinitionId$.getValue();
1513
- if (caseDefinitionKeyValue && caseDefinitionKeyValue !== currentCaseDefinitionId) {
1514
- this.documentService.findProcessDocumentDefinitions(caseDefinitionKeyValue).subscribe((processDocumentDefinitions) => {
1515
- this.processDocumentDefinitions = processDocumentDefinitions;
1516
- const definitionWithProcessDefinitionKeyValues = this.formMappingService.mapComponents(this.formDefinition$.getValue(), this.mapProcessDefinitionKeyComponent);
1517
- this.formDefinition$.next(definitionWithProcessDefinitionKeyValues);
1518
- this.caseDefinitionId$.next(caseDefinitionKeyValue);
1519
- });
1520
- }
1521
- }
1522
1501
  onSubmit(event) {
1523
1502
  const submission = event.data;
1524
1503
  const properties = cloneDeep(this.properties);
@@ -1535,13 +1514,7 @@ class EditProductAanvragenConnectorComponent {
1535
1514
  properties.openNotificatieProperties.secret = submission.openNotificationsSecret;
1536
1515
  properties.openNotificatieProperties.callbackBaseUrl = submission.openNotificationsCallbackBaseUrl;
1537
1516
  properties.aanvragerRolTypeUrl = submission.applicantRoleTypeUrl;
1538
- properties.typeMapping = [
1539
- {
1540
- productAanvraagType: submission.productAanvraagType,
1541
- caseDefinitionKey: submission.caseDefinitionKey,
1542
- processDefinitionKey: submission.processDefinitionKey
1543
- }
1544
- ];
1517
+ properties.typeMapping = submission.productAanvraagTypes;
1545
1518
  this.propertiesSave.emit({ properties, name: submission.connectorName });
1546
1519
  }
1547
1520
  onDelete() {
@@ -1570,32 +1543,37 @@ class EditProductAanvragenConnectorComponent {
1570
1543
  submission.openNotificationsSecret = properties.openNotificatieProperties.secret;
1571
1544
  submission.openNotificationsCallbackBaseUrl = properties.openNotificatieProperties.callbackBaseUrl;
1572
1545
  submission.applicantRoleTypeUrl = properties.aanvragerRolTypeUrl;
1573
- submission.productAanvraagType = properties.typeMapping[0].productAanvraagType;
1574
- submission.caseDefinitionKey = properties.typeMapping[0].caseDefinitionKey;
1575
- submission.processDefinitionKey = properties.typeMapping[0].processDefinitionKey;
1546
+ submission.productAanvraagTypes = properties.typeMapping;
1576
1547
  submission.connectorName = this.defaultName;
1577
1548
  this.refreshForm({ submission: { data: submission } });
1578
1549
  }
1579
1550
  refreshForm(refreshValue) {
1580
1551
  this.formRefresh$.next(refreshValue);
1581
1552
  }
1582
- loadDocumentDefinitions() {
1583
- this.documentService.getAllDefinitions().subscribe((definitions) => {
1553
+ loadDefinitions() {
1554
+ let documentDefinitions;
1555
+ this.documentService.getAllDefinitions().pipe(tap((resDocumentDefinitions) => documentDefinitions = resDocumentDefinitions.content), switchMap((resDocumentDefinitions) => combineLatest(resDocumentDefinitions.content.map((definition) => this.documentService.findProcessDocumentDefinitions(definition.id.name)))), tap((res) => {
1584
1556
  var _a;
1585
- this.documentDefinitions = definitions;
1586
- const definitionWithCaseDefinitionKeyValues = this.formMappingService.mapComponents(this.formDefinition$.getValue(), this.mapCaseDefinitionKeyComponent);
1587
- this.formDefinition$.next(definitionWithCaseDefinitionKeyValues);
1557
+ this.caseDefinitionOptions = documentDefinitions.map((documentDefinition) => {
1558
+ return { label: documentDefinition.id.name, value: documentDefinition.id.name };
1559
+ });
1560
+ documentDefinitions.forEach((documentDefinition, index) => {
1561
+ this.processDocumentDefinitionOptions[documentDefinition.id.name] = res[index].map((processDocumentDefinition) => processDocumentDefinition.id.processDefinitionKey);
1562
+ });
1563
+ window['productRequestDefinitions'] = this.processDocumentDefinitionOptions;
1564
+ const definitionWithCaseDefinitionOptions = this.formMappingService.mapComponents(this.formDefinition$.getValue(), this.mapCaseDefinitionKeyComponent);
1565
+ this.formDefinition$.next(definitionWithCaseDefinitionOptions);
1588
1566
  if ((_a = this.properties) === null || _a === void 0 ? void 0 : _a.aanvragerRolTypeUrl) {
1589
1567
  this.prefillForm();
1590
1568
  }
1591
- });
1569
+ })).subscribe();
1592
1570
  }
1593
1571
  }
1594
1572
  EditProductAanvragenConnectorComponent.decorators = [
1595
1573
  { type: Component, args: [{
1596
1574
  selector: 'valtimo-edit-product-aanvragen-connector',
1597
- template: "<!--\n ~ Copyright 2015-2021 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n *ngIf=\"translatedFormDefinition$ | async as definition\"\n class=\"edit-product-request\"\n [ngClass]=\"{'has-delete': showDeleteButton}\"\n>\n <valtimo-form-io\n [form]=\"definition\"\n [formRefresh$]=\"formRefresh$\"\n [options]=\"options\"\n (change)=\"onChange($event)\"\n (submit)=\"onSubmit($event)\"\n >\n </valtimo-form-io>\n\n <button *ngIf=\"showDeleteButton\" class=\"btn btn-danger btn-space\" (click)=\"onDelete()\">\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{'connectorManagement.remove' | translate}}\n </button>\n</div>\n\n",
1598
- styles: ["/*!\n * Copyright 2015-2021 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.edit-product-request ::ng-deep .btn-wizard-nav-cancel{display:none}.edit-product-request ::ng-deep .list-inline{display:flex;flex-direction:row;justify-content:flex-end}.edit-product-request.has-delete ::ng-deep .list-inline{margin-bottom:-30px}.edit-product-request .btn-danger{position:relative}"]
1575
+ template: "<!--\n ~ Copyright 2015-2021 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n *ngIf=\"translatedFormDefinition$ | async as definition\"\n class=\"edit-product-request\"\n [ngClass]=\"{'has-delete': showDeleteButton}\"\n>\n <valtimo-form-io\n [form]=\"definition\"\n [formRefresh$]=\"formRefresh$\"\n [options]=\"options\"\n (submit)=\"onSubmit($event)\"\n >\n </valtimo-form-io>\n\n <button *ngIf=\"showDeleteButton\" class=\"btn btn-danger btn-space\" (click)=\"onDelete()\">\n <i class=\"icon mdi mdi-delete mr-1\"></i>\n {{'connectorManagement.remove' | translate}}\n </button>\n</div>\n\n",
1576
+ styles: ["/*!\n * Copyright 2015-2021 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.edit-product-request ::ng-deep .btn-wizard-nav-cancel{display:none}.edit-product-request ::ng-deep .list-inline{display:flex;flex-direction:row;justify-content:flex-end}.edit-product-request ::ng-deep .col-sm-2{flex:0 0 25%;max-width:25%}.edit-product-request ::ng-deep .edit-grid-component>label{display:none}.edit-product-request.has-delete ::ng-deep .list-inline{margin-bottom:-30px}.edit-product-request .btn-danger{position:relative}"]
1599
1577
  },] }
1600
1578
  ];
1601
1579
  EditProductAanvragenConnectorComponent.ctorParameters = () => [