Skip to content

Commit

Permalink
DMP-3482: Show Automated Job Batch Size in Admin Portal (#1578)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabahirfan authored Oct 25, 2024
1 parent 0617a4b commit 8784bad
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ describe('Admin - Automated tasks screen', () => {
cy.get('app-details-table dt').contains('Cron editable');
cy.get('app-details-table dd').contains('Yes');

cy.get('app-details-table dt').contains('Batch size');
cy.get('app-details-table dd').contains('1000');

cy.get('app-details-table dt').contains('Date created');
cy.get('app-details-table dd').contains('Mon 1 Jan 2024 at 00:00:00');

Expand Down
3 changes: 3 additions & 0 deletions darts-api-stub/admin/automated-tasks/automated-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const defaultAutomatedTasks = [
description: 'Simulate 202 success',
cron_expression: '0 0 1 * * *',
is_cron_editable: true,
batch_size: 1000,
is_active: true,
created_at: '2024-01-01T00:00:00Z',
created_by: 1,
Expand All @@ -21,6 +22,7 @@ const defaultAutomatedTasks = [
description: 'Simulate 404 not found',
cron_expression: '0 0 2 * * *',
is_cron_editable: true,
batch_size: 500,
is_active: false,
created_at: '2024-01-02T00:00:00Z',
created_by: 2,
Expand All @@ -33,6 +35,7 @@ const defaultAutomatedTasks = [
description: 'Simulate 409 already running task',
cron_expression: '0 0 3 * * *',
is_cron_editable: true,
batch_size: 250,
is_active: true,
created_at: '2024-01-03T00:00:00Z',
created_by: 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const task: AutomatedTaskDetails = {
description: 'Task 1 description',
cronExpression: '1 0 0 * * *',
isCronEditable: true,
batchSize: 1000,
createdAt: DateTime.fromISO('2021-01-01T00:00:00Z'),
createdBy: 1,
lastModifiedAt: DateTime.fromISO('2021-01-01T00:00:00Z'),
Expand Down Expand Up @@ -67,6 +68,7 @@ describe('ViewAutomatedTasksComponent', () => {
Description: 'Task 1 description',
'Cron expression': '1 0 0 * * *',
'Cron editable': 'Yes',
'Batch size': 1000,
'Date created': 'Fri 1 Jan 2021 at 00:00:00',
'Created by': 'User 1',
'Date modified': 'Fri 1 Jan 2021 at 00:00:00',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class ViewAutomatedTasksComponent {
Description: this.task()?.description,
'Cron expression': this.task()?.cronExpression,
'Cron editable': this.task()?.isCronEditable ? 'Yes' : 'No',
'Batch size': this.task()?.batchSize,
'Date created': this.task()?.createdAt.toFormat(this.dateFormat),
'Created by': this.task()?.createdByFullName,
'Date modified': this.task()?.lastModifiedAt.toFormat(this.dateFormat),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface AutomatedTaskData {

export interface AutomatedTaskDetailsData extends AutomatedTaskData {
is_cron_editable: boolean;
batch_size: number;
created_at: string;
created_by: number;
last_modified_at: string;
Expand Down
1 change: 1 addition & 0 deletions src/app/admin/models/automated-task/automated-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type AutomatedTask = {

export type AutomatedTaskDetails = AutomatedTask & {
isCronEditable: boolean;
batchSize: number;
createdAt: DateTime;
createdBy: number;
lastModifiedAt: DateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class AutomatedTasksService {
cronExpression: task.cron_expression,
isActive: task.is_active,
isCronEditable: task.is_cron_editable,
batchSize: task.batch_size,
createdAt: DateTime.fromISO(task.created_at),
createdBy: task.created_by,
lastModifiedAt: DateTime.fromISO(task.last_modified_at),
Expand Down

0 comments on commit 8784bad

Please sign in to comment.