diff options
Diffstat (limited to 'public/src/app/rule-engine/rule-list')
3 files changed, 82 insertions, 33 deletions
diff --git a/public/src/app/rule-engine/rule-list/rule-list.component.html b/public/src/app/rule-engine/rule-list/rule-list.component.html index c68c706..4ce6efb 100644 --- a/public/src/app/rule-engine/rule-list/rule-list.component.html +++ b/public/src/app/rule-engine/rule-list/rule-list.component.html @@ -1,8 +1,8 @@ <div class="container"> <div class="header"> - <span style="font-size: 18px;">Rule Engine</span> + <span style="font-size: 18px; margin-left:20px;">Rule Engine</span> <div style="display:flex"> - <button mat-raised-button (click)="translateRules()" color="primary" [disabled]="store.ruleList.length === 0" style="margin-left: 20px;" + <button mat-raised-button (click)="translateRules()" color="primary" [disabled]="store.ruleList.length === 0" style="margin-right: 10px; width: 113px;height: 36px;" data-tests-id="btnTranslate"> Translate </button> @@ -20,6 +20,35 @@ <app-version-type-select #versionEventType [versions]="versions" [metaData]="metaData" (nodesUpdated)="handleUpdateNode($event)" (refrashRuleList)="handlePropertyChange()"></app-version-type-select> + <!-- <div class="container-phase-notify"> + <div> + <span class="field-label required" style="margin-right: 10px;"> + phase + </span> + <select name="phase" [(ngModel)]="phase" data-tests-id="phase" style="height: 27px; padding: 0.3rem; margin-right: 18px;" + class="field-select"> + <option [ngValue]="null" disabled>Select phase</option> + </select> + </div> + + <div class="default" style="display: flex; align-items: center"> + <div class="pretty p-svg"> + <input type="checkbox" name="notifyCheckbox" data-tests-id="notifyCheckbox" /> + <div class="state"> + <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>notify OID</label> + </div> + </div> + <div class="input-wrapper"> + <input type="text" ngModel required name="notify-oid" data-tests-id="notify-oid" class="input"> + </div> + </div> + + </div> --> + <div *ngIf="targetSource && store.ruleList.length === 0" style="margin: 30px 0; display: flex; align-items: center; justify-content: center; flex-direction: column;"> <div style="margin: 3em 0 2em 0;"> @@ -40,9 +69,6 @@ </div> <div *ngIf="store.ruleList.length > 0"> - <div style="padding: 10px 0;"> - Rules - </div> <div style="display: flex; align-items: center;"> <button mat-mini-fab color="primary" id="addMoreRule" data-tests-id="addMoreRule" style="height: 24px; width: 24px; display:flex" (click)="openAction()"> diff --git a/public/src/app/rule-engine/rule-list/rule-list.component.scss b/public/src/app/rule-engine/rule-list/rule-list.component.scss index c4aee05..6446fbd 100644 --- a/public/src/app/rule-engine/rule-list/rule-list.component.scss +++ b/public/src/app/rule-engine/rule-list/rule-list.component.scss @@ -4,30 +4,30 @@ height: 100%; display: flex; flex-direction: column; - + margin: 0; + padding: 0; .header { position: relative; display: flex; justify-content: space-between; align-items: center; color: #191919; - border-bottom: 2px solid #d2d2d2; - padding-bottom: 0.5rem; - margin: 1rem; + border-bottom: 1px solid #d2d2d2; + padding-bottom: 5px; + margin: 8px 0; } - .item { border: 1px solid #d2d2d2; padding: 0 10px; height: 40px; } - .mat-fab, .mat-mini-fab, .mat-raised-button { box-shadow: none; } } + .my-full-screen-dialog .mat-dialog-container { max-width: none; width: 100vw; @@ -46,7 +46,6 @@ display: flex !important; justify-content: center !important; color: #d2d2d2 !important; - &:hover { color: #009fdb !important; } @@ -68,6 +67,7 @@ .mat-mini-fab .mat-button-wrapper { padding: 0 !important; } + .mat-icon { // width: 18px; // height: 18px; @@ -75,35 +75,45 @@ justify-content: center !important; align-items: center !important; } + /* Rules for sizing the icon. */ + .material-icons.md-18 { font-size: 18px; } + .material-icons.md-24 { font-size: 24px; } + .material-icons.md-30 { font-size: 30px; } + .material-icons.md-36 { font-size: 36px; } + .material-icons.md-48 { font-size: 48px; } /* Rules for using icons as black on a light background. */ + .material-icons.md-dark { color: rgba(0, 0, 0, 0.54); } + .material-icons.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); } /* Rules for using icons as white on a dark background. */ + .material-icons.md-light { color: rgba(255, 255, 255, 1); } + .material-icons.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); } diff --git a/public/src/app/rule-engine/rule-list/rule-list.component.ts b/public/src/app/rule-engine/rule-list/rule-list.component.ts index 45cfbd0..2857ea2 100644 --- a/public/src/app/rule-engine/rule-list/rule-list.component.ts +++ b/public/src/app/rule-engine/rule-list/rule-list.component.ts @@ -1,12 +1,11 @@ -import { Component, ViewEncapsulation, ViewChild } from '@angular/core'; +import { Component, ViewChild, ViewEncapsulation } from '@angular/core'; import { MatDialog } from '@angular/material'; -import { ActionListComponent } from '../action-list/action-list.component'; -import { RuleEngineApiService } from '../api/rule-engine-api.service'; -import { ConfirmPopupComponent } from '../confirm-popup/confirm-popup.component'; -import { Store } from '../../store/store'; import { isEmpty } from 'lodash'; import { ToastrService } from 'ngx-toastr'; import { timer } from 'rxjs/observable/timer'; +import { Store } from '../../store/store'; +import { RuleEngineApiService } from '../api/rule-engine-api.service'; +import { ConfirmPopupComponent } from '../confirm-popup/confirm-popup.component'; const primaryColor = '#009fdb'; @@ -58,7 +57,11 @@ export class RuleListComponent { ); this.store.updateRuleList(Object.values(response.rules)); this.targetSource = response.schema; + this.store.notifyIdValue = response.notifyId; + this.versionType.notifyIdCheckbox = + response.notifyId !== '' ? true : false; } else { + this.versionType.notifyIdCheckbox = false; this.store.resetRuleList(); this.versionType.updateVersionTypeFlag(false); this.targetSource = null; @@ -83,20 +86,29 @@ export class RuleListComponent { private toastr: ToastrService, public store: Store ) { - this.store.loader = true; - this.params = { - vfcmtUuid: this.store.mcUuid, - nodeName: this.store.tabParmasForRule[0].name, - nodeId: this.store.tabParmasForRule[0].nid, - fieldName: this.store.configurationForm[0].name, - userId: 'ym903w', // this.store.sdcParmas.userId - flowType: this.store.cdump.flowType - }; - console.log('params: %o', this.params); - this.store.loader = true; - // set api params by iframe url query - this._ruleApi.setParams(this.params); - this.getListOfRules(); + this.store.loader = false; + this._ruleApi.tabIndex.subscribe(index => { + console.log('rule index in rule-list component:', index); + const tabName = this.store.cdump.nodes[index].name; + console.log('tab name:', tabName); + + if (tabName.toLowerCase().includes('map')) { + this.params = { + vfcmtUuid: this.store.mcUuid, + nodeName: this.store.tabParmasForRule[0].name, + nodeId: this.store.tabParmasForRule[0].nid, + fieldName: this.store.tabsProperties[index][0].name, + userId: this.store.sdcParmas.userId, + flowType: this.store.cdump.flowType + }; + console.log('params: %o', this.params); + this.store.loader = true; + // set api params by iframe url query + this._ruleApi.setParams(this.params); + store.ruleListExistParams = this.params; + this.getListOfRules(); + } + }); } handlePropertyChange() { @@ -108,7 +120,8 @@ export class RuleListComponent { translateRules() { this.store.loader = true; // send translate JSON - this._ruleApi.translate().subscribe( + const nofityId = this.store.notifyIdValue; + this._ruleApi.translate(nofityId).subscribe( data => { this.store.loader = false; console.log(JSON.stringify(data)); @@ -116,7 +129,7 @@ export class RuleListComponent { this.store.configurationForm.forEach(property => { console.log('mappingTarget ', this.versionType.mappingTarget); if (property.name === this.versionType.mappingTarget) { - property.assignment.value = JSON.stringify(data); + property.value = JSON.stringify(data); domElementName = property.name; console.log(property.name); } |