mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
7.9 KiB
119 lines
7.9 KiB
/**
|
|
* @fileoverview added by tsickle
|
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
*/
|
|
import * as tslib_1 from "tslib";
|
|
import { State, Action, Selector } from '@ngxs/store';
|
|
import { GetPermissions, UpdatePermissions } from '../actions/permission-management.actions';
|
|
import { PermissionManagementService } from '../services/permission-management.service';
|
|
import { tap } from 'rxjs/operators';
|
|
var PermissionManagementState = /** @class */ (function () {
|
|
function PermissionManagementState(permissionManagementService) {
|
|
this.permissionManagementService = permissionManagementService;
|
|
}
|
|
/**
|
|
* @param {?} __0
|
|
* @return {?}
|
|
*/
|
|
PermissionManagementState.getPermissionGroups = /**
|
|
* @param {?} __0
|
|
* @return {?}
|
|
*/
|
|
function (_a) {
|
|
var permissionRes = _a.permissionRes;
|
|
return permissionRes.groups || [];
|
|
};
|
|
/**
|
|
* @param {?} __0
|
|
* @return {?}
|
|
*/
|
|
PermissionManagementState.getEntitiyDisplayName = /**
|
|
* @param {?} __0
|
|
* @return {?}
|
|
*/
|
|
function (_a) {
|
|
var permissionRes = _a.permissionRes;
|
|
return permissionRes.entityDisplayName;
|
|
};
|
|
/**
|
|
* @param {?} __0
|
|
* @param {?} __1
|
|
* @return {?}
|
|
*/
|
|
PermissionManagementState.prototype.permissionManagementGet = /**
|
|
* @param {?} __0
|
|
* @param {?} __1
|
|
* @return {?}
|
|
*/
|
|
function (_a, _b) {
|
|
var patchState = _a.patchState;
|
|
var payload = _b.payload;
|
|
return this.permissionManagementService.getPermissions(payload).pipe(tap((/**
|
|
* @param {?} permissionResponse
|
|
* @return {?}
|
|
*/
|
|
function (permissionResponse) {
|
|
return patchState({
|
|
permissionRes: permissionResponse,
|
|
});
|
|
})));
|
|
};
|
|
/**
|
|
* @param {?} _
|
|
* @param {?} __1
|
|
* @return {?}
|
|
*/
|
|
PermissionManagementState.prototype.permissionManagementUpdate = /**
|
|
* @param {?} _
|
|
* @param {?} __1
|
|
* @return {?}
|
|
*/
|
|
function (_, _a) {
|
|
var payload = _a.payload;
|
|
return this.permissionManagementService.updatePermissions(payload);
|
|
};
|
|
PermissionManagementState.ctorParameters = function () { return [
|
|
{ type: PermissionManagementService }
|
|
]; };
|
|
tslib_1.__decorate([
|
|
Action(GetPermissions),
|
|
tslib_1.__metadata("design:type", Function),
|
|
tslib_1.__metadata("design:paramtypes", [Object, GetPermissions]),
|
|
tslib_1.__metadata("design:returntype", void 0)
|
|
], PermissionManagementState.prototype, "permissionManagementGet", null);
|
|
tslib_1.__decorate([
|
|
Action(UpdatePermissions),
|
|
tslib_1.__metadata("design:type", Function),
|
|
tslib_1.__metadata("design:paramtypes", [Object, UpdatePermissions]),
|
|
tslib_1.__metadata("design:returntype", void 0)
|
|
], PermissionManagementState.prototype, "permissionManagementUpdate", null);
|
|
tslib_1.__decorate([
|
|
Selector(),
|
|
tslib_1.__metadata("design:type", Function),
|
|
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
tslib_1.__metadata("design:returntype", void 0)
|
|
], PermissionManagementState, "getPermissionGroups", null);
|
|
tslib_1.__decorate([
|
|
Selector(),
|
|
tslib_1.__metadata("design:type", Function),
|
|
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
tslib_1.__metadata("design:returntype", String)
|
|
], PermissionManagementState, "getEntitiyDisplayName", null);
|
|
PermissionManagementState = tslib_1.__decorate([
|
|
State({
|
|
name: 'PermissionManagementState',
|
|
defaults: (/** @type {?} */ ({ permissionRes: {} })),
|
|
}),
|
|
tslib_1.__metadata("design:paramtypes", [PermissionManagementService])
|
|
], PermissionManagementState);
|
|
return PermissionManagementState;
|
|
}());
|
|
export { PermissionManagementState };
|
|
if (false) {
|
|
/**
|
|
* @type {?}
|
|
* @private
|
|
*/
|
|
PermissionManagementState.prototype.permissionManagementService;
|
|
}
|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