🐛 fix(parameterComponent): use strict equality operator (===) instead of loose equality operator (==) for item.type comparison to improve code quality and avoid potential bugs

🐛 fix(parameterComponent): update style prop value in ShadTooltip component to use class names 'tooltip-fixed-width' and 'custom-scroll' for consistent styling and better readability
🐛 fix(parameterComponent): update disabled prop value in TextAreaComponent to use the disabled variable passed as a prop for consistency and better code organization
🐛 fix(AccordionComponent): use strict equality operator (===) instead of loose equality operator (==) for open.length comparison to improve code quality and avoid potential bugs
🐛 fix(codeAreaComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(codeAreaComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(codeAreaComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(codeAreaComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(inputFileComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(inputFileComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(inputFileComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(inputFileComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(intComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(intComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(promptComponent): add missing dependencies to useEffect dependency array to avoid potential bugs and improve code quality
🐛 fix(promptComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(textAreaComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(textAreaComponent): remove unnecessary space in className prop value to improve code readability
🐛 fix(tabsContext): change getTweak initial state from an object to an empty array to match the expected type and avoid potential bugs
🐛 fix(ApiModal): add missing curly braces around the buildTweaks function call to ensure the correct value is pushed to the tweak.current array

🐛 fix(EditNodeModal): remove unnecessary 'save' variable from useContext destructuring
🐛 fix(chatMessage): use strict equality operator (===) instead of loose equality operator (==) for comparison
🐛 fix(chatModal): use strict equality operator (===) instead of loose equality operator (==) for comparison
🐛 fix(codeAreaModal): add 'setCloseEdit' to useContext destructuring and add 'setModalOpen' function
🐛 fix(chatInput): use strict equality operator (===) instead of loose equality operator (==) for comparison
🐛 fix(chatMessage): use strict equality operator (===) instead of loose equality operator (==) for comparison
🐛 fix(formModal): use strict equality operator (===) instead of loose equality operator (==) for comparison
🐛 fix(formModal): use strict equality operator (===) instead of loose equality operator (==) for comparison
🐛 fix(formModal): use strict equality operator (===) instead of loose equality operator (==) for comparison
🐛 fix(formModal): use strict equality operator (===) instead of loose equality operator (==) for comparison
🐛 fix(genericModal): use strict equality operator (===) instead of loose equality operator (==) for comparison
🐛 fix(flow): add missing newline at the end of the file
🐛 fix(tabs): add missing import for TweaksType from flow

🐛 fix(utils.ts): change comparison operator from '==' to '===' for better type safety and strict equality check
This commit is contained in:
Cristhian Zanforlin Lousa 2023-07-10 10:29:09 -03:00
commit 243b59507b
21 changed files with 72 additions and 63 deletions

View file

@ -122,7 +122,7 @@ export default function ParameterComponent({
{nodeNames[item.family] ?? ""}{" "} {nodeNames[item.family] ?? ""}{" "}
<span className="text-xs"> <span className="text-xs">
{" "} {" "}
{item.type == "" ? "" : " - "} {item.type === "" ? "" : " - "}
{item.type.split(", ").length > 2 {item.type.split(", ").length > 2
? item.type.split(", ").map((el, i) => ( ? item.type.split(", ").map((el, i) => (
<React.Fragment key={el + i}> <React.Fragment key={el + i}>
@ -176,7 +176,7 @@ export default function ParameterComponent({
<></> <></>
) : ( ) : (
<ShadTooltip <ShadTooltip
style="max-w-[30vw] max-h-[20vh] overflow-auto custom-scroll" style="tooltip-fixed-width custom-scroll"
delayDuration={0} delayDuration={0}
content={refHtml.current} content={refHtml.current}
side={left ? "left" : "right"} side={left ? "left" : "right"}
@ -217,7 +217,7 @@ export default function ParameterComponent({
/> />
) : data.node.template[name].multiline ? ( ) : data.node.template[name].multiline ? (
<TextAreaComponent <TextAreaComponent
disabled={false} disabled={disabled}
value={data.node.template[name].value ?? ""} value={data.node.template[name].value ?? ""}
onChange={handleOnNewValue} onChange={handleOnNewValue}
/> />

View file

@ -13,7 +13,7 @@ export default function AccordionComponent({
open = [], open = [],
}: AccordionComponentType) { }: AccordionComponentType) {
const [value, setValue] = useState( const [value, setValue] = useState(
open.length == 0 ? "" : getOpenAccordion() open.length === 0 ? "" : getOpenAccordion()
); );
function getOpenAccordion() { function getOpenAccordion() {

View file

@ -27,15 +27,10 @@ export default function CodeAreaComponent({
useEffect(() => { useEffect(() => {
setMyValue(typeof value == "string" ? value : JSON.stringify(value)); setMyValue(typeof value == "string" ? value : JSON.stringify(value));
}, [value]); }, [value]);
return ( return (
<div className={disabled ? "cursor-not-allowed" : ""}> <div className={disabled ? "pointer-events-none w-full " : " w-full"}>
<div
className={
(editNode ? "w-full items-center" : "flex w-full items-center") +
(disabled ? " pointer-events-none" : "")
}
>
<div className="flex w-full items-center"> <div className="flex w-full items-center">
<span <span
onClick={() => { onClick={() => {
@ -53,9 +48,8 @@ export default function CodeAreaComponent({
}} }}
className={ className={
editNode editNode
? "input-edit-node input-dialog " ? "input-edit-node"
: "input-dialog input-primary " + : "input-primary text-muted-foreground" + (disabled ? " input-disable" : "")
(disabled ? "input-disable" : "")
} }
> >
{myValue !== "" ? myValue : "Type something..."} {myValue !== "" ? myValue : "Type something..."}
@ -87,6 +81,5 @@ export default function CodeAreaComponent({
</button> </button>
</div> </div>
</div> </div>
</div>
); );
} }

View file

@ -98,10 +98,8 @@ export default function InputFileComponent({
onClick={handleButtonClick} onClick={handleButtonClick}
className={ className={
editNode editNode
? " input-edit-node " + " input-dialog " ? "input-edit-node input-dialog text-muted-foreground"
: (disabled ? " input-disable " : "") + : (disabled ? "input-disable input-primary input-dialog" : "input-primary input-dialog text-muted-foreground")
" input-primary " +
" input-dialog "
} }
> >
{myValue !== "" ? myValue : "No file"} {myValue !== "" ? myValue : "No file"}

View file

@ -30,7 +30,7 @@ export default function IntComponent({
<div <div
className={ className={
"w-full " + "w-full " +
(disabled ? "pointer-events-none w-full cursor-not-allowed" : "w-full") (disabled ? "pointer-events-none w-full cursor-not-allowed" : "")
} }
> >
<input <input
@ -70,7 +70,7 @@ export default function IntComponent({
className={ className={
editNode editNode
? " input-edit-node " ? " input-edit-node "
: " input-primary " + (disabled ? " input-disable " : "") : " input-primary " + (disabled ? " input-disable" : "")
} }
placeholder={editNode ? "Integer number" : "Type an integer number"} placeholder={editNode ? "Integer number" : "Type an integer number"}
onChange={(e) => { onChange={(e) => {

View file

@ -44,7 +44,7 @@ export default function PromptAreaComponent({
}) })
.catch((error) => {}); .catch((error) => {});
} }
}, [reactFlowInstance, field_name]); }, [reactFlowInstance, field_name, myValue, nodeClass, setNodeClass]);
return ( return (
<div className={disabled ? "cursor-not-allowed" : ""}> <div className={disabled ? "cursor-not-allowed" : ""}>
@ -69,10 +69,9 @@ export default function PromptAreaComponent({
}} }}
className={ className={
editNode editNode
? " input-edit-node " + " input-dialog " ? "input-edit-node input-dialog"
: (disabled ? " input-disable " : "") + : (disabled ? " input-disable " : "") +
" input-primary " + " input-primary input-dialog"
" input-dialog "
} }
> >
{myValue !== "" ? myValue : "Type your prompt here"} {myValue !== "" ? myValue : "Type your prompt here"}

View file

@ -27,13 +27,8 @@ export default function TextAreaComponent({
}, [closePopUp]); }, [closePopUp]);
return ( return (
<div className={disabled ? "cursor-not-allowed" : ""}> <div className={disabled ? "pointer-events-none w-full " : " w-full"}>
<div <div className="flex w-full items-center">
className={
(editNode ? "relative top-2 w-full" : "flex w-full items-center") +
(disabled ? " pointer-events-none" : "")
}
>
<input <input
value={myValue} value={myValue}
className={ className={
@ -46,6 +41,7 @@ export default function TextAreaComponent({
setMyValue(e.target.value); setMyValue(e.target.value);
onChange(e.target.value); onChange(e.target.value);
}} }}
/> />
<button <button

View file

@ -54,7 +54,7 @@ const TabsContextInitialValue: TabsContextType = {
setTabsState: (state: TabsState) => {}, setTabsState: (state: TabsState) => {},
getNodeId: (nodeType: string) => "", getNodeId: (nodeType: string) => "",
setTweak: (tweak: any) => {}, setTweak: (tweak: any) => {},
getTweak: {}, getTweak: [],
paste: ( paste: (
selection: { nodes: any; edges: any }, selection: { nodes: any; edges: any },
position: { x: number; y: number; paneX?: number; paneY?: number } position: { x: number; y: number; paneX?: number; paneY?: number }
@ -75,7 +75,7 @@ export function TabsProvider({ children }: { children: ReactNode }) {
const { templates, reactFlowInstance } = useContext(typesContext); const { templates, reactFlowInstance } = useContext(typesContext);
const [lastCopiedSelection, setLastCopiedSelection] = useState(null); const [lastCopiedSelection, setLastCopiedSelection] = useState(null);
const [tabsState, setTabsState] = useState<TabsState>({}); const [tabsState, setTabsState] = useState<TabsState>({});
const [getTweak, setTweak] = useState({}); const [getTweak, setTweak] = useState([]);
const newNodeId = useRef(uid()); const newNodeId = useRef(uid());
function incrementNodeId() { function incrementNodeId() {

View file

@ -205,6 +205,7 @@ The cursor: default; property value restores the browser's default cursor style
.input-primary { .input-primary {
@apply bg-background block border-ring form-input px-3 placeholder:text-muted-foreground rounded-md shadow-sm sm:text-sm truncate w-full; @apply bg-background block border-ring form-input px-3 placeholder:text-muted-foreground rounded-md shadow-sm sm:text-sm truncate w-full;
} }
.input-edit-node{ .input-edit-node{
@apply input-primary placeholder:text-center pt-0.5 pb-0.5 text-center @apply input-primary placeholder:text-center pt-0.5 pb-0.5 text-center
} }
@ -212,7 +213,7 @@ The cursor: default; property value restores the browser's default cursor style
@apply input-primary pr-7 mx-2 @apply input-primary pr-7 mx-2
} }
.input-disable{ .input-disable{
@apply bg-input @apply bg-input text-muted-foreground
} }
.input-dialog{ .input-dialog{
@apply text-ring cursor-pointer bg-transparent @apply text-ring cursor-pointer bg-transparent
@ -1049,5 +1050,8 @@ The cursor: default; property value restores the browser's default cursor style
@apply relative w-full rounded-md shadow-sm @apply relative w-full rounded-md shadow-sm
} }
.tooltip-fixed-width{
@apply max-w-[30vw] max-h-[20vh] overflow-auto
}
} }

View file

@ -142,7 +142,8 @@ export default function ApiModal({ flow }: { flow: FlowType }) {
} }
function startTweaks() { function startTweaks() {
tweak?.current?.push(buildTweaks(flow)); const t = buildTweaks(flow);
tweak?.current?.push(t);
} }
function filterNodes() { function filterNodes() {
@ -266,7 +267,7 @@ export default function ApiModal({ flow }: { flow: FlowType }) {
return ( return (
<Dialog open={true} onOpenChange={setModalOpen}> <Dialog open={true} onOpenChange={setModalOpen}>
<DialogTrigger></DialogTrigger> <DialogTrigger></DialogTrigger>
<DialogContent className="h-[80vh] lg:max-w-[80vw]"> <DialogContent className="h-[80vh] md:max-w-[80vw]">
<DialogHeader> <DialogHeader>
<DialogTitle className="flex items-center"> <DialogTitle className="flex items-center">
<span className="pr-2">Code</span> <span className="pr-2">Code</span>
@ -382,10 +383,10 @@ export default function ApiModal({ flow }: { flow: FlowType }) {
key={i} key={i}
className="h-10 dark:border-b-muted" className="h-10 dark:border-b-muted"
> >
<TableCell className="p-0 text-center text-sm text-gray-900"> <TableCell className="p-0 text-center text-sm text-foreground">
{n} {n}
</TableCell> </TableCell>
<TableCell className="p-0 text-center text-xs text-gray-900 dark:text-gray-300"> <TableCell className="p-0 text-xs text-foreground">
<div className="m-auto w-[250px]"> <div className="m-auto w-[250px]">
{t.data.node.template[n] {t.data.node.template[n]
.type === "str" && .type === "str" &&

View file

@ -55,7 +55,7 @@ export default function EditNodeModal({ data }: { data: NodeDataType }) {
const { closePopUp } = useContext(PopUpContext); const { closePopUp } = useContext(PopUpContext);
const { types } = useContext(typesContext); const { types } = useContext(typesContext);
const ref = useRef(); const ref = useRef();
const { setTabsState, tabId, save } = useContext(TabsContext); const { setTabsState, tabId } = useContext(TabsContext);
const { reactFlowInstance } = useContext(typesContext); const { reactFlowInstance } = useContext(typesContext);
let disabled = let disabled =

View file

@ -86,7 +86,7 @@ export default function ChatMessage({
components={{ components={{
code({ node, inline, className, children, ...props }) { code({ node, inline, className, children, ...props }) {
if (children.length) { if (children.length) {
if (children[0] == "▍") { if (children[0] === "▍") {
return ( return (
<span className="chat-message-modal-markdown-span"> <span className="chat-message-modal-markdown-span">
▍ ▍

View file

@ -374,7 +374,7 @@ export default function ChatModal({
<ChatMessage <ChatMessage
lockChat={lockChat} lockChat={lockChat}
chat={c} chat={c}
lastMessage={chatHistory.length - 1 == i ? true : false} lastMessage={chatHistory.length - 1 === i ? true : false}
key={i} key={i}
/> />
)) ))

View file

@ -31,7 +31,7 @@ export default function CodeAreaModal({
const [code, setCode] = useState(value); const [code, setCode] = useState(value);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { dark } = useContext(darkContext); const { dark } = useContext(darkContext);
const { closePopUp } = useContext(PopUpContext); const { closePopUp, setCloseEdit } = useContext(PopUpContext);
const { setErrorData, setSuccessData } = useContext(alertContext); const { setErrorData, setSuccessData } = useContext(alertContext);
const [error, setError] = useState<{ const [error, setError] = useState<{
detail: { error: string; traceback: string }; detail: { error: string; traceback: string };
@ -41,6 +41,13 @@ export default function CodeAreaModal({
setValue(code); setValue(code);
}, [code, setValue]); }, [code, setValue]);
function setModalOpen(x: boolean) {
if (x === false) {
setCloseEdit("codearea");
closePopUp();
}
}
function handleClick() { function handleClick() {
setLoading(true); setLoading(true);
postValidateCode(code) postValidateCode(code)
@ -55,6 +62,7 @@ export default function CodeAreaModal({
}); });
setValue(code); setValue(code);
setOpen((old) => !old); setOpen((old) => !old);
setModalOpen(false);
} else { } else {
if (funcErrors.length !== 0) { if (funcErrors.length !== 0) {
setErrorData({ setErrorData({

View file

@ -57,7 +57,7 @@ export default function ChatInput({
<button <button
className={classNames( className={classNames(
"form-modal-send-button", "form-modal-send-button",
chatValue == "" ? "text-primary" : " bg-indigo-600 text-background" chatValue === "" ? "text-primary" : " bg-indigo-600 text-background"
)} )}
disabled={lockChat} disabled={lockChat}
onClick={() => sendMessage()} onClick={() => sendMessage()}

View file

@ -34,13 +34,13 @@ export default function ChatMessage({
{!chat.isSend ? ( {!chat.isSend ? (
<div className="form-modal-chat-image"> <div className="form-modal-chat-image">
<div className="form-modal-chat-bot-icon "> <div className="form-modal-chat-bot-icon ">
<img src={Robot} className="form-modal-chat-icon-img" /> <img src={Robot} className="form-modal-chat-icon-img" alt="robot_image"/>
</div> </div>
</div> </div>
) : ( ) : (
<div className="form-modal-chat-image"> <div className="form-modal-chat-image">
<div className="form-modal-chat-user-icon "> <div className="form-modal-chat-user-icon ">
<img src={MaleTechnology} className="form-modal-chat-icon-img" /> <img src={MaleTechnology} className="form-modal-chat-icon-img" alt="male_technology"/>
</div> </div>
</div> </div>
)} )}
@ -75,7 +75,7 @@ export default function ChatMessage({
components={{ components={{
code({ node, inline, className, children, ...props }) { code({ node, inline, className, children, ...props }) {
if (children.length) { if (children.length) {
if (children[0] == "▍") { if (children[0] === "▍") {
return ( return (
<span className="form-modal-markdown-span"> <span className="form-modal-markdown-span">
▍ ▍

View file

@ -63,12 +63,14 @@ export default function FormModal({
const [chatHistory, setChatHistory] = useState<ChatMessageType[]>([]); const [chatHistory, setChatHistory] = useState<ChatMessageType[]>([]);
const { reactFlowInstance } = useContext(typesContext); const { reactFlowInstance } = useContext(typesContext);
const { setErrorData, setNoticeData } = useContext(alertContext); const { setErrorData } = useContext(alertContext);
const ws = useRef<WebSocket | null>(null); const ws = useRef<WebSocket | null>(null);
const [lockChat, setLockChat] = useState(false); const [lockChat, setLockChat] = useState(false);
const isOpen = useRef(open); const isOpen = useRef(open);
const messagesRef = useRef(null); const messagesRef = useRef(null);
const id = useRef(flow.id); const id = useRef(flow.id);
const tabsStateFlowId = tabsState[flow.id];
const tabsStateFlowIdFormKeysData = tabsStateFlowId.formKeysData;
const [chatKey, setChatKey] = useState( const [chatKey, setChatKey] = useState(
Object.keys(tabsState[flow.id].formKeysData.input_keys).find( Object.keys(tabsState[flow.id].formKeysData.input_keys).find(
(k) => !tabsState[flow.id].formKeysData.handle_keys.some((j) => j === k) (k) => !tabsState[flow.id].formKeysData.handle_keys.some((j) => j === k)
@ -86,7 +88,7 @@ export default function FormModal({
}, [open]); }, [open]);
useEffect(() => { useEffect(() => {
id.current = flow.id; id.current = flow.id;
}, [flow.id, tabsState[flow.id], tabsState[flow.id].formKeysData]); }, [flow.id, tabsStateFlowId, tabsStateFlowIdFormKeysData]);
var isStream = false; var isStream = false;
@ -515,7 +517,7 @@ export default function FormModal({
<ChatMessage <ChatMessage
lockChat={lockChat} lockChat={lockChat}
chat={c} chat={c}
lastMessage={chatHistory.length - 1 == i ? true : false} lastMessage={chatHistory.length - 1 === i ? true : false}
key={i} key={i}
/> />
)) ))

View file

@ -202,13 +202,12 @@ export default function GenericModal({
"flex h-[55vh] w-full" "flex h-[55vh] w-full"
)} )}
> >
{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 custom-scroll focus-visible:ring-1 dark:border-gray-700 dark:bg-gray-900 dark:text-white" 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();
setIsEdit(false); setIsEdit(false);
}} }}
autoFocus autoFocus
@ -218,9 +217,9 @@ export default function GenericModal({
}} }}
placeholder="Type message here." placeholder="Type message here."
/> />
) : type == TypeModal.PROMPT && !isEdit ? ( ) : type === TypeModal.PROMPT && !isEdit ? (
<TextAreaContentView /> <TextAreaContentView />
) : type != TypeModal.PROMPT ? ( ) : type !== TypeModal.PROMPT ? (
<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" 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"
@ -235,7 +234,7 @@ export default function GenericModal({
)} )}
</div> </div>
{type == TypeModal.PROMPT && ( {type === TypeModal.PROMPT && (
<> <>
<div className="sm:6/6 mr-28 mt-3 h-[60px] overflow-y-auto custom-scroll"> <div className="sm:6/6 mr-28 mt-3 h-[60px] overflow-y-auto custom-scroll">
<div className="flex flex-wrap items-center"> <div className="flex flex-wrap items-center">
@ -281,7 +280,7 @@ export default function GenericModal({
setModalOpen(false); setModalOpen(false);
break; break;
case 2: case 2:
!inputValue || inputValue == "" !inputValue || inputValue === ""
? setModalOpen(false) ? setModalOpen(false)
: validatePrompt(false); : validatePrompt(false);
break; break;

View file

@ -27,3 +27,12 @@ export type FlowStyleType = {
color: string; color: string;
flow_id: string; flow_id: string;
}; };
export type TweaksType = Array<
{
[key: string]: {
output_key?: string;
};
} & FlowStyleType
>;

View file

@ -1,5 +1,5 @@
import { Dispatch, SetStateAction } from "react"; import { Dispatch, SetStateAction } from "react";
import { FlowType } from "../flow"; import { FlowType, TweaksType } from "../flow";
export type TabsContextType = { export type TabsContextType = {
saveFlow: (flow: FlowType) => Promise<void>; saveFlow: (flow: FlowType) => Promise<void>;
@ -32,8 +32,8 @@ export type TabsContextType = {
) => void; ) => void;
lastCopiedSelection: { nodes: any; edges: any }; lastCopiedSelection: { nodes: any; edges: any };
setLastCopiedSelection: (selection: { nodes: any; edges: any }) => void; setLastCopiedSelection: (selection: { nodes: any; edges: any }) => void;
setTweak: (tweak: any) => void; setTweak: (tweak: TweaksType) => void;
getTweak: any; getTweak: TweaksType[];
}; };
export type TabsState = { export type TabsState = {

View file

@ -843,7 +843,7 @@ export function groupByFamily(data, baseClasses, left, type) {
}); });
}); });
if (left == false) { if (left === false) {
let groupedBy = arrOfType.filter((object, index, self) => { let groupedBy = arrOfType.filter((object, index, self) => {
const foundIndex = self.findIndex( const foundIndex = self.findIndex(
(o) => o.family === object.family && o.type === object.type (o) => o.family === object.family && o.type === object.type
@ -866,7 +866,7 @@ export function groupByFamily(data, baseClasses, left, type) {
}); });
} }
if (left == false) { if (left === false) {
let resFil = result.filter((group) => group.family === parentOutput); let resFil = result.filter((group) => group.family === parentOutput);
result = resFil; result = resFil;
} }
@ -893,8 +893,8 @@ export function groupByFamily(data, baseClasses, left, type) {
} }
groupedArray.forEach((object, index, self) => { groupedArray.forEach((object, index, self) => {
const findObj = arrOfLength.find((x) => x.type == object.family); const findObj = arrOfLength.find((x) => x.type === object.family);
if (object.component.length == findObj.length) { if (object.component.length === findObj.length) {
self[index]["type"] = ""; self[index]["type"] = "";
} else { } else {
self[index]["type"] = object.component.join(", "); self[index]["type"] = object.component.join(", ");