fix: use is-dormant instead of dormant_at (#10191)

This commit is contained in:
Jon Ayers
2023-10-10 19:00:09 -05:00
committed by GitHub
parent 652e1a7d43
commit ec9b480ac0
14 changed files with 61 additions and 205 deletions
@@ -88,10 +88,7 @@ export const DormantWorkspaceBanner = ({
) : (
<>
<span>There are</span>{" "}
<Link
component={RouterLink}
to="/workspaces?filter=dormant_at:1970-01-01"
>
<Link component={RouterLink} to="/workspaces?filter=is-dormant:true">
workspaces
</Link>{" "}
that may be deleted soon due to inactivity. Activate the workspaces
@@ -44,7 +44,7 @@ export const useWorkspacesToBeDeleted = (
const { data } = useWorkspacesData({
page: 0,
limit: 0,
query: "template:" + template.name + " dormant_at:1970-01-01",
query: "template:" + template.name + " is-dormant:true",
});
return data?.workspaces?.filter((workspace: Workspace) => {
if (!workspace.dormant_at || !formValues.time_til_dormant_autodelete_ms) {
@@ -68,10 +68,10 @@ const WorkspacesPage: FC = () => {
// are at risk of being deleted.
useEffect(() => {
if (schedulingEnabled) {
const includesDormant = filterProps.filter.query.includes("dormant_at");
const includesDormant = filterProps.filter.query.includes("is-dormant");
const dormantQuery = includesDormant
? filterProps.filter.query
: filterProps.filter.query + " dormant_at:1970-01-01";
: filterProps.filter.query + " is-dormant:true";
if (includesDormant && data) {
setDormantWorkspaces(data.workspaces);
+1 -1
View File
@@ -17,7 +17,7 @@ export const workspaceFilterQuery = {
all: "",
running: "status:running",
failed: "status:failed",
dormant: "dormant_at:1970-01-01",
dormant: "is-dormant:true",
};
export const userFilterQuery = {