Skip to content

Commit

Permalink
fix: context menu icon on app items, remove unused tabIndex, update a…
Browse files Browse the repository at this point in the history
…pp min versions
  • Loading branch information
jenniferarnesen committed Jan 27, 2025
1 parent a2117bd commit 7aa6f52
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ import { sGetSelectedId } from '../../../reducers/selected.js'
import { IconOfflineSaved } from '../../IconOfflineSaved.js'
import styles from './styles/NavigationMenuItem.module.css'

export const NavigationMenuItem = ({
close,
displayName,
id,
starred,
tabIndex,
}) => {
export const NavigationMenuItem = ({ close, displayName, id, starred }) => {
const history = useHistory()
const { lastUpdated } = useCacheableSection(id)
const { isConnected } = useDhis2ConnectionStatus()
Expand All @@ -40,7 +34,6 @@ export const NavigationMenuItem = ({
return (
<MenuItem
dense
tabIndex={tabIndex}
onClick={handleClick}
key={id}
label={
Expand All @@ -66,5 +59,4 @@ NavigationMenuItem.propTypes = {
displayName: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
starred: PropTypes.bool,
tabIndex: PropTypes.number,
}
7 changes: 2 additions & 5 deletions src/components/Item/AppItem/ItemContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Popover,
IconFullscreen16,
IconLaunch16,
IconMore24,
IconMore16,
} from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useRef, useState } from 'react'
Expand All @@ -20,7 +20,6 @@ export const ItemContextMenu = ({
appUrl,
enterFullscreen,
loadItemFailed,
tabIndex,
}) => {
const buttonRef = useRef()
const [menuIsOpen, setMenuIsOpen] = useState(false)
Expand Down Expand Up @@ -54,8 +53,7 @@ export const ItemContextMenu = ({
title={i18n.t('Open menu')}
onClick={openMenu}
dataTest="appitem-menu-button"
icon={<IconMore24 color={colors.grey700} />}
tabIndex={tabIndex}
icon={<IconMore16 color={colors.grey700} />}
/>
</div>
{menuIsOpen && (
Expand Down Expand Up @@ -97,5 +95,4 @@ ItemContextMenu.propTypes = {
appUrl: PropTypes.string,
enterFullscreen: PropTypes.func,
loadItemFailed: PropTypes.bool,
tabIndex: PropTypes.string,
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Plugin } from '@dhis2/app-runtime/experimental'
import { CenteredContent, CircularLoader } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { useDispatch, useSelector, shallowEqual } from 'react-redux'
import { useDispatch, useSelector } from 'react-redux'
import { acAddIframePluginStatus } from '../../../../actions/iframePluginStatus.js'
import {
CHART,
Expand Down Expand Up @@ -37,7 +37,7 @@ const IframePlugin = ({
isFirstOfType,
}) => {
const dispatch = useDispatch()
const iframePluginStatus = useSelector(sGetIframePluginStatus, shallowEqual)
const iframePluginStatus = useSelector(sGetIframePluginStatus)
const { baseUrl } = useConfig()
const { userSettings } = useUserSettings()
const [error, setError] = useState(null)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/__tests__/isAppVersionCompatible.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isLLVersionCompatible } from '../isAppVersionCompatible.js'

const testcases = [
['101.1.9', true],
['101.1.14', true],
['100.5.9', false],
['101.2.0', true],
['100.0.9', false],
Expand Down
6 changes: 3 additions & 3 deletions src/modules/isAppVersionCompatible.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// TODO handle plugin version matrix in a better way
export const minDVVersion = [100, 8, 1]
export const minLLVersion = [101, 1, 9]
export const minMapsVersion = [100, 7, 1]
export const minDVVersion = [100, 9, 1]
export const minLLVersion = [101, 1, 14]
export const minMapsVersion = [100, 7, 11]

const isAppVersionCompatible = (version, minVersion) => {
const [major, minor, patch] = version
Expand Down

0 comments on commit 7aa6f52

Please sign in to comment.