fix: update flow name validation and label (#3785)

* 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>
This commit is contained in:
Lucas Oliveira 2024-09-12 16:47:21 -03:00 committed by GitHub
commit 128a0e9332
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 40 additions and 3 deletions

View file

@ -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 ? (

View file

@ -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));
}

View file

@ -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,
});