Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add debounced search on type to the search bar #2703

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

Merged
merged 7 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixing e2e test
  • Loading branch information
Kira-Pilot committed Jun 29, 2022
commit 766f03e5bc785ec98d33ff414ea9f1eef552a949
4 changes: 2 additions & 2 deletions site/e2e/pom/WorkspacesPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Page } from "@playwright/test"
import { BasePom } from "./BasePom"

export class WorkspacesPage extends BasePom {
constructor(baseURL: string | undefined, page: Page) {
super(baseURL, "/workspaces", page)
constructor(baseURL: string | undefined, page: Page, params?: string) {
super(baseURL, `/workspaces${params && params}`, page)
}
}
2 changes: 1 addition & 1 deletion site/e2e/tests/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test("Login takes user to /workspaces", async ({ baseURL, page }) => {
const signInPage = new SignInPage(baseURL, page)
await signInPage.submitBuiltInAuthentication(email, password)

const workspacesPage = new WorkspacesPage(baseURL, page)
const workspacesPage = new WorkspacesPage(baseURL, page, "?filter=owner%3Ame")
await waitForClientSideNavigation(page, { to: workspacesPage.url })

await page.waitForSelector("text=Workspaces")
Expand Down
6 changes: 4 additions & 2 deletions site/src/pages/WorkspacesPage/WorkspacesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import { WorkspacesPageView } from "./WorkspacesPageView"

const WorkspacesPage: FC = () => {
const [workspacesState, send] = useMachine(workspacesMachine)
const [_, setSearchParams] = useSearchParams()
const [searchParams, setSearchParams] = useSearchParams()
const { workspaceRefs } = workspacesState.context

// On page load, populate the table with workspaces
useEffect(() => {
const query = workspaceFilterQuery.me
const filter = searchParams.get("filter")
const query = filter !== null ? filter : workspaceFilterQuery.me
// const query = workspaceFilterQuery.me

send({
type: "GET_WORKSPACES",
Expand Down