@livepreso/api 6.42.1 → 6.43.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.
Files changed (117) hide show
  1. package/.rush/temp/build-cache-tar.log +7 -0
  2. package/.rush/temp/package-deps_build.json +151 -133
  3. package/.rush/temp/shrinkwrap-deps.json +189 -192
  4. package/CHANGELOG.json +12 -0
  5. package/CHANGELOG.md +8 -1
  6. package/api.build.log +10 -24
  7. package/babel.config.js +1 -1
  8. package/cjs/api.js +1 -1
  9. package/cjs/api.js.map +1 -1
  10. package/cjs/auth.js +2 -1
  11. package/cjs/auth.js.map +1 -1
  12. package/cjs/caching.js +3 -3
  13. package/cjs/collections/appointment-adjunct-tags.js +28 -0
  14. package/cjs/collections/appointment-adjunct-tags.js.map +1 -0
  15. package/cjs/collections/appointment-deckversion-tags.js +28 -0
  16. package/cjs/collections/appointment-deckversion-tags.js.map +1 -0
  17. package/cjs/collections/appointment-section-tags.js +28 -0
  18. package/cjs/collections/appointment-section-tags.js.map +1 -0
  19. package/cjs/collections/appointment-slide-tags.js +28 -0
  20. package/cjs/collections/appointment-slide-tags.js.map +1 -0
  21. package/cjs/collections/appointment-tags.js +208 -0
  22. package/cjs/collections/appointment-tags.js.map +1 -0
  23. package/cjs/collections/tags.js +28 -0
  24. package/cjs/collections/tags.js.map +1 -0
  25. package/cjs/collections.js +78 -0
  26. package/cjs/collections.js.map +1 -1
  27. package/cjs/models/appointment-adjunct-tags.js +52 -0
  28. package/cjs/models/appointment-adjunct-tags.js.map +1 -0
  29. package/cjs/models/appointment-deckversion-tags.js +52 -0
  30. package/cjs/models/appointment-deckversion-tags.js.map +1 -0
  31. package/cjs/models/appointment-section-tags.js +52 -0
  32. package/cjs/models/appointment-section-tags.js.map +1 -0
  33. package/cjs/models/appointment-slide-tags.js +52 -0
  34. package/cjs/models/appointment-slide-tags.js.map +1 -0
  35. package/cjs/models/appointment-tags.js +16 -15
  36. package/cjs/models/appointment-tags.js.map +1 -1
  37. package/cjs/models/appointment.js +8 -2
  38. package/cjs/models/appointment.js.map +1 -1
  39. package/cjs/models/deck-tags.js +61 -0
  40. package/cjs/models/deck-tags.js.map +1 -0
  41. package/cjs/models/deck-version.js +2 -0
  42. package/cjs/models/deck-version.js.map +1 -1
  43. package/cjs/models/deck.js +4 -1
  44. package/cjs/models/deck.js.map +1 -1
  45. package/cjs/models/manifest-json.js +47 -12
  46. package/cjs/models/manifest-json.js.map +1 -1
  47. package/cjs/models/preset.js +21 -1
  48. package/cjs/models/preset.js.map +1 -1
  49. package/cjs/models/tag.js +54 -0
  50. package/cjs/models/tag.js.map +1 -0
  51. package/cjs/models/user.js +2 -1
  52. package/cjs/models/user.js.map +1 -1
  53. package/cjs/models.js +78 -0
  54. package/cjs/models.js.map +1 -1
  55. package/cjs/presentation/appointment-presentation.js +5 -2
  56. package/cjs/presentation/appointment-presentation.js.map +1 -1
  57. package/cjs/presentation/base-presentation-model.js +56 -7
  58. package/cjs/presentation/base-presentation-model.js.map +1 -1
  59. package/cjs/presentation/base-presentation-model.spec.js +40 -6
  60. package/cjs/presentation/base-presentation-model.spec.js.map +1 -1
  61. package/cjs/presentation/presentation-deck.js +2 -1
  62. package/cjs/presentation/presentation-deck.js.map +1 -1
  63. package/cjs/presentation/presentation-section.js +21 -8
  64. package/cjs/presentation/presentation-section.js.map +1 -1
  65. package/cjs/presentation/presentation-section.spec.js +418 -0
  66. package/cjs/presentation/presentation-section.spec.js.map +1 -0
  67. package/cjs/presentation/presentation-slide.js +12 -4
  68. package/cjs/presentation/presentation-slide.js.map +1 -1
  69. package/cjs/presentation/presentation-slide.spec.js +294 -0
  70. package/cjs/presentation/presentation-slide.spec.js.map +1 -0
  71. package/cjs/presentation/presentation-subslide.js +5 -2
  72. package/cjs/presentation/presentation-subslide.js.map +1 -1
  73. package/cjs/presentation/presentation-subslide.spec.js +58 -12
  74. package/cjs/presentation/presentation-subslide.spec.js.map +1 -1
  75. package/cjs/presentation/presentation.js +13 -3
  76. package/cjs/presentation/presentation.js.map +1 -1
  77. package/cjs/state-register.js +11 -1
  78. package/cjs/state-register.js.map +1 -1
  79. package/cjs/sync.js +1 -1
  80. package/cjs/utils.js +5 -5
  81. package/config/rush-project.json +53 -0
  82. package/package.json +64 -66
  83. package/src/api.js +1 -1
  84. package/src/collections/appointment-adjunct-tags.js +18 -0
  85. package/src/collections/appointment-deckversion-tags.js +21 -0
  86. package/src/collections/appointment-section-tags.js +18 -0
  87. package/src/collections/appointment-slide-tags.js +18 -0
  88. package/src/collections/appointment-tags.js +136 -0
  89. package/src/collections/tags.js +18 -0
  90. package/src/collections.js +6 -0
  91. package/src/models/appointment-adjunct-tags.js +41 -0
  92. package/src/models/appointment-deckversion-tags.js +41 -0
  93. package/src/models/appointment-section-tags.js +41 -0
  94. package/src/models/appointment-slide-tags.js +41 -0
  95. package/src/models/appointment-tags.js +16 -14
  96. package/src/models/appointment.js +6 -1
  97. package/src/models/deck-tags.js +52 -0
  98. package/src/models/deck-version.js +2 -0
  99. package/src/models/deck.js +2 -0
  100. package/src/models/manifest-json.js +46 -7
  101. package/src/models/preset.js +19 -0
  102. package/src/models/tag.js +42 -0
  103. package/src/models/user.js +2 -0
  104. package/src/models.js +6 -0
  105. package/src/presentation/appointment-presentation.js +4 -1
  106. package/src/presentation/base-presentation-model.js +52 -7
  107. package/src/presentation/base-presentation-model.spec.js +44 -6
  108. package/src/presentation/presentation-deck.js +1 -0
  109. package/src/presentation/presentation-section.js +20 -9
  110. package/src/presentation/presentation-section.spec.js +363 -0
  111. package/src/presentation/presentation-slide.js +16 -3
  112. package/src/presentation/presentation-slide.spec.js +250 -0
  113. package/src/presentation/presentation-subslide.js +7 -2
  114. package/src/presentation/presentation-subslide.spec.js +32 -3
  115. package/src/presentation/presentation.js +15 -3
  116. package/src/state-register.js +7 -0
  117. package/api.build.error.log +0 -16
