Skip to content

Commit ccc01f9

Browse files
committed
remove unused select books dialog
1 parent ac37eda commit ccc01f9

8 files changed

Lines changed: 0 additions & 167 deletions

File tree

assets/localization/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@
316316
"%scrollGroup_3%": "D",
317317
"%scrollGroup_4%": "E",
318318
"%scrollGroup_undefined%": "Ø",
319-
"%selectBooks_title_selectBooks%": "Select Books",
320319
"%selectMultipleProjects_title_selectProjects%": "Select Projects",
321320
"%selectProject_title%": "Select Project",
322321
"%settings_defaultMessage_loadingOneSetting%": "Loading setting",

assets/localization/es.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@
436436
"%scrollGroup_3%": "D",
437437
"%scrollGroup_4%": "E",
438438
"%scrollGroup_undefined%": "Ø",
439-
"%selectBooks_title_selectBooks%": "Seleccionar libros",
440439
"%selectMultipleProjects_title_selectProjects%": "Seleccionar Proyectos",
441440
"%selectProject_title%": "Seleccionar Proyecto",
442441
"%settings_defaultMessage_loadingOneSetting%": "Cargando configuración",

e2e-tests/tests/isolated/overlay/dialog-rendering.spec.ts

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -435,62 +435,4 @@ test('all dialog types render correctly in modal and non-modal form', async ({ m
435435
// eslint-disable-next-line no-type-assertion/no-type-assertion
436436
expect((result as string[]).length).toBeGreaterThanOrEqual(1);
437437
});
438-
439-
// =========================================================================
440-
// Select Books Dialog
441-
// =========================================================================
442-
443-
await test.step('select books dialog - modal', async () => {
444-
const resultPromise = showDialogViaWebSocket<string[]>('platform.selectBooks', {
445-
title: 'Pick Books',
446-
prompt: 'Select some books',
447-
selectedBookIds: ['GEN', 'EXO'],
448-
isModal: true,
449-
});
450-
451-
const dialog = modalDialog(mainPage);
452-
await expect(dialog).toBeVisible({ timeout: 10_000 });
453-
await expect(modalBackdrop(mainPage)).toBeVisible();
454-
await expect(dialog).toContainText('Select some books');
455-
456-
// Verify book checklist renders (Genesis and Exodus should be pre-selected)
457-
await expect(dialog.getByText('Genesis')).toBeVisible({ timeout: 5_000 });
458-
await expect(dialog.getByText('Exodus')).toBeVisible();
459-
460-
// Submit with pre-selected books using the dialog's specific submit button class.
461-
// Fixed modal + overflow can clip the footer; scrollIntoView does not fix that, and Playwright's
462-
// click can fail even with force:true when the hit point is outside the viewport.
463-
const submitButton = dialog.locator('.select-books-dialog-submit-button');
464-
await submitButton.evaluate((el) => {
465-
if (el instanceof HTMLElement) el.click();
466-
});
467-
468-
await expect(dialog).not.toBeVisible({ timeout: 3_000 });
469-
const result = await resultPromise;
470-
expect(Array.isArray(result)).toBe(true);
471-
expect(result).toContain('GEN');
472-
expect(result).toContain('EXO');
473-
});
474-
475-
await test.step('select books dialog - non-modal (floating tab)', async () => {
476-
const resultPromise = showDialogViaWebSocket<string[]>('platform.selectBooks', {
477-
prompt: 'Books from tab',
478-
selectedBookIds: ['MAT'],
479-
});
480-
481-
const panel = mainPage.locator('.dock-panel').filter({ hasText: 'Books from tab' });
482-
await expect(panel).toBeVisible({ timeout: 10_000 });
483-
await expect(modalDialog(mainPage)).not.toBeVisible();
484-
485-
// Verify checklist renders
486-
await expect(panel.getByText('Matthew')).toBeVisible({ timeout: 5_000 });
487-
488-
const submitButton = panel.locator('.select-books-dialog-submit-button');
489-
await submitButton.click();
490-
491-
await expect(panel).not.toBeVisible({ timeout: 3_000 });
492-
const result = await resultPromise;
493-
expect(Array.isArray(result)).toBe(true);
494-
expect(result).toContain('MAT');
495-
});
496438
});

