File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
extensions/ql-vscode/src/view/method-modeling Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { vscode } from "../vscode-api";
1010import { NotInModelingMode } from "./NotInModelingMode" ;
1111import { NoMethodSelected } from "./NoMethodSelected" ;
1212import { MethodModelingPanelViewState } from "../../model-editor/shared/view-state" ;
13+ import { convertFromLegacyModeledMethod } from "../../model-editor/shared/modeled-methods-legacy" ;
1314
1415type Props = {
1516 initialViewState ?: MethodModelingPanelViewState ;
@@ -31,7 +32,10 @@ export function MethodModelingView({ initialViewState }: Props): JSX.Element {
3132
3233 const modelingStatus = useMemo (
3334 ( ) =>
34- getModelingStatus ( modeledMethod ? [ modeledMethod ] : [ ] , isMethodModified ) ,
35+ getModelingStatus (
36+ convertFromLegacyModeledMethod ( modeledMethod ) ,
37+ isMethodModified ,
38+ ) ,
3539 [ modeledMethod , isMethodModified ] ,
3640 ) ;
3741
@@ -95,7 +99,7 @@ export function MethodModelingView({ initialViewState }: Props): JSX.Element {
9599 < MethodModeling
96100 modelingStatus = { modelingStatus }
97101 method = { method }
98- modeledMethods = { modeledMethod ? [ modeledMethod ] : [ ] }
102+ modeledMethods = { convertFromLegacyModeledMethod ( modeledMethod ) }
99103 showMultipleModels = { viewState ?. showMultipleModels }
100104 onChange = { onChange }
101105 />
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { MethodModelingInputs } from "./MethodModelingInputs";
44import { Method } from "../../model-editor/method" ;
55import { styled } from "styled-components" ;
66import { MultipleModeledMethodsPanel } from "./MultipleModeledMethodsPanel" ;
7+ import { convertToLegacyModeledMethod } from "../../model-editor/shared/modeled-methods-legacy" ;
78
89export type ModeledMethodsPanelProps = {
910 method : Method ;
@@ -26,9 +27,7 @@ export const ModeledMethodsPanel = ({
2627 return (
2728 < SingleMethodModelingInputs
2829 method = { method }
29- modeledMethod = {
30- modeledMethods . length > 0 ? modeledMethods [ 0 ] : undefined
31- }
30+ modeledMethod = { convertToLegacyModeledMethod ( modeledMethods ) }
3231 onChange = { onChange }
3332 />
3433 ) ;
You can’t perform that action at this time.
0 commit comments