Skip to content

Commit 566abc3

Browse files
committed
Make other component nodes non expandable in app explorer tree
Signed-off-by: Denis Golovin dgolovin@redhat.com
1 parent 8afd93e commit 566abc3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/odo.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,19 +267,19 @@ export class OpenShiftComponent extends OpenShiftObjectImpl {
267267
contextValue: ContextType,
268268
contextPath: Uri = undefined,
269269
compType: string = undefined) {
270-
super(parent, name, contextValue, '', Collapsed, contextPath, compType);
270+
super(parent, name, contextValue, '', compType === NotAvailable? TreeItemCollapsibleState.None : Collapsed, contextPath, compType);
271271
}
272272

273273
isOdoManaged(): boolean {
274-
return this.compType === NotAvailable;
274+
return this.compType !== NotAvailable;
275275
}
276276

277277
get iconPath(): Uri {
278278
return Uri.file(path.join(__dirname, '../../images/component', 'workspace.png'));
279279
}
280280

281281
getChildren(): Promise<OpenShiftObject[]> {
282-
return this.contextValue === ContextType.COMPONENT_NO_CONTEXT ? Promise.resolve(<OpenShiftObject[]>[]) : this.odo.getComponentChildren(this);
282+
return this.contextValue === ContextType.COMPONENT_NO_CONTEXT || !this.isOdoManaged() ? Promise.resolve(<OpenShiftObject[]>[]) : this.odo.getComponentChildren(this);
283283
}
284284

285285
get tooltip(): string {
@@ -949,9 +949,6 @@ export class OdoImpl implements Odo {
949949
}
950950

951951
public async createService(application: OpenShiftObject, formData: any): Promise<OpenShiftObject> {
952-
// await this.execute(Command.createService(application.getParent().getName(), application.getName(), templateName, planName, name.trim()), Platform.getUserHomePath());
953-
// await this.createApplication(application);
954-
// return this.insertAndReveal(new OpenShiftService(application, name));
955952
formData.metadata.labels = {
956953
app: application.getName(),
957954
'app.kubernetes.io/part-of': application.getName()

0 commit comments

Comments
 (0)