blob: caed0c2319190fd939f1cc6f4bfff64004351066 [file] [log] [blame]
<!--
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.
-->
<div class="container-fluid">
<div class="row">
<h5 class="over-title margin-bottom-15">Create DQ Model</h5>
</div><!--//row-->
<div class="row">
<form name="Form" id="form" novalidate>
<div id="wizard" class="swMain" >
<ul>
<li ng-click="form.goTo(Form, 1)">
<a href="" ng-class="{'selected' : currentStep >= 1, 'done' : currentStep > 1}" class="selected" style="">
<div class="stepNumber">
1
</div>
<span class="stepDesc text-small"> Choose Target </span>
</a>
</li>
<li ng-click="form.goTo(Form, 2)">
<a href="" ng-class="{'selected' : currentStep >= 2, 'done' : currentStep > 2}" class="" style="">
<div class="stepNumber">
2
</div>
<span class="stepDesc text-small"> Select Models </span>
</a>
</li>
<li ng-click="form.goTo(Form, 3)">
<a href="" ng-class="{'selected' : currentStep >= 3, 'done' : currentStep > 3}" class="" style="">
<div class="stepNumber">
3
</div>
<span class="stepDesc text-small"> Configuration </span>
</a>
</li>
</ul>
<div id="step-1" ng-show="currentStep == 1" class="formStep" >
<label class="stepDesc">This step let you choose the target for data quality comparision with target, Apollo datasets are enabled, other platofrms are coming soon. Currently you can only select the attributes from one schema</label>
<div class="container-fluid">
<!-- select db tree -->
<div class="col-md-4 col-lg-4 col-sm-4">
<fieldset>
<legend>Please select schema</legend>
<div class="add-dataset" style="color:#b2c831">
<a class="bark-link" href="#/createdataasset">Cannot find your DataAsset? Click here to add</a>
</div>
<div angular-treeview="true"
tree-model="dbList"
node-id="id"
node-label="name"
node-children="children"
l1-icon="fa fa-database"
l2-icon="fa fa-table"
l3-icon="fa fa-file-text-o"
class="y-scrollable">
</div>
</fieldset>
</div>
<!-- schema definition list -->
<div class="col-md-8 col-lg-8 col-sm-8">
<fieldset>
<legend>
Select one attribute
</legend>
<div class="y-scrollable">
<div>
<label>View schema:</label> <i ng-show="currentNode.parent" style="color:#fff;font-weight: bold;">{{currentNode.parent.name}}.{{currentNode.name}}</i>
</div>
<div>
<label>Selected Column:</label> <i style="color:#fff;font-weight: bold;">{{form.selection}}</i>
</div>
<div>
<table st-table="schemaCollection" class="table table-striped">
<thead>
<tr style="background-color:#7D95CC">
<th></th>
<th>Column Name</th>
<th>Description</th>
<th>Data Type</th>
<th>Sample Data</th>
</tr>
</thead>
<tbody>
<tr ng-if="!schemaCollection || schemaCollection.length == 0">
<td colspan="5" style="text-align:center" ><span class="highlight">Please select a schema from the left tree first</span></td>
</tr>
<tr ng-repeat="row in schemaCollection">
<td><input type="radio"
name="selAttr"
value="{{row.name}}"
ng-model="form.selection"
/>
</td>
<td>{{row.name}}</td>
<td>{{row.desc}}</td>
<td>{{row.type}}</td>
<td class="highlight">{{row.sample}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</fieldset>
</div>
<div class="form-group btn-container">
<button class="btn btn-primary btn-o next-step btn-wide pull-right" ng-click="form.next(Form)">
Next <i class="fa fa-arrow-circle-right"></i>
</button>
</div>
</div>
</div>
<div id="step-2" ng-show="currentStep == 2" class="formStep" >
<label class="stepDesc">Please choose one of the validity models provided below:</label>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<fieldset>
<div class="y-scrollable">
<div class="container col-md-12 col-lg-12 col-sm-12">
<div class="row">
<div class="col-md-3 col-lg-3 col-sm-3">
<h5>Simple Statistics</h5>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<input name="vaType" type="radio" ng-model="form.vaType" value="2" ng-init="form.vaType=2" /> <label>Null Count</label>
</div>
</div>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<input name="vaType" type="radio" ng-model="form.vaType" value="3"/> <label>Unique Count</label>
</div>
</div>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<input name="vaType" type="radio" ng-model="form.vaType" value="4"/> <label>Duplicate Count</label>
</div>
</div>
<h5>Summary Statistics</h5>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<input name="vaType" type="radio" ng-model="form.vaType" value="5"/> <label>Maximum</label>
</div>
</div>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<input name="vaType" type="radio" ng-model="form.vaType" value="6"/> <label>Minimum</label>
</div>
</div>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<input name="vaType" type="radio" ng-model="form.vaType" value="7"/> <label>Mean</label>
</div>
</div>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<input name="vaType" type="radio" ng-model="form.vaType" value="8"/> <label>Median</label>
</div>
</div>
<h5>Advanced Statistics</h5>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<input name="vaType" type="radio" ng-model="form.vaType" value="9" disabled/> <label>Regular Expression Match</label>
</div>
</div>
</div>
<div class="col-md-9 col-lg-9 col-sm-9" ng-include="'/pages/measures/va-explaination.html'">
<!-- <ng-include src="'/models.html'"/> -->
</div>
</div>
</div>
</div>
</fieldset>
</div>
<div class="form-group btn-container" >
<button class="btn btn-primary btn-o back-step btn-wide pull-left" ng-click="form.prev(Form)">
<i class="fa fa-arrow-circle-left"></i> Back
</button>
<button class="btn btn-primary btn-o next-step btn-wide pull-right" ng-click="form.next(Form)">
Next <i class="fa fa-arrow-circle-right"></i>
</button>
</div>
</div>
</div>
<div id="step-3" ng-show="currentStep == 3" class="formStep" >
<label class="stepDesc">Please setup the model required information</label>
<div class="container-fluid">
<!-- schema definition list -->
<div class="col-md-12 col-lg-12 col-sm-12">
<fieldset>
<legend>
Required Information
</legend>
<div class="y-scrollable">
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group" ng-class="{'has-error':Form.ruleName.$dirty&&Form.ruleName.$invalid, 'has-success':Form.ruleName.$valid}">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Model Name<span class="symbol required"></span>:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<input type="text" class="form-control" ng-model="form.basic.name" name="ruleName" placeholder="Please input the measure name" required ng-pattern="'([0-9a-zA-Z\\_\\-])+'">
<span class="error text-small block " ng-if="Form.ruleName.$dirty && Form.ruleName.$error.required">Model Name is required</span>
<span class="error text-small block " ng-if="Form.ruleName.$dirty && Form.ruleName.$error.pattern">Only letter, number, "-" and "_" are allowed</span>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Model Definition:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<input type="text" class="form-control" ng-model="form.basic.desc" placeholder="Please input detail description of your model">
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label for="typeSelector" class="col-md-2 col-lg-2 col-sm-2 control-label">
Model Type:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<select id="typeSelector" class="form-control" ng-model="form.basic.type" ng-init="form.basic.type='1'" disabled required>
<option ng-repeat="row in ruleTypes" value="{{$index}}" >{{row}}</option>
</select>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label for="systemSelector" class="col-md-2 col-lg-2 col-sm-2 control-label">
Organization:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<select id="systemSelector" class="form-control" ng-model="form.basic.system" required disabled>
<option ng-repeat="row in ruleSystems" value="{{$index}}" >{{row}}</option>
</select>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
DataAsset:
</label>
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="text" class="form-control" ng-model="currentNode.name" disabled>
</div>
</div>
</div>
<div ng-show="form.vaType==9" class="col-md-12 col-lg-12 col-sm-12" ng-class="{'has-error':Form.regex.$dirty && Form.regex.$invalid, 'has-success':Form.regex.$valid}">
<div class="form-group">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Regular Expression<span class="symbol required"></span>:
</label>
<div class="col-md-10 col-lg-10 col-sm-10">
<div class="row">
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="text" class="form-control" ng-model="form.basic.regex" name="regex" placeholder="Some expression like ^[A-Za-z]+$" ng-required="form.vaType==9" ng-change="form.testRegex(Form)">
<span class="error text-small block" ng-if="Form.regex.$dirty && Form.regex.$invalid">Please input valid regular expression.</span>
</div>
<div class="col-md-2 col-lg-2 col-sm-2">
<button type="button" class="btn btn-primary btn-o next-step" style="width:100%;" ng-click="needTestRegex=!needTestRegex" ng-init="needTestRegex=false;"><i class="faChevron" ng-class="needTestRegex ?'fa fa-angle-down':'fa fa-angle-right'" style="width:10px"></i>&nbsp;Test Regex</button>
</div>
</div>
<div class="row" ng-show="needTestRegex">
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="text" class="form-control" ng-model="form.basic.regexTestStr" name="regexTestStr" placeholder="Please input the test string here" ng-change="form.testRegex(Form)">
</div>
<div class="col-md-2 col-lg-2 col-sm-2" style="padding-top:8px;">
<span class="test-result" ng-class="{'bg-success': regexTestResult=='Matched', 'bg-danger': regexTestResult=='Unmatched'}">{{regexTestResult}}</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group" ng-class="{'has-error':Form.threshold.$invalid}">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Threshold:
</label>
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="number" class="form-control" ng-model="form.basic.threshold" name="threshold">
<span class="error text-small block" ng-if="Form.threshold.$error.number">Only number is allowed</span>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Schedule Type:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<select class="form-control" ng-init="form.basic.scheduleType='1'" ng-model="form.basic.scheduleType" ng-init="form.basic.scheduleType='0'">
<option ng-repeat="row in scheduleTypes" value="{{$index}}" >{{row}}</option>
</select>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group" ng-class="{'has-error':Form.email.$dirty&&Form.email.$invalid, 'has-success':Form.email.$valid}">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Notification email<span class="symbol required"></span>:
</label>
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="email" class="form-control" ng-model="form.basic.email" name="email" ng-required="currentStep==3" placeholder="Please input valid email address" ng-pattern="'^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$'">
<span class="error text-small block" ng-if="Form.email.$dirty&&Form.email.$invalid">Please, enter a valid email address.</span>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Owner:
</label>
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="text" class="form-control" ng-model="form.basic.owner" ng-init="form.basic.owner=ntAccount" disabled>
</div>
</div>
</div>
</div>
<!-- <div style="color:#fff">
<label style="color:#b2c831">Tips: </label>After submitted, please go to "Rule Repository" to check the rule status
</div> -->
<div style="color:#b2c831">
<p>
<i class="fa fa-info-circle"></i> After submitted, please go to "<a class="bark-link" href="#/measures">Models</a>" to check the model status
</p>
</div>
</fieldset>
</div>
<div class="form-group btn-container" >
<button class="btn btn-primary btn-o back-step btn-wide pull-left" ng-click="form.prev(Form)">
<i class="fa fa-arrow-circle-left"></i> Back
</button>
<button class="btn btn-primary btn-o next-step btn-wide pull-right" ng-click="form.submit(Form)">
<!-- <button class="btn btn-primary btn-o next-step btn-wide pull-right" data-toggle="modal" data-target="#confirm"> -->
Submit
</button>
</div>
</div>
</div>
<div class="modal fade" id="confirm-va" role="dialog">
<div class="modal-dialog modal-xg modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Save the model with the below information?</h4>
</div>
<div class="modal-body">
<ng-include src="'/pages/measures/confirmation-va.html'"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" ng-click="form.save()">Save</button>
</div>
</div>
</div>
</div>
</form>
</div><!--//row-->
</div>