Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions scripts/lint-baseline/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
"src/analysis/classic/shaman/shared/TotemTracker.tsx:195:26__@typescript-eslint/no-explicit-any",
"src/analysis/classic/shaman/shared/TotemTracker.tsx:204:25__@typescript-eslint/no-explicit-any",
"src/analysis/classic/shaman/shared/TotemTracker.tsx:33:20__@typescript-eslint/no-explicit-any",
"src/analysis/classic/warlock/demonology/guide/DoomguardSection.tsx:8:3__@eslint-react/no-nested-component-definitions",
"src/analysis/classic/warrior/fury/modules/checklist/Component.tsx:14:30__@eslint-react/no-nested-component-definitions",
"src/analysis/retail/deathknight/blood/modules/features/RuneWaste.tsx:189:51__@typescript-eslint/no-explicit-any",
"src/analysis/retail/deathknight/blood/modules/spells/DeathStrike/UsageSection.tsx:131:55__@typescript-eslint/no-explicit-any",
"src/analysis/retail/deathknight/blood/modules/spells/DeathStrike/UsageSection.tsx:234:68__@typescript-eslint/no-explicit-any",
"src/analysis/retail/deathknight/blood/modules/spells/DeathStrike/UsageSection.tsx:252:42__@typescript-eslint/no-explicit-any",
"src/analysis/retail/deathknight/frost/modules/features/checklist/Component.tsx:15:30__@eslint-react/no-nested-component-definitions",
"src/analysis/retail/deathknight/unholy/modules/features/checklist/Component.tsx:15:30__@eslint-react/no-nested-component-definitions",
"src/analysis/retail/druid/feral/modules/core/Snapshots.ts:149:45__@typescript-eslint/no-explicit-any",
"src/analysis/retail/druid/feral/modules/core/Snapshots.ts:159:50__@typescript-eslint/no-explicit-any",
"src/analysis/retail/druid/feral/modules/core/Snapshots.ts:253:42__@typescript-eslint/no-explicit-any",
Expand Down Expand Up @@ -170,6 +168,12 @@
"src/common/indexById.ts:14:39__@typescript-eslint/no-explicit-any",
"src/common/indexById.ts:17:89__@typescript-eslint/no-explicit-any",
"src/common/indexById.ts:40:39__@typescript-eslint/no-explicit-any",
"src/common/lazyLoadComponent.tsx:18:9__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/common/lazyLoadComponent.tsx:20:8__react-hooks/exhaustive-deps",
"src/common/lazyLoadComponent.tsx:4:63__@typescript-eslint/no-explicit-any",
"src/common/lazyLoadComponent.tsx:5:24__@typescript-eslint/no-explicit-any",
"src/common/lazyLoadComponent.tsx:6:28__@typescript-eslint/no-explicit-any",
"src/common/lazyLoadComponent.tsx:8:46__@typescript-eslint/no-explicit-any",
"src/common/safeMerge.ts:4:42__@typescript-eslint/no-explicit-any",
"src/interface/Ad.tsx:82:13__@typescript-eslint/no-explicit-any",
"src/interface/ChangelogPanel.tsx:51:11__@eslint-react/dom/no-missing-button-type",
Expand All @@ -186,7 +190,7 @@
"src/interface/ReadableListing.tsx:12:18__@eslint-react/no-children-for-each",
"src/interface/ReportRaidBuffList.tsx:30:1__null",
"src/interface/ReportRaidBuffList.tsx:65:1__null",
"src/interface/ResultsChangelogTab.jsx:16:3__@eslint-react/no-default-props",
"src/interface/ReportSelectionHeader.tsx:154:33__@typescript-eslint/no-explicit-any",
"src/interface/guide/components/Apl/index.tsx:133:25__@typescript-eslint/no-explicit-any",
"src/interface/guide/components/Apl/violations/claims.tsx:47:72__@typescript-eslint/no-explicit-any",
"src/interface/guide/components/Apl/violations/index.tsx:52:35__@typescript-eslint/no-explicit-any",
Expand All @@ -201,14 +205,23 @@
"src/interface/guide/index.tsx:138:54__@typescript-eslint/no-explicit-any",
"src/interface/guide/index.tsx:184:42__@typescript-eslint/no-explicit-any",
"src/interface/guide/index.tsx:185:21__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/EncounterStats.tsx:138:6__react-hooks/exhaustive-deps",
"src/interface/report/Results/PhaseSelector.tsx:41:5__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/interface/report/Results/TimeFilter.tsx:27:5__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/interface/report/Results/TimeFilter.tsx:28:5__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/interface/report/Results/TimeFilter.tsx:29:5__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/interface/report/Results/TimeFilter.tsx:71:9__@eslint-react/dom/no-missing-button-type",
"src/interface/report/Results/TimeInput.tsx:39:5__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/interface/report/Results/TimeInput.tsx:40:5__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/interface/report/Results/TimeInput.tsx:41:5__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/interface/report/Results/Timeline/Lane.tsx:181:68__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/Timeline/Auras.tsx:140:31__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/Timeline/Auras.tsx:19:23__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/Timeline/Auras.tsx:26:44__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/Timeline/Auras.tsx:43:32__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/Timeline/Auras.tsx:56:12__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/Timeline/Auras.tsx:79:35__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/Timeline/Auras.tsx:94:36__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/Timeline/Lane.tsx:188:66__@typescript-eslint/no-explicit-any",
"src/interface/report/Results/index.tsx:73:7__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/interface/report/Results/index.tsx:76:5__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/interface/report/hooks/useBossPhaseEvents.tsx:103:7__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
Expand Down Expand Up @@ -304,7 +317,7 @@
"src/parser/shared/modules/GlobalCooldown.tsx:179:34__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/HotTracker.ts:883:36__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/HotTracker.ts:883:58__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/features/Checklist/Requirement.tsx:40:48__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/features/Checklist/Requirement.tsx:48:57__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/features/Checklist/Rule.tsx:81:37__@eslint-react/no-unstable-context-value",
"src/parser/shared/modules/features/Checklist/helpers/performanceForThresholds.ts:99:62__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/helpers/ExecuteHelper.ts:430:53__@typescript-eslint/no-explicit-any",
Expand All @@ -318,27 +331,22 @@
"src/parser/shared/modules/helpers/Probability.tsx:42:64__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/mana/ManaLevelChartComponent.tsx:12:15__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/mana/ManaLevelChartComponent.tsx:13:16__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/mana/ManaLevelChartComponent.tsx:86:64__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/mana/ManaUsageChartComponent.tsx:11:16__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/mana/ManaUsageChartComponent.tsx:88:64__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/mana/ManaLevelChartComponent.tsx:68:51__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/mana/ManaUsageChartComponent.tsx:85:62__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/mana/ManaUsageChartComponent.tsx:9:16__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/resourcetracker/ResourceSuggest.tsx:10:18__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/resourcetracker/ResourceTracker.ts:377:25__@typescript-eslint/no-explicit-any",
"src/parser/shared/modules/resources/resourcetracker/ResourceTracker.ts:377:45__@typescript-eslint/no-explicit-any",
"src/parser/shared/normalizers/ApplyBuff.ts:42:5__@typescript-eslint/prefer-for-of",
"src/parser/shared/normalizers/MissingDotApplyDebuffPrePull.ts:38:14__@typescript-eslint/no-explicit-any",
"src/parser/ui/BaseChart.tsx:24:9__@typescript-eslint/no-explicit-any",
"src/parser/ui/Cooldown.tsx:70:24__@eslint-react/no-access-state-in-setstate",
"src/parser/ui/Cooldown.tsx:76:23__@eslint-react/no-access-state-in-setstate",
"src/parser/ui/DonutChart.tsx:28:3__@eslint-react/no-default-props",
"src/parser/ui/FlushLineChart.tsx:45:38__@typescript-eslint/no-explicit-any",
"src/parser/ui/FlushLineChart.tsx:6:9__@typescript-eslint/no-explicit-any",
"src/parser/ui/FooterChart.tsx:13:9__@typescript-eslint/no-explicit-any",
"src/parser/ui/ItemStatistic.tsx:20:15__@eslint-react/no-default-props",
"src/parser/ui/ManaLevelGraph.tsx:39:43__@typescript-eslint/no-explicit-any",
"src/parser/ui/ManaLevelGraph.tsx:35:41__@typescript-eslint/no-explicit-any",
"src/parser/ui/Panel.tsx:18:7__@eslint-react/no-default-props",
"src/parser/ui/Statistic.tsx:104:11__@eslint-react/dom/no-missing-button-type",
"src/parser/ui/Statistic.tsx:44:3__@eslint-react/no-default-props",
"src/parser/ui/Statistic.tsx:70:18__@eslint-react/no-access-state-in-setstate",
"src/parser/ui/Statistic.tsx:58:7__@eslint-react/hooks-extra/no-direct-set-state-in-use-effect",
"src/parser/ui/StatisticBox.tsx:41:3__@eslint-react/no-default-props",
"src/parser/ui/StatisticBox.tsx:65:18__@eslint-react/no-access-state-in-setstate",
"src/parser/ui/StatisticBox.tsx:97:15__@eslint-react/dom/no-missing-button-type"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import fetchWcl from 'common/fetchWclApi';
import { WCLBossResources } from 'common/WCL_TYPES';
import ManaLevelGraph from 'parser/ui/ManaLevelGraph';
import ManaStyles from 'parser/ui/ManaStyles';
import { useEffect, useState } from 'react';

