Merge branch 'main' into fix/large-files-storage-backend-v3

# Conflicts:
#	src/features/storages/providers/s3.ts
This commit is contained in:
charlesgauthereau
2026-02-11 11:54:09 +01:00
11 changed files with 51 additions and 23 deletions
@@ -85,7 +85,7 @@ export const LoginForm = (props: loginFormProps) => {
<FormItem>
<FormLabel>Email Address</FormLabel>
<FormControl>
<Input autoComplete="email" autoFocus placeholder="exemple@portabase.io" {...field} />
<Input autoComplete="email" autoFocus placeholder="example@portabase.io" {...field} />
</FormControl>
<FormMessage/>
</FormItem>
@@ -88,7 +88,7 @@ export const RegisterForm = (props: registerFormProps) => {
<FormItem>
<FormLabel>Email</FormLabel>
<FormControl>
<Input placeholder="exemple@portabase.io" {...field} />
<Input placeholder="example@portabase.io" {...field} />
</FormControl>
<FormMessage/>
</FormItem>
@@ -18,6 +18,7 @@ import {
ChannelOrganisationForm
} from "@/components/wrappers/dashboard/admin/channels/organization/channels-organization-form";
type ChannelAddModalProps = {
channel?: NotificationChannelWith | StorageChannelWith
organization?: OrganizationWithMembers;
@@ -34,6 +34,7 @@ import {
addNotificationChannelAction, updateNotificationChannelAction
} from "@/components/wrappers/dashboard/admin/channels/channel/channel-form/providers/notifications/action";
type NotifierFormProps = {
onSuccessAction?: () => void;
organization?: OrganizationWithMembers;
@@ -54,7 +55,7 @@ export const ChannelForm = ({onSuccessAction, organization, defaultValues, kind}
});
useEffect(() => {
form.reset(defaultValues ? {...defaultValues} : {});
form.reset(defaultValues ? {...defaultValues} : {enabled: true});
}, [defaultValues]);
const mutationAddNotificationChannel = useMutation({
@@ -118,7 +119,7 @@ export const ChannelForm = ({onSuccessAction, organization, defaultValues, kind}
}}
>
{type.preview && (
{type.preview && (
<div
className="absolute bottom-0 right-0 overflow-hidden w-20 h-20 pointer-events-none">
<div
@@ -223,11 +224,11 @@ export const ChannelForm = ({onSuccessAction, organization, defaultValues, kind}
<div className="flex justify-between mt-4">
<div>
{defaultValues && (
{kind == "storage" && (
<ChannelTestButton
kind={kind}
organizationId={organization?.id}
channel={defaultValues}
channel={form.getValues()}
/>
)}
</div>
@@ -1,18 +1,21 @@
"use client"
import {Button} from "@/components/ui/button";
import {NotificationChannel} from "@/db/schema/09_notification-channel";
import {useMutation} from "@tanstack/react-query";
import {dispatchNotification} from "@/features/notifications/dispatch";
import {EventPayload} from "@/features/notifications/types";
import {Send, ShieldCheck} from "lucide-react";
import {toast} from "sonner";
import {Button} from "@/components/ui/button";
import {NotificationChannel} from "@/db/schema/09_notification-channel";
import {dispatchNotification} from "@/features/notifications/dispatch";
import {EventPayload} from "@/features/notifications/types";
import {useIsMobile} from "@/hooks/use-mobile";
import {cn} from "@/lib/utils";
import {StorageChannel} from "@/db/schema/12_storage-channel";
import {ChannelKind, getChannelTextBasedOnKind} from "@/components/wrappers/dashboard/admin/channels/helpers/common";
import {ChannelKind} from "@/components/wrappers/dashboard/admin/channels/helpers/common";
import type {StorageInput} from "@/features/storages/types";
import {dispatchStorage} from "@/features/storages/dispatch";
type NotifierTestChannelButtonProps = {
channel: NotificationChannel | StorageChannel;
organizationId?: string;
@@ -20,8 +23,9 @@ type NotifierTestChannelButtonProps = {
}
export const ChannelTestButton = ({channel, organizationId, kind}: NotifierTestChannelButtonProps) => {
const channelText = getChannelTextBasedOnKind(kind)
const isMobile = useIsMobile()
const mutation = useMutation({
mutationFn: async () => {
if (kind === "notification") {
@@ -30,7 +34,7 @@ export const ChannelTestButton = ({channel, organizationId, kind}: NotifierTestC
message: `We are testing channel ${channel.name}`,
level: 'info',
};
const result = await dispatchNotification(payload, undefined, channel.id, organizationId);
const result = await dispatchNotification(payload, undefined, channel, organizationId);
if (result.success) {
toast.success(result.message);
@@ -41,7 +45,7 @@ export const ChannelTestButton = ({channel, organizationId, kind}: NotifierTestC
const input: StorageInput = {
action: "ping",
};
const result = await dispatchStorage(input, undefined, channel.id);
const result = await dispatchStorage(input, undefined, undefined, channel);
if (result.success) {
toast.success("Successfully connected to storage channel");
@@ -47,7 +47,7 @@ export const NotifierSmtpForm = ({form}: NotifierSmtpFormProps) => {
<FormItem>
<FormLabel>Username</FormLabel>
<FormControl>
<Input placeholder="contact@exemple.com" {...field} value={field.value ?? ""}/>
<Input placeholder="contact@example.com" {...field} value={field.value ?? ""}/>
</FormControl>
<FormMessage/>
</FormItem>
@@ -77,7 +77,7 @@ export const NotifierSmtpForm = ({form}: NotifierSmtpFormProps) => {
<FormItem>
<FormLabel>From Email</FormLabel>
<FormControl>
<Input placeholder={`"Portabase" <exemple@portabase.io>`} {...field}
<Input placeholder={`"Portabase" <example@portabase.io>`} {...field}
value={field.value ?? ""}/>
</FormControl>
<FormMessage/>
@@ -19,9 +19,22 @@ export const StorageS3Form = ({form}: StorageS3FormProps) => {
name="config.endPointUrl"
render={({field}) => (
<FormItem>
<FormLabel>Endpoind URL</FormLabel>
<FormLabel>Endpoint URL</FormLabel>
<FormControl>
<Input {...field} placeholder="s3.exemple.com"/>
<Input {...field} placeholder="s3.amazonaws.com"/>
</FormControl>
<FormMessage/>
</FormItem>
)}
/>
<FormField
control={form.control}
name="config.region"
render={({field}) => (
<FormItem>
<FormLabel>Region</FormLabel>
<FormControl>
<Input {...field} placeholder="us-east-1"/>
</FormControl>
<FormMessage/>
</FormItem>
@@ -110,7 +110,7 @@ export const EmailForm = (props: EmailFormProps) => {
<FormItem>
<FormLabel>From Email *</FormLabel>
<FormControl>
<Input placeholder={"exemple@portabase.com"} {...field} />
<Input placeholder={"example@portabase.com"} {...field} />
</FormControl>
<FormDescription>{"The email from where the email will be send"}</FormDescription>
<FormMessage/>
@@ -172,7 +172,7 @@ export const EmailForm = (props: EmailFormProps) => {
<FormItem>
<FormLabel>User Email *</FormLabel>
<FormControl>
<Input placeholder={"exemple@portabase.com"} {...field} />
<Input placeholder={"example@portabase.com"} {...field} />
</FormControl>
<FormDescription>{"The email server user"}</FormDescription>
<FormMessage/>