Skip to content
Snippets Groups Projects
Commit f419a6b8 authored by Reinder Kraaij's avatar Reinder Kraaij :eye:
Browse files

Merge branch 'TMSS-2294-Part-IV' into 'master'

Resolve TMSS-2294 "Part iv"

Closes TMSS-2294

See merge request !1225
parents a78f1cb8 326abc84
No related branches found
No related tags found
1 merge request!1225Resolve TMSS-2294 "Part iv"
......@@ -10,7 +10,7 @@ server {
listen 8008;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always;
add_header Content-Security-Policy "default-src 'self' data: https://cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline' https://stackpath.bootstrapcdn.com https://fonts.googleapis.com https://cdnjs.cloudflare.com; font-src 'self' data: https://stackpath.bootstrapcdn.com https://fonts.gstatic.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com; connect-src 'self' ws://localhost:5678 ws://tmss.lofar.eu:5678";
add_header Content-Security-Policy "default-src 'self' data: https://cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline' https://stackpath.bootstrapcdn.com https://fonts.googleapis.com https://cdnjs.cloudflare.com; font-src 'self' data: https://stackpath.bootstrapcdn.com https://fonts.gstatic.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com; connect-src 'self' ws://localhost:5678 ws://tmss.lofar.eu:5678; img-src 'self' https://tile.openstreetmap.org";
add_header Referrer-Policy 'strict-origin';
location / {
......
......@@ -8,10 +8,7 @@
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>TMSS</title>
<meta http-equiv="Content-Security-Policy" content="default-src *;
img-src * 'self' data: https:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *;
style-src 'self' 'unsafe-inline' *" />
</head>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
......
......@@ -79,16 +79,17 @@ export default function StationView(props) {
/>
<TabView>
<TabPanel header="Station List" className="TabStation">
<TabPanel header="Station Geo Map" className="TabStation">
<div className="StationListWrap" >
<ListBox options={stations} optionLabel="0" className="StationListbox" onChange={(e) => ZoomTo(e.value)}/>
<StationGeoView stations={stationsGeo } selected={selectedStation} mapRef={ setMap} ></StationGeoView >
</div>
</TabPanel>
<TabPanel header="Geo Plot">
<div className="GeoMap">
<StationGeoView stations={stationsGeo} selected={selectedStation}></StationGeoView >
</div>
<TabPanel header="Station Constraints Plot">
<div className="StationListWrap" >
<ListBox options={stations} optionLabel="0" className="StationListbox" onChange={(e) => ZoomTo(e.value)}/>
<div> A Contraints view will be implemnted here soon. </div>
</div>
</TabPanel>
</TabView>
......
const ExternalUrlsUtils = {
BaseLofarMonitorUrl : "https://proxy.lofar.eu/lofmonitor/station_overview?station=",
/**
* Function to give back a scheduling constraint url
* @param {string} Station - The Station
* @param {string} schedulingUnit - the Unit we are looking at
* @param {string} onDate - 2023-02-14 formatedf formated of the date
* @returns string with the url
*/
getUserRolePermissionForStationAndSchedulingUnitOnDate(station,schedulingUnit,onDate) {
return "/api/scheduling_unit_blueprint/" + schedulingUnit + "/scheduling_constraints_plot/" + station + "/" + onDate
},
/**
* Function to give back the Lofar Monitoring Url
* @param {string} Station - The Station
* @returns string with the url
*/
getLofarMontitorUrlForStation(station) {
return this.BaseLofarMonitorUrl + station
}
};
export default ExternalUrlsUtils;
\ No newline at end of file
import externalUrls from "./externalurls";
describe('getLofarMontitorUrlForStation', () => {
it('should return the correct url', () => {
const subbandString = externalUrls.getLofarMontitorUrlForStation("CS002")
expect(subbandString).toEqual("https://proxy.lofar.eu/lofmonitor/station_overview?station=CS002")
})
});
describe('getUserRolePermissionForStationAndSchedulingUnitOnDate', () => {
it('should return the correct url', () => {
const subbandString = externalUrls.getUserRolePermissionForStationAndSchedulingUnitOnDate("CS003", 21, "1976-08-06")
expect(subbandString).toEqual("/api/scheduling_unit_blueprint/21/scheduling_constraints_plot/CS003/1976-08-06")
})
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment