Add MongoDB integration and documentation updates

- Enhanced MongoDB connection handling in backend with improved host validation.
- Updated documentation to include MongoDB connection options and API references.
- Added new images for MongoDB connection forms and processes.
- Implemented MongoDB connection form in the frontend with necessary adjustments.
This commit is contained in:
Victor Santos
2025-11-17 17:39:37 -03:00
parent 055a663d24
commit ed475f0ed8
9 changed files with 166 additions and 12 deletions
@@ -1,4 +1,4 @@
import { useEffect, useState } from "react";
import { useState } from "react";
import { Controller, FormProvider, useForm } from "react-hook-form";
import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -84,19 +84,11 @@ export const MongoDBConnectionForm = ({ appConnection, onSubmit }: Props) => {
handleSubmit,
watch,
control,
setValue,
formState: { isSubmitting, isDirty }
} = form;
const host = watch("credentials.host");
const sslEnabled = watch("credentials.sslEnabled");
useEffect(() => {
if (host && host.includes("+srv") && !sslEnabled) {
setValue("credentials.sslEnabled", true, { shouldDirty: true });
}
}, [host, sslEnabled, setValue]);
return (
<FormProvider {...form}>
<form onSubmit={handleSubmit(onSubmit)}>
@@ -307,4 +307,4 @@ export const RedisConnectionForm = ({ appConnection, onSubmit }: Props) => {
</form>
</FormProvider>
);
};
};