Skip to content

feat: add impending deletion filter to workspaces page #7860

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 18 commits into from
Jun 12, 2023
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
fix lint and stories
  • Loading branch information
Kira-Pilot committed Jun 6, 2023
commit a4b81ce45727e338d0153ce4250370e7ca349072
4 changes: 2 additions & 2 deletions coderd/searchquery/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestSearchWorkspace(t *testing.T) {
c := c
t.Run(c.Name, func(t *testing.T) {
t.Parallel()
values, errs := searchquery.Workspaces(c.Query, codersdk.Pagination{}, 0)
values, _, errs := searchquery.Workspaces(c.Query, codersdk.Pagination{}, 0)
if c.ExpectedErrorContains != "" {
require.True(t, len(errs) > 0, "expect some errors")
var s strings.Builder
Expand All @@ -167,7 +167,7 @@ func TestSearchWorkspace(t *testing.T) {

query := ``
timeout := 1337 * time.Second
values, errs := searchquery.Workspaces(query, codersdk.Pagination{}, timeout)
values, _, errs := searchquery.Workspaces(query, codersdk.Pagination{}, timeout)
require.Empty(t, errs)
require.Equal(t, int64(timeout.Seconds()), values.AgentInactiveDisconnectTimeoutSeconds)
})
Expand Down
1 change: 0 additions & 1 deletion coderd/workspaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,6 @@ func TestWorkspaceFilterManual(t *testing.T) {
require.Len(t, res.Workspaces, 1)
require.Equal(t, workspace.ID, res.Workspaces[0].ID)
})

}

func TestOffsetLimit(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
import { action } from "@storybook/addon-actions"
import { Story } from "@storybook/react"
import { Meta, StoryObj } from "@storybook/react"
import { MockTemplate } from "testHelpers/entities"
import {
TemplateSchedulePageView,
TemplateSchedulePageViewProps,
} from "./TemplateSchedulePageView"
import { TemplateSchedulePageView } from "./TemplateSchedulePageView"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"

export default {
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
cacheTime: 0,
refetchOnWindowFocus: false,
networkMode: "offlineFirst",
},
},
})

const meta: Meta<typeof TemplateSchedulePageView> = {
title: "pages/TemplateSchedulePageView",
component: TemplateSchedulePageView,
args: {
allowAdvancedScheduling: true,
allowWorkspaceActions: true,
template: MockTemplate,
onSubmit: action("onSubmit"),
onCancel: action("cancel"),
},
decorators: [
(Story) => (
<QueryClientProvider client={queryClient}>
<Story />
</QueryClientProvider>
),
],
}
export default meta
type Story = StoryObj<typeof TemplateSchedulePageView>

const Template: Story<TemplateSchedulePageViewProps> = (args) => (
<TemplateSchedulePageView {...args} />
)
const defaultArgs = {
allowAdvancedScheduling: true,
allowWorkspaceActions: true,
template: MockTemplate,
onSubmit: action("onSubmit"),
onCancel: action("cancel"),
}

export const Example = Template.bind({})
Example.args = {}
export const Example: Story = {
args: { ...defaultArgs },
}

export const CantSetMaxTTL = Template.bind({})
CantSetMaxTTL.args = {
allowAdvancedScheduling: false,
export const CantSetMaxTTL: Story = {
args: { ...defaultArgs, allowAdvancedScheduling: false },
}