🐛 fix(GenericNode): improve readability of tooltip title by formatting the JSX code

🐛 fix(inputFileComponent): fix class order in className to ensure proper styling
🐛 fix(textAreaComponent): fix class order in className to ensure proper styling
🐛 fix(API): remove trailing whitespace at the end of the file
🐛 fix(ApiModal): add missing space before if statement condition
🐛 fix(genericModal): remove unnecessary whitespace and fix class order in className
🐛 fix(utils): add missing comma in INVALID_CHARACTERS array
🐛 fix(tailwind.config.js): add missing comma in custom-scroll CSS rule
This commit is contained in:
Lucas Oliveira 2023-07-07 11:36:34 -03:00
commit 3842b90907
8 changed files with 39 additions and 35 deletions

View file

@ -118,8 +118,14 @@ export default function GenericNode({
<Tooltip
title={
!validationStatus ? (
<span className="flex">Build <Zap className="mx-0.5 h-5 fill-build-trigger stroke-build-trigger stroke-1" strokeWidth={1.5} /> flow to validate status.</span>
<span className="flex">
Build{" "}
<Zap
className="mx-0.5 h-5 fill-build-trigger stroke-build-trigger stroke-1"
strokeWidth={1.5}
/>{" "}
flow to validate status.
</span>
) : (
<div className="max-h-96 overflow-auto">
{validationStatus.params

View file

@ -112,7 +112,7 @@ export default function InputFileComponent({
{!editNode && !loading && (
<FileSearch2
strokeWidth={1.5}
className="h-6 w-6 hover:text-accent-foreground ml-3"
className="ml-3 h-6 w-6 hover:text-accent-foreground"
/>
)}
{!editNode && loading && (

View file

@ -30,24 +30,23 @@ export default function TextAreaComponent({
<div className={disabled ? "cursor-not-allowed" : ""}>
<div
className={
(editNode ? "w-full relative top-2" : "flex w-full items-center") +
(editNode ? "relative top-2 w-full" : "flex w-full items-center") +
(disabled ? " pointer-events-none" : "")
}
>
<input
value={myValue}
className={
editNode
? "input-edit-node"
: "input-primary" + (disabled ? " input-disable " : "")
}
placeholder={"Type something..."}
onChange={(e) => {
setMyValue(e.target.value);
onChange(e.target.value);
}}
/>
value={myValue}
className={
editNode
? "input-edit-node"
: "input-primary" + (disabled ? " input-disable " : "")
}
placeholder={"Type something..."}
onChange={(e) => {
setMyValue(e.target.value);
onChange(e.target.value);
}}
/>
<button
onClick={() => {

View file

@ -338,4 +338,4 @@ export async function uploadFile(
const formData = new FormData();
formData.append("file", file);
return await axios.post(`/api/v1/upload/${id}`, formData);
}
}

View file

@ -111,7 +111,7 @@ export default function ApiModal({ flow }: { flow: FlowType }) {
startTweaks();
}
} else {
if(tweak?.current){
if (tweak?.current) {
startTweaks();
}
}

View file

@ -206,7 +206,7 @@ export default function GenericModal({
{type == TypeModal.PROMPT && isEdit ? (
<Textarea
ref={ref}
className="form-input h-full w-full rounded-lg border-gray-300 focus-visible:ring-1 dark:border-gray-700 dark:bg-gray-900 dark:text-white custom-scroll"
className="form-input h-full w-full rounded-lg border-gray-300 custom-scroll focus-visible:ring-1 dark:border-gray-700 dark:bg-gray-900 dark:text-white"
value={inputValue}
onBlur={() => {
blur();
@ -236,15 +236,14 @@ export default function GenericModal({
)}
</div>
{type == TypeModal.PROMPT && (
<>
<div className="h-[6vh] overflow-y-auto custom-scroll">
<div className="items-center flex flex-wrap">
<Variable className=" -ml-px mr-1 h-4 w-4 text-primary flex"></Variable>
<>
<div className="h-[6vh] overflow-y-auto custom-scroll">
<div className="flex flex-wrap items-center">
<Variable className=" -ml-px mr-1 flex h-4 w-4 text-primary"></Variable>
<span className="text-md font-semibold text-primary">
Input Variables: {wordsHighlight &&
wordsHighlight.length == 0 ? '-' : ''}
Input Variables:{" "}
{wordsHighlight && wordsHighlight.length == 0 ? "-" : ""}
</span>
{wordsHighlight.map((word, index) => (
@ -256,7 +255,8 @@ export default function GenericModal({
>
<Badge
key={index}
variant="gray" size="md"
variant="gray"
size="md"
className="m-1 max-w-[40vw] cursor-default truncate p-2.5 text-sm"
>
<div className="relative bottom-[1px]">
@ -269,11 +269,10 @@ export default function GenericModal({
</Badge>
</ShadTooltip>
))}
</div>
</div>
</>
)}
</div>
</>
)}
<DialogFooter>
<Button
@ -282,7 +281,7 @@ export default function GenericModal({
switch (myModalType) {
case 1:
setValue(inputValue);
setModalOpen(false);
setModalOpen(false);
break;
case 2:
validatePrompt(false);

View file

@ -1022,7 +1022,7 @@ export const INVALID_CHARACTERS = [
")",
"[",
"]",
"\n"
"\n",
];
export const regexHighlight = /\{([^}]+)\}/g;

View file

@ -199,7 +199,7 @@ module.exports = {
".custom-scroll": {
"&::-webkit-scrollbar": {
width: "8px",
height: "8px"
height: "8px",
},
"&::-webkit-scrollbar-track": {
backgroundColor: "#f1f1f1",