<!--
  #%L
  thinkbig-ui-feed-manager
  %%
  Copyright (C) 2017 ThinkBig Analytics
  %%
  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.
  #L%
  -->
<card-layout body-css="md-padding">
    <header-section>
        <div layout="row" layout-align="space-between-center" flex>
            <div class="card-title" flex>Business Properties</div>
            <h2 class="card-sub-header">{{vm.stepNumber}} of {{vm.totalSteps}}</h2>
        </div>
        <div layout="row" layout-align="space-between-center" flex class="layout-padding-top">
            <div class="card-sub-header" flex>Provide additional business metadata</div>
            <thinkbig-feed-errors-card-header></thinkbig-feed-errors-card-header>
        </div>
    </header-section>
    <body-section>
        <md-input-container class="md-block" flex-gt-sm>
            <label>Data Owner</label>
            <input ng-model="vm.model.dataOwner">
            </input>
        </md-input-container>
      <thinkbig-property-list-editor properties="vm.model.userProperties" is-valid="vm.isValid"></thinkbig-property-list-editor>

        <md-input-container class="md-block layout-padding-top-bottom flex-gt-sm" flex-gt-sm="" style="">
            <label class="label-small md-container-ignore">Tags</label>
            <md-chips ng-model="vm.model.tags" md-autocomplete-snap md-transform-chip="vm.transformChip($chip)" md-require-match="false">
                <md-autocomplete md-selected-item="vm.tagChips.selectedItem" md-search-text="vm.tagChips.searchText" md-items="item in vm.feedTagService.querySearch(vm.tagChips.searchText)"
                                 md-item-text="item.name" placeholder="Add tag(s)">
                    <span md-highlight-text="vm.tagChips.searchText">{{item.name}}</span>
                </md-autocomplete>
                <md-chip-template>
                    <span>
                        <strong>{{$chip.name}}</strong>
                    </span>
                </md-chip-template>
            </md-chips>
        </md-input-container>

        <md-input-container class="md-block layout-padding-top-bottom flex-gt-sm condensed" flex-gt-sm="" style="" ng-if="vm.securityGroupsEnabled == true">
            <label class="label-small md-container-ignore">Hadoop Security Groups</label>
            <md-chips ng-model="vm.model.securityGroups" md-autocomplete-snap
                      md-transform-chip="vm.transformChip($chip)"
                      md-require-match="true" class="layout-padding-top-bottom">
                <md-autocomplete
                    md-min-length="0"
                    md-selected-item="vm.securityGroupChips.selectedItem"
                    md-search-text="vm.securityGroupChips.searchText"
                    md-items="item in vm.feedSecurityGroups.querySearch(vm.securityGroupChips.searchText)"
                    md-item-text="item.name"
                    md-no-cache="true"
                    placeholder="Add a Hadoop Security Group">
                    <span md-highlight-text="vm.securityGroupChips.searchText">{{item.name}}</span>
                </md-autocomplete>
                <md-chip-template>
                            <span>
                              <strong>{{$chip.name}}</strong>
                            </span>
                </md-chip-template>
            </md-chips>
        </md-input-container>


        <thinkbig-step-buttons can-continue="vm.isValid" step-index="{{::vm.stepIndex}}"></thinkbig-step-buttons>
    </body-section>
</card-layout>
