@sprucelabs/spruce-organization-utils 7.0.1 → 7.0.3
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.
|
@@ -3,11 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
|
4
4
|
const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
|
|
5
5
|
class OrganizationListCardViewController extends heartwood_view_controllers_1.AbstractViewController {
|
|
6
|
-
static id = 'org-list-card';
|
|
7
|
-
activeRecordCardVc;
|
|
8
|
-
onDelete;
|
|
9
|
-
onEdit;
|
|
10
|
-
selectedOrgId;
|
|
11
6
|
constructor(options) {
|
|
12
7
|
super(options);
|
|
13
8
|
this.onDelete = options.onDelete;
|
|
@@ -50,7 +45,8 @@ class OrganizationListCardViewController extends heartwood_view_controllers_1.Ab
|
|
|
50
45
|
id: org.id,
|
|
51
46
|
isSelected: this.selectedOrgId === org.id,
|
|
52
47
|
onClick: async () => {
|
|
53
|
-
|
|
48
|
+
var _a;
|
|
49
|
+
await ((_a = this.onEdit) === null || _a === void 0 ? void 0 : _a.call(this, org));
|
|
54
50
|
},
|
|
55
51
|
//@ts-ignore
|
|
56
52
|
cells: [
|
|
@@ -75,6 +71,7 @@ class OrganizationListCardViewController extends heartwood_view_controllers_1.Ab
|
|
|
75
71
|
};
|
|
76
72
|
}
|
|
77
73
|
async handleDeleteOrg(org) {
|
|
74
|
+
var _a;
|
|
78
75
|
this.activeRecordCardVc.deleteRow(org.id);
|
|
79
76
|
this.activeRecordCardVc.setIsBusy(true);
|
|
80
77
|
const client = await this.connectToApi();
|
|
@@ -83,7 +80,7 @@ class OrganizationListCardViewController extends heartwood_view_controllers_1.Ab
|
|
|
83
80
|
organizationId: org.id,
|
|
84
81
|
},
|
|
85
82
|
});
|
|
86
|
-
await this.onDelete
|
|
83
|
+
await ((_a = this.onDelete) === null || _a === void 0 ? void 0 : _a.call(this, org));
|
|
87
84
|
this.activeRecordCardVc.setIsBusy(false);
|
|
88
85
|
}
|
|
89
86
|
async load() {
|
|
@@ -99,4 +96,5 @@ class OrganizationListCardViewController extends heartwood_view_controllers_1.Ab
|
|
|
99
96
|
return this.activeRecordCardVc.render();
|
|
100
97
|
}
|
|
101
98
|
}
|
|
99
|
+
OrganizationListCardViewController.id = 'org-list-card';
|
|
102
100
|
exports.default = OrganizationListCardViewController;
|