@@ -0,0 +1,136 @@
1
+ import { getState, register } from "../state-register.js";
2
+
3
+ import { BaseCollection } from "./base.js";
4
+ import _ from "lodash";
5
+
6
+ /**
7
+ * @constructor
8
+ * @alias collections.AppointmentTagsCollection
9
+ * @extends collections.BaseCollection
10
+ * @see models.AppointmentTagsModel
11
+ */
12
+ export const AppointmentTagsCollection = BaseCollection.extend(
13
+ /** @lends collections.AppointmentTagsCollection# */ {
14
+ model: "AppointmentTagsModel",
15
+
16
+ tagNameCollectionMapping: {
17
+ deckversion: "AppointmentDeckVersionTagsCollection",
18
+ section: "AppointmentSectionTagsCollection",
19
+ slide: "AppointmentSlideTagsCollection",
20
+ adjunct: "AppointmentAdjunctTagsCollection",
21
+ },
22
+
23
+ _mapResultsToModel(result) {
24
+ // Maps a model from a content specific tag to a more generic one.
25
+ // It's generally the same thing, except instead of something like:
26
+ //
27
+ // slide: "/api/slides/1/"
28
+ //
29
+ // It becomes:
30
+ //
31
+ // content_type: "slide",
32
+ // content_url: "/api/slides/1/"
33
+ //
34
+ // So that we can return the list side by side.
35
+ const AppointmentTagsModel = getState("AppointmentTagsModel");
36
+ const resultType = Object.keys(result).find((key) => {
37
+ return Object.keys(this.tagNameCollectionMapping).includes(key);
38
+ });
39
+ if (!resultType) {
40
+ throw new Error("Unknown type of result found");
41
+ }
42
+ return new AppointmentTagsModel({
43
+ tags: result.tags,
44
+ content_type: resultType,
45
+ content_url: result[resultType],
46
+ appointment: result.appointment,
47
+ user: result.user,
48
+ url: result.url,
49
+ });
50
+ },
51
+
52
+ // These methods don't quite make sense right now, disable it for development.
53
+ async fetchSet() {
54
+ throw new Error("Not implemented");
55
+ },
56
+
57
+ async fetchModels() {
58
+ throw new Error("Not implemented");
59
+ },
60
+
61
+ async delete() {
62
+ throw new Error("Cannot delete using this collection");
63
+ },
64
+
65
+ async save() {
66
+ throw new Error("Not implemented");
67
+ },
68
+
69
+ async fetch(options) {
70
+ const AppointmentModel = getState("AppointmentModel");
71
+
72
+ let hasAppointment =
73
+ this._options?.appointment instanceof AppointmentModel ||
74
+ options?.appointment instanceof AppointmentModel;
75
+
76
+ if (!hasAppointment && this.parent instanceof AppointmentModel) {
77
+ options.appointment = this.parent;
78
+ hasAppointment = true;
79
+ }
80
+
81
+ if (!hasAppointment) {
82
+ throw new Error(
83
+ "Requires an appointment model in collection options to fetch."
84
+ );
85
+ }
86
+
87
+ const tagModels = Object.values(this.tagNameCollectionMapping);
88
+ // Fetch all the separate tag models and combine them into a single collection
89
+ const results = (
90
+ await Promise.all(
91
+ tagModels.map((tagModel) => {
92
+ const Collection = getState(tagModel);
93
+ const tags = new Collection({}, this._options);
94
+ return tags.fetch(options);
95
+ })
96
+ )
97
+ )
98
+ .flatMap((collection) => collection.results)
99
+ .map(this._mapResultsToModel.bind(this));
100
+
101
+ this.add(results);
102
+
103
+ return {
104
+ count: results.length,
105
+ next: null,
106
+ previous: null,
107
+ results: this.toJSON(),
108
+ };
109
+ },
110
+
111
+ // Used by Telepresenter to add the tags in the hostedpreso bundle to
112
+ // the appointment tags collection
113
+ addFromAppointment(appointment) {
114
+ const tagCollectionNames = [
115
+ "appointmentdeckversiontags_set",
116
+ "appointmentsectiontags_set",
117
+ "appointmentslidetags_set",
118
+ "appointmentadjuncttags_set",
119
+ ];
120
+
121
+ // flatMap currently doesn't work in TelePresenter
122
+ const results = _.flatten(
123
+ tagCollectionNames.map((collectionName) => {
124
+ const collection = appointment[collectionName];
125
+ return collection?._data || [];
126
+ })
127
+ ).map(this._mapResultsToModel.bind(this));
128
+
129
+ this.add(results);
130
+ },
131
+ }
132
+ );
133
+
134
+ AppointmentTagsCollection.canBeEmpty = true;
135
+
136
+ register("AppointmentTagsCollection", AppointmentTagsCollection);
@@ -0,0 +1,18 @@
1
+ import "../models/tag.js";
2
+
3
+ import { BaseCollection } from "./base.js";
4
+ import { register } from "../state-register.js";
5
+
6
+ /**
7
+ * @constructor
8
+ * @alias collections.TagCollection
9
+ * @extends collections.BaseCollection
10
+ * @see models.TagModel
11
+ */
12
+ export const TagCollection = BaseCollection.extend(
13
+ /** @lends collections.TagCollection# */ {
14
+ model: "TagModel",
15
+ }
16
+ );
17
+
18
+ register("TagCollection", TagCollection);
@@ -36,5 +36,11 @@ export * from "./collections/users";
36
36
  export * from "./collections/uploads";
