@livepreso/api 6.45.0 → 6.47.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.
- package/.rush/temp/1aebf46f78ad5c45f82f8147751890adb37bef9d.log +10 -0
- package/.rush/temp/3cdc82c352e8ed90607952873f3aa4c200490874.log +10 -0
- package/.rush/temp/5489ab737e406518983c16c57fc3e1edc07c0341.log +10 -0
- package/.rush/temp/924652444ab5a6063f328a2217123a2227058896.log +10 -0
- package/.rush/temp/9f2030f96d62f3e38052e35201819a216566f14f.log +10 -0
- package/.rush/temp/operation/test/all.log +19 -0
- package/.rush/temp/operation/test/state.json +3 -0
- package/.rush/temp/package-deps_build.json +156 -141
- package/.rush/temp/shrinkwrap-deps.json +281 -214
- package/CHANGELOG.json +29 -0
- package/CHANGELOG.md +15 -1
- package/README.md +4 -4
- package/api.build.log +6 -3
- package/api.test.cache.log +1 -0
- package/api.test.log +19 -0
- package/cjs/api.js +18 -2
- package/cjs/api.js.map +1 -1
- package/cjs/auth.js +3 -3
- package/cjs/auth.js.map +1 -1
- package/cjs/collections/activity.js.map +1 -1
- package/cjs/collections/adjunct-sections.js.map +1 -1
- package/cjs/collections/adjunct-slides.js.map +1 -1
- package/cjs/collections/adjunct-sub-slides.js.map +1 -1
- package/cjs/collections/appointment-adjunct-tags.js.map +1 -1
- package/cjs/collections/appointment-deckversion-tags.js.map +1 -1
- package/cjs/collections/appointment-editors.js.map +1 -1
- package/cjs/collections/appointment-section-tags.js.map +1 -1
- package/cjs/collections/appointment-slide-tags.js.map +1 -1
- package/cjs/collections/appointment-tags.js +9 -7
- package/cjs/collections/appointment-tags.js.map +1 -1
- package/cjs/collections/appointment-templates.js +36 -0
- package/cjs/collections/appointment-templates.js.map +1 -0
- package/cjs/collections/appointments.js.map +1 -1
- package/cjs/collections/assets.js.map +1 -1
- package/cjs/collections/auto-adjuncts.js.map +1 -1
- package/cjs/collections/base.js +4 -0
- package/cjs/collections/base.js.map +1 -1
- package/cjs/collections/base.spec.js.map +1 -1
- package/cjs/collections/cms-vals.js +5 -0
- package/cjs/collections/cms-vals.js.map +1 -1
- package/cjs/collections/contact-phones.js +28 -0
- package/cjs/collections/contact-phones.js.map +1 -0
- package/cjs/collections/contacts.js.map +1 -1
- package/cjs/collections/created-assets.js.map +1 -1
- package/cjs/collections/customers.js.map +1 -1
- package/cjs/collections/deck-notes.js.map +1 -1
- package/cjs/collections/deck-version-screenshots.js.map +1 -1
- package/cjs/collections/deck-versions.js.map +1 -1
- package/cjs/collections/decks.js.map +1 -1
- package/cjs/collections/deleted-assets.js.map +1 -1
- package/cjs/collections/dispatches.js.map +1 -1
- package/cjs/collections/event-objects.js.map +1 -1
- package/cjs/collections/events.js.map +1 -1
- package/cjs/collections/groups.js.map +1 -1
- package/cjs/collections/images.js.map +1 -1
- package/cjs/collections/locations.js.map +1 -1
- package/cjs/collections/opportunities.js.map +1 -1
- package/cjs/collections/pack-diffs.js.map +1 -1
- package/cjs/collections/packs.js.map +1 -1
- package/cjs/collections/presets.js.map +1 -1
- package/cjs/collections/section-selections.js.map +1 -1
- package/cjs/collections/sections.js.map +1 -1
- package/cjs/collections/signers.js +28 -0
- package/cjs/collections/signers.js.map +1 -0
- package/cjs/collections/signing-requests.js +28 -0
- package/cjs/collections/signing-requests.js.map +1 -0
- package/cjs/collections/slide-selections.js.map +1 -1
- package/cjs/collections/slides.js.map +1 -1
- package/cjs/collections/snapshots.js.map +1 -1
- package/cjs/collections/sub-slides.js.map +1 -1
- package/cjs/collections/tags.js.map +1 -1
- package/cjs/collections/teams.js.map +1 -1
- package/cjs/collections/templates.js.map +1 -1
- package/cjs/collections/uploads.js.map +1 -1
- package/cjs/collections/users.js.map +1 -1
- package/cjs/collections.js +52 -13
- package/cjs/collections.js.map +1 -1
- package/cjs/fixtures.js +232 -0
- package/cjs/fixtures.js.map +1 -0
- package/cjs/index.js +28 -4
- package/cjs/index.js.map +1 -1
- package/cjs/models/activity-item.js +10 -2
- package/cjs/models/activity-item.js.map +1 -1
- package/cjs/models/adjunct-section.js +7 -2
- package/cjs/models/adjunct-section.js.map +1 -1
- package/cjs/models/adjunct-slide.js +7 -2
- package/cjs/models/adjunct-slide.js.map +1 -1
- package/cjs/models/adjunct-sub-slide.js.map +1 -1
- package/cjs/models/adjunct.js +40 -0
- package/cjs/models/adjunct.js.map +1 -1
- package/cjs/models/appointment-adjunct-tags.js.map +1 -1
- package/cjs/models/appointment-deckversion-tags.js.map +1 -1
- package/cjs/models/appointment-editor.js.map +1 -1
- package/cjs/models/appointment-section-tags.js.map +1 -1
- package/cjs/models/appointment-slide-tags.js.map +1 -1
- package/cjs/models/appointment-stats.js.map +1 -1
- package/cjs/models/appointment-tags.js.map +1 -1
- package/cjs/models/appointment-template.js +28 -0
- package/cjs/models/appointment-template.js.map +1 -0
- package/cjs/models/appointment-viewing.js.map +1 -1
- package/cjs/models/appointment.js +108 -15
- package/cjs/models/appointment.js.map +1 -1
- package/cjs/models/asset.js +12 -0
- package/cjs/models/asset.js.map +1 -1
- package/cjs/models/auto-adjunct-key-check.js.map +1 -1
- package/cjs/models/auto-adjunct.js +2 -1
- package/cjs/models/auto-adjunct.js.map +1 -1
- package/cjs/models/base.js +25 -5
- package/cjs/models/base.js.map +1 -1
- package/cjs/models/base.spec.js.map +1 -1
- package/cjs/models/choicelist.js.map +1 -1
- package/cjs/models/cms-val.js +35 -1
- package/cjs/models/cms-val.js.map +1 -1
- package/cjs/models/cms-val.spec.js +32 -0
- package/cjs/models/cms-val.spec.js.map +1 -0
- package/cjs/models/contact-phone.js +66 -0
- package/cjs/models/contact-phone.js.map +1 -0
- package/cjs/models/contact.js.map +1 -1
- package/cjs/models/customer.js +3 -1
- package/cjs/models/customer.js.map +1 -1
- package/cjs/models/deck-note.js.map +1 -1
- package/cjs/models/deck-tags.js.map +1 -1
- package/cjs/models/deck-version-screenshot.js.map +1 -1
- package/cjs/models/deck-version.js +31 -8
- package/cjs/models/deck-version.js.map +1 -1
- package/cjs/models/deck.js.map +1 -1
- package/cjs/models/dispatch-preview.js.map +1 -1
- package/cjs/models/dispatch.js.map +1 -1
- package/cjs/models/event-object.js.map +1 -1
- package/cjs/models/event.js.map +1 -1
- package/cjs/models/feed-data.js.map +1 -1
- package/cjs/models/file.js.map +1 -1
- package/cjs/models/group.js.map +1 -1
- package/cjs/models/handover.js.map +1 -1
- package/cjs/models/hosted-preso.js.map +1 -1
- package/cjs/models/image.js.map +1 -1
- package/cjs/models/location.js.map +1 -1
- package/cjs/models/manifest-json.js +70 -2
- package/cjs/models/manifest-json.js.map +1 -1
- package/cjs/models/onshare.js.map +1 -1
- package/cjs/models/opportunity.js.map +1 -1
- package/cjs/models/pack-diff.js.map +1 -1
- package/cjs/models/pack.js.map +1 -1
- package/cjs/models/preset.js +4 -1
- package/cjs/models/preset.js.map +1 -1
- package/cjs/models/refresh-request.js +24 -0
- package/cjs/models/refresh-request.js.map +1 -1
- package/cjs/models/room.js.map +1 -1
- package/cjs/models/salesforce-lookup.js.map +1 -1
- package/cjs/models/section-selection.js.map +1 -1
- package/cjs/models/section.js.map +1 -1
- package/cjs/models/signer.js +47 -0
- package/cjs/models/signer.js.map +1 -0
- package/cjs/models/signing-request.js +66 -0
- package/cjs/models/signing-request.js.map +1 -0
- package/cjs/models/slide-selection.js.map +1 -1
- package/cjs/models/slide.js.map +1 -1
- package/cjs/models/snapshot.js +41 -2
- package/cjs/models/snapshot.js.map +1 -1
- package/cjs/models/snapshot.spec.js +51 -0
- package/cjs/models/snapshot.spec.js.map +1 -0
- package/cjs/models/sub-slide.js.map +1 -1
- package/cjs/models/support-ticket.js.map +1 -1
- package/cjs/models/tag.js.map +1 -1
- package/cjs/models/team.js +15 -2
- package/cjs/models/team.js.map +1 -1
- package/cjs/models/template.js +105 -3
- package/cjs/models/template.js.map +1 -1
- package/cjs/models/tenancy.js +3 -0
- package/cjs/models/tenancy.js.map +1 -1
- package/cjs/models/timing-log.js.map +1 -1
- package/cjs/models/timing-log.spec.js.map +1 -1
- package/cjs/models/token.js.map +1 -1
- package/cjs/models/transcribe-socket.js.map +1 -1
- package/cjs/models/user.js +7 -2
- package/cjs/models/user.js.map +1 -1
- package/cjs/models.js +52 -13
- package/cjs/models.js.map +1 -1
- package/cjs/presentation/appointment-presentation.js.map +1 -1
- package/cjs/presentation/base-presentation-collection.js.map +1 -1
- package/cjs/presentation/base-presentation-model.js +23 -14
- package/cjs/presentation/base-presentation-model.js.map +1 -1
- package/cjs/presentation/base-presentation-model.spec.js.map +1 -1
- package/cjs/presentation/presentation-deck.js +5 -1
- package/cjs/presentation/presentation-deck.js.map +1 -1
- package/cjs/presentation/presentation-deck.spec.js.map +1 -1
- package/cjs/presentation/presentation-decks.js.map +1 -1
- package/cjs/presentation/presentation-section.js +33 -8
- package/cjs/presentation/presentation-section.js.map +1 -1
- package/cjs/presentation/presentation-section.spec.js +13 -20
- package/cjs/presentation/presentation-section.spec.js.map +1 -1
- package/cjs/presentation/presentation-sections.js.map +1 -1
- package/cjs/presentation/presentation-slide.js +43 -9
- package/cjs/presentation/presentation-slide.js.map +1 -1
- package/cjs/presentation/presentation-slide.spec.js +11 -18
- package/cjs/presentation/presentation-slide.spec.js.map +1 -1
- package/cjs/presentation/presentation-slides.js.map +1 -1
- package/cjs/presentation/presentation-subslide.js.map +1 -1
- package/cjs/presentation/presentation-subslide.spec.js.map +1 -1
- package/cjs/presentation/presentation-subslides.js.map +1 -1
- package/cjs/presentation/presentation.js +8 -3
- package/cjs/presentation/presentation.js.map +1 -1
- package/cjs/selections.js +106 -0
- package/cjs/selections.js.map +1 -0
- package/cjs/sync.js.map +1 -1
- package/cjs/utils.js +43 -6
- package/cjs/utils.js.map +1 -1
- package/cjs/utils.spec.js +1 -1
- package/cjs/utils.spec.js.map +1 -1
- package/jest.config.js +4 -3
- package/package.json +12 -9
- package/src/api.js +17 -2
- package/src/auth.js +3 -3
- package/src/collections/activity.js +4 -4
- package/src/collections/adjunct-sections.js +1 -1
- package/src/collections/adjunct-slides.js +1 -1
- package/src/collections/adjunct-sub-slides.js +1 -1
- package/src/collections/appointment-adjunct-tags.js +1 -1
- package/src/collections/appointment-deckversion-tags.js +2 -2
- package/src/collections/appointment-editors.js +1 -1
- package/src/collections/appointment-section-tags.js +1 -1
- package/src/collections/appointment-slide-tags.js +1 -1
- package/src/collections/appointment-tags.js +20 -18
- package/src/collections/appointment-templates.js +26 -0
- package/src/collections/appointments.js +9 -9
- package/src/collections/assets.js +1 -1
- package/src/collections/auto-adjuncts.js +1 -1
- package/src/collections/base.js +10 -6
- package/src/collections/base.spec.js +2 -2
- package/src/collections/cms-vals.js +5 -1
- package/src/collections/contact-phones.js +18 -0
- package/src/collections/contacts.js +1 -1
- package/src/collections/created-assets.js +1 -1
- package/src/collections/customers.js +1 -1
- package/src/collections/deck-notes.js +1 -1
- package/src/collections/deck-version-screenshots.js +1 -1
- package/src/collections/deck-versions.js +1 -1
- package/src/collections/decks.js +1 -1
- package/src/collections/deleted-assets.js +1 -1
- package/src/collections/dispatches.js +2 -2
- package/src/collections/event-objects.js +1 -1
- package/src/collections/events.js +1 -1
- package/src/collections/groups.js +1 -1
- package/src/collections/images.js +1 -1
- package/src/collections/locations.js +1 -1
- package/src/collections/opportunities.js +1 -1
- package/src/collections/pack-diffs.js +1 -1
- package/src/collections/packs.js +1 -1
- package/src/collections/presets.js +1 -1
- package/src/collections/section-selections.js +1 -1
- package/src/collections/sections.js +1 -1
- package/src/collections/signers.js +18 -0
- package/src/collections/signing-requests.js +18 -0
- package/src/collections/slide-selections.js +1 -1
- package/src/collections/slides.js +1 -1
- package/src/collections/snapshots.js +1 -1
- package/src/collections/sub-slides.js +1 -1
- package/src/collections/tags.js +1 -1
- package/src/collections/teams.js +1 -1
- package/src/collections/templates.js +1 -1
- package/src/collections/uploads.js +1 -1
- package/src/collections/users.js +1 -1
- package/src/collections.js +4 -1
- package/src/fixtures.js +195 -0
- package/src/index.js +2 -3
- package/src/models/activity-item.js +9 -1
- package/src/models/adjunct-section.js +7 -2
- package/src/models/adjunct-slide.js +7 -2
- package/src/models/adjunct-sub-slide.js +1 -1
- package/src/models/adjunct.js +39 -1
- package/src/models/appointment-adjunct-tags.js +1 -1
- package/src/models/appointment-deckversion-tags.js +1 -1
- package/src/models/appointment-editor.js +1 -1
- package/src/models/appointment-section-tags.js +1 -1
- package/src/models/appointment-slide-tags.js +1 -1
- package/src/models/appointment-stats.js +1 -1
- package/src/models/appointment-tags.js +1 -1
- package/src/models/appointment-template.js +19 -0
- package/src/models/appointment-viewing.js +1 -1
- package/src/models/appointment.js +104 -38
- package/src/models/asset.js +15 -1
- package/src/models/auto-adjunct-key-check.js +1 -1
- package/src/models/auto-adjunct.js +2 -1
- package/src/models/base.js +36 -21
- package/src/models/base.spec.js +18 -18
- package/src/models/choicelist.js +1 -1
- package/src/models/cms-val.js +24 -1
- package/src/models/cms-val.spec.js +14 -0
- package/src/models/contact-phone.js +57 -0
- package/src/models/contact.js +1 -1
- package/src/models/customer.js +3 -3
- package/src/models/deck-note.js +1 -1
- package/src/models/deck-tags.js +1 -1
- package/src/models/deck-version-screenshot.js +1 -1
- package/src/models/deck-version.js +32 -6
- package/src/models/deck.js +1 -1
- package/src/models/dispatch-preview.js +1 -1
- package/src/models/dispatch.js +1 -1
- package/src/models/event-object.js +1 -1
- package/src/models/event.js +1 -1
- package/src/models/feed-data.js +2 -2
- package/src/models/file.js +1 -1
- package/src/models/group.js +1 -1
- package/src/models/handover.js +1 -1
- package/src/models/hosted-preso.js +1 -1
- package/src/models/image.js +1 -1
- package/src/models/location.js +1 -1
- package/src/models/manifest-json.js +65 -5
- package/src/models/onshare.js +1 -1
- package/src/models/opportunity.js +1 -1
- package/src/models/pack-diff.js +1 -1
- package/src/models/pack.js +1 -1
- package/src/models/preset.js +4 -1
- package/src/models/refresh-request.js +16 -1
- package/src/models/room.js +1 -1
- package/src/models/salesforce-lookup.js +1 -1
- package/src/models/section-selection.js +1 -1
- package/src/models/section.js +1 -1
- package/src/models/signer.js +37 -0
- package/src/models/signing-request.js +56 -0
- package/src/models/slide-selection.js +1 -1
- package/src/models/slide.js +1 -1
- package/src/models/snapshot.js +30 -2
- package/src/models/snapshot.spec.js +31 -0
- package/src/models/sub-slide.js +1 -1
- package/src/models/support-ticket.js +1 -1
- package/src/models/tag.js +1 -1
- package/src/models/team.js +14 -3
- package/src/models/template.js +72 -2
- package/src/models/tenancy.js +4 -1
- package/src/models/timing-log.js +2 -2
- package/src/models/timing-log.spec.js +1 -1
- package/src/models/token.js +1 -1
- package/src/models/transcribe-socket.js +1 -1
- package/src/models/user.js +13 -2
- package/src/models.js +4 -1
- package/src/presentation/appointment-presentation.js +4 -4
- package/src/presentation/base-presentation-collection.js +1 -1
- package/src/presentation/base-presentation-model.js +25 -16
- package/src/presentation/base-presentation-model.spec.js +5 -5
- package/src/presentation/presentation-deck.js +28 -23
- package/src/presentation/presentation-deck.spec.js +4 -4
- package/src/presentation/presentation-decks.js +1 -1
- package/src/presentation/presentation-section.js +59 -31
- package/src/presentation/presentation-section.spec.js +31 -32
- package/src/presentation/presentation-sections.js +1 -1
- package/src/presentation/presentation-slide.js +51 -25
- package/src/presentation/presentation-slide.spec.js +21 -27
- package/src/presentation/presentation-slides.js +1 -1
- package/src/presentation/presentation-subslide.js +5 -5
- package/src/presentation/presentation-subslide.spec.js +3 -3
- package/src/presentation/presentation-subslides.js +1 -1
- package/src/presentation/presentation.js +5 -3
- package/src/selections.js +71 -0
- package/src/sync.js +1 -1
- package/src/utils.js +31 -8
- package/src/utils.spec.js +8 -8
- package/.rush/temp/package-deps_test.json +0 -172
- package/cjs/collections/appointment-duplicates.js +0 -29
- package/cjs/collections/appointment-duplicates.js.map +0 -1
- package/cjs/models/appointment-duplicate.js +0 -94
- package/cjs/models/appointment-duplicate.js.map +0 -1
- package/src/collections/appointment-duplicates.js +0 -19
- package/src/models/appointment-duplicate.js +0 -73
|
@@ -15,13 +15,20 @@ import "../collections/slide-selections.js";
|
|
|
15
15
|
import "../collections/dispatches.js";
|
|
16
16
|
import "../collections/users.js";
|
|
17
17
|
import "../collections/appointment-tags";
|
|
18
|
+
import "../collections/appointment-deckversion-tags";
|
|
19
|
+
import "../collections/appointment-section-tags";
|
|
20
|
+
import "../collections/appointment-slide-tags";
|
|
21
|
+
import "../collections/appointment-adjunct-tags";
|
|
18
22
|
|
|
19
23
|
import { AdjunctSectionCollection } from "../collections/adjunct-sections.js";
|
|
20
24
|
import { AdjunctSlideCollection } from "../collections/adjunct-slides.js";
|
|
21
25
|
import { AdjunctSubSlideCollection } from "../collections/adjunct-sub-slides.js";
|
|
26
|
+
import { AppointmentTemplateCollection } from "../collections/appointment-templates.js";
|
|
22
27
|
import { BaseModel } from "./base.js";
|
|
28
|
+
import { ContactPhoneCollection } from "../collections/contact-phones.js";
|
|
23
29
|
import { DeckNoteCollection } from "../collections/deck-notes.js";
|
|
24
30
|
import Promise from "bluebird";
|
|
31
|
+
import _ from "lodash";
|
|
25
32
|
import log from "../log.js";
|
|
26
33
|
import moment from "moment";
|
|
27
34
|
import { register } from "../state-register.js";
|
|
@@ -51,9 +58,11 @@ export const AppointmentModel = BaseModel.extend(
|
|
|
51
58
|
* @property {string} viewtype
|
|
52
59
|
* @property {boolean} support_mode
|
|
53
60
|
* @property {boolean} is_muted
|
|
61
|
+
* @property {boolean} is_signing_enabled
|
|
54
62
|
* @property {date} no_edit_after
|
|
55
63
|
* @property {date} no_share_after
|
|
56
64
|
* @property {date} no_delete_after
|
|
65
|
+
* @property {string} share_visibility_mode
|
|
57
66
|
*/
|
|
58
67
|
props: {
|
|
59
68
|
name: "stringSanitized",
|
|
@@ -75,10 +84,12 @@ export const AppointmentModel = BaseModel.extend(
|
|
|
75
84
|
viewtype: "string",
|
|
76
85
|
support_mode: "boolean",
|
|
77
86
|
is_muted: "boolean",
|
|
87
|
+
is_signing_enabled: "boolean",
|
|
78
88
|
no_edit_after: "date",
|
|
79
89
|
no_share_after: "date",
|
|
80
90
|
no_delete_after: "date",
|
|
81
91
|
no_snapshot_create_after: "date",
|
|
92
|
+
share_visibility_mode: "string",
|
|
82
93
|
},
|
|
83
94
|
|
|
84
95
|
/**
|
|
@@ -152,6 +163,17 @@ export const AppointmentModel = BaseModel.extend(
|
|
|
152
163
|
return adjunctSubSlides;
|
|
153
164
|
},
|
|
154
165
|
},
|
|
166
|
+
includedTemplates: {
|
|
167
|
+
deps: ["id"],
|
|
168
|
+
fn() {
|
|
169
|
+
return new AppointmentTemplateCollection(
|
|
170
|
+
{},
|
|
171
|
+
{
|
|
172
|
+
appointment: this,
|
|
173
|
+
},
|
|
174
|
+
);
|
|
175
|
+
},
|
|
176
|
+
},
|
|
155
177
|
deckNotes: {
|
|
156
178
|
deps: ["id"],
|
|
157
179
|
fn() {
|
|
@@ -211,6 +233,16 @@ export const AppointmentModel = BaseModel.extend(
|
|
|
211
233
|
return this.cannotEdit || this.cannotDelete;
|
|
212
234
|
},
|
|
213
235
|
},
|
|
236
|
+
// This property should be set by the calling code of the appointment and be the set of
|
|
237
|
+
// contact phones for all contacts on this preso. It must be fetchd and set after the contact_set
|
|
238
|
+
// is fetched. It's up to the calling code to decide if this property is required and
|
|
239
|
+
// therefore the extra fetch
|
|
240
|
+
contactPhones: {
|
|
241
|
+
deps: ["id", "contact_set"],
|
|
242
|
+
fn() {
|
|
243
|
+
return new ContactPhoneCollection();
|
|
244
|
+
},
|
|
245
|
+
},
|
|
214
246
|
},
|
|
215
247
|
|
|
216
248
|
getHooksPath() {
|
|
@@ -220,26 +252,26 @@ export const AppointmentModel = BaseModel.extend(
|
|
|
220
252
|
return this.deckversion_set.first().getHooksPath();
|
|
221
253
|
},
|
|
222
254
|
|
|
223
|
-
fetchAll(fetchSelf = false,
|
|
255
|
+
fetchAll(fetchSelf = false, fetchOptions = {}) {
|
|
224
256
|
return Promise.resolve()
|
|
225
257
|
.then(() => {
|
|
226
258
|
if (!this._url || fetchSelf) {
|
|
227
|
-
return this.fetch(
|
|
259
|
+
return this.fetch(fetchOptions);
|
|
228
260
|
}
|
|
229
261
|
return Promise.resolve();
|
|
230
262
|
})
|
|
231
263
|
.then(() => {
|
|
232
264
|
const fetches = [
|
|
233
|
-
this.deckversion_set
|
|
234
|
-
this.appointmentssection_set
|
|
235
|
-
this.appointmentsslide_set
|
|
236
|
-
this.appointmenteditor_set
|
|
237
|
-
this.adjunctSlides
|
|
238
|
-
this.adjunctSections
|
|
239
|
-
this.adjunctSubSlides
|
|
240
|
-
this.contact_set
|
|
241
|
-
this.tags
|
|
242
|
-
this.user
|
|
265
|
+
this.deckversion_set?.fetchModels(fetchOptions),
|
|
266
|
+
this.appointmentssection_set?.fetch(fetchOptions),
|
|
267
|
+
this.appointmentsslide_set?.fetch(fetchOptions),
|
|
268
|
+
this.appointmenteditor_set?.fetch(fetchOptions),
|
|
269
|
+
this.adjunctSlides?.fetch(fetchOptions),
|
|
270
|
+
this.adjunctSections?.fetch(fetchOptions),
|
|
271
|
+
this.adjunctSubSlides?.fetch(fetchOptions),
|
|
272
|
+
this.contact_set?.fetchSet(fetchOptions),
|
|
273
|
+
this.tags?.fetch(fetchOptions),
|
|
274
|
+
this.user?.fetch(fetchOptions)?.catch((e) => {
|
|
243
275
|
if (e.status && e.status === 404) {
|
|
244
276
|
// It's possible for a user to be deactivated, which means they'll
|
|
245
277
|
// return with a 404. We want to be able to still load the preso,
|
|
@@ -249,52 +281,84 @@ export const AppointmentModel = BaseModel.extend(
|
|
|
249
281
|
}
|
|
250
282
|
throw e;
|
|
251
283
|
}),
|
|
252
|
-
this.deckNotes
|
|
253
|
-
this.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
284
|
+
this.deckNotes?.fetch(fetchOptions),
|
|
285
|
+
this.includedTemplates.fetch(fetchOptions),
|
|
286
|
+
this.opportunity_set
|
|
287
|
+
?.fetchSet(fetchOptions)
|
|
288
|
+
?.then(() => {
|
|
289
|
+
return Promise.all(
|
|
290
|
+
this.opportunity_set.map((opp) =>
|
|
291
|
+
opp.customer.fetch(fetchOptions),
|
|
292
|
+
),
|
|
293
|
+
);
|
|
294
|
+
})
|
|
295
|
+
?.catch(() => {
|
|
296
|
+
log.error(
|
|
297
|
+
`Failed to fetch Opportunity set`,
|
|
298
|
+
this.opportunity_set.toJSON(),
|
|
299
|
+
);
|
|
300
|
+
return Promise.resolve();
|
|
301
|
+
}),
|
|
260
302
|
];
|
|
261
303
|
|
|
262
304
|
if (this.latest_snapshot) {
|
|
263
|
-
fetches.push(this.latest_snapshot.fetch(
|
|
305
|
+
fetches.push(this.latest_snapshot.fetch(fetchOptions));
|
|
264
306
|
}
|
|
265
307
|
|
|
266
308
|
if (this.latest_feed_data) {
|
|
267
|
-
fetches.push(this.latest_feed_data.fetch(
|
|
309
|
+
fetches.push(this.latest_feed_data.fetch(fetchOptions));
|
|
268
310
|
}
|
|
269
311
|
|
|
270
312
|
if (this.latest_tele) {
|
|
271
|
-
fetches.push(this.latest_tele.fetch(
|
|
313
|
+
fetches.push(this.latest_tele.fetch(fetchOptions));
|
|
272
314
|
}
|
|
273
315
|
|
|
274
316
|
return Promise.all(fetches);
|
|
275
317
|
})
|
|
276
318
|
.then(() => {
|
|
319
|
+
return Promise.all(
|
|
320
|
+
this.deckversion_set.map((model) => {
|
|
321
|
+
return Promise.all([
|
|
322
|
+
model.screenshots.fetch(fetchOptions),
|
|
323
|
+
model.template_set.fetchSet(fetchOptions),
|
|
324
|
+
model.manifest_json.fetch(fetchOptions),
|
|
325
|
+
model.deck.fetch(fetchOptions),
|
|
326
|
+
]);
|
|
327
|
+
}),
|
|
328
|
+
);
|
|
329
|
+
})
|
|
330
|
+
.then(() => {
|
|
331
|
+
const deckversionTemplates =
|
|
332
|
+
this.deckversion_set.first().template_set.models;
|
|
333
|
+
|
|
334
|
+
const allTemplates = _.uniqBy(
|
|
335
|
+
this.includedTemplates.models.concat(deckversionTemplates),
|
|
336
|
+
"id",
|
|
337
|
+
);
|
|
338
|
+
|
|
339
|
+
async function getTemplateOrFetch(adj) {
|
|
340
|
+
const existingTemplate = allTemplates.find(
|
|
341
|
+
(t) => t.id === adj.template.id,
|
|
342
|
+
);
|
|
343
|
+
if (existingTemplate) {
|
|
344
|
+
adj.template = existingTemplate;
|
|
345
|
+
} else {
|
|
346
|
+
await adj.template.fetch(fetchOptions);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return adj;
|
|
350
|
+
}
|
|
351
|
+
|
|
277
352
|
const adjunctSlides = this.adjunctSlides
|
|
278
353
|
.filter((adj) => adj.template)
|
|
279
|
-
.map((adj) => adj
|
|
354
|
+
.map((adj) => getTemplateOrFetch(adj));
|
|
355
|
+
|
|
280
356
|
const adjunctSections = this.adjunctSections
|
|
281
357
|
.filter((adj) => adj.template)
|
|
282
|
-
.map((adj) => adj
|
|
358
|
+
.map((adj) => getTemplateOrFetch(adj));
|
|
283
359
|
|
|
284
360
|
return Promise.all([...adjunctSlides, ...adjunctSections]);
|
|
285
361
|
})
|
|
286
|
-
.then(() => {
|
|
287
|
-
return Promise.all(
|
|
288
|
-
this.deckversion_set.map((model) => {
|
|
289
|
-
return Promise.all([
|
|
290
|
-
model.screenshots.fetch(options),
|
|
291
|
-
model.template_set.fetchSet(options),
|
|
292
|
-
model.manifest_json.fetch(options),
|
|
293
|
-
model.deck.fetch(options),
|
|
294
|
-
]);
|
|
295
|
-
})
|
|
296
|
-
);
|
|
297
|
-
})
|
|
298
362
|
.return(this);
|
|
299
363
|
},
|
|
300
364
|
|
|
@@ -315,11 +379,13 @@ export const AppointmentModel = BaseModel.extend(
|
|
|
315
379
|
preset: this._retrieveURL(appointment.preset),
|
|
316
380
|
locks: appointment.locks,
|
|
317
381
|
is_muted: appointment.is_muted,
|
|
382
|
+
is_signing_enabled: appointment.is_signing_enabled,
|
|
318
383
|
no_edit_after: appointment.no_edit_after,
|
|
319
384
|
no_share_after: appointment.no_share_after,
|
|
320
385
|
no_delete_after: appointment.no_delete_after,
|
|
321
386
|
team: this._retrieveURL(appointment.team),
|
|
322
387
|
editors_can_change_editors: appointment.editors_can_change_editors,
|
|
388
|
+
share_visibility_mode: appointment.share_visibility_mode,
|
|
323
389
|
};
|
|
324
390
|
|
|
325
391
|
if (this.id) {
|
|
@@ -328,7 +394,7 @@ export const AppointmentModel = BaseModel.extend(
|
|
|
328
394
|
|
|
329
395
|
return data;
|
|
330
396
|
},
|
|
331
|
-
}
|
|
397
|
+
},
|
|
332
398
|
);
|
|
333
399
|
|
|
334
400
|
register("AppointmentModel", AppointmentModel);
|
package/src/models/asset.js
CHANGED
|
@@ -33,6 +33,20 @@ export const AssetModel = BaseModel.extend(
|
|
|
33
33
|
orig_path: "string",
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* The asset serializer actually returns the file in question for the URL.
|
|
38
|
+
* This method returns the actual URL of the asset endpoint, for example:
|
|
39
|
+
*
|
|
40
|
+
* /api/assets/2/
|
|
41
|
+
*/
|
|
42
|
+
assetURL() {
|
|
43
|
+
// HACK: For some reason the API endpoint returns a url with a pack in it, but
|
|
44
|
+
// this doesn't actually work. We just want the 'asset' url.
|
|
45
|
+
return `${this.getResourceURL().replace("/packs/{pack.id}", "")}${
|
|
46
|
+
this.id
|
|
47
|
+
}/`;
|
|
48
|
+
},
|
|
49
|
+
|
|
36
50
|
/**
|
|
37
51
|
* @property {models.PackModel} pack
|
|
38
52
|
*/
|
|
@@ -43,7 +57,7 @@ export const AssetModel = BaseModel.extend(
|
|
|
43
57
|
url() {
|
|
44
58
|
return this._url;
|
|
45
59
|
},
|
|
46
|
-
}
|
|
60
|
+
},
|
|
47
61
|
);
|
|
48
62
|
|
|
49
63
|
register("AssetModel", AssetModel);
|
|
@@ -41,6 +41,7 @@ export const AutoAdjunctModel = BaseModel.extend(
|
|
|
41
41
|
sequence: "number",
|
|
42
42
|
tags: "array",
|
|
43
43
|
cmsvalkey_set: "array",
|
|
44
|
+
_tenancy: "object",
|
|
44
45
|
},
|
|
45
46
|
|
|
46
47
|
/**
|
|
@@ -52,7 +53,7 @@ export const AutoAdjunctModel = BaseModel.extend(
|
|
|
52
53
|
template: "TemplateModel",
|
|
53
54
|
team: "TeamModel",
|
|
54
55
|
},
|
|
55
|
-
}
|
|
56
|
+
},
|
|
56
57
|
);
|
|
57
58
|
|
|
58
59
|
register("AutoAdjunctModel", AutoAdjunctModel);
|
package/src/models/base.js
CHANGED
|
@@ -21,6 +21,7 @@ export const BaseModel = Model.extend(
|
|
|
21
21
|
/** @lends models.BaseModel# */ {
|
|
22
22
|
modelName: null,
|
|
23
23
|
queryData: {},
|
|
24
|
+
detailType: "number",
|
|
24
25
|
|
|
25
26
|
// This is unfortunately necessary to avoid the default ampersand model/state
|
|
26
27
|
// behaviour from automatically hydrating all children and collections on a fetch.
|
|
@@ -99,6 +100,15 @@ export const BaseModel = Model.extend(
|
|
|
99
100
|
if (def && (def.isState || def instanceof Collection)) {
|
|
100
101
|
dataCopy[key] = def.toJSON();
|
|
101
102
|
}
|
|
103
|
+
|
|
104
|
+
if (def && Array.isArray(def)) {
|
|
105
|
+
dataCopy[key] = def.map((obj) => {
|
|
106
|
+
if (obj instanceof Model) {
|
|
107
|
+
return obj.toJSON();
|
|
108
|
+
}
|
|
109
|
+
return obj;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
102
112
|
}
|
|
103
113
|
|
|
104
114
|
this.registerStates();
|
|
@@ -131,7 +141,7 @@ export const BaseModel = Model.extend(
|
|
|
131
141
|
for (const derivedProp of Object.keys(this._data[derivedKey])) {
|
|
132
142
|
this[derivedKey].set(
|
|
133
143
|
derivedProp,
|
|
134
|
-
this._data[derivedKey][derivedProp]
|
|
144
|
+
this._data[derivedKey][derivedProp],
|
|
135
145
|
);
|
|
136
146
|
}
|
|
137
147
|
}
|
|
@@ -152,9 +162,9 @@ export const BaseModel = Model.extend(
|
|
|
152
162
|
const replacements = _.extend(
|
|
153
163
|
{},
|
|
154
164
|
{
|
|
155
|
-
detailKey:
|
|
165
|
+
detailKey: this.detailType,
|
|
156
166
|
},
|
|
157
|
-
this.urlMatchKeys
|
|
167
|
+
this.urlMatchKeys,
|
|
158
168
|
);
|
|
159
169
|
|
|
160
170
|
const regexes = Object.keys(replacements).reduce((result, key) => {
|
|
@@ -162,6 +172,8 @@ export const BaseModel = Model.extend(
|
|
|
162
172
|
const name = key.replace(/\./g, "_");
|
|
163
173
|
if (type === "number") {
|
|
164
174
|
result[name] = "\\d+";
|
|
175
|
+
} else if (type === "uuid") {
|
|
176
|
+
result[name] = "([a-z]|[0-9]|-)+";
|
|
165
177
|
} else if (type === "string") {
|
|
166
178
|
result[name] = "\\w+";
|
|
167
179
|
} else {
|
|
@@ -208,7 +220,7 @@ export const BaseModel = Model.extend(
|
|
|
208
220
|
Failed to match URL '${url}' for model '${this.modelName}'.
|
|
209
221
|
This is usually because the regex type for a key hasn't been set.
|
|
210
222
|
Error: `,
|
|
211
|
-
e
|
|
223
|
+
e,
|
|
212
224
|
);
|
|
213
225
|
return false;
|
|
214
226
|
}
|
|
@@ -226,8 +238,8 @@ export const BaseModel = Model.extend(
|
|
|
226
238
|
// and we want to ignore the hostname (https://staging-demo.salespreso.com)
|
|
227
239
|
// and strip out the '/api' from both the resource url and the variable url
|
|
228
240
|
// so that we can use the remaining part to isolate the id
|
|
229
|
-
_getIDFromURL(url) {
|
|
230
|
-
const resourceURL = this.getResourceURL();
|
|
241
|
+
_getIDFromURL(url, resource = "") {
|
|
242
|
+
const resourceURL = resource || this.getResourceURL();
|
|
231
243
|
|
|
232
244
|
if (!url || !resourceURL) {
|
|
233
245
|
return null;
|
|
@@ -318,7 +330,7 @@ export const BaseModel = Model.extend(
|
|
|
318
330
|
const Model = registeredStates[model];
|
|
319
331
|
if (!Model) {
|
|
320
332
|
throw new Error(
|
|
321
|
-
`'${model}' not found! Did you forget to import it on the '${this.modelName}' model
|
|
333
|
+
`'${model}' not found! Did you forget to import it on the '${this.modelName}' model?`,
|
|
322
334
|
);
|
|
323
335
|
}
|
|
324
336
|
this._children[prop] = Model;
|
|
@@ -328,7 +340,7 @@ export const BaseModel = Model.extend(
|
|
|
328
340
|
const Collection = state[collection];
|
|
329
341
|
if (!Collection) {
|
|
330
342
|
throw new Error(
|
|
331
|
-
`'${collection}' not found! Did you forget to import it on the '${this.modelName}' model
|
|
343
|
+
`'${collection}' not found! Did you forget to import it on the '${this.modelName}' model?`,
|
|
332
344
|
);
|
|
333
345
|
}
|
|
334
346
|
this._collections[prop] = Collection;
|
|
@@ -362,7 +374,7 @@ export const BaseModel = Model.extend(
|
|
|
362
374
|
}
|
|
363
375
|
}
|
|
364
376
|
},
|
|
365
|
-
this
|
|
377
|
+
this,
|
|
366
378
|
);
|
|
367
379
|
|
|
368
380
|
// Loop throught the collections and replace with the registered collection
|
|
@@ -373,7 +385,7 @@ export const BaseModel = Model.extend(
|
|
|
373
385
|
this._registerCollection(registeredStates, prop, collection);
|
|
374
386
|
}
|
|
375
387
|
},
|
|
376
|
-
this
|
|
388
|
+
this,
|
|
377
389
|
);
|
|
378
390
|
},
|
|
379
391
|
|
|
@@ -452,10 +464,10 @@ export const BaseModel = Model.extend(
|
|
|
452
464
|
_.concat(
|
|
453
465
|
_.concat(
|
|
454
466
|
Object.keys(this._unsetChildren),
|
|
455
|
-
Object.keys(this._unsetCollections)
|
|
467
|
+
Object.keys(this._unsetCollections),
|
|
456
468
|
),
|
|
457
|
-
Object.keys(this._values)
|
|
458
|
-
)
|
|
469
|
+
Object.keys(this._values),
|
|
470
|
+
),
|
|
459
471
|
);
|
|
460
472
|
|
|
461
473
|
keys.forEach((key) => {
|
|
@@ -508,12 +520,12 @@ export const BaseModel = Model.extend(
|
|
|
508
520
|
if (typeof this._children[child] === "function") {
|
|
509
521
|
this._safeSet(
|
|
510
522
|
child,
|
|
511
|
-
new this._children[child](val, { parent: this })
|
|
523
|
+
new this._children[child](val, { parent: this }),
|
|
512
524
|
);
|
|
513
525
|
this.listenTo(
|
|
514
526
|
this[child],
|
|
515
527
|
"all",
|
|
516
|
-
this._getCachedEventBubblingHandler(child)
|
|
528
|
+
this._getCachedEventBubblingHandler(child),
|
|
517
529
|
);
|
|
518
530
|
} else {
|
|
519
531
|
this._safeSet(child, val);
|
|
@@ -541,7 +553,7 @@ export const BaseModel = Model.extend(
|
|
|
541
553
|
if (typeof this._collections[coll] === "function") {
|
|
542
554
|
this._safeSet(
|
|
543
555
|
coll,
|
|
544
|
-
new this._collections[coll](val, { parent: this })
|
|
556
|
+
new this._collections[coll](val, { parent: this }),
|
|
545
557
|
);
|
|
546
558
|
} else {
|
|
547
559
|
this._safeSet(coll, val);
|
|
@@ -601,7 +613,6 @@ export const BaseModel = Model.extend(
|
|
|
601
613
|
if (this._url && this.isNew()) {
|
|
602
614
|
return this.getFullURLPath(this._url);
|
|
603
615
|
}
|
|
604
|
-
|
|
605
616
|
return this.getFullURLPath(this.getPlainURL());
|
|
606
617
|
},
|
|
607
618
|
|
|
@@ -617,6 +628,10 @@ export const BaseModel = Model.extend(
|
|
|
617
628
|
resp += "/";
|
|
618
629
|
}
|
|
619
630
|
|
|
631
|
+
if (!resp.includes("{") || !resp.includes("}")) {
|
|
632
|
+
return resp;
|
|
633
|
+
}
|
|
634
|
+
|
|
620
635
|
// Replace any values in a url with one from the model.
|
|
621
636
|
// So if you have /path/to/{model.id}/
|
|
622
637
|
// It will check the model from "this.model.id" and replace
|
|
@@ -655,7 +670,7 @@ export const BaseModel = Model.extend(
|
|
|
655
670
|
return sync.apply(this, arguments);
|
|
656
671
|
},
|
|
657
672
|
|
|
658
|
-
serialize() {
|
|
673
|
+
serialize(opts = { derived: true }) {
|
|
659
674
|
// Return nothing if data passed is falsy. More than likely this is
|
|
660
675
|
// a null value
|
|
661
676
|
if (!this._data) {
|
|
@@ -665,7 +680,7 @@ export const BaseModel = Model.extend(
|
|
|
665
680
|
const data = Model.prototype.serialize.apply(this, arguments);
|
|
666
681
|
data.url = this.url();
|
|
667
682
|
|
|
668
|
-
let derived = this.getAttributes(
|
|
683
|
+
let derived = this.getAttributes(opts);
|
|
669
684
|
derived = Object.keys(derived).reduce((object, key) => {
|
|
670
685
|
let value = derived[key];
|
|
671
686
|
if (value instanceof Collection || value instanceof Model) {
|
|
@@ -716,7 +731,7 @@ export const BaseModel = Model.extend(
|
|
|
716
731
|
|
|
717
732
|
return null;
|
|
718
733
|
},
|
|
719
|
-
}
|
|
734
|
+
},
|
|
720
735
|
);
|
|
721
736
|
|
|
722
737
|
function replacePropertyDefinition(object, name) {
|
|
@@ -785,7 +800,7 @@ function replacePropertyDefinition(object, name) {
|
|
|
785
800
|
get() {
|
|
786
801
|
if (!this._values) {
|
|
787
802
|
throw new Error(
|
|
788
|
-
`Trying to retrieve value ${name} of model ${object.modelName} during constructor
|
|
803
|
+
`Trying to retrieve value ${name} of model ${object.modelName} during constructor`,
|
|
789
804
|
);
|
|
790
805
|
}
|
|
791
806
|
|
package/src/models/base.spec.js
CHANGED
|
@@ -53,7 +53,7 @@ it("should replace child model strings with the registered model", () => {
|
|
|
53
53
|
const Model = G(
|
|
54
54
|
BaseModel.extend({
|
|
55
55
|
children: { test: "TestModel" },
|
|
56
|
-
})
|
|
56
|
+
}),
|
|
57
57
|
);
|
|
58
58
|
const model = new Model({ test: 1 });
|
|
59
59
|
expect(model.test).toBeInstanceOf(TestModel);
|
|
@@ -64,7 +64,7 @@ it("should allow the model to be passed in", () => {
|
|
|
64
64
|
const Model = G(
|
|
65
65
|
BaseModel.extend({
|
|
66
66
|
children: { test: "TestModel" },
|
|
67
|
-
})
|
|
67
|
+
}),
|
|
68
68
|
);
|
|
69
69
|
const model = new Model({ test: new TestModel({ id: 1 }) });
|
|
70
70
|
expect(model.test.id).toEqual(1);
|
|
@@ -76,7 +76,7 @@ it("should reference parent model if foreign key exists", () => {
|
|
|
76
76
|
const Model = G(
|
|
77
77
|
BaseModel.extend({
|
|
78
78
|
children: { test: "TestModel" },
|
|
79
|
-
})
|
|
79
|
+
}),
|
|
80
80
|
);
|
|
81
81
|
const model = new Model({ test: 1 });
|
|
82
82
|
expect(model).toEqual(model.test.parent);
|
|
@@ -86,7 +86,7 @@ it("should throw an error if the child model doesn't exist", () => {
|
|
|
86
86
|
const Model = G(
|
|
87
87
|
BaseModel.extend({
|
|
88
88
|
children: { test: "DoesntExist" },
|
|
89
|
-
})
|
|
89
|
+
}),
|
|
90
90
|
);
|
|
91
91
|
|
|
92
92
|
expect(() => new Model()).toThrow();
|
|
@@ -97,7 +97,7 @@ it("should convert a url into a model", () => {
|
|
|
97
97
|
const Model = G(
|
|
98
98
|
BaseModel.extend({
|
|
99
99
|
children: { test: "TestModel" },
|
|
100
|
-
})
|
|
100
|
+
}),
|
|
101
101
|
);
|
|
102
102
|
const model = new Model({ test: "/api/tests/1/" });
|
|
103
103
|
expect(model.test.id).toEqual(1);
|
|
@@ -115,7 +115,7 @@ it("should convert an object into a model", () => {
|
|
|
115
115
|
const Model = G(
|
|
116
116
|
BaseModel.extend({
|
|
117
117
|
children: { test: "TestModel" },
|
|
118
|
-
})
|
|
118
|
+
}),
|
|
119
119
|
);
|
|
120
120
|
const model = new Model({ test: { id: 1 } });
|
|
121
121
|
expect(model.test.id).toEqual(1);
|
|
@@ -127,12 +127,12 @@ it("should replace collection strings with their registered state", () => {
|
|
|
127
127
|
BaseCollection.extend({
|
|
128
128
|
model: "TestModel",
|
|
129
129
|
}),
|
|
130
|
-
"TestCollection"
|
|
130
|
+
"TestCollection",
|
|
131
131
|
);
|
|
132
132
|
const Model = G(
|
|
133
133
|
BaseModel.extend({
|
|
134
134
|
collections: { tests: "TestCollection" },
|
|
135
|
-
})
|
|
135
|
+
}),
|
|
136
136
|
);
|
|
137
137
|
const model = new Model({
|
|
138
138
|
tests: [{ id: 1 }],
|
|
@@ -146,12 +146,12 @@ it("should allow a list of models to be passed into a collection", () => {
|
|
|
146
146
|
BaseCollection.extend({
|
|
147
147
|
model: "TestModel",
|
|
148
148
|
}),
|
|
149
|
-
"TestCollection"
|
|
149
|
+
"TestCollection",
|
|
150
150
|
);
|
|
151
151
|
const Model = G(
|
|
152
152
|
BaseModel.extend({
|
|
153
153
|
collections: { tests: "TestCollection" },
|
|
154
|
-
})
|
|
154
|
+
}),
|
|
155
155
|
);
|
|
156
156
|
const test = new TestModel({ id: 1 });
|
|
157
157
|
const model = new Model({
|
|
@@ -166,12 +166,12 @@ it("should allow a collection to be passed in directly", () => {
|
|
|
166
166
|
BaseCollection.extend({
|
|
167
167
|
model: "TestModel",
|
|
168
168
|
}),
|
|
169
|
-
"TestCollection"
|
|
169
|
+
"TestCollection",
|
|
170
170
|
);
|
|
171
171
|
const Model = G(
|
|
172
172
|
BaseModel.extend({
|
|
173
173
|
collections: { tests: "TestCollection" },
|
|
174
|
-
})
|
|
174
|
+
}),
|
|
175
175
|
);
|
|
176
176
|
const model = new Model({
|
|
177
177
|
tests: new TestCollection([{ id: 1 }]),
|
|
@@ -192,12 +192,12 @@ it("should convert a url into a collection", () => {
|
|
|
192
192
|
BaseCollection.extend({
|
|
193
193
|
model: "TestModel",
|
|
194
194
|
}),
|
|
195
|
-
"TestCollection"
|
|
195
|
+
"TestCollection",
|
|
196
196
|
);
|
|
197
197
|
const Model = G(
|
|
198
198
|
BaseModel.extend({
|
|
199
199
|
collections: { tests: "TestCollection" },
|
|
200
|
-
})
|
|
200
|
+
}),
|
|
201
201
|
);
|
|
202
202
|
const model = new Model({ tests: "/api/tests/" });
|
|
203
203
|
expect(model.tests).toBeInstanceOf(TestCollection);
|
|
@@ -209,7 +209,7 @@ it("should convert an array of objects into a collection", () => {
|
|
|
209
209
|
const Model = G(
|
|
210
210
|
BaseModel.extend({
|
|
211
211
|
collections: { tests: "TestCollection" },
|
|
212
|
-
})
|
|
212
|
+
}),
|
|
213
213
|
);
|
|
214
214
|
const model = new Model({
|
|
215
215
|
tests: [{ id: 1 }, { id: 2 }],
|
|
@@ -331,13 +331,13 @@ it("should pass through values into a derived collection", () => {
|
|
|
331
331
|
name: "string",
|
|
332
332
|
},
|
|
333
333
|
}),
|
|
334
|
-
"DerivedModel"
|
|
334
|
+
"DerivedModel",
|
|
335
335
|
);
|
|
336
336
|
|
|
337
337
|
const DerivedCollection = G(
|
|
338
338
|
BaseCollection.extend({
|
|
339
339
|
model: "DerivedModel",
|
|
340
|
-
})
|
|
340
|
+
}),
|
|
341
341
|
);
|
|
342
342
|
|
|
343
343
|
const TestModel = G(
|
|
@@ -351,7 +351,7 @@ it("should pass through values into a derived collection", () => {
|
|
|
351
351
|
},
|
|
352
352
|
},
|
|
353
353
|
}),
|
|
354
|
-
"TestModel"
|
|
354
|
+
"TestModel",
|
|
355
355
|
);
|
|
356
356
|
|
|
357
357
|
const model = new TestModel({
|