Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct component imports, open apps in same window #1652

Open
wants to merge 2 commits into
base: feature-command-palette
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Layer } from '@dhis2-ui/layer'
import { Modal } from '@dhis2-ui/modal'
import { Popper } from '@dhis2-ui/popper'
import { render, fireEvent, waitFor } from '@testing-library/react'
import { mount } from 'enzyme'
import React from 'react'
import { act } from 'react-dom/test-utils'
import { Modal } from '../../../../modal/src/modal/modal.js'
import { Button } from '../../index.js'
import { DropdownButton } from '../dropdown-button.js'

Expand Down
40 changes: 35 additions & 5 deletions components/header-bar/i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,45 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-06-12T03:40:49.012Z\n"
"PO-Revision-Date: 2024-06-12T03:40:49.013Z\n"
"POT-Creation-Date: 2024-12-17T01:42:03.299Z\n"
"PO-Revision-Date: 2024-12-17T01:42:03.300Z\n"

msgid "Search apps"
msgstr "Search apps"

msgid "Search commands"
msgstr "Search commands"

msgid "Search shortcuts"
msgstr "Search shortcuts"

msgid "Search apps, shortcuts, commands"
msgstr "Search apps, shortcuts, commands"

msgid "Browse apps"
msgstr "Browse apps"

msgid "Browse commands"
msgstr "Browse commands"

msgid "Browse shortcuts"
msgstr "Browse shortcuts"

msgid "Logout"
msgstr "Logout"

msgid "Top apps"
msgstr "Top apps"

msgid "All Apps"
msgstr "All Apps"

msgid "All Commands"
msgstr "All Commands"

msgid "All Shortcuts"
msgstr "All Shortcuts"

msgid "DHIS2 {{dhis2Version}}"
msgstr "DHIS2 {{dhis2Version}}"

Expand Down Expand Up @@ -62,9 +95,6 @@ msgstr "Help"
msgid "About DHIS2"
msgstr "About DHIS2"

msgid "Logout"
msgstr "Logout"

msgid "New {{appName}} version available"
msgstr "New {{appName}} version available"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
setHighlightedIndex(0)
}
},
[

Check warning on line 188 in components/header-bar/src/command-palette/hooks/use-navigation.js

View workflow job for this annotation

GitHub Actions / lint

React Hook useCallback has a missing dependency: 'showGrid'. Either include it or remove the dependency array
activeSection,
actionsLength,
defaultSection,
Expand Down Expand Up @@ -231,12 +231,13 @@
?.childNodes?.[highlightedIndex]?.click()
} else {
// open apps, shortcuts link
window.open(itemsArray[highlightedIndex]?.['defaultAction'])
window.location.href =
itemsArray[highlightedIndex]?.['defaultAction']
// TODO: execute commands
}
}
},
[

Check warning on line 240 in components/header-bar/src/command-palette/hooks/use-navigation.js

View workflow job for this annotation

GitHub Actions / lint

React Hook useCallback has unnecessary dependencies: 'show' and 'showGrid'. Either exclude them or remove the dependency array
activeSection,
currentView,
filter.length,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function AppItem({ name, path, img, highlighted, handleMouseEnter }) {
return (
<a
href={path}
target="_self"
className={cx('item', { highlighted })}
onMouseEnter={handleMouseEnter}
tabIndex={-1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function ListItem({
return (
<a
href={path ? path : undefined}
target="_self"
onClick={onClickHandler}
className={cx('item', { highlighted })}
data-test={dataTest}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { colors, spacers, theme } from '@dhis2/ui-constants'
import { IconSearch16 } from '@dhis2/ui-icons'
import { InputField } from '@dhis2-ui/input'
import PropTypes from 'prop-types'
import React from 'react'
import { InputField } from '../../../../input/src/input-field/input-field.js'

function Search({ value, onChange, placeholder }) {
return (
Expand Down
Loading