🐛 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 <Tooltip
title={ title={
!validationStatus ? ( !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"> <div className="max-h-96 overflow-auto">
{validationStatus.params {validationStatus.params

View file

@ -112,7 +112,7 @@ export default function InputFileComponent({
{!editNode && !loading && ( {!editNode && !loading && (
<FileSearch2 <FileSearch2
strokeWidth={1.5} 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 && ( {!editNode && loading && (

View file

@ -30,24 +30,23 @@ export default function TextAreaComponent({
<div className={disabled ? "cursor-not-allowed" : ""}> <div className={disabled ? "cursor-not-allowed" : ""}>
<div <div
className={ 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" : "") (disabled ? " pointer-events-none" : "")
} }
> >
<input <input
value={myValue} value={myValue}
className={ className={
editNode editNode
? "input-edit-node" ? "input-edit-node"
: "input-primary" + (disabled ? " input-disable " : "") : "input-primary" + (disabled ? " input-disable " : "")
} }
placeholder={"Type something..."} placeholder={"Type something..."}
onChange={(e) => { onChange={(e) => {
setMyValue(e.target.value); setMyValue(e.target.value);
onChange(e.target.value); onChange(e.target.value);
}} }}
/> />
<button <button
onClick={() => { onClick={() => {

View file

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

View file

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

View file

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

View file

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

View file

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