Skip to content

Commit dfe03f6

Browse files
committed
Fixed error in the backend, and cleaned up non typesafe code in frontend
1 parent 9f5a8ed commit dfe03f6

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/test-app-backend/src/ChangedInstancesProcessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class ChangedInstancesProcessor {
8181
changesetFileProps: Partial<ChangesetFileProps>[],
8282
db: IModelDb,
8383
): Promise<ChangedECInstance[]> {
84-
const ecChangeUnifier = new PartialECChangeUnifier();
84+
const ecChangeUnifier = new PartialECChangeUnifier(db);
8585

8686
const changesetFilePaths = changesetFileProps
8787
.filter((csFile) => csFile.pathname !== undefined)

packages/test-app-backend/src/main.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55
import { IModelHost } from "@itwin/core-backend";
66
import { Logger, LogLevel } from "@itwin/core-bentley";
7-
import { BentleyCloudRpcManager, HttpServerRequest, HttpServerResponse, IModelReadRpcInterface, IModelTileRpcInterface, RpcManager } from "@itwin/core-common";
7+
import { BentleyCloudRpcManager, IModelReadRpcInterface, IModelTileRpcInterface, RpcManager } from "@itwin/core-common";
88
import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common";
99
import { ECSchemaRpcImpl } from "@itwin/ecschema-rpcinterface-impl";
1010
import { IModelJsExpressServer } from "@itwin/express-server";
@@ -14,7 +14,6 @@ import { AzureClientStorage, BlockBlobClientWrapperFactory } from "@itwin/object
1414
import { Presentation } from "@itwin/presentation-backend";
1515
import { PresentationRpcInterface } from "@itwin/presentation-common";
1616
import { config } from "dotenv-flow";
17-
import express from "express";
1817
import { ChangesRpcImpl } from "./RPC/ChangesRpcImpl";
1918
import { ChangesRpcInterface } from "./RPC/ChangesRpcInterface";
2019

@@ -43,12 +42,8 @@ void (async () => {
4342
{ info: { title: "test-app-backend", version: "v1.0" } },
4443
[IModelReadRpcInterface, IModelTileRpcInterface, PresentationRpcInterface, ChangesRpcInterface, ECSchemaRpcInterface],
4544
);
46-
const app = express();
45+
4746
const server = new IModelJsExpressServer(rpcConfig.protocol);
4847
await server.initialize(port);
4948
console.log(`Backend (PID ${process.pid}) is listening on port ${port}.`);
50-
51-
app.post("*", async (request: HttpServerRequest, response: HttpServerResponse) => {
52-
await rpcConfig.protocol.handleOperationPostRequest(request, response);
53-
});
5449
})();

packages/test-app-frontend/src/App/ITwinJsApp/AppUi/PropertyComparisonViewport.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ import React from "react";
1111
import { getSchemaContext } from "./presentation/SchemaContextProvider";
1212
import { getUnifiedSelectionStorage } from "./presentation/SelectionStorage";
1313

14+
declare global {
15+
interface Window { // extend the Window interface, via interface merging. https://www.typescriptlang.org/docs/handbook/declaration-merging.html
16+
viewport?: ScreenViewport;
17+
}
18+
}
19+
1420
export interface PropertyComparisonViewportContentProps {
1521
iModelConnection: IModelConnection;
1622
getViewState: () => ViewStateProp | undefined;
@@ -58,8 +64,7 @@ export function PropertyComparisonViewportContent(props: PropertyComparisonViewp
5864
viewportRef={(v: ScreenViewport) => {
5965
// for convenience, if window defined bind viewport to window
6066
if (undefined !== window) {
61-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-assertion
62-
(window as any).viewport = v;
67+
window.viewport = v;
6368
}
6469
} } />
6570
);

0 commit comments

Comments
 (0)