Fixed the UI related issues reported during testing for Google Cloud SQL deployment. #5750

This commit is contained in:
Yogesh Mahajan 2023-03-23 11:51:21 +05:30 committed by GitHub
parent c5e1e74757
commit a026353df8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -16,10 +16,6 @@ import sys
if sys.version_info < (3, 4): if sys.version_info < (3, 4):
raise RuntimeError('This application must be run under Python 3.4 ' raise RuntimeError('This application must be run under Python 3.4 '
'or later.') 'or later.')
# Due to https://github.com/eventlet/eventlet/issues/670
if sys.version_info <= (3, 9):
import select
import builtins import builtins
import os import os
@ -41,6 +37,7 @@ if (3, 10) > sys.version_info > (3, 8) and os.name == 'posix':
# Fix eventlet issue with Python 3.9. # Fix eventlet issue with Python 3.9.
# Ref: https://github.com/eventlet/eventlet/issues/670 # Ref: https://github.com/eventlet/eventlet/issues/670
# This was causing issue in psycopg3 # This was causing issue in psycopg3
import select
from eventlet import hubs from eventlet import hubs
hubs.use_hub("poll") hubs.use_hub("poll")

View File

@ -45,7 +45,7 @@ class RdsProvider(AbsProvider):
def init_args(self, parsers): def init_args(self, parsers):
""" Create the command line parser for this provider """ """ Create the command line parser for this provider """
self.parser = parsers.add_parser('rds', self.parser = parsers.add_parser('rds',
help='Amazon AWS RDS PostgreSQL', help='Amazon RDS PostgreSQL',
epilog='Credentials are read from ' epilog='Credentials are read from '
'~/.aws/config by default and ' '~/.aws/config by default and '
'can be overridden in the ' 'can be overridden in the '

View File

@ -50,7 +50,6 @@ export function GoogleCredentials(props) {
return new Promise((resolve, reject)=>{axiosApi.post(_url, post_data) return new Promise((resolve, reject)=>{axiosApi.post(_url, post_data)
.then((res) => { .then((res) => {
if (res.data && res.data.success == 1 ) { if (res.data && res.data.success == 1 ) {
_eventBus.fireEvent('SET_CRED_VERIFICATION_INITIATED',true);
let params = 'scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no, width=550,height=650,left=600,top=150'; let params = 'scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no, width=550,height=650,left=600,top=150';
child = window.open(res.data.data.auth_url, 'google_authentication', params); child = window.open(res.data.data.auth_url, 'google_authentication', params);
resolve(true); resolve(true);
@ -76,6 +75,7 @@ export function GoogleCredentials(props) {
axiosApi.get(auth_url) axiosApi.get(auth_url)
.then((res)=>{ .then((res)=>{
if (res.data.success && res.data.success == 1 ){ if (res.data.success && res.data.success == 1 ){
_eventBus.fireEvent('SET_CRED_VERIFICATION_INITIATED',true);
_eventBus.fireEvent('SET_ERROR_MESSAGE_FOR_CLOUD_WIZARD',[MESSAGE_TYPE.SUCCESS, gettext('Authentication completed successfully. Click the Next button to proceed.')]); _eventBus.fireEvent('SET_ERROR_MESSAGE_FOR_CLOUD_WIZARD',[MESSAGE_TYPE.SUCCESS, gettext('Authentication completed successfully. Click the Next button to proceed.')]);
clearInterval(interval); clearInterval(interval);
if(child){ if(child){
@ -242,12 +242,14 @@ GoogleDatabaseDetails.propTypes = {
// Validation functions // Validation functions
export function validateGoogleStep2(cloudInstanceDetails) { export function validateGoogleStep2(cloudInstanceDetails) {
let isError = false; let isError = false;
if ((isEmptyString(cloudInstanceDetails.name) || isEmptyString(cloudInstanceDetails.project) || if ((isEmptyString(cloudInstanceDetails.name) || (!/^(?=[a-z])[a-z0-9\-]*$/.test(cloudInstanceDetails.name) ||
cloudInstanceDetails.name.length > 97) || isEmptyString(cloudInstanceDetails.project) ||
isEmptyString(cloudInstanceDetails.region) || isEmptyString(cloudInstanceDetails.availability_zone) || isEmptyString(cloudInstanceDetails.region) || isEmptyString(cloudInstanceDetails.availability_zone) ||
isEmptyString(cloudInstanceDetails.db_version) || isEmptyString(cloudInstanceDetails.instance_type) || isEmptyString(cloudInstanceDetails.db_version) || isEmptyString(cloudInstanceDetails.instance_type) ||
isEmptyString(cloudInstanceDetails.instance_class) || isEmptyString(cloudInstanceDetails.storage_type)|| isEmptyString(cloudInstanceDetails.instance_class) || isEmptyString(cloudInstanceDetails.storage_type)||
isEmptyString(cloudInstanceDetails.storage_size) || isEmptyString(cloudInstanceDetails.public_ips)) || isEmptyString(cloudInstanceDetails.storage_size) || isEmptyString(cloudInstanceDetails.public_ips)) ||
(cloudInstanceDetails.high_availability && isEmptyString(cloudInstanceDetails.secondary_availability_zone))) { (cloudInstanceDetails.high_availability && (isEmptyString(cloudInstanceDetails.secondary_availability_zone) ||
cloudInstanceDetails.secondary_availability_zone == cloudInstanceDetails.availability_zone))) {
isError = true; isError = true;
} }
return isError; return isError;

View File

@ -523,7 +523,7 @@ class GoogleClusterSchema extends BaseUISchema {
validate(data, setErr) { validate(data, setErr) {
if ( !isEmptyString(data.name) && (!/^(?=[a-z])[a-z0-9\-]*$/.test(data.name) || data.name.length > 97)) { if ( !isEmptyString(data.name) && (!/^(?=[a-z])[a-z0-9\-]*$/.test(data.name) || data.name.length > 97)) {
setErr('name',gettext('Name must only contain lowercase letters, numbers, and hyphens. Start with a letter.')); setErr('name',gettext('Name must only contain lowercase letters, numbers, and hyphens.Should start with a letter and must be 97 characters or less'));
return true; return true;
} }
return false; return false;