Advertisement
Guest User

directory.js

a guest
Jun 2nd, 2016
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// <reference path="../../../../_all.ts" />
  2.  
  3. namespace app.personnel.employee.directory {
  4.     import AbstractSearchController = incode.search.AbstractSearchController;
  5.     import SearchCriteria = incode.search.ISearchCriteria;
  6.     import Pager = incode.search.IPager;
  7.     import SearchMetaData = incode.search.ISearchMetaData;
  8.     import InputParameter = incode.search.IInputParameter;
  9.     import Facet = incode.search.IFacet;
  10.     import FacetType = incode.search.FacetType;
  11.     import Bucket = incode.search.IBucket;
  12.  
  13.     export class DirectoryComponentController extends AbstractSearchController {
  14.         searchEndpoint: string = "api/incode/personnel/EmployeeService/Search";
  15.         isLoading: boolean = false;
  16.         showFilter: boolean = false;
  17.         criteria: SearchCriteria;
  18.         pager: Pager;
  19.         lastResult: incode.core.IExecutionResult<SearchCriteria>;
  20.  
  21.         searchMetadata: SearchMetaData = { chips: [], filter: [] };
  22.         isAdvancedSearch: boolean = false;
  23.  
  24.         static $inject = ['$mdSidenav', '$mdDialog', 'appService'];
  25.         constructor(
  26.             $mdSidenav: angular.material.ISidenavService,
  27.             $mdDialog: angular.material.IDialogService,
  28.             appService: incode.app.IAppService) {
  29.  
  30.             super($mdSidenav, $mdDialog, appService);
  31.  
  32.             this.criteria = {
  33.                 From: 1,
  34.                 Size: 9,
  35.                 TotalHits: 0,
  36.                 IsAdvancedSearch: false,
  37.                 OrderBy: "LastName ASC",
  38.                 Parameters: [
  39.                     <InputParameter>{
  40.                         InputType: "text",
  41.                         Label: "Number",
  42.                         FieldId: "EmployeeNumber"
  43.                     },
  44.                     <InputParameter>{
  45.                         InputType: "text",
  46.                         Label: "First Name",
  47.                         FieldId: "FirstName"
  48.                     },
  49.                     <InputParameter>{
  50.                         InputType: "text",
  51.                         Label: "Last Name",
  52.                         FieldId: "LastName"
  53.                     },
  54.                     <InputParameter>{
  55.                         InputType: "text",
  56.                         Label: "Full Name",
  57.                         FieldId: "EmployeeFullName"
  58.                     },
  59.                     <InputParameter>{
  60.                         InputType: "text",
  61.                         Label: "Department",
  62.                         FieldId: "DepartmentDescription"
  63.                     }
  64.                 ],
  65.                 Facets: [
  66.                     <Facet>{
  67.                         IndexFieldName: "Department",
  68.                         Name: "Department",
  69.                         Type: FacetType.Multiselect
  70.                     },
  71.                     <Facet>{
  72.                         IndexFieldName: "BirthDate",
  73.                         Name: "Birth Date",
  74.                         Type: FacetType.DateRange
  75.                     },
  76.                     <Facet>{
  77.                         IndexFieldName: "HireDate",
  78.                         Name: "Hire Date",
  79.                         Type: FacetType.DateRange
  80.                     },
  81.                     <Facet>{
  82.                         IndexFieldName: "SexTypeValue",
  83.                         Name: "Gender",
  84.                         Type: FacetType.Multiselect
  85.                     }],
  86.                 Properties: [
  87.                     "EmployeeId",
  88.                     "EmployeeNumber",
  89.                     "FirstName",
  90.                     "LastName",
  91.                     "EmployeeFullName",
  92.                     "EmailAddress",
  93.                     "DepartmentId",
  94.                     "Department",
  95.                     "DepartmentDescription",
  96.                     "PhoneNumber",
  97.                     "PhoneNumberExt",
  98.                     "HireDate",
  99.                     "BirthDate",
  100.                     "SexTypeValue",
  101.                     "PrimaryPositionTitle",
  102.                     "DepartmentRowNum",
  103.                     "BirthMonthRowNum",
  104.                     "AnniversaryRowNum"]
  105.             };
  106.  
  107.             this.pager = {
  108.                 pages: [],
  109.                 totalPages: 0,
  110.                 selectedPage: 1,
  111.                 maxPages: 5,
  112.                 previous: false,
  113.                 next: false,
  114.                 first: false,
  115.                 last: false
  116.             };
  117.  
  118.             this.activate();
  119.  
  120.         }
  121.     }
  122.  
  123.     export class DirectorySearchComponent implements ng.IComponentOptions {
  124.         public templateUrl: string;
  125.         public controller: any;
  126.         public controllerAs: string = "directory";
  127.         public transclude: boolean = true;
  128.  
  129.         constructor() {
  130.             this.templateUrl = "employee/directory/directory.tmpl.html";
  131.             this.controller = DirectoryComponentController;
  132.         }
  133.     }
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement