Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { ChipTypeMap } from "@mui/material";
import { AutocompleteProps } from "@mui/material/Autocomplete";
import stringify from "fast-json-stable-stringify";
import { forwardRef, useEffect, useRef } from "react";

import { useInfiniteFind } from "@/hooks/crud/useInfiniteFind";
Expand Down Expand Up @@ -102,7 +103,7 @@ const AutoCompleteEntitySelect = <
useEffect(() => {
fetchNextPage({ pageParam: params });
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [JSON.stringify(searchPayload)]);
}, [stringify(searchPayload)]);

return (
<AutoCompleteSelect<Value, Label, Multiple>
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/components/nlp/components/NlpTrainForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
RadioGroup,
Typography,
} from "@mui/material";
import stringify from "fast-json-stable-stringify";
import { FC, useCallback, useEffect, useMemo, useState } from "react";
import { Controller, useFieldArray, useForm } from "react-hook-form";
import { useQuery } from "react-query";
Expand Down Expand Up @@ -82,7 +83,7 @@ const NlpDatasetSample: FC<NlpDatasetSampleProps> = ({
) as INlpDatasetKeywordEntity[],
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[allKeywordEntities, allTraitEntities, JSON.stringify(sample)],
[allKeywordEntities, allTraitEntities, stringify(sample)],
);
const { handleSubmit, control, register, reset, setValue, watch } =
useForm<INlpSampleFormAttributes>({
Expand Down Expand Up @@ -167,7 +168,7 @@ const NlpDatasetSample: FC<NlpDatasetSampleProps> = ({
useEffect(() => {
reset(defaultValues);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [JSON.stringify(defaultValues)]);
}, [stringify(defaultValues)]);

return (
<Box className="nlp-train" sx={{ position: "relative", p: 2 }}>
Expand Down Expand Up @@ -322,9 +323,7 @@ const NlpDatasetSample: FC<NlpDatasetSampleProps> = ({
</ContentItem>
))}
</Box>
{
/* Keyword entities */
}
{/* Keyword entities */}
<Box display="flex" flexDirection="column">
{keywordEntities.map((keywordEntity, index) => (
<ContentItem
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/visual-editor/Aside.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/

import { Grid, IconButton, Paper, Typography, styled } from "@mui/material";
import stringify from "fast-json-stable-stringify";
import { FC, SVGProps } from "react";

import AttachmentIcon from "@/app-components/svg/toolbar/AttachmentIcon";
Expand Down Expand Up @@ -88,7 +89,7 @@ export const Block = ({
onDragStart={(event) => {
event.dataTransfer.setData(
"storm-diagram-node",
JSON.stringify({
stringify({
...blockTemplate,
name,
}),
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/visual-editor/v2/Diagrams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
DiagramModel,
DiagramModelGenerics,
} from "@projectstorm/react-diagrams";
import stringify from "fast-json-stable-stringify";
import { useRouter } from "next/router";
import { SyntheticEvent, useCallback, useEffect, useState } from "react";
import { useQueryClient } from "react-query";
Expand Down Expand Up @@ -340,7 +341,7 @@ const Diagrams = () => {
});
}, [
selectedCategoryId,
JSON.stringify(
stringify(
blocks.map((b) => {
return { ...b, position: undefined, updatedAt: undefined };
}),
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/hooks/crud/useCount.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/

import stringify from "fast-json-stable-stringify";
import { useQuery, UseQueryOptions } from "react-query";

import { EntityType, QueryType } from "@/services/types";
Expand All @@ -31,6 +32,6 @@ export const useCount = <TEntity extends IDynamicProps["entity"]>(
return useQuery({
...options,
queryFn: () => api.count({ where: params }),
queryKey: [QueryType.count, entity, JSON.stringify(params)],
queryKey: [QueryType.count, entity, stringify(params)],
});
};
3 changes: 2 additions & 1 deletion frontend/src/websocket/SocketIoClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/

import stringify from "fast-json-stable-stringify";
import { io, ManagerOptions, Socket, SocketOptions } from "socket.io-client";

import { IOIncomingMessage, IOOutgoingMessage } from "./types/io-message";
Expand Down Expand Up @@ -133,7 +134,7 @@ export class SocketIoClient {
return response;
}
throw new Error(
`Request failed with status code ${response.statusCode}: ${JSON.stringify(
`Request failed with status code ${response.statusCode}: ${stringify(
response.body,
)}`,
);
Expand Down