Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change node to component on FE constants #2545

Merged
merged 1 commit into from
Jul 5, 2024
Merged
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 @@ -87,7 +87,7 @@ export default function NodeToolbarComponent({
}
setNoticeData({
title:
"Minimization are only available for nodes with one handle or fewer.",
"Minimization are only available for components with one handle or fewer.",
});
return;
}
Expand Down Expand Up @@ -762,7 +762,7 @@ export default function NodeToolbarComponent({
onClose={setShowOverrideModal}
onCancel={() => {
saveComponent(cloneDeep(data), false);
setSuccessData({ title: "New node successfully saved!" });
setSuccessData({ title: "New component successfully saved!" });
}}
>
<ConfirmationModal.Content>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/stores/flowStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
const ids = errorsObjs.map((obj) => obj.id).flat();

get().updateBuildStatus(ids, BuildStatus.ERROR);
throw new Error("Invalid nodes");
throw new Error("Invalid components");
}
}
function handleBuildUpdate(
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/utils/buildUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function updateVerticesOrder(
});
useFlowStore.getState().setIsBuilding(false);
setLockChat && setLockChat(false);
throw new Error("Invalid nodes");
throw new Error("Invalid components");
}
// orderResponse.data.ids,
// for each id we need to build the VertexLayerElementType object as
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/utils/parameterUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const handleUpdateValues = async (name: string, data: NodeDataType) => {

const template = data.node?.template;
if (!template) {
console.error("No template found in the node.");
console.error("No template found in the component.");
return;
}

Expand All @@ -27,7 +27,7 @@ export const handleUpdateValues = async (name: string, data: NodeDataType) => {
return res.data.template;
}
} catch (error) {
console.error("Error occurred while updating the node:", error);
console.error("Error occurred while updating the component:", error);
throw error;
}
};
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/src/utils/reactflowUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ Array<{ id: string; errors: Array<string> }> {
{
id: "",
errors: [
"No nodes found in the flow. Please add at least one node to the flow.",
"No components found in the flow. Please add at least one component to the flow.",
],
},
];
Expand Down Expand Up @@ -848,7 +848,7 @@ export function validateSelection(
let errorsArray: Array<string> = [];
// check if there is more than one node
if (clonedSelection.nodes.length < 2) {
errorsArray.push("Please select more than one node");
errorsArray.push("Please select more than one component");
}
if (
clonedSelection.nodes.some(
Expand All @@ -857,15 +857,15 @@ export function validateSelection(
isOutputNode(node.data as NodeDataType),
)
) {
errorsArray.push("Select non-input/output nodes only");
errorsArray.push("Select non-input/output components only");
}
//check if there are two or more nodes with free outputs
if (
clonedSelection.nodes.filter(
(n) => !clonedSelection.edges.some((e) => e.source === n.id),
).length > 1
) {
errorsArray.push("Select only one node with free outputs");
errorsArray.push("Select only one component with free outputs");
}

// check if there is any node that does not have any connection
Expand All @@ -876,7 +876,7 @@ export function validateSelection(
!clonedSelection.edges.some((edge) => edge.source === node.id),
)
) {
errorsArray.push("Select only connected nodes");
errorsArray.push("Select only connected components");
}
return errorsArray;
}
Expand Down
Loading