fix: makes action title follow the flow name after editing to old title (#8293)

* Set names and descriptions as empty to get from flow name when empty instead of assigning the immediate name

* Changed to compare already parsed values

* changed parseString to return empty when the string is empty or have only spaces
This commit is contained in:
Lucas Oliveira 2025-06-02 14:36:40 -03:00 committed by GitHub
commit 3bb0779fd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 8 deletions

View file

@ -80,18 +80,31 @@ export default function ToolsTable({
if (!open && selectedRows) {
handleOnNewValue({
value: data.map((row) => {
const name = parseString(row.name, [
"snake_case",
"no_blank",
"lowercase",
]);
const display_name = parseString(row.display_name, [
"snake_case",
"no_blank",
"lowercase",
]);
const processedValue = (
row.name !== ""
? parseString(row.name, ["snake_case", "no_blank", "lowercase"])
: parseString(row.display_name, [
"snake_case",
"no_blank",
"lowercase",
])
name !== "" && name !== display_name
? name
: isAction
? ""
: display_name
).slice(0, 46);
const processedDescription =
row.description !== "" ? row.description : row.display_description;
row.description !== "" &&
row.description !== row.display_description
? row.description
: isAction
? ""
: row.display_description;
return selectedRows?.some(
(selected) =>

View file

@ -78,6 +78,14 @@ export function parseString(
): string {
let result = str;
if (result === "") {
return "";
}
if (parsers.includes("no_blank") && result.trim() === "") {
return "";
}
let parsersArray: FieldParserType[] = [];
if (typeof parsers === "string") {