src/renderer/components/dialogs/dialog-definition.model.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ export const ABOUT_DIALOG_TYPE = 'platform.aboutDialog';
1010
export const SELECT_PROJECT_DIALOG_TYPE = 'platform.selectProject';
1111
/** The tabType for the select multiple projects dialog in `select-multiple-projects.dialog.tsx` */
1212
export const SELECT_MULTIPLE_PROJECTS_DIALOG_TYPE = 'platform.selectMultipleProjects';
13-
/** The tabType for the select books dialog in `select-books.dialog.tsx` */
14-
export const SELECT_BOOKS_DIALOG_TYPE = 'platform.selectBooks';
1513
/** The dialogType for alert dialogs rendered via overlay */
1614
export const ALERT_DIALOG_TYPE = 'platform.alert';
1715
/** The dialogType for confirm dialogs rendered via overlay */
@@ -28,12 +26,6 @@ export type SelectMultipleProjectsDialogOptions = ProjectDialogOptionsBase & {
2826
selectedProjectIds?: string[];
2927
};
3028

31-
/** Options to provide when showing the Select Books dialog */
32-
export type SelectBooksDialogOptions = DialogOptions & {
33-
/** Books IDs that should start selected in the dialog */
34-
selectedBookIds?: string[];
35-
};
36-
3729
/** Options to provide when showing an alert dialog */
3830
export type AlertDialogOptions = DialogOptions & {
3931
/** The message body displayed in the dialog. Required for alert dialogs. */
@@ -66,7 +58,6 @@ export interface DialogTypes {
6658
SelectMultipleProjectsDialogOptions,
6759
string[]
6860
>;
69-
[SELECT_BOOKS_DIALOG_TYPE]: DialogDataTypes<SelectBooksDialogOptions, string[]>;
7061
[ALERT_DIALOG_TYPE]: DialogDataTypes<AlertDialogOptions, true>;
7162
[CONFIRM_DIALOG_TYPE]: DialogDataTypes<ConfirmDialogOptions, boolean>;
7263
}

src/renderer/components/dialogs/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { CONFIRM_DIALOG } from './confirm-dialog.component';
44
import { SELECT_MULTIPLE_PROJECTS_DIALOG } from './select-multiple-projects.dialog';
55
import { SELECT_PROJECT_DIALOG } from './select-project.dialog';
66
import { DialogDefinition, DialogTabTypes } from './dialog-definition.model';
7-
import { SELECT_BOOKS_DIALOG } from './select-books-dialog.component';
87

98
/**
109
* Map of all available dialog definitions used to create dialogs
@@ -17,7 +16,6 @@ export const DIALOGS: { [DialogTabType in DialogTabTypes]: DialogDefinition<Dial
1716
[CONFIRM_DIALOG.tabType]: CONFIRM_DIALOG,
1817
[SELECT_PROJECT_DIALOG.tabType]: SELECT_PROJECT_DIALOG,
1918
[SELECT_MULTIPLE_PROJECTS_DIALOG.tabType]: SELECT_MULTIPLE_PROJECTS_DIALOG,
20-
[SELECT_BOOKS_DIALOG.tabType]: SELECT_BOOKS_DIALOG,
2119
};
2220

2321
/** All tab types for available dialogs */

src/renderer/components/dialogs/select-books-dialog.component.scss

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/renderer/components/dialogs/select-books-dialog.component.tsx

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/renderer/services/dialog.service-host.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ const mockDialogs = {
4949
tabType: 'platform.selectMultipleProjects',
5050
Component: vi.fn(),
5151
},
52-
'platform.selectBooks': { tabType: 'platform.selectBooks', Component: vi.fn() },
5352
'platform.alert': {
5453
tabType: 'platform.alert',
5554
dialogRole: 'alertdialog',

0 commit comments

Comments
 (0)