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) {
|
if (!open && selectedRows) {
|
||||||
handleOnNewValue({
|
handleOnNewValue({
|
||||||
value: data.map((row) => {
|
value: data.map((row) => {
|
||||||
const processedValue = (
|
const name = parseString(row.name, [
|
||||||
row.name !== ""
|
|
||||||
? parseString(row.name, ["snake_case", "no_blank", "lowercase"])
|
|
||||||
: parseString(row.display_name, [
|
|
||||||
"snake_case",
|
"snake_case",
|
||||||
"no_blank",
|
"no_blank",
|
||||||
"lowercase",
|
"lowercase",
|
||||||
])
|
]);
|
||||||
|
const display_name = parseString(row.display_name, [
|
||||||
|
"snake_case",
|
||||||
|
"no_blank",
|
||||||
|
"lowercase",
|
||||||
|
]);
|
||||||
|
const processedValue = (
|
||||||
|
name !== "" && name !== display_name
|
||||||
|
? name
|
||||||
|
: isAction
|
||||||
|
? ""
|
||||||
|
: display_name
|
||||||
).slice(0, 46);
|
).slice(0, 46);
|
||||||
|
|
||||||
const processedDescription =
|
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(
|
return selectedRows?.some(
|
||||||
(selected) =>
|
(selected) =>
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,14 @@ export function parseString(
|
||||||
): string {
|
): string {
|
||||||
let result = str;
|
let result = str;
|
||||||
|
|
||||||
|
if (result === "") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parsers.includes("no_blank") && result.trim() === "") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
let parsersArray: FieldParserType[] = [];
|
let parsersArray: FieldParserType[] = [];
|
||||||
|
|
||||||
if (typeof parsers === "string") {
|
if (typeof parsers === "string") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue