Skip to content

Commit 3aa75a1

Browse files
Removes DPAD access check for species data (#25)
Removes the dependency on DPAD access checks for determining whether to fetch and display species data.
1 parent c92e4ba commit 3aa75a1

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

‎app/components/species/index.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { useSpeciesContext } from '$components/common/app-context';
3232
import { getColorLegend } from '$utils/data/color';
3333
import { MdContent } from '$components/common/md-content';
3434
import { HealpixArrowDestineData } from '$utils/data/healpix';
35-
import { useKeycloak } from '$components/auth/context';
3635

3736
const ChartsSection = React.lazy(() => import('./charts'));
3837

@@ -59,7 +58,6 @@ export default function Component(props: SpeciesComponentProps) {
5958
const {
6059
params: { id }
6160
} = props;
62-
const { hasDPADAccess } = useKeycloak();
6361
const { group, setGroup, setDestineYear, destineLayer } = useSpeciesContext();
6462

6563

@@ -69,7 +67,6 @@ export default function Component(props: SpeciesComponentProps) {
6967
});
7068

7169
const { data: seasonalData } = useQuery({
72-
enabled: hasDPADAccess,
7370
queryKey: ['species', id, 'csv'],
7471
queryFn: getCsvFn(`/destine/ifs-nemo-${id}-weighted-seasonal.csv`),
7572
select: selectCsvChartData
@@ -87,7 +84,7 @@ export default function Component(props: SpeciesComponentProps) {
8784
queryFn: requestSpeciesArrowFn(group?.file)
8885
});
8986

90-
const destineDataEnabled = !!group?.id && hasDPADAccess && !!destineLayer;
87+
const destineDataEnabled = !!group?.id && !!destineLayer;
9188
const { data: destineArrowData } = useQuery({
9289
enabled: destineDataEnabled,
9390
queryKey: ['species', id, 'arrow-destine', group?.id],

‎app/components/species/map-data.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ import { DeckGLOverlay } from '$components/common/deckgl-overlay';
1111
import { useSpeciesContext } from '$components/common/app-context';
1212
import { getJsonFn, Species } from '$utils/api';
1313
import { MapLoadingIndicator } from '$components/common/map-loading-indicator';
14-
import { useKeycloak } from '$components/auth/context';
1514

1615
export function SpeciesPDF() {
1716
const { id } = useParams<{ id: string }>();
18-
const { hasDPADAccess } = useKeycloak();
1917
const { group, destineLayer, destineYear } = useSpeciesContext();
2018
const map = useMap();
2119

@@ -39,7 +37,7 @@ export function SpeciesPDF() {
3937
queryFn: requestSpeciesArrowFn(group?.file)
4038
});
4139

42-
const destineDataEnabled = !!group?.id && hasDPADAccess && !!destineLayer;
40+
const destineDataEnabled = !!group?.id && !!destineLayer;
4341
const { data: destineArrowData, isLoading: isDestineLoading } = useQuery({
4442
enabled: destineDataEnabled,
4543
queryKey: ['species', id, 'arrow-destine', group?.id],

0 commit comments

Comments
 (0)