diff --git a/app/guid-node/links/controller.ts b/app/guid-node/links/controller.ts index ffb123a27c..c6d8469294 100644 --- a/app/guid-node/links/controller.ts +++ b/app/guid-node/links/controller.ts @@ -5,4 +5,8 @@ export default class GuidNodeLinksController extends Controller { get currentUserCanEdit() { return this.model.node.currentUserPermissions.includes(Permission.Write); } + + get shouldShowEmptyPage() { + return this.model.configuredLinkAddons.every((item: { targetUrl: string | null }) => item.targetUrl === null); + } } diff --git a/app/guid-node/links/template.hbs b/app/guid-node/links/template.hbs index bfacda06ee..86da9ebb2f 100644 --- a/app/guid-node/links/template.hbs +++ b/app/guid-node/links/template.hbs @@ -1,6 +1,11 @@

{{t 'links.linked-services'}}

- {{#if this.model.configuredLinkAddons}} + {{#if this.shouldShowEmptyPage}} +

{{t 'links.empty-screen-message'}}

+ {{#if this.currentUserCanEdit}} +

{{t 'links.point-to-addons-message'}} {{t 'addons.heading'}}

+ {{/if}} + {{else}} @@ -25,23 +30,20 @@ {{#each this.model.configuredLinkAddons as |configuredLinkAddon|}} - - - - - - + {{#if configuredLinkAddon.targetUrl}} + + + + + + + {{/if}} {{/each}}
- {{t - {{configuredLinkAddon.externalLinkService.displayName}} - {{configuredLinkAddon.displayName}}{{configuredLinkAddon.resourceType}}{{t 'links.link'}}
+ {{t + {{configuredLinkAddon.externalLinkService.displayName}} + {{configuredLinkAddon.displayName}}{{configuredLinkAddon.resourceType}}{{t 'links.link'}}
- {{else}} -

{{t 'links.empty-screen-message'}}

- {{#if this.currentUserCanEdit}} -

{{t 'links.point-to-addons-message'}} {{t 'addons.heading'}}

- {{/if}} {{/if}}