@livepreso/api 6.53.1 → 6.55.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/chunked-rush-logs/api.build.chunks.jsonl +2 -2
- package/.rush/temp/operation/build/all.log +2 -2
- package/.rush/temp/operation/build/error.log +1 -1
- package/.rush/temp/operation/build/log-chunks.jsonl +2 -2
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/shrinkwrap-deps.json +65 -15
- package/CHANGELOG.json +46 -0
- package/CHANGELOG.md +27 -1
- package/cjs/api.js +1 -1
- package/cjs/api.js.map +1 -1
- package/cjs/collections/auto-adjuncts.js +0 -22
- package/cjs/collections/auto-adjuncts.js.map +1 -1
- package/cjs/collections/cms-vals.js +25 -0
- package/cjs/collections/cms-vals.js.map +1 -1
- package/cjs/collections/cms-vals.spec.js +73 -0
- package/cjs/collections/cms-vals.spec.js.map +1 -0
- package/cjs/collections/deck-version-screenshots.js +0 -23
- package/cjs/collections/deck-version-screenshots.js.map +1 -1
- package/cjs/collections/scenarios.js +20 -0
- package/cjs/collections/scenarios.js.map +1 -0
- package/cjs/collections.js +11 -22
- package/cjs/collections.js.map +1 -1
- package/cjs/fixtures.js +18 -1
- package/cjs/fixtures.js.map +1 -1
- package/cjs/middlewares/base.js +1 -2
- package/cjs/middlewares/base.js.map +1 -1
- package/cjs/models/appointment.js +29 -8
- package/cjs/models/appointment.js.map +1 -1
- package/cjs/models/auto-adjunct.js +3 -2
- package/cjs/models/auto-adjunct.js.map +1 -1
- package/cjs/models/base.js +3 -1
- package/cjs/models/base.js.map +1 -1
- package/cjs/models/cms-val.js +3 -3
- package/cjs/models/cms-val.js.map +1 -1
- package/cjs/models/customer.js +2 -1
- package/cjs/models/customer.js.map +1 -1
- package/cjs/models/deck-layout.js +52 -0
- package/cjs/models/deck-layout.js.map +1 -0
- package/cjs/models/deck-version-screenshot.js +2 -2
- package/cjs/models/deck-version-screenshot.js.map +1 -1
- package/cjs/models/deck-version.js +43 -20
- package/cjs/models/deck-version.js.map +1 -1
- package/cjs/models/image.js +0 -2
- package/cjs/models/image.js.map +1 -1
- package/cjs/models/pack-diff.js +18 -9
- package/cjs/models/pack-diff.js.map +1 -1
- package/cjs/models/preset.js +8 -6
- package/cjs/models/preset.js.map +1 -1
- package/cjs/models/scenario.js +41 -0
- package/cjs/models/scenario.js.map +1 -0
- package/cjs/models/user.js +8 -3
- package/cjs/models/user.js.map +1 -1
- package/cjs/models.js +22 -0
- package/cjs/models.js.map +1 -1
- package/cjs/presentation/appointment-presentation.js +5 -3
- package/cjs/presentation/appointment-presentation.js.map +1 -1
- package/cjs/presentation/base-presentation-model.js +26 -23
- package/cjs/presentation/base-presentation-model.js.map +1 -1
- package/cjs/presentation/base-presentation-model.spec.js +21 -21
- package/cjs/presentation/base-presentation-model.spec.js.map +1 -1
- package/cjs/presentation/presentation-deck.js +6 -0
- package/cjs/presentation/presentation-deck.js.map +1 -1
- package/cjs/presentation/presentation-section.js +28 -3
- package/cjs/presentation/presentation-section.js.map +1 -1
- package/cjs/presentation/presentation-section.spec.js +16 -3
- package/cjs/presentation/presentation-section.spec.js.map +1 -1
- package/cjs/presentation/presentation-slide.js +25 -1
- package/cjs/presentation/presentation-slide.js.map +1 -1
- package/cjs/presentation/presentation-slide.spec.js +8 -1
- package/cjs/presentation/presentation-slide.spec.js.map +1 -1
- package/cjs/sync.js +17 -9
- package/cjs/sync.js.map +1 -1
- package/cjs/utils.js +12 -3
- package/cjs/utils.js.map +1 -1
- package/cjs/utils.spec.js +22 -0
- package/cjs/utils.spec.js.map +1 -1
- package/package.json +1 -1
- package/rush-logs/api.build.error.log +1 -1
- package/rush-logs/api.build.log +2 -2
- package/src/api.js +1 -1
- package/src/collections/auto-adjuncts.js +0 -22
- package/src/collections/cms-vals.js +28 -0
- package/src/collections/cms-vals.spec.js +66 -0
- package/src/collections/deck-version-screenshots.js +0 -22
- package/src/collections/scenarios.js +18 -0
- package/src/collections.js +1 -2
- package/src/fixtures.js +17 -1
- package/src/middlewares/base.js +1 -2
- package/src/models/appointment.js +32 -6
- package/src/models/auto-adjunct.js +3 -2
- package/src/models/base.js +3 -2
- package/src/models/cms-val.js +3 -3
- package/src/models/customer.js +1 -0
- package/src/models/deck-layout.js +54 -0
- package/src/models/deck-version-screenshot.js +2 -2
- package/src/models/deck-version.js +12 -14
- package/src/models/image.js +0 -3
- package/src/models/pack-diff.js +14 -9
- package/src/models/preset.js +8 -6
- package/src/models/scenario.js +39 -0
- package/src/models/user.js +8 -1
- package/src/models.js +2 -0
- package/src/presentation/appointment-presentation.js +7 -4
- package/src/presentation/base-presentation-model.js +29 -23
- package/src/presentation/base-presentation-model.spec.js +22 -22
- package/src/presentation/presentation-deck.js +6 -0
- package/src/presentation/presentation-section.js +26 -1
- package/src/presentation/presentation-section.spec.js +14 -1
- package/src/presentation/presentation-slide.js +24 -0
- package/src/presentation/presentation-slide.spec.js +7 -0
- package/src/sync.js +16 -12
- package/src/utils.js +13 -3
- package/src/utils.spec.js +27 -0
- package/cjs/collections/created-assets.js +0 -26
- package/cjs/collections/created-assets.js.map +0 -1
- package/cjs/collections/deleted-assets.js +0 -26
- package/cjs/collections/deleted-assets.js.map +0 -1
- package/src/collections/created-assets.js +0 -26
- package/src/collections/deleted-assets.js +0 -26
package/src/models/preset.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./user.js";
|
|
2
2
|
import "./deck.js";
|
|
3
3
|
import "./team.js";
|
|
4
|
+
import "./scenario.js";
|
|
4
5
|
|
|
5
6
|
import { BaseModel } from "./base.js";
|
|
6
7
|
import { register } from "../state-register.js";
|
|
@@ -36,13 +37,14 @@ export const PresetModel = BaseModel.extend(
|
|
|
36
37
|
/**
|
|
37
38
|
* @property {models.UserModel} user
|
|
38
39
|
* @property {models.DeckModel} deck
|
|
39
|
-
* @property {models.
|
|
40
|
+
* @property {models.TeamMode} team
|
|
41
|
+
* @property {models.ScenarioMode} keylist_scenario
|
|
40
42
|
*/
|
|
41
43
|
children: {
|
|
42
44
|
user: "UserModel",
|
|
43
45
|
deck: "DeckModel",
|
|
44
46
|
team: "TeamModel",
|
|
45
|
-
|
|
47
|
+
keylist_scenario: "ScenarioModel",
|
|
46
48
|
},
|
|
47
49
|
|
|
48
50
|
toServer() {
|
|
@@ -66,10 +68,10 @@ export const PresetModel = BaseModel.extend(
|
|
|
66
68
|
if (teamURL) {
|
|
67
69
|
data.team = teamURL;
|
|
68
70
|
}
|
|
69
|
-
const
|
|
71
|
+
const keylistScenarioURL = this._retrieveURL(this.keylist_scenario);
|
|
70
72
|
|
|
71
|
-
if (
|
|
72
|
-
data.
|
|
73
|
+
if (keylistScenarioURL) {
|
|
74
|
+
data.keylist_scenario = keylistScenarioURL;
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
return data;
|
|
@@ -79,6 +81,6 @@ export const PresetModel = BaseModel.extend(
|
|
|
79
81
|
|
|
80
82
|
PresetModel.USER_VISIBILITY = "__user__";
|
|
81
83
|
PresetModel.GLOBAL_VISIBILITY = "__global__";
|
|
82
|
-
PresetModel.
|
|
84
|
+
PresetModel.STANDARD_DECK = "__standard__";
|
|
83
85
|
|
|
84
86
|
register("PresetModel", PresetModel);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import "./team.js";
|
|
3
|
+
import "./deck.js";
|
|
4
|
+
|
|
5
|
+
import { register } from "../state-register.js";
|
|
6
|
+
import { BaseModel } from "../models/base.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @constructor
|
|
10
|
+
* @alias models.ScenarioModel
|
|
11
|
+
* @extends models.BaseModel
|
|
12
|
+
*/
|
|
13
|
+
export const ScenarioModel = BaseModel.extend(
|
|
14
|
+
/** @lends models.ScenarioModel# */ {
|
|
15
|
+
modelName: "scenarios",
|
|
16
|
+
detailType: "uuid",
|
|
17
|
+
|
|
18
|
+
props: {
|
|
19
|
+
name: "string",
|
|
20
|
+
must_use_with_preset_for_this_scenario: "boolean",
|
|
21
|
+
can_use_personal_presets: "boolean",
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @property {models.DeckModel} deck
|
|
26
|
+
* @property {models.TeamModel} owner_team
|
|
27
|
+
*/
|
|
28
|
+
children: {
|
|
29
|
+
deck: "DeckModel",
|
|
30
|
+
owner_team: "TeamModel",
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
toServer() {
|
|
34
|
+
return _.omit(this.serialize({ urlsOnly: true }), ["url"]);
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
register("ScenarioModel", ScenarioModel);
|
package/src/models/user.js
CHANGED
|
@@ -117,17 +117,23 @@ export const UserModel = BaseModel.extend(
|
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
const presomanager = {
|
|
120
|
+
// Can create or delete slides
|
|
120
121
|
isGlobalTemporarySlideManager:
|
|
121
122
|
this.actions.indexOf("Manage Temporary Slides") > -1,
|
|
122
123
|
isTeamTemporarySlideManager:
|
|
123
124
|
this.actions.indexOf("Manage Team Temporary Slides") > -1,
|
|
124
125
|
|
|
126
|
+
// Can update content within a slide (text, images, etc.)
|
|
127
|
+
isContentAdmin: this.actions.indexOf("Administer Content") > -1,
|
|
125
128
|
isTeamContentManager:
|
|
126
129
|
this.actions.indexOf("Manage Team Editable Text") > -1,
|
|
127
|
-
isContentCreator: this.actions.indexOf("Create Content") > -1,
|
|
128
130
|
|
|
129
131
|
canAddGlobalNotes: this.actions.indexOf("Manage Notes") > -1,
|
|
130
132
|
canAddTeamNotes: this.actions.indexOf("Manage Team Notes") > -1,
|
|
133
|
+
|
|
134
|
+
// This is someone that uses the CDK/publishes content, not someone
|
|
135
|
+
// that edits content.
|
|
136
|
+
isContentCreator: this.actions.indexOf("Create Content") > -1,
|
|
131
137
|
};
|
|
132
138
|
|
|
133
139
|
presomanager.canModifyNotes =
|
|
@@ -139,6 +145,7 @@ export const UserModel = BaseModel.extend(
|
|
|
139
145
|
|
|
140
146
|
presomanager.isPresoManagerUser =
|
|
141
147
|
presomanager.canModifyTemporarySlides ||
|
|
148
|
+
presomanager.canModifyNotes ||
|
|
142
149
|
presomanager.canModifyContent;
|
|
143
150
|
|
|
144
151
|
presomanager.canModifyContent =
|
package/src/models.js
CHANGED
|
@@ -21,6 +21,7 @@ export * from "./models/deck";
|
|
|
21
21
|
export * from "./models/deck-tags";
|
|
22
22
|
export * from "./models/deck-version";
|
|
23
23
|
export * from "./models/deck-version-screenshot";
|
|
24
|
+
export * from "./models/deck-layout";
|
|
24
25
|
export * from "./models/dispatch";
|
|
25
26
|
export * from "./models/dispatch-preview";
|
|
26
27
|
export * from "./models/envs.js";
|
|
@@ -42,6 +43,7 @@ export * from "./models/preset";
|
|
|
42
43
|
export * from "./models/refresh-request";
|
|
43
44
|
export * from "./models/room";
|
|
44
45
|
export * from "./models/salesforce-lookup.js";
|
|
46
|
+
export * from "./models/scenario";
|
|
45
47
|
export * from "./models/section";
|
|
46
48
|
export * from "./models/section-selection";
|
|
47
49
|
export * from "./models/signing-backend";
|
|
@@ -5,7 +5,7 @@ import "../models/user.js";
|
|
|
5
5
|
import "../collections/opportunities.js";
|
|
6
6
|
import "../collections/contacts.js";
|
|
7
7
|
|
|
8
|
-
import { AppointmentModel,
|
|
8
|
+
import { AppointmentModel, ScenarioModel } from "../models.js";
|
|
9
9
|
|
|
10
10
|
import { BaseModel } from "../models/base.js";
|
|
11
11
|
import { PresentationDeck } from "./presentation-deck.js";
|
|
@@ -59,16 +59,18 @@ export const AppointmentPresentation = BaseModel.extend(
|
|
|
59
59
|
|
|
60
60
|
const createFromAppointment = function (appointment, options) {
|
|
61
61
|
const appointmentPresentation = new AppointmentPresentation();
|
|
62
|
-
const
|
|
62
|
+
const scenario = appointment.scenario
|
|
63
|
+
? new ScenarioModel(appointment.scenario).id
|
|
64
|
+
: null;
|
|
63
65
|
|
|
64
66
|
// Note that we're not passing through tags if appointment.tags is empty.
|
|
65
67
|
// This is because tags currently aren't available in the telepresenter
|
|
66
68
|
// bundle and we want to fall back on the model tags for now.
|
|
67
69
|
appointmentPresentation.presentation.decks.add(
|
|
68
70
|
appointment.deckversion_set.map((model, index) => {
|
|
69
|
-
const screenshots = PresentationDeck.
|
|
71
|
+
const screenshots = PresentationDeck.filterScreenshotsByScenario(
|
|
70
72
|
model.screenshots,
|
|
71
|
-
|
|
73
|
+
scenario,
|
|
72
74
|
);
|
|
73
75
|
|
|
74
76
|
return PresentationDeck.createFromDeckVersion(model, {
|
|
@@ -80,6 +82,7 @@ const createFromAppointment = function (appointment, options) {
|
|
|
80
82
|
appointmentTags: appointment.tags.length ? appointment.tags : null,
|
|
81
83
|
screenshots,
|
|
82
84
|
index,
|
|
85
|
+
rootAssetPath: options?.rootAssetPath ?? null,
|
|
83
86
|
...options,
|
|
84
87
|
});
|
|
85
88
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModel } from "../models/base.js";
|
|
2
2
|
import { DeckVersionScreenshotCollection } from "../collections/deck-version-screenshots.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ScenarioModel } from "../models/scenario.js";
|
|
4
4
|
import _ from "lodash";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -24,7 +24,7 @@ BasePresentationModel.screenshotsToMap = function (screenshots) {
|
|
|
24
24
|
return screenshots.reduce((result, model) => {
|
|
25
25
|
if (result[model.subject]) {
|
|
26
26
|
throw new Error(`
|
|
27
|
-
Found multiple screenshots that could match this subject. If there is a
|
|
27
|
+
Found multiple screenshots that could match this subject. If there is a scenario
|
|
28
28
|
and a global, be sure to remove the screenshot that you don't need.
|
|
29
29
|
`);
|
|
30
30
|
}
|
|
@@ -50,52 +50,58 @@ BasePresentationModel.getThumbnail = function (model, screenshots) {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* Takes a list of screenshots and filters it to only be a list used by a single
|
|
53
|
+
* Takes a list of screenshots and filters it to only be a list used by a single scenario
|
|
54
54
|
* (or company wide).
|
|
55
55
|
*
|
|
56
56
|
* The logic should be like this:
|
|
57
57
|
*
|
|
58
|
-
* * If the
|
|
59
|
-
* * If we select a
|
|
60
|
-
*
|
|
61
|
-
* see the same global version. Obviously only one
|
|
58
|
+
* * If the scenario is null, we just return all global screenshots (scenario = null)
|
|
59
|
+
* * If we select a scenario, we take those global screenshots and replace any that have a
|
|
60
|
+
* scenario specific version of that screenshot. If none is found, the
|
|
61
|
+
* scenario will want to see the same global version. Obviously only one
|
|
62
|
+
* scenario's screenshots should be available.
|
|
62
63
|
*/
|
|
63
|
-
BasePresentationModel.
|
|
64
|
+
BasePresentationModel.filterScreenshotsByScenario = function (
|
|
64
65
|
_screenshots,
|
|
65
|
-
|
|
66
|
+
_scenario = null,
|
|
66
67
|
) {
|
|
67
68
|
const screenshots = new DeckVersionScreenshotCollection(_screenshots);
|
|
68
|
-
const
|
|
69
|
+
const scenario = _scenario ? new ScenarioModel({ id: _scenario }) : null;
|
|
69
70
|
|
|
70
71
|
const globalScreenshots = screenshots
|
|
71
|
-
.filter((screen) => screen.
|
|
72
|
+
.filter((screen) => screen.scenario === null)
|
|
72
73
|
.map((screen) => screen.toJSON());
|
|
73
74
|
|
|
74
75
|
const result = globalScreenshots;
|
|
75
76
|
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
.filter(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
if (scenario) {
|
|
78
|
+
const scenarioScreenshots = screenshots
|
|
79
|
+
.filter(
|
|
80
|
+
(screen) => screen.scenario && screen.scenario.url() === scenario.url(),
|
|
81
|
+
)
|
|
82
|
+
.map((screen) => ({
|
|
83
|
+
...screen.toJSON(),
|
|
84
|
+
scenario: screen.scenario.url(),
|
|
85
|
+
}));
|
|
86
|
+
|
|
87
|
+
for (const scenarioScreen of scenarioScreenshots) {
|
|
82
88
|
const existingGlobalIndex = _.findIndex(result, {
|
|
83
|
-
subject:
|
|
89
|
+
subject: scenarioScreen.subject,
|
|
84
90
|
});
|
|
85
91
|
|
|
86
92
|
if (existingGlobalIndex === -1) {
|
|
87
|
-
// If there isn't an existing global version, just add the
|
|
93
|
+
// If there isn't an existing global version, just add the scenario
|
|
88
94
|
// screenshot to the list
|
|
89
|
-
result.push(
|
|
95
|
+
result.push(scenarioScreen);
|
|
90
96
|
} else {
|
|
91
|
-
// Otherwise we should use the
|
|
92
|
-
result[existingGlobalIndex] =
|
|
97
|
+
// Otherwise we should use the scenario version instead of the global version
|
|
98
|
+
result[existingGlobalIndex] = scenarioScreen;
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
// Try to return it in the same order every time
|
|
98
|
-
const ordered = _.orderBy(result, ["
|
|
104
|
+
const ordered = _.orderBy(result, ["scenario", "subject"], ["desc", "asc"]);
|
|
99
105
|
return new DeckVersionScreenshotCollection(ordered);
|
|
100
106
|
};
|
|
101
107
|
|
|
@@ -229,38 +229,38 @@ describe("#getTags", () => {
|
|
|
229
229
|
});
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
-
describe("#
|
|
232
|
+
describe("#filterScreenshotsByScenario", () => {
|
|
233
233
|
const screenshots = new DeckVersionScreenshotCollection([
|
|
234
234
|
{
|
|
235
235
|
subject: "/api/slides/1/",
|
|
236
236
|
image_256: "global-screenshot-1.png",
|
|
237
|
-
|
|
237
|
+
scenario: null,
|
|
238
238
|
},
|
|
239
239
|
{
|
|
240
240
|
subject: "/api/slides/2/",
|
|
241
241
|
image_256: "global-screenshot-2.png",
|
|
242
|
-
|
|
242
|
+
scenario: null,
|
|
243
243
|
},
|
|
244
244
|
{
|
|
245
245
|
subject: "/api/slides/1/",
|
|
246
|
-
image_256: "
|
|
247
|
-
|
|
246
|
+
image_256: "scenario-1-screenshot.png",
|
|
247
|
+
scenario: "/api/scenarios/50465ccb-8887-4e1c-bb01-84c91a58c7ea/",
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
250
|
subject: "/api/sections/2/",
|
|
251
|
-
image_256: "
|
|
252
|
-
|
|
251
|
+
image_256: "scenario-1-screenshot.png",
|
|
252
|
+
scenario: "/api/scenarios/50465ccb-8887-4e1c-bb01-84c91a58c7ea/",
|
|
253
253
|
},
|
|
254
|
-
// Just for testing that the
|
|
254
|
+
// Just for testing that the scenario filters don't get cross-contaminated
|
|
255
255
|
{
|
|
256
256
|
subject: "/api/sections/2/",
|
|
257
|
-
image_256: "
|
|
258
|
-
|
|
257
|
+
image_256: "scenario-2-screenshot.png",
|
|
258
|
+
scenario: "/api/scenarios/9d35f335-efe7-4e5b-8365-f2afa229469d/",
|
|
259
259
|
},
|
|
260
260
|
]);
|
|
261
261
|
|
|
262
|
-
it("should just return global screenshots if
|
|
263
|
-
const filtered = BasePresentationModel.
|
|
262
|
+
it("should just return global screenshots if scenario is null", () => {
|
|
263
|
+
const filtered = BasePresentationModel.filterScreenshotsByScenario(
|
|
264
264
|
screenshots,
|
|
265
265
|
null,
|
|
266
266
|
).toJSON();
|
|
@@ -269,37 +269,37 @@ describe("#filterScreenshotsByTeam", () => {
|
|
|
269
269
|
{
|
|
270
270
|
subject: "/api/slides/1/",
|
|
271
271
|
image_256: "global-screenshot-1.png",
|
|
272
|
-
|
|
272
|
+
scenario: null,
|
|
273
273
|
},
|
|
274
274
|
{
|
|
275
275
|
subject: "/api/slides/2/",
|
|
276
276
|
image_256: "global-screenshot-2.png",
|
|
277
|
-
|
|
277
|
+
scenario: null,
|
|
278
278
|
},
|
|
279
279
|
]);
|
|
280
280
|
});
|
|
281
281
|
|
|
282
|
-
it("should return globals with
|
|
283
|
-
const filtered = BasePresentationModel.
|
|
282
|
+
it("should return globals with scenario override", () => {
|
|
283
|
+
const filtered = BasePresentationModel.filterScreenshotsByScenario(
|
|
284
284
|
screenshots,
|
|
285
|
-
|
|
285
|
+
"50465ccb-8887-4e1c-bb01-84c91a58c7ea",
|
|
286
286
|
).toJSON();
|
|
287
287
|
|
|
288
288
|
expect(filtered).toEqual([
|
|
289
289
|
{
|
|
290
290
|
image_256: "global-screenshot-2.png",
|
|
291
291
|
subject: "/api/slides/2/",
|
|
292
|
-
|
|
292
|
+
scenario: null,
|
|
293
293
|
},
|
|
294
294
|
{
|
|
295
|
-
image_256: "
|
|
295
|
+
image_256: "scenario-1-screenshot.png",
|
|
296
296
|
subject: "/api/sections/2/",
|
|
297
|
-
|
|
297
|
+
scenario: "/api/scenarios/50465ccb-8887-4e1c-bb01-84c91a58c7ea/",
|
|
298
298
|
},
|
|
299
299
|
{
|
|
300
|
-
image_256: "
|
|
300
|
+
image_256: "scenario-1-screenshot.png",
|
|
301
301
|
subject: "/api/slides/1/",
|
|
302
|
-
|
|
302
|
+
scenario: "/api/scenarios/50465ccb-8887-4e1c-bb01-84c91a58c7ea/",
|
|
303
303
|
},
|
|
304
304
|
]);
|
|
305
305
|
});
|
|
@@ -60,6 +60,9 @@ export const PresentationDeck = BasePresentationModel.extend(
|
|
|
60
60
|
title: "string",
|
|
61
61
|
usesImpostorSections: "boolean",
|
|
62
62
|
editable: "boolean",
|
|
63
|
+
titleEditable: "boolean",
|
|
64
|
+
notesEditable: "boolean",
|
|
65
|
+
tagsEditable: "boolean",
|
|
63
66
|
tags: "array",
|
|
64
67
|
version: "number",
|
|
65
68
|
namespacedKey: "string",
|
|
@@ -159,6 +162,9 @@ PresentationDeck.createFromDeckVersion = function (
|
|
|
159
162
|
common: deckVersionModel.manifest_json.common,
|
|
160
163
|
title: deckVersionModel.deck.title,
|
|
161
164
|
editable: tags.indexOf("editable") > -1,
|
|
165
|
+
titleEditable: false,
|
|
166
|
+
notesEditable: true,
|
|
167
|
+
tagsEditable: true,
|
|
162
168
|
tags,
|
|
163
169
|
version: deckVersionModel.version,
|
|
164
170
|
usesImpostorSections: isImpostorDeck(deckVersionModel),
|
|
@@ -49,7 +49,10 @@ export const PresentationSection = BasePresentationModel.extend(
|
|
|
49
49
|
* @property {boolean} visible
|
|
50
50
|
* @property {number} deckversion
|
|
51
51
|
* @property {number} selectionID
|
|
52
|
-
* @property {
|
|
52
|
+
* @property {bool} editable
|
|
53
|
+
* @property {bool} titleEditable
|
|
54
|
+
* @property {bool} notesEditable
|
|
55
|
+
* @property {bool} tagsEditable
|
|
53
56
|
* @property {array} tags
|
|
54
57
|
* @property {boolean} impostor
|
|
55
58
|
* @property {boolean} isWelcome
|
|
@@ -94,6 +97,9 @@ export const PresentationSection = BasePresentationModel.extend(
|
|
|
94
97
|
deckversion: "number",
|
|
95
98
|
selectionID: "number",
|
|
96
99
|
editable: "boolean",
|
|
100
|
+
titleEditable: "boolean",
|
|
101
|
+
notesEditable: "boolean",
|
|
102
|
+
tagsEditable: "boolean",
|
|
97
103
|
tags: "array",
|
|
98
104
|
impostor: "boolean",
|
|
99
105
|
isWelcome: {
|
|
@@ -226,6 +232,11 @@ PresentationSection.createFromSection = function (sectionModel, options = {}) {
|
|
|
226
232
|
title: sectionModel.title,
|
|
227
233
|
deckversion: sectionModel.deckversion.id,
|
|
228
234
|
editable: tags.indexOf("editable") > -1,
|
|
235
|
+
// By default this is true for a deck slide. These can be changed later in PM depending
|
|
236
|
+
// on the logged in user and properties of an AutoAdjunct
|
|
237
|
+
titleEditable: false,
|
|
238
|
+
notesEditable: true,
|
|
239
|
+
tagsEditable: true,
|
|
229
240
|
tags,
|
|
230
241
|
index: config.sequence,
|
|
231
242
|
sequence: config.sequence,
|
|
@@ -304,6 +315,9 @@ PresentationSection.createFromAdjunctSection = function (
|
|
|
304
315
|
title: adjunctSectionModel.title,
|
|
305
316
|
deckversion: deckVersionModel.id,
|
|
306
317
|
editable: false,
|
|
318
|
+
titleEditable: false,
|
|
319
|
+
notesEditable: true,
|
|
320
|
+
tagsEditable: true,
|
|
307
321
|
index: config.sequence,
|
|
308
322
|
sequence: config.sequence,
|
|
309
323
|
visible: config.visible,
|
|
@@ -404,6 +418,9 @@ PresentationSection.createFromImpostorSection = function (
|
|
|
404
418
|
title: slideModel.title,
|
|
405
419
|
deckversion: slideModel.section.deckversion.id,
|
|
406
420
|
editable: tags.indexOf("editable") > -1,
|
|
421
|
+
titleEditable: false,
|
|
422
|
+
notesEditable: true,
|
|
423
|
+
tagsEditable: true,
|
|
407
424
|
tags,
|
|
408
425
|
index: config.sequence,
|
|
409
426
|
sequence: config.sequence,
|
|
@@ -554,6 +571,10 @@ PresentationSection.createFromAutoAdjunct = function (model, opts = {}) {
|
|
|
554
571
|
tags,
|
|
555
572
|
cmsvalkey_set: autoAdjunct.cmsvalkey_set,
|
|
556
573
|
namespacedKey: autoAdjunct.namespaced_key,
|
|
574
|
+
editable: true,
|
|
575
|
+
titleEditable: true,
|
|
576
|
+
notesEditable: true,
|
|
577
|
+
tagsEditable: true,
|
|
557
578
|
});
|
|
558
579
|
|
|
559
580
|
if (autoAdjunct.template) {
|
|
@@ -608,6 +629,10 @@ PresentationSection.createFromTemplate = function (template, index, minID = 0) {
|
|
|
608
629
|
index,
|
|
609
630
|
cmsvalkey_set: [],
|
|
610
631
|
namespacedKey: templateModel.namespaced_key,
|
|
632
|
+
editable: false,
|
|
633
|
+
titleEditable: false,
|
|
634
|
+
notesEditable: true,
|
|
635
|
+
tagsEditable: true,
|
|
611
636
|
});
|
|
612
637
|
|
|
613
638
|
return presentationSection;
|
|
@@ -56,6 +56,9 @@ describe("#createFromSection", () => {
|
|
|
56
56
|
custom: false,
|
|
57
57
|
deckversion: 408,
|
|
58
58
|
editable: false,
|
|
59
|
+
titleEditable: false,
|
|
60
|
+
notesEditable: true,
|
|
61
|
+
tagsEditable: true,
|
|
59
62
|
html: "https://staging-test-cdn.salespreso.com/media/pack/409/assets/sections/agenda/index.html",
|
|
60
63
|
id: 1728,
|
|
61
64
|
impostor: false,
|
|
@@ -184,7 +187,6 @@ describe("#createFromAdjunctSection", () => {
|
|
|
184
187
|
createdByTemplate: false,
|
|
185
188
|
custom: false,
|
|
186
189
|
deckversion: 1,
|
|
187
|
-
editable: false,
|
|
188
190
|
id: 1,
|
|
189
191
|
image:
|
|
190
192
|
"https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png",
|
|
@@ -204,6 +206,10 @@ describe("#createFromAdjunctSection", () => {
|
|
|
204
206
|
url: "/api/adjunctsections/1737/",
|
|
205
207
|
visible: true,
|
|
206
208
|
cmsvalkey_set: [],
|
|
209
|
+
editable: false,
|
|
210
|
+
titleEditable: false,
|
|
211
|
+
notesEditable: true,
|
|
212
|
+
tagsEditable: true,
|
|
207
213
|
};
|
|
208
214
|
|
|
209
215
|
expect(presentationSection.toJSON()).toEqual(expected);
|
|
@@ -312,6 +318,9 @@ describe("#createFromImpostorSection", () => {
|
|
|
312
318
|
custom: false,
|
|
313
319
|
deckversion: 3,
|
|
314
320
|
editable: false,
|
|
321
|
+
titleEditable: false,
|
|
322
|
+
notesEditable: true,
|
|
323
|
+
tagsEditable: true,
|
|
315
324
|
html: "https://staging-test-cdn.salespreso.com/media/pack/427/assets/sections/test-deck/slides/agenda/index.html",
|
|
316
325
|
id: 23898,
|
|
317
326
|
impostor: true,
|
|
@@ -441,6 +450,10 @@ describe("#createFromAutoAdjunct", () => {
|
|
|
441
450
|
title: "Five",
|
|
442
451
|
url: "/api/adjunctsections/545/",
|
|
443
452
|
visible: true,
|
|
453
|
+
editable: true,
|
|
454
|
+
titleEditable: true,
|
|
455
|
+
tagsEditable: true,
|
|
456
|
+
notesEditable: true,
|
|
444
457
|
};
|
|
445
458
|
expect(presentationSection.toJSON()).toEqual(expected);
|
|
446
459
|
});
|
|
@@ -41,6 +41,9 @@ export const PresentationSlide = BasePresentationModel.extend(
|
|
|
41
41
|
* @property {string} thumbnail
|
|
42
42
|
* @property {number} selectionID
|
|
43
43
|
* @property {bool} editable
|
|
44
|
+
* @property {bool} titleEditable
|
|
45
|
+
* @property {bool} notesEditable
|
|
46
|
+
* @property {bool} tagsEditable
|
|
44
47
|
* @property {array} tags
|
|
45
48
|
* @property {string[]} cmsvalkey_set
|
|
46
49
|
*/
|
|
@@ -80,6 +83,9 @@ export const PresentationSlide = BasePresentationModel.extend(
|
|
|
80
83
|
thumbnail: "string",
|
|
81
84
|
selectionID: "number",
|
|
82
85
|
editable: "boolean",
|
|
86
|
+
titleEditable: "boolean",
|
|
87
|
+
notesEditable: "boolean",
|
|
88
|
+
tagsEditable: "boolean",
|
|
83
89
|
tags: "array",
|
|
84
90
|
cmsvalkey_set: "array",
|
|
85
91
|
},
|
|
@@ -170,6 +176,11 @@ PresentationSlide.createFromSlide = function (slideModel, options = {}) {
|
|
|
170
176
|
thumbnail: PresentationSlide.getThumbnail(slideModel, options.screenshots),
|
|
171
177
|
custom: false,
|
|
172
178
|
editable: tags.indexOf("editable") > -1,
|
|
179
|
+
// By default this is true for a deck slide. These can be changed later in PM depending
|
|
180
|
+
// on the logged in user and properties of an AutoAdjunct
|
|
181
|
+
titleEditable: false,
|
|
182
|
+
notesEditable: true,
|
|
183
|
+
tagsEditable: true,
|
|
173
184
|
title: slideModel.title,
|
|
174
185
|
section: slideModel.section.id,
|
|
175
186
|
sectionKey: slideModel.section.key,
|
|
@@ -358,6 +369,9 @@ PresentationSlide.createFromManifestJSON = function (
|
|
|
358
369
|
css: url2.resolve(manifestJSON.getAssetPath(key), "slide.css"),
|
|
359
370
|
key: slideKey,
|
|
360
371
|
editable: false,
|
|
372
|
+
titleEditable: false,
|
|
373
|
+
notesEditable: true,
|
|
374
|
+
tagsEditable: true,
|
|
361
375
|
sequence: manifestJSON.ordering[key],
|
|
362
376
|
thumbnail: null,
|
|
363
377
|
custom: false,
|
|
@@ -387,6 +401,9 @@ PresentationSlide.createFromManifestImpostor = function (
|
|
|
387
401
|
const presentationSlide = new PresentationSlide({
|
|
388
402
|
id: parseInt(_.uniqueId(), 10),
|
|
389
403
|
editable: slide.tags.indexOf("editable") !== -1,
|
|
404
|
+
titleEditable: false,
|
|
405
|
+
notesEditable: true,
|
|
406
|
+
tagsEditable: true,
|
|
390
407
|
thumbnail: null,
|
|
391
408
|
custom: false,
|
|
392
409
|
visible: true,
|
|
@@ -409,6 +426,9 @@ PresentationSlide.createFromTemplate = function (
|
|
|
409
426
|
...template,
|
|
410
427
|
id: minID + parseInt(_.uniqueId(), 10),
|
|
411
428
|
editable: false,
|
|
429
|
+
titleEditable: false,
|
|
430
|
+
notesEditable: false,
|
|
431
|
+
tagsEditable: false,
|
|
412
432
|
thumbnail: null,
|
|
413
433
|
custom: false,
|
|
414
434
|
visible: true,
|
|
@@ -479,6 +499,10 @@ PresentationSlide.createFromAutoAdjunct = function (model, opts = {}) {
|
|
|
479
499
|
tags,
|
|
480
500
|
cmsvalkey_set: autoAdjunct.cmsvalkey_set,
|
|
481
501
|
namespacedKey: autoAdjunct.namespaced_key,
|
|
502
|
+
editable: true,
|
|
503
|
+
titleEditable: true,
|
|
504
|
+
notesEditable: true,
|
|
505
|
+
tagsEditable: true,
|
|
482
506
|
});
|
|
483
507
|
|
|
484
508
|
if (autoAdjunct.template) {
|
|
@@ -46,6 +46,9 @@ describe("#createFromSlide", () => {
|
|
|
46
46
|
css: "https://staging-test-cdn.salespreso.com/media/pack/410/assets/sections/test-deck/slides/slide-key/slide.css",
|
|
47
47
|
custom: false,
|
|
48
48
|
editable: false,
|
|
49
|
+
titleEditable: false,
|
|
50
|
+
tagsEditable: true,
|
|
51
|
+
notesEditable: true,
|
|
49
52
|
html: "https://staging-test-cdn.salespreso.com/media/pack/410/assets/sections/test-deck/slides/slide-key/index.html",
|
|
50
53
|
id: 23219,
|
|
51
54
|
index: 13,
|
|
@@ -294,6 +297,10 @@ describe("#createFromAutoAdjunct", () => {
|
|
|
294
297
|
title: "Three",
|
|
295
298
|
url: "/api/adjunctslides/525/",
|
|
296
299
|
visible: true,
|
|
300
|
+
editable: true,
|
|
301
|
+
titleEditable: true,
|
|
302
|
+
notesEditable: true,
|
|
303
|
+
tagsEditable: true,
|
|
297
304
|
};
|
|
298
305
|
|
|
299
306
|
expect(presentationSlide.toJSON()).toEqual(expected);
|