File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket Expand file tree Collapse file tree 1 file changed +9
-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 ,
@@ -165,6 +167,11 @@ const AddBucket = ({ classes }: IsetProps) => {
165167 IAM_SCOPES . S3_PUT_BUCKET_OBJECT_LOCK_CONFIGURATION ,
166168 ] ) ;
167169
170+ useEffect ( ( ) => {
171+ dispatch ( setName ( "" ) ) ;
172+ dispatch ( setIsDirty ( false ) ) ;
173+ } , [ ] )
174+
168175 useEffect ( ( ) => {
169176 const bucketNameErrors = [
170177 ! ( isDirty && ( bucketName . length < 3 || bucketName . length > 63 ) ) ,
@@ -181,7 +188,7 @@ const AddBucket = ({ classes }: IsetProps) => {
181188 ] ;
182189 setValidationResult ( bucketNameErrors ) ;
183190 // eslint-disable-next-line react-hooks/exhaustive-deps
184- } , [ bucketName ] ) ;
191+ } , [ bucketName , isDirty ] ) ;
185192
186193 useEffect ( ( ) => {
187194 const fetchRecords = ( ) => {
@@ -476,7 +483,7 @@ const AddBucket = ({ classes }: IsetProps) => {
476483 type = "submit"
477484 variant = "callAction"
478485 color = "primary"
479- disabled = { addLoading || invalidFields . length > 0 || hasErrors }
486+ disabled = { addLoading || invalidFields . length > 0 || ( ! isDirty || hasErrors ) }
480487 label = { "Create Bucket" }
481488 />
482489 </ Grid >
You can’t perform that action at this time.
0 commit comments