Skip to content

Commit

Permalink
fix: update flow name validation and label (langflow-ai#3785)
Browse files Browse the repository at this point in the history
* Changed text warning name invalid

* Change invalidNameList to include components

* 📝 (generalBugs-shard-13.spec.ts): add missing comments to clarify the purpose of the code block and improve code readability

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
  • Loading branch information
2 people authored and smatiolids committed Sep 16, 2024
1 parent 0311c07 commit ae02f22
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ export const EditFlowSettings: React.FC<InputProps> = ({
<span className="edit-flow-span">Character limit reached</span>
)}
{isInvalidName && (
<span className="edit-flow-span">Invalid name</span>
<span className="edit-flow-span">
Name invalid or already exists
</span>
)}
</div>
{setName ? (
Expand Down
3 changes: 1 addition & 2 deletions src/frontend/src/modals/flowSettingsModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ export default function FlowSettingsModal({
if (flows) {
const tempNameList: string[] = [];
flows.forEach((flow: FlowType) => {
if ((flow.is_component ?? false) === false)
tempNameList.push(flow.name);
tempNameList.push(flow.name);
});
setNameList(tempNameList.filter((name) => name !== currentFlow!.name));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,42 @@ test("should be able to share a component on the store by clicking on the share

await page.getByTestId("share-modal-button-flow").click();

let replace = await page.getByTestId("replace-button").isVisible();

if (replace) {
await page.getByTestId("replace-button").click();
}

await page.waitForSelector("text=flow shared successfully ", {
timeout: 10000,
});

await page.waitForTimeout(500);

await page.waitForSelector("text=share", { timeout: 10000 });
await page.waitForSelector("text=playground", { timeout: 10000 });
await page.waitForSelector("text=api", { timeout: 10000 });

await page.getByTestId("shared-button-flow").click();

await page.waitForTimeout(500);

await page.waitForSelector("text=Publish workflow to the Langflow Store.", {
timeout: 10000,
});
await page.waitForSelector('[data-testid="share-modal-button-flow"]', {
timeout: 10000,
});
await page.waitForSelector("text=Share Flow", { timeout: 10000 });

await page.getByTestId("share-modal-button-flow").click();

replace = await page.getByTestId("replace-button").isVisible();

if (replace) {
await page.getByTestId("replace-button").click();
}

await page.waitForSelector("text=flow shared successfully ", {
timeout: 10000,
});
Expand Down

0 comments on commit ae02f22

Please sign in to comment.