Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding security token usage #318

Merged
merged 3 commits into from
Oct 29, 2024
Merged
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
11 changes: 9 additions & 2 deletions src/components/dialog/observation-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { Typography } from '@mui/material';
import axios from 'axios';
import axiosRetry from 'axios-retry';
import { LineChart, Line, XAxis, YAxis, CartesianGrid, ResponsiveContainer, Tooltip, ReferenceLine } from 'recharts';

import { getNamespacedEnvParam } from "@utils/map-utils";
import dayjs from 'dayjs';


// install day.js for UTC visual formatting
const utc = require("dayjs/plugin/utc");

Expand Down Expand Up @@ -56,10 +57,16 @@ function getObsChartData(url, setLineButtonView) {

// create the function to call for data
queryFn: async () => {
// create the authorization header
const requestOptions = {
method: 'GET',
headers: { Authorization: `Bearer ${ getNamespacedEnvParam('REACT_APP_UI_DATA_TOKEN') }`}
};

// make the call to get the data
const ret_val = await axios
// make the call to get the data
.get(url)
.get(url, requestOptions)
// use the data returned
.then (( response ) => {
// return the data
Expand Down