mirror of https://github.com/abpframework/abp
Feature/state services (#1939)
* feat(core): add profile-state service * feat(core): add session-state service * feat(feature-management): add feature-management-state service * feat(identity): add identity-state service * feat(permission-management): add permission-management-state service * feat(tenant-management): add tenant-management-state service * feat(theme-basic): add layout-state servicepull/1940/head
parent
bbd0c2e385
commit
3cc0e0f9c2
@ -1,6 +1,8 @@
|
||||
export * from './application-configuration.service';
|
||||
export * from './config.service';
|
||||
export * from './config-state.service';
|
||||
export * from './lazy-load.service';
|
||||
export * from './localization.service';
|
||||
export * from './profile.service';
|
||||
export * from './rest.service';
|
||||
export * from './profile-state.service';
|
||||
export * from './session-state.service';
|
||||
|
@ -0,0 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngxs/store';
|
||||
import { ProfileState } from '../states';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ProfileStateService {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
getProfile() {
|
||||
return this.store.selectSnapshot(ProfileState.getProfile);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngxs/store';
|
||||
import { SessionState } from '../states';
|
||||
|
||||
@Injectable()
|
||||
export class SessionStateService {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
getLanguage() {
|
||||
return this.store.selectSnapshot(SessionState.getLanguage);
|
||||
}
|
||||
|
||||
getTenant() {
|
||||
return this.store.selectSnapshot(SessionState.getTenant);
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngxs/store';
|
||||
import { FeatureManagementState } from '../states';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class FeatureManagementStateService {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
getFeatures() {
|
||||
return this.store.selectSnapshot(FeatureManagementState.getFeatures);
|
||||
}
|
||||
}
|
@ -1 +1,2 @@
|
||||
export * from './feature-management.service';
|
||||
export * from './feature-management-state.service';
|
||||
|
@ -0,0 +1,23 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngxs/store';
|
||||
import { IdentityState } from '../states/identity.state';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class IdentityStateService {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
getRoles() {
|
||||
return this.store.selectSnapshot(IdentityState.getRoles);
|
||||
}
|
||||
getRolesTotalCount() {
|
||||
return this.store.selectSnapshot(IdentityState.getRolesTotalCount);
|
||||
}
|
||||
getUsers() {
|
||||
return this.store.selectSnapshot(IdentityState.getUsers);
|
||||
}
|
||||
getUsersTotalCount() {
|
||||
return this.store.selectSnapshot(IdentityState.getUsersTotalCount);
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
export * from './identity.service';
|
||||
export * from './identity-state.service';
|
@ -1 +1,2 @@
|
||||
export * from './permission-management.service';
|
||||
export * from './permission-management-state.service';
|
||||
|
@ -0,0 +1,17 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngxs/store';
|
||||
import { PermissionManagementState } from '../states/permission-management.state';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PermissionManagementStateService {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
getPermissionGroups() {
|
||||
return this.store.selectSnapshot(PermissionManagementState.getPermissionGroups);
|
||||
}
|
||||
getEntityDisplayName() {
|
||||
return this.store.selectSnapshot(PermissionManagementState.getPermissionGroups);
|
||||
}
|
||||
}
|
@ -1 +1,2 @@
|
||||
export * from './tenant-management.service';
|
||||
export * from './tenant-management-state.service';
|
||||
|
@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngxs/store';
|
||||
import { TenantManagementState } from '../states/tenant-management.state';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TenantManagementStateService {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
getTenants() {
|
||||
return this.store.selectSnapshot(TenantManagementState.get);
|
||||
}
|
||||
|
||||
getTenantsTotalCount() {
|
||||
return this.store.selectSnapshot(TenantManagementState.getTenantsTotalCount);
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
export * from './initial.service';
|
||||
export * from './layout-state.service';
|
@ -0,0 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngxs/store';
|
||||
import { LayoutState } from '../states/layout.state';
|
||||
|
||||
@Injectable()
|
||||
export class LayoutStateService {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
getNavigationElements() {
|
||||
return this.store.selectSnapshot(LayoutState.getNavigationElements);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue