Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 32 additions & 33 deletions extensions/ql-vscode/src/view/model-editor/MethodRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,39 +359,38 @@ const ModelableMethodRow = forwardRef<HTMLDivElement, MethodRowProps>(
);
ModelableMethodRow.displayName = "ModelableMethodRow";

const UnmodelableMethodRow = forwardRef<
HTMLDivElement,
MethodRowProps
>((props: MethodRowProps, ref) => {
const { method, viewState, revealedMethodSignature } = props;

const jumpToMethod = useCallback(
() => sendJumpToMethodMessage(method),
[method],
);

return (
<DataGridRow
data-testid="unmodelable-method-row"
focused={revealedMethodSignature === method.signature}
>
<DataGridCell ref={ref}>
<ApiOrMethodRow>
<ModelingStatusIndicator status="saved" />
<MethodClassifications method={method} />
<MethodName {...props.method} />
{viewState.mode === Mode.Application && (
<UsagesButton onClick={jumpToMethod}>
{method.usages.length}
</UsagesButton>
)}
<ViewLink onClick={jumpToMethod}>View</ViewLink>
</ApiOrMethodRow>
</DataGridCell>
<DataGridCell gridColumn="span 5">Method already modeled</DataGridCell>
</DataGridRow>
);
});
const UnmodelableMethodRow = forwardRef<HTMLDivElement, MethodRowProps>(
(props: MethodRowProps, ref) => {
const { method, viewState, revealedMethodSignature } = props;

const jumpToMethod = useCallback(
() => sendJumpToMethodMessage(method),
[method],
);

return (
<DataGridRow
data-testid="unmodelable-method-row"
focused={revealedMethodSignature === method.signature}
>
<DataGridCell ref={ref}>
<ApiOrMethodRow>
<ModelingStatusIndicator status="saved" />
<MethodClassifications method={method} />
<MethodName {...props.method} />
{viewState.mode === Mode.Application && (
<UsagesButton onClick={jumpToMethod}>
{method.usages.length}
</UsagesButton>
)}
<ViewLink onClick={jumpToMethod}>View</ViewLink>
</ApiOrMethodRow>
</DataGridCell>
<DataGridCell gridColumn="span 5">Method already modeled</DataGridCell>
</DataGridRow>
);
},
);
UnmodelableMethodRow.displayName = "UnmodelableMethodRow";

function sendJumpToMethodMessage(method: Method) {
Expand Down
Loading