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:
parent
dada8417a5
commit
3bb0779fd6
2 changed files with 29 additions and 8 deletions
|
|
@ -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) =>
|
||||
|
|
|
|||
|
|
@ -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") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue