@@ -38,6 +38,7 @@ import {handleXhrErrorResponse} from 'sentry/utils/handleXhrErrorResponse';
3838import type { ApiQueryKey } from 'sentry/utils/queryClient' ;
3939import { setApiQueryData , useApiQuery , useQueryClient } from 'sentry/utils/queryClient' ;
4040import recreateRoute from 'sentry/utils/recreateRoute' ;
41+ import slugify from 'sentry/utils/slugify' ;
4142import useApi from 'sentry/utils/useApi' ;
4243import { useLocation } from 'sentry/utils/useLocation' ;
4344import { useNavigate } from 'sentry/utils/useNavigate' ;
@@ -329,6 +330,25 @@ function ProjectGeneralSettings({onChangeSlug}: Props) {
329330 help : t ( 'The unique identifier for this project. It cannot be modified.' ) ,
330331 } ;
331332
333+ const slugField : FieldObject = {
334+ name : 'slug' ,
335+ type : 'string' ,
336+ required : true ,
337+ label : t ( 'Slug' ) ,
338+ help : t ( 'A unique ID used to identify this project' ) ,
339+ transformInput : slugify as ( str : string ) => string ,
340+ getData : ( data : { slug ?: string } ) => {
341+ return {
342+ slug : data . slug ,
343+ } ;
344+ } ,
345+ saveOnBlur : false ,
346+ saveMessageAlertType : 'warning' ,
347+ saveMessage : t (
348+ "Changing a project's slug can break your build scripts! Please proceed carefully."
349+ ) ,
350+ } ;
351+
332352 // Create filtered platform field without mutating the shared fields object
333353 const platformField = {
334354 ...fields . platform ,
@@ -355,7 +375,7 @@ function ProjectGeneralSettings({onChangeSlug}: Props) {
355375 < JsonForm
356376 { ...jsonFormProps }
357377 title = { t ( 'Project Details' ) }
358- fields = { [ fields . name , projectIdField , platformField ] }
378+ fields = { [ slugField , projectIdField , platformField ] }
359379 />
360380 < JsonForm { ...jsonFormProps } title = { t ( 'Email' ) } fields = { [ fields . subjectPrefix ] } />
361381 </ Form >
0 commit comments