From c6cae392e2378d6eb3b9068f00d242a08329eba8 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Sat, 9 Jun 2018 08:11:45 +0100 Subject: [PATCH] minor refactoring, rename AcaState to AppStore rename main store to a more traditional name --- src/app/app.component.ts | 4 ++-- src/app/components/favorites/favorites.component.ts | 4 ++-- src/app/components/files/files.component.ts | 4 ++-- src/app/components/header/header.component.spec.ts | 4 ++-- src/app/components/header/header.component.ts | 4 ++-- src/app/components/libraries/libraries.component.ts | 4 ++-- src/app/components/page.component.ts | 4 ++-- src/app/components/recent-files/recent-files.component.ts | 4 ++-- src/app/components/shared-files/shared-files.component.ts | 4 ++-- src/app/components/trashcan/trashcan.component.ts | 4 ++-- src/app/store/selectors/app.selectors.ts | 4 ++-- src/app/store/states/app.state.ts | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f2846ea89..1b73c984d 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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, + private store: Store, private config: AppConfigService, private electronService: ElectronService, private uploadService: UploadService) { diff --git a/src/app/components/favorites/favorites.component.ts b/src/app/components/favorites/favorites.component.ts index 83e302e6b..e2083f774 100644 --- a/src/app/components/favorites/favorites.component.ts +++ b/src/app/components/favorites/favorites.component.ts @@ -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, + store: Store, private nodesApi: NodesApiService, private contentService: ContentService, private content: ContentManagementService, diff --git a/src/app/components/files/files.component.ts b/src/app/components/files/files.component.ts index 9973f0ef2..b1cd8e1ec 100644 --- a/src/app/components/files/files.component.ts +++ b/src/app/components/files/files.component.ts @@ -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, + store: Store, private nodesApi: NodesApiService, private nodeActionsService: NodeActionsService, private uploadService: UploadService, diff --git a/src/app/components/header/header.component.spec.ts b/src/app/components/header/header.component.spec.ts index 66347206e..d21790274 100644 --- a/src/app/components/header/header.component.spec.ts +++ b/src/app/components/header/header.component.spec.ts @@ -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; let component: HeaderComponent; let appConfigService: AppConfigService; - let store: Store; + let store: Store; beforeEach(() => { TestBed.configureTestingModule({ diff --git a/src/app/components/header/header.component.ts b/src/app/components/header/header.component.ts index 7ef397765..2c121e61a 100644 --- a/src/app/components/header/header.component.ts +++ b/src/app/components/header/header.component.ts @@ -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; logo$: Observable; - constructor(store: Store) { + constructor(store: Store) { this.headerColor$ = store.select(selectHeaderColor); this.appName$ = store.select(selectAppName); this.logo$ = store.select(selectLogoPath); diff --git a/src/app/components/libraries/libraries.component.ts b/src/app/components/libraries/libraries.component.ts index a34c0215d..098ac4ceb 100644 --- a/src/app/components/libraries/libraries.component.ts +++ b/src/app/components/libraries/libraries.component.ts @@ -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, + store: Store, router: Router, preferences: UserPreferencesService) { super(preferences, router, route, store); diff --git a/src/app/components/page.component.ts b/src/app/components/page.component.ts index 296c4a478..78a9afbbf 100644 --- a/src/app/components/page.component.ts +++ b/src/app/components/page.component.ts @@ -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) { + protected store: Store) { } ngOnInit() { diff --git a/src/app/components/recent-files/recent-files.component.ts b/src/app/components/recent-files/recent-files.component.ts index f74895f80..32a5a1038 100644 --- a/src/app/components/recent-files/recent-files.component.ts +++ b/src/app/components/recent-files/recent-files.component.ts @@ -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, + store: Store, private content: ContentManagementService, public permission: NodePermissionService, preferences: UserPreferencesService) { diff --git a/src/app/components/shared-files/shared-files.component.ts b/src/app/components/shared-files/shared-files.component.ts index e23806878..eb3ea2074 100644 --- a/src/app/components/shared-files/shared-files.component.ts +++ b/src/app/components/shared-files/shared-files.component.ts @@ -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, + store: Store, private content: ContentManagementService, private apiService: AlfrescoApiService, public permission: NodePermissionService, diff --git a/src/app/components/trashcan/trashcan.component.ts b/src/app/components/trashcan/trashcan.component.ts index 37ccdbf5b..efea722aa 100644 --- a/src/app/components/trashcan/trashcan.component.ts +++ b/src/app/components/trashcan/trashcan.component.ts @@ -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, + store: Store, router: Router, route: ActivatedRoute) { super(preferences, router, route, store); diff --git a/src/app/store/selectors/app.selectors.ts b/src/app/store/selectors/app.selectors.ts index d49588766..46dd9ca17 100644 --- a/src/app/store/selectors/app.selectors.ts +++ b/src/app/store/selectors/app.selectors.ts @@ -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); diff --git a/src/app/store/states/app.state.ts b/src/app/store/states/app.state.ts index 370e2c78e..7b91766be 100644 --- a/src/app/store/states/app.state.ts +++ b/src/app/store/states/app.state.ts @@ -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 };