Skip to content

Commit

Permalink
devtools: Remove auto type conversion of opslang command parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
kobkaz committed Jan 23, 2025
1 parent eca8c69 commit a65dbc8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions devtools-frontend/src/components/CommandView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ const buildTco = (
const parameterSchema = commandSchema.parameters[i];
const parameter = commandLine.parameters[i];
const name = `param${i + 1}`;
const typeConversionWarning = (from, to) => {
window.alert(
`Automatically converting ${from} to ${to} at ${name}. \n` +
"Automatic conversion will be removed in future!!",
);
};
switch (parameterSchema.dataType) {
case CommandParameterDataType.CMD_PARAMETER_BYTES:
switch (parameter.type) {
Expand Down Expand Up @@ -164,6 +170,7 @@ const buildTco = (
});
break;
case "bytes":
typeConversionWarning("bytes", "double");
tcoParams.push({
name,
value: {
Expand All @@ -188,6 +195,7 @@ const buildTco = (
});
break;
case "integer":
typeConversionWarning("integer", "double");
tcoParams.push({
name,
value: {
Expand All @@ -197,6 +205,7 @@ const buildTco = (
});
break;
case "bytes":
typeConversionWarning("bytes", "double");
tcoParams.push({
name,
value: {
Expand Down

0 comments on commit a65dbc8

Please sign in to comment.