eHealthAfrica/direct-delivery-dashboard

View on GitHub
src/app/planning/schedule/import/schedule-import-dialog.html

Summary

Maintainability
Test Coverage
<div class="modal-header alert-info">
  <h3>Import Delivery Scheduling Data for - {{ sdidCtrl.roundCode }}</h3>
</div>

<!-- Modal body section -->
<div class="modal-body">
  <div class="col-sm-15">
    <div class="row">
      <div class="col-sm-6">
        <ng-csv-import
            class="btn btn-default btn-lg"
            content="sdidCtrl.csv.content"
            header="sdidCtrl.csv.header"
            separator="sdidCtrl.csv.separator"
            result="sdidCtrl.csv.result">
        </ng-csv-import>
      </div>
      <div class="col-sm-6" align="left">
        <button class="btn btn-primary btn-lg"
                ng-disabled="sdidCtrl.getSize() <= 0"
                ng-click="sdidCtrl.applyImport()">
          <i class="fa fa-cog"></i>
          <span>Apply Changes</span>
        </button>
        <button class="btn btn-default btn-lg" ng-click="sdidCtrl.close()">
          <i class="fa fa-times"></i>
          <span>Close</span>
        </button>
      </div>
    </div>
    <br/><br/>

    <div class="alert alert-info" ng-show="sdidCtrl.csv.result">
      <strong>Uploaded {{ sdidCtrl.getSize() }} rows successfully!</strong>
    </div>
    <br/><br/>

    <!-- processed result  -->
    <div class="row container-fluid">
      <table class="table table-condensed table-striped table-bordered wrapped-content">
        <thead>
        <tr>
          <th>#</th>
          <th class="col-sm-2" ng-bind="sdidCtrl.headers.roundCode.text"></th>
          <th class="col-sm-2" ng-bind="sdidCtrl.headers.facilityName.text"></th>
          <th class="col-sm-2" ng-bind="sdidCtrl.headers.facilityCode.text"></th>
          <th class="col-sm-1" ng-bind="sdidCtrl.headers.deliveryDate.text"></th>
          <th class="col-sm-2" ng-bind="sdidCtrl.headers.driverID.text"></th>
          <th class="col-sm-1" ng-bind="sdidCtrl.headers.drop.text"></th>
          <th class="col-sm-1" ng-bind="sdidCtrl.headers.window.text"></th>
          <th class="col-sm-1" ng-bind="sdidCtrl.headers.distance.text">Distance (KM)</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="row in sdidCtrl.csv.result"
            ng-class="{'danger': !sdidCtrl.isValid(row) }">
          <td ng-bind="($index + 1)"></td>
          <td ng-bind="row[sdidCtrl.headers.roundCode.text]"></td>
          <td ng-bind="row[sdidCtrl.headers.facilityName.text]"></td>
          <td ng-bind="row[sdidCtrl.headers.facilityCode.text]"></td>
          <td ng-bind="row[sdidCtrl.headers.deliveryDate.text]"></td>
          <td ng-bind="row[sdidCtrl.headers.driverID.text]"></td>
          <td ng-bind="row[sdidCtrl.headers.drop.text]"></td>
          <td ng-bind="row[sdidCtrl.headers.window.text]"></td>
          <td ng-bind="row[sdidCtrl.headers.distance.text]"></td>
        </tr>
        </tbody>
      </table>
    </div>

  </div>
</div>

<!-- modal footer section-->
<div class="modal-footer">
  <button class="btn btn-default btn-lg" ng-click="sdidCtrl.close()">
    <i class="fa fa-times"></i>
    <span>Close</span>
  </button>
</div>