summaryrefslogtreecommitdiffstats
path: root/public/src/app/rule-engine/version-type-select
diff options
context:
space:
mode:
Diffstat (limited to 'public/src/app/rule-engine/version-type-select')
-rw-r--r--public/src/app/rule-engine/version-type-select/version-type-select.component.html82
-rw-r--r--public/src/app/rule-engine/version-type-select/version-type-select.component.scss18
-rw-r--r--public/src/app/rule-engine/version-type-select/version-type-select.component.ts63
3 files changed, 120 insertions, 43 deletions
diff --git a/public/src/app/rule-engine/version-type-select/version-type-select.component.html b/public/src/app/rule-engine/version-type-select/version-type-select.component.html
index 79b9eae..74c55a8 100644
--- a/public/src/app/rule-engine/version-type-select/version-type-select.component.html
+++ b/public/src/app/rule-engine/version-type-select/version-type-select.component.html
@@ -1,34 +1,64 @@
<div class="selected-event">
- <div style="flex:1; display: flex; align-items: center;">
+ <div style="flex:1; display: flex; align-items: flex-end;">
- <span class="field-label required" style="margin-right: 10px;">Mapping Target</span>
- <select name="mappingTarget" [(ngModel)]="mappingTarget" (ngModelChange)="onChangeMapping($event)" data-tests-id="mappingDdl"
- style="height: 27px; padding: 0.3rem; margin-right: 18px;" class="field-select">
- <option [ngValue]="null" disabled>Select Mapping</option>
- <option *ngFor="let target of advancedSetting" [value]="target.name" data-tests-id="templateOptions">{{target.name}}</option>
- </select>
+ <div style="display:flex; flex-direction:column; margin-right: 25px;">
+ <span class="field-label required space-down" style="margin-right: 10px;">Mapping Target</span>
+ <select name="mappingTarget" [(ngModel)]="mappingTarget" (ngModelChange)="onChangeMapping($event)" data-tests-id="mappingDdl"
+ style="height: 35px; padding: 0.3rem; border: 1px solid #d2d2d2" class="field-select">
+ <option [ngValue]="null" disabled>Select Mapping</option>
+ <optgroup label="Rules Configured">
+ <option *ngFor="let target of advancedSetting" [hidden]="!target.isExist" [value]="target.name" data-tests-id="templateOptionsExist">{{target.name}}</option>
+ </optgroup>
+ <optgroup label="No Mapping Configuration">
+ <option *ngFor="let target of advancedSetting" [hidden]="target.isExist" [value]="target.name" data-tests-id="templateOptionsNotExist">{{target.name}}</option>
+ </optgroup>
+ </select>
+ </div>
- <span class="field-label required" style="font-size: 13px; margin-right: 10px; display: flex;
- align-items: center;" [ngClass]="{'required' : !readOnly}">
- Version
- </span>
- <select *ngIf="!readOnly" style="height: 27px; padding: 0.3rem; margin-right: 18px;" [(ngModel)]="selectedVersion" (ngModelChange)="onSelectVersion($event)"
- data-tests-id="selectVersion">
- <option [ngValue]="null" disabled>Select Version</option>
- <option *ngFor="let version of versions" [value]="version" data-tests-id="option">{{version}}</option>
- </select>
- <span *ngIf="readOnly" style="height: 27px; padding: 0.3rem; width:100px; margin-right: 18px; border: 1px solid #D2D2D2; display: flex; align-items: center; background: #F2F2F2">{{selectedVersion}}</span>
+ <div style="display:flex; flex-direction:column; margin-right: 25px;">
+ <span class="field-label required space-down" style="font-size: 13px; margin-right: 10px; display: flex;
+ align-items: center;" [ngClass]="{'required' : !readOnly}">
+ Version
+ </span>
+ <select *ngIf="!readOnly" style="height: 35px; padding: 0.3rem; border: 1px solid #d2d2d2" [(ngModel)]="selectedVersion" (ngModelChange)="onSelectVersion($event)"
+ data-tests-id="selectVersion">
+ <option [ngValue]="null" disabled>Select Version</option>
+ <option *ngFor="let version of versions" [value]="version" data-tests-id="option">{{version}}</option>
+ </select>
+ <span *ngIf="readOnly" style="height: 35px; padding: 0.3rem; width:100px; border: 1px solid #D2D2D2; display: flex; align-items: center; background: #F2F2F2">{{selectedVersion}}</span>
+ </div>
- <span class="field-label required" style="font-size: 13px; display: flex; align-items: center; width: 100px;" [ngClass]="{'required' : !readOnly}">
- Event Domain
- </span>
- <select *ngIf="!readOnly" style="height: 27px; padding: 0.3rem;" [(ngModel)]="selectedEvent" (ngModelChange)="onSelectEventType($event)"
- data-tests-id="selectEventType">
- <option [ngValue]="null" disabled>Select Type</option>
- <option *ngFor="let event of events" [value]="event" data-tests-id="option">{{event | slice:0:event.length-6}}</option>
- </select>
- <span *ngIf="readOnly" style="height: 27px; padding: 0.3rem; width:200px; border: 1px solid #D2D2D2; display: flex; align-items: center; background: #F2F2F2">{{selectedEvent | slice:0:selectedEvent.length-6}}</span>
+ <div style="display:flex; flex-direction:column; margin-right: 25px;">
+ <span class="field-label required space-down" style="font-size: 13px; display: flex; align-items: center; width: 100px;"
+ [ngClass]="{'required' : !readOnly}">
+ Event Domain
+ </span>
+ <select *ngIf="!readOnly" style="height: 35px; padding: 0.3rem; border: 1px solid #d2d2d2" [(ngModel)]="selectedEvent" (ngModelChange)="onSelectEventType($event)"
+ data-tests-id="selectEventType">
+ <option [ngValue]="null" disabled>Select Type</option>
+ <option *ngFor="let event of events" [value]="event" data-tests-id="option">{{event | slice:0:event.length-6}}</option>
+ </select>
+ <span *ngIf="readOnly" style="height: 35px; padding: 0.3rem; width:200px; border: 1px solid #D2D2D2; display: flex; align-items: center; background: #F2F2F2">{{selectedEvent | slice:0:selectedEvent.length-6}}</span>
+ </div>
+
+ <div class="notifyId" style="display: flex; flex-direction:column; margin-right:25px;">
+ <div class="pretty p-svg space-down">
+ <input type="checkbox" name="notifyIdCheckbox" data-tests-id="notifyIdCheckbox" [checked]="notifyIdCheckbox" (change)="changeNotifyId()"
+ />
+ <div class="state">
+ <!-- svg path -->
+ <svg class="svg svg-icon" viewBox="0 0 20 20">
+ <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z"
+ style="stroke: #009fdb; fill:#009fdb;"></path>
+ </svg>
+ <label style="margin-left: 5px;">Notify OID</label>
+ </div>
+ </div>
+ <div *ngIf="notifyIdCheckbox" class="input-wrapper">
+ <input type="text" ngModel required name="defaultInput" data-tests-id="defaultInput" [(ngModel)]="store.notifyIdValue" class="input">
+ </div>
+ </div>
</div>
</div>
diff --git a/public/src/app/rule-engine/version-type-select/version-type-select.component.scss b/public/src/app/rule-engine/version-type-select/version-type-select.component.scss
index 9f7bad3..1be996e 100644
--- a/public/src/app/rule-engine/version-type-select/version-type-select.component.scss
+++ b/public/src/app/rule-engine/version-type-select/version-type-select.component.scss
@@ -1,7 +1,6 @@
.selected-event {
display: flex;
- margin: 10px 0;
- // align-items: center;
+ // margin: 10px 0; // align-items: center;
flex-direction: column;
margin-bottom: 30px;
}
@@ -23,6 +22,20 @@
outline: none;
}
+.space-down {
+ margin-bottom: 5px;
+}
+
+.input-wrapper {
+ .input {
+ height: 35px;
+ border-radius: 2px;
+ padding: 5px;
+ width: 100%;
+ border: 1px solid #d2d2d2;
+ }
+}
+
.target-field {
width: 370px;
display: flex;
@@ -42,5 +55,6 @@
min-width: 250px;
padding: 5px 0 5px 5px;
margin: 0;
+ border: 1px solid #d2d2d2;
}
}
diff --git a/public/src/app/rule-engine/version-type-select/version-type-select.component.ts b/public/src/app/rule-engine/version-type-select/version-type-select.component.ts
index b4170a5..ff229cd 100644
--- a/public/src/app/rule-engine/version-type-select/version-type-select.component.ts
+++ b/public/src/app/rule-engine/version-type-select/version-type-select.component.ts
@@ -1,6 +1,6 @@
-import { Component, Output, EventEmitter, Input } from '@angular/core';
-import { RuleEngineApiService } from '../api/rule-engine-api.service';
+import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Store } from '../../store/store';
+import { RuleEngineApiService } from '../api/rule-engine-api.service';
@Component({
selector: 'app-version-type-select',
@@ -19,25 +19,60 @@ export class VersionTypeSelectComponent {
@Input() metaData;
@Output() nodesUpdated = new EventEmitter();
@Output() refrashRuleList = new EventEmitter();
- advancedSetting;
+ advancedSetting: Array<any>;
+ notifyIdCheckbox = false;
constructor(private _ruleApi: RuleEngineApiService, public store: Store) {
this.selectedVersion = null;
this.selectedEvent = null;
// set ddl with the first option value.
- this.mappingTarget = this.store.configurationForm[0].name;
- this.advancedSetting = this.store.configurationForm.filter(item => {
- if (
- !(
- item.hasOwnProperty('constraints') &&
- !item.assignment.value.includes('get_input')
- )
- ) {
- return item;
+
+ this._ruleApi.tabIndex.subscribe(index => {
+ console.log('rule index:', index);
+
+ const tabName = this.store.cdump.nodes[index].name;
+ console.log('tab name:', tabName);
+
+ if (tabName.toLowerCase().includes('map')) {
+ this.mappingTarget = this.store.tabsProperties[index][0].name;
+ this.advancedSetting = this.store.tabsProperties[index].filter(item => {
+ if (
+ !(
+ item.hasOwnProperty('constraints') &&
+ !item.value.includes('get_input')
+ )
+ ) {
+ return item;
+ }
+ });
+
+ this._ruleApi
+ .generateMappingRulesFileName(
+ this.store.ruleListExistParams.nodeName,
+ this.store.ruleListExistParams.nodeId,
+ this.store.ruleListExistParams.vfcmtUuid
+ )
+ .subscribe(response => {
+ console.log('generateMappingRulesFileName response: ', response);
+ this.advancedSetting.forEach(element => {
+ if (response.includes(element.name)) {
+ element.isExist = true;
+ } else {
+ element.isExist = false;
+ }
+ });
+ });
}
});
}
+ changeNotifyId() {
+ if (!this.notifyIdCheckbox) {
+ this.store.notifyIdValue = '';
+ }
+ return (this.notifyIdCheckbox = !this.notifyIdCheckbox);
+ }
+
onChangeMapping(configurationKey) {
console.log('changing propertiy key:', configurationKey);
this._ruleApi.setFieldName(configurationKey);
@@ -78,9 +113,7 @@ export class VersionTypeSelectComponent {
.subscribe(tree => {
console.log('tree: ', tree);
this.loader = false;
- this.nodesUpdated.emit({
- nodes: tree
- });
+ this.nodesUpdated.emit({ nodes: tree });
});
}
}