<!--
  Licensed to the Apache Software
	Foundation (ASF) under one or more contributor license agreements. See the
	NOTICE file distributed with this work for additional information regarding
	copyright ownership. The ASF licenses this file to You 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.
  -->
<metron-config-sensor-rule-editor *ngIf="showTextEditor" [riskLevelRule]="currentRiskLevelRule"
                                  (onCancelTextEditor)="onCancelTextEditor()"
                                  (onSubmitTextEditor)="onSubmitTextEditor($event)"></metron-config-sensor-rule-editor>

<div class="metron-slider-pane-edit fill load-left-to-right dialog1x">

    <div class="form-title">Threat Triage Rules</div>
    <i class="fa fa-times float-right close-button" aria-hidden="true" (click)="onClose()"></i>


    <form role="form" class="threat-intel-form">
        <div class="form-group threat-triage-aggregator">
            <label attr.for="aggregator">AGGREGATOR</label>
            <select class="form-control" name="aggregator"
                    [(ngModel)]="sensorEnrichmentConfig.threatIntel.triageConfig.aggregator">
                <option *ngFor="let aggregator of availableAggregators" [value]="aggregator">{{aggregator}}</option>
            </select>
        </div>
        <div class="threat-triage-summary">
            <div class="form-group">
                <div class="rules-summary-title">Rules</div>
            </div>
        </div>
        <div class="form-group threat-triage-rules-list">
            <div class="threat-triage-rule" *ngFor="let riskLevelRule of this.visibleRules">
                <div class="row mx-0 py-0 threat-triage-rule-wrapper">
                    <div class="threat-triage-rule-row" style="font-size: small;" [title]="riskLevelRule.score">
                        {{ riskLevelRule.score }}
                    </div>
                    <div class="threat-triage-rule-row threat-triage-rule-str" [title]="getDisplayName(riskLevelRule)">
                        {{ getDisplayName(riskLevelRule) }}
                    </div>
                    <div class="threat-triage-rule-row" style="">
                        <i class="fa fa-i-cursor" aria-hidden="true" (click)="onEditRule(riskLevelRule)"></i>
                        <i class="fa fa-trash-o" aria-hidden="true" (click)="onDeleteRule(riskLevelRule)"></i>
                    </div>
                </div>
                <div class="form-seperator-edit"></div>
            </div>
        </div>
        <div class="form-group mx-0 py-0">
            <button class="btn form-enable-disable-button add-button" (click)="onNewRule()"><i
                    aria-hidden="true" class="fa fa-plus fa-4"></i></button>
        </div>
    </form>

</div>