37
37
  export * from "./collections/appointment-editors.js";
38
38
  export * from "./collections/appointment-duplicates.js";
39
+ export * from "./collections/tags.js";
39
40
  export * from "./collections/teams.js";
40
41
  export * from "./collections/templates.js";
42
+ export * from "./collections/appointment-tags.js";
43
+ export * from "./collections/appointment-deckversion-tags.js";
44
+ export * from "./collections/appointment-section-tags.js";
45
+ export * from "./collections/appointment-slide-tags.js";
46
+ export * from "./collections/appointment-adjunct-tags.js";
@@ -0,0 +1,41 @@
1
+ import "./appointment.js";
2
+ import "./user.js";
3
+ import "./adjunct.js";
4
+
5
+ import { BaseModel } from "./base.js";
6
+ import { register } from "../state-register.js";
7
+
8
+ /**
9
+ * @constructor
10
+ * @alias models.AppointmentAdjunctTagsModel
11
+ * @extends models.BaseModel
12
+ */
13
+ export const AppointmentAdjunctTagsModel = BaseModel.extend(
14
+ /** @lends models.AppointmentAdjunctTagsModel# */ {
15
+ modelName: "appointment-adjunct-tags",
16
+
17
+ urlMatchKeys: {
18
+ "appointment.id": "number",
19
+ },
20
+
21
+ /**
22
+ * @property {string[]} tags
23
+ */
24
+ props: {
25
+ tags: "array",
26
+ },
27
+
28
+ /**
29
+ * @property {models.AppointmentModel} appointment
30
+ * @property {models.AdjunctModel} adjunct
31
+ * @property {models.UserModel} user
32
+ */
33
+ children: {
34
+ appointment: "AppointmentModel",
35
+ adjunct: "AdjunctModel",
36
+ user: "UserModel",
37
+ },
38
+ }
39
+ );
40
+
41
+ register("AppointmentAdjunctTagsModel", AppointmentAdjunctTagsModel);
@@ -0,0 +1,41 @@
1
+ import "./appointment.js";
2
+ import "./user.js";
3
+ import "./deck-version.js";
4
+
5
+ import { BaseModel } from "./base.js";
6
+ import { register } from "../state-register.js";
7
+
8
+ /**
9
+ * @constructor
10
+ * @alias models.AppointmentDeckVersionTagsModel
11
+ * @extends models.BaseModel
12
+ */
13
+ export const AppointmentDeckVersionTagsModel = BaseModel.extend(
14
+ /** @lends models.AppointmentDeckVersionTagsModel# */ {
15
+ modelName: "appointment-deckversion-tags",
16
+
17
+ urlMatchKeys: {
18
+ "appointment.id": "number",
19
+ },
20
+
21
+ /**
22
+ * @property {string[]} tags
23
+ */
24
+ props: {
25
+ tags: "array",
26
+ },
27
+
28
+ /**
29
+ * @property {models.AppointmentModel} appointment
30
+ * @property {models.DeckVersionModel} deckversion
31
+ * @property {models.UserModel} user
32
+ */
33
+ children: {
34
+ appointment: "AppointmentModel",
35
+ deckversion: "DeckVersionModel",
36
+ user: "UserModel",
37
+ },
38
+ }
39
+ );
40
+
41
+ register("AppointmentDeckVersionTagsModel", AppointmentDeckVersionTagsModel);
@@ -0,0 +1,41 @@
1
+ import "./appointment.js";
2
+ import "./user.js";
3
+ import "./slide.js";
4
+
5
+ import { BaseModel } from "./base.js";
6
+ import { register } from "../state-register.js";
7
+
8
+ /**
9
+ * @constructor
10
+ * @alias models.AppointmentSectionTagsModel
11
+ * @extends models.BaseModel
12
+ */
13
+ export const AppointmentSectionTagsModel = BaseModel.extend(
14
+ /** @lends models.AppointmentSectionTagsModel# */ {
15
+ modelName: "appointment-section-tags",
16
+
17
+ urlMatchKeys: {
18
+ "appointment.id": "number",
19
+ },
20
+
21
+ /**
22
+ * @property {string[]} tags
23
+ */
24
+ props: {
25
+ tags: "array",
26
+ },
27
+
28
+ /**
29
+ * @property {models.AppointmentModel} appointment
30
+ * @property {models.SectionModel} slide
31
+ * @property {models.UserModel} user
32
+ */
33
+ children: {
34
+ appointment: "AppointmentModel",
35
+ section: "SectionModel",
36
+ user: "UserModel",
37
+ },
38
+ }
39
+ );
40
+
41
+ register("AppointmentSectionTagsModel", AppointmentSectionTagsModel);
@@ -0,0 +1,41 @@
1
+ import "./appointment.js";
2
+ import "./user.js";
3
+ import "./slide.js";
4
+
5
+ import { BaseModel } from "./base.js";
6
+ import { register } from "../state-register.js";
7
+
8
+ /**
9
+ * @constructor
10
+ * @alias models.AppointmentSlideTagsModel
11
+ * @extends models.BaseModel
12
+ */
13
+ export const AppointmentSlideTagsModel = BaseModel.extend(
14
+ /** @lends models.AppointmentSlideTagsModel# */ {
15
+ modelName: "appointment-slide-tags",
16
+
17
+ urlMatchKeys: {
18
+ "appointment.id": "number",
19
+ },
20
+
21
+ /**
22
+ * @property {string[]} tags
23
+ */
24
+ props: {
25
+ tags: "array",
26
+ },
27
+
28
+ /**
29
+ * @property {models.AppointmentModel} appointment
30
+ * @property {models.SlideModel} slide
31
+ * @property {models.UserModel} user
32
+ */
33
+ children: {
34
+ appointment: "AppointmentModel",
35
+ slide: "SlideModel",
36
+ user: "UserModel",
37
+ },
38
+ }
39
+ );
40
+
41
+ register("AppointmentSlideTagsModel", AppointmentSlideTagsModel);
@@ -8,26 +8,28 @@ import { register } from "../state-register.js";
8
8
  */
