Skip to content

Commit

Permalink
Changed the task audit log to use new state wiring [comixed#424]
Browse files Browse the repository at this point in the history
 * Refactored the code to use the new NgRx model.
 * Removed the old task audit log state wiring.
  • Loading branch information
mcpierce committed Aug 18, 2020
1 parent fa9d04a commit 45c80fe
Show file tree
Hide file tree
Showing 22 changed files with 635 additions and 625 deletions.
@@ -0,0 +1,43 @@
/*
* ComiXed - A digital comic book library management application.
* Copyright (C) 2020, The ComiXed Project
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses>
*/

import { createAction, props } from '@ngrx/store';
import { TaskAuditLogEntry } from 'app/backend-status/models/task-audit-log-entry';

/**
* Loads all task audit log entries after the specified date.
*/
export const loadTaskAuditLogEntries = createAction(
'[LoadTaskAuditLog] Load task audit log entries',
props<{ since: number }>()
);

/**
* Receives additional task audit log entries.
*/
export const taskAuditLogEntriesLoaded = createAction(
'[LoadTaskAuditLog] Task audit log entries loaded',
props<{ entries: TaskAuditLogEntry[]; latest: number }>()
);

/**
* Failed to get task audit log entries.
*/
export const loadTaskAuditLogFailed = createAction(
'[LoadTaskAuditLog] Failed to load the task audit log entries'
);

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 7 additions & 7 deletions comixed-frontend/src/app/backend-status/backend-status.module.ts
Expand Up @@ -24,20 +24,20 @@ import { BackendStatusRoutingModule } from 'app/backend-status/backend-status-ro
import { BuildDetailsAdaptor } from 'app/backend-status/adaptors/build-details.adaptor';
import { StoreModule } from '@ngrx/store';
import * as fromBuildDetails from './reducers/build-details.reducer';
import * as fromTaskAuditLog from './reducers/task-audit-log.reducer';
import * as fromClearTaskAuditLog from './reducers/clear-task-audit-log.reducer';
import * as fromLoadTaskAuditLog from './reducers/load-task-audit-log.reducer';
import { EffectsModule } from '@ngrx/effects';
import { BuildDetailsEffects } from 'app/backend-status/effects/build-details.effects';
import { TranslateModule } from '@ngx-translate/core';
import { TaskAuditLogEffects } from 'app/backend-status/effects/task-audit-log.effects';
import { TaskAuditLogPageComponent } from './pages/task-audit-log-page/task-audit-log-page.component';
import { TaskAuditLogAdaptor } from 'app/backend-status/adaptors/task-audit-log.adaptor';
import { TableModule } from 'primeng/table';
import { ScrollPanelModule } from 'primeng/primeng';
import { CoreModule } from 'app/core/core.module';
import { CLEAR_TASK_AUDIT_LOG_FEATURE_KEY } from 'app/backend-status/reducers/clear-task-audit-log.reducer';
import { ClearTaskAuditLogEffects } from 'app/backend-status/effects/clear-task-audit-log.effects';
import { ToolbarModule, TooltipModule } from 'primeng/primeng';
import { LOAD_TASK_AUDIT_LOG_FEATURE_KEY } from 'app/backend-status/reducers/load-task-audit-log.reducer';
import { LoadTaskAuditLogEffects } from 'app/backend-status/effects/load-task-audit-log.effects';

@NgModule({
declarations: [BuildDetailsPageComponent, TaskAuditLogPageComponent],
Expand All @@ -51,16 +51,16 @@ import { ToolbarModule, TooltipModule } from 'primeng/primeng';
fromBuildDetails.reducer
),
StoreModule.forFeature(
fromTaskAuditLog.TASK_AUDIT_LOG_FEATURE_KEY,
fromTaskAuditLog.reducer
LOAD_TASK_AUDIT_LOG_FEATURE_KEY,
fromLoadTaskAuditLog.reducer
),
StoreModule.forFeature(
CLEAR_TASK_AUDIT_LOG_FEATURE_KEY,
fromClearTaskAuditLog.reducer
),
EffectsModule.forFeature([
BuildDetailsEffects,
TaskAuditLogEffects,
LoadTaskAuditLogEffects,
ClearTaskAuditLogEffects
]),
TableModule,
Expand All @@ -69,6 +69,6 @@ import { ToolbarModule, TooltipModule } from 'primeng/primeng';
TooltipModule
],
exports: [CommonModule, CoreModule],
providers: [BuildDetailsService, BuildDetailsAdaptor, TaskAuditLogAdaptor]
providers: [BuildDetailsService, BuildDetailsAdaptor]
})
export class BackendStatusModule {}

0 comments on commit 45c80fe

Please sign in to comment.