From 20e695fce347a23bf91c5795fd358d956db86932 Mon Sep 17 00:00:00 2001 From: Sebastian-ubs Date: Thu, 8 Aug 2024 18:37:15 +0200 Subject: [PATCH 1/6] try to link about tab to menu (not working) --- extensions/src/platform-scripture/src/main.ts | 10 ++++++++++ .../src/types/platform-scripture.d.ts | 2 ++ .../components/platform-bible-menu.commands.tsx | 3 --- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/extensions/src/platform-scripture/src/main.ts b/extensions/src/platform-scripture/src/main.ts index 66014ad8e4..31cb52a8c4 100644 --- a/extensions/src/platform-scripture/src/main.ts +++ b/extensions/src/platform-scripture/src/main.ts @@ -43,6 +43,13 @@ const repeatableWordsValidator: ProjectSettingValidator< // #endregion +async function openAboutTab(): Promise { + return papi.webViews.getWebView( + 'about', // TAB_TYPE_ABOUT, + { type: 'float', floatSize: { width: 700, height: 800 } }, + ); +} + async function openPlatformCharactersInventory( webViewId: string | undefined, ): Promise { @@ -143,6 +150,8 @@ export async function activate(context: ExecutionActivationContext) { '%webView_configureChecks_title%', ); + const openAboutTabPromise = papi.commands.registerCommand('platform.about', openAboutTab); + const includeProjectsCommandPromise = papi.commands.registerCommand( 'platformScripture.toggleIncludeMyParatext9Projects', async (shouldInclude) => { @@ -220,6 +229,7 @@ export async function activate(context: ExecutionActivationContext) { await checkAggregatorService.initialize(); context.registrations.add( + await openAboutTabPromise, await scriptureExtenderPdpefPromise, await includeProjectsCommandPromise, await includeProjectsValidatorPromise, diff --git a/extensions/src/platform-scripture/src/types/platform-scripture.d.ts b/extensions/src/platform-scripture/src/types/platform-scripture.d.ts index f1bb40a54f..01027b939a 100644 --- a/extensions/src/platform-scripture/src/types/platform-scripture.d.ts +++ b/extensions/src/platform-scripture/src/types/platform-scripture.d.ts @@ -650,6 +650,8 @@ declare module 'papi-shared-types' { } export interface CommandHandlers { + 'platform.about': (projectId?: string | undefined) => Promise; + /** * Toggle the `platformScripture.includeMyParatext9Projects` setting on or off * diff --git a/src/renderer/components/platform-bible-menu.commands.tsx b/src/renderer/components/platform-bible-menu.commands.tsx index 267e50aa80..799cd85b76 100644 --- a/src/renderer/components/platform-bible-menu.commands.tsx +++ b/src/renderer/components/platform-bible-menu.commands.tsx @@ -31,9 +31,6 @@ export function handleMenuCommand(command: Command, tabId?: string) { case 'platform.visitSupportPage': VisitPage('https://support.bible'); break; - case 'platform.about': - logger.info(`TODO: display about. tabId: ${tabId}`); - break; default: (async () => { try { From 78938ef26863209bfe00a8012bf3ca8e3ceff0bf Mon Sep 17 00:00:00 2001 From: Sebastian-ubs Date: Fri, 9 Aug 2024 13:24:21 +0200 Subject: [PATCH 2/6] change about tab to dialog getting error: No tab loader for tabType 'undefined' --- extensions/src/platform-scripture/src/main.ts | 11 +++----- lib/papi-dts/papi.d.ts | 12 +++++++++ .../dialogs/about-dialog.component.tsx} | 26 +++++++++++-------- .../dialogs/dialog-definition.model.ts | 5 ++++ src/renderer/components/dialogs/index.ts | 4 ++- .../platform-dock-layout-storage.util.ts | 3 --- src/renderer/services/dialog.service-host.ts | 9 +++++++ src/renderer/testing/test-layout.data.ts | 6 ++--- src/shared/services/dialog.service-model.ts | 8 ++++++ src/shared/services/dialog.service.ts | 4 +++ 10 files changed, 61 insertions(+), 27 deletions(-) rename src/renderer/{testing/about-panel.component.tsx => components/dialogs/about-dialog.component.tsx} (57%) diff --git a/extensions/src/platform-scripture/src/main.ts b/extensions/src/platform-scripture/src/main.ts index 31cb52a8c4..b565e1e7c2 100644 --- a/extensions/src/platform-scripture/src/main.ts +++ b/extensions/src/platform-scripture/src/main.ts @@ -43,13 +43,6 @@ const repeatableWordsValidator: ProjectSettingValidator< // #endregion -async function openAboutTab(): Promise { - return papi.webViews.getWebView( - 'about', // TAB_TYPE_ABOUT, - { type: 'float', floatSize: { width: 700, height: 800 } }, - ); -} - async function openPlatformCharactersInventory( webViewId: string | undefined, ): Promise { @@ -150,7 +143,9 @@ export async function activate(context: ExecutionActivationContext) { '%webView_configureChecks_title%', ); - const openAboutTabPromise = papi.commands.registerCommand('platform.about', openAboutTab); + const openAboutTabPromise = papi.commands.registerCommand('platform.about', async () => + papi.dialogs.about(), + ); const includeProjectsCommandPromise = papi.commands.registerCommand( 'platformScripture.toggleIncludeMyParatext9Projects', diff --git a/lib/papi-dts/papi.d.ts b/lib/papi-dts/papi.d.ts index 48f291335a..de640e4d11 100644 --- a/lib/papi-dts/papi.d.ts +++ b/lib/papi-dts/papi.d.ts @@ -4882,12 +4882,15 @@ declare module 'renderer/components/dialogs/dialog-definition.model' { import { DialogDefinitionBase, DialogProps } from 'renderer/components/dialogs/dialog-base.data'; import { ReactElement } from 'react'; import { ProjectMetadataFilterOptions } from 'shared/models/project-data-provider-factory.interface'; + /** The tabType for the about dialog in `about-dialog.component.tsx` */ + export const ABOUT_DIALOG_TYPE = 'platform.about'; /** The tabType for the select project dialog in `select-project.dialog.tsx` */ export const SELECT_PROJECT_DIALOG_TYPE = 'platform.selectProject'; /** The tabType for the select multiple projects dialog in `select-multiple-projects.dialog.tsx` */ export const SELECT_MULTIPLE_PROJECTS_DIALOG_TYPE = 'platform.selectMultipleProjects'; /** The tabType for the select books dialog in `select-books.dialog.tsx` */ export const SELECT_BOOKS_DIALOG_TYPE = 'platform.selectBooks'; + export type AboutDialogOptions = DialogOptions; type ProjectDialogOptionsBase = DialogOptions & ProjectMetadataFilterOptions; /** Options to provide when showing the Select Project dialog */ export type SelectProjectDialogOptions = ProjectDialogOptionsBase; @@ -4909,6 +4912,7 @@ declare module 'renderer/components/dialogs/dialog-definition.model' { * If you add a dialog here, you must also add it on {@link DIALOGS} */ export interface DialogTypes { + [ABOUT_DIALOG_TYPE]: DialogDataTypes; [SELECT_PROJECT_DIALOG_TYPE]: DialogDataTypes; [SELECT_MULTIPLE_PROJECTS_DIALOG_TYPE]: DialogDataTypes< SelectMultipleProjectsDialogOptions, @@ -4957,6 +4961,7 @@ declare module 'renderer/components/dialogs/dialog-definition.model' { } declare module 'shared/services/dialog.service-model' { import { + AboutDialogOptions, DialogTabTypes, DialogTypes, SelectProjectDialogOptions, @@ -4985,6 +4990,13 @@ declare module 'shared/services/dialog.service-model' { * @returns Returns the user's selected project id or `undefined` if the user cancels */ selectProject(options?: SelectProjectDialogOptions): Promise; + /** + * Shows the about dialog + * + * @param options Various options for configuring the dialog that shows + * @returns Returns the user's selected project id or `undefined` if the user cancels + */ + about(options?: AboutDialogOptions): Promise; } /** Prefix on requests that indicates that the request is related to dialog operations */ export const CATEGORY_DIALOG = 'dialog'; diff --git a/src/renderer/testing/about-panel.component.tsx b/src/renderer/components/dialogs/about-dialog.component.tsx similarity index 57% rename from src/renderer/testing/about-panel.component.tsx rename to src/renderer/components/dialogs/about-dialog.component.tsx index 93d46f174e..4f775d24f5 100644 --- a/src/renderer/testing/about-panel.component.tsx +++ b/src/renderer/components/dialogs/about-dialog.component.tsx @@ -1,13 +1,14 @@ import icon from '@assets/icon.png'; import { useLocalizedStrings } from '@renderer/hooks/papi-hooks'; -import { SavedTabInfo, TabInfo } from '@shared/models/docking-framework.model'; import { LocalizeKey } from 'platform-bible-utils'; +import DIALOG_BASE from './dialog-base.data'; +import { ABOUT_DIALOG_TYPE, DialogDefinition } from './dialog-definition.model'; export const TAB_TYPE_ABOUT = 'about'; const STRING_KEYS: LocalizeKey[] = ['%product_name%']; -export default function AboutPanel() { +function AboutPanel() { const [{ '%product_name%': productName }] = useLocalizedStrings(STRING_KEYS); return ( @@ -22,12 +23,15 @@ export default function AboutPanel() { ); } -export function loadAboutTab(savedTabInfo: SavedTabInfo): TabInfo { - return { - ...savedTabInfo, - tabTitle: 'About', - content: , - minWidth: 230, - minHeight: 230, - }; -} +const ABOUT_DIALOG: DialogDefinition = Object.freeze({ + ...DIALOG_BASE, + tabType: ABOUT_DIALOG_TYPE, + defaultTitle: 'About', + initialSize: { + width: 230, + height: 230, + }, + Component: AboutPanel, +}); + +export default ABOUT_DIALOG; diff --git a/src/renderer/components/dialogs/dialog-definition.model.ts b/src/renderer/components/dialogs/dialog-definition.model.ts index ba71de26a0..d04778e640 100644 --- a/src/renderer/components/dialogs/dialog-definition.model.ts +++ b/src/renderer/components/dialogs/dialog-definition.model.ts @@ -3,6 +3,8 @@ import { DialogDefinitionBase, DialogProps } from '@renderer/components/dialogs/ import { ReactElement } from 'react'; import { ProjectMetadataFilterOptions } from '@shared/models/project-data-provider-factory.interface'; +/** The tabType for the about dialog in `about-dialog.component.tsx` */ +export const ABOUT_DIALOG_TYPE = 'platform.about'; /** The tabType for the select project dialog in `select-project.dialog.tsx` */ export const SELECT_PROJECT_DIALOG_TYPE = 'platform.selectProject'; /** The tabType for the select multiple projects dialog in `select-multiple-projects.dialog.tsx` */ @@ -10,6 +12,8 @@ export const SELECT_MULTIPLE_PROJECTS_DIALOG_TYPE = 'platform.selectMultipleProj /** The tabType for the select books dialog in `select-books.dialog.tsx` */ export const SELECT_BOOKS_DIALOG_TYPE = 'platform.selectBooks'; +export type AboutDialogOptions = DialogOptions; + type ProjectDialogOptionsBase = DialogOptions & ProjectMetadataFilterOptions; /** Options to provide when showing the Select Project dialog */ @@ -35,6 +39,7 @@ export type SelectBooksDialogOptions = DialogOptions & { * If you add a dialog here, you must also add it on {@link DIALOGS} */ export interface DialogTypes { + [ABOUT_DIALOG_TYPE]: DialogDataTypes; [SELECT_PROJECT_DIALOG_TYPE]: DialogDataTypes; [SELECT_MULTIPLE_PROJECTS_DIALOG_TYPE]: DialogDataTypes< SelectMultipleProjectsDialogOptions, diff --git a/src/renderer/components/dialogs/index.ts b/src/renderer/components/dialogs/index.ts index 7c396dd97d..1856037e77 100644 --- a/src/renderer/components/dialogs/index.ts +++ b/src/renderer/components/dialogs/index.ts @@ -1,5 +1,6 @@ -import SELECT_PROJECT_DIALOG from '@renderer/components/dialogs/select-project.dialog'; +import ABOUT_DIALOG from '@renderer/components/dialogs/about-dialog.component'; import SELECT_MULTIPLE_PROJECTS_DIALOG from '@renderer/components/dialogs/select-multiple-projects.dialog'; +import SELECT_PROJECT_DIALOG from '@renderer/components/dialogs/select-project.dialog'; import { DialogDefinition, DialogTabTypes } from './dialog-definition.model'; import SELECT_BOOKS_DIALOG from './select-books-dialog.component'; @@ -9,6 +10,7 @@ import SELECT_BOOKS_DIALOG from './select-books-dialog.component'; * If you add a dialog here, you must also add it on {@link DialogTypes} */ const DIALOGS: { [DialogTabType in DialogTabTypes]: DialogDefinition } = { + [ABOUT_DIALOG.tabType]: ABOUT_DIALOG, [SELECT_PROJECT_DIALOG.tabType]: SELECT_PROJECT_DIALOG, [SELECT_MULTIPLE_PROJECTS_DIALOG.tabType]: SELECT_MULTIPLE_PROJECTS_DIALOG, [SELECT_BOOKS_DIALOG.tabType]: SELECT_BOOKS_DIALOG, diff --git a/src/renderer/components/docking/platform-dock-layout-storage.util.ts b/src/renderer/components/docking/platform-dock-layout-storage.util.ts index 3d289a787a..60c927edd2 100644 --- a/src/renderer/components/docking/platform-dock-layout-storage.util.ts +++ b/src/renderer/components/docking/platform-dock-layout-storage.util.ts @@ -43,7 +43,6 @@ import { updateWebViewTab, } from '@renderer/components/web-view.component'; -import { TAB_TYPE_ABOUT, loadAboutTab } from '@renderer/testing/about-panel.component'; import { TAB_TYPE_BUTTONS, loadButtonsTab } from '@renderer/testing/test-buttons-panel.component'; import { TAB_TYPE_TEST, loadTestTab } from '@renderer/testing/test-panel.component'; import { @@ -60,7 +59,6 @@ import { ErrorTabData, TAB_TYPE_ERROR, createErrorTab, saveErrorTab } from './er let tabLoaderMap: Map; if (globalThis.isNoisyDevModeEnabled) { tabLoaderMap = new Map([ - [TAB_TYPE_ABOUT, loadAboutTab], [TAB_TYPE_BUTTONS, loadButtonsTab], [TAB_TYPE_QUICK_VERSE_HERESY, loadQuickVerseHeresyTab], [TAB_TYPE_TEST, loadTestTab], @@ -77,7 +75,6 @@ if (globalThis.isNoisyDevModeEnabled) { ]); } else { tabLoaderMap = new Map([ - [TAB_TYPE_ABOUT, loadAboutTab], [TAB_TYPE_BUTTONS, loadButtonsTab], [TAB_TYPE_WEBVIEW, loadWebViewTab], [TAB_TYPE_DOWNLOAD_UPDATE_PROJECT_DIALOG, loadDownloadUpdateProjectTab], diff --git a/src/renderer/services/dialog.service-host.ts b/src/renderer/services/dialog.service-host.ts index 81b0cc6593..c841b5ff41 100644 --- a/src/renderer/services/dialog.service-host.ts +++ b/src/renderer/services/dialog.service-host.ts @@ -18,6 +18,7 @@ import SELECT_PROJECT_DIALOG from '@renderer/components/dialogs/select-project.d import { DialogTabTypes, DialogTypes } from '@renderer/components/dialogs/dialog-definition.model'; import { hookUpDialogService } from '@renderer/components/dialogs/dialog-base.data'; import localizationService from '@shared/services/localization.service'; +import ABOUT_DIALOG from '@renderer/components/dialogs/about-dialog.component'; /** A live dialog request. Includes the dialog's id and the functions to run on receiving results */ // TODO: preserve requests between refreshes - save the request id or something? @@ -233,6 +234,13 @@ async function showDialog( return dialogPromise; } +// on the dialogService - see `dialog.service-model.ts` for JSDoc +async function about( + options?: DialogTypes[typeof ABOUT_DIALOG.tabType]['options'], +): Promise { + return showDialog(ABOUT_DIALOG.tabType, options); +} + // on the dialogService - see `dialog.service-model.ts` for JSDoc async function selectProject( options?: DialogTypes[typeof SELECT_PROJECT_DIALOG.tabType]['options'], @@ -242,6 +250,7 @@ async function selectProject( const dialogService: DialogService = { showDialog, + about, selectProject, }; diff --git a/src/renderer/testing/test-layout.data.ts b/src/renderer/testing/test-layout.data.ts index 431dd0c0a4..414353ad1e 100644 --- a/src/renderer/testing/test-layout.data.ts +++ b/src/renderer/testing/test-layout.data.ts @@ -1,6 +1,5 @@ import { SavedTabInfo } from '@shared/models/docking-framework.model'; import { LayoutBase } from 'rc-dock'; -import { TAB_TYPE_ABOUT } from '@renderer/testing/about-panel.component'; import { TAB_TYPE_BUTTONS } from '@renderer/testing/test-buttons-panel.component'; // import { TAB_TYPE_QUICK_VERSE_HERESY } from '@renderer/testing/test-quick-verse-heresy-panel.component'; import { TAB_TYPE_TEST } from '@renderer/testing/test-panel.component'; @@ -9,7 +8,7 @@ import { TAB_TYPE_TEST } from '@renderer/testing/test-panel.component'; // import { TAB_TYPE_EXTENSION_MANAGER } from '@renderer/components/extension-manager/extension-manager-tab.component'; import LOREM_IPSUM from './lorem-ipsum'; -export const FIRST_TAB_ID = 'About'; +export const FIRST_TAB_ID = 'Test Tab One'; // Using `as` here simplifies type changes. /* eslint-disable no-type-assertion/no-type-assertion */ @@ -24,7 +23,6 @@ const testLayout: LayoutBase = globalThis.isNoisyDevModeEnabled children: [ { tabs: [ - { id: 'About', tabType: TAB_TYPE_ABOUT }, { id: 'Test Tab Two', tabType: TAB_TYPE_TEST }, { id: 'Test Tab One', tabType: TAB_TYPE_TEST }, { @@ -101,7 +99,7 @@ const testLayout: LayoutBase = globalThis.isNoisyDevModeEnabled size: 250, children: [ { - tabs: [{ id: 'About', tabType: TAB_TYPE_ABOUT }] as SavedTabInfo[], + tabs: [{ id: 'Test Tab One', tabType: TAB_TYPE_TEST }] as SavedTabInfo[], }, ], }, diff --git a/src/shared/services/dialog.service-model.ts b/src/shared/services/dialog.service-model.ts index 434b302bee..c5b915bb88 100644 --- a/src/shared/services/dialog.service-model.ts +++ b/src/shared/services/dialog.service-model.ts @@ -1,4 +1,5 @@ import { + AboutDialogOptions, DialogTabTypes, DialogTypes, SelectProjectDialogOptions, @@ -29,6 +30,13 @@ export interface DialogService { * @returns Returns the user's selected project id or `undefined` if the user cancels */ selectProject(options?: SelectProjectDialogOptions): Promise; + /** + * Shows the about dialog + * + * @param options Various options for configuring the dialog that shows + * @returns Returns the user's selected project id or `undefined` if the user cancels + */ + about(options?: AboutDialogOptions): Promise; } /** Prefix on requests that indicates that the request is related to dialog operations */ diff --git a/src/shared/services/dialog.service.ts b/src/shared/services/dialog.service.ts index 633bbfd6c5..98d0288fdc 100644 --- a/src/shared/services/dialog.service.ts +++ b/src/shared/services/dialog.service.ts @@ -17,6 +17,10 @@ const dialogService: DialogService = { await initialize(); return networkService.request(serializeRequestType(CATEGORY_DIALOG, 'showDialog'), ...args); }, + about: async (...args) => { + await initialize(); + return networkService.request(serializeRequestType(CATEGORY_DIALOG, 'showDialog'), ...args); + }, selectProject: async (...args) => { await initialize(); return networkService.request(serializeRequestType(CATEGORY_DIALOG, 'selectProject'), ...args); From f022ae3f306413a3f9e3d3c1968aef0a452302e4 Mon Sep 17 00:00:00 2001 From: Sebastian-ubs Date: Fri, 9 Aug 2024 18:49:24 +0200 Subject: [PATCH 3/6] =?UTF-8?q?fix=20about=20dialog=20to=20show=20up=20?= =?UTF-8?q?=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/services/dialog.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/services/dialog.service.ts b/src/shared/services/dialog.service.ts index 98d0288fdc..4c4cfbb76d 100644 --- a/src/shared/services/dialog.service.ts +++ b/src/shared/services/dialog.service.ts @@ -19,7 +19,7 @@ const dialogService: DialogService = { }, about: async (...args) => { await initialize(); - return networkService.request(serializeRequestType(CATEGORY_DIALOG, 'showDialog'), ...args); + return networkService.request(serializeRequestType(CATEGORY_DIALOG, 'about'), ...args); }, selectProject: async (...args) => { await initialize(); From 16baf1d09669e6d03457979f492ab954e7c78d3d Mon Sep 17 00:00:00 2001 From: Sebastian-ubs Date: Fri, 9 Aug 2024 19:19:22 +0200 Subject: [PATCH 4/6] choose a better dialog size --- src/renderer/components/dialogs/about-dialog.component.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/dialogs/about-dialog.component.tsx b/src/renderer/components/dialogs/about-dialog.component.tsx index 4f775d24f5..0b0bba5826 100644 --- a/src/renderer/components/dialogs/about-dialog.component.tsx +++ b/src/renderer/components/dialogs/about-dialog.component.tsx @@ -28,8 +28,8 @@ const ABOUT_DIALOG: DialogDefinition = Object.freeze({ tabType: ABOUT_DIALOG_TYPE, defaultTitle: 'About', initialSize: { - width: 230, - height: 230, + width: 500, + height: 500, }, Component: AboutPanel, }); From a1a5543dac5575dd6ce0676b2d0cb2121c058025 Mon Sep 17 00:00:00 2001 From: Sebastian-ubs Date: Wed, 11 Sep 2024 09:50:28 +0200 Subject: [PATCH 5/6] rename about -> showAboutDialog --- extensions/src/platform-scripture/src/main.ts | 6 +++--- lib/papi-dts/papi.d.ts | 2 +- src/renderer/components/dialogs/about-dialog.component.tsx | 4 ++-- src/renderer/services/dialog.service-host.ts | 4 ++-- src/shared/services/dialog.service-model.ts | 2 +- src/shared/services/dialog.service.ts | 7 +++++-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/extensions/src/platform-scripture/src/main.ts b/extensions/src/platform-scripture/src/main.ts index b565e1e7c2..e905fa5e0d 100644 --- a/extensions/src/platform-scripture/src/main.ts +++ b/extensions/src/platform-scripture/src/main.ts @@ -143,8 +143,8 @@ export async function activate(context: ExecutionActivationContext) { '%webView_configureChecks_title%', ); - const openAboutTabPromise = papi.commands.registerCommand('platform.about', async () => - papi.dialogs.about(), + const showAboutDialogPromise = papi.commands.registerCommand('platform.about', async () => + papi.dialogs.showAboutDialog(), ); const includeProjectsCommandPromise = papi.commands.registerCommand( @@ -224,7 +224,7 @@ export async function activate(context: ExecutionActivationContext) { await checkAggregatorService.initialize(); context.registrations.add( - await openAboutTabPromise, + await showAboutDialogPromise, await scriptureExtenderPdpefPromise, await includeProjectsCommandPromise, await includeProjectsValidatorPromise, diff --git a/lib/papi-dts/papi.d.ts b/lib/papi-dts/papi.d.ts index de640e4d11..e11e1c441f 100644 --- a/lib/papi-dts/papi.d.ts +++ b/lib/papi-dts/papi.d.ts @@ -4996,7 +4996,7 @@ declare module 'shared/services/dialog.service-model' { * @param options Various options for configuring the dialog that shows * @returns Returns the user's selected project id or `undefined` if the user cancels */ - about(options?: AboutDialogOptions): Promise; + showAboutDialog(options?: AboutDialogOptions): Promise; } /** Prefix on requests that indicates that the request is related to dialog operations */ export const CATEGORY_DIALOG = 'dialog'; diff --git a/src/renderer/components/dialogs/about-dialog.component.tsx b/src/renderer/components/dialogs/about-dialog.component.tsx index 0b0bba5826..0b82edc4d2 100644 --- a/src/renderer/components/dialogs/about-dialog.component.tsx +++ b/src/renderer/components/dialogs/about-dialog.component.tsx @@ -8,7 +8,7 @@ export const TAB_TYPE_ABOUT = 'about'; const STRING_KEYS: LocalizeKey[] = ['%product_name%']; -function AboutPanel() { +function AboutDialog() { const [{ '%product_name%': productName }] = useLocalizedStrings(STRING_KEYS); return ( @@ -31,7 +31,7 @@ const ABOUT_DIALOG: DialogDefinition = Object.freeze({ width: 500, height: 500, }, - Component: AboutPanel, + Component: AboutDialog, }); export default ABOUT_DIALOG; diff --git a/src/renderer/services/dialog.service-host.ts b/src/renderer/services/dialog.service-host.ts index c841b5ff41..414f36794d 100644 --- a/src/renderer/services/dialog.service-host.ts +++ b/src/renderer/services/dialog.service-host.ts @@ -235,7 +235,7 @@ async function showDialog( } // on the dialogService - see `dialog.service-model.ts` for JSDoc -async function about( +async function showAboutDialog( options?: DialogTypes[typeof ABOUT_DIALOG.tabType]['options'], ): Promise { return showDialog(ABOUT_DIALOG.tabType, options); @@ -250,7 +250,7 @@ async function selectProject( const dialogService: DialogService = { showDialog, - about, + showAboutDialog, selectProject, }; diff --git a/src/shared/services/dialog.service-model.ts b/src/shared/services/dialog.service-model.ts index c5b915bb88..70b49b5ede 100644 --- a/src/shared/services/dialog.service-model.ts +++ b/src/shared/services/dialog.service-model.ts @@ -36,7 +36,7 @@ export interface DialogService { * @param options Various options for configuring the dialog that shows * @returns Returns the user's selected project id or `undefined` if the user cancels */ - about(options?: AboutDialogOptions): Promise; + showAboutDialog(options?: AboutDialogOptions): Promise; } /** Prefix on requests that indicates that the request is related to dialog operations */ diff --git a/src/shared/services/dialog.service.ts b/src/shared/services/dialog.service.ts index 4c4cfbb76d..f648a916e6 100644 --- a/src/shared/services/dialog.service.ts +++ b/src/shared/services/dialog.service.ts @@ -17,9 +17,12 @@ const dialogService: DialogService = { await initialize(); return networkService.request(serializeRequestType(CATEGORY_DIALOG, 'showDialog'), ...args); }, - about: async (...args) => { + showAboutDialog: async (...args) => { await initialize(); - return networkService.request(serializeRequestType(CATEGORY_DIALOG, 'about'), ...args); + return networkService.request( + serializeRequestType(CATEGORY_DIALOG, 'showAboutDialog'), + ...args, + ); }, selectProject: async (...args) => { await initialize(); From 6b1a55ccec97b479b6061cd4961de8916e37537e Mon Sep 17 00:00:00 2001 From: Sebastian-ubs Date: Wed, 11 Sep 2024 10:11:09 +0200 Subject: [PATCH 6/6] remove default tab - start Platform empty --- src/renderer/testing/test-layout.data.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/renderer/testing/test-layout.data.ts b/src/renderer/testing/test-layout.data.ts index 414353ad1e..c45aa65df9 100644 --- a/src/renderer/testing/test-layout.data.ts +++ b/src/renderer/testing/test-layout.data.ts @@ -8,8 +8,6 @@ import { TAB_TYPE_TEST } from '@renderer/testing/test-panel.component'; // import { TAB_TYPE_EXTENSION_MANAGER } from '@renderer/components/extension-manager/extension-manager-tab.component'; import LOREM_IPSUM from './lorem-ipsum'; -export const FIRST_TAB_ID = 'Test Tab One'; - // Using `as` here simplifies type changes. /* eslint-disable no-type-assertion/no-type-assertion */ const testLayout: LayoutBase = globalThis.isNoisyDevModeEnabled @@ -99,7 +97,7 @@ const testLayout: LayoutBase = globalThis.isNoisyDevModeEnabled size: 250, children: [ { - tabs: [{ id: 'Test Tab One', tabType: TAB_TYPE_TEST }] as SavedTabInfo[], + tabs: [] as SavedTabInfo[], }, ], },