@sprucelabs/spruce-organization-utils 6.0.97 → 7.0.0

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.
@@ -5,12 +5,12 @@ type Button = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Button;
5
5
  type Row = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ListRow;
6
6
  type OnDeleteHandler = (organization: Organization) => void | Promise<void>;
7
7
  type OnEditHandler = (organization: Organization) => void | Promise<void>;
8
- export type OrganizationListCardViewControllerOptions = {
8
+ export interface OrganizationListCardViewControllerOptions {
9
9
  onDelete?: OnDeleteHandler;
10
10
  onEdit?: OnEditHandler;
11
11
  footerButtons?: Button[];
12
12
  selectedOrgId?: string;
13
- };
13
+ }
14
14
  export default class OrganizationListCardViewController extends AbstractViewController<Card> {
15
15
  static id: string;
16
16
  private activeRecordCardVc;
@@ -5,12 +5,12 @@ type Button = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Button;
5
5
  type Row = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ListRow;
6
6
  type OnDeleteHandler = (organization: Organization) => void | Promise<void>;
7
7
  type OnEditHandler = (organization: Organization) => void | Promise<void>;
8
- export type OrganizationListCardViewControllerOptions = {
8
+ export interface OrganizationListCardViewControllerOptions {
9
9
  onDelete?: OnDeleteHandler;
10
10
  onEdit?: OnEditHandler;
11
11
  footerButtons?: Button[];
12
12
  selectedOrgId?: string;
13
- };
13
+ }
14
14
  export default class OrganizationListCardViewController extends AbstractViewController<Card> {
15
15
  static id: string;
16
16
  private activeRecordCardVc;
@@ -3,6 +3,11 @@ 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;
6
11
  constructor(options) {
7
12
  super(options);
8
13
  this.onDelete = options.onDelete;
@@ -45,8 +50,7 @@ class OrganizationListCardViewController extends heartwood_view_controllers_1.Ab
45
50
  id: org.id,
46
51
  isSelected: this.selectedOrgId === org.id,
47
52
  onClick: async () => {
48
- var _a;
49
- await ((_a = this.onEdit) === null || _a === void 0 ? void 0 : _a.call(this, org));
53
+ await this.onEdit?.(org);
50
54
  },
51
55
  //@ts-ignore
52
56
  cells: [
@@ -71,7 +75,6 @@ class OrganizationListCardViewController extends heartwood_view_controllers_1.Ab
71
75
  };
72
76
  }
73
77
  async handleDeleteOrg(org) {
74
- var _a;
75
78
  this.activeRecordCardVc.deleteRow(org.id);
76
79
  this.activeRecordCardVc.setIsBusy(true);
77
80
  const client = await this.connectToApi();
@@ -80,7 +83,7 @@ class OrganizationListCardViewController extends heartwood_view_controllers_1.Ab
80
83
  organizationId: org.id,
81
84
  },
82
85
  });
83
- await ((_a = this.onDelete) === null || _a === void 0 ? void 0 : _a.call(this, org));
86
+ await this.onDelete?.(org);
84
87
  this.activeRecordCardVc.setIsBusy(false);
85
88
  }
86
89
  async load() {
@@ -96,5 +99,4 @@ class OrganizationListCardViewController extends heartwood_view_controllers_1.Ab
96
99
  return this.activeRecordCardVc.render();
97
100
  }
98
101
  }
99
- OrganizationListCardViewController.id = 'org-list-card';
100
102
  exports.default = OrganizationListCardViewController;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-organization-utils",
3
3
  "description": "Support for working with organizations and Sprucebot. 📈",
4
- "version": "6.0.97",
4
+ "version": "7.0.0",
5
5
  "skill": {
6
6
  "namespace": "organization"
7
7
  },