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:
parent
1ea42725a4
commit
128a0e9332
3 changed files with 40 additions and 3 deletions
|
|
@ -62,7 +62,9 @@ export const EditFlowSettings: React.FC<InputProps> = ({
|
||||||
<span className="edit-flow-span">Character limit reached</span>
|
<span className="edit-flow-span">Character limit reached</span>
|
||||||
)}
|
)}
|
||||||
{isInvalidName && (
|
{isInvalidName && (
|
||||||
<span className="edit-flow-span">Invalid name</span>
|
<span className="edit-flow-span">
|
||||||
|
Name invalid or already exists
|
||||||
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{setName ? (
|
{setName ? (
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,7 @@ export default function FlowSettingsModal({
|
||||||
if (flows) {
|
if (flows) {
|
||||||
const tempNameList: string[] = [];
|
const tempNameList: string[] = [];
|
||||||
flows.forEach((flow: FlowType) => {
|
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));
|
setNameList(tempNameList.filter((name) => name !== currentFlow!.name));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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();
|
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 ", {
|
await page.waitForSelector("text=flow shared successfully ", {
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue