Skip to content

Commit 465497c

Browse files
committed
Better warnings
1 parent aaf3b21 commit 465497c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

dashi/src/actions/setComponentVisibility.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import appStore from "../store/appStore";
33
import { ContribPoint } from "../model/extension";
44
import fetchApiResult from "../utils/fetchApiResult";
55
import { updateContributionState } from "./updateContributionState";
6+
import {Input} from "../model/callback";
67

78
export function setComponentVisibility(
89
contribPoint: ContribPoint,
@@ -48,10 +49,13 @@ function getLayoutInputValues(
4849
const contributionModel = contributionModels[contribIndex];
4950
const inputs = contributionModel.layout!.inputs;
5051
if (inputs && inputs.length > 0) {
51-
// TODO: get inputValue from sources specified by input.kind.
52-
// For time being we use null as it is JSON-serializable
53-
return inputs.map((input) => {
54-
console.warn(`layout input not supported yet`, input);
52+
return inputs.map((input: Input) => {
53+
if (!input.kind || input.kind === "Component") {
54+
console.warn(`input kind not supported in layout:`, input);
55+
} else {
56+
// TODO: Get value from another kind of input.
57+
console.warn(`input kind not supported yet:`, input);
58+
}
5559
return null;
5660
});
5761
} else {

0 commit comments

Comments
 (0)