Skip to content

Commit

Permalink
Renamed lots of files
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcouch-sil committed Oct 16, 2023
1 parent 59eed4b commit 15c2e29
Show file tree
Hide file tree
Showing 30 changed files with 74 additions and 74 deletions.
26 changes: 13 additions & 13 deletions lib/papi-dts/papi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,7 @@ declare module 'shared/services/web-view.service' {
currentTabId?: string,
direction?: DropDirection,
) => Promise<void>;
/** Properties related to the dock layout provided by `paranext-dock-layout.component.tsx` */
/** Properties related to the dock layout provided by `platform-dock-layout.component.tsx` */
type PapiDockLayout = {
/** The rc-dock dock layout React element ref. Used to perform operations on the layout */
dockLayout: DockLayout;
Expand Down Expand Up @@ -2051,7 +2051,7 @@ declare module 'shared/services/web-view.service' {
*
* TODO: This should be removed and the `testLayout` imported directly in this file once this
* service is refactored to split the code between processes. The only reason this is passed from
* `paranext-dock-layout.component.tsx` is that we cannot import `testLayout` here since this
* `platform-dock-layout.component.tsx` is that we cannot import `testLayout` here since this
* service is currently all shared code. Refactor should happen in #203
*/
testLayout: LayoutBase;
Expand Down Expand Up @@ -2464,7 +2464,7 @@ declare module 'shared/models/project-metadata.model' {
projectType: string;
};
}
declare module 'shared/services/project-lookup.service.model' {
declare module 'shared/services/project-lookup.service-model' {
import { ProjectMetadata } from 'shared/models/project-metadata.model';
/**
* Provides metadata for projects known by the platform
Expand All @@ -2485,7 +2485,7 @@ declare module 'shared/services/project-lookup.service.model' {
export const projectLookupServiceNetworkObjectName = 'ProjectLookupService';
}
declare module 'shared/services/project-lookup.service' {
import { ProjectLookupServiceType } from 'shared/services/project-lookup.service.model';
import { ProjectLookupServiceType } from 'shared/services/project-lookup.service-model';
const projectLookupService: ProjectLookupServiceType;
export default projectLookupService;
}
Expand Down Expand Up @@ -2940,7 +2940,7 @@ declare module 'renderer/components/dialogs/dialog-base.data' {
const DIALOG_BASE: DialogDefinitionBase;
export default DIALOG_BASE;
}
declare module 'renderer/components/dialogs/dialog.data' {
declare module 'renderer/components/dialogs/dialog-definition.model' {
import { DialogOptions } from 'shared/models/dialog-options.model';
import { DialogDefinitionBase, DialogProps } from 'renderer/components/dialogs/dialog-base.data';
import { ReactElement } from 'react';
Expand Down Expand Up @@ -2989,8 +2989,8 @@ declare module 'renderer/components/dialogs/dialog.data' {
}
>;
}
declare module 'shared/services/dialog.service.model' {
import { DialogTabTypes, DialogTypes } from 'renderer/components/dialogs/dialog.data';
declare module 'shared/services/dialog.service-model' {
import { DialogTabTypes, DialogTypes } from 'renderer/components/dialogs/dialog-definition.model';
import { DialogOptions } from 'shared/models/dialog-options.model';
/**
* Prompt the user for responses with dialogs
Expand Down Expand Up @@ -3025,12 +3025,12 @@ declare module 'shared/services/dialog.service.model' {
export const CATEGORY_DIALOG = 'dialog';
}
declare module 'shared/services/dialog.service' {
import { DialogService } from 'shared/services/dialog.service.model';
import { DialogService } from 'shared/services/dialog.service-model';
const dialogService: DialogService;
export default dialogService;
}
declare module 'renderer/hooks/papi-hooks/use-dialog-callback.hook' {
import { DialogTabTypes, DialogTypes } from 'renderer/components/dialogs/dialog.data';
import { DialogTabTypes, DialogTypes } from 'renderer/components/dialogs/dialog-definition.model';
/**
* Enables using `papi.dialogs.showDialog` in React more easily. Provides a callback to run to get a
* response from a dialog as well as states that indicate the dialog's response and whether the
Expand Down Expand Up @@ -3155,12 +3155,12 @@ declare module 'papi-frontend' {
import { PapiWebViewService } from 'shared/services/web-view.service';
import { InternetService } from 'shared/services/internet.service';
import { DataProviderService } from 'shared/services/data-provider.service';
import { ProjectLookupServiceType } from 'shared/services/project-lookup.service.model';
import { ProjectLookupServiceType } from 'shared/services/project-lookup.service-model';
import { PapiFrontendProjectDataProviderService } from 'shared/services/project-data-provider.service';
import { PapiContext } from 'renderer/context/papi-context/index';
import { PapiHooks } from 'renderer/hooks/papi-hooks/index';
import { SettingsService } from 'shared/services/settings.service';
import { DialogService } from 'shared/services/dialog.service.model';
import { DialogService } from 'shared/services/dialog.service-model';
const papi: {
/**
* Event manager - accepts subscriptions to an event and runs the subscription callbacks when the event is emitted
Expand Down Expand Up @@ -3490,8 +3490,8 @@ declare module 'papi-backend' {
import { DataProviderService } from 'shared/services/data-provider.service';
import { PapiBackendProjectDataProviderService } from 'shared/services/project-data-provider.service';
import { ExtensionStorageService } from 'extension-host/services/extension-storage.service';
import { ProjectLookupServiceType } from 'shared/services/project-lookup.service.model';
import { DialogService } from 'shared/services/dialog.service.model';
import { ProjectLookupServiceType } from 'shared/services/project-lookup.service-model';
import { DialogService } from 'shared/services/dialog.service-model';
const papi: {
/**
* Event manager - accepts subscriptions to an event and runs the subscription callbacks when the event is emitted
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/app.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jest.mock('@renderer/hooks/papi-hooks/use-event.hook', () => ({
__esModule: true,
default: /** useEvent Mock */ () => {},
}));
jest.mock('@renderer/components/docking/paranext-dock-layout.component', () => ({
jest.mock('@renderer/components/docking/platform-dock-layout.component', () => ({
__esModule: true,
default: /** ParanextDockLayout Mock */ () => undefined,
}));
Expand Down
2 changes: 1 addition & 1 deletion src/extension-host/extension-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import dataProviderService from '@shared/services/data-provider.service';
import extensionAssetService from '@shared/services/extension-asset.service';
import { getErrorMessage } from '@shared/utils/util';
import { CommandNames } from 'papi-shared-types';
import { startProjectLookupService } from '@extension-host/services/project-lookup.service.host';
import { startProjectLookupService } from '@extension-host/services/project-lookup.service-host';

// #region Test logs

Expand Down
4 changes: 2 additions & 2 deletions src/extension-host/services/papi-backend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import {
import extensionStorageService, {
ExtensionStorageService,
} from '@extension-host/services/extension-storage.service';
import { ProjectLookupServiceType } from '@shared/services/project-lookup.service.model';
import { ProjectLookupServiceType } from '@shared/services/project-lookup.service-model';
import projectLookupService from '@shared/services/project-lookup.service';
import dialogService from '@shared/services/dialog.service';
import { DialogService } from '@shared/services/dialog.service.model';
import { DialogService } from '@shared/services/dialog.service-model';

// IMPORTANT NOTES:
// 1) When adding new services here, consider whether they also belong in papi-frontend.service.ts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ProjectMetadata } from '@shared/models/project-metadata.model';
import {
projectLookupServiceNetworkObjectName,
ProjectLookupServiceType,
} from '@shared/services/project-lookup.service.model';
} from '@shared/services/project-lookup.service-model';
import { joinUriPaths } from '@node/utils/util';
import logger from '@shared/services/logger.service';
import networkObjectService from '@shared/services/network-object.service';
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/app.component.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { MemoryRouter as Router, Routes, Route } from 'react-router-dom';
import './app.component.css';
import ParanextDockLayout from '@renderer/components/docking/paranext-dock-layout.component';
import PlatformDockLayout from '@renderer/components/docking/platform-dock-layout.component';
import TestContext from '@renderer/context/papi-context/test.context';
import PlatformBibleToolbar from './components/platform-bible-toolbar';

function Main() {
return (
<TestContext.Provider value="test">
<PlatformBibleToolbar />
<ParanextDockLayout />
<PlatformDockLayout />
</TestContext.Provider>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/dialogs/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SELECT_PROJECT_DIALOG from '@renderer/components/dialogs/select-project.dialog';
import { DialogDefinition, DialogTabTypes } from './dialog.data';
import { DialogDefinition, DialogTabTypes } from './dialog-definition.model';

/**
* Map of all available dialog definitions used to create dialogs
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/dialogs/select-project.dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { ListItemIcon } from '@mui/material';
import FolderOpenIcon from '@mui/icons-material/FolderOpen';
import './select-project.dialog.scss';
import { useMemo } from 'react';
import ProjectList from '@renderer/components/project-components/project-list.component';
import ProjectList from '@renderer/components/projects/project-list.component';
import usePromise from '@renderer/hooks/papi-hooks/use-promise.hook';
import projectLookupService from '@shared/services/project-lookup.service';
import DIALOG_BASE, { DialogProps } from '@renderer/components/dialogs/dialog-base.data';
import { DialogDefinition } from '@renderer/components/dialogs/dialog.data';
import { DialogDefinition } from '@renderer/components/dialogs/dialog-definition.model';

type SelectProjectDialogProps = DialogProps<string>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
margin: 4px;
}

.dock-layout .dock-panel.dock-style-paranext {
.dock-layout .dock-panel.dock-style-platform-bible {
border: 0;
}

Expand All @@ -21,63 +21,63 @@
border: 0;
}

.dock-layout .dock-panel.dock-style-paranext .dock-tab {
.dock-layout .dock-panel.dock-style-platform-bible .dock-tab {
margin-right: 0;
border: 1px solid #5c5c5c;
background: #bfbfbf;
color: #191919;
flex: 1 0 auto;
}

.dock-layout .dock-panel.dock-style-paranext .dock-tab > div {
.dock-layout .dock-panel.dock-style-platform-bible .dock-tab > div {
padding-left: 7px;
}

/*
* Show borders on the sides of the dock-nav, not on the very edges of the dock-tabs,
* so the borders show even when the tabs don't fit in the space and you have to scroll
*/
.dock-layout .dock-panel.dock-style-paranext .dock-tab:first-child {
.dock-layout .dock-panel.dock-style-platform-bible .dock-tab:first-child {
border-left: 0;
}

.dock-layout .dock-panel.dock-style-paranext .dock-tab:nth-last-child(2) {
.dock-layout .dock-panel.dock-style-platform-bible .dock-tab:nth-last-child(2) {
border-right: 0;
}

.dock-layout .dock-panel.dock-style-paranext .dock-nav {
.dock-layout .dock-panel.dock-style-platform-bible .dock-nav {
border-left: 1px solid #5c5c5c;
border-right: 1px solid #5c5c5c;
}

.dock-layout .dock-panel.dock-style-paranext .dock-tab.dock-tab-active {
.dock-layout .dock-panel.dock-style-platform-bible .dock-tab.dock-tab-active {
background: #a6c9ff;
color: #191919;
border-bottom: 1px solid #a6c9ff;
}

/* Curved corners including on floating window */
.dock-layout .dock-panel.dock-style-paranext,
.dock-layout .dock-panel.dock-style-paranext .dock-bar,
.dock-layout .dock-panel.dock-style-paranext .dock-nav,
.dock-layout .dock-panel.dock-style-paranext .dock-nav-wrap,
.dock-layout .dock-panel.dock-style-paranext .dock-tab {
.dock-layout .dock-panel.dock-style-platform-bible,
.dock-layout .dock-panel.dock-style-platform-bible .dock-bar,
.dock-layout .dock-panel.dock-style-platform-bible .dock-nav,
.dock-layout .dock-panel.dock-style-platform-bible .dock-nav-wrap,
.dock-layout .dock-panel.dock-style-platform-bible .dock-tab {
border-radius: 5px 5px 0 0;
}

.dock-layout .dock-panel.dock-style-paranext .dock-bar {
.dock-layout .dock-panel.dock-style-platform-bible .dock-bar {
background: #8c8c8c;
padding: 0;
border: 0;
}

.dock-layout .dock-panel.dock-style-paranext .dock-tab-hit-area {
.dock-layout .dock-panel.dock-style-platform-bible .dock-tab-hit-area {
/* expand the invisible dock-tab-hit-area a bit to cover the border area above it */
left: -1px;
right: -1px;
}

.dock-layout .dock-panel.dock-style-paranext .dock-nav-wrap {
.dock-layout .dock-panel.dock-style-platform-bible .dock-nav-wrap {
/*
* Remove the handle bar at the top of each dock-tab. Note: Now, the tab
* group can only be grabbed by grabbing the intersection between two tabs
Expand All @@ -91,7 +91,7 @@
}

/* tabs take all the space */
.dock-layout .dock-panel.dock-style-paranext .dock-nav-list {
.dock-layout .dock-panel.dock-style-platform-bible .dock-nav-list {
flex-grow: 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
addWebViewToDock,
getFloatPosition,
loadTab,
} from './paranext-dock-layout.component';
} from './platform-dock-layout.component';

describe('Dock Layout Component', () => {
const mockDockLayout = mock(DockLayout);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'rc-dock/dist/rc-dock.css';
import './paranext-dock-layout.component.css';
import './platform-dock-layout.component.css';
import { useRef, useEffect } from 'react';
import DockLayout, {
BoxData,
Expand All @@ -15,8 +15,8 @@ import {
createErrorTab,
saveErrorTab,
} from '@renderer/components/docking/error-tab.component';
import ParanextPanel from '@renderer/components/docking/paranext-panel.component';
import ParanextTabTitle from '@renderer/components/docking/paranext-tab-title.component';
import PlatformPanel from '@renderer/components/docking/platform-panel.component';
import PlatformTabTitle from '@renderer/components/docking/platform-tab-title.component';
import {
loadWebViewTab,
TAB_TYPE_WEBVIEW,
Expand Down Expand Up @@ -51,11 +51,11 @@ import { getErrorMessage } from '@shared/utils/util';
import {
loadDownloadUpdateProjectTab,
TAB_TYPE_DOWNLOAD_UPDATE_PROJECT_DIALOG,
} from '@renderer/components/project-components/download-update-project-tab.component';
} from '@renderer/components/projects/download-update-project-tab.component';
import {
loadOpenMultipleProjectsTab,
TAB_TYPE_OPEN_MULTIPLE_PROJECTS_DIALOG,
} from '@renderer/components/project-components/open-multiple-projects-tab.component';
} from '@renderer/components/projects/open-multiple-projects-tab.component';
import {
TAB_TYPE_EXTENSION_MANAGER,
loadExtensionManagerTab,
Expand All @@ -64,7 +64,7 @@ import {
TAB_TYPE_RUN_BASIC_CHECKS,
loadRunBasicChecksTab,
} from '@renderer/components/run-basic-checks-dialog/run-basic-checks-tab.component';
import { hasDialogRequest, resolveDialogRequest } from '@renderer/services/dialog.service.host';
import { hasDialogRequest, resolveDialogRequest } from '@renderer/services/dialog.service-host';
import { DialogData } from '@shared/models/dialog-options.model';
import DIALOGS from '@renderer/components/dialogs';
import cloneDeep from 'lodash/cloneDeep';
Expand All @@ -80,8 +80,8 @@ const DEFAULT_PANEL_DIRECTION: PanelDirection = 'right';

const DOCK_FLOAT_OFFSET = 28;
// NOTE: 'card' is a built-in style. We can likely remove it when we create a full theme for
// Paranext.
const TAB_GROUP = 'card paranext';
// Platform.
const TAB_GROUP = 'card platform-bible';

const groups: { [key: string]: TabGroup } = {
[TAB_GROUP]: {
Expand All @@ -98,7 +98,7 @@ const groups: { [key: string]: TabGroup } = {
// a shared file.
// TODO: please move these utility functions with #203

/** tab loader functions for each Paranext tab type */
/** tab loader functions for each Platform tab type */
const tabLoaderMap = new Map<TabType, TabLoader>([
[TAB_TYPE_ABOUT, loadAboutTab],
[TAB_TYPE_BUTTONS, loadButtonsTab],
Expand All @@ -116,7 +116,7 @@ const tabLoaderMap = new Map<TabType, TabLoader>([
),
]);

/** tab saver functions for each Paranext tab type that wants to override the default */
/** tab saver functions for each Platform tab type that wants to override the default */
const tabSaverMap = new Map<TabType, TabSaver>([
[TAB_TYPE_WEBVIEW, saveWebViewTab],
[TAB_TYPE_ERROR, saveErrorTab],
Expand Down Expand Up @@ -170,8 +170,8 @@ export function loadTab(savedTabInfo: SavedTabInfo): RCDockTabInfo {
// Translate the data from the loaded tab to be in the form needed by rc-dock
return {
...tabInfo,
title: <ParanextTabTitle iconUrl={tabInfo.tabIconUrl} text={tabInfo.tabTitle} />,
content: <ParanextPanel>{tabInfo.content}</ParanextPanel>,
title: <PlatformTabTitle iconUrl={tabInfo.tabIconUrl} text={tabInfo.tabTitle} />,
content: <PlatformPanel>{tabInfo.content}</PlatformPanel>,
group: TAB_GROUP,
closable: true,
};
Expand Down Expand Up @@ -418,14 +418,14 @@ export function addWebViewToDock(
const tabId = webView.id;
if (!tabId)
throw new Error(
`paranext-dock-layout error: WebView of type ${webView.webViewType} has no id!`,
`platform-dock-layout error: WebView of type ${webView.webViewType} has no id!`,
);
return addTabToDock({ id: tabId, tabType: TAB_TYPE_WEBVIEW, data: webView }, layout, dockLayout);
}

// #endregion

export default function ParanextDockLayout() {
export default function PlatformDockLayout() {
// This ref will always be defined
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const dockLayoutRef = useRef<DockLayout>(null!);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactNode } from 'react';
import './paranext-panel.component.css';
import './platform-panel.component.css';

/**
* Used for possible styling on every panel in Paranext
Expand Down
Loading

0 comments on commit 15c2e29

Please sign in to comment.