mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
minor refactoring, rename AcaState to AppStore
rename main store to a more traditional name
This commit is contained in:
parent
1ac85c0149
commit
c6cae392e2
@ -31,7 +31,7 @@ import {
|
||||
} from '@alfresco/adf-core';
|
||||
import { ElectronService } from '@ngstack/electron';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AcaState } from './store/states/app.state';
|
||||
import { AppStore } from './store/states/app.state';
|
||||
import { SetHeaderColorAction } from './store/actions/header-color.action';
|
||||
import { SetAppNameAction } from './store/actions/app-name.action';
|
||||
import { SetLogoPathAction } from './store/actions/logo-path.action';
|
||||
@ -47,7 +47,7 @@ export class AppComponent implements OnInit {
|
||||
private router: Router,
|
||||
private pageTitle: PageTitleService,
|
||||
preferences: UserPreferencesService,
|
||||
private store: Store<AcaState>,
|
||||
private store: Store<AppStore>,
|
||||
private config: AppConfigService,
|
||||
private electronService: ElectronService,
|
||||
private uploadService: UploadService) {
|
||||
|
@ -32,7 +32,7 @@ import { ContentManagementService } from '../../common/services/content-manageme
|
||||
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||
import { PageComponent } from '../page.component';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AcaState } from '../../store/states/app.state';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
|
||||
@Component({
|
||||
templateUrl: './favorites.component.html'
|
||||
@ -41,7 +41,7 @@ export class FavoritesComponent extends PageComponent implements OnInit {
|
||||
|
||||
constructor(router: Router,
|
||||
route: ActivatedRoute,
|
||||
store: Store<AcaState>,
|
||||
store: Store<AppStore>,
|
||||
private nodesApi: NodesApiService,
|
||||
private contentService: ContentService,
|
||||
private content: ContentManagementService,
|
||||
|
@ -39,7 +39,7 @@ import { NodePermissionService } from '../../common/services/node-permission.ser
|
||||
|
||||
import { PageComponent } from '../page.component';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AcaState } from '../../store/states/app.state';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
|
||||
@Component({
|
||||
templateUrl: './files.component.html'
|
||||
@ -52,7 +52,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(router: Router,
|
||||
route: ActivatedRoute,
|
||||
store: Store<AcaState>,
|
||||
store: Store<AppStore>,
|
||||
private nodesApi: NodesApiService,
|
||||
private nodeActionsService: NodeActionsService,
|
||||
private uploadService: UploadService,
|
||||
|
@ -34,7 +34,7 @@ import { HeaderComponent } from './header.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { StoreModule, Store } from '@ngrx/store';
|
||||
import { appReducer } from '../../store/reducers/app.reducer';
|
||||
import { INITIAL_STATE, AcaState } from '../../store/states/app.state';
|
||||
import { INITIAL_STATE, AppStore } from '../../store/states/app.state';
|
||||
import { SetAppNameAction } from '../../store/actions/app-name.action';
|
||||
import { SetHeaderColorAction } from '../../store/actions/header-color.action';
|
||||
|
||||
@ -42,7 +42,7 @@ describe('HeaderComponent', () => {
|
||||
let fixture: ComponentFixture<HeaderComponent>;
|
||||
let component: HeaderComponent;
|
||||
let appConfigService: AppConfigService;
|
||||
let store: Store<AcaState>;
|
||||
let store: Store<AppStore>;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
|
@ -26,7 +26,7 @@
|
||||
import { Component, Output, EventEmitter, ViewEncapsulation } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { AcaState } from '../../store/states/app.state';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
import { selectHeaderColor, selectAppName, selectLogoPath } from '../../store/selectors/app.selectors';
|
||||
|
||||
@Component({
|
||||
@ -42,7 +42,7 @@ export class HeaderComponent {
|
||||
headerColor$: Observable<string>;
|
||||
logo$: Observable<string>;
|
||||
|
||||
constructor(store: Store<AcaState>) {
|
||||
constructor(store: Store<AppStore>) {
|
||||
this.headerColor$ = store.select(selectHeaderColor);
|
||||
this.appName$ = store.select(selectAppName);
|
||||
this.logo$ = store.select(selectLogoPath);
|
||||
|
@ -30,7 +30,7 @@ import { ShareDataRow } from '@alfresco/adf-content-services';
|
||||
|
||||
import { PageComponent } from '../page.component';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AcaState } from '../../store/states/app.state';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
|
||||
@Component({
|
||||
templateUrl: './libraries.component.html'
|
||||
@ -39,7 +39,7 @@ export class LibrariesComponent extends PageComponent {
|
||||
|
||||
constructor(private nodesApi: NodesApiService,
|
||||
route: ActivatedRoute,
|
||||
store: Store<AcaState>,
|
||||
store: Store<AppStore>,
|
||||
router: Router,
|
||||
preferences: UserPreferencesService) {
|
||||
super(preferences, router, route, store);
|
||||
|
@ -30,7 +30,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { OnDestroy, ViewChild, OnInit } from '@angular/core';
|
||||
import { Subscription, Subject } from 'rxjs/Rx';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AcaState } from '../store/states/app.state';
|
||||
import { AppStore } from '../store/states/app.state';
|
||||
import { SetSelectedNodesAction } from '../store/actions/select-nodes.action';
|
||||
import { selectedNodes } from '../store/selectors/app.selectors';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
@ -66,7 +66,7 @@ export abstract class PageComponent implements OnInit, OnDestroy {
|
||||
constructor(protected preferences: UserPreferencesService,
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected store: Store<AcaState>) {
|
||||
protected store: Store<AppStore>) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -32,7 +32,7 @@ import { ContentManagementService } from '../../common/services/content-manageme
|
||||
import { PageComponent } from '../page.component';
|
||||
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AcaState } from '../../store/states/app.state';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
|
||||
@Component({
|
||||
templateUrl: './recent-files.component.html'
|
||||
@ -42,7 +42,7 @@ export class RecentFilesComponent extends PageComponent implements OnInit {
|
||||
constructor(
|
||||
router: Router,
|
||||
route: ActivatedRoute,
|
||||
store: Store<AcaState>,
|
||||
store: Store<AppStore>,
|
||||
private content: ContentManagementService,
|
||||
public permission: NodePermissionService,
|
||||
preferences: UserPreferencesService) {
|
||||
|
@ -32,7 +32,7 @@ import { ContentManagementService } from '../../common/services/content-manageme
|
||||
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||
import { PageComponent } from '../page.component';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AcaState } from '../../store/states/app.state';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
|
||||
@Component({
|
||||
templateUrl: './shared-files.component.html'
|
||||
@ -41,7 +41,7 @@ export class SharedFilesComponent extends PageComponent implements OnInit {
|
||||
|
||||
constructor(router: Router,
|
||||
route: ActivatedRoute,
|
||||
store: Store<AcaState>,
|
||||
store: Store<AppStore>,
|
||||
private content: ContentManagementService,
|
||||
private apiService: AlfrescoApiService,
|
||||
public permission: NodePermissionService,
|
||||
|
@ -30,7 +30,7 @@ import { UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { ContentManagementService } from '../../common/services/content-management.service';
|
||||
import { PageComponent } from '../page.component';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AcaState } from '../../store/states/app.state';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
|
||||
@Component({
|
||||
templateUrl: './trashcan.component.html'
|
||||
@ -39,7 +39,7 @@ export class TrashcanComponent extends PageComponent implements OnInit {
|
||||
|
||||
constructor(private contentManagementService: ContentManagementService,
|
||||
preferences: UserPreferencesService,
|
||||
store: Store<AcaState>,
|
||||
store: Store<AppStore>,
|
||||
router: Router,
|
||||
route: ActivatedRoute) {
|
||||
super(preferences, router, route, store);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { createSelector } from '@ngrx/store';
|
||||
import { AcaState, AppState } from '../states/app.state';
|
||||
import { AppStore, AppState } from '../states/app.state';
|
||||
|
||||
export const selectApp = (state: AcaState) => state.app;
|
||||
export const selectApp = (state: AppStore) => state.app;
|
||||
export const selectHeaderColor = createSelector(selectApp, (state: AppState) => state.headerColor);
|
||||
export const selectAppName = createSelector(selectApp, (state: AppState) => state.appName);
|
||||
export const selectLogoPath = createSelector(selectApp, (state: AppState) => state.logoPath);
|
||||
|
@ -14,10 +14,10 @@ export const INITIAL_APP_STATE: AppState = {
|
||||
selectedNodes: []
|
||||
};
|
||||
|
||||
export interface AcaState {
|
||||
export interface AppStore {
|
||||
app: AppState;
|
||||
}
|
||||
|
||||
export const INITIAL_STATE: AcaState = {
|
||||
export const INITIAL_STATE: AppStore = {
|
||||
app: INITIAL_APP_STATE
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user