Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
  • Loading branch information
Tristan-WorkGH committed Jul 17, 2024
1 parent ab4f667 commit bd04020
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
15 changes: 7 additions & 8 deletions demo/src/diagram-viewers/add-diagrams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export const addNadToDemo = () => {
.then((response) => response.text())
.then((svgContent) => {
new NetworkAreaDiagramViewer(
// @ts-expect-error: we know it's not null in the demo
document.getElementById('svg-container'),
document.getElementById('svg-container')!,
svgContent,
500,
600,
Expand All @@ -47,8 +46,7 @@ export const addSldToDemo = () => {
.then((response) => response.text())
.then((svgContent) => {
new SingleLineDiagramViewer(
// @ts-expect-error: we know it's not null in the demo
document.getElementById('svg-container-sld'),
document.getElementById('svg-container-sld')!,
svgContent, //svg content
null, //svg metadata
'voltage-level',
Expand All @@ -60,6 +58,7 @@ export const addSldToDemo = () => {
null, //callback on the breakers
null, //callback on the feeders
null, //callback on the buses
// @ts-expect-error: TODO look if null is really possible in code
null, //arrows color
null //hovers on equipments callback
);
Expand All @@ -74,9 +73,9 @@ export const addSldToDemo = () => {
.then((response) => response.text())
.then((svgContent) => {
new SingleLineDiagramViewer(
// @ts-expect-error: we know it's not null in the demo
document.getElementById('svg-container-sld-with-callbacks'),
document.getElementById('svg-container-sld-with-callbacks')!,
svgContent, //svg content
// @ts-expect-error: incomplete data in example json
SldSvgExampleMeta, //svg metadata
'voltage-level',
500,
Expand All @@ -101,9 +100,9 @@ export const addSldToDemo = () => {
.then((response) => response.text())
.then((svgContent) => {
new SingleLineDiagramViewer(
// @ts-expect-error: we know it's not null in the demo
document.getElementById('svg-container-sldsub-with-callbacks'),
document.getElementById('svg-container-sldsub-with-callbacks')!,
svgContent, //svg content
// @ts-expect-error: incomplete data in example json
SldSvgSubExampleMeta, //svg metadata
'substation',
500,
Expand Down
3 changes: 1 addition & 2 deletions demo/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';

// @ts-expect-error: not null in this demo
const root = ReactDOM.createRoot(document.getElementById('root'));
const root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(
<React.StrictMode>
<App />
Expand Down
2 changes: 1 addition & 1 deletion src/components/network-map-viewer/network/network-map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type NetworkMapProps = {
// resized, but not for programmatic resizes of the parent. For now in our
// app, only study display mode resizes programmatically
// use this prop to make the map resize when needed, each time this prop changes, map.resize() is trigged
triggerMapResizeOnChange: unknown;
triggerMapResizeOnChange?: unknown;
updatedLines?: LineLayerProps['updatedLines'];
useName?: boolean;
visible?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class SingleLineDiagramViewer {
onFeederCallback: OnFeederCallbackType | null,
onBusCallback: OnBusCallbackType | null,
selectionBackColor: string,
handleTogglePopover: HandleTogglePopoverType
handleTogglePopover: HandleTogglePopoverType | null
) {
this.container = container;
this.svgType = svgType;
Expand Down

0 comments on commit bd04020

Please sign in to comment.