11import React , { useEffect , useRef , useState } from "react" ;
22import { useTranslation } from "react-i18next" ;
3- import { Link } from "react-router" ;
3+ import { useNavigate } from "react-router" ;
44import i18n from "../i18n/i18n" ;
55import languages from "../i18n/languages" ;
66import opencastLogo from "../img/opencast-white.svg?url" ;
77import { setSpecificServiceFilter } from "../slices/tableFilterSlice" ;
8- import { loadServicesIntoTable } from "../thunks/tableThunks" ;
98import { getErrorCount , getHealthStatus } from "../selectors/healthSelectors" ;
109import {
1110 getOrgProperties ,
@@ -73,14 +72,6 @@ const Header = () => {
7372 registrationModalRef . current ?. open ( )
7473 } ;
7574
76- const redirectToServices = async ( ) => {
77- // Load services into table
78- await dispatch ( loadServicesIntoTable ( ) ) ;
79-
80- // set the action filter value of services to true
81- await dispatch ( setSpecificServiceFilter ( { filter : "actions" , filterValue : "true" } ) ) ;
82- } ;
83-
8475 const showHotKeyCheatSheet = ( ) => {
8576 hotKeyCheatSheetModalRef . current ?. open ( )
8677 } ;
@@ -216,7 +207,6 @@ const Header = () => {
216207 { displayMenuNotify && (
217208 < MenuNotify
218209 healthStatus = { healthStatus }
219- redirectToServices = { redirectToServices }
220210 />
221211 ) }
222212 </ div >
@@ -302,20 +292,27 @@ const MenuLang = () => {
302292
303293const MenuNotify = ( {
304294 healthStatus,
305- redirectToServices
306295} : {
307296 healthStatus : HealthStatus [ ] ,
308- redirectToServices : ( ) => Promise < void > ,
309297} ) => {
298+ const dispatch = useAppDispatch ( ) ;
299+ const navigate = useNavigate ( ) ;
300+
301+ const redirectToServices = async ( ) => {
302+ // set the action filter value of services to true
303+ await dispatch ( setSpecificServiceFilter ( { filter : "actions" , filterValue : "true" } ) ) ;
304+ navigate ( "/systems/services" ) ;
305+ } ;
306+
310307 return (
311308 < ul className = "dropdown-ul" >
312309 { /* For each service in the serviceList (Background Services) one list item */ }
313310 { healthStatus . map ( ( service , key ) => (
314311 < li key = { key } >
315312 { ! ! service . status && (
316- < Link
317- to = "/systems/services "
318- onClick = { async ( ) => await redirectToServices ( ) }
313+ < button
314+ className = "button-like-anchor "
315+ onClick = { ( ) => redirectToServices ( ) }
319316 >
320317 < span > { service . name } </ span >
321318 { service . error ? (
@@ -327,7 +324,7 @@ const MenuNotify = ({
327324 { service . status }
328325 </ span >
329326 ) }
330- </ Link >
327+ </ button >
331328 ) }
332329 </ li >
333330 ) ) }
0 commit comments