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: offline dashboard #1700

Merged
merged 160 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from 159 commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
9dcf70b
chore: create useOnlineStatus mock for development
jenniferarnesen Apr 12, 2021
1c9aa71
chore: mock the cachesection status hook
jenniferarnesen Apr 12, 2021
bb613a4
chore: add mock CacheableSection component
jenniferarnesen Apr 12, 2021
96b3396
fix: use default export
jenniferarnesen Apr 12, 2021
831cbca
chore: add isRecording to redux for mocking purposes
jenniferarnesen Apr 13, 2021
ab5df1e
feat: use forceLoad flag to force loading of all visualizations
jenniferarnesen Apr 14, 2021
086a1af
fix: cleanup
jenniferarnesen Apr 16, 2021
6f7aeb4
fix: make sure dashboard is loaded before rendering the edit components
jenniferarnesen Apr 16, 2021
bbebc91
chore: propagate isRecording to plugins that can then unmount the vis
jenniferarnesen Apr 19, 2021
13d4ede
chore: group titlebar code together
jenniferarnesen Apr 19, 2021
7fc499f
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Apr 20, 2021
dc84ea9
fix: upgrade to latest d2
jenniferarnesen Apr 20, 2021
1eec929
fix: upgrade to latest d2
jenniferarnesen Apr 20, 2021
4d511cc
fix: force static assets to reload when recording
jenniferarnesen Apr 20, 2021
b907d63
Merge branch 'feat/offline-dashboard' of github.com:dhis2/dashboard-a…
jenniferarnesen Apr 20, 2021
ff49be0
fix: remove extraneous
jenniferarnesen Apr 20, 2021
72c392d
fix: if invalid id is provided to edit/print then redirect to view
jenniferarnesen Apr 21, 2021
f83d44c
chore: disable actions in titlebar if offline
jenniferarnesen Apr 21, 2021
e9a990d
chore: star button tooltip based on starred and isOnline
jenniferarnesen Apr 21, 2021
e3dfaab
chore: disable item menu options when offline
jenniferarnesen Apr 22, 2021
c135a34
fix: remove console
jenniferarnesen Apr 22, 2021
0f44d67
fix: simplify New button
jenniferarnesen Apr 22, 2021
0bd8863
fix: improve alignment of button and search field with chips
jenniferarnesen Apr 22, 2021
d869319
fix: snapshot updates
jenniferarnesen Apr 22, 2021
444dc65
Merge branch 'fix/new-button-wo-text' into feat/offline-dashboard
jenniferarnesen Apr 23, 2021
8e3e002
chore: disable New button when offline
jenniferarnesen Apr 23, 2021
3389362
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Apr 23, 2021
efe6f69
chore: disable New button when offline
jenniferarnesen Apr 23, 2021
38f20ba
Merge branch 'feat/offline-dashboard' of github.com:dhis2/dashboard-a…
jenniferarnesen Apr 23, 2021
d92397f
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Apr 26, 2021
a3c4154
fix: add tooltip to disabled buttons
jenniferarnesen Apr 26, 2021
7251b05
fix: position Tag and add hover
jenniferarnesen Apr 26, 2021
3cb1b11
fix: dashboard chip offline indicator
jenniferarnesen Apr 27, 2021
738ac12
fix: href needed in edit mode
jenniferarnesen Apr 27, 2021
6e15767
fix: progress indicator on chip
jenniferarnesen Apr 27, 2021
31f4462
fix: rename component
jenniferarnesen Apr 28, 2021
8746c06
fix: remove warning about className type
jenniferarnesen Apr 28, 2021
8bb94e9
fix: move temporary isOnline button to dashboard bar
jenniferarnesen Apr 28, 2021
11e1bdb
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Apr 28, 2021
9182c4b
fix: add notice if opening a non-cached dashboard while offline
jenniferarnesen Apr 28, 2021
d32f5cf
fix: move showDescription to own redux prop at root
jenniferarnesen Apr 28, 2021
8f36d49
fix: move showDescription to own redux prop at root
jenniferarnesen Apr 28, 2021
f13df3c
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Apr 28, 2021
a00de88
Merge branch 'feat/offline-dashboard' of github.com:dhis2/dashboard-a…
jenniferarnesen Apr 28, 2021
31596c9
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Apr 28, 2021
6baa028
fix: a complete mess at the moment
jenniferarnesen Apr 29, 2021
712f078
fix: finish converting selected redux prop to hold complete active da…
jenniferarnesen Apr 29, 2021
57fe588
fix: unit tests
jenniferarnesen Apr 29, 2021
5e1cf7c
fix: more test fixes
jenniferarnesen Apr 30, 2021
6c25034
fix: go between dashboards when offline
jenniferarnesen Apr 30, 2021
0a53464
fix: switching dashboards when offline
jenniferarnesen May 6, 2021
1fd1a8c
fix: tooltip for disabled buttons
jenniferarnesen May 6, 2021
6974818
fix: tooltip on disabled Menu items
jenniferarnesen May 6, 2021
85d745e
fix: snapshots
jenniferarnesen May 7, 2021
092d361
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen May 14, 2021
1e30a94
fix: tests
jenniferarnesen May 14, 2021
ca1e3f4
fix: correct logic for Viewing and switching dashboards
jenniferarnesen May 18, 2021
a077ed4
chore: disable filter button when offline
jenniferarnesen May 18, 2021
a67573d
chore: edit view isOnline changes
jenniferarnesen May 18, 2021
095e21f
chore: disable buttons in edit mode
jenniferarnesen May 19, 2021
c7e6257
chore: disable the interpretations component when offline
jenniferarnesen May 19, 2021
b23538a
chore: pass isOffline to interpretations and sharing
jenniferarnesen May 20, 2021
52a2543
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen May 20, 2021
02c7700
fix: isOfflineStatus instead of isOnlineStatus
jenniferarnesen May 21, 2021
e8ae7b0
chore: cypress tests
jenniferarnesen May 21, 2021
fdb9259
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen May 27, 2021
d2616d7
fix: cypress tests for offline
jenniferarnesen Jun 1, 2021
86b3081
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Jun 2, 2021
3e409b2
chore: restore cypress tests
jenniferarnesen Jun 2, 2021
20ba1e6
fix: temporary redux for demo
jenniferarnesen Jun 3, 2021
f412a60
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Jun 28, 2021
55da94c
fix: remove offline mocking
jenniferarnesen Jun 29, 2021
1f36ce2
fix: use local packages for offline
jenniferarnesen Jun 29, 2021
cf7e428
fix: lint issues
jenniferarnesen Jul 9, 2021
435a128
fix: using the actual offline state
jenniferarnesen Jul 9, 2021
1a4f207
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Jul 9, 2021
7ac36e2
fix: tests
jenniferarnesen Jul 9, 2021
6344085
fix: provide arg for fn
jenniferarnesen Aug 9, 2021
057189e
fix: broken Tooltip
jenniferarnesen Aug 9, 2021
f7fe994
fix: all api requests now recorded
jenniferarnesen Aug 10, 2021
bd1fddd
fix: use released packages
jenniferarnesen Aug 11, 2021
9b0dbda
fix: force to alpha app-runtime
jenniferarnesen Aug 11, 2021
f74e854
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 11, 2021
8a31288
fix: remove packages inadvertently added
jenniferarnesen Aug 11, 2021
38bb8f2
fix: remove old stuff
jenniferarnesen Aug 11, 2021
6998f06
fix: remove unused prop
jenniferarnesen Aug 11, 2021
43e1aca
fix: remove unused stuff
jenniferarnesen Aug 11, 2021
c2b7a51
fix: tests
jenniferarnesen Aug 12, 2021
7f98ad1
fix: syntax change
jenniferarnesen Aug 12, 2021
1516e8e
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 12, 2021
eb18d99
fix: use offline and add jest test
jenniferarnesen Aug 12, 2021
bc3b485
fix: use offline instead of online
jenniferarnesen Aug 13, 2021
f9bc56d
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 13, 2021
b1c36ea
fix: dont store individual dashboard in app cache
jenniferarnesen Aug 16, 2021
1180707
fix: default fn just in case
jenniferarnesen Aug 16, 2021
97d8aeb
fix: do not need special loading for resources when recording
jenniferarnesen Aug 16, 2021
68a8785
fix: useCallback to prevent Content rendering more than necessary
jenniferarnesen Aug 17, 2021
0e12b1f
fix: use offline instead of online for readability
jenniferarnesen Aug 17, 2021
10bc9c3
fix: reset loaded state when id changes
jenniferarnesen Aug 17, 2021
c86ec0d
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 17, 2021
6193052
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 17, 2021
7b41a8a
fix: move forceLoad flag to ItemGrid
jenniferarnesen Aug 17, 2021
3cebcf5
fix: handle current problem with isCached being true
jenniferarnesen Aug 17, 2021
c0c8627
fix: yarn and i18n changes
jenniferarnesen Aug 17, 2021
5b15458
fix: first time going offline get correct isCached val
jenniferarnesen Aug 18, 2021
3a22b6e
fix: use hook in StarDashboardButton
jenniferarnesen Aug 18, 2021
eebde54
fix: allow plugin assets to be in the app cache
jenniferarnesen Aug 18, 2021
f7978ea
fix: force latest cli-app-scripts
jenniferarnesen Aug 18, 2021
fca5039
fix: use correct redirecturl from Print
jenniferarnesen Aug 18, 2021
7b5bdcf
fix: increase max width to allow more text to show
jenniferarnesen Aug 19, 2021
fd0702c
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 19, 2021
d0e39f4
fix: tooltip should only display when hovering over the button
jenniferarnesen Aug 19, 2021
f81acbd
fix: use more brief format in last updated tooltip
jenniferarnesen Aug 19, 2021
ca865d4
fix: upgrade cli-app-scripts
jenniferarnesen Aug 20, 2021
a214f39
fix: only post statistics if online
jenniferarnesen Aug 23, 2021
6929f48
fix: print cached dashboards
jenniferarnesen Aug 23, 2021
0ad74a8
fix: eliminate repeated fetches
jenniferarnesen Aug 23, 2021
c62c356
fix: show loading mask any time id changes
jenniferarnesen Aug 23, 2021
d31919d
fix: use a different var name
jenniferarnesen Aug 23, 2021
fb97f4c
fix: upgrade cli-app-scripts
jenniferarnesen Aug 24, 2021
66a7bea
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 24, 2021
d972a8e
fix: remove merge conflict markers
jenniferarnesen Aug 24, 2021
9f5f9b2
fix: disable Confirm button in Filtersettings if offline
jenniferarnesen Aug 24, 2021
3d4c4d0
fix: pass online status to TranslationDialog
jenniferarnesen Aug 24, 2021
4d92129
fix: updated jest tests
jenniferarnesen Aug 25, 2021
c0ba2c1
fix: cypress tests with real offline online simulation
jenniferarnesen Aug 25, 2021
5e660f5
fix: cypress tests fix
jenniferarnesen Aug 26, 2021
4d217f7
fix: remove unneeded file
jenniferarnesen Aug 26, 2021
82c25ef
fix: remove unused fn
jenniferarnesen Aug 26, 2021
11941a7
fix: clean up cypress test
jenniferarnesen Aug 26, 2021
11e0205
fix: new element hierarchy
jenniferarnesen Aug 26, 2021
d13b3e3
fix: clean up cypress tests
jenniferarnesen Aug 26, 2021
700d6cc
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 27, 2021
9a9fb29
fix: merge conflicts
jenniferarnesen Aug 27, 2021
bba937d
fix: stuff
jenniferarnesen Aug 27, 2021
6735a54
fix: incorrect i18n format
jenniferarnesen Aug 27, 2021
b2944e1
fix: move style to css module
jenniferarnesen Aug 27, 2021
5e76895
fix: cleanup
jenniferarnesen Aug 27, 2021
196debe
fix: remove unused file
jenniferarnesen Aug 27, 2021
5a35fee
fix: regenerated yarn.lock - yuck
jenniferarnesen Aug 27, 2021
2b1058d
fix: snapshots
jenniferarnesen Aug 27, 2021
69df6f5
fix: replace styledjsx
jenniferarnesen Aug 30, 2021
aa79c99
fix: consolidate tooltip code
jenniferarnesen Aug 30, 2021
a20ce1d
fix: remove unused component
jenniferarnesen Aug 30, 2021
8c8cf96
fix: changes due to switch away from styled jsx
jenniferarnesen Aug 30, 2021
e7675f4
fix: restore maxWidth property on LastUpdatedTag
jenniferarnesen Aug 30, 2021
008d234
fix: remove TitleBar/index.js
jenniferarnesen Aug 30, 2021
a908e84
fix: remove redundant position: relative
jenniferarnesen Aug 30, 2021
46778ef
fix: no need to do this if isRecording - it will happen automatically
jenniferarnesen Aug 30, 2021
d7a4c93
fix: remove unused prop
jenniferarnesen Aug 31, 2021
73cbbcf
fix: test fix
jenniferarnesen Aug 31, 2021
f9b2b51
fix: use offline prop
jenniferarnesen Aug 31, 2021
f2aa1c1
fix: no need for counter, just a bool flag
jenniferarnesen Aug 31, 2021
dc27c01
fix: remove console
jenniferarnesen Aug 31, 2021
74413ec
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 31, 2021
0ea3403
fix: code review updates
jenniferarnesen Aug 31, 2021
4ee4c75
fix: rename to OfflineTooltip
jenniferarnesen Aug 31, 2021
51902c7
fix: upgrade to official published app-runtime and cli-app-scripts
jenniferarnesen Aug 31, 2021
9973eb0
Merge branch 'master' into feat/offline-dashboard
jenniferarnesen Aug 31, 2021
3e49f63
fix: skip broken tests for now
jenniferarnesen Aug 31, 2021
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
3 changes: 2 additions & 1 deletion cypress/elements/editDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { newButtonSel } from './viewDashboard'