interface Props {
reportCode: string;
actorId: number;
start: number;
end: number;
offsetTime: number;
manaUpdates: {
timestamp: number;
current: number;
max: number;
}[];
}

const Mana = ({ reportCode, actorId, start, end, manaUpdates, offsetTime }: Props) => {
const [bossHealth, setBossHealth] = useState<WCLBossResources | null>(null);

useEffect(() => {
const load = () => {
fetchWcl<WCLBossResources>(`report/graph/resources/${reportCode}`, {
start,
end,
sourceclass: 'Boss',
hostility: 'Enemies',
abilityid: 1000,
}).then((json) => {
setBossHealth(json);
});
};

load();
}, [reportCode, start, end]);

if (!bossHealth) {
return <div>Loading...</div>;
}

const mana = manaUpdates.map(({ timestamp, current, max }) => ({
x: Math.max(timestamp, start) - start,
y: (current / max) * 100,
}));

const deaths = bossHealth.deaths?.length
? bossHealth.deaths
.filter((death) => death.targetID === actorId)
.map(({ timestamp, killingAbility }) => ({
x: timestamp - start,
ability: killingAbility || 'Uknown Ability',
}))
: [];

const bossData = bossHealth.series.map((series, i) => {
const data = series.data.map(([timestamp, health]) => ({ x: timestamp - start, y: health }));

const color = ManaStyles[`Boss-${i}` as keyof typeof ManaStyles] as {
backgroundColor: string;
borderColor: string;
};

return {
title: `${series.name} Health`,
borderColor: color.borderColor,
backgroundColor: color.backgroundColor,
data,
};
});

return (
<div>
<br />
<div className="graph-container">
<ManaLevelGraph mana={mana} deaths={deaths} bossData={bossData} />
</div>
</div>
);
};

export default Mana;
38 changes: 0 additions & 38 deletions src/common/lazyLoadComponent.jsx

This file was deleted.

Loading
Loading