(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["additional-settings-main-logs-pass-fail-criteria-logs-pass-fail-criteria-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.component.html":
/*!**************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.component.html ***!
  \**************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"p-grid w-100-p my-24 p-align-center\">\n    <span class=\"font-weight-500 mr-25\" >Evaluate Pass/Fail status periodically while test is running </span>\n    <p-selectButton class=\"radio-selectButton\" [options]=\"passFailOptions\" [(ngModel)]=\"passFailOptionValue\" [disabled]=\"enableDisKeywordList.CHECK_PROFILE_PERIODIC\"></p-selectButton>\n</div>\n<div *ngIf=\"passFailOptionValue  == 'y' \" >\n    <div class=\"p-grid p-align-center my-16  w-100-p\">\n        <div class=\"p-col-fixed\">Run rules with</div>\n        <div class=\"p-col-1\">\n            <p-dropdown  [options]=\"runRulesOptions\" [style]=\"{ 'min-width' : '100%' }\" [(ngModel)]=\"runRulesOptionValue\"  dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n        </div>\n        <div class=\"p-col-fixed\">window of  </div>\n        <div class=\"p-col-fixed\">\n            <p-spinner  inputStyleClass=\"w-100-p\" min=\"1\"  [(ngModel)]=\"windowVal\"></p-spinner>    \n        </div>\n        <div *ngIf=\"runRulesOptionValue == '0'\" class=\"p-col-fixed\">minute(s)</div>\n        <div *ngIf=\"runRulesOptionValue == '1'\" class=\"p-col-fixed\">minute(s) evaluated every 1 minute</div>\n    </div> \n    <div class=\"p-grid my-8 p-align-center\">\n        <div class=\"p-col-fixed\">Select Check Profile(s)</div>\n        <div class=\"p-col-2\">\n            <p-dropdown dropdownIcon=\"icons8 icons8-expand-arrow\" [pTooltip]=\"selProject\" [style]=\"{'min-width' : '100%'}\" [options]=\"projectList\" [(ngModel)]=\"selProject\" (onChange)=\"populateSubProject()\"></p-dropdown>  \n        </div>\n        <div class=\"p-col-2\">\n            <p-dropdown dropdownIcon=\"icons8 icons8-expand-arrow\" [pTooltip]=\"selSubProject\" [style]=\"{'min-width' : '100%'}\" [options]=\"subProjectList\" [(ngModel)]=\"selSubProject\" (onChange)=\"fillCheckProfDD(selProject + '/' + selSubProject)\"></p-dropdown>\n        </div>\n        <div class=\"p-col-2\">\n            <p-multiSelect [panelStyle]=\"{'min-width' : '100px'}\" [pTooltip]=\"selectCheckProfileValue\" [style]=\"{'width' : '100%'}\" [options]=\"selectCheckProfile\" [(ngModel)]=\"selectCheckProfileValue\"></p-multiSelect>\n        </div>\n        <div class=\"\">\n            <button pButton type=\"button\" class=\"width-34\" (click)=\"addChkProfile()\" icon=\"icons8 icons8-plus-math\"></button>\n        </div>\n    </div>\n   \n    <div class=\"p-grid p-align-center my-16  w-100-p\">\n        \n        <cav-table [value]=\"profileTableBody\" [headerRelativePath]=\"relativePath1\" [scrollable]=\"true\" [responsive]=\"true\"\n        scrollHeight=\"calc(100vh - 240px)\" (clickButtonEvent)=\"clickButtonEventPeriodic($event)\"></cav-table>      \n        \n    </div>\n    <div class=\"p-grid p-align-center my-16  w-100-p\">\n        <p-checkbox label=\"Skip Rampup, Stabilize and Rampdown phases. [ Simple Test based Scheduling only ] \"   binary=\"true\" [(ngModel)]=\"skipPhaseCheck\"></p-checkbox>\n    </div>\n    <div class=\"mt-32 p-24 mb-16 border-3 borderTabClass\">\n        <div class=\"w-100-p font-weight-500 font-14\">\n            PASS/FAIL CRITERIA\n        </div>\n        <div class=\"w-100-p p-grid p-align-center mt-8 mb-16\">\n            <span class=\"p-col-fixed\">Metrics used in rules are green if variation compared to SLA is upto </span>\n            <div class=\"p-col-1\">\n                <div class=\"ui-inputgroup\">\n                <p-spinner  inputStyleClass=\"w-100-p\" [min]=\"0\" [max]=\"100\"  [(ngModel)]=\"slaVal\"></p-spinner>\n                <span class=\"ui-inputgroup-addon\">%</span>\n                </div>\n            </div>\n            <span class=\"p-col-fixed\">yellow upto</span>\n            <div class=\"p-col-1 \">\n                <div class=\"ui-inputgroup\">\n                <p-spinner  inputStyleClass=\"w-100-p\" [min]=\"0\" [max]=\"100\" [(ngModel)]=\"yellowVal\"></p-spinner>\n                <span class=\"ui-inputgroup-addon\">%</span>\n                </div>\n            </div>\n            <span class=\"p-col-fixed\">red more than</span>\n            <div class=\"p-col-1 \">\n                <div class=\"ui-inputgroup\">\n                <p-spinner  inputStyleClass=\"w-100-p\" [min]=\"0\" [max]=\"100\" disabled [(ngModel)]=\"yellowVal\"></p-spinner>\n                <span class=\"ui-inputgroup-addon\">%</span>    \n            </div>\n            </div>\n            <span class=\"p-col-fixed\">Test fails if </span>\n            <div class=\"p-col-1\">\n                <div class=\"ui-inputgroup\">\n                <p-spinner  inputStyleClass=\"w-100-p\" [min]=\"0\" [(ngModel)]=\"testFailVal\"></p-spinner>\n                <span class=\"ui-inputgroup-addon\">%</span>    \n            </div>\n            </div>\n            <span class=\"p-col-fixed\">or more metrics are red</span>\n\n        </div>\n        <div class=\"w-100-p p-grid p-align-center my-16\">\n            <p-checkbox label=\"Stop test on failure\"   binary=\"true\" [(ngModel)]=\"stopTestCheck\"></p-checkbox>\n        </div>\n        <div class=\"w-100-p p-grid p-align-center mt-16\">\n            <p-checkbox label=\"Generate Pass/Fail Report for \" class=\"\"   binary=\"true\" [(ngModel)]=\"generatePassFailCheck\"></p-checkbox>\n            <div class=\"p-col-2\">\n                <p-dropdown [disabled]=\"!generatePassFailCheck\" [options]=\"caseOptions\" [style]=\"{ 'min-width' : '100%' }\" [(ngModel)]=\"caseOptionValue\" dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n            </div>\n        </div>\n    </div>\n</div> \n<div class=\"p-grid w-100-p my-24 p-align-center\">\n    <span class=\"font-weight-500 mr-25\" >Run rules for overall Pass/Fail criteria</span>\n    <p-selectButton class=\"radio-selectButton\" [options]=\"overallPassFailOptions\" [(ngModel)]=\"overallPassFailOptionValue\" [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL\"></p-selectButton>\n</div>\n<div *ngIf=\"overallPassFailOptionValue  == 'y' \" >\n    <div class=\"alert-info my-24\">\n        Evaluate Pass/Fail status at the end of test\n    </div>\n\n    <div class=\"p-grid w-100-p my-16 p-align-center\">\n        <span class=\"font-weight-500 mr-25\" >Evaluate Pass/Fail status at the end of test for </span>\n        <p-selectButton class=\"radio-selectButton\" [options]=\"endPassFailOptions\" [(ngModel)]=\"endPassFailOptionValue\"></p-selectButton>\n    </div>\n    <div class=\"w-100-p my-16\">\n        <p-checkbox label=\"Apply same CheckRules as periodic case\"   binary=\"true\" [(ngModel)]=\"applySameCheckRulesCheck\" (click)=\"onApplySameRuleChange()\"></p-checkbox>\n    </div>\n    <div class=\"p-grid my-8 p-align-center\">\n        <div class=\"p-col-fixed\">Select Check Profile(s)</div>\n        <div class=\"p-col-2\">\n            <p-dropdown dropdownIcon=\"icons8 icons8-expand-arrow\" [pTooltip]=\"selectCheckProfileValue\" [style]=\"{'min-width' : '100%'}\" [options]=\"overallProjectList\" [(ngModel)]=\"selOverallProject\" (onChange)=\"populateOverallSubProject()\"></p-dropdown>  \n        </div>\n        <div class=\"p-col-2\">\n            <p-dropdown dropdownIcon=\"icons8 icons8-expand-arrow\" [pTooltip]=\"selectCheckProfileValue\" [style]=\"{'min-width' : '100%'}\" [options]=\"overallSubProjectList\" [(ngModel)]=\"selOverallSubProject\" (onChange)=\"fillCheckProfDD(selOverallProject + '/' + selOverallSubProject)\"></p-dropdown>\n        </div>\n        <div class=\"p-col-2\">\n            <p-multiSelect [panelStyle]=\"{'min-width' : '100px'}\" [pTooltip]=\"selectCheckProfileValue\" [style]=\"{'width' : '100%'}\" [options]=\"selectCheckProfile\" [(ngModel)]=\"secondSelectCheckProfileValue\"></p-multiSelect>\n        </div>\n        <div class=\"\">\n            <button pButton type=\"button\"  class=\"width-34\" icon=\"icons8 icons8-plus-math\" (click)=\"addChkProfileOverallData()\">\n            </button>\n        </div>\n    </div>\n    <div class=\"p-grid p-align-center my-16  w-100-p\">\n        <cav-table [value]=\"overallProfileTableBody\" [headerRelativePath]=\"relativePath2\" [scrollable]=\"true\" [responsive]=\"true\"\n        scrollHeight=\"calc(100vh - 240px)\" (clickButtonEvent)=\"clickButtonEventOverall($event)\"></cav-table>   \n        \n    </div>\n    <div class=\"p-24 mb-16 border-5 border-all rounded-3\">\n        <h3 class=\"font-weight-500 font-14 mt-0\">SHOW METRICS OF BASELINE TESTRUNS IN THE PASS/FAIL REPORT</h3>\n        <div class=\"p-grid p-align-center w-100-p\">\n            <div class=\"p-col-3\">\n                <p-checkbox label=\"Baseline 1\" binary=\"true\" [(ngModel)]=\"baseline1Check\" (onChange)=\"onChangeBaseLine1($event)\"></p-checkbox>\n            </div>\n            <div class=\"p-col-1 \">\n                <input  type=\"text\" class=\"w-100-p\" pInputText [(ngModel)]=\"baselineName1\" [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL || !baseline1Check\"> \n            </div>\n            <div class=\"p-col-2 \">\n                <p-dropdown placeholder=\"--Select Test--\" (onChange)=\"setTrListForBaseLine1(baseline1OptionValue)\"\n                [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL || !baseline1Check\" [options]=\"scenList\" [style]=\"{ 'min-width' : '100%' }\" [(ngModel)]=\"baseline1OptionValue\" pTooltip=\"{{baseline1OptionValue}}\" dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n            </div>\n            <div class=\"p-col-2 p-col-push-4\">\n                <p-dropdown placeholder=\"Select Test Run\" [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL || !baseline1Check\" [options]=\"secondBaseline1Options\" [style]=\"{ 'min-width' : '100%' }\" [(ngModel)]=\"secondBaseline1OptionValue\"  dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n            </div>\n\n            <div class=\"p-col-3\">\n                <p-checkbox label=\"Baseline 2\"  binary=\"true\" [(ngModel)]=\"baseline2Check\" (onChange)=\"onChangeBaseLine2($event)\"></p-checkbox>\n            </div>\n            <div class=\"p-col-1 \">\n                <input  type=\"text\" class=\"w-100-p\" pInputText [(ngModel)]=\"baselineName2\" [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL || !baseline2Check\"> \n            </div>\n            <div class=\"p-col-2 \">\n                <p-dropdown placeholder=\"--Select Test--\" [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL || !baseline2Check\" [options]=\"scenList\" [style]=\"{ 'min-width' : '100%' }\"\n                (onChange)=\"setTrListForBaseLine2(baseline2OptionValue)\"\n                [(ngModel)]=\"baseline2OptionValue\" pTooltip=\"{{baseline2OptionValue}}\" dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n            </div>\n            <div class=\"p-col-2 p-col-push-4\">\n                <p-dropdown placeholder=\"Select Test Run\" [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL || !baseline2Check\" [options]=\"secondBaseline2Options\" [style]=\"{ 'min-width' : '100%' }\" [(ngModel)]=\"secondBaseline2OptionValue\"  dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n            </div>\n\n            <div class=\"p-col-3\">\n                <p-checkbox label=\"Baseline 3\" (onChange)=\"onChangeBaseLine3($event)\"  binary=\"true\" [(ngModel)]=\"baseline3Check\"></p-checkbox>\n            </div>\n            <div class=\"p-col-1 \">\n                <input  type=\"text\" class=\"w-100-p\" pInputText [(ngModel)]=\"baselineName3\" [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL || !baseline3Check\"> \n            </div>\n            <div class=\"p-col-2 \">\n                <p-dropdown placeholder=\"--Select Test--\" (onChange)=\"setTrListForBaseLine3(baseline3OptionValue)\"\n                [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL || !baseline3Check\" [options]=\"scenList\" [style]=\"{ 'min-width' : '100%' }\" [(ngModel)]=\"baseline3OptionValue\" pTooltip=\"{{baseline3OptionValue}}\"  dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n            </div>\n            <div class=\"p-col-2 p-col-push-4\">\n                <p-dropdown placeholder=\"Select Test Run\" [disabled]=\"enableDisKeywordList.CHECK_PROFILE_OVERALL || !baseline3Check\" [options]=\"secondBaseline3Options\" [style]=\"{ 'min-width' : '100%' }\" [(ngModel)]=\"secondBaseline3OptionValue\"  dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n            </div>\n            <div class=\"p-col-3\">\n                <p-checkbox label=\"Override checkprofile SLA with\" (onChange)=\"onOverallSlaClick()\"  binary=\"true\" [(ngModel)]=\"overrideCheckProfile\"></p-checkbox>\n            </div>\n            <div class=\"p-col-3 p-col-push-6\">\n                <p-dropdown placeholder=\"Select Baseline\" [disabled]=\"overrideCheckProfile ? false : true\" [options]=\"overrideCheckOptions\" [style]=\"{ 'min-width' : '100%' }\" [(ngModel)]=\"overrideCheckOptionValue\" pTooltip=\"{{overrideCheckOptionValue}}\" dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n            </div>\n        </div>\n\n    </div>\n    <div class=\"p-24 mb-16 border-5 border-all rounded-3\">\n        <h3 class=\"mt-0 font-weight-500 font-14\">\n            PASS/FAIL CRITERIA\n        </h3>\n        <div class=\" p-grid p-align-center\">\n            <div class=\"p-col-fixed\">Metrics used in rules are green if variation compared to SLA is upto </div>\n            <div class=\"p-col-1 \">\n                <div class=\"ui-inputgroup\">\n                <p-spinner  inputStyleClass=\"w-100-p\" [min]=\"0\" [max]=\"100\" [(ngModel)]=\"slaVal2\"></p-spinner>\n                <span class=\"ui-inputgroup-addon\">%</span>\n                </div>\n            </div>\n            <div class=\"p-col-fixed\">yellow upto</div>\n            <div class=\"p-col-1 \">\n                <div class=\"ui-inputgroup\">\n                <p-spinner  inputStyleClass=\"w-100-p\" [min]=\"0\" [max]=\"100\" [(ngModel)]=\"yellowVal2\"></p-spinner>\n                <span class=\"ui-inputgroup-addon\">%</span>\n                </div>\n            </div>\n            <div class=\"p-col-fixed\">red more than</div>\n            <div class=\"p-col-1 \">\n                <div class=\"ui-inputgroup\">\n                <p-spinner  inputStyleClass=\"w-100-p\" [min]=\"0\" [max]=\"100\" disabled [(ngModel)]=\"yellowVal2\"></p-spinner>\n                <span class=\"ui-inputgroup-addon\">%</span>\n                </div>\n            </div>\n            <div class=\"p-col-fixed\">Test fails if </div>\n            <div class=\"p-col-1 \">\n                <div class=\"ui-inputgroup\">\n                <p-spinner inputStyleClass=\"w-100-p\" [min]=\"0\" [(ngModel)]=\"testFailVal2\"></p-spinner>\n                <span class=\"ui-inputgroup-addon\">%</span>\n                </div>\n            </div>\n            <div class=\"p-col-fixed\">or more metrics are red</div>\n        </div>\n       \n    </div>\n</div>\n");

/***/ }),

