<Route
  @name={{routeName}}
as |route|>
  <EventSource @src={{topology}} />
  <div class="tab-section">
    {{#if (and (eq topology.Upstreams.length 0) (eq topology.Downstreams.length 0) (not topology.DefaultAllow) (not topology.WildcardIntention))}}
      <EmptyState>
        <BlockSlot @name="header">
          <h2>
            No dependencies
          </h2>
        </BlockSlot>
        <BlockSlot @name="body">
          <p>
            This service has neither downstreams nor upstreams, which means that no services are configured to connect with it. Add upstreams and intentions to ensure this service is connected with the rest of your service mesh.
          </p>
        </BlockSlot>
        <BlockSlot @name="actions">
          <li class="docs-link">
            <a href="{{env 'CONSUL_DOCS_URL'}}/connect/registration/service-registration#complete-configuration-example" rel="noopener noreferrer" target="_blank">Documentation on upstreams</a>
          </li>
        </BlockSlot>
      </EmptyState>
    {{else}}
    {{#if topology.collapsible}}
      <CollapsibleNotices>
        {{#if topology.FilteredByACLs}}
          <TopologyMetrics::Notice
            data-test-notice='filtered-by-acls'
            @type="info"
            @for="limited-access"
            @action={{false}}
          />
        {{/if}}
        {{#if topology.DefaultAllow}}
          <TopologyMetrics::Notice
            data-test-notice='default-allow'
            @type="warning"
            @for="default-allow"
            @internal={{true}}
            @action={{true}}
          />
        {{/if}}
        {{#if topology.WildcardIntention}}
          <TopologyMetrics::Notice
            data-test-notice='wildcard-intention'
            @type="warning"
            @for="wildcard-intention"
            @internal={{true}}
            @action={{true}}
          />
        {{/if}}
        {{#if topology.notDefinedIntention}}
          <TopologyMetrics::Notice
            data-test-notice='not-defined-intention'
            @type="warning"
            @for="not-defined-intention"
            @link="{{env 'CONSUL_DOCS_URL'}}/connect/registration/service-registration#upstreams"
            @internal={{false}}
            @action={{true}}
          />
        {{/if}}
      </CollapsibleNotices>
    {{else}}
      {{#if topology.FilteredByACLs}}
          <TopologyMetrics::Notice
            data-test-notice='filtered-by-acls'
            @type="info"
            @for="limited-access"
            @action={{false}}
          />
        {{/if}}
        {{#if topology.DefaultAllow}}
          <TopologyMetrics::Notice
            data-test-notice='default-allow'
            @type="warning"
            @for="default-allow"
            @internal={{true}}
            @action={{true}}
          />
        {{/if}}
        {{#if topology.WildcardIntention}}
          <TopologyMetrics::Notice
            data-test-notice='wildcard-intention'
            @type="warning"
            @for="wildcard-intention"
            @internal={{true}}
            @action={{true}}
          />
        {{/if}}
        {{#if topology.notDefinedIntention}}
          <TopologyMetrics::Notice
            data-test-notice='not-defined-intention'
            @type="warning"
            @for="not-defined-intention"
            @link="{{env 'CONSUL_DOCS_URL'}}/connect/registration/service-registration#upstreams"
            @internal={{false}}
            @action={{true}}
          />
        {{/if}}
    {{/if}}


      <TopologyMetrics
        @nspace={{nspace}}
        @dc={{dc.Name}}
        @service={{items.firstObject}}
        @topology={{topology}}
        @metricsHref={{render-template urls.service
          (hash
            Datacenter=dc.Name
            Service=(hash
              Name=items.firstObject.Name
              Namespace=(or items.firstObject.Namespace '')
            )
          )
        }}
        @isRemoteDC={{not dc.Local}}
        @hasMetricsProvider={{hasMetricsProvider}}
        @oncreate={{route-action 'createIntention'}}
      />
    {{/if}}
  </div>
</Route>
