Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions client-v3/e2e/tests/12-show-config-sessions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Show Config — Sessions tab: session tags CRUD.
* Note: actual session start/stop is tested in 13-live-show.spec.ts.
* Show Config — Sessions tab: session start via the tab button + session tags CRUD.
* Spec 13 covers session start/stop via the navbar.
*/
import { test, expect, type BrowserContext, type Page } from '@playwright/test';
import {
Expand Down Expand Up @@ -73,3 +73,25 @@ test('deletes a session tag', async () => {
timeout: 5_000,
});
});

// ── Session start via the tab button ─────────────────────────────────────

test('switches back to Sessions sub-tab', async () => {
await page.click('button[role="tab"]:has-text("Sessions")');
await expect(page.locator('button.btn-success:has-text("Start Session")')).toBeVisible({
timeout: 10_000,
});
});

test('starts a session via the Sessions tab Start button', async () => {
await page.click('button.btn-success:has-text("Start Session")');
// START_SHOW WS message pushes all clients to /live
await page.waitForURL(`${UI_BASE}/live`, { timeout: 10_000 });
});

test('stops the session via the navbar to restore state for later specs', async () => {
await page.locator('text=Live Config').click();
await page.click('button:has-text("Stop Session")');
await confirmDialog(page);
await expect(page.locator('a:has-text("Live")')).toHaveClass(/disabled/, { timeout: 10_000 });
});
4 changes: 2 additions & 2 deletions client-v3/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client-v3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client-v3",
"version": "0.30.4",
"version": "0.30.5",
"description": "DigiScript front end (Vue 3)",
"author": "DreamTeamProd",
"private": true,
Expand Down
52 changes: 18 additions & 34 deletions client-v3/src/components/show/config/sessions/SessionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@
<BContainer class="mx-0" fluid>
<BRow v-if="systemStore.isShowExecutor" style="margin-bottom: 0.5rem">
<BCol class="text-start ps-0">
<BButtonGroup>
<BButton
variant="success"
:disabled="systemStore.currentShow?.current_session_id !== null || startingSession"
@click.stop="startSession"
>
Start Session
</BButton>
<BButton
variant="danger"
:disabled="systemStore.currentShow?.current_session_id === null || stoppingSession"
@click.stop="stopSession"
>
Stop Session
</BButton>
</BButtonGroup>
<BButton
variant="success"
:disabled="systemStore.currentShow?.current_session_id !== null || startingSession"
@click.stop="startSession"
>
Start Session
</BButton>
</BCol>
</BRow>
<BRow>
Expand Down Expand Up @@ -65,14 +56,15 @@ import log from 'loglevel';
import { makeURL, msToTimerString, contrastColor } from '@/js/utils';
import { useSystemStore } from '@/stores/system';
import { useShowStore } from '@/stores/show';
import { useWebSocketStore } from '@/stores/websocket';
import { toast } from '@/js/toast';
import SessionTagDropdown from './SessionTagDropdown.vue';

const systemStore = useSystemStore();
const showStore = useShowStore();
const wsStore = useWebSocketStore();

const startingSession = ref(false);
const stoppingSession = ref(false);

const sessionFields = [
{ key: 'start_date_time', label: 'Start Time' },
Expand All @@ -96,9 +88,17 @@ function revisionLabel(revisionId: number | null): string {
}

async function startSession(): Promise<void> {
if (!wsStore.internalUUID) {
toast.error('Unable to start new show session');
return;
}
startingSession.value = true;
try {
const response = await fetch(makeURL('/api/v1/show/sessions/start'), { method: 'POST' });
const response = await fetch(makeURL('/api/v1/show/sessions/start'), {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ session_id: wsStore.internalUUID }),
});
if (response.ok) {
toast.success('Started new show session');
await showStore.getShowSessionData();
Expand All @@ -110,22 +110,6 @@ async function startSession(): Promise<void> {
startingSession.value = false;
}
}

async function stopSession(): Promise<void> {
stoppingSession.value = true;
try {
const response = await fetch(makeURL('/api/v1/show/sessions/stop'), { method: 'POST' });
if (response.ok) {
toast.success('Stopped show session');
await showStore.getShowSessionData();
} else {
log.error('Unable to stop show session');
toast.error('Unable to stop show session');
}
} finally {
stoppingSession.value = false;
}
}
</script>

<style scoped>
Expand Down
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"version": "0.30.4",
"version": "0.30.5",
"description": "DigiScript front end",
"author": "DreamTeamProd",
"private": true,
Expand Down
6 changes: 4 additions & 2 deletions client/src/vue_components/config/ConfigSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,17 @@ export default defineComponent({
}
},
resetEditSettings(): void {
const newSettings: Record<string, unknown> = {};
Object.keys(this.visibleSettings).forEach((x) => {
this.editSettings[x] = this.visibleSettings[x].value;
newSettings[x] = this.visibleSettings[x].value;
});
this.editSettings = newSettings;
},
resetForm(toggleLoaded: boolean): void {
if (toggleLoaded) this.loaded = false;
this.toggle = this.toggle === 0 ? 1 : 0;
Object.keys((this as any).RAW_SETTINGS).forEach((x) => {
this.editSettings[x] = (this as any).RAW_SETTINGS[x].value;
this.$set(this.editSettings, x, (this as any).RAW_SETTINGS[x].value);
});
(this as any).$v.editSettings.$reset();
if (toggleLoaded) this.loaded = true;
Expand Down
38 changes: 8 additions & 30 deletions client/src/vue_components/show/config/sessions/SessionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@
<b-container class="mx-0" fluid>
<b-row style="margin-bottom: 0.5rem">
<b-col class="text-left pl-0">
<b-button-group v-if="IS_SHOW_EXECUTOR">
<b-button
variant="success"
:disabled="CURRENT_SHOW_SESSION !== null || startingSession"
@click.stop="startSession"
>
Start Session
</b-button>
<b-button
variant="danger"
:disabled="CURRENT_SHOW_SESSION === null || stoppingSession"
@click.stop="stopSession"
>
Stop Session
</b-button>
</b-button-group>
<b-button
v-if="IS_SHOW_EXECUTOR"
variant="success"
:disabled="CURRENT_SHOW_SESSION !== null || startingSession"
@click.stop="startSession"
>
Start Session
</b-button>
</b-col>
</b-row>
<b-row>
Expand Down Expand Up @@ -87,7 +79,6 @@ export default defineComponent({
{ key: 'tags', label: 'Tags' },
],
startingSession: false,
stoppingSession: false,
};
},
computed: {
Expand Down Expand Up @@ -122,19 +113,6 @@ export default defineComponent({
}
this.startingSession = false;
},
async stopSession(): Promise<void> {
this.stoppingSession = true;
const response = await fetch(`${makeURL('/api/v1/show/sessions/stop')}`, {
method: 'POST',
});
if (response.ok) {
(this as any).$toast.success('Stopped show session');
} else {
log.error('Unable to stop show session');
(this as any).$toast.error('Unable to stop show session');
}
this.stoppingSession = false;
},
runTimeCalc(start: string, end: string): string {
const startDate = Date.parse(start);
const endDate = Date.parse(end);
Expand Down
4 changes: 2 additions & 2 deletions electron/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "digiscript-electron",
"version": "0.30.4",
"version": "0.30.5",
"description": "DigiScript Electron Desktop Application",
"author": "DreamTeamProd",
"license": "GPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "digiscript-server"
version = "0.30.4"
version = "0.30.5"
description = "DigiScript server - Digital script management for theatrical shows"
readme = "../README.md"
requires-python = ">=3.13"
Expand Down
Loading