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

fix: update flow name validation and label #3785

Merged
merged 4 commits into from
Sep 12, 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 @@ -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
Loading