OpenProject is the leading open source project management software.
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.
openproject/frontend/legacy/app/services/plugin-context.service.ts

18 lines
606 B

// Need to re-use this from typings of the actual context if at all possible
import {openprojectLegacyModule} from "core-app/openproject-legacy-app";
import {IPluginContext} from "../../typings/open-project-legacy.typings";
export class PluginContextService {
public context?:IPluginContext;
constructor() {
window.OpenProject.getPluginContext().then((context:IPluginContext) => this.context = context!);
}
public getContext():Promise<IPluginContext> {
return (window as any).OpenProject.getPluginContext();
}
}
openprojectLegacyModule.service('pluginContext', PluginContextService);