/***/ "./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.component.scss":
/*!************************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.component.scss ***!
  \************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("");

/***/ }),

/***/ "./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.component.ts":
/*!**********************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.component.ts ***!
  \**********************************************************************************************************************/
/*! exports provided: LogsPassFailCriteriaComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogsPassFailCriteriaComponent", function() { return LogsPassFailCriteriaComponent; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../interface/scenario-state */ "./src/app/pages/scenario/interface/scenario-state.ts");
/* harmony import */ var _service_scen_keyword_definition_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../service/scen-keyword-definition.service */ "./src/app/pages/scenario/service/scen-keyword-definition.service.ts");
/* harmony import */ var _service_scenario_http_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../service/scenario-http.service */ "./src/app/pages/scenario/service/scenario-http.service.ts");
/* harmony import */ var _constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants/scen-keyword-constants */ "./src/app/pages/scenario/constants/scen-keyword-constants.ts");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");
/* harmony import */ var _service_scenario_utils_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../service/scenario-utils.service */ "./src/app/pages/scenario/service/scenario-utils.service.ts");
/* harmony import */ var _service_sch_schedule_data_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../service/sch-schedule-data.service */ "./src/app/pages/scenario/service/sch-schedule-data.service.ts");
/* harmony import */ var _service_additional_setting_data_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../service/additional-setting-data-service */ "./src/app/pages/scenario/service/additional-setting-data-service.ts");
/* harmony import */ var _service_scenario_share_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../service/scenario-share.service */ "./src/app/pages/scenario/service/scenario-share.service.ts");











