@memberjunction/ng-user-view-grid 0.9.41 → 0.9.42

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.
@@ -803,25 +803,28 @@ export class UserViewGridComponent {
803
803
  switch (event) {
804
804
  case 'merge':
805
805
  // user has requested to merge the records and retain the selected record from the compare records component, so run the merge
806
+ // first, confirm with the user to make 100% sure they want to do this as it is irreversible
806
807
  if (this._entityInfo && this.recordCompareComponent) {
807
- const md = new Metadata();
808
- const result = yield md.MergeRecords({
809
- EntityName: this._entityInfo.Name,
810
- RecordsToMerge: this.mergeRecords.map((r) => r.ID).filter((id) => { var _a; return id !== ((_a = this.recordCompareComponent) === null || _a === void 0 ? void 0 : _a.selectedRecordId); }),
811
- SurvivingRecordID: this.recordCompareComponent.selectedRecordId
812
- });
813
- if (result.Success) {
814
- // merge was successful, so refresh the grid
815
- this.selectedKeys = [];
816
- this.compareRecords = [];
817
- this.mergeRecords = [];
818
- this.mergeMode = false;
819
- this.compareMode = false;
820
- this.Refresh(this.Params);
821
- }
822
- else {
823
- // the merge failed, so show an error message
824
- this.CreateSimpleNotification("Error merging records: " + result.OverallStatus, 'error', 5000);
808
+ if (confirm("Are you sure you want to merge these records? This action is irreversible.")) {
809
+ const md = new Metadata();
810
+ const result = yield md.MergeRecords({
811
+ EntityName: this._entityInfo.Name,
812
+ RecordsToMerge: this.mergeRecords.map((r) => r.ID).filter((id) => { var _a; return id !== ((_a = this.recordCompareComponent) === null || _a === void 0 ? void 0 : _a.selectedRecordId); }),
813
+ SurvivingRecordID: this.recordCompareComponent.selectedRecordId
814
+ });
815
+ if (result.Success) {
816
+ // merge was successful, so refresh the grid
817
+ this.selectedKeys = [];
818
+ this.compareRecords = [];
819
+ this.mergeRecords = [];
820
+ this.mergeMode = false;
821
+ this.compareMode = false;
822
+ this.Refresh(this.Params);
823
+ }
824
+ else {
825
+ // the merge failed, so show an error message
826
+ this.CreateSimpleNotification("Error merging records: " + result.OverallStatus, 'error', 5000);
827
+ }
825
828
  }
826
829
  }
827
830
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-user-view-grid",
3
- "version": "0.9.41",
3
+ "version": "0.9.42",
4
4
  "description": "MemberJunction: Angular Grid to display dynamic and saved user views for any entity in MemberJunction.",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",