Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Show correct 'no results' message on workspace filters#2103

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
f0ssel merged 7 commits intomainfromf0ssel/fix-no-results
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from1 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
NextNext commit
fix: Show correct 'no results' message on workspace filters
  • Loading branch information
@f0ssel
f0ssel committedJun 7, 2022
commit44d0d6df73da62ca238b7937f4bc3ac8c6eafaee
2 changes: 1 addition & 1 deletionsite/src/pages/WorkspacesPage/WorkspacesPage.test.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ describe("WorkspacesPage", () => {
render(<WorkspacesPage />)

// Then
await screen.findByText(Language.emptyMessage)
await screen.findByText(Language.emptyCreateWorkspaceMessage)
})

it("renders a filled workspaces page", async () => {
Expand Down
46 changes: 29 additions & 17 deletionssite/src/pages/WorkspacesPage/WorkspacesPageView.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,11 +40,11 @@ import { getDisplayStatus } from "../../util/workspace"
dayjs.extend(relativeTime)

export const Language = {
createButton: "Create workspace",
emptyMessage: "Create your first workspace",
emptyDescription: "Start editing your source code and building your software",
filterName: "Filters",
createWorkspaceButton: "Create workspace",
emptyCreateWorkspaceMessage: "Create your first workspace",
emptyCreateWorkspaceDescription: "Start editing your source code and building your software",
emptyResultsMessage: "No results matched your search",
filterName: "Filters",
yourWorkspacesButton: "Your workspaces",
allWorkspacesButton: "All workspaces",
workspaceTooltipTitle: "What is workspace?",
Expand DownExpand Up@@ -200,19 +200,31 @@ export const WorkspacesPageView: FC<WorkspacesPageViewProps> = ({ loading, works
<TableBody>
{!workspaces && loading && <TableLoader />}
{workspaces && workspaces.length === 0 && (
<TableRow>
<TableCell colSpan={999}>
<EmptyState
message={Language.emptyMessage}
description={Language.emptyDescription}
cta={
<Link underline="none" component={RouterLink} to="/workspaces/new">
<Button startIcon={<AddCircleOutline />}>{Language.createButton}</Button>
</Link>
}
/>
</TableCell>
</TableRow>
<>
{filter === "owner:me" || filter === "" ? (
<TableRow>
<TableCell colSpan={999}>
<EmptyState
message={Language.emptyCreateWorkspaceMessage}
description={Language.emptyCreateWorkspaceDescription}
cta={
<Link underline="none" component={RouterLink} to="/workspaces/new">
<Button startIcon={<AddCircleOutline />}>{Language.createWorkspaceButton}</Button>
</Link>
}
/>
</TableCell>
</TableRow>
) : (
<TableRow>
<TableCell colSpan={999}>
<EmptyState
message={Language.emptyResultsMessage}
/>
</TableCell>
</TableRow>
)}
</>
)}
{workspaces &&
workspaces.map((workspace) => {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp