-
+
+
@@ -300,13 +228,13 @@ export default {
},
start: {
required,
- beforeEnd: (value, vm) => (value == null && vm.end != null ? false
- : new Date(value) <= new Date(vm.end)),
+ beforeEnd: (value, vm) =>
+ value == null && vm.end != null ? false : new Date(value) <= new Date(vm.end),
},
end: {
required,
- afterStart: (value, vm) => (value == null && vm.start != null ? false
- : new Date(value) >= new Date(vm.start)),
+ afterStart: (value, vm) =>
+ value == null && vm.start != null ? false : new Date(value) >= new Date(vm.start),
},
script_mode: {
required,
@@ -315,8 +243,10 @@ export default {
},
computed: {
currentShowLoaded() {
- return (this.$store.state.system.settings.current_show != null
- && this.$store.state.currentShow != null);
+ return (
+ this.$store.state.system.settings.current_show != null &&
+ this.$store.state.currentShow != null
+ );
},
...mapGetters(['SCRIPT_MODES']),
},
diff --git a/client/src/vue_components/config/ConfigUsers.vue b/client/src/vue_components/config/ConfigUsers.vue
index 2176e3e1..6d8fbd4f 100644
--- a/client/src/vue_components/config/ConfigUsers.vue
+++ b/client/src/vue_components/config/ConfigUsers.vue
@@ -1,23 +1,10 @@
-
+
-
+
-
- New User
-
+ New User
@@ -29,6 +16,14 @@
>
RBAC
+
+ Reset Password
+
+
+
+
+
+
+
-
-
-
-
@@ -70,25 +66,21 @@ import { mapActions, mapGetters } from 'vuex';
import CreateUser from '@/vue_components/user/CreateUser.vue';
import ConfigRbac from '@/vue_components/user/ConfigRbac.vue';
+import ResetPassword from '@/vue_components/user/ResetPassword.vue';
export default {
name: 'ConfigUsers',
- components: { CreateUser, ConfigRbac },
+ components: { CreateUser, ConfigRbac, ResetPassword },
data() {
return {
- userFields: [
- 'username',
- 'last_login',
- 'last_seen',
- 'is_admin',
- { key: 'btn', label: '' },
- ],
+ userFields: ['username', 'last_login', 'last_seen', 'is_admin', { key: 'btn', label: '' }],
editUser: null,
+ resetUser: null,
clientTimeout: null,
};
},
computed: {
- ...mapGetters(['SHOW_USERS', 'CURRENT_SHOW']),
+ ...mapGetters(['SHOW_USERS', 'CURRENT_SHOW', 'CURRENT_USER']),
},
async mounted() {
await this.getUsers();
@@ -103,6 +95,16 @@ export default {
setEditUser(userId) {
this.editUser = userId;
},
+ setResetUser(user) {
+ this.resetUser = user;
+ },
+ async handlePasswordReset() {
+ await this.getUsers();
+ },
+ closeResetPasswordModal() {
+ this.$bvModal.hide('reset-password');
+ this.resetUser = null;
+ },
async deleteUser(data) {
const msg = `Are you sure you want to delete ${data.item.username}?`;
const action = await this.$bvModal.msgBoxConfirm(msg, {});
diff --git a/client/src/vue_components/show/config/cast/CastLineStats.vue b/client/src/vue_components/show/config/cast/CastLineStats.vue
index bfbfc66a..658fe8d4 100644
--- a/client/src/vue_components/show/config/cast/CastLineStats.vue
+++ b/client/src/vue_components/show/config/cast/CastLineStats.vue
@@ -1,18 +1,9 @@
-
+
-
-
+
+
-
+
{{ scene.name }}
{{ CAST_BY_ID(data.item.Cast).first_name }} {{ CAST_BY_ID(data.item.Cast).last_name }}
-
-
+
+
{{ getLineCountForCast(data.item.Cast, scene.act, scene.id) }}
@@ -68,12 +51,14 @@
diff --git a/client/src/vue_components/show/config/characters/CharacterLineStats.vue b/client/src/vue_components/show/config/characters/CharacterLineStats.vue
index 50e7203c..87e8f14f 100644
--- a/client/src/vue_components/show/config/characters/CharacterLineStats.vue
+++ b/client/src/vue_components/show/config/characters/CharacterLineStats.vue
@@ -1,18 +1,9 @@
-
+
-
-
+
+
-
+
{{ scene.name }}
{{ CHARACTER_BY_ID(data.item.Character).name }}
-
+
@@ -68,12 +53,14 @@
diff --git a/client/src/vue_components/show/config/cues/CueCountStats.vue b/client/src/vue_components/show/config/cues/CueCountStats.vue
index a34f321c..df5277fb 100644
--- a/client/src/vue_components/show/config/cues/CueCountStats.vue
+++ b/client/src/vue_components/show/config/cues/CueCountStats.vue
@@ -1,18 +1,9 @@
-
+
-
-
+
+
-
+
{{ scene.name }}
{{ CUE_TYPE_BY_ID(data.item.CueType).prefix }}
-
-
+
+
{{ getCountForCueType(data.item.CueType, scene.act, scene.id) }}
@@ -68,12 +51,14 @@
diff --git a/client/src/vue_components/show/config/cues/CueEditor.vue b/client/src/vue_components/show/config/cues/CueEditor.vue
index 19637618..b1e3c8a4 100644
--- a/client/src/vue_components/show/config/cues/CueEditor.vue
+++ b/client/src/vue_components/show/config/cues/CueEditor.vue
@@ -1,60 +1,30 @@
-
+
-
- Go to Page
-
-
- Go to Cue
-
+ Go to Page
+ Go to Cue
-
-
+
+
Prev Page
Current Page: {{ currentEditPage }}
-
-
- Next Page
-
+
+ Next Page
-
- Cues
-
+ Cues
Script
-
+
@@ -116,12 +86,7 @@
@ok="goToPage"
>
-
+
-
+
This is a required field, and must be greater than 0.
@@ -196,10 +159,23 @@ export default {
}
return 'primary';
},
- ...mapGetters(['CURRENT_SHOW', 'ACT_LIST', 'SCENE_LIST', 'CHARACTER_LIST',
- 'CHARACTER_GROUP_LIST', 'CAN_REQUEST_EDIT', 'CURRENT_EDITOR', 'INTERNAL_UUID',
- 'GET_SCRIPT_PAGE', 'DEBUG_MODE_ENABLED', 'CUE_TYPES', 'SCRIPT_CUES', 'SCRIPT_CUTS',
- 'STAGE_DIRECTION_STYLES', 'STAGE_DIRECTION_STYLE_OVERRIDES', 'CURRENT_USER']),
+ ...mapGetters([
+ 'CURRENT_SHOW',
+ 'ACT_LIST',
+ 'SCENE_LIST',
+ 'CHARACTER_LIST',
+ 'CHARACTER_GROUP_LIST',
+ 'CAN_REQUEST_EDIT',
+ 'CURRENT_EDITOR',
+ 'INTERNAL_UUID',
+ 'GET_SCRIPT_PAGE',
+ 'CUE_TYPES',
+ 'SCRIPT_CUES',
+ 'SCRIPT_CUTS',
+ 'STAGE_DIRECTION_STYLES',
+ 'STAGE_DIRECTION_STYLE_OVERRIDES',
+ 'CURRENT_USER',
+ ]),
},
watch: {
currentEditPage(val) {
@@ -308,11 +284,25 @@ export default {
this.$bvModal.hide('jump-to-cue');
},
...mapMutations(['REMOVE_PAGE', 'ADD_BLANK_LINE', 'SET_LINE']),
- ...mapActions(['GET_SCENE_LIST', 'GET_ACT_LIST', 'GET_CHARACTER_LIST',
- 'GET_CHARACTER_GROUP_LIST', 'LOAD_SCRIPT_PAGE', 'ADD_BLANK_PAGE', 'GET_SCRIPT_CONFIG_STATUS',
- 'RESET_TO_SAVED', 'SAVE_NEW_PAGE', 'SAVE_CHANGED_PAGE', 'GET_CUE_TYPES', 'LOAD_CUES',
- 'GET_CUTS', 'GET_STAGE_DIRECTION_STYLES', 'GET_STAGE_DIRECTION_STYLE_OVERRIDES',
- 'GET_CUE_COLOUR_OVERRIDES', 'GET_CURRENT_USER']),
+ ...mapActions([
+ 'GET_SCENE_LIST',
+ 'GET_ACT_LIST',
+ 'GET_CHARACTER_LIST',
+ 'GET_CHARACTER_GROUP_LIST',
+ 'LOAD_SCRIPT_PAGE',
+ 'ADD_BLANK_PAGE',
+ 'GET_SCRIPT_CONFIG_STATUS',
+ 'RESET_TO_SAVED',
+ 'SAVE_NEW_PAGE',
+ 'SAVE_CHANGED_PAGE',
+ 'GET_CUE_TYPES',
+ 'LOAD_CUES',
+ 'GET_CUTS',
+ 'GET_STAGE_DIRECTION_STYLES',
+ 'GET_STAGE_DIRECTION_STYLE_OVERRIDES',
+ 'GET_CUE_COLOUR_OVERRIDES',
+ 'GET_CURRENT_USER',
+ ]),
},
};
diff --git a/client/src/vue_components/show/config/cues/JumpToCueModal.vue b/client/src/vue_components/show/config/cues/JumpToCueModal.vue
index 24fcc22d..38385937 100644
--- a/client/src/vue_components/show/config/cues/JumpToCueModal.vue
+++ b/client/src/vue_components/show/config/cues/JumpToCueModal.vue
@@ -12,11 +12,7 @@
@hidden="resetCueSearch"
>
-
+
-
+
{{ generalError }}
-
-
-
- Searching for cue...
-
+
-
Found {{ cueSearchResults.exact_matches.length }} cues matching "{{ cueSearchForm.identifier }}":
+
+ Found {{ cueSearchResults.exact_matches.length }} cues matching "{{
+ cueSearchForm.identifier
+ }}":
+
-
+
No exact match found for "{{ cueSearchForm.identifier }}"
Did you mean one of these?
@@ -105,10 +90,7 @@
>
{{ suggestion.cue_type.prefix }} {{ suggestion.cue.ident }}
- Page {{ suggestion.location.page }}
-
+
{{ Math.round(suggestion.similarity_score * 100) }}% match
@@ -117,31 +99,15 @@
-
+
No cues found matching "{{ cueSearchForm.identifier }}" for the selected cue type.
-
-
- New Search
-
-
- Cancel
-
+
+ New Search
+ Cancel
@@ -195,14 +161,14 @@ export default {
},
showSuggestions() {
return (
- this.cueSearchResults?.exact_matches?.length === 0
- && this.cueSearchResults?.suggestions?.length > 0
+ this.cueSearchResults?.exact_matches?.length === 0 &&
+ this.cueSearchResults?.suggestions?.length > 0
);
},
noMatches() {
return (
- this.cueSearchResults?.exact_matches?.length === 0
- && this.cueSearchResults?.suggestions?.length === 0
+ this.cueSearchResults?.exact_matches?.length === 0 &&
+ this.cueSearchResults?.suggestions?.length === 0
);
},
cueTypeErrorState() {
@@ -265,7 +231,7 @@ export default {
const targetPage = match.location.page;
this.$emit('navigate', targetPage);
Vue.$toast.success(
- `Jumped to ${match.cue_type.prefix} ${match.cue.ident} on page ${targetPage}`,
+ `Jumped to ${match.cue_type.prefix} ${match.cue.ident} on page ${targetPage}`
);
},
resetCueSearch() {
diff --git a/client/src/vue_components/show/config/cues/ScriptLineCueEditor.vue b/client/src/vue_components/show/config/cues/ScriptLineCueEditor.vue
index 26d35c4c..9884189e 100644
--- a/client/src/vue_components/show/config/cues/ScriptLineCueEditor.vue
+++ b/client/src/vue_components/show/config/cues/ScriptLineCueEditor.vue
@@ -1,30 +1,23 @@
-
-
+
+
- {{ actLabel }} - {{ sceneLabel }}
+ {{ actLabel }} - {{ sceneLabel }}
-
-
+
+
{{ cueLabel(cue) }}
@@ -43,33 +36,30 @@
- {{ characters.find((char) => (char.id === part.character_id)).name }}
+ {{ characters.find((char) => char.id === part.character_id).name }}
- {{ characterGroups.find((char) => (char.id === part.character_group_id)).name }}
+ {{ characterGroups.find((char) => char.id === part.character_group_id).name }}
{{ part.line_text }}
-
+
-
-
-
- Cue Line
-
+
+
+ Cue Line
-
-
-
- Spacing Line
-
+
+
+ Spacing Line
@@ -133,15 +101,8 @@
@hidden="resetNewForm"
@ok="onSubmitNew"
>
-
-
+
+
-
+
This is a required field.
-
+
-
+
This is a required field.
-
+
⚠️ A cue with this identifier already exists for this cue type
-
-
-
+
+
+
{{ line.line_parts[0].line_text | uppercase }}
{{ line.line_parts[0].line_text | lowercase }}
@@ -220,18 +176,18 @@
- {{ characters.find((char) => (char.id === part.character_id)).name }}
+ {{ characters.find((char) => char.id === part.character_id).name }}
- {{ characterGroups.find((char) => (char.id === part.character_group_id)).name }}
+ {{ characterGroups.find((char) => char.id === part.character_group_id).name }}
{{ part.line_text }}
@@ -251,15 +207,8 @@
@hidden="resetEditForm"
@ok="onSubmitEdit"
>
-
-
+
+
-
+
This is a required field.
-
+
-
+
This is a required field.
-
+
⚠️ A cue with this identifier already exists for this cue type
@@ -332,9 +270,11 @@ import { contrastColor } from 'contrast-color';
import log from 'loglevel';
import { LINE_TYPES } from '@/constants/lineTypes';
import { isWholeLineCut as isWholeLineCutUtil } from '@/js/scriptUtils';
+import scriptDisplayMixin from '@/mixins/scriptDisplayMixin';
export default {
name: 'ScriptLineCueEditor',
+ mixins: [scriptDisplayMixin],
props: {
line: {
required: true,
@@ -432,103 +372,98 @@ export default {
},
},
computed: {
- ...mapGetters(['IS_CUE_EDITOR', 'RBAC_ROLES', 'CURRENT_USER_RBAC', 'IS_ADMIN_USER', 'SCRIPT_CUES', 'CUE_COLOUR_OVERRIDES']),
+ ...mapGetters([
+ 'IS_CUE_EDITOR',
+ 'RBAC_ROLES',
+ 'CURRENT_USER_RBAC',
+ 'IS_ADMIN_USER',
+ 'SCRIPT_CUES',
+ 'CUE_COLOUR_OVERRIDES',
+ ]),
cueTypeOptions() {
if (this.IS_ADMIN_USER) {
return [
{ value: null, text: 'N/A' },
- ...this.cueTypes.map((cueType) => ({ value: cueType.id, text: `${cueType.prefix}: ${cueType.description}` })),
+ ...this.cueTypes.map((cueType) => ({
+ value: cueType.id,
+ text: `${cueType.prefix}: ${cueType.description}`,
+ })),
];
}
const writeMask = this.RBAC_ROLES.find((x) => x.key === 'WRITE').value;
-
- const allowableCueTypes = this.CURRENT_USER_RBAC.cuetypes.filter((x) => (x[1] & writeMask) !== 0).map((x) => x[0].id);
+
+ const allowableCueTypes = this.CURRENT_USER_RBAC.cuetypes
+ .filter((x) => (x[1] & writeMask) !== 0)
+ .map((x) => x[0].id);
return [
{ value: null, text: 'N/A' },
- ...this.cueTypes.filter((cueType) => allowableCueTypes.includes(cueType.id)).map((cueType) => ({ value: cueType.id, text: `${cueType.prefix}: ${cueType.description}` })),
+ ...this.cueTypes
+ .filter((cueType) => allowableCueTypes.includes(cueType.id))
+ .map((cueType) => ({
+ value: cueType.id,
+ text: `${cueType.prefix}: ${cueType.description}`,
+ })),
];
},
needsHeadings() {
const ret = [];
this.line.line_parts.forEach(function checkLinePartNeedsHeading(part) {
- if (this.previousLine == null
- || this.previousLine.line_parts.length !== this.line.line_parts.length) {
+ if (
+ this.previousLine == null ||
+ this.previousLine.line_parts.length !== this.line.line_parts.length
+ ) {
ret.push(true);
} else {
- const matchingIndex = this.previousLine.line_parts.find((prevPart) => (
- prevPart.part_index === part.part_index));
+ const matchingIndex = this.previousLine.line_parts.find(
+ (prevPart) => prevPart.part_index === part.part_index
+ );
if (matchingIndex == null) {
ret.push(true);
} else {
- ret.push(!(matchingIndex.character_id === part.character_id
- && matchingIndex.character_group_id === part.character_group_id));
+ ret.push(
+ !(
+ matchingIndex.character_id === part.character_id &&
+ matchingIndex.character_group_id === part.character_group_id
+ )
+ );
}
}
}, this);
return ret;
},
- needsHeadingsAny() {
- return this.needsHeadings.some((x) => (x === true));
- },
- needsActSceneLabel() {
+ needsActSceneLabelSimple() {
if (this.previousLine == null) {
return true;
}
- return !(this.previousLine.act_id === this.line.act_id
- && this.previousLine.scene_id === this.line.scene_id);
- },
- actLabel() {
- return this.acts.find((act) => (act.id === this.line.act_id)).name;
- },
- sceneLabel() {
- return this.scenes.find((scene) => (scene.id === this.line.scene_id)).name;
- },
- stageDirectionStyle() {
- const sdStyle = this.stageDirectionStyles.find(
- (style) => (style.id === this.line.stage_direction_style_id),
+ return !(
+ this.previousLine.act_id === this.line.act_id &&
+ this.previousLine.scene_id === this.line.scene_id
);
- const override = this.stageDirectionStyleOverrides
- .find((elem) => elem.settings.id === sdStyle.id);
- if (this.line.line_type === LINE_TYPES.STAGE_DIRECTION) {
- return override ? override.settings : sdStyle;
- }
- return null;
- },
- stageDirectionStyling() {
- if (this.line.stage_direction_style_id == null || this.stageDirectionStyle == null) {
- return {
- 'background-color': 'darkslateblue',
- 'font-style': 'italic',
- };
- }
- const style = {
- 'font-weight': this.stageDirectionStyle.bold ? 'bold' : 'normal',
- 'font-style': this.stageDirectionStyle.italic ? 'italic' : 'normal',
- 'text-decoration-line': this.stageDirectionStyle.underline ? 'underline' : 'none',
- color: this.stageDirectionStyle.text_colour,
- };
- if (this.stageDirectionStyle.enable_background_colour) {
- style['background-color'] = this.stageDirectionStyle.background_colour;
- }
- return style;
},
flatScriptCues() {
- return Object.keys(this.SCRIPT_CUES).map((key) => this.SCRIPT_CUES[key]).flat();
+ return Object.keys(this.SCRIPT_CUES)
+ .map((key) => this.SCRIPT_CUES[key])
+ .flat();
},
isDuplicateNewCue() {
if (this.newFormState.ident == null || this.newFormState.cueType == null) {
return false;
}
- return this.flatScriptCues.some((cue) => cue.cue_type_id === this.newFormState.cueType
- && cue.ident === this.newFormState.ident);
+ return this.flatScriptCues.some(
+ (cue) =>
+ cue.cue_type_id === this.newFormState.cueType && cue.ident === this.newFormState.ident
+ );
},
isDuplicateEditCue() {
if (this.editFormState.ident == null || this.editFormState.cueType == null) {
return false;
}
- return this.flatScriptCues.some((cue) => cue.cue_type_id === this.editFormState.cueType
- && cue.ident === this.editFormState.ident
- && cue.id !== this.editFormState.cueId);
+ return this.flatScriptCues.some(
+ (cue) =>
+ cue.cue_type_id === this.editFormState.cueType &&
+ cue.ident === this.editFormState.ident &&
+ cue.id !== this.editFormState.cueId
+ );
},
},
methods: {
@@ -644,7 +579,7 @@ export default {
}
},
cueLabel(cue) {
- const cueType = this.cueTypes.find((cT) => (cT.id === cue.cue_type_id));
+ const cueType = this.cueTypes.find((cT) => cT.id === cue.cue_type_id);
return `${cueType.prefix} ${cue.ident}`;
},
cueBackgroundColour(cue) {
@@ -668,17 +603,17 @@ export default {
diff --git a/client/src/vue_components/show/config/mics/MicAllocations.vue b/client/src/vue_components/show/config/mics/MicAllocations.vue
index 46f6cd31..5be645a5 100644
--- a/client/src/vue_components/show/config/mics/MicAllocations.vue
+++ b/client/src/vue_components/show/config/mics/MicAllocations.vue
@@ -1,8 +1,5 @@
-
+
-
+
-
+
-
- View
-
-
- Edit
-
+ View
+ Edit
@@ -123,26 +107,31 @@
-
+
{{ scene.name }}
- {{ CHARACTER_BY_ID(data.item.Character).name }}
+
+
+ {{ CHARACTER_BY_ID(data.item.Character).name }}
+
+
+
+
+
+
-
+
-
- N/A
-
+ N/A
-
+
{{ getTooltipText(data.item.Character, scene.id) }}
@@ -212,7 +198,7 @@ export default {
];
},
tableFields() {
- return ['Character', ...this.sortedScenes.map((scene) => (scene.id.toString()))];
+ return ['Character', ...this.sortedScenes.map((scene) => scene.id.toString())];
},
sortedActs() {
if (this.CURRENT_SHOW.first_act_id == null) {
@@ -254,9 +240,12 @@ export default {
if (!this.loaded) {
return [];
}
- return this.CHARACTER_LIST.map((character) => ({
- Character: character.id,
- }), this);
+ return this.CHARACTER_LIST.map(
+ (character) => ({
+ Character: character.id,
+ }),
+ this
+ );
},
allAllocations() {
const micData = {};
@@ -266,11 +255,13 @@ export default {
allocations.forEach((allocation) => {
sceneData[allocation.scene_id] = allocation.character_id;
});
- this.sortedScenes.map((scene) => (scene.id)).forEach((sceneId) => {
- if (!Object.keys(sceneData).includes(sceneId.toString())) {
- sceneData[sceneId] = null;
- }
- });
+ this.sortedScenes
+ .map((scene) => scene.id)
+ .forEach((sceneId) => {
+ if (!Object.keys(sceneData).includes(sceneId.toString())) {
+ sceneData[sceneId] = null;
+ }
+ });
micData[micId] = sceneData;
}, this);
return micData;
@@ -284,21 +275,25 @@ export default {
allocationByCharacter() {
const charData = {};
// Initialize with empty arrays for each character/scene combination
- this.CHARACTER_LIST.map((character) => (character.id)).forEach((characterId) => {
+ this.CHARACTER_LIST.map((character) => character.id).forEach((characterId) => {
const sceneData = {};
- this.sortedScenes.map((scene) => (scene.id)).forEach((sceneId) => {
- sceneData[sceneId] = [];
- });
+ this.sortedScenes
+ .map((scene) => scene.id)
+ .forEach((sceneId) => {
+ sceneData[sceneId] = [];
+ });
charData[characterId] = sceneData;
}, this);
// Collect all mics assigned to each character in each scene
Object.keys(this.MIC_ALLOCATIONS).forEach((micId) => {
- this.sortedScenes.map((scene) => (scene.id)).forEach((sceneId) => {
- if (this.allAllocations[micId][sceneId] != null) {
- const characterId = this.allAllocations[micId][sceneId];
- charData[characterId][sceneId].push(this.MICROPHONE_BY_ID(micId).name);
- }
- }, this);
+ this.sortedScenes
+ .map((scene) => scene.id)
+ .forEach((sceneId) => {
+ if (this.allAllocations[micId][sceneId] != null) {
+ const characterId = this.allAllocations[micId][sceneId];
+ charData[characterId][sceneId].push(this.MICROPHONE_BY_ID(micId).name);
+ }
+ }, this);
}, this);
// Convert arrays to comma-separated strings (or null if empty)
Object.keys(charData).forEach((characterId) => {
@@ -309,9 +304,19 @@ export default {
});
return charData;
},
- ...mapGetters(['MICROPHONES', 'CURRENT_SHOW', 'ACT_BY_ID', 'SCENE_BY_ID', 'CHARACTER_LIST',
- 'CHARACTER_BY_ID', 'MIC_ALLOCATIONS', 'MICROPHONE_BY_ID', 'IS_SHOW_EDITOR',
- 'CONFLICTS_BY_SCENE', 'CONFLICTS_BY_MIC']),
+ ...mapGetters([
+ 'MICROPHONES',
+ 'CURRENT_SHOW',
+ 'ACT_BY_ID',
+ 'SCENE_BY_ID',
+ 'CHARACTER_LIST',
+ 'CHARACTER_BY_ID',
+ 'MIC_ALLOCATIONS',
+ 'MICROPHONE_BY_ID',
+ 'IS_SHOW_EDITOR',
+ 'CONFLICTS_BY_SCENE',
+ 'CONFLICTS_BY_MIC',
+ ]),
},
async mounted() {
await this.resetToStoredAlloc();
@@ -378,13 +383,69 @@ export default {
}
// Check this mic isn't allocated to anyone else for this scene
- if (this.internalState[micId][sceneId] != null
- && this.internalState[micId][sceneId] !== characterId) {
+ if (
+ this.internalState[micId][sceneId] != null &&
+ this.internalState[micId][sceneId] !== characterId
+ ) {
return true;
}
return false;
},
+ micSelectAllDisabledForCharacter(micId, characterId) {
+ if (this.saving) {
+ return true;
+ }
+ // Check if this mic is used anywhere on another character
+ let canAssign = true;
+ this.sortedScenes.forEach((scene) => {
+ if (
+ this.internalState[micId][scene.id] != null &&
+ this.internalState[micId][scene.id] !== characterId
+ ) {
+ canAssign = false;
+ }
+ }, this);
+ if (!canAssign) {
+ return true;
+ }
+
+ // Check if the character already has a different mic assigned anywhere
+ this.MICROPHONES.forEach((otherMic) => {
+ if (otherMic.id !== micId) {
+ this.sortedScenes.forEach((scene) => {
+ if (this.internalState[otherMic.id][scene.id] === characterId) {
+ canAssign = false;
+ }
+ }, this);
+ }
+ }, this);
+ return !canAssign;
+ },
+ toggleSelectAllAllocation(micId, characterId) {
+ let allAssigned = true;
+ this.sortedScenes.forEach((scene) => {
+ if (this.internalState[micId][scene.id] !== characterId) {
+ allAssigned = false;
+ }
+ }, this);
+ this.sortedScenes.forEach((scene) => {
+ if (allAssigned) {
+ this.internalState[micId][scene.id] = null;
+ } else {
+ this.internalState[micId][scene.id] = characterId;
+ }
+ }, this);
+ },
+ micSelectedAllForCharacter(micId, characterId) {
+ let allAssigned = true;
+ this.sortedScenes.forEach((scene) => {
+ if (this.internalState[micId][scene.id] !== characterId) {
+ allAssigned = false;
+ }
+ }, this);
+ return allAssigned;
+ },
toggleAllocation(micId, sceneId, characterId) {
if (this.internalState[micId][sceneId] === characterId) {
this.internalState[micId][sceneId] = null;
@@ -406,8 +467,9 @@ export default {
}
// Find all conflicts where this scene is the "change INTO" scene for this character
- return allConflicts.filter((c) => c.adjacentSceneId === sceneId
- && c.adjacentCharacterId === characterId);
+ return allConflicts.filter(
+ (c) => c.adjacentSceneId === sceneId && c.adjacentCharacterId === characterId
+ );
},
getConflictClassForCell(characterId, sceneId) {
const conflicts = this.getConflictsForCell(characterId, sceneId);
@@ -455,8 +517,8 @@ export default {
+
diff --git a/client/src/vue_components/show/config/mics/MicList.vue b/client/src/vue_components/show/config/mics/MicList.vue
index 1b6e1cbf..e5625f94 100644
--- a/client/src/vue_components/show/config/mics/MicList.vue
+++ b/client/src/vue_components/show/config/mics/MicList.vue
@@ -13,23 +13,17 @@
v-if="IS_SHOW_EDITOR"
v-b-modal.new-microphone
variant="outline-success"
+ :disabled="disableButtons"
>
New Microphone
-
+
Edit
-
+
Delete
@@ -53,15 +47,8 @@
@hidden="resetNewMicrophoneForm"
@ok="onSubmitNewMicrophone"
>
-
-
+
+
-
+
This is a required field, and must be unique.
@@ -87,9 +72,7 @@
:state="validateNewMicrophone('description')"
aria-describedby="description-feedback"
/>
-
+
Something went wrong!
@@ -104,15 +87,8 @@
@hidden="resetEditMicrophoneForm"
@ok="onSubmitEditMicrophone"
>
-
-
+
+
-
+
This is a required field, and must be unique.
@@ -138,9 +112,7 @@
:state="validateEditMicrophone('description')"
aria-describedby="description-feedback"
/>
-
+
Something went wrong!
@@ -160,11 +132,12 @@ function isNameUnique(value) {
}
if (this.editMicrophoneForm.id != null) {
if (this.MICROPHONES != null && this.MICROPHONES.length > 0) {
- return !this.MICROPHONES.some((mic) => (
- mic.name === value && mic.id !== this.editMicrophoneForm.id));
+ return !this.MICROPHONES.some(
+ (mic) => mic.name === value && mic.id !== this.editMicrophoneForm.id
+ );
}
} else if (this.MICROPHONES != null && this.MICROPHONES.length > 0) {
- return !this.MICROPHONES.some((mic) => (mic.name === value));
+ return !this.MICROPHONES.some((mic) => mic.name === value);
}
return true;
}
@@ -173,11 +146,7 @@ export default {
name: 'MicList',
data() {
return {
- micFields: [
- 'name',
- 'description',
- { key: 'btn', label: '' },
- ],
+ micFields: ['name', 'description', { key: 'btn', label: '' }],
rowsPerPage: 15,
currentPage: 1,
newMicrophoneForm: {
@@ -200,19 +169,24 @@ export default {
required,
unique: isNameUnique,
},
- description: {
- },
+ description: {},
},
editMicrophoneForm: {
name: {
required,
unique: isNameUnique,
},
- description: {
- },
+ description: {},
},
},
computed: {
+ disableButtons() {
+ return (
+ this.isSubmittingNewMicrophone ||
+ this.isSubmittingEditMicrophone ||
+ this.isSubmittingDeleteMicrophone
+ );
+ },
...mapGetters(['MICROPHONES', 'IS_SHOW_EDITOR']),
},
methods: {
diff --git a/client/src/vue_components/show/config/mics/MicTimeline.vue b/client/src/vue_components/show/config/mics/MicTimeline.vue
index b3385ac4..67d487b7 100644
--- a/client/src/vue_components/show/config/mics/MicTimeline.vue
+++ b/client/src/vue_components/show/config/mics/MicTimeline.vue
@@ -1,15 +1,9 @@
-
+
-
+
@@ -49,30 +43,15 @@
-
+
No allocation data to display for this view
-