Skip to content

Commit 6c81d96

Browse files
feat: use identifiable token in data item search + ui upgrade (DHIS2-6568) (DHIS2-20698) (#3454)
* feat: use identifiable token in data item search + ui upgrade
1 parent 59995e4 commit 6c81d96

4 files changed

Lines changed: 468 additions & 435 deletions

File tree

cypress/integration/dimensions/data.cy.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,39 @@ describe('Data dimension', () => {
223223
expectSourceToNotBeLoading()
224224
expectSelectableDataItemsAmountToBeLeast(PAGE_SIZE)
225225
})
226+
it('can search by uid in global search', () => {
227+
goToStartPage()
228+
openDimension(DIMENSION_ID_DATA)
229+
expectDataDimensionModalToBeVisible()
230+
expectSelectableDataItemsAmountToBeLeast(PAGE_SIZE)
231+
232+
const testUid = 'Uvn6LCg7dVU'
233+
const expectedItemName = 'ANC 1 Coverage'
234+
235+
// searching for a uid returns the matching item
236+
cy.intercept('GET', DATA_ITEMS_URL).as('uidSearchRequest')
237+
inputSearchTerm(testUid)
238+
cy.wait('@uidSearchRequest').then(({ request, response }) => {
239+
expect(request.url).to.contain('page=1')
240+
expect(request.url).to.contain(testUid)
241+
expect(response.statusCode).to.eq(200)
242+
expect(response.body.dataItems.length).to.eq(1)
243+
})
244+
expectSourceToNotBeLoading()
245+
expectSelectableDataItemsAmountToBe(1)
246+
expectItemToBeSelectable(expectedItemName)
247+
248+
// clear the search
249+
cy.intercept('GET', DATA_ITEMS_URL).as('uidSearchClear')
250+
clearSearchTerm()
251+
cy.wait('@uidSearchClear').then(({ request, response }) => {
252+
expect(request.url).to.contain('page=1')
253+
expect(response.statusCode).to.eq(200)
254+
expect(response.body.dataItems.length).to.be.eq(PAGE_SIZE)
255+
})
256+
expectSourceToNotBeLoading()
257+
expectSelectableDataItemsAmountToBeLeast(PAGE_SIZE)
258+
})
226259
// VERSION-TOGGLE: remove when 42 is lowest supported version
227260
it(['>=42'], 'can toggle option view mode', () => {
228261
goToStartPage()

docs/data-visualizer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ To select items for a dimension, open the dimension modal window by clicking on
8787

8888
#### Select data items
8989

90-
When selecting data items, there are different ways to filter the displayed items. By using the search field at the top, a global search by item name is performed across the currently selected **Data Type**. By selecting a **Data Type** from the dropdown, items can be filtered by type and subtype, where the subtype available depends on the selected data type. The name search and the type/subtype filtering can be combined as well for a more detailed filter. The type of each displayed item is indicated on the right and a corresponding icon is shown on the left of the item.
90+
When selecting data items, there are different ways to filter the displayed items. By using the search field at the top, a global search by item name, id or code is performed across the currently selected **Data Type**. By selecting a **Data Type** from the dropdown, items can be filtered by type and subtype, where the subtype available depends on the selected data type. The name search and the type/subtype filtering can be combined as well for a more detailed filter. The type of each displayed item is indicated on the right and a corresponding icon is shown on the left of the item.
9191

9292
![](resources/images/data-visualizer-cc-data-modal.png)
9393

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
"typescript-eslint": "^8.35.0"
4949
},
5050
"dependencies": {
51-
"@dhis2/analytics": "29.0.3",
51+
"@dhis2/analytics": "^29.1.0",
5252
"@dhis2/app-runtime": "^3.14.1",
5353
"@dhis2/app-service-datastore": "^1.0.0-beta.3",
5454
"@dhis2/d2-i18n": "^1.1.0",
55-
"@dhis2/ui": "^10.7.7",
55+
"@dhis2/ui": "^10.12.7",
5656
"decode-uri-component": "^0.2.2",
5757
"history": "^5.3.0",
5858
"lodash-es": "^4.17.21",

0 commit comments

Comments
 (0)