Skip to content

Commit

Permalink
the lintening
Browse files Browse the repository at this point in the history
Signed-off-by: Antoine MAZEAS <[email protected]>
  • Loading branch information
antoinemzs committed Dec 24, 2024
1 parent aa23d8a commit d5874f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
import { makeStyles } from '@mui/styles';
import { FunctionComponent, useContext, useEffect, useMemo, useState } from 'react';

import { findTeams } from '../../../../actions/teams/team-actions';
import { fetchTeams, findTeams } from '../../../../actions/teams/team-actions';
import { TeamsHelper } from '../../../../actions/teams/team-helper';
import PaginationComponentV2 from '../../../../components/common/queryable/pagination/PaginationComponentV2';
import { buildSearchPagination } from '../../../../components/common/queryable/QueryableUtils';
import { useQueryable } from '../../../../components/common/queryable/useQueryableWithLocalStorage';
Expand All @@ -22,14 +23,12 @@ import Transition from '../../../../components/common/Transition';
import { useFormatter } from '../../../../components/i18n';
import ItemTags from '../../../../components/ItemTags';
import type { Theme } from '../../../../components/Theme';
import { useHelper } from '../../../../store';
import type { TeamOutput } from '../../../../utils/api-types';
import { useAppDispatch } from '../../../../utils/hooks';
import useDataLoader from '../../../../utils/hooks/useDataLoader';
import CreateTeam from '../../components/teams/CreateTeam';
import { PermissionsContext, TeamContext } from '../Context';
import { useAppDispatch } from '../../../../utils/hooks';
import { fetchTeams } from '../../../../actions/teams/team-actions';
import {useHelper} from "../../../../store";
import {TeamsHelper} from "../../../../actions/teams/team-helper";
import useDataLoader from "../../../../utils/hooks/useDataLoader";

const useStyles = makeStyles((theme: Theme) => ({
item: {
Expand All @@ -55,7 +54,7 @@ const InjectAddTeams: FunctionComponent<Props> = ({
availableTeamIds,
}) => {
// Standard hooks
const dispatch = useAppDispatch()
const dispatch = useAppDispatch();
const { t } = useFormatter();
const classes = useStyles();
const { permissions } = useContext(PermissionsContext);
Expand All @@ -64,7 +63,6 @@ const InjectAddTeams: FunctionComponent<Props> = ({
const [teamValues, setTeamValues] = useState<TeamOutput[]>([]);
const [selectedTeamValues, setSelectedTeamValues] = useState<TeamOutput[]>([]);

console.log("availableTeamIds = {}", availableTeamIds)
const allTeams = useHelper((helper: TeamsHelper) => helper.getTeams().filter(t => availableTeamIds.length > 0 ? availableTeamIds.includes(t.team_id) : true));
useDataLoader(() => {
dispatch(fetchTeams()).finally(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Tab, Tabs } from '@mui/material';
import * as React from 'react';
import { useEffect, useRef, useState } from 'react';

import { fetchExercise } from '../../../../actions/Exercise';
import { ExercisesHelper } from '../../../../actions/exercises/exercise-helper';
import { fetchInject } from '../../../../actions/Inject';
import type { InjectOutputType } from '../../../../actions/injects/Inject';
import type { InjectHelper } from '../../../../actions/injects/inject-helper';
Expand All @@ -13,8 +15,6 @@ import { useAppDispatch } from '../../../../utils/hooks';
import useDataLoader from '../../../../utils/hooks/useDataLoader';
import UpdateInjectDetails from './UpdateInjectDetails';
import UpdateInjectLogicalChains from './UpdateInjectLogicalChains';
import {ExercisesHelper} from "../../../../actions/exercises/exercise-helper";
import {fetchExercise} from "../../../../actions/Exercise";

interface Props {
open: boolean;
Expand Down Expand Up @@ -60,9 +60,9 @@ const UpdateInject: React.FC<Props> = ({ open, handleClose, onUpdateInject, mass
inject: helper.getInject(injectId),
}));
const { simulation } = useHelper((helper: ExercisesHelper) => ({
simulation: helper.getExercise(inject.inject_exercise)
simulation: helper.getExercise(inject.inject_exercise),
}));
const availableTeamIds = simulation?.exercise_teams || []
const availableTeamIds = simulation?.exercise_teams || [];

useDataLoader(() => {
setIsInjectLoading(true);
Expand Down

0 comments on commit d5874f1

Please sign in to comment.