mirror of
https://github.com/Unkn0wnCat/matrix-veles.git
synced 2025-05-06 21:56:13 +02:00
webui: Fix warnings
This commit is contained in:
parent
7b3598fad6
commit
52b426cb6a
10 changed files with 24 additions and 27 deletions
|
@ -6,7 +6,7 @@ import RegisterView from "./components/auth/RegisterView";
|
||||||
import RequireAuth from "./features/auth/RequireAuth";
|
import RequireAuth from "./features/auth/RequireAuth";
|
||||||
import {useAppDispatch, useAppSelector} from "./app/hooks";
|
import {useAppDispatch, useAppSelector} from "./app/hooks";
|
||||||
import broadcastChannel from "./app/broadcastChannel";
|
import broadcastChannel from "./app/broadcastChannel";
|
||||||
import {logOut, receiveAuthUpdate, selectAuth} from "./features/auth/authSlice";
|
import {receiveAuthUpdate, selectAuth} from "./features/auth/authSlice";
|
||||||
import PanelLayout from "./layouts/PanelLayout";
|
import PanelLayout from "./layouts/PanelLayout";
|
||||||
import {useTranslation} from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
import {
|
import {
|
||||||
|
@ -56,7 +56,7 @@ function App() {
|
||||||
disposeQuery()
|
disposeQuery()
|
||||||
disposeRoomsQuery()
|
disposeRoomsQuery()
|
||||||
environment.getStore().notify(undefined, true)
|
environment.getStore().notify(undefined, true)
|
||||||
}, [auth])
|
}, [auth, disposeQuery, disposeRoomsQuery, environment, loadQuery, loadRoomsQuery])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -16,7 +16,9 @@ export type GQLAuthObj = {
|
||||||
auth?: string
|
auth?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (auth: GQLAuthObj) => new Environment({
|
const RelayEnvironment = (auth: GQLAuthObj) => new Environment({
|
||||||
network: Network.create(fetchRelay(auth)),
|
network: Network.create(fetchRelay(auth)),
|
||||||
store: new Store(new RecordSource()),
|
store: new Store(new RecordSource()),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default RelayEnvironment
|
|
@ -1,8 +1,7 @@
|
||||||
import React, {useCallback} from "react";
|
import React from "react";
|
||||||
import styles from "./List.module.scss";
|
import styles from "./List.module.scss";
|
||||||
import {Box, Loader} from "lucide-react";
|
import {Box, Loader} from "lucide-react";
|
||||||
import {Trans, useTranslation} from "react-i18next";
|
import {Trans, useTranslation} from "react-i18next";
|
||||||
import {Link} from "react-router-dom";
|
|
||||||
import {LoadMoreFn} from "react-relay/relay-hooks/useLoadMoreFunction";
|
import {LoadMoreFn} from "react-relay/relay-hooks/useLoadMoreFunction";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
@ -17,7 +16,7 @@ const List = (props: Props) => {
|
||||||
const {t} = useTranslation()
|
const {t} = useTranslation()
|
||||||
|
|
||||||
return <div className={styles.list + (props.className ? " " + props.className :"")}>
|
return <div className={styles.list + (props.className ? " " + props.className :"")}>
|
||||||
{(!props.children || props.children.length == 0) && <span className={styles.eol}>
|
{(!props.children || props.children.length === 0) && <span className={styles.eol}>
|
||||||
<Box width={50} height={50} strokeWidth={1} strokeDasharray={"2px 4px"} /><br/>
|
<Box width={50} height={50} strokeWidth={1} strokeDasharray={"2px 4px"} /><br/>
|
||||||
<Trans i18nKey={"list.none"}>No entries</Trans>
|
<Trans i18nKey={"list.none"}>No entries</Trans>
|
||||||
</span>}
|
</span>}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {PreloadedQuery, usePaginationFragment} from "react-relay/hooks";
|
import {usePaginationFragment} from "react-relay/hooks";
|
||||||
import {graphql} from "babel-plugin-relay/macro";
|
import {graphql} from "babel-plugin-relay/macro";
|
||||||
import {Trans, useTranslation} from "react-i18next";
|
import {Trans} from "react-i18next";
|
||||||
import styles from "./DashMyLists.module.scss";
|
import styles from "./DashMyLists.module.scss";
|
||||||
import {Link} from "react-router-dom";
|
import {Link} from "react-router-dom";
|
||||||
import List from "../../List";
|
import List from "../../List";
|
||||||
|
@ -14,9 +14,9 @@ type Props = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const DashMyLists = (props: Props) => {
|
const DashMyLists = (props: Props) => {
|
||||||
const {t} = useTranslation()
|
//const {t} = useTranslation()
|
||||||
|
|
||||||
const {data, refetch, loadNext, hasNext, isLoadingNext} = usePaginationFragment<ComponentDashMyLists, DashMyListsFragment$key>(
|
const {data, loadNext, hasNext, isLoadingNext} = usePaginationFragment<ComponentDashMyLists, DashMyListsFragment$key>(
|
||||||
graphql`
|
graphql`
|
||||||
fragment DashMyListsFragment on Query @refetchable(queryName: "ComponentDashMyLists") {
|
fragment DashMyListsFragment on Query @refetchable(queryName: "ComponentDashMyLists") {
|
||||||
lists(after: $first, first: $count) @connection(key: "ComponentDashMyLists_lists") {
|
lists(after: $first, first: $count) @connection(key: "ComponentDashMyLists_lists") {
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {PreloadedQuery, usePaginationFragment} from "react-relay/hooks";
|
import {usePaginationFragment} from "react-relay/hooks";
|
||||||
import {graphql} from "babel-plugin-relay/macro";
|
import {graphql} from "babel-plugin-relay/macro";
|
||||||
import {DashboardQuery} from "./__generated__/DashboardQuery.graphql";
|
|
||||||
import {DashMyRoomsFragment$key} from "./__generated__/DashMyRoomsFragment.graphql";
|
import {DashMyRoomsFragment$key} from "./__generated__/DashMyRoomsFragment.graphql";
|
||||||
import {ComponentDashMyRooms} from "./__generated__/ComponentDashMyRooms.graphql";
|
import {ComponentDashMyRooms} from "./__generated__/ComponentDashMyRooms.graphql";
|
||||||
import {Trans, useTranslation} from "react-i18next";
|
import {Trans} from "react-i18next";
|
||||||
import styles from "./DashMyRooms.module.scss";
|
import styles from "./DashMyRooms.module.scss";
|
||||||
import {Link} from "react-router-dom";
|
import {Link} from "react-router-dom";
|
||||||
import {Loader, Box} from "lucide-react";
|
|
||||||
import List from "../../List";
|
import List from "../../List";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
@ -16,9 +14,9 @@ type Props = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const DashMyRooms = (props: Props) => {
|
const DashMyRooms = (props: Props) => {
|
||||||
const {t} = useTranslation()
|
//const {t} = useTranslation()
|
||||||
|
|
||||||
const {data, refetch, loadNext, hasNext, isLoadingNext} = usePaginationFragment<ComponentDashMyRooms, DashMyRoomsFragment$key>(
|
const {data, loadNext, hasNext, isLoadingNext} = usePaginationFragment<ComponentDashMyRooms, DashMyRoomsFragment$key>(
|
||||||
graphql`
|
graphql`
|
||||||
fragment DashMyRoomsFragment on Query @refetchable(queryName: "ComponentDashMyRooms") {
|
fragment DashMyRoomsFragment on Query @refetchable(queryName: "ComponentDashMyRooms") {
|
||||||
rooms(after: $first, first: $count, filter: {canEdit: true}) @connection(key: "ComponentDashMyRooms_rooms") {
|
rooms(after: $first, first: $count, filter: {canEdit: true}) @connection(key: "ComponentDashMyRooms_rooms") {
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
import React, {useCallback} from "react";
|
import React from "react";
|
||||||
import {graphql} from "babel-plugin-relay/macro";
|
import {graphql} from "babel-plugin-relay/macro";
|
||||||
|
|
||||||
|
|
||||||
import {PreloadedQuery, usePaginationFragment, usePreloadedQuery} from "react-relay/hooks";
|
import {PreloadedQuery, usePreloadedQuery} from "react-relay/hooks";
|
||||||
import {DashboardQuery} from "./__generated__/DashboardQuery.graphql";
|
import {DashboardQuery} from "./__generated__/DashboardQuery.graphql";
|
||||||
import {Trans} from "react-i18next";
|
import {Trans} from "react-i18next";
|
||||||
import {DashboardListsQuery} from "./__generated__/DashboardListsQuery.graphql";
|
|
||||||
import {DashboardQueryLists$data, DashboardQueryLists$key} from "./__generated__/DashboardQueryLists.graphql";
|
|
||||||
import DashMyRooms from "./DashMyRooms";
|
import DashMyRooms from "./DashMyRooms";
|
||||||
import styles from "./Dashboard.module.scss";
|
import styles from "./Dashboard.module.scss";
|
||||||
import DashMyLists from "./DashMyLists";
|
import DashMyLists from "./DashMyLists";
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {useNavigate, useOutlet} from "react-router-dom";
|
||||||
import styles from "./Rooms.module.scss";
|
import styles from "./Rooms.module.scss";
|
||||||
import {Trans} from "react-i18next";
|
import {Trans} from "react-i18next";
|
||||||
import RoomsTable from "./RoomsTable";
|
import RoomsTable from "./RoomsTable";
|
||||||
import {PreloadedQuery, usePreloadedQuery, useQueryLoader} from "react-relay/hooks";
|
import {PreloadedQuery, usePreloadedQuery} from "react-relay/hooks";
|
||||||
import {graphql} from "babel-plugin-relay/macro";
|
import {graphql} from "babel-plugin-relay/macro";
|
||||||
import {RoomsQuery} from "./__generated__/RoomsQuery.graphql";
|
import {RoomsQuery} from "./__generated__/RoomsQuery.graphql";
|
||||||
import {X} from "lucide-react";
|
import {X} from "lucide-react";
|
||||||
|
|
|
@ -11,7 +11,7 @@ type Props = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const RoomsTable = ({initialQueryRef}: Props) => {
|
const RoomsTable = ({initialQueryRef}: Props) => {
|
||||||
const {data, refetch, loadNext, hasNext, isLoadingNext} = usePaginationFragment(graphql`
|
const {data} = usePaginationFragment(graphql`
|
||||||
fragment RoomsTableFragment on Query @refetchable(queryName: "RoomsTableFragment") {
|
fragment RoomsTableFragment on Query @refetchable(queryName: "RoomsTableFragment") {
|
||||||
rooms(after: $first, first: $count, filter: {canEdit: true}) @connection(key: "RoomsTableFragment_rooms") {
|
rooms(after: $first, first: $count, filter: {canEdit: true}) @connection(key: "RoomsTableFragment_rooms") {
|
||||||
edges {
|
edges {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {Link, useLocation, useNavigate, useOutlet} from "react-router-dom";
|
||||||
import {UserPlus, User} from "lucide-react";
|
import {UserPlus, User} from "lucide-react";
|
||||||
|
|
||||||
import {ReactComponent as Logo} from "../logo.svg";
|
import {ReactComponent as Logo} from "../logo.svg";
|
||||||
import {useAppDispatch, useAppSelector} from "../app/hooks";
|
import {useAppSelector} from "../app/hooks";
|
||||||
import {selectAuth} from "../features/auth/authSlice";
|
import {selectAuth} from "../features/auth/authSlice";
|
||||||
import {Trans} from "react-i18next";
|
import {Trans} from "react-i18next";
|
||||||
|
|
||||||
|
|
|
@ -3000,9 +3000,9 @@ caniuse-api@^3.0.0:
|
||||||
lodash.uniq "^4.5.0"
|
lodash.uniq "^4.5.0"
|
||||||
|
|
||||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001297, caniuse-lite@^1.0.30001312:
|
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001297, caniuse-lite@^1.0.30001312:
|
||||||
version "1.0.30001312"
|
version "1.0.30001390"
|
||||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz#e11eba4b87e24d22697dae05455d5aea28550d5f"
|
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001390.tgz"
|
||||||
integrity sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==
|
integrity sha512-sS4CaUM+/+vqQUlCvCJ2WtDlV81aWtHhqeEVkLokVJJa3ViN4zDxAGfq9R8i1m90uGHxo99cy10Od+lvn3hf0g==
|
||||||
|
|
||||||
case-sensitive-paths-webpack-plugin@^2.4.0:
|
case-sensitive-paths-webpack-plugin@^2.4.0:
|
||||||
version "2.4.0"
|
version "2.4.0"
|
||||||
|
|
Loading…
Add table
Reference in a new issue