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