diff --git a/dashboard/src/app/get-started/template-list/template-list.controller.ts b/dashboard/src/app/get-started/template-list/template-list.controller.ts index df3dc2ad67d..cf7e1249ea3 100644 --- a/dashboard/src/app/get-started/template-list/template-list.controller.ts +++ b/dashboard/src/app/get-started/template-list/template-list.controller.ts @@ -76,7 +76,6 @@ export class TemplateListController { this.cheNotification = cheNotification; this.devfileRegistry = devfileRegistry; this.createWorkspaceSvc = createWorkspaceSvc; - this.devfileRegistryUrl = cheWorkspace.getWorkspaceSettings().cheWorkspaceDevfileRegistryUrl; this.createButtonConfig = { mainAction: { @@ -102,10 +101,20 @@ export class TemplateListController { }] }; - this.init(); + cheWorkspace.fetchWorkspaceSettings().then(() => { + const workspaceSettings = cheWorkspace.getWorkspaceSettings(); + this.devfileRegistryUrl = workspaceSettings && workspaceSettings.cheWorkspaceDevfileRegistryUrl; + this.init(); + }); } private init(): void { + if (!this.devfileRegistryUrl) { + const message = 'Failed to load the devfile registry URL.'; + this.cheNotification.showError(message); + this.$log.error(message); + return; + } this.isLoading = true; this.devfileRegistry.fetchDevfiles(this.devfileRegistryUrl).then((devfiles: Array) => { this.devfiles = devfiles.map(devfile => { diff --git a/dashboard/src/app/get-started/template-list/template-list.html b/dashboard/src/app/get-started/template-list/template-list.html index c3261eaa1ef..a150274a706 100644 --- a/dashboard/src/app/get-started/template-list/template-list.html +++ b/dashboard/src/app/get-started/template-list/template-list.html @@ -27,8 +27,8 @@
-
Select a Template
-
Use a sample template to create your first workspace.
+
Select a Sample
+
Use a sample to create your first workspace.