export const confirmActionDialogSel = '[data-test="confirm-action-dialog"]'
export const titleInputSel = '[data-test="dashboard-title-input"]'
export const itemMenuSel = '[data-test="item-menu]'
export const itemMenuSel = '[data-test="item-menu"]'
export const itemSearchSel = '[data-test="item-search"]'

export const actionsBarSel = '[data-test="edit-control-bar"]'

Expand Down
2 changes: 2 additions & 0 deletions cypress/elements/sharingDialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const getSharingDialogUserSearch = () =>
cy.get('[placeholder="Enter names"]').scrollIntoView()
7 changes: 7 additions & 0 deletions cypress/elements/viewDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ export const outerScrollContainerSel = '[data-test="outer-scroll-container"]'
export const innerScrollContainerSel = '[data-test="inner-scroll-container"]'

/** Functions **/

export const getViewActionButton = action =>
cy
.get(titleBarSel, EXTENDED_TIMEOUT)
.find('button')
.contains(action, EXTENDED_TIMEOUT)

export const clickViewActionButton = action =>
cy
.get(titleBarSel, EXTENDED_TIMEOUT)
Expand Down
3 changes: 2 additions & 1 deletion cypress/integration/edit/edit_dashboard/sharing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
import { getSharingDialogUserSearch } from '../../../elements/sharingDialog'
import { dashboardTitleSel } from '../../../elements/viewDashboard'
import { EXTENDED_TIMEOUT } from '../../../support/utils'

Expand All @@ -10,7 +11,7 @@ When('I change sharing settings', () => {
//confirm that Boateng is not currently listed
cy.get('hr').should('have.length', 3)

cy.get('[placeholder="Enter names"]').type('Boateng')
getSharingDialogUserSearch().type('Boateng')
cy.contains(USER_NAME).click()

cy.get('div').contains(USER_NAME).should('be.visible')
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/edit/edit_dashboard/star_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Then('the dashboard is starred', () => {

cy.get(dashboardChipSel)
.contains(TEST_DASHBOARD_TITLE)
.parent()
.siblings(chipStarSel)
.first()
.should('be.visible')
Expand All @@ -42,6 +43,7 @@ Then('the dashboard is not starred', () => {

cy.get(dashboardChipSel)
.contains(TEST_DASHBOARD_TITLE)
.parent()
.siblings()
.should('not.exist')
})
69 changes: 69 additions & 0 deletions cypress/integration/view/offline.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Feature: Offline dashboard

Scenario: I cache an uncached dashboard
Given I create a cached and uncached dashboard
Then the cached dashboard has a Last Updated time and chip icon
And the uncached dashboard does not have a Last Updated time and no chip icon

Scenario: I am online with an uncached dashboard when I lose connectivity
Given I open an uncached dashboard
When connectivity is turned off
Then all actions for "uncached" dashboard requiring connectivity are disabled

Scenario: I am online with a cached dashboard when I lose connectivity
Given I open a cached dashboard
Then the cached dashboard options are available
When connectivity is turned off
Then all actions for "cached" dashboard requiring connectivity are disabled

Scenario: I am offline and switch from a cached dashboard to an uncached dashboard
Given I open a cached dashboard
And connectivity is turned off
When I click to open an uncached dashboard when offline
Then the dashboard is not available and offline message is displayed

Scenario: I am offline and switch to a cached dashboard
Given I open an uncached dashboard
And connectivity is turned off
When I click to open a cached dashboard when offline
Then the cached dashboard is loaded and displayed in view mode

Scenario: I am offline and switch to an uncached dashboard and then connectivity is restored
Given I open a cached dashboard
And connectivity is turned off
When I click to open an uncached dashboard when offline
Then the dashboard is not available and offline message is displayed
When connectivity is turned on
Then the uncached dashboard is loaded and displayed in view mode

Scenario: I am in edit mode on an uncached dashboard when I lose connectivity and then I exit without saving and then connectivity is restored
Given I open an uncached dashboard in edit mode
When connectivity is turned off
Then all edit actions requiring connectivity are disabled
When I click Exit without saving
Then the dashboard is not available and offline message is displayed
When connectivity is turned on
Then the uncached dashboard is loaded and displayed in view mode

Scenario: I am in edit mode on a cached dashboard when I lose connectivity and then I exit without saving
Given I open a cached dashboard in edit mode
When connectivity is turned off
Then all edit actions requiring connectivity are disabled
When I click Exit without saving
Then the cached dashboard is loaded and displayed in view mode

Scenario: The sharing dialog is open when connectivity is lost
Given I open a cached dashboard
When I open sharing settings
And connectivity is turned off
Then it is not possible to change sharing settings

Scenario: The interpretations panel is open when connectivity is lost
Given I open a cached dashboard
And I open the interpretations panel
When connectivity is turned off
Then it is not possible to interact with interpretations


Scenario: I delete the cached and uncached dashboard
Given I delete the cached and uncached dashboard
Loading