@@ -22,6 +22,7 @@ import { gitpodHostUrl } from "../service/service";
2222import { useCurrentUser } from "../user-context" ;
2323import { OrgSettingsPage } from "./OrgSettingsPage" ;
2424import { useToast } from "../components/toasts/Toasts" ;
25+ import { useDefaultWorkspaceImageQuery } from "../data/workspaces/default-workspace-image-query" ;
2526
2627export default function TeamSettingsPage ( ) {
2728 const user = useCurrentUser ( ) ;
@@ -169,6 +170,7 @@ export default function TeamSettingsPage() {
169170function OrgSettingsForm ( props : { org ?: OrganizationInfo } ) {
170171 const { org } = props ;
171172 const { data : settings , isLoading } = useOrgSettingsQuery ( ) ;
173+ const { data : globalDefaultImage } = useDefaultWorkspaceImageQuery ( ) ;
172174 const updateTeamSettings = useUpdateOrgSettingsMutation ( ) ;
173175 const [ defaultWorkspaceImage , setDefaultWorkspaceImage ] = useState ( settings ?. defaultWorkspaceImage ?? "" ) ;
174176 const { toast } = useToast ( ) ;
@@ -190,11 +192,10 @@ function OrgSettingsForm(props: { org?: OrganizationInfo }) {
190192 }
191193 try {
192194 await updateTeamSettings . mutateAsync ( {
193- // We don't want to have original setting passed, since defaultWorkspaceImage could be undefined
194- // to bring compatibility when we're going to change Gitpod install value's defaultImage setting
195+ ...settings ,
195196 ...newSettings ,
196197 } ) ;
197- if ( newSettings . defaultWorkspaceImage ) {
198+ if ( newSettings . defaultWorkspaceImage !== undefined ) {
198199 toast ( "Default workspace image has been updated." ) ;
199200 }
200201 } catch ( error ) {
@@ -206,7 +207,7 @@ function OrgSettingsForm(props: { org?: OrganizationInfo }) {
206207 ) ;
207208 }
208209 } ,
209- [ updateTeamSettings , org ?. id , org ?. isOwner , toast ] ,
210+ [ updateTeamSettings , org ?. id , org ?. isOwner , settings , toast ] ,
210211 ) ;
211212
212213 return (
@@ -241,6 +242,7 @@ function OrgSettingsForm(props: { org?: OrganizationInfo }) {
241242 label = "Default Image"
242243 // TODO: Provide document links
243244 hint = "Use any official Gitpod Docker image, or Docker image reference"
245+ placeholder = { globalDefaultImage }
244246 value = { defaultWorkspaceImage }
245247 onChange = { setDefaultWorkspaceImage }
246248 disabled = { isLoading || ! org ?. isOwner }
0 commit comments