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

feat: support new dashboard plugin architecture #396

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9013df3
refactor: use callback prop for installation status messaging
edoardo Jun 21, 2023
879f061
chore: update deps to latest alpha, remove postRobot
edoardo Oct 9, 2023
1c032e5
refactor: handle recording on first load and plugin cache clear
edoardo Oct 9, 2023
03b3cb0
chore: update app-runtime cli-app-scripts to latest
edoardo May 24, 2024
e329628
refactor: simplify the communication for offline caching
edoardo May 27, 2024
7b04638
refactor: move caching logic in shared component
edoardo May 29, 2024
3d687d2
fix: fix typo
edoardo May 30, 2024
62f7ae1
chore: rename shared component
edoardo Jun 3, 2024
8610a75
refactor: use shared dashboard plugin wrapper
edoardo Jun 3, 2024
faf7e31
chore: bump cli-app-scripts and app-runtime deps
edoardo Jul 1, 2024
b8f9097
chore: use analytics build from d2-ci for testing
edoardo Jul 3, 2024
67aef2a
test: ignore more ResizeObserver errors
edoardo Jul 4, 2024
37039b4
chore: remove unused component
edoardo Jul 4, 2024
7397f9e
fix: avoid ResizeObserver loop error
edoardo Jul 11, 2024
e60ca36
chore: remove debug logs
edoardo Jul 11, 2024
929e81c
chore: bump analytics with period selector fix
edoardo Jul 12, 2024
334f02d
chore: update cli-app-scripts, remove resolution for i18next-scanner
edoardo Jul 29, 2024
1138893
chore: bump app-runtime to avoid duplicate version
edoardo Jul 30, 2024
ae9fcf7
test: fix tests for 2.39
edoardo Jul 31, 2024
8cfe5c5
test: move cy.log inside tests
edoardo Jul 31, 2024
e755bcc
test: update skipRounding test
edoardo Jul 31, 2024
f7f0ed2
test: skip failing test on 40
edoardo Jul 31, 2024
008d22d
test: refactor tests for time dimensions, skip on 41
edoardo Jul 31, 2024
2d2583d
test: skip tests for 39 and 41
edoardo Jul 31, 2024
5569aa4
test: fix tag filtering
edoardo Aug 1, 2024
68614a5
chore: bump start-server-and-test
edoardo Aug 1, 2024
28dfcc6
chore: update analytics
edoardo Aug 5, 2024
8633759
fix: indicate the plugin is for dashboard
edoardo Aug 13, 2024
f7395e7
fix: use correct case for pluginType value
edoardo Aug 15, 2024
5cac399
chore: update yarn.lock
edoardo Aug 15, 2024
ed3c3fe
Merge remote-tracking branch 'origin/master' into refactor/use-platfo…
edoardo Aug 15, 2024
1066caf
chore: update cli-style and cypress deps to work with Cypress 13
edoardo Aug 15, 2024
d83e2ce
chore: run prettier
edoardo Aug 16, 2024
a60fe53
test: revert changes after backports
edoardo Aug 16, 2024
573093e
chore: remove resolution for @dhis2/ui
edoardo Aug 19, 2024
e969ff6
Merge remote-tracking branch 'origin/master' into refactor/use-platfo…
edoardo Oct 10, 2024
40757b4
Merge remote-tracking branch 'origin/master' into refactor/use-platfo…
edoardo Oct 30, 2024
bd9b7cb
chore: use latest analytics build for testing
edoardo Oct 30, 2024
0fd5a80
Merge branch 'master' into refactor/use-platform-plugin-components
edoardo Nov 4, 2024
12aeaf0
test: fix decimals in test
edoardo Nov 4, 2024
8d60178
chore: use latest test build of analytics
edoardo Nov 11, 2024
271f453
test: move tooltip open in tooltip assertion helper function
edoardo Nov 12, 2024
efc9139
fix: ensure the Tooltip is closed immediately
edoardo Nov 12, 2024
699a59d
test: fix tooltip tests for period chip
edoardo Nov 12, 2024
01a2841
fix: format date ranges in tooltip component
edoardo Nov 15, 2024
1b50879
chore: use latest analytics build for testing
edoardo Nov 15, 2024
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
14 changes: 10 additions & 4 deletions cypress/helpers/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,18 @@ export const expectAxisToNotHaveDimension = (axisId, dimensionId) => {
}
}

