@@ -18,17 +18,13 @@ import { User } from "@gitpod/gitpod-protocol";
18
18
import { useLocation } from "react-router" ;
19
19
import { StartWorkspaceModalContext , StartWorkspaceModalKeyBinding } from "./start-workspace-modal-context" ;
20
20
import SelectIDEModal from "../settings/SelectIDEModal" ;
21
- import Arrow from "../components/Arrow" ;
22
- import ConfirmationModal from "../components/ConfirmationModal" ;
23
21
24
22
export interface WorkspacesProps { }
25
23
26
24
export interface WorkspacesState {
27
25
workspaces : WorkspaceInfo [ ] ;
28
26
isTemplateModelOpen : boolean ;
29
27
repos : WhitelistedRepository [ ] ;
30
- showInactive : boolean ;
31
- deleteModalVisible : boolean ;
32
28
}
33
29
34
30
export default function ( ) {
@@ -39,8 +35,6 @@ export default function () {
39
35
const [ activeWorkspaces , setActiveWorkspaces ] = useState < WorkspaceInfo [ ] > ( [ ] ) ;
40
36
const [ inactiveWorkspaces , setInactiveWorkspaces ] = useState < WorkspaceInfo [ ] > ( [ ] ) ;
41
37
const [ workspaceModel , setWorkspaceModel ] = useState < WorkspaceModel > ( ) ;
42
- const [ showInactive , setShowInactive ] = useState < boolean > ( ) ;
43
- const [ deleteModalVisible , setDeleteModalVisible ] = useState < boolean > ( ) ;
44
38
const { setIsStartWorkspaceModalVisible } = useContext ( StartWorkspaceModalContext ) ;
45
39
46
40
useEffect ( ( ) => {
@@ -56,18 +50,6 @@ export default function () {
56
50
< >
57
51
< Header title = "Workspaces" subtitle = "Manage recent and stopped workspaces." />
58
52
59
- < ConfirmationModal
60
- title = "Delete Inactive Workspaces"
61
- areYouSureText = "You are about to permanently delete your inactive workspaces."
62
- buttonText = "Delete Inactive Workspaces"
63
- visible = { ! ! deleteModalVisible }
64
- onClose = { ( ) => setDeleteModalVisible ( false ) }
65
- onConfirm = { ( ) => {
66
- inactiveWorkspaces . forEach ( ( ws ) => workspaceModel ?. deleteWorkspace ( ws . workspace . id ) ) ;
67
- setDeleteModalVisible ( false ) ;
68
- } }
69
- > </ ConfirmationModal >
70
-
71
53
{ isOnboardingUser && < SelectIDEModal location = { "workspace_list" } /> }
72
54
73
55
{ workspaceModel ?. initialized &&
@@ -146,58 +128,27 @@ export default function () {
146
128
} ) }
147
129
{ activeWorkspaces . length > 0 && < div className = "py-6" > </ div > }
148
130
{ inactiveWorkspaces . length > 0 && (
149
- < div className = "pt-14" >
150
- < div className = "border-t border-gray-200 dark:border-gray-800" > </ div >
151
- < div
152
- onClick = { ( ) => setShowInactive ( ! showInactive ) }
153
- className = "flex cursor-pointer py-6"
131
+ < div className = "p-3 text-gray-400 bg-gray-50 dark:bg-gray-800 rounded-xl text-sm text-center" >
132
+ Unpinned workspaces that have been inactive for more than 14 days will be
133
+ automatically deleted.{ " " }
134
+ < a
135
+ className = "gp-link"
136
+ href = "https://www.gitpod.io/docs/life-of-workspace/#garbage-collection"
154
137
>
155
- < div className = "flex flex-col" >
156
- < h2 className = "" > Inactive Workspaces</ h2 >
157
- </ div >
158
- < div >
159
- < Arrow
160
- up = { ! ! showInactive }
161
- customBorderClasses = "text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400"
162
- />
163
- </ div >
164
- </ div >
165
- { showInactive ? (
166
- < >
167
- < div className = "flex flex-row p-3 text-gray-400 bg-gray-50 dark:bg-gray-800 rounded-xl" >
168
- < div className = "text-sm flex-auto py-3" >
169
- Unpinned workspaces that have been inactive for more than 14 days
170
- will be automatically deleted.{ " " }
171
- < a
172
- className = "gp-link"
173
- href = "https://www.gitpod.io/docs/life-of-workspace/#garbage-collection"
174
- >
175
- Learn more
176
- </ a >
177
- </ div >
178
- < button
179
- onClick = { ( ) => setDeleteModalVisible ( true ) }
180
- className = "ml-2 danger secondary w-64 p-2"
181
- >
182
- Delete Inactive Workspaces
183
- </ button >
184
- </ div >
185
- { inactiveWorkspaces . map ( ( e ) => {
186
- return (
187
- < WorkspaceEntry
188
- key = { e . workspace . id }
189
- desc = { e }
190
- model = { workspaceModel }
191
- stopWorkspace = { ( wsId ) =>
192
- getGitpodService ( ) . server . stopWorkspace ( wsId )
193
- }
194
- />
195
- ) ;
196
- } ) }
197
- </ >
198
- ) : null }
138
+ Learn more
139
+ </ a >
199
140
</ div >
200
141
) }
142
+ { inactiveWorkspaces . map ( ( e ) => {
143
+ return (
144
+ < WorkspaceEntry
145
+ key = { e . workspace . id }
146
+ desc = { e }
147
+ model = { workspaceModel }
148
+ stopWorkspace = { ( wsId ) => getGitpodService ( ) . server . stopWorkspace ( wsId ) }
149
+ />
150
+ ) ;
151
+ } ) }
201
152
</ ItemsList >
202
153
</ >
203
154
) : (
0 commit comments