some S3 compatible storage systems have a region parameter (#524)

* some S3 compatible storage systems have a region parameter

* wip

* wip

* replace current toastMethod by new toastProvider

* wip

* fix failing testcase

* wip
This commit is contained in:
Hoan Luu Huu authored and GitHub committed 2025-05-28 10:03:39 -04:00
1 parent 10818493bc
commit e65d9b9db6
55 files changed
+276 -113

No files matched your search

+2 -2
View File
@@ -1,7 +1,6 @@
import { useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { toastError } from "src/store";
import { useToast } from "src/components/toast/toast-provider";
import type { IMessage } from "src/store/types";
@@ -11,6 +10,7 @@ export const useRedirect = <Type>(
message: IMessage,
) => {
const navigate = useNavigate();
const { toastError } = useToast();
useEffect(() => {
if (collection && !collection.length) {
+4 -2
View File
@@ -7,8 +7,9 @@ import {
SpeechCredential,
User,
} from "src/api/types";
import { useToast } from "src/components/toast/toast-provider";
import { toastError, useSelectState } from "src/store";
import { useSelectState } from "src/store";
import { IMessage, Scope, UserData } from "src/store/types";
@@ -21,6 +22,7 @@ export const useScopedRedirect = (
) => {
const navigate = useNavigate();
const currentServiceProvider = useSelectState("currentServiceProvider");
const { toastError } = useToast();
useEffect(() => {
if (
@@ -47,5 +49,5 @@ export const useScopedRedirect = (
navigate(redirect);
}
}, [user, currentServiceProvider, data]);
}, [user, currentServiceProvider, data, toastError]);
};
+3 -1
View File
@@ -2,11 +2,12 @@ import React, { useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { toastError, useSelectState, useAccessControl } from "src/store";
import { useSelectState, useAccessControl } from "src/store";
import { ROUTE_INTERNAL_SETTINGS } from "src/router/routes";
import type { ACL, IMessage } from "src/store/types";
import type { ServiceProvider } from "src/api/types";
import { useToast } from "src/components/toast/toast-provider";
type PassthroughProps = {
[key: string]: unknown;
@@ -22,6 +23,7 @@ export const withAccessControl = (
) => {
return function WithAccessControl(Component: React.ComponentType) {
return function ComponentWithAccessControl(props: PassthroughProps) {
const { toastError } = useToast();
const navigate = useNavigate();
const hasPermission = useAccessControl(acl);
const currentServiceProvider = useSelectState("currentServiceProvider");