File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ import { selDistSet, selSiteRep } from "../../../../../systemSlice";
4545import {
4646 resetForm ,
4747 setEnableObjectLocking ,
48+ setIsDirty ,
49+ setName ,
4850 setQuota ,
4951 setQuotaSize ,
5052 setQuotaUnit ,
@@ -181,9 +183,11 @@ const AddBucket = ({ classes }: IsetProps) => {
181183 ] ;
182184 setValidationResult ( bucketNameErrors ) ;
183185 // eslint-disable-next-line react-hooks/exhaustive-deps
184- } , [ bucketName ] ) ;
186+ } , [ bucketName , isDirty ] ) ;
185187
186188 useEffect ( ( ) => {
189+ dispatch ( setName ( "" ) ) ;
190+ dispatch ( setIsDirty ( false ) ) ;
187191 const fetchRecords = ( ) => {
188192 api
189193 . invoke ( "GET" , `/api/v1/buckets` )
@@ -476,7 +480,12 @@ const AddBucket = ({ classes }: IsetProps) => {
476480 type = "submit"
477481 variant = "callAction"
478482 color = "primary"
479- disabled = { addLoading || invalidFields . length > 0 || hasErrors }
483+ disabled = {
484+ addLoading ||
485+ invalidFields . length > 0 ||
486+ ! isDirty ||
487+ hasErrors
488+ }
480489 label = { "Create Bucket" }
481490 />
482491 </ Grid >
You can’t perform that action at this time.
0 commit comments