Просмотр исходного кода

fix: ensure we respect the specified username on database creation (#3908)

jose-fully-ported 2 лет назад
Родитель
Сommit
07afa35d5b

+ 5 - 2
dashboard/src/main/home/database-dashboard/forms/AuroraPostgresForm.tsx

@@ -20,6 +20,7 @@ import Error from "components/porter/Error";
 import Fieldset from "components/porter/Fieldset";
 import Fieldset from "components/porter/Fieldset";
 import Container from "components/porter/Container";
 import Container from "components/porter/Container";
 import ClickToCopy from "components/porter/ClickToCopy";
 import ClickToCopy from "components/porter/ClickToCopy";
+import { AuroraPostgresFormValues } from "./types";
 
 
 type Props = RouteComponentProps & {
 type Props = RouteComponentProps & {
   currentTemplate: any;
   currentTemplate: any;
@@ -83,9 +84,11 @@ const AuroraPostgresForm: React.FC<Props> = ({
   const deploy = async () => {
   const deploy = async () => {
     setButtonStatus("loading");
     setButtonStatus("loading");
 
 
-    const values = {
+    const values: { config: AuroraPostgresFormValues } = {
       config: {
       config: {
-        name,
+        name: name,
+        databaseName: dbName,
+        masterUsername: dbUsername,
         masterUserPassword: dbPassword,
         masterUserPassword: dbPassword,
         allocatedStorage: storage,
         allocatedStorage: storage,
         instanceClass: tier,
         instanceClass: tier,

+ 5 - 2
dashboard/src/main/home/database-dashboard/forms/RDSForm.tsx

@@ -20,6 +20,7 @@ import Error from "components/porter/Error";
 import Fieldset from "components/porter/Fieldset";
 import Fieldset from "components/porter/Fieldset";
 import Container from "components/porter/Container";
 import Container from "components/porter/Container";
 import ClickToCopy from "components/porter/ClickToCopy";
 import ClickToCopy from "components/porter/ClickToCopy";
+import { RdsFormValues } from "./types";
 
 
 type Props = RouteComponentProps & {
 type Props = RouteComponentProps & {
   currentTemplate: any;
   currentTemplate: any;
@@ -83,9 +84,11 @@ const RDSForm: React.FC<Props> = ({
   const deploy = async (wildcard?: any) => {
   const deploy = async (wildcard?: any) => {
     setButtonStatus("loading");
     setButtonStatus("loading");
 
 
-    let values = {
+    let values: { config: RdsFormValues } = {
       config: {
       config: {
-        name,
+        name: name,
+        databaseName: dbName,
+        masterUsername: dbUsername,
         masterUserPassword: dbPassword,
         masterUserPassword: dbPassword,
         allocatedStorage: storage,
         allocatedStorage: storage,
         instanceClass: tier,
         instanceClass: tier,

+ 17 - 0
dashboard/src/main/home/database-dashboard/forms/types.ts

@@ -0,0 +1,17 @@
+export type RdsFormValues = {
+    name: string,
+    databaseName: string,
+    masterUsername: string,
+    masterUserPassword: string,
+    allocatedStorage: number,
+    instanceClass: string,
+};
+
+export type AuroraPostgresFormValues = {
+    name: string,
+    databaseName: string,
+    masterUsername: string,
+    masterUserPassword: string,
+    allocatedStorage: number,
+    instanceClass: string,
+};