Skip to content

Commit

Permalink
feat: incorporate job queue in job list (#571)
Browse files Browse the repository at this point in the history
* feat: add queue actions

* chore: update translations

* feat: add new queue button

* refactor: update table headers to match design

* chore: update translations

* fix: ignore invalid jobs

* refactor: separate table rows by job type

* refactor: hardcode queue type for queues

* feat: add toggleable row for queued jobs

* fix: update job toggle to json patch

* refactor: finish naming updates

* test: add tests for queue components

* style: add slight inset to distinguish expanded rows

* style: refine expandable styles

* refactor: adjust expandable row styles

* refactor: use css module instead of inline styles

* fix: use new endpoint to toggle tasks

* chore: update caniuse db

* test: add new queue test

* refactor: update e2e test naming

* test: add queue list test

* test: add queue row expansion test

* refactor: rename switch

* test: add queue to filter test

* test: add test for queue toggling

* test: add test for queue actions

* chore: simplify fixture naming

* refactor: consolidate to single info link

* chore: update translations

* refactor: rely on cypress for jobswitch test

* refactor: rename to namefilter

* refactor: ensure all queries are static

* refactor: align terms

* chore: update fixtures

* refactor: unify naming used in e2e tests

* chore: update fixtures

* chore: update modal confirmation text
  • Loading branch information
ismay authored Jan 3, 2024
1 parent c952231 commit 204173e
Show file tree
Hide file tree
Showing 173 changed files with 2,267 additions and 1,373 deletions.
27 changes: 27 additions & 0 deletions cypress/fixtures/list/disabled-queue-scheduler.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"name": "Queue 1",
"type": "Sequence",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED",
"enabled": false,
"configurable": true,
"sequence": [
{
"id": "uvUPBToQHD9",
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED"
},
{
"id": "PPgVeqiSXpz",
"name": "Job 2",
"type": "DISABLE_INACTIVE_USERS",
"status": "SCHEDULED"
}
]
}
]
27 changes: 27 additions & 0 deletions cypress/fixtures/list/enabled-queue-scheduler.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"name": "Queue 1",
"type": "Sequence",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED",
"enabled": true,
"configurable": true,
"sequence": [
{
"id": "uvUPBToQHD9",
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED"
},
{
"id": "PPgVeqiSXpz",
"name": "Job 2",
"type": "DISABLE_INACTIVE_USERS",
"status": "SCHEDULED"
}
]
}
]
27 changes: 27 additions & 0 deletions cypress/fixtures/list/list-queues-scheduler.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"name": "Queue",
"type": "Sequence",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED",
"enabled": true,
"configurable": true,
"sequence": [
{
"id": "uvUPBToQHD9",
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED"
},
{
"id": "PPgVeqiSXpz",
"name": "Job 2",
"type": "DISABLE_INACTIVE_USERS",
"status": "SCHEDULED"
}
]
}
]
File renamed without changes.
34 changes: 34 additions & 0 deletions cypress/fixtures/list/single-queue-job-configurations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"pager": {
"page": 1,
"total": 11,
"pageSize": 50,
"pageCount": 1
},
"jobConfigurations": [
{
"name": "Job 1",
"created": "2023-11-16T13:20:38.208",
"jobType": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"jobParameters": {
"type": "REPORT"
},
"lastExecutedStatus": "NOT_STARTED",
"configurable": true,
"id": "uvUPBToQHD9"
},
{
"name": "Job 2",
"created": "2023-11-16T13:20:48.433",
"jobType": "DISABLE_INACTIVE_USERS",
"jobParameters": {
"inactiveMonths": 1,
"reminderDaysBefore": 2
},
"lastExecutedStatus": "NOT_STARTED",
"configurable": true,
"id": "PPgVeqiSXpz"
}
]
}
5 changes: 5 additions & 0 deletions cypress/fixtures/list/single-queue-queues.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Queue",
"cronExpression": "0 0 3 ? * MON",
"sequence": ["uvUPBToQHD9", "PPgVeqiSXpz"]
}
27 changes: 27 additions & 0 deletions cypress/fixtures/list/single-queue-scheduler.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"name": "Queue",
"type": "Sequence",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED",
"enabled": true,
"configurable": true,
"sequence": [
{
"id": "uvUPBToQHD9",
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED"
},
{
"id": "PPgVeqiSXpz",
"name": "Job 2",
"type": "DISABLE_INACTIVE_USERS",
"status": "SCHEDULED"
}
]
}
]
84 changes: 84 additions & 0 deletions cypress/fixtures/list/some-user-jobs-and-queues-scheduler.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[
{
"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"
}
]
},
{
"name": "Job 2",
"type": "MONITORING",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "SCHEDULED",
"enabled": true,
"configurable": true,
"sequence": [
{
"id": "HEUQRVwkSaB",
"name": "Job 2",
"type": "MONITORING",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "SCHEDULED"
}
]
},
{
"name": "Job 3",
"type": "DISABLE_INACTIVE_USERS",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "SCHEDULED",
"enabled": true,
"configurable": true,
"sequence": [
{
"id": "thARpL8RTbe",
"name": "Job 3",
"type": "DISABLE_INACTIVE_USERS",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2021-03-01T03:00:00.000",
"status": "SCHEDULED"
}
]
},
{
"name": "Queue 1",
"type": "Sequence",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED",
"enabled": true,
"configurable": true,
"sequence": [
{
"id": "uvUPBToQHD9",
"name": "Job 1",
"type": "DATA_INTEGRITY",
"cronExpression": "0 0 3 ? * MON",
"nextExecutionTime": "2023-11-20T03:00:00.000",
"status": "SCHEDULED"
},
{
"id": "PPgVeqiSXpz",
"name": "Job 2",
"type": "DISABLE_INACTIVE_USERS",
"status": "SCHEDULED"
}
]
}
]
67 changes: 67 additions & 0 deletions cypress/fixtures/network/41/queue_actions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[
{
"path": "/api/41/systemSettings/helpPageLink",
"featureName": "Queue actions",
"static": false,
"count": 3,
"nonDeterministic": false,
"method": "GET",
"requestBody": "",
"requestHeaders": {
"host": "debug.dhis2.org",
"connection": "keep-alive",
"accept": "application/json",
"origin": "http://localhost:3000",
"sec-fetch-site": "cross-site",
"sec-fetch-mode": "cors"
},
"statusCode": 200,
"responseBody": "{\"helpPageLink\":\"https://dhis2.github.io/dhis2-docs/master/en/user/html/dhis2_user_manual_en.html\"}",
"responseSize": 99,
"responseHeaders": {
"server": "nginx/1.23.0",
"content-type": "application/json;charset=UTF-8",
"transfer-encoding": "chunked",
"connection": "keep-alive",
"access-control-allow-credentials": "true",
"access-control-allow-origin": "http://localhost:3000",
"vary": "Origin",
"access-control-expose-headers": "ETag, Location",
"cache-control": "no-cache, private",
"x-content-type-options": "nosniff",
"x-xss-protection": "1; mode=block"
}
},
{
"path": "/api/41/scheduler/queueable",
"featureName": "Queue actions",
"static": false,
"count": 1,
"nonDeterministic": false,
"method": "GET",
"requestBody": "",
"requestHeaders": {
"host": "debug.dhis2.org",
"connection": "keep-alive",
"accept": "application/json",
"origin": "http://localhost:3000",
"sec-fetch-site": "cross-site",
"sec-fetch-mode": "cors"
},
"statusCode": 200,
"responseBody": "[{\"name\":\"1\",\"type\":\"DATA_INTEGRITY\",\"status\":\"DISABLED\",\"enabled\":false,\"configurable\":true,\"sequence\":[{\"id\":\"sHmTcgoa5vB\",\"name\":\"1\",\"type\":\"DATA_INTEGRITY\",\"status\":\"DISABLED\"}]}]",
"responseSize": 183,
"responseHeaders": {
"server": "nginx/1.23.0",
"content-type": "application/json;charset=UTF-8",
"transfer-encoding": "chunked",
"connection": "keep-alive",
"access-control-allow-credentials": "true",
"access-control-allow-origin": "http://localhost:3000",
"vary": "Origin",
"access-control-expose-headers": "ETag, Location",
"x-content-type-options": "nosniff",
"x-xss-protection": "1; mode=block"
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[
{
"path": "/api/41/systemSettings/helpPageLink",
"featureName": "Queues can be enabled and disabled",
"static": false,
"count": 2,
"nonDeterministic": false,
"method": "GET",
"requestBody": "",
"requestHeaders": {
"host": "debug.dhis2.org",
"connection": "keep-alive",
"accept": "application/json",
"origin": "http://localhost:3000",
"sec-fetch-site": "cross-site",
"sec-fetch-mode": "cors"
},
"statusCode": 200,
"responseBody": "{\"helpPageLink\":\"https://dhis2.github.io/dhis2-docs/master/en/user/html/dhis2_user_manual_en.html\"}",
"responseSize": 99,
"responseHeaders": {
"server": "nginx/1.23.0",
"content-type": "application/json;charset=UTF-8",
"transfer-encoding": "chunked",
"connection": "keep-alive",
"access-control-allow-credentials": "true",
"access-control-allow-origin": "http://localhost:3000",
"vary": "Origin",
"access-control-expose-headers": "ETag, Location",
"cache-control": "no-cache, private",
"x-content-type-options": "nosniff",
"x-xss-protection": "1; mode=block"
}
}
]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"path": "/api/41/systemSettings/helpPageLink",
"featureName": "Users should be able to edit a sequence",
"featureName": "Queues should be listed",
"static": false,
"count": 1,
"nonDeterministic": false,
Expand Down
Loading

1 comment on commit 204173e

@dhis2-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.