9
9
  export const AppointmentTagsModel = BaseModel.extend(
10
10
  /** @lends models.AppointmentTagsModel# */ {
11
- modelName: "appointment-tags",
11
+ urlMatchKeys: {
12
+ "appointment.id": "number",
13
+ },
12
14
 
13
15
  /**
14
- * @property {object} tags
16
+ * @property {string[]} tags
17
+ * @property {string} content_type
18
+ * @property {string} content_url
15
19
  */
16
20
  props: {
17
- items: "object",
18
- },
19
-
20
- url() {
21
- if (this.parent && this.parent.modelName === "appointments") {
22
- return this.getFullURLPath(`${this.parent.getPlainURL()}tags/`);
23
- }
24
- return BaseModel.prototype.url.call(this);
21
+ tags: "array",
22
+ content_type: "string",
23
+ content_url: "string",
25
24
  },
26
25
 
27
- fetch() {
28
- return BaseModel.prototype.fetch.call(this).tap((tags) => {
29
- this.items = tags;
30
- });
26
+ /**
27
+ * @property {models.AppointmentModel} appointment
28
+ * @property {models.UserModel} user
29
+ */
30
+ children: {
31
+ appointment: "AppointmentModel",
32
+ user: "UserModel",
31
33
  },
32
34
  }
33
35
  );
@@ -14,6 +14,7 @@ import "../collections/section-selections.js";
14
14
  import "../collections/slide-selections.js";
15
15
  import "../collections/dispatches.js";
16
16
  import "../collections/users.js";
17
+ import "../collections/appointment-tags";
17
18
 
18
19
  import { AdjunctSectionCollection } from "../collections/adjunct-sections.js";
19
20
  import { AdjunctSlideCollection } from "../collections/adjunct-slides.js";
@@ -94,6 +95,11 @@ export const AppointmentModel = BaseModel.extend(
94
95
  appointmentsslide_set: "SlideSelectionCollection",
95
96
  dispatch_set: "DispatchCollection",
96
97
  current_editor_set: "UserCollection",
98
+ tags: "AppointmentTagsCollection",
99
+ appointmentdeckversiontags_set: "AppointmentDeckVersionTagsCollection",
100
+ appointmentsectiontags_set: "AppointmentSectionTagsCollection",
101
+ appointmentslidetags_set: "AppointmentSlideTagsCollection",
102
+ appointmentadjuncttags_set: "AppointmentAdjunctTagsCollection",
97
103
  },
98
104
 
99
105
  /**
@@ -109,7 +115,6 @@ export const AppointmentModel = BaseModel.extend(
109
115
  user: "UserModel",
110
116
  latest_tele: "HostedPresoModel",
111
117
  stats: "AppointmentStatsModel",
112
- tags: "AppointmentTagsModel",
113
118
  team: "TeamModel",
114
119
  },
115
120
 
@@ -0,0 +1,52 @@
1
+ import { BaseModel } from "./base.js";
2
+ import { register } from "../state-register.js";
3
+
4
+ /**
5
+ * @constructor
6
+ * @alias models.DeckTagsModel
7
+ * @extends models.BaseModel
8
+ */
9
+ export const DeckTagsModel = BaseModel.extend(
10
+ /** @lends models.DeckTagsModel# */ {
11
+ modelName: "deck-tags",
12
+
13
+ /**
14
+ * @property {object} items
15
+ */
16
+ props: {
17
+ items: "object",
18
+ },
19
+
20
+ url() {
21
+ if (this.parent && this.parent.modelName === "decks") {
22
+ return this.getFullURLPath(`${this.parent.getPlainURL()}tags/`);
23
+ }
24
+ return BaseModel.prototype.url.call(this);
25
+ },
26
+
27
+ fetch(opts) {
28
+ return BaseModel.prototype.fetch.call(this, opts).tap((tags) => {
29
+ this.items = tags;
30
+ });
31
+ },
32
+
33
+ isNew() {
34
+ // Force deck-tags to always use PUT.
35
+ return false;
36
+ },
37
+
38
+ toServer() {
39
+ return this.items;
40
+ },
41
+
42
+ save() {
43
+ return BaseModel.prototype.save.call(this).tap((tags) => {
44
+ this.items = tags;
45
+ });
46
+ },
47
+ }
48
+ );
49
+
50
+ DeckTagsModel.canBeEmpty = true;
51
+
52
+ register("DeckTagsModel", DeckTagsModel);
@@ -37,6 +37,7 @@ export const DeckVersionModel = BaseModel.extend(
37
37
  * @property {string} upgrade_description
38
38
  * @property {string} friendly_release_notes
39
39
  * @property {boolean} has_editable_share_support
40
+ * @property {string} point_in_time_share_policy
40
41
  * @property {string[]} tags
41
42
  */
42
43
  props: {
@@ -56,6 +57,7 @@ export const DeckVersionModel = BaseModel.extend(
56
57
  upgrade_description: "string",
57
58
  friendly_release_notes: "string",
58
59
  has_editable_share_support: "boolean",
60
+ point_in_time_share_policy: "string",
59
61
  tags: "array",
60
62
  },
61
63
 
@@ -1,3 +1,4 @@
1
+ import "./deck-tags.js";
1
2
  import "./deck-version.js";
2
3
 
3
4
  import { BaseModel } from "./base.js";
@@ -53,6 +54,7 @@ export const DeckModel = BaseModel.extend(
53
54
  children: {
54
55
  approved_version: "DeckVersionModel",
55
56
  head_version: "DeckVersionModel",
57
+ tags: "DeckTagsModel",
56
58
  },
57
59
  }
58
60
  );
@@ -77,6 +77,9 @@ export const ManifestJSONModel = BaseModel.extend(
77
77
  type: "boolean",
78
78
  default: false,
79
79
  },
80
+ point_in_time_share_policy: {
81
+ type: "string",
82
+ },
80
83
  notify_salesperson_after_feeds_fetched: {
81
84
  type: "boolean",
82
85
  default: false,
@@ -147,6 +150,41 @@ export const ManifestJSONModel = BaseModel.extend(
147
150
  * object.
148
151
  */
149
152
  ManifestJSONModel.createFromProject = function (projectFile) {
153
+ // If the deck is an impostor deck, we have to update some things for
154
+ // them to make sense in the impostor format
155
+ if (projectFile.impostor) {
156
+ // There is only one real section; all of the "sections" defined in the
157
+ // project.yaml are actually slides, and slides can't have a maxAdjunctSlides
158
+ // value. We get around this by totalling up all of the maxAdjunctSlides values
159
+ // across the sections and give that number to the real section. Later e.g. in the
160
+ // app, that number will be taken and divided by the number of impostor sections
161
+ // to get the maxAdjunctSlides value for each impostor section
162
+ const maxAdjunctSlides = projectFile.sections.reduce((num, section) => {
163
+ return num + (section.maxAdjunctSlides || 0);
164
+ }, 0);
165
+
166
+ // Create a "real" section (that will never be seen by the user) and give
167
+ // it all of the sections & slides. Impostor sections (which are technically
168
+ // slides) are given the "section-header" tag to mark them as sections
169
+ projectFile.sections = [
170
+ {
171
+ maxAdjunctSlides,
172
+ key: projectFile.key,
173
+ title: projectFile.name,
174
+ slides: projectFile.sections.reduce((sections, section) => {
175
+ const newSection = {
176
+ ...section,
177
+ slides: [],
178
+ };
179
+ newSection.tags = ["section-header"].concat(newSection.tags || []);
180
+
181
+ sections.push(newSection, ...(section.slides || []));
182
+ return sections;
183
+ }, []),
184
+ },
185
+ ];
186
+ }
187
+
150
188
  const titles = projectFile.sections.reduce((titles, section) => {
151
189
  titles[section.key] = section.title;
152
190
  for (const slide of section.slides || []) {
@@ -186,13 +224,9 @@ ManifestJSONModel.createFromProject = function (projectFile) {
186
224
  }, {});
187
225
 
188
226
  const tags = projectFile.sections.reduce((tags, section) => {
189
- if (section.tags) {
190
- tags[section.key] = section.tags;
191
- }
227
+ tags[section.key] = section.tags || [];
192
228
  for (const slide of section.slides || []) {
193
- if (slide.tags) {
194
- tags[`${section.key}/${slide.key}`] = slide.tags;
195
- }
229
+ tags[`${section.key}/${slide.key}`] = slide.tags || [];
196
230
  }
197
231
  return tags;
198
232
  }, {});
@@ -203,7 +237,7 @@ ManifestJSONModel.createFromProject = function (projectFile) {
203
237
  if (projectFile.welcome.tags) {
204
238
  // It's convention to use an empty string for the
205
239
  // Welcome slide's key
206
- tags[""] = projectFile.welcome.tags;
240
+ tags[""] = projectFile.welcome.tags || [];
207
241
  }
208
242
  }
209
243
 
@@ -249,6 +283,11 @@ ManifestJSONModel.createFromProject = function (projectFile) {
249
283
  projectFile.has_editable_share_support;
250
284
  }
251
285
 
286
+ if (projectFile.point_in_time_share_policy) {
287
+ manifest.point_in_time_share_policy =
288
+ projectFile.point_in_time_share_policy;
289
+ }
290
+
252
291
  if (projectFile.notify_salesperson_after_feeds_fetched) {
253
292
  manifest.notify_salesperson_after_feeds_fetched =
254
293
  projectFile.notify_salesperson_after_feeds_fetched;
@@ -1,5 +1,6 @@
1
1
  import "./user.js";
2
2
  import "./deck.js";
3
+ import "./team.js";
3
4
 
4
5
  import { BaseModel } from "./base.js";
5
6
  import { register } from "../state-register.js";
@@ -32,10 +33,13 @@ export const PresetModel = BaseModel.extend(
32
33
  /**
33
34
  * @property {models.UserModel} user
34
35
  * @property {models.DeckModel} deck
36
+ * @property {models.TeamModel} team
35
37
  */
36
38
  children: {
37
39
  user: "UserModel",
38
40
  deck: "DeckModel",
41
+ team: "TeamModel",
42
+ keylist_team: "TeamModel",
39
43
  },
40
44
 
41
45
  toServer() {
@@ -54,9 +58,24 @@ export const PresetModel = BaseModel.extend(
54
58
  data.id = this.id;
55
59
  }
56
60
 
61
+ const teamURL = this._retrieveURL(this.team);
62
+
63
+ if (teamURL) {
64
+ data.team = teamURL;
65
+ }
66
+ const keylistTeamURL = this._retrieveURL(this.keylist_team);
67
+
68
+ if (keylistTeamURL) {
69
+ data.keylist_team = keylistTeamURL;
70
+ }
71
+
57
72
  return data;
58
73
  },
59
74
  }
60
75
  );
61
76
 
77
+ PresetModel.USER_VISIBILITY = "__user__";
78
+ PresetModel.GLOBAL_VISIBILITY = "__global__";
79
+ PresetModel.STANDARD_SLIDE_SOURCE = "__standard__";
80
+
62
81
  register("PresetModel", PresetModel);
@@ -0,0 +1,42 @@
1
+ import "./user.js";
2
+ import "./team.js";
3
+ import "./deck.js";
4
+
5
+ import { BaseModel } from "./base.js";
6
+ import { register } from "../state-register.js";
7
+
8
+ /**
9
+ * @constructor
10
+ * @alias models.TagModel
11
+ * @extends models.BaseModel
12
+ */
13
+ export const TagModel = BaseModel.extend(
14
+ /** @lends models.TagModel# */ {
15
+ modelName: "tags",
16
+
17
+ /**
18
+ * @property {string} scope
19
+ * @property {string} key
20
+ * @property {string} description
21
+ */
22
+ props: {
23
+ scope: "string",
24
+ key: "string",
25
+ description: "string",
26
+ visible: "boolean",
27
+ },
28
+
29
+ /**
30
+ * @property {models.UserModel} user
31
+ * @property {models.TeamModel} team
32
+ * @property {models.DeckModel} deck
33
+ */
34
+ children: {
35
+ user: "UserModel",
36
+ team: "TeamModel",
37
+ deck: "DeckModel",
38
+ },
39
+ }
40
+ );
41
+
42
+ register("TagModel", TagModel);
@@ -109,6 +109,8 @@ export const UserModel = BaseModel.extend(
109
109
  const presets = {
110
110
  canCreateCompanyPresets:
111
111
  this.actions.indexOf("Manage Deck Presets") > -1,
112
+ canCreateTeamPresets:
113
+ this.actions.indexOf("Manage Team Presets") > -1,
112
114
  };
113
115
 
114
116
  const presomanager = {