diff --git a/src/app/AccessManagement/AccessManager.tsx b/src/app/AccessManagement/AccessManager.tsx
index 9f1474f6..d87a5b6c 100644
--- a/src/app/AccessManagement/AccessManager.tsx
+++ b/src/app/AccessManagement/AccessManager.tsx
@@ -99,10 +99,12 @@ const AccessManager = () => {
shouldFocusToggleOnSelect
>
- setIsFlushCache(true)}>
+ setIsFlushCache(true)}
+ >
{t('access-management.flush-cache-action')}
@@ -131,11 +133,13 @@ const AccessManager = () => {
{buildSelectedContent}
- setIsFlushCache(false)}
- submitModal={() => {
- setIsFlushCache(false);
- }}/>
+ setIsFlushCache(false)}
+ submitModal={() => {
+ setIsFlushCache(false);
+ }}
+ />
);
diff --git a/src/app/AccessManagement/FlushRoleCacheModal.tsx b/src/app/AccessManagement/FlushRoleCacheModal.tsx
index 68d81d7e..93c1024e 100644
--- a/src/app/AccessManagement/FlushRoleCacheModal.tsx
+++ b/src/app/AccessManagement/FlushRoleCacheModal.tsx
@@ -29,20 +29,13 @@ const FlushRoleCacheModal = (props: { isModalOpen: boolean; submitModal: () => v
>
{t('access-management.flush-cache-action')}
,
- }
+ footerContent={
+ }
+ onClick={() => window.open(t('brandname.ickle-query-docs-link'), '_blank')}
+ >
+ {t('caches.query.ickle-query-docs')}
+
+ }
>
{
const health = ComponentHealth[props.health];
const displayIcon = props.displayIcon == undefined ? true : props.displayIcon;
- const {theme} = useContext(ThemeContext);
-
- const getHealthLabelColor = ()=>{
+ const { theme } = useContext(ThemeContext);
+
+ const getHealthLabelColor = () => {
const color = displayUtils.healthColor(health, false);
- return (theme === 'dark' && color === chart_global_label_Fill.value)
- ? global_Color_light_100.value
- : color;
- }
+ return theme === 'dark' && color === chart_global_label_Fill.value ? global_Color_light_100.value : color;
+ };
return (
{displayIcon && (
diff --git a/src/app/Common/Status.tsx b/src/app/Common/Status.tsx
index 60c4c843..20c8ec8b 100644
--- a/src/app/Common/Status.tsx
+++ b/src/app/Common/Status.tsx
@@ -20,9 +20,7 @@ const Status = (props: { status?: Status }) => {
-
- {status.name}
-
+ {status.name}
diff --git a/src/app/ProtoSchema/ProtobufSchemasDisplay.tsx b/src/app/ProtoSchema/ProtobufSchemasDisplay.tsx
index cdee08a8..2c43696b 100644
--- a/src/app/ProtoSchema/ProtobufSchemasDisplay.tsx
+++ b/src/app/ProtoSchema/ProtobufSchemasDisplay.tsx
@@ -59,7 +59,7 @@ const ProtobufSchemasDisplay = (props: { setProtoSchemasCount: (number) => void;
page: 1,
perPage: 10
});
- const {syntaxHighLighterTheme} = useContext(ThemeContext)
+ const { syntaxHighLighterTheme } = useContext(ThemeContext);
const isSchemaExpanded = (row) => expandedSchemaNames.includes(row.name);
@@ -218,7 +218,12 @@ const ProtobufSchemasDisplay = (props: { setProtoSchemasCount: (number) => void;
return (
-
+
{schemasContent.get(name)}
diff --git a/src/app/Rebalancing/RebalancingCache.tsx b/src/app/Rebalancing/RebalancingCache.tsx
index 1046b495..c72160b1 100644
--- a/src/app/Rebalancing/RebalancingCache.tsx
+++ b/src/app/Rebalancing/RebalancingCache.tsx
@@ -35,8 +35,8 @@ const RebalancingCache = () => {
if (cache?.rehash_in_progress) {
return (
-
-
+
+
);
}
@@ -46,7 +46,7 @@ const RebalancingCache = () => {
*/
if (ConsoleServices.security().hasConsoleACL(ConsoleACL.ADMIN, connectedUser)) {
return (
-
+
{
return (
-
+
);
};
diff --git a/src/app/assets/languages/en.json b/src/app/assets/languages/en.json
index fae4bf78..32097f44 100644
--- a/src/app/assets/languages/en.json
+++ b/src/app/assets/languages/en.json
@@ -22,7 +22,8 @@
"about-name": "About",
"documentation-name": "Documentation",
"close-browser-message": "Close the browser or open an incognito window to log again.",
- "dark-theme": "Dark theme"
+ "dark-theme": "Dark theme",
+ "logout": "Logout"
},
"welcome-page": {
"welcome-title": "Welcome to {{brandname}} Server",
diff --git a/src/app/providers/ThemeProvider.tsx b/src/app/providers/ThemeProvider.tsx
index 55ef48bd..037a28be 100644
--- a/src/app/providers/ThemeProvider.tsx
+++ b/src/app/providers/ThemeProvider.tsx
@@ -3,39 +3,38 @@ import { getInitialTheme } from '@app/utils/themeUtils';
import { githubGist, dracula } from 'react-syntax-highlighter/dist/esm/styles/hljs';
const initialState = {
- theme : '',
- toggleTheme : ()=>{},
- syntaxHighLighterTheme : ''
-}
+ theme: '',
+ toggleTheme: () => {},
+ syntaxHighLighterTheme: ''
+};
export const ThemeContext = React.createContext(initialState);
+const ThemeProvider = ({ children }) => {
+ const [theme, setTheme] = useState(getInitialTheme);
+ const syntaxHighLighterTheme = theme === 'dark' ? dracula : githubGist;
-const ThemeProvider = ({children})=>{
- const [theme,setTheme] = useState(getInitialTheme);
- const syntaxHighLighterTheme = theme === 'dark'? dracula : githubGist;
-
- useEffect(()=>{
- if (theme === 'dark') {
- document.documentElement.classList.add('pf-v5-theme-dark');
- } else {
- document.documentElement.classList.remove('pf-v5-theme-dark');
- }
-
- if (localStorage) {
- localStorage.setItem('theme',theme);
- }
- },[theme])
-
- const toggleTheme = ()=>{
- setTheme((previousTheme)=> previousTheme === 'light'?'dark':'light');
+ useEffect(() => {
+ if (theme === 'dark') {
+ document.documentElement.classList.add('pf-v5-theme-dark');
+ } else {
+ document.documentElement.classList.remove('pf-v5-theme-dark');
}
- const themeState = {
- theme,
- toggleTheme,
- syntaxHighLighterTheme
- }
- return {children}
-}
-export {ThemeProvider}
+ if (localStorage) {
+ localStorage.setItem('theme', theme);
+ }
+ }, [theme]);
+
+ const toggleTheme = () => {
+ setTheme((previousTheme) => (previousTheme === 'light' ? 'dark' : 'light'));
+ };
+ const themeState = {
+ theme,
+ toggleTheme,
+ syntaxHighLighterTheme
+ };
+ return {children};
+};
+
+export { ThemeProvider };
diff --git a/src/app/services/rolesHook.ts b/src/app/services/rolesHook.ts
index 7425c386..3b9e881f 100644
--- a/src/app/services/rolesHook.ts
+++ b/src/app/services/rolesHook.ts
@@ -83,10 +83,7 @@ export function useFlushCache(call: () => void) {
const { t } = useTranslation();
const onFlushCache = () => {
ConsoleServices.security()
- .flushCache(
- t('access-management.flush-cache-success'),
- t('access-management.flush-cache-error')
- )
+ .flushCache(t('access-management.flush-cache-success'), t('access-management.flush-cache-error'))
.then((actionResponse) => {
addAlert(actionResponse);
})
diff --git a/src/app/utils/themeUtils.ts b/src/app/utils/themeUtils.ts
index 72d5136d..2669a9eb 100644
--- a/src/app/utils/themeUtils.ts
+++ b/src/app/utils/themeUtils.ts
@@ -1,12 +1,9 @@
+export const getInitialTheme = (): string => {
+ // Get theme from local storage cookie
+ if (localStorage && localStorage.getItem('theme')) return localStorage.getItem('theme') || 'light';
+ // Check System preferred Theme
+ const prefersDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
-export const getInitialTheme = () : string => {
- // Get theme from local storage cookie
- if(localStorage && localStorage.getItem('theme'))
- return localStorage.getItem('theme') || 'light';
-
- // Check System preferred Theme
- const prefersDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
-
- return prefersDarkTheme? 'dark' :'light';
-}
+ return prefersDarkTheme ? 'dark' : 'light';
+};