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')} , - ]} > - - {t('access-management.modal-flush-cache-description')} - + {t('access-management.modal-flush-cache-description')} ); diff --git a/src/app/AppLayout/AppLayout.tsx b/src/app/AppLayout/AppLayout.tsx index 267f5199..835f12e7 100644 --- a/src/app/AppLayout/AppLayout.tsx +++ b/src/app/AppLayout/AppLayout.tsx @@ -26,15 +26,11 @@ import { ToolbarItem, Tooltip, PageSidebarBody, - Switch + Switch, + MenuToggleElement, + MenuToggle } from '@patternfly/react-core'; -import { - Dropdown, - DropdownGroup, - DropdownItem, - DropdownToggle, - DropdownPosition -} from '@patternfly/react-core/deprecated'; +import { Dropdown, DropdownGroup, DropdownItem } from '@patternfly/react-core'; import icon from '!!url-loader!@app/assets/images/brand.svg'; import { Link, NavLink, Redirect } from 'react-router-dom'; import { IAppRoute, routes } from '@app/routes'; @@ -61,7 +57,7 @@ interface IAppLayout { const AppLayout: React.FunctionComponent = ({ init, children }) => { const { t } = useTranslation(); const brandname = t('brandname.brandname'); - const {theme,toggleTheme} = useContext(ThemeContext); + const { theme, toggleTheme } = useContext(ThemeContext); const history = useHistory(); const { connectedUser } = useConnectedUser(); @@ -95,40 +91,46 @@ const AppLayout: React.FunctionComponent = ({ init, children }) => { ); - const userDropdownItems = [ - - { - if (KeycloakService.Instance.isInitialized() && KeycloakService.Instance.authenticated()) { - KeycloakService.Instance.logout(ConsoleServices.landing()); - } else { - ConsoleServices.authentication().logOutLink(); - history.push('/welcome'); - window.location.reload(); - } - }} - > - Logout - - - ]; - const userActions = () => { const chromeAgent = navigator.userAgent.toString().indexOf('Chrome') > -1; if (chromeAgent || (KeycloakService.Instance.isInitialized() && KeycloakService.Instance.authenticated())) { return ( - - setIsDropdownOpen(!isDropdownOpen)} - isOpen={isDropdownOpen} - toggle={ - setIsDropdownOpen(!isDropdownOpen)}>{connectedUser.name} - } - dropdownItems={userDropdownItems} - /> - + + + setIsDropdownOpen(!isDropdownOpen)} + isOpen={isDropdownOpen} + toggle={(toggleRef: React.Ref) => ( + setIsDropdownOpen(!isDropdownOpen)} + isExpanded={isDropdownOpen} + > + {connectedUser.name} + + )} + shouldFocusToggleOnSelect + > + + { + if (KeycloakService.Instance.isInitialized() && KeycloakService.Instance.authenticated()) { + KeycloakService.Instance.logout(ConsoleServices.landing()); + } else { + ConsoleServices.authentication().logOutLink(); + history.push('/welcome'); + window.location.reload(); + } + }} + > + {t('layout.logout')} + + + + + ); } return ( @@ -143,19 +145,6 @@ const AppLayout: React.FunctionComponent = ({ init, children }) => { ); }; - const helpDropdownItems = [ - window.open(t('brandname.documentation-link'), '_blank')} - key="documentation" - icon={} - > - {t('layout.documentation-name')} - , - setIsAboutOpen(!isAboutOpen)} key="about" component="button"> - {t('layout.about-name')} - - ]; - const headerToolbar = ( @@ -164,29 +153,46 @@ const AppLayout: React.FunctionComponent = ({ init, children }) => { align={{ default: 'alignRight' }} spacer={{ default: 'spacerNone', md: 'spacerMd' }} > - + + + setIsHelpOpen(!isHelpOpen)} isOpen={isHelpOpen} - toggle={ - setIsHelpOpen(!isHelpOpen)}> + toggle={(toggleRef: React.Ref) => ( + setIsHelpOpen(!isHelpOpen)} + isExpanded={isHelpOpen} + > - - } - dropdownItems={helpDropdownItems} - /> + + )} + > + window.open(t('brandname.documentation-link'), '_blank')} + key="documentation" + icon={} + > + {t('layout.documentation-name')} + + , + setIsAboutOpen(!isAboutOpen)} key="about" component="button"> + {t('layout.about-name')} + + {!ConsoleServices.authentication().isNotSecured() && userActions()} diff --git a/src/app/Caches/Configuration/CacheConfiguration.tsx b/src/app/Caches/Configuration/CacheConfiguration.tsx index 8494fca5..57907805 100644 --- a/src/app/Caches/Configuration/CacheConfiguration.tsx +++ b/src/app/Caches/Configuration/CacheConfiguration.tsx @@ -1,4 +1,4 @@ -import React, {useContext} from 'react'; +import React, { useContext } from 'react'; import { Alert, AlertActionLink, @@ -23,9 +23,9 @@ import { global_BackgroundColor_100 } from '@patternfly/react-tokens'; const CacheConfiguration = (props: { cacheName: string; editable: boolean; config: string }) => { const { t } = useTranslation(); - const {theme} = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); const encodingDocs = t('brandname.encoding-docs-link'); - const {syntaxHighLighterTheme} = useContext(ThemeContext) + const { syntaxHighLighterTheme } = useContext(ThemeContext); const yamlConfig = useFetchConfigurationYAML(props.cacheName); const xmlConfig = useFetchConfigurationXML(props.cacheName); @@ -70,7 +70,12 @@ const CacheConfiguration = (props: { cacheName: string; editable: boolean; confi {config} - + {config} @@ -80,7 +85,7 @@ const CacheConfiguration = (props: { cacheName: string; editable: boolean; confi return ( - + JSON} tabContentId="tab1" tabContentRef={contentRef1} /> XML} tabContentId="tab2" tabContentRef={contentRef2} /> YAML} tabContentId="tab3" tabContentRef={contentRef3} /> diff --git a/src/app/Caches/Configuration/DetailConfigurations.tsx b/src/app/Caches/Configuration/DetailConfigurations.tsx index dab8bc26..1649dddc 100644 --- a/src/app/Caches/Configuration/DetailConfigurations.tsx +++ b/src/app/Caches/Configuration/DetailConfigurations.tsx @@ -49,7 +49,7 @@ const DetailConfigurations: React.FunctionComponent = (props) => { perPage: 10 }); - const {syntaxHighLighterTheme} = useContext(ThemeContext) + const { syntaxHighLighterTheme } = useContext(ThemeContext); useEffect(() => { setFilteredTemplates(cacheTemplates); diff --git a/src/app/Caches/Create/CacheConfigEditor.tsx b/src/app/Caches/Create/CacheConfigEditor.tsx index fe869484..52e362c3 100644 --- a/src/app/Caches/Create/CacheConfigEditor.tsx +++ b/src/app/Caches/Create/CacheConfigEditor.tsx @@ -28,7 +28,7 @@ const CacheConfigEditor = (props: { cacheEditorModifier: (CacheEditorStep) => void; setReviewConfig: (string) => void; }) => { - const {theme} = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); const sampleConfig = '{\n' + ' "distributed-cache": {\n' + diff --git a/src/app/Caches/Create/Features/PersistentCacheConfigurator.tsx b/src/app/Caches/Create/Features/PersistentCacheConfigurator.tsx index c3813f47..a22b169a 100644 --- a/src/app/Caches/Create/Features/PersistentCacheConfigurator.tsx +++ b/src/app/Caches/Create/Features/PersistentCacheConfigurator.tsx @@ -28,7 +28,7 @@ import { global_spacer_md } from '@patternfly/react-tokens'; import { ThemeContext } from '@app/providers/ThemeProvider'; const PersistentCacheConfigurator = () => { - const {theme} = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); const { configuration, setConfiguration } = useCreateCache(); const { t } = useTranslation(); const brandname = t('brandname.brandname'); diff --git a/src/app/Caches/Create/ReviewCacheConfig.tsx b/src/app/Caches/Create/ReviewCacheConfig.tsx index 6b7c32d2..02edfac9 100644 --- a/src/app/Caches/Create/ReviewCacheConfig.tsx +++ b/src/app/Caches/Create/ReviewCacheConfig.tsx @@ -10,7 +10,7 @@ const ReviewCacheConfig = (props: { setReviewConfig: (string) => void }) => { const { configuration } = useCreateCache(); const { t } = useTranslation(); const [config, setConfig] = useState(CacheConfigUtils.createCacheConfigFromData(configuration)); - const {theme} = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); useEffect(() => { const jsonFormatConfig = CacheConfigUtils.createCacheConfigFromData(configuration); diff --git a/src/app/Caches/DetailCache.tsx b/src/app/Caches/DetailCache.tsx index 6ba8cf31..7b41abb1 100644 --- a/src/app/Caches/DetailCache.tsx +++ b/src/app/Caches/DetailCache.tsx @@ -7,7 +7,8 @@ import { Button, ButtonVariant, Card, - CardBody, Divider, + CardBody, + Divider, EmptyState, EmptyStateActions, EmptyStateBody, @@ -62,7 +63,7 @@ import { ThemeContext } from '@app/providers/ThemeProvider'; const DetailCache = (props: { cacheName: string }) => { const cacheName = props.cacheName; const { t } = useTranslation(); - const {theme} = useContext(ThemeContext); + const { theme } = useContext(ThemeContext); const brandname = t('brandname.brandname'); const encodingDocs = t('brandname.encoding-docs-link'); const { connectedUser } = useConnectedUser(); @@ -146,7 +147,7 @@ const DetailCache = (props: { cacheName: string }) => { activeKey={activeTabKey2} aria-label="Entries tab" component={TabsComponent.nav} - style={theme === 'dark'? {} : { backgroundColor: global_BackgroundColor_100.value }} + style={theme === 'dark' ? {} : { backgroundColor: global_BackgroundColor_100.value }} onSelect={(event, tabIndex) => setActiveTabKey2(tabIndex)} > { return; } return ( - - - - - - + + + + + + ); }; @@ -275,8 +274,8 @@ const DetailCache = (props: { cacheName: string }) => { return ( - - + + ); }; @@ -284,19 +283,19 @@ const DetailCache = (props: { cacheName: string }) => { const buildIndexManage = () => { if (!cache?.features.indexed) return; return ( - - - - - - + + + + + + ); }; @@ -322,15 +321,15 @@ const DetailCache = (props: { cacheName: string }) => { const buildFeaturesChip = () => { if (!cache?.features) return; return ( - - - {displayUtils.createFeaturesChipGroup(cache.features).map((feature) => ( - - ))} - - + + + {displayUtils.createFeaturesChipGroup(cache.features).map((feature) => ( + + ))} + + ); }; @@ -342,9 +341,7 @@ const DetailCache = (props: { cacheName: string }) => { {buildDisplayReindexing()} - - {buildFeaturesChip()} - + {buildFeaturesChip()} {buildBackupsManage()} {buildIndexManage()} diff --git a/src/app/Caches/Entries/CacheEntries.tsx b/src/app/Caches/Entries/CacheEntries.tsx index 98b71e0b..7d756e76 100644 --- a/src/app/Caches/Entries/CacheEntries.tsx +++ b/src/app/Caches/Entries/CacheEntries.tsx @@ -64,7 +64,7 @@ const CacheEntries = (props: { cacheName: string }) => { perPage: 10 }); - const {syntaxHighLighterTheme} = useContext(ThemeContext) + const { syntaxHighLighterTheme } = useContext(ThemeContext); useEffect(() => { if (cache.encoding.key == EncodingType.Protobuf) { diff --git a/src/app/Caches/Query/QueryEntries.tsx b/src/app/Caches/Query/QueryEntries.tsx index 4609d55e..6b679742 100644 --- a/src/app/Caches/Query/QueryEntries.tsx +++ b/src/app/Caches/Query/QueryEntries.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect,useContext } from 'react'; +import React, { useState, useEffect, useContext } from 'react'; import { Bullseye, Button, @@ -41,8 +41,7 @@ const QueryEntries = (props: { cacheName: string; indexed: boolean; changeTab: ( total: 0 }); - const {syntaxHighLighterTheme} = useContext(ThemeContext) - + const { syntaxHighLighterTheme } = useContext(ThemeContext); const columnNames = { value: 'Value' @@ -171,11 +170,17 @@ const QueryEntries = (props: { cacheName: string; indexed: boolean; changeTab: ( } - onClick={() => window.open(t('brandname.ickle-query-docs-link'), '_blank')}>{t('caches.query.ickle-query-docs')}} + footerContent={ + + } >