Skip to content
Snippets Groups Projects
Unverified Commit 97ac62bf authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Do not show parameters for non-variable template tags in the action editor (#29028)

parent dac6d4dd
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,9 @@ export function enableActionsForDB(dbId = SAMPLE_DB_ID) {
}
export function fillActionQuery(query) {
cy.get(".ace_content").type(query, { parseSpecialCharSequences: false });
cy.get(".ace_content:visible").type(query, {
parseSpecialCharSequences: false,
});
}
/**
*
......
......@@ -330,6 +330,26 @@ describe(
cy.findByLabelText("Success message").should("be.disabled");
});
});
it("should display parameters for variable template tags only", () => {
cy.visit("/");
cy.findByText("New").click();
popover().findByText("Action").click();
cy.findByText("Select a database").click();
popover().within(() => cy.findByText("QA Postgres12").click());
fillActionQuery("{{#1-orders-model}}");
cy.findByLabelText("#1-orders-model").should("not.exist");
fillActionQuery("{{snippet:101}}");
cy.findByLabelText("#1-orders-model").should("not.exist");
cy.findByLabelText("101").should("not.exist");
fillActionQuery("{{id}}");
cy.findByLabelText("#1-orders-model").should("not.exist");
cy.findByLabelText("101").should("not.exist");
cy.findByLabelText("Id").should("be.visible");
});
},
);
......
......@@ -75,7 +75,7 @@ export const setTemplateTagTypesFromFieldSettings = (
const query = question.query() as NativeQuery;
let tempQuestion = question.clone();
query.templateTagsWithoutSnippets().forEach((tag: TemplateTag) => {
query.variableTemplateTags().forEach((tag: TemplateTag) => {
const currentQuery = tempQuestion.query() as NativeQuery;
const fieldType = fields[tag.id]?.fieldType ?? "string";
const nextTag = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment