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

refactor: remove store #495

Merged
57 commits merged into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
f1ccdf0
chore: add job schedules hook
Mar 15, 2023
573af25
chore: use job schedules endpoint for home route
Mar 27, 2023
e04d501
chore: add use job by id hook for edit route
Mar 27, 2023
fd179d3
chore: add job hooks tests
Mar 27, 2023
f76c185
chore: add use job by id hook for view route
Mar 27, 2023
97b5ce4
chore: align test with wording other tests
Mar 27, 2023
69444eb
test(cypress): update e2e fixtures
Mar 28, 2023
089c223
test(jest): fix jest tests
Mar 29, 2023
7242d51
refactor: remove containers
Mar 29, 2023
4a416a1
chore: initial replacement of store
Apr 5, 2023
f693352
chore: add spinner
Apr 5, 2023
bba0ab8
chore: fix hooks
Apr 5, 2023
c6d81f6
chore: fix hook tests
Apr 5, 2023
bd0c08c
chore: fix linting errors
Apr 5, 2023
2f6e089
test(jest): fix parameter fields test
Apr 12, 2023
f9d5e1c
test(jest): fix schedule field test
Apr 12, 2023
681256b
refactor: pass refetch to runjobmodal instead of using hook
Apr 12, 2023
953a2c7
test(jest): fix actions test
Apr 12, 2023
249b734
test(jest): fix runjobaction test
Apr 12, 2023
aa1b75b
test(jest): fix jobtable test
Apr 12, 2023
5a91e0b
test(jest): fix jobtablerow test
Apr 12, 2023
0525423
test(jest): fix labeledoptionsfield test
Apr 17, 2023
2a6cb64
test(jest): fix skiptabletypesfield test
Apr 17, 2023
82ed8f5
test(jest): fix jobtypefield test
Apr 17, 2023
5c41f2e
test(jest): fix deletejobaction test
Apr 17, 2023
e694b1f
test(jest): fix jobeditformcontainer test
Apr 17, 2023
f76dd98
style(eslint): remove unused store context export
Apr 17, 2023
e855555
refactor: add data fetching states to JobTypeField
Apr 18, 2023
32f89af
refactor: add data fetching states to form fields
Apr 18, 2023
ea64420
refactor: pass refetch to togglejobswitch instead of using hook
Apr 19, 2023
4e1f9b7
refactor: handle malformed data for job schedules
Apr 24, 2023
3888024
test(jest): fix async tests
Apr 25, 2023
7d661b6
test(cypress): ensure job types have loaded before clicking
Apr 25, 2023
e0cd0a4
test(cypress): update fixtures to 41
Apr 26, 2023
d5d90d1
fix(jobedit): ensure jobedit is not using stale data
Apr 26, 2023
9d98abe
fix(jobview): ensure jobview is not using stale data
Apr 26, 2023
951e865
chore: update yarn.lock
May 2, 2023
daa90e2
refactor(imports): allow importing from hooks dir
May 2, 2023
e38da21
refactor(prop): use on- style name for callback property
May 2, 2023
e7bfa0b
Revert "refactor(imports): allow importing from hooks dir"
May 2, 2023
a7758be
refactor(imports): simplify import style
May 2, 2023
3fa412c
fix(hooks): ensure data is never returned unmodified
May 2, 2023
8338f67
refactor(hooks): simplify hook
May 2, 2023
3eb4546
fix(joblist): show error in noticebox instead of throwing
May 2, 2023
ddd6b71
refactor(auth): show noticebox on errors instead of throwing
May 3, 2023
f7423a3
chore: remove unused module
May 3, 2023
58ee8af
chore: update translations
May 3, 2023
afb7a57
refactor: fail gracefully if parameter option could not be found
May 3, 2023
38b1451
fix: fix copied error message
May 3, 2023
eaf1a86
test(jest): add jobadd test
May 3, 2023
6bea77d
test(jest): add jobedit and jobview tests
May 3, 2023
225a55a
test(jest): add joblist test
May 3, 2023
c46e55c
test(pages): improve page test coverage
May 8, 2023
d94d2ab
test(hooks): improve hooks test coverage
May 8, 2023
c2a42f1
chore: add missing translation
May 9, 2023
10cfe63
refactor: extract job filtering from job list
May 9, 2023
560487e
fix: specify 2.40 as minimum version
May 15, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_dhis2BaseUrl: http://localhost:8080
CYPRESS_dhis2ApiVersion: 40
CYPRESS_dhis2BaseUrl: https://debug.dhis2.org/dev
CYPRESS_dhis2ApiVersion: 41
CYPRESS_networkMode: stub

release:
Expand Down
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"video": false,
"env": {
"dhis2DataTestPrefix": "dhis2-scheduler",
"dhis2ApiVersion": "40"
"dhis2ApiVersion": "41",
"dhis2BaseUrl": "https://debug.dhis2.org/dev"
}
}
69 changes: 21 additions & 48 deletions cypress/fixtures/list-route/disabled-user-job.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,21 @@
{
"jobConfigurations": [
{
"lastUpdated": "2021-02-23T11:28:02.492",
"id": "lnWRZN67iDU",
"href": "https://debug.dhis2.org/dev/api/32/jobConfigurations/lnWRZN67iDU",
"created": "2021-02-23T11:28:02.492",
"name": "Job 1",
"jobStatus": "DISABLED",
"displayName": "Job 1",
"enabled": false,
"leaderOnlyJob": false,
"externalAccess": false,
"jobType": "DATA_INTEGRITY",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"sharing": {
"external": false,
"users": {},
"userGroups": {}
},
"cronExpression": "0 0 3 ? * MON",
"schedulingType": "CRON",
"lastRuntimeExecution": "00:00:21.780",
"lastExecutedStatus": "COMPLETED",
"lastExecuted": "2021-02-22T03:00:21.795",
"favorite": false,
"configurable": true,
"access": {
"read": true,
"update": true,
"externalize": false,
"delete": true,
"write": true,
"manage": true
},
"lastUpdatedBy": {
"displayName": "John Traore",
"id": "xE7jOejl9FI",
"username": "admin"
},
"favorites": [],
"translations": [],
"userGroupAccesses": [],
"attributeValues": [],
"userAccesses": []
}
]
}
[
{
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "DISABLED",
"enabled": false,
"configurable": true,
"sequence": [
{
"id": "lnWRZN67iDU",
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "DISABLED"
}
]
}
]
69 changes: 21 additions & 48 deletions cypress/fixtures/list-route/enabled-user-job.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,21 @@
{
"jobConfigurations": [
{
"lastUpdated": "2021-02-23T11:28:02.492",
"id": "lnWRZN67iDU",
"href": "https://debug.dhis2.org/dev/api/32/jobConfigurations/lnWRZN67iDU",
"created": "2021-02-23T11:28:02.492",
"name": "Job 1",
"jobStatus": "DISABLED",
"displayName": "Job 1",
"enabled": true,
"leaderOnlyJob": false,
"externalAccess": false,
"jobType": "DATA_INTEGRITY",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"sharing": {
"external": false,
"users": {},
"userGroups": {}
},
"cronExpression": "0 0 3 ? * MON",
"schedulingType": "CRON",
"lastRuntimeExecution": "00:00:21.780",
"lastExecutedStatus": "COMPLETED",
"lastExecuted": "2021-02-22T03:00:21.795",
"favorite": false,
"configurable": true,
"access": {
"read": true,
"update": true,
"externalize": false,
"delete": true,
"write": true,
"manage": true
},
"lastUpdatedBy": {
"displayName": "John Traore",
"id": "xE7jOejl9FI",
"username": "admin"
},
"favorites": [],
"translations": [],
"userGroupAccesses": [],
"attributeValues": [],
"userAccesses": []
}
]
}
[
{
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "DISABLED",
"enabled": true,
"configurable": true,
"sequence": [
{
"id": "lnWRZN67iDU",
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "DISABLED"
}
]
}
]
2 changes: 1 addition & 1 deletion cypress/fixtures/list-route/no-jobs.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "jobConfigurations": [] }
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"jobConfigurations": [
{
"lastUpdated": "2021-02-24T02:00:00.368",
"id": "sHMedQF7VYa",
"href": "https://debug.dhis2.org/dev/api/32/jobConfigurations/sHMedQF7VYa",
"created": "2021-02-19T13:51:53.974",
"name": "System Job 1",
"jobStatus": "SCHEDULED",
"displayName": "System Job 1",
"enabled": true,
"leaderOnlyJob": true,
"externalAccess": false,
"jobType": "CREDENTIALS_EXPIRY_ALERT",
"nextExecutionTime": "2021-02-25T02:00:00.000",
"sharing": {
"external": false,
"users": {},
"userGroups": {}
},
"cronExpression": "0 0 2 ? * *",
"schedulingType": "CRON",
"lastRuntimeExecution": "00:00:00.349",
"lastExecutedStatus": "COMPLETED",
"lastExecuted": "2021-02-24T02:00:00.364",
"favorite": false,
"configurable": false,
"access": {
"read": true,
"update": true,
"externalize": false,
"delete": true,
"write": true,
"manage": true
},
"favorites": [],
"translations": [],
"userGroupAccesses": [],
"attributeValues": [],
"userAccesses": []
}
]
}
64 changes: 21 additions & 43 deletions cypress/fixtures/list-route/single-system-job.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
{
"jobConfigurations": [
{
"lastUpdated": "2021-02-24T02:00:00.368",
"id": "sHMedQF7VYa",
"href": "https://debug.dhis2.org/dev/api/32/jobConfigurations/sHMedQF7VYa",
"created": "2021-02-19T13:51:53.974",
"name": "System Job 1",
"jobStatus": "SCHEDULED",
"displayName": "System Job 1",
"enabled": true,
"leaderOnlyJob": true,
"externalAccess": false,
"jobType": "CREDENTIALS_EXPIRY_ALERT",
"nextExecutionTime": "2021-02-25T02:00:00.000",
"sharing": {
"external": false,
"users": {},
"userGroups": {}
},
"cronExpression": "0 0 2 ? * *",
"schedulingType": "CRON",
"lastRuntimeExecution": "00:00:00.349",
"lastExecutedStatus": "COMPLETED",
"lastExecuted": "2021-02-24T02:00:00.364",
"favorite": false,
"configurable": false,
"access": {
"read": true,
"update": true,
"externalize": false,
"delete": true,
"write": true,
"manage": true
},
"favorites": [],
"translations": [],
"userGroupAccesses": [],
"attributeValues": [],
"userAccesses": []
}
]
}
[
{
"name": "System Job 1",
"type": "CREDENTIALS_EXPIRY_ALERT",
"cronExpression": "0 0 2 ? * *",
"nextExecutionTime": "2021-02-25T02:00:00.000",
"status": "SCHEDULED",
"enabled": true,
"configurable": false,
"sequence": [
{
"id": "sHMedQF7VYa",
"name": "System Job 1",
"type": "CREDENTIALS_EXPIRY_ALERT",
"cronExpression": "0 0 2 ? * *",
"nextExecutionTime": "2021-02-25T02:00:00.000",
"status": "SCHEDULED"
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"jobConfigurations": [
{
"lastUpdated": "2021-02-23T11:28:02.492",
"id": "lnWRZN67iDU",
"href": "https://debug.dhis2.org/dev/api/32/jobConfigurations/lnWRZN67iDU",
"created": "2021-02-23T11:28:02.492",
"name": "Job 1",
"jobStatus": "SCHEDULED",
"displayName": "Job 1",
"enabled": true,
"leaderOnlyJob": false,
"externalAccess": false,
"jobType": "DATA_INTEGRITY",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"sharing": {
"external": false,
"users": {},
"userGroups": {}
},
"cronExpression": "0 0 3 ? * MON",
"schedulingType": "CRON",
"lastRuntimeExecution": "00:00:21.780",
"lastExecutedStatus": "COMPLETED",
"lastExecuted": "2021-02-22T03:00:21.795",
"favorite": false,
"configurable": true,
"access": {
"read": true,
"update": true,
"externalize": false,
"delete": true,
"write": true,
"manage": true
},
"lastUpdatedBy": {
"displayName": "John Traore",
"id": "xE7jOejl9FI",
"username": "admin"
},
"favorites": [],
"translations": [],
"userGroupAccesses": [],
"attributeValues": [],
"userAccesses": []
}
]
}
69 changes: 21 additions & 48 deletions cypress/fixtures/list-route/single-user-job.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,21 @@
{
"jobConfigurations": [
{
"lastUpdated": "2021-02-23T11:28:02.492",
"id": "lnWRZN67iDU",
"href": "https://debug.dhis2.org/dev/api/32/jobConfigurations/lnWRZN67iDU",
"created": "2021-02-23T11:28:02.492",
"name": "Job 1",
"jobStatus": "SCHEDULED",
"displayName": "Job 1",
"enabled": true,
"leaderOnlyJob": false,
"externalAccess": false,
"jobType": "DATA_INTEGRITY",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"sharing": {
"external": false,
"users": {},
"userGroups": {}
},
"cronExpression": "0 0 3 ? * MON",
"schedulingType": "CRON",
"lastRuntimeExecution": "00:00:21.780",
"lastExecutedStatus": "COMPLETED",
"lastExecuted": "2021-02-22T03:00:21.795",
"favorite": false,
"configurable": true,
"access": {
"read": true,
"update": true,
"externalize": false,
"delete": true,
"write": true,
"manage": true
},
"lastUpdatedBy": {
"displayName": "John Traore",
"id": "xE7jOejl9FI",
"username": "admin"
},
"favorites": [],
"translations": [],
"userGroupAccesses": [],
"attributeValues": [],
"userAccesses": []
}
]
}
[
{
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "SCHEDULED",
"enabled": true,
"configurable": true,
"sequence": [
{
"id": "lnWRZN67iDU",
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "SCHEDULED"
}
]
}
]
Loading