mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-10-18 09:24:23 +00:00
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:
1 parent
10818493bc
commit
e65d9b9db6
55 files changed
+276
-113
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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]);
|
||||
};
|
||||
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user