Tag cluster & workspace as beta features in extension api (#1589)

* mark cluster & workspace as beta

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* back to public

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2020-12-07 13:38:40 +02:00
1 parent d3026d4dd0
commit 8f27559053
5 files changed
+253 -26

No files matched your search

+23 -2
View File
@@ -26,6 +26,11 @@ export interface WorkspaceState {
enabled: boolean;
}
/**
* Workspace
*
* @beta
*/
export class Workspace implements WorkspaceModel, WorkspaceState {
/**
* Unique id for workspace
@@ -78,23 +83,39 @@ export class Workspace implements WorkspaceModel, WorkspaceState {
}
}
/**
* Is workspace managed by an extension
*/
get isManaged(): boolean {
return !!this.ownerRef;
}
/**
* Get workspace state
*
*/
getState(): WorkspaceState {
return toJS({
enabled: this.enabled
});
}
/**
* Push state
*
* @interal
* @param state workspace state
*/
pushState(state = this.getState()) {
logger.silly("[WORKSPACE] pushing state", {...state, id: this.id});
broadcastMessage("workspace:state", this.id, toJS(state));
}
@action
setState(state: WorkspaceState) {
/**
*
* @param state workspace state
*/
@action setState(state: WorkspaceState) {
Object.assign(this, state);
}