<!--
  #%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%
  -->
<md-dialog aria-label="Feed Results"  ng-cloak>
    <form>
        <md-toolbar class="md-warn">
            <div  class="md-toolbar-tools">
                <h4  ng-if="!isValid">
                    <ng-md-icon size="24" md-icon icon="error_outline" aria-label="Error creating Feed"></ng-md-icon>
                    <span>Error creating {{feedName | characters:50}}</span>
                </h4>
                <span flex></span>
                <md-button class="md-icon-button" ng-click="cancel()">
                    <ng-md-icon md-icon icon="close" aria-label="Close dialog"></ng-md-icon>
                </md-button>
            </div>
            </md-toolbar>
        <md-dialog-content layout="column" flex style="min-width:500px;" layout-padding>
            <div ng-if="!isValid && feedErrorsData != null">
                <div class="md-subhead">{{::message}}</div>
                            <md-list class="padding-left" ng-repeat="(severity,errors)  in feedErrorsData">
                                <md-list-item class="md-2-line" ng-repeat="error in errors track by $index" >
                                    <div class="md-list-item-text" >
                                        <div ng-if="error.processorName != null && error.processorName != '' " class="md-subheader">Processor: {{::error.processorName}}</div>
                                        <div class="md-warn-text">{{::error.message}}</div>
                                    </div>
                                    <md-divider ng-if="!$last"></md-divider>
                                </md-list-item>
                            </md-list>
            </div>
        </md-dialog-content>
        <md-dialog-actions layout="row">
            <md-button class="md-warn" ng-click="fixErrors()">
               Okay
            </md-button>
        </md-dialog-actions>
    </form>
</md-dialog>
