Skip to content

Commit dc1d6f6

Browse files
authored
Merge pull request #690 from dreamteamprod/dev
Release 0.17.4
2 parents beb90db + c217f65 commit dc1d6f6

4 files changed

Lines changed: 50 additions & 4 deletions

File tree

client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "client",
3-
"version": "0.17.3",
3+
"version": "0.17.4",
44
"private": true,
55
"scripts": {
66
"build": "vite build",

client/src/views/show/ShowLiveView.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,12 @@
242242
>
243243
This is a required field.
244244
</b-form-invalid-feedback>
245+
<b-form-text
246+
v-if="isDuplicateCue"
247+
class="text-warning"
248+
>
249+
⚠️ A cue with this identifier already exists for this cue type
250+
</b-form-text>
245251
</b-form-group>
246252
</b-form>
247253
</b-modal>
@@ -386,6 +392,16 @@ export default {
386392
}, this);
387393
return count;
388394
},
395+
flatScriptCues() {
396+
return Object.keys(this.SCRIPT_CUES).map((key) => this.SCRIPT_CUES[key]).flat();
397+
},
398+
isDuplicateCue() {
399+
if (!this.newCueFormState.ident || !this.newCueFormState.cueType) {
400+
return false;
401+
}
402+
return this.flatScriptCues.some((cue) => cue.cue_type_id === this.newCueFormState.cueType
403+
&& cue.ident === this.newCueFormState.ident);
404+
},
389405
...mapGetters(['CURRENT_SHOW_SESSION', 'GET_SCRIPT_PAGE', 'ACT_LIST', 'SCENE_LIST',
390406
'CHARACTER_LIST', 'CHARACTER_GROUP_LIST', 'CURRENT_SHOW', 'CUE_TYPES', 'SCRIPT_CUES',
391407
'INTERNAL_UUID', 'SESSION_FOLLOW_DATA', 'SCRIPT_CUTS', 'SETTINGS', 'STAGE_DIRECTION_STYLES',

client/src/vue_components/show/config/cues/ScriptLineCueEditor.vue

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@
133133
>
134134
This is a required field.
135135
</b-form-invalid-feedback>
136+
<b-form-text
137+
v-if="isDuplicateNewCue"
138+
class="text-warning"
139+
>
140+
⚠️ A cue with this identifier already exists for this cue type
141+
</b-form-text>
136142
</b-form-group>
137143
</b-form>
138144
</b-modal>
@@ -182,6 +188,12 @@
182188
>
183189
This is a required field.
184190
</b-form-invalid-feedback>
191+
<b-form-text
192+
v-if="isDuplicateEditCue"
193+
class="text-warning"
194+
>
195+
⚠️ A cue with this identifier already exists for this cue type
196+
</b-form-text>
185197
</b-form-group>
186198
</b-form>
187199
<template #modal-footer="{ ok, cancel }">
@@ -308,7 +320,7 @@ export default {
308320
},
309321
},
310322
computed: {
311-
...mapGetters(['IS_CUE_EDITOR', 'RBAC_ROLES', 'CURRENT_USER_RBAC', 'IS_ADMIN_USER']),
323+
...mapGetters(['IS_CUE_EDITOR', 'RBAC_ROLES', 'CURRENT_USER_RBAC', 'IS_ADMIN_USER', 'SCRIPT_CUES']),
312324
cueTypeOptions() {
313325
if (this.IS_ADMIN_USER) {
314326
return [
@@ -385,6 +397,24 @@ export default {
385397
}
386398
return style;
387399
},
400+
flatScriptCues() {
401+
return Object.keys(this.SCRIPT_CUES).map((key) => this.SCRIPT_CUES[key]).flat();
402+
},
403+
isDuplicateNewCue() {
404+
if (this.newFormState.ident == null || this.newFormState.cueType == null) {
405+
return false;
406+
}
407+
return this.flatScriptCues.some((cue) => cue.cue_type_id === this.newFormState.cueType
408+
&& cue.ident === this.newFormState.ident);
409+
},
410+
isDuplicateEditCue() {
411+
if (this.editFormState.ident == null || this.editFormState.cueType == null) {
412+
return false;
413+
}
414+
return this.flatScriptCues.some((cue) => cue.cue_type_id === this.editFormState.cueType
415+
&& cue.ident === this.editFormState.ident
416+
&& cue.id !== this.editFormState.cueId);
417+
},
388418
},
389419
methods: {
390420
contrastColor,

0 commit comments

Comments
 (0)