<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-object-meta [initialized]="isInitialized"
                [objectMeta]="crd?.objectMeta"></kd-object-meta>

<kd-card [initialized]="isInitialized">
  <div title
       i18n>Resource Information</div>
  <div content
       id="resource-information"
       *ngIf="isInitialized"
       fxLayout="row wrap">
    <kd-property *ngIf="crd?.version">
      <div key
           i18n>Version</div>
      <div id="resource-version"
           value>{{crd?.version}}</div>
    </kd-property>
    <kd-property>
      <div key
           i18n>Scope</div>
      <div id="resource-scope"
           value>{{crd?.scope}}</div>
    </kd-property>
    <kd-property>
      <div key
           i18n>Group</div>
      <div id="resource-group"
           value>{{crd?.group}}</div>
    </kd-property>
    <kd-property *ngIf="crd.subresources.length > 0">
      <div key
           i18n>Subresources</div>
      <div value>{{crd.subresources.join(", ")}}</div>
    </kd-property>
  </div>
</kd-card>

<kd-card [initialized]="isInitialized">
  <div title
       i18n>Accepted Names</div>
  <div content
       id="accepted-names"
       *ngIf="isInitialized"
       fxLayout="row wrap">
    <kd-property>
      <div key
           i18n>Plural</div>
      <div value>{{crd?.names.plural}}</div>
    </kd-property>
    <kd-property *ngIf="crd?.names.singular">
      <div key
           i18n>Singular</div>
      <div value>{{crd?.names.singular}}</div>
    </kd-property>
    <kd-property>
      <div key
           i18n>Kind</div>
      <div value>{{crd?.names.kind}}</div>
    </kd-property>
    <kd-property>
      <div key
           i18n>List Kind</div>
      <div value>{{crd?.names.listKind}}</div>
    </kd-property>
    <kd-property *ngIf="crd?.names.shortNames">
      <div key
           i18n>Short Names</div>
      <div value>{{crd?.names.shortNames.join(", ")}}</div>
    </kd-property>
    <kd-property *ngIf="crd?.names.categories">
      <div key
           i18n>Categories</div>
      <div value>{{crd?.names.categories.join(", ")}}</div>
    </kd-property>
  </div>
</kd-card>

<kd-crd-object-list [namespaced]="isNamespaced()"></kd-crd-object-list>

<kd-crd-versions-list *ngIf="crd?.versions"
                      [versions]="crd?.versions"
                      [initialized]="isInitialized"></kd-crd-versions-list>

<kd-condition-list [conditions]="crd?.conditions"
                   [showLastProbeTime]="false"
                   [initialized]="isInitialized"></kd-condition-list>
