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
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,12 @@ const AIChat: React.FC = () => {
case Command.DataMap: {
switch (parsedInput.templateId) {
case "mappings-for-records":
// TODO: Update this to use the LS API for validating function names
const invalidPattern = /[<>\/\(\)\{\}\[\]\\!@#$%^&*+=|;:'",.?`~]/;
if (invalidPattern.test(parsedInput.placeholderValues.functionName)) {
throw new Error("Please provide a valid function name without special characters.");
}

await processMappingParameters(
inputText,
{
Expand Down Expand Up @@ -1565,12 +1571,6 @@ const AIChat: React.FC = () => {

const functionName = parameters.functionName;

const invalidPattern = /[<>\/\(\)\{\}\[\]\\!@#$%^&*_+=|;:'",.?`~]/;

if (invalidPattern.test(functionName)) {
throw new Error("Please provide a valid function name without special characters.");
}

const projectImports = await rpcClient.getBIDiagramRpcClient().getAllImports();
const activeFile = await rpcClient.getAiPanelRpcClient().getActiveFile();
const projectComponents = await rpcClient.getBIDiagramRpcClient().getProjectComponents();
Expand Down
Loading