export const assertTooltipContainsEntries = (entries) =>
export const assertTooltipContainsEntries = (primary, entries) => {
cy.getBySelLike('layout-chip')
.containsExact(primary, EXTENDED_TIMEOUT)
.trigger('mouseover')

entries.forEach((entry) => cy.getBySel('tooltip-content').contains(entry))

// close the tooltip to avoid it covering other elements in subsequent tests
cy.get('body').type('{esc}')
cy.getBySel('tooltip-content').should('not.exist')
}

export const assertChipContainsText = (primary, items, secondary) => {
if (items) {
cy.getBySelLike('layout-chip')
Expand All @@ -49,7 +58,4 @@ export const assertChipContainsText = (primary, items, secondary) => {
EXTENDED_TIMEOUT
)
}
cy.getBySelLike('layout-chip')
.containsExact(primary, EXTENDED_TIMEOUT)
.trigger('mouseover')
}
56 changes: 40 additions & 16 deletions cypress/integration/conditions/alphanumericConditions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ describe('text conditions (event)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Exactly: ${TEST_TEXT}`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Exactly: ${TEST_TEXT}`,
])
})

it('is not', () => {
Expand All @@ -149,7 +152,10 @@ describe('text conditions (event)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Is not: ${TEST_TEXT}`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Is not: ${TEST_TEXT}`,
])
})

it('contains', () => {
Expand All @@ -169,7 +175,10 @@ describe('text conditions (event)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Contains: ${TEST_TEXT}`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Contains: ${TEST_TEXT}`,
])
})

it('contains (case-sensitive)', () => {
Expand All @@ -190,7 +199,10 @@ describe('text conditions (event)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Contains: ${TEST_TEXT}`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Contains: ${TEST_TEXT}`,
])
})

it('does not contain', () => {
Expand All @@ -214,7 +226,7 @@ describe('text conditions (event)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([
assertTooltipContainsEntries(dimensionName, [
stageName,
`Does not contain: ${TEST_TEXT}`,
])
Expand All @@ -234,7 +246,10 @@ describe('text conditions (event)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Is empty / null`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Is empty / null`,
])
})

it('is not empty / not null', () => {
Expand All @@ -257,7 +272,10 @@ describe('text conditions (event)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Is not empty / not null`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Is not empty / not null`,
])
})

it('2 conditions: contains + is not', () => {
Expand All @@ -273,7 +291,11 @@ describe('text conditions (event)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 2)

assertTooltipContainsEntries([stageName, 'Contains: ', 'Is not: '])
assertTooltipContainsEntries(dimensionName, [
stageName,
'Contains: ',
'Is not: ',
])
})
})
describe(['>=41'], 'text conditions (TE)', { testIsolation: false }, () => {
Expand Down Expand Up @@ -317,7 +339,7 @@ describe(['>=41'], 'text conditions (TE)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([`Exactly: ${TEST_TEXT}`])
assertTooltipContainsEntries(dimensionName, [`Exactly: ${TEST_TEXT}`])
})

it('is not', () => {
Expand All @@ -337,7 +359,7 @@ describe(['>=41'], 'text conditions (TE)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([`Is not: ${TEST_TEXT}`])
assertTooltipContainsEntries(dimensionName, [`Is not: ${TEST_TEXT}`])
})

it('contains', () => {
Expand All @@ -357,7 +379,7 @@ describe(['>=41'], 'text conditions (TE)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([`Contains: ${TEST_TEXT}`])
assertTooltipContainsEntries(dimensionName, [`Contains: ${TEST_TEXT}`])
})

it('contains (case-sensitive)', () => {
Expand All @@ -378,7 +400,7 @@ describe(['>=41'], 'text conditions (TE)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([`Contains: ${TEST_TEXT}`])
assertTooltipContainsEntries(dimensionName, [`Contains: ${TEST_TEXT}`])
})

it('does not contain', () => {
Expand All @@ -402,7 +424,9 @@ describe(['>=41'], 'text conditions (TE)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([`Does not contain: ${TEST_TEXT}`])
assertTooltipContainsEntries(dimensionName, [
`Does not contain: ${TEST_TEXT}`,
])
})

it('is empty / null', () => {
Expand All @@ -419,7 +443,7 @@ describe(['>=41'], 'text conditions (TE)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([`Is empty / null`])
assertTooltipContainsEntries(dimensionName, [`Is empty / null`])
})

it('is not empty / not null', () => {
Expand All @@ -436,7 +460,7 @@ describe(['>=41'], 'text conditions (TE)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([`Is not empty / not null`])
assertTooltipContainsEntries(dimensionName, [`Is not empty / not null`])
})

it('2 conditions: contains + is not', () => {
Expand All @@ -452,7 +476,7 @@ describe(['>=41'], 'text conditions (TE)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 2)

assertTooltipContainsEntries(['Contains: ', 'Is not: '])
assertTooltipContainsEntries(dimensionName, ['Contains: ', 'Is not: '])
})
})
/* This test doesn't look like it needs `testIsolation: false`
Expand Down
25 changes: 18 additions & 7 deletions cypress/integration/conditions/booleanConditions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('boolean conditions - Yes/NA', () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, /\bYes\b/])
assertTooltipContainsEntries(dimensionName, [stageName, /\bYes\b/])
})

it('Not answered selected', () => {
Expand All @@ -85,7 +85,10 @@ describe('boolean conditions - Yes/NA', () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, /\bNot answered\b/])
assertTooltipContainsEntries(dimensionName, [
stageName,
/\bNot answered\b/,
])
})

it('Yes + Not answered selected', () => {
Expand All @@ -103,7 +106,11 @@ describe('boolean conditions - Yes/NA', () => {

assertChipContainsText(dimensionName, 'all')

assertTooltipContainsEntries([stageName, /\bYes\b/, /\bNot answered\b/])
assertTooltipContainsEntries(dimensionName, [
stageName,
/\bYes\b/,
/\bNot answered\b/,
])
})
})

Expand All @@ -122,7 +129,7 @@ describe('boolean conditions - Yes/No/NA', () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, /\bYes\b/])
assertTooltipContainsEntries(dimensionName, [stageName, /\bYes\b/])
})

it('No selected', () => {
Expand All @@ -132,7 +139,7 @@ describe('boolean conditions - Yes/No/NA', () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, /\bNo\b/])
assertTooltipContainsEntries(dimensionName, [stageName, /\bNo\b/])
})

it('Yes + Not answered selected', () => {
Expand All @@ -149,7 +156,11 @@ describe('boolean conditions - Yes/No/NA', () => {

assertChipContainsText(dimensionName, 2)

assertTooltipContainsEntries([stageName, /\bYes\b/, /\bNot answered\b/])
assertTooltipContainsEntries(dimensionName, [
stageName,
/\bYes\b/,
/\bNot answered\b/,
])
})

it('Yes + No + Not answered selected', () => {
Expand All @@ -167,7 +178,7 @@ describe('boolean conditions - Yes/No/NA', () => {

assertChipContainsText(dimensionName, 'all')

assertTooltipContainsEntries([
assertTooltipContainsEntries(dimensionName, [
stageName,
/\bYes\b/,
/\bNo\b/,
Expand Down
36 changes: 27 additions & 9 deletions cypress/integration/conditions/dateConditions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ describe('date conditions (Date)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Exactly: ${TEST_DATE}`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Exactly: ${TEST_DATE}`,
])
})

it('is not', () => {
Expand All @@ -113,7 +116,10 @@ describe('date conditions (Date)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Is not: ${TEST_DATE}`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Is not: ${TEST_DATE}`,
])
})

it('after', () => {
Expand All @@ -133,7 +139,10 @@ describe('date conditions (Date)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `After: ${TEST_DATE}`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`After: ${TEST_DATE}`,
])
})

it('after or including', () => {
Expand All @@ -154,7 +163,7 @@ describe('date conditions (Date)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([
assertTooltipContainsEntries(dimensionName, [
stageName,
`After or including: ${TEST_DATE}`,
])
Expand All @@ -178,7 +187,10 @@ describe('date conditions (Date)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Before: ${TEST_DATE}`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Before: ${TEST_DATE}`,
])
})

it('before or including', () => {
Expand All @@ -198,7 +210,7 @@ describe('date conditions (Date)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([
assertTooltipContainsEntries(dimensionName, [
stageName,
`Before or including: ${TEST_DATE}`,
])
Expand Down Expand Up @@ -226,7 +238,10 @@ describe('date conditions (Date)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Is empty / null`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Is empty / null`,
])
})

it('is not empty / not null', () => {
Expand Down Expand Up @@ -258,7 +273,10 @@ describe('date conditions (Date)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 1)

assertTooltipContainsEntries([stageName, `Is not empty / not null`])
assertTooltipContainsEntries(dimensionName, [
stageName,
`Is not empty / not null`,
])
})

it('2 conditions: after + before or including', () => {
Expand All @@ -283,7 +301,7 @@ describe('date conditions (Date)', { testIsolation: false }, () => {

assertChipContainsText(dimensionName, 2)

assertTooltipContainsEntries([
assertTooltipContainsEntries(dimensionName, [
stageName,
`After: ${TEST_DATE_AFT}`,
`Before or including: ${TEST_DATE_BFI}`,
Expand Down
Loading
Loading