1 import {Plugin, IUserProperties} from "app/models";
2 import {CacheService} from "app/services";
3 import {PluginsService} from "../../../../ng2/services/plugins.service";
4 import {IWorkspaceViewModelScope} from "../../workspace-view-model";
7 interface IPluginsContextViewModelScope extends IWorkspaceViewModelScope {
13 export class PluginsContextViewModel {
17 'Sdc.Services.CacheService',
21 constructor(private $scope:IPluginsContextViewModelScope,
22 private $stateParams:any,
23 private cacheService:CacheService,
24 private pluginsService:PluginsService) {
29 private initScope = ():void => {
30 this.$scope.plugin = this.pluginsService.getPluginByStateUrl(this.$stateParams.path);
32 this.$scope.user = this.cacheService.get('user');
34 this.$scope.queryParams = {
35 userId: this.$scope.user.userId,
36 userRole: this.$scope.user.role,
37 displayType: "context",
38 contextType: this.$scope.component.getComponentSubType(),
39 uuid: this.$scope.component.uuid,
40 lifecycleState: this.$scope.component.lifecycleState,
41 isOwner: this.$scope.component.lastUpdaterUserId === this.$scope.user.userId