@sprucelabs/spruce-location-utils 3.0.2 → 3.0.6

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.
@@ -1,12 +1,20 @@
1
1
  import { SkillViewController } from '@sprucelabs/heartwood-view-controllers';
2
2
  import { OrganizationFixture, ViewFixture } from '@sprucelabs/spruce-test-fixtures';
3
3
  declare const organizationAssert: {
4
+ /**
5
+ *
6
+ * @deprecated use vcAssert.assertSkillViewIsScopedBy(this.vc, 'organization')
7
+ */
4
8
  assertRedirectsToAddOrgIfNoOrgExists(options: {
5
9
  views: ViewFixture;
6
10
  organizations: OrganizationFixture;
7
11
  vc: SkillViewController<any>;
8
12
  didAddOrgRedirectDestination: string;
9
13
  }): Promise<void>;
14
+ /**
15
+ *
16
+ * @deprecated do not even do this anymore
17
+ */
10
18
  assertDoesNotRedirectToAddAOrgIfOrgExists(options: {
11
19
  vc: SkillViewController<any>;
12
20
  views: ViewFixture;
@@ -12,6 +12,10 @@ import { assertOptions } from '@sprucelabs/schema';
12
12
  import { TestRouter, } from '@sprucelabs/spruce-test-fixtures';
13
13
  import { assert } from '@sprucelabs/test';
14
14
  const organizationAssert = {
15
+ /**
16
+ *
17
+ * @deprecated use vcAssert.assertSkillViewIsScopedBy(this.vc, 'organization')
18
+ */
15
19
  assertRedirectsToAddOrgIfNoOrgExists(options) {
16
20
  return __awaiter(this, void 0, void 0, function* () {
17
21
  assertOptions(options, [
@@ -39,6 +43,10 @@ const organizationAssert = {
39
43
  TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
40
44
  });
41
45
  },
46
+ /**
47
+ *
48
+ * @deprecated do not even do this anymore
49
+ */
42
50
  assertDoesNotRedirectToAddAOrgIfOrgExists(options) {
43
51
  return __awaiter(this, void 0, void 0, function* () {
44
52
  assertOptions(options, ['views', 'vc', 'organizations']);
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { AbstractViewController, buildActiveRecordCard, } from '@sprucelabs/heartwood-view-controllers';
11
11
  import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
12
+ import locationRenderer from '../renderers/locationRenderer.js';
12
13
  export default class LocationListCardViewController extends AbstractViewController {
13
14
  constructor(options) {
14
15
  super(options);
@@ -38,6 +39,7 @@ export default class LocationListCardViewController extends AbstractViewControll
38
39
  }));
39
40
  }
40
41
  buildRow(location) {
42
+ const address = location.address;
41
43
  return {
42
44
  id: location.id,
43
45
  isSelected: this.selectedLocationId === location.id,
@@ -51,11 +53,7 @@ export default class LocationListCardViewController extends AbstractViewControll
51
53
  content: location.name,
52
54
  },
53
55
  subText: {
54
- content: `${location.address
55
- ? `${location.address.street1}${location.address.street2
56
- ? ` ${location.address.street2}`
57
- : ``} ${location.address.city} ${location.address.zip}`
58
- : ``}`,
56
+ content: locationRenderer.renderAddress(address),
59
57
  },
60
58
  },
61
59
  {
@@ -1,12 +1,20 @@
1
1
  import { SkillViewController } from '@sprucelabs/heartwood-view-controllers';
2
2
  import { OrganizationFixture, ViewFixture } from '@sprucelabs/spruce-test-fixtures';
3
3
  declare const organizationAssert: {
4
+ /**
5
+ *
6
+ * @deprecated use vcAssert.assertSkillViewIsScopedBy(this.vc, 'organization')
7
+ */
4
8
  assertRedirectsToAddOrgIfNoOrgExists(options: {
5
9
  views: ViewFixture;
6
10
  organizations: OrganizationFixture;
7
11
  vc: SkillViewController<any>;
8
12
  didAddOrgRedirectDestination: string;
9
13
  }): Promise<void>;
14
+ /**
15
+ *
16
+ * @deprecated do not even do this anymore
17
+ */
10
18
  assertDoesNotRedirectToAddAOrgIfOrgExists(options: {
11
19
  vc: SkillViewController<any>;
12
20
  views: ViewFixture;
@@ -5,6 +5,10 @@ const schema_1 = require("@sprucelabs/schema");
5
5
  const spruce_test_fixtures_1 = require("@sprucelabs/spruce-test-fixtures");
6
6
  const test_1 = require("@sprucelabs/test");
7
7
  const organizationAssert = {
8
+ /**
9
+ *
10
+ * @deprecated use vcAssert.assertSkillViewIsScopedBy(this.vc, 'organization')
11
+ */
8
12
  async assertRedirectsToAddOrgIfNoOrgExists(options) {
9
13
  (0, schema_1.assertOptions)(options, [
10
14
  'views',
@@ -30,6 +34,10 @@ const organizationAssert = {
30
34
  });
31
35
  spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
32
36
  },
37
+ /**
38
+ *
39
+ * @deprecated do not even do this anymore
40
+ */
33
41
  async assertDoesNotRedirectToAddAOrgIfOrgExists(options) {
34
42
  (0, schema_1.assertOptions)(options, ['views', 'vc', 'organizations']);
35
43
  const { vc, views, organizations } = options;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
4
7
  const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
8
+ const locationRenderer_1 = __importDefault(require("../renderers/locationRenderer"));
5
9
  class LocationListCardViewController extends heartwood_view_controllers_1.AbstractViewController {
6
10
  constructor(options) {
7
11
  super(options);
@@ -31,6 +35,7 @@ class LocationListCardViewController extends heartwood_view_controllers_1.Abstra
31
35
  }));
32
36
  }
33
37
  buildRow(location) {
38
+ const address = location.address;
34
39
  return {
35
40
  id: location.id,
36
41
  isSelected: this.selectedLocationId === location.id,
@@ -44,11 +49,7 @@ class LocationListCardViewController extends heartwood_view_controllers_1.Abstra
44
49
  content: location.name,
45
50
  },
46
51
  subText: {
47
- content: `${location.address
48
- ? `${location.address.street1}${location.address.street2
49
- ? ` ${location.address.street2}`
50
- : ``} ${location.address.city} ${location.address.zip}`
51
- : ``}`,
52
+ content: locationRenderer_1.default.renderAddress(address),
52
53
  },
53
54
  },
54
55
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-location-utils",
3
3
  "description": "Location Utilities",
4
- "version": "3.0.2",
4
+ "version": "3.0.6",
5
5
  "skill": {
6
6
  "namespace": "locations"
7
7
  },