let LogsPassFailCriteriaComponent = class LogsPassFailCriteriaComponent {
    constructor(keywordDefinition, scenarioHttpService, dataService, sessionService, scenUtilsService, schData, scenShareService) {
        this.keywordDefinition = keywordDefinition;
        this.scenarioHttpService = scenarioHttpService;
        this.dataService = dataService;
        this.sessionService = sessionService;
        this.scenUtilsService = scenUtilsService;
        this.schData = schData;
        this.scenShareService = scenShareService;
        this.passFailOptions = [];
        this.passFailOptionValue = 'n';
        this.runRulesOptions = [];
        this.runRulesOptionValue = "0";
        this.windowVal = 5;
        this.selectCheckProfile = [];
        this.selectCheckProfileValue = "";
        this.profileTableBody = [];
        this.skipPhaseCheck = false;
        this.slaVal = 20;
        this.yellowVal = 50;
        this.testFailVal = 10;
        this.slaVal2 = 20;
        this.yellowVal2 = 50;
        this.testFailVal2 = 10;
        this.stopTestCheck = false;
        this.generatePassFailCheck = false;
        this.caseOptions = [];
        this.caseOptionValue = '2';
        this.overallPassFailOptions = [];
        this.overallPassFailOptionValue = 'n';
        this.endPassFailOptions = [];
        this.endPassFailOptionValue = '0';
        this.secondSelectCheckProfileValue = "";
        this.applySameCheckRulesCheck = false;
        this.overallProfileTableBody = [];
        this.baseline1Check = false;
        this.secondBaseline1Options = [];
        this.baseline2Check = false;
        this.overrideCheckProfile = false;
        this.baseline3Check = false;
        this.secondBaseline3Options = [];
        this.overrideCheckOptions = [{ label: "--Select BaseLine-- ", value: '' }];
        this.overrideCheckOptionValue = "";
        this.enableDisKeywordList = {
            "CHECK_PROFILE_PERIODIC": false,
            "CHECK_PROFILE_OVERALL": false
        };
        this.screenKeywordList = Object.keys(this.enableDisKeywordList);
        this.scenList = [];
        this.projectList = [];
        this.subProjectList = [];
        this.selProject = "";
        this.selSubProject = "";
        this.overallSubProjectList = [];
        this.overallProjectList = [];
        this.selOverallProject = "";
        this.selOverallSubProject = "";
        this.relativePath1 = "scenario/additionalSettings/logsPassFail/logsPassFailPeriodic.json";
        this.relativePath2 = "scenario/additionalSettings/logsPassFail/logsPassFailOverall.json";
    }
    clickButtonEventPeriodic(event) {
        var _a, _b;
        const me = this;
        if (((_b = (_a = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _a === void 0 ? void 0 : _a.actionConfig) === null || _b === void 0 ? void 0 : _b.action) === "deletechkProfPeriodic") {
            me.deleteRowDataPeriodic(event.cavEventExt.row);
        }
    }
    clickButtonEventOverall(event) {
        var _a, _b;
        const me = this;
        if (((_b = (_a = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _a === void 0 ? void 0 : _a.actionConfig) === null || _b === void 0 ? void 0 : _b.action) === "deletechkProfOverall") {
            me.deleteRowDataOverAll(event.cavEventExt.row);
        }
    }
    canDeactivate() {
        //insert logic to check if there are pending changes here;
        //returning true will navigate without confirmation
        //returning false will show a confirm alert before navigating away
        try {
            if (this.validateAndSetKeywordArray() == false) {
                //   this.breadCrumbService.changeBreadcrumb([{ label: "Group Based Settings" }, { label: "Think Time" }]);
                return false;
            }
        }
        catch (e) {
        }
        return true;
    }
    setDataInConf() {
        return true;
    }
    ngOnInit() {
        return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
            this.saveSubscription = this.scenUtilsService.$saveGroupbasedSetting.subscribe((res) => {
                if (this.validateAndSetKeywordArray()) {
                    this.scenUtilsService.saveComponentData(0, {});
                }
            });
            this.fillDD();
            this.username = this.sessionService.session.cctx.u;
            this.populateProjList();
            this.projSubProj = `${this.scenUtilsService.Project}/${this.scenUtilsService.subProject}`;
            yield this.getScenList(this.projSubProj, this.username);
            this.arrKeywordData = this.keywordDefinition.chkAndGetKeywrdDataWithAdditionalKeys(this.screenKeywordList);
            if (this.keywordDefinition.isArrKeywordDataEmpty(this.arrKeywordData, this.screenKeywordList)) {
                this.keywordDefinition.setRequestKeywordListInBody(this.screenKeywordList, "");
                let obj = this.keywordDefinition.getRequestJsonParm();
                this.getKeywordData(obj);
                //error case
                if (this.arrKeywordData == null)
                    this.arrKeywordData = {};
            }
            else
                this.fillDataInComp();
        });
    }
    getKeywordData(obj) {
        this.scenarioHttpService.getDefaultKeywordData(obj).subscribe((state) => {
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["GetDefaultKeywordDataLoadingState"]) {
                return;
            }
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["GetDefaultKeywordDataLoadedState"]) {
                this.keywordDefinition.setArrKeywordData(this.arrKeywordData, state.data, this.keywordDefinition.mergeKeywordData);
                this.fillDataInComp();
                return;
            }
        }, (state) => {
            console.log(state.error);
            return;
        });
    }
    fillDataInComp() {
        return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
            let keys = Object.keys(this.arrKeywordData);
            for (let i = 0; i < keys.length; i++) //keyword iteration
             {
                let strKeyword = keys[i];
                let keyObj = this.arrKeywordData[strKeyword];
                let dataObj = this.arrKeywordData[strKeyword]['data'];
                this.enableDisKeywordList[strKeyword] = this.dataService.isCompEnable(this.dataService.getScenMode(), keyObj, strKeyword);
                if (dataObj == undefined) {
                    continue;
                }
                if (dataObj == undefined)
                    continue;
                if (dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_5__["GLOBAL_KEY"]] == undefined)
                    continue;
                let arrVal = dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_5__["GLOBAL_KEY"]][0];
                if (arrVal == undefined)
                    continue;
                else if (strKeyword == 'CHECK_PROFILE_PERIODIC') {
                    if (arrVal.length > 1) {
                        this.passFailOptionValue = "y";
                        let chkProfileArr = arrVal[0].split(",");
                        yield this.fillCheckProfDD(this.getProjSubProj(chkProfileArr));
                        for (let i = 0; i < chkProfileArr.length; i++) {
                            for (let j = 0; j < this.chkProfileList.length; j++) {
                                if (chkProfileArr[i] == this.chkProfileList[j]['Project'] + "/" + this.chkProfileList[j]['SubProject'] + "/" + this.chkProfileList[j]['Profile Name']) {
                                    let obj = JSON.parse(JSON.stringify(this.chkProfileList[j]));
                                    obj['Profile Name'] = chkProfileArr[i];
                                    this.profileTableBody.push(obj);
                                    break;
                                }
                            }
                        }
                        this.runRulesOptionValue = arrVal[1] == "0" ? "0" : "1";
                        this.windowVal = Number.isNaN(Number.parseInt(arrVal[2])) ? 5 : Number.parseInt(arrVal[2]);
                        this.skipPhaseCheck = (arrVal[3] == "0" || arrVal[3] == undefined) ? false : true;
                        this.stopTestCheck = (arrVal[4] == "0" || arrVal[4] == undefined) ? false : true;
                        this.slaVal = Number.isNaN(Number.parseInt(arrVal[5])) ? 20 : Number.parseInt(arrVal[5]);
                        this.yellowVal = Number.isNaN(Number.parseInt(arrVal[6])) ? 50 : Number.parseInt(arrVal[6]);
                        this.testFailVal = Number.isNaN(Number.parseInt(arrVal[7])) ? 10 : Number.parseInt(arrVal[7]);
                        this.generatePassFailCheck = (arrVal[8] == "0" || arrVal[8] == undefined) ? false : true;
                        if (this.generatePassFailCheck) {
                            this.caseOptionValue = arrVal[8];
                        }
                    }
                    else
                        this.passFailOptionValue = "n";
                }
                else if (strKeyword == 'CHECK_PROFILE_OVERALL') {
                    if (arrVal.length > 1) {
                        /**
                         * CHECK_PROFILE_OVERALL p/s/check_prof1,p/s/check_prof2 [<time period option > <+/- 10%> <+/- 50%> <10%> BaselineTR1 BaseLineTR2 BaseLineT3
                         */
                        this.overallPassFailOptionValue = "y";
                        let chkProfileArr = arrVal[0].split(",");
                        yield this.fillCheckProfDD(this.getProjSubProj(chkProfileArr));
                        for (let i = 0; i < chkProfileArr.length; i++) {
                            for (let j = 0; j < this.chkProfileList.length; j++) {
                                if (chkProfileArr[i] == this.chkProfileList[j]['Project'] + "/" + this.chkProfileList[j]['SubProject'] + "/" + this.chkProfileList[j]['Profile Name']) {
                                    let obj = JSON.parse(JSON.stringify(this.chkProfileList[j]));
                                    obj['Profile Name'] = chkProfileArr[i];
                                    this.overallProfileTableBody.push(obj);
                                    this.tempProfOverallDataTable = this.overallProfileTableBody;
                                    break;
                                }
                            }
                        }
                        this.endPassFailOptionValue = arrVal[1] == "0" ? "0" : "1";
                        this.slaVal2 = Number.isNaN(Number.parseInt(arrVal[2])) ? 20 : Number.parseInt(arrVal[2]);
                        this.yellowVal2 = Number.isNaN(Number.parseInt(arrVal[3])) ? 50 : Number.parseInt(arrVal[3]);
                        this.testFailVal2 = Number.isNaN(Number.parseInt(arrVal[4])) ? 10 : Number.parseInt(arrVal[4]);
                        this.baseline1Check = (arrVal[5] == undefined || arrVal[5] == "NA") ? false : true;
                        if (this.baseline1Check) {
                            this.overrideCheckOptions = this.overrideCheckOptions.concat({ label: 'Baseline1 TR', value: '1' });
                            this.baselineName1 = arrVal[5].split(';')[2];
                            this.getScenList(this.projSubProj, this.username).then(_ => {
                                this.baseline1OptionValue = arrVal[5].split(';')[1];
                                this.setTrListForBaseLine1Promise(this.baseline1OptionValue, this.baseline1OptionValue.substring(0, this.baseline1OptionValue.lastIndexOf('/'))).then((res) => {
                                    this.secondBaseline1OptionValue = arrVal[5].split(';')[0];
                                });
                            });
                        }
                        this.baseline2Check = (arrVal[6] == undefined || arrVal[6] == "NA") ? false : true;
                        if (this.baseline2Check) {
                            this.overrideCheckOptions = this.overrideCheckOptions.concat({ label: 'Baseline2 TR', value: '2' });
                            this.baselineName2 = arrVal[6].split(';')[2];
                            this.getScenList(this.projSubProj, this.username).then(_ => {
                                this.baseline2OptionValue = arrVal[6].split(';')[1];
                                this.setTrListForBaseLine2Promise(this.baseline2OptionValue, this.baseline2OptionValue.substring(0, this.baseline2OptionValue.lastIndexOf('/'))).then((res) => {
                                    this.secondBaseline2OptionValue = arrVal[6].split(';')[0];
                                });
                            });
                        }
                        this.baseline3Check = (arrVal[7] == undefined || arrVal[7] == "NA") ? false : true;
                        if (this.baseline3Check) {
                            this.overrideCheckOptions = this.overrideCheckOptions.concat({ label: 'Baseline3 TR', value: '3' });
                            this.baselineName3 = arrVal[7].split(';')[2];
                            this.getScenList(this.projSubProj, this.username).then(_ => {
                                this.baseline3OptionValue = arrVal[7].split(';')[1];
                                this.setTrListForBaseLine3Promise(this.baseline3OptionValue, this.baseline3OptionValue.substring(0, this.baseline3OptionValue.lastIndexOf('/'))).then((res) => {
                                    this.baseline3OptionValue = arrVal[7].split(';')[0];
                                });
                            });
                        }
                        this.overrideCheckProfile = (arrVal[8] == undefined || arrVal[8] == "0") ? false : true;
                        if (this.overrideCheckProfile) {
                            if (arrVal[8] == "1") {
                                this.overrideCheckOptionValue = '1';
                            }
                            else if (arrVal[8] == "2") {
                                this.overrideCheckOptionValue = '2';
                            }
                            else if (arrVal[8] == "3") {
                                this.overrideCheckOptionValue = '3';
                            }
                        }
                    }
                    else
                        this.overallPassFailOptionValue = "n";
                }
            }
        });
    }
    fillDD() {
        this.passFailOptions = [
            { label: 'Yes', value: 'y' },
            { label: 'No', value: 'n' }
        ];
        this.runRulesOptions = [
            { label: 'Fixed', value: '0' },
            { label: 'Moving', value: '1' }
        ];
        this.profileTableHead = [
            { field: 'Profile Name', header: 'Profile Name' },
            { field: 'Profile Description', header: 'Profile Description' },
            { field: 'Check Rules', header: 'Check Rules' },
            { field: 'Last Updated', header: 'Last Updated' },
            { field: 'Updated By', header: 'Updated By' }
        ];
        this.caseOptions = [
            { label: 'All Cases', value: '2' },
            { label: 'Failure Cases', value: '1' },
        ];
        this.overallPassFailOptions = [
            { label: 'Yes', value: 'y' },
            { label: 'No', value: 'n' },
        ];
        this.endPassFailOptions = [
            { label: 'Complete Test Duration', value: '0' },
            { label: 'Duration Phase Value', value: '1' },
        ];
    }
    getScenList(projSubproj, getSessUserName) {
        return new Promise((onfullfill) => {
            this.scenarioHttpService.getScenarioList(projSubproj, getSessUserName).subscribe((state) => {
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadingState"]) {
                    return;
                }
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadedState"]) {
                    this.getScenarioListForSpecificProjSubProjDataOnLoaded(state);
                    onfullfill(true);
                    return;
                }
            }, (state) => {
            });
        });
    }
    getScenarioListForSpecificProjSubProjDataOnLoaded(state) {
        this.selectScenarioList = state.data;
        this.scenList = [];
        this.scenList.push({ label: "--Select Test--", value: "" });
        for (let i = 0; i < this.selectScenarioList.length; i++) {
            let obj = { label: this.selectScenarioList[i], value: this.selectScenarioList[i] };
            this.scenList.push(obj);
        }
    }
    getChkProfileList(projSubproj, getSessUserName) {
        return new Promise((onfullfill) => {
            this.scenarioHttpService.getChkProfileList(projSubproj, getSessUserName).subscribe((state) => {
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadingState"]) {
                    return;
                }
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadedState"]) {
                    this.getSelectedChkProfileData(state);
                    onfullfill(true);
                    return;
                }
            }, (state) => {
            });
        });
    }
    getSelectedChkProfileData(state) {
        this.chkProfileList = state.data;
        this.selectCheckProfile = [];
        for (let i = 0; i < this.chkProfileList.length; i++) {
            let obj = { label: `${this.chkProfileList[i]['Profile Name']}`, value: `${this.chkProfileList[i]['Profile Name']}` };
            this.selectCheckProfile.push(obj);
        }
    }
    setTrListForBaseLine1Promise(scen, projSubproj) {
        return new Promise((onfullfill, onreject) => {
            this.scenarioHttpService.getTestRunList(scen.split("/")[2], projSubproj).subscribe((state) => {
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadingState"]) {
                    return;
                }
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadedState"]) {
                    this.getTRListDataOnLoadedForBaseLine1(state);
                    onfullfill(true);
                    return;
                }
            }, (state) => {
            });
        });
    }
    setTrListForBaseLine2Promise(scen, projSubproj) {
        return new Promise((onfullfill, onreject) => {
            this.scenarioHttpService.getTestRunList(scen.split("/")[2], projSubproj).subscribe((state) => {
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadingState"]) {
                    return;
                }
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadedState"]) {
                    this.getTRListDataOnLoadedForBaseLine2(state);
                    onfullfill(true);
                    return;
                }
            }, (state) => {
            });
        });
    }
    setTrListForBaseLine3Promise(scen, projSubproj) {
        return new Promise((onfullfill, onreject) => {
            this.scenarioHttpService.getTestRunList(scen.split("/")[2], projSubproj).subscribe((state) => {
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadingState"]) {
                    return;
                }
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadedState"]) {
                    this.getTRListDataOnLoadedForBaseLine3(state);
                    onfullfill(true);
                    return;
                }
            }, (state) => {
            });
        });
    }
    getTRListDataOnLoadedForBaseLine1(state) {
        let res = state.data;
        this.secondBaseline1Options = [];
        this.secondBaseline1Options.push({ label: "Select Test Run", value: null });
        for (let i = 0; i < res.length; i++) {
            this.secondBaseline1Options.push({ label: res[i], value: res[i] });
        }
    }
    getTRListDataOnLoadedForBaseLine2(state) {
        let res = state.data;
        this.secondBaseline2Options = [];
        this.secondBaseline2Options.push({ label: "Select Test Run", value: null });
        for (let i = 0; i < res.length; i++) {
            this.secondBaseline2Options.push({ label: res[i], value: res[i] });
        }
    }
    getTRListDataOnLoadedForBaseLine3(state) {
        let res = state.data;
        this.secondBaseline3Options = [];
        this.secondBaseline3Options.push({ label: "Select Test Run", value: null });
        for (let i = 0; i < res.length; i++) {
            this.secondBaseline3Options.push({ label: res[i], value: res[i] });
        }
    }
    addChkProfile() {
        try {
            if (!this.selProject) {
                this.scenUtilsService.errorMessage("Please Select project.");
                return;
            }
            if (!this.selSubProject) {
                this.scenUtilsService.errorMessage("Please Select Sub project.");
                return;
            }
            if (!this.selectCheckProfileValue) {
                this.scenUtilsService.errorMessage("Please Select CheckProfile.");
                return;
            }
            for (let i = 0; i < this.selectCheckProfileValue.length; i++) {
                for (let j = 0; j < this.profileTableBody.length; j++) {
                    if (this.selectCheckProfileValue[i] == this.profileTableBody[j]['Profile Name'].substr(this.profileTableBody[j]['Profile Name'].lastIndexOf("/") + 1)) {
                        this.scenUtilsService.errorMessage("Check Profile already added.");
                        return;
                    }
                }
            }
            for (let i = 0; i < this.selectCheckProfileValue.length; i++) {
                for (let j = 0; j < this.chkProfileList.length; j++) {
                    if (this.chkProfileList[j] != null && this.chkProfileList[j] != undefined) {
                        if (this.chkProfileList[j]["Profile Name"] == this.selectCheckProfileValue[i]) {
                            let profileName = this.chkProfileList[j].Project + "/" + this.chkProfileList[j].SubProject + "/" + this.chkProfileList[j]["Profile Name"];
                            let obj = JSON.parse(JSON.stringify(this.chkProfileList[j]));
                            obj['Profile Name'] = profileName;
                            this.profileTableBody.push(obj);
                        }
                    }
                }
            }
            this.selectCheckProfileValue = "";
        }
        catch (e) {
            console.log(e);
        }
    }
    addChkProfileOverallData() {
        try {
            if (!this.selOverallProject) {
                this.scenUtilsService.errorMessage("Please Select project.");
                return;
            }
            if (!this.selOverallSubProject) {
                this.scenUtilsService.errorMessage("Please Select Sub project.");
                return;
            }
            if (!this.secondSelectCheckProfileValue) {
                this.scenUtilsService.errorMessage("Please Select CheckProfile.");
                return;
            }
            for (let i = 0; i < this.secondSelectCheckProfileValue.length; i++) {
                for (let j = 0; j < this.overallProfileTableBody.length; j++) {
                    if (this.secondSelectCheckProfileValue[i] == this.overallProfileTableBody[j]['Profile Name'].substr(this.overallProfileTableBody[j]['Profile Name'].lastIndexOf("/") + 1)) {
                        this.scenUtilsService.errorMessage("Check Profile already added.");
                        return;
                    }
                }
            }
            for (let i = 0; i < this.secondSelectCheckProfileValue.length; i++) {
                for (let j = 0; j < this.chkProfileList.length; j++) {
                    if (this.chkProfileList[j] != null && this.chkProfileList[j] != undefined) {
                        if (this.chkProfileList[j]["Profile Name"] == this.secondSelectCheckProfileValue[i]) {
                            let profileName = this.chkProfileList[j].Project + "/" + this.chkProfileList[j].SubProject + "/" + this.chkProfileList[j]["Profile Name"];
                            let obj = JSON.parse(JSON.stringify(this.chkProfileList[j]));
                            obj['Profile Name'] = profileName;
                            this.overallProfileTableBody.push(obj);
                            this.tempProfOverallDataTable = this.overallProfileTableBody;
                        }
                    }
                }
            }
            this.secondSelectCheckProfileValue = "";
        }
        catch (e) {
            console.log(e);
        }
    }
    onChangeBaseLine1(event) {
        if (this.baseline1Check)
            this.overrideCheckOptions = this.overrideCheckOptions.concat({ label: 'Baseline1 TR', value: '1' });
        else {
            if (!this.baseline2Check && !this.baseline3Check)
                this.overrideCheckOptionValue = "";
            this.overrideCheckOptions = this.overrideCheckOptions.filter(x => x.label !== "Baseline1 TR");
        }
        this.getScenList(this.projSubProj, this.username);
    }
    onChangeBaseLine2(event) {
        if (this.baseline2Check)
            this.overrideCheckOptions = this.overrideCheckOptions.concat({ label: 'Baseline2 TR', value: '2' });
        else {
            if (!this.baseline1Check && !this.baseline3Check)
                this.overrideCheckOptionValue = "";
            this.overrideCheckOptions = this.overrideCheckOptions.filter(x => x.label !== "Baseline2 TR");
        }
        this.getScenList(this.projSubProj, this.username);
    }
    onChangeBaseLine3(event) {
        if (this.baseline3Check)
            this.overrideCheckOptions = this.overrideCheckOptions.concat({ label: 'Baseline3 TR', value: '3' });
        else {
            if (!this.baseline1Check && !this.baseline2Check) {
                this.overrideCheckOptionValue = "";
            }
            this.overrideCheckOptions = this.overrideCheckOptions.filter(x => x.label !== "Baseline3 TR");
        }
        this.getScenList(this.projSubProj, this.username);
    }
    setTrListForBaseLine1(scen) {
        this.scenarioHttpService.getTestRunList(scen.split("/")[2], scen.substring(0, scen.lastIndexOf('/'))).subscribe((state) => {
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadingState"]) {
                return;
            }
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadedState"]) {
                this.getTRListData1(state);
                return;
            }
        }, (state) => {
        });
    }
    setTrListForBaseLine2(scen) {
        this.scenarioHttpService.getTestRunList(scen.split("/")[2], scen.substring(0, scen.lastIndexOf('/'))).subscribe((state) => {
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadingState"]) {
                return;
            }
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadedState"]) {
                this.getTRListData2(state);
                return;
            }
        }, (state) => {
        });
    }
    setTrListForBaseLine3(scen) {
        this.scenarioHttpService.getTestRunList(scen.split("/")[2], scen.substring(0, scen.lastIndexOf('/'))).subscribe((state) => {
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadingState"]) {
                return;
            }
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadedState"]) {
                this.getTRListData3(state);
                return;
            }
        }, (state) => {
        });
    }
    getTRListData1(state) {
        let res = state.data;
        this.secondBaseline1Options = [];
        this.secondBaseline1Options.push({ label: "Select Test Run", value: null });
        for (let i = 0; i < res.length; i++) {
            this.secondBaseline1Options.push({ label: res[i], value: res[i] });
        }
    }
    getTRListData2(state) {
        let res = state.data;
        this.secondBaseline2Options = [];
        this.secondBaseline2Options.push({ label: "Select Test Run", value: null });
        for (let i = 0; i < res.length; i++) {
            this.secondBaseline2Options.push({ label: res[i], value: res[i] });
        }
    }
    getTRListData3(state) {
        let res = state.data;
        this.secondBaseline3Options = [];
        this.secondBaseline3Options.push({ label: "Select Test Run", value: null });
        for (let i = 0; i < res.length; i++) {
            this.secondBaseline3Options.push({ label: res[i], value: res[i] });
        }
    }
    onApplySameRuleChange() {
        if (this.applySameCheckRulesCheck && this.profileTableBody.length == 0) {
            this.scenUtilsService.errorMessage("No records present for periodic time table.");
            this.applySameCheckRulesCheck = false;
            return;
        }
        if (this.applySameCheckRulesCheck) {
            this.overallProfileTableBody = JSON.parse(JSON.stringify(this.profileTableBody));
        }
        else {
            this.overallProfileTableBody = this.tempProfOverallDataTable;
        }
    }
    validateAndSetKeywordArray() {
        if (!this.validateAndSetChkProfPeriodic())
            return false;
        if (!this.validateAndSetChkProfOverall())
            return false;
        //All validation success
        for (let i = 0; i < this.screenKeywordList.length; i++) {
            this.schData.saveKeywordData[this.screenKeywordList[i]] = this.arrKeywordData[this.screenKeywordList[i]].data;
        }
        return true;
    }
    validateAndSetChkProfOverall() {
        let tempObj = [];
        if (this.overallPassFailOptionValue == "y") {
            //validation here
            if ((this.baseline1Check && !this.baselineName1) || (this.baseline2Check && !this.baselineName2) || (this.baseline3Check && !this.baselineName3)) {
                this.scenUtilsService.errorMessage("Please provide baseline name.");
                return;
            }
            if ((this.baseline1Check && !this.baseline1OptionValue) || (this.baseline2Check && !this.baseline2OptionValue) || (this.baseline3Check && !this.baseline3OptionValue)) {
                this.scenUtilsService.errorMessage("Please select a scenario.");
                return;
            }
            if ((this.baseline1Check && !this.secondBaseline1OptionValue) || (this.baseline2Check && !this.secondBaseline2OptionValue) || (this.baseline3Check && !this.secondBaseline3OptionValue)) {
                this.scenUtilsService.errorMessage("Please select a test run.");
                return;
            }
            if (!this.slaVal2 || this.slaVal2 <= 0 || this.slaVal2 > 100 || !this.yellowVal2 || this.yellowVal2 <= 0 || this.yellowVal2 > 100) {
                this.scenUtilsService.errorMessage("Threshold value for Metric can not be blank or less than 1 and more than 100");
                return false;
            }
            if (!this.testFailVal2 || this.testFailVal2 <= 0 || this.testFailVal2 > 100) {
                this.scenUtilsService.errorMessage("Overall Test Fails field value can not be blank or less than 1 and more than 100");
                return false;
            }
            if (this.slaVal2 > this.yellowVal2) {
                this.scenUtilsService.errorMessage("Green Metric threshold cannot be greater than Yellow Metric threshold.");
                return false;
            }
            if (this.overrideCheckOptionValue == "" && this.overrideCheckProfile) {
                this.scenUtilsService.errorMessage("Please select Baseline to override checkprofile SLA.");
                return;
            }
            if (this.overallProfileTableBody.length <= 0) {
                this.scenUtilsService.errorMessage("Single or multiple profile(s) must be selected");
                return;
            }
            let chkProfileStr = "";
            for (let i = 0; i < this.overallProfileTableBody.length; i++) {
                chkProfileStr += this.overallProfileTableBody[i]['Profile Name'] + ",";
            }
            chkProfileStr = chkProfileStr.indexOf(",") > -1 ? chkProfileStr.substring(0, chkProfileStr.length - 1) : chkProfileStr;
            this.tempProfOverallDataTable = this.overallProfileTableBody;
            tempObj.push(chkProfileStr);
            tempObj.push(this.endPassFailOptionValue);
            tempObj.push(this.slaVal2);
            tempObj.push(this.yellowVal2);
            tempObj.push(this.testFailVal2);
            if (this.baseline1Check) {
                let str = this.secondBaseline1OptionValue + ";" + this.baseline1OptionValue + ";" + this.baselineName1;
                tempObj.push(str);
            }
            else {
                tempObj.push("NA");
            }
            if (this.baseline2Check) {
                let str2 = this.secondBaseline2OptionValue + ";" + this.baseline2OptionValue + ";" + this.baselineName2;
                tempObj.push(str2);
            }
            else {
                tempObj.push("NA");
            }
            if (this.baseline3Check) {
                let str3 = this.secondBaseline3OptionValue + ";" + this.baseline3OptionValue + ";" + this.baselineName3;
                tempObj.push(str3);
            }
            else {
                tempObj.push("NA");
            }
            if (!this.overrideCheckProfile) {
                tempObj.push('0');
            }
            else if (this.overrideCheckProfile && this.overrideCheckOptionValue == '1') {
                tempObj.push(this.overrideCheckOptionValue);
            }
            else if (this.overrideCheckProfile && this.overrideCheckOptionValue == '2') {
                tempObj.push(this.overrideCheckOptionValue);
            }
            else if (this.overrideCheckProfile && this.overrideCheckOptionValue == '3') {
                tempObj.push(this.overrideCheckOptionValue);
            }
        }
        else {
        }
        this.setArrayWithKeyWord("CHECK_PROFILE_OVERALL", tempObj);
        return true;
    }
    validateAndSetChkProfPeriodic() {
        let tempObj = [];
        if (this.passFailOptionValue == "y") {
            //validation here
            if (!this.windowVal || this.windowVal <= 0) {
                this.scenUtilsService.errorMessage(`Interval value can not be blank and less than 1`);
                return false;
            }
            if (this.profileTableBody.length <= 0) {
                this.scenUtilsService.errorMessage("Single or multiple profile(s) must be selected");
                return false;
            }
            if (!this.slaVal || this.slaVal <= 0 || this.slaVal > 100 || !this.yellowVal || this.yellowVal <= 0 || this.yellowVal > 100) {
                this.scenUtilsService.errorMessage("Threshold value for Metric can not be blank or less than 1 and more than 100");
                return false;
            }
            if (!this.testFailVal || this.testFailVal <= 0 || this.testFailVal > 100) {
                this.scenUtilsService.errorMessage("Overall Test Fails field value can not be blank or less than 1 and more than 100");
                return false;
            }
            if (this.slaVal > this.yellowVal) {
                this.scenUtilsService.errorMessage("Green Metric threshold cannot be greater than Yellow Metric threshold.");
                return false;
            }
            let chkProfileStr = "";
            for (let i = 0; i < this.profileTableBody.length; i++) {
                chkProfileStr += this.profileTableBody[i]['Profile Name'] + ",";
            }
            chkProfileStr = chkProfileStr.indexOf(",") > -1 ? chkProfileStr.substring(0, chkProfileStr.length - 1) : chkProfileStr;
            tempObj.push(chkProfileStr);
            tempObj.push(this.runRulesOptionValue);
            tempObj.push(this.windowVal);
            if (this.skipPhaseCheck) {
                tempObj.push(1);
            }
            else {
                tempObj.push(0);
            }
            if (this.stopTestCheck) {
                tempObj.push(1);
            }
            else {
                tempObj.push(0);
            }
            tempObj.push(this.slaVal);
            tempObj.push(this.yellowVal);
            tempObj.push(this.testFailVal);
            if (this.generatePassFailCheck) {
                tempObj.push(this.caseOptionValue);
            }
            else {
                tempObj.push(0);
            }
        }
        this.setArrayWithKeyWord("CHECK_PROFILE_PERIODIC", tempObj);
        return true;
    }
    setArrayWithKeyWord(keyword, temObj) {
        let dataObj = this.arrKeywordData[keyword].data;
        if (dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_5__["GLOBAL_KEY"]] != undefined) {
            dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_5__["GLOBAL_KEY"]] = [];
            dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_5__["GLOBAL_KEY"]].push(temObj);
        }
        else {
            dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_5__["GLOBAL_KEY"]] = [temObj];
        }
    }
    deleteRowDataOverAll(rowData) {
        this.overallProfileTableBody = this.overallProfileTableBody.filter(res => {
            return res["Profile Name"] != rowData["Profile Name"];
        });
        this.tempProfOverallDataTable = this.overallProfileTableBody;
    }
    deleteRowDataPeriodic(rowData) {
        this.profileTableBody = this.profileTableBody.filter(res => {
            return res["Profile Name"] != rowData["Profile Name"];
        });
    }
    onOverallSlaClick() {
        try {
            if (!this.overrideCheckProfile) {
                this.overrideCheckOptionValue = "";
            }
        }
        catch (e) {
            console.error(e);
        }
    }
    /**
     * This method will return check profile list of all projects/subprojects of the controller.
     */
    fillCheckProfDD(projSubProj) {
        this.secondSelectCheckProfileValue = "";
        this.selectCheckProfileValue = "";
        return new Promise((res, rej) => {
            this.scenShareService.getProjSubProjList().then(() => Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
                this.getChkProfileList(projSubProj, this.username).then(() => {
                    res(true);
                });
            }));
        });
    }
    getProjSubProj(checkProfArr) {
        let projSubProjStr = "";
        for (let i in checkProfArr) {
            if (i == '0')
                projSubProjStr = checkProfArr[i].substr(0, checkProfArr[i].lastIndexOf("/"));
            else {
                projSubProjStr = projSubProjStr + "," + checkProfArr[i].substr(0, checkProfArr[i].lastIndexOf("/"));
            }
        }
        return projSubProjStr;
    }
    populateProjList() {
        this.projectList = [];
        this.subProjectList = [];
        this.selectCheckProfile = [];
        this.projectList.push({ label: 'Select Project', value: null });
        this.overallProjectList.push({ label: 'Select Project', value: null });
        for (let i = 0; i < this.scenShareService.totalProjSubProjData.length; i++) {
            if (this.projectList.map(ele => ele.label).indexOf(this.scenShareService.totalProjSubProjData[i].project) == -1)
                this.projectList.push({ label: this.scenShareService.totalProjSubProjData[i].project, value: this.scenShareService.totalProjSubProjData[i].project });
            if (this.overallProjectList.map(ele => ele.label).indexOf(this.scenShareService.totalProjSubProjData[i].project) == -1)
                this.overallProjectList.push({ label: this.scenShareService.totalProjSubProjData[i].project, value: this.scenShareService.totalProjSubProjData[i].project });
        }
        this.selProject = this.projectList[0].value;
        this.selOverallProject = this.overallProjectList[0].value;
        this.populateSubProject();
        this.populateOverallSubProject();
    }
    populateSubProject() {
        this.subProjectList = [];
        this.selectCheckProfile = [];
        this.selectCheckProfileValue = "";
        if (!this.selProject)
            this.subProjectList.push({ label: 'Select Sub Project', value: null });
        for (let i in this.scenShareService.totalProjSubProjData) {
            if (this.selProject == this.scenShareService.totalProjSubProjData[i].project) {
                this.subProjectList.push({ label: this.scenShareService.totalProjSubProjData[i].subproject, value: this.scenShareService.totalProjSubProjData[i].subproject });
            }
        }
        this.selSubProject = this.subProjectList[0].value;
        if (this.selSubProject)
            this.fillCheckProfDD(`${this.selProject}/${this.selSubProject}`);
    }
    populateOverallSubProject() {
        this.overallSubProjectList = [];
        this.selectCheckProfile = [];
        this.secondSelectCheckProfileValue = "";
        if (!this.selOverallProject)
            this.overallSubProjectList.push({ label: 'Select Sub Project', value: null });
        for (let i in this.scenShareService.totalProjSubProjData) {
            if (this.selOverallProject == this.scenShareService.totalProjSubProjData[i].project) {
                this.overallSubProjectList.push({ label: this.scenShareService.totalProjSubProjData[i].subproject, value: this.scenShareService.totalProjSubProjData[i].subproject });
            }
        }
        this.selOverallSubProject = this.overallSubProjectList[0].value;
        if (this.selOverallSubProject)
            this.fillCheckProfDD(`${this.selOverallProject}/${this.selOverallSubProject}`);
    }
    ngOnDestroy() {
        if (this.saveSubscription)
            this.saveSubscription.unsubscribe();
    }
};
LogsPassFailCriteriaComponent.ctorParameters = () => [
    { type: _service_scen_keyword_definition_service__WEBPACK_IMPORTED_MODULE_3__["ScenKeywordDefinitionService"] },
    { type: _service_scenario_http_service__WEBPACK_IMPORTED_MODULE_4__["ScenarioHttpService"] },
    { type: _service_additional_setting_data_service__WEBPACK_IMPORTED_MODULE_9__["AdditionalSettingsDataService"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_6__["SessionService"] },
    { type: _service_scenario_utils_service__WEBPACK_IMPORTED_MODULE_7__["ScenarioUtilsService"] },
    { type: _service_sch_schedule_data_service__WEBPACK_IMPORTED_MODULE_8__["SchScheduleDataService"] },
    { type: _service_scenario_share_service__WEBPACK_IMPORTED_MODULE_10__["ScenarioSharedService"] }
];
LogsPassFailCriteriaComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-logs-pass-fail-criteria',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./logs-pass-fail-criteria.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./logs-pass-fail-criteria.component.scss */ "./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.component.scss")).default]
    })
], LogsPassFailCriteriaComponent);



/***/ }),

/***/ "./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.module.ts":
/*!*******************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.module.ts ***!
  \*******************************************************************************************************************/
/*! exports provided: LogsPassFailCriteriaModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogsPassFailCriteriaModule", function() { return LogsPassFailCriteriaModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
/* harmony import */ var _logs_pass_fail_criteria_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logs-pass-fail-criteria.component */ "./src/app/pages/scenario/additional-settings-main/logs-pass-fail-criteria/logs-pass-fail-criteria.component.ts");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var _interface_scenario_routing_guard__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../interface/scenario-routing-guard */ "./src/app/pages/scenario/interface/scenario-routing-guard.ts");
/* harmony import */ var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/shared/cav-table/cav-table.module */ "./src/app/shared/cav-table/cav-table.module.ts");









const route = [
    { path: '', component: _logs_pass_fail_criteria_component__WEBPACK_IMPORTED_MODULE_3__["LogsPassFailCriteriaComponent"], canDeactivate: [_interface_scenario_routing_guard__WEBPACK_IMPORTED_MODULE_7__["ScenRoutingGuard"]] }
];
let LogsPassFailCriteriaModule = class LogsPassFailCriteriaModule {
};
LogsPassFailCriteriaModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [_logs_pass_fail_criteria_component__WEBPACK_IMPORTED_MODULE_3__["LogsPassFailCriteriaComponent"]],
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["FileUploadModule"],
            _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["DropdownModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["ButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["BreadcrumbModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["SelectButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["InputTextModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["MultiSelectModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["TableModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["CardModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["CheckboxModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["MessageModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["RadioButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["SpinnerModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["TooltipModule"],
            _angular_router__WEBPACK_IMPORTED_MODULE_5__["RouterModule"].forChild(route),
            src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_8__["CavTableModule"],
        ],
        exports: [_logs_pass_fail_criteria_component__WEBPACK_IMPORTED_MODULE_3__["LogsPassFailCriteriaComponent"]]
    })
], LogsPassFailCriteriaModule);



/***/ })

}]);