File tree Expand file tree Collapse file tree 1 file changed +13
-40
lines changed
portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket Expand file tree Collapse file tree 1 file changed +13
-40
lines changed Original file line number Diff line number Diff line change @@ -80,46 +80,19 @@ const BucketNamingRules = () => {
8080 } , [ dispatch ] ) ;
8181
8282 useEffect ( ( ) => {
83- if ( validBucketCharacters . test ( bucketName ) ) {
84- setValidCharacters ( true ) ;
85- } else {
86- setValidCharacters ( false ) ;
87- }
88- if ( ipAddressFormat . test ( bucketName ) ) {
89- setNotIPFormat ( false ) ;
90- } else {
91- setNotIPFormat ( true ) ;
92- }
93- if (
94- bucketName . includes ( ".-" ) ||
95- bucketName . includes ( "-." ) ||
96- bucketName . includes ( ".." )
97- ) {
98- setNoAdjacentPeriods ( false ) ;
99- } else {
100- setNoAdjacentPeriods ( true ) ;
101- }
102-
103- if ( bucketName . startsWith ( "xn--" ) ) {
104- setNoPrefix ( false ) ;
105- } else {
106- setNoPrefix ( true ) ;
107- }
108- if ( bucketName . endsWith ( "-s3alias" ) ) {
109- setNoSuffix ( false ) ;
110- } else {
111- setNoSuffix ( true ) ;
112- }
113- if ( bucketName . length < 3 || bucketName . length > 63 ) {
114- setLengthRule ( false ) ;
115- } else {
116- setLengthRule ( true ) ;
117- }
118- if ( records . includes ( bucketName ) ) {
119- setUniqueName ( false ) ;
120- } else {
121- setUniqueName ( true ) ;
122- }
83+ setValidCharacters ( validBucketCharacters . test ( bucketName ) ) ;
84+ setNotIPFormat ( ! ipAddressFormat . test ( bucketName ) ) ;
85+ setNoAdjacentPeriods (
86+ ! (
87+ bucketName . includes ( ".-" ) ||
88+ bucketName . includes ( "-." ) ||
89+ bucketName . includes ( ".." )
90+ )
91+ ) ;
92+ setNoPrefix ( ! bucketName . startsWith ( "xn--" ) ) ;
93+ setNoSuffix ( ! bucketName . endsWith ( "-s3alias" ) ) ;
94+ setLengthRule ( ! ( bucketName . length < 3 || bucketName . length > 63 ) ) ;
95+ setUniqueName ( ! records . includes ( bucketName ) ) ;
12396 // eslint-disable-next-line react-hooks/exhaustive-deps
12497 } , [ bucketName ] ) ;
12598
You can’t perform that action at this time.
0 commit comments