소스 검색

Changed person model to reflect data returned from JSON API

Joe Hawkins 8 년 전
부모
커밋
61a4f0696d

+ 7 - 5
src/main/angular/src/models/person.model.ts

@@ -1,13 +1,15 @@
 export default class Person {
-    userKey: string;
-    photoUrl: string;
+    detail: any;
+    displayNames: string[];
     orgChartParentKey: string;
-    fields: any[];
+    photoURL: string;
+    userKey: string;
 
     constructor(options: any) {
-        this.fields = options.fields;
+        this.detail = options.detail;
+        this.displayNames = options.displayNames;
         this.orgChartParentKey = options.orgChartParentKey;
-        this.photoUrl = options.photoUrl;
+        this.photoURL = options.photoURL;
         this.userKey = options.userKey;
     }
 }

+ 16 - 16
src/main/angular/src/orgchart/orgchart.component.html

@@ -10,39 +10,39 @@
              ng-click="$ctrl.selectPerson(manager.userKey)">
             <div class="orgchart-separator" ng-class="{first:$first,last:$last}"></div>
             <div class="orgchart-picture">
-                <img ng-src="{{ manager.photoUrl }}" />
+                <img ng-src="{{ manager.photoURL }}" />
             </div>
             <div class="orgchart-manager-fields">
-                <div class="orgchart-field orgchart-field-0">{{ manager.fields[0].value }}</div>
-                <div class="orgchart-field orgchart-field-1">{{ manager.fields[1].value }}</div>
+                <div class="orgchart-field orgchart-field-0">{{ manager.displayNames[0] }}</div>
+                <div class="orgchart-field orgchart-field-1">{{ manager.displayNames[1] }}</div>
             </div>
         </div>
     </div>
 
     <div class="orgchart-primary-person">
-        <img class="orgchart-picture" ng-src="{{ $ctrl.person.photoUrl }}" />
+        <img class="orgchart-picture" ng-src="{{ $ctrl.person.photoURL }}" />
         <div class="orgchart-num-reports" ng-if="$ctrl.directReports.length">{{ $ctrl.directReports.length }}</div>
 
-        <div class="orgchart-primary-field orgchart-field-0">{{ $ctrl.person.fields[0].value }}</div>
-        <div class="orgchart-primary-field orgchart-field orgchart-field-1">{{ $ctrl.person.fields[1].value }}</div>
-        <div class="orgchart-primary-field orgchart-field orgchart-field-2">{{ $ctrl.person.fields[2].value }}</div>
-        <div class="orgchart-primary-field orgchart-field orgchart-field-3">{{ $ctrl.person.fields[3].value }}</div>
-        <div class="orgchart-primary-field orgchart-field orgchart-field-4">{{ $ctrl.person.fields[4].value }}</div>
-        <div class="orgchart-primary-field orgchart-field orgchart-field-5">{{ $ctrl.person.fields[5].value }}</div>
-        <div class="orgchart-primary-field orgchart-field orgchart-field-6">{{ $ctrl.person.fields[6].value }}</div>
+        <div class="orgchart-primary-field orgchart-field-0">{{ $ctrl.person.displayNames[0] }}</div>
+        <div class="orgchart-primary-field orgchart-field orgchart-field-1">{{ $ctrl.person.displayNames[1] }}</div>
+        <div class="orgchart-primary-field orgchart-field orgchart-field-2">{{ $ctrl.person.displayNames[2] }}</div>
+        <div class="orgchart-primary-field orgchart-field orgchart-field-3">{{ $ctrl.person.displayNames[3] }}</div>
+        <div class="orgchart-primary-field orgchart-field orgchart-field-4">{{ $ctrl.person.displayNames[4] }}</div>
+        <div class="orgchart-primary-field orgchart-field orgchart-field-5">{{ $ctrl.person.displayNames[5] }}</div>
+        <div class="orgchart-primary-field orgchart-field orgchart-field-6">{{ $ctrl.person.displayNames[6] }}</div>
     </div>
 
     <div class="orgchart-direct-reports-title orgchart-title">Direct Reports</div>
     <div class="orgchart-direct-reports person-card-list" ng-if="$ctrl.directReports.length">
         <div class="person-card" ng-repeat="directReport in $ctrl.directReports"
             ng-click="$ctrl.selectPerson(directReport.userKey)">
-            <div class="person-card-image"><img ng-src="{{ directReport.photoUrl }}" /></div>
+            <div class="person-card-image"><img ng-src="{{ directReport.photoURL }}" /></div>
             <div class="orgchart-num-reports" ng-if="directReport.numOfReports">{{ directReport.numOfReports }}</div>
             <div class="person-card-details">
-                <div class="person-card-row-1">{{ directReport.fields[0].value }}</div>
-                <div class="person-card-row-2">{{ directReport.fields[1].value }}</div>
-                <div class="person-card-row-3">{{ directReport.fields[2].value }}</div>
-                <div class="person-card-row-4">{{ directReport.fields[3].value }}</div>
+                <div class="person-card-row-1">{{ directReport.displayNames[0] }}</div>
+                <div class="person-card-row-2">{{ directReport.displayNames[1] }}</div>
+                <div class="person-card-row-3">{{ directReport.displayNames[2] }}</div>
+                <div class="person-card-row-4">{{ directReport.displayNames[3] }}</div>
             </div>
         </div>
     </div>

+ 5 - 5
src/main/angular/src/peoplesearch/peoplesearch-cards.component.html

@@ -1,11 +1,11 @@
 <div class="person-card-list">
-    <div class="person-card" ng-repeat="person in $ctrl.people" ng-click="$ctrl.selectPerson(person.id)">
+    <div class="person-card" ng-repeat="person in $ctrl.people" ng-click="$ctrl.selectPerson(person.userKey)">
         <div class="person-card-image"></div>
         <div class="person-card-details">
-            <div class="person-card-row-1">{{ person.givenName }} {{ person.sn }}</div>
-            <div class="person-card-row-2">{{ person.title }}</div>
-            <div class="person-card-row-3">{{ person.telephoneNumber }}</div>
-            <div class="person-card-row-4">{{ person.mail }}</div>
+            <div class="person-card-row-1">{{ person.detail.givenName.values[0] }} {{ person.detail.sn.values[0]  }}</div>
+            <div class="person-card-row-2">{{ person.detail.title.values[0] }}</div>
+            <div class="person-card-row-3">{{ person.detail.telephoneNumber.values[0] }}</div>
+            <div class="person-card-row-4">{{ person.detail.mail.values[0] }}</div>
         </div>
     </div>
 </div>

+ 6 - 6
src/main/angular/src/peoplesearch/peoplesearch-table.component.html

@@ -9,12 +9,12 @@
         </tr>
     </thead>
     <tbody>
-        <tr ng-repeat="person in $ctrl.people" ng-click="$ctrl.selectPerson(person.id)">
-            <td>{{ person.givenName }}</td>
-            <td>{{ person.sn }}</td>
-            <td>{{ person.title }}</td>
-            <td>{{ person.mail }}</td>
-            <td>{{ person.telephoneNumber }}</td>
+        <tr ng-repeat="person in $ctrl.people" ng-click="$ctrl.selectPerson(person.userKey)">
+            <td>{{ person.detail.givenName.values[0] }}</td>
+            <td>{{ person.detail.sn.values[0] }}</td>
+            <td>{{ person.detail.title.values[0] }}</td>
+            <td>{{ person.detail.mail.values[0] }}</td>
+            <td>{{ person.detail.telephoneNumber.values[0] }}</td>
         </tr>
     </tbody>
 </table>

+ 6 - 1
src/main/angular/src/peoplesearch/peoplesearch-table.component.ts

@@ -12,9 +12,10 @@ export default class PeopleSearchTableComponent {
     private deregistrationCallback: () => void;
     people: Person[];
 
-    static $inject = [ '$scope', 'PeopleSearchService' ];
+    static $inject = [ '$scope', '$state', 'PeopleSearchService' ];
     constructor(
         private $scope: IScope,
+        private $state: angular.ui.IStateService,
         private peopleSearchService: PeopleSearchService) {
     }
 
@@ -34,4 +35,8 @@ export default class PeopleSearchTableComponent {
     getPeople() {
         this.people = this.peopleSearchService.people;
     }
+
+    selectPerson(id: string) {
+        this.$state.go('orgchart', { personId: id });
+    }
 }

+ 678 - 324
src/main/angular/src/services/people.data.json

@@ -1,437 +1,791 @@
 [
   {
     "userKey": "1",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Andy Smith",
+      "ASST. C/O",
+      "(123) 456-7890",
+      "andy.smith@lapd.gov"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 3,
-    "fields": [
-      {
-        "fieldId": "name",
-        "name": "Name",
-        "value": "Andy Smith"
-      },
-      {
-        "fieldId": "phone",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "label": "Last Name",
+        "type": "text",
+        "values": [
+          "Smith"
+        ]
+      },
+      "givenName": {
+        "name": "givenName",
+        "label": "First Name",
+        "type": "text",
+        "values": [
+          "Andy"
+        ]
+      },
+      "telephoneNumber": {
         "name": "Phone",
-        "type": "phone",
-        "value": "(123) 456-7890"
-      },
-      {
-        "fieldId": "email",
-        "name": "Email",
+        "type": "tel",
+        "values": [
+          "(123) 456-7890"
+        ]
+      },
+      "mail": {
+        "name": "mail",
+        "label": "Email Address",
         "type": "email",
-        "value": "andy.smith@lapd.gov"
-      },
-      {
-        "fieldId": "title",
-        "name": "Title",
-        "value": "ASST. C/O"
-      },
-      {
-        "fieldId": "department",
+        "values": [
+          "andy.smith@lapd.gov"
+        ]
+      },
+      "title": {
+        "name": "title",
+        "label": "Title",
+        "values": [
+          "ASST. C/O"
+        ]
+      },
+      "department": {
         "name": "Department",
-        "value": "Office of Operations"
+        "values": [
+          "Office of Operations"
+        ]
       },
-      {
-        "fieldId": "manager",
+      "manager": {
         "name": "Manager",
-        "value": "Debra McCarthy",
+        "values": [
+          "Debra McCarthy"
+        ],
         "type": "person-link",
         "typeMetaData": {
           "userKey": "3"
         }
       }
-    ]
+    }
   },
   {
     "userKey": "3",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Debra McCarthy",
+      "Deputy Chief"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": null,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Debra McCarthy",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Deputy Chief"
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "McCarthy"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Debra"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Deputy Chief"
+        ]
       }
-    ]
+    }
   },
   {
     "userKey": "4",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Earl Paysinger",
+      "Assistant Chief"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 3,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Earl Paysinger",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Assistant Chief"
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Paysinger"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Earl"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Assistant Chief"
+        ]
       }
-    ]
+    }
   },
   {
     "userKey": "5",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Charlie Beck",
+      "Chief of Police"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 3,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Charlie Beck",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Chief of Police"
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Beck"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Charlie"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Chief of Police"
+        ]
       }
-    ]
+    }
   },
   {
     "userKey": "6",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "John W. Mack",
+      "CFO"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 3,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "John W. Mack",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "Commissioner",
-        "value": "CFO"
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Mack"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "John W. "
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "Commissioner": {
+        "values": [
+          "CFO"
+        ]
       }
-    ]
+    }
   },
   {
     "userKey": "7",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "R. Tefank",
+      "Executive Director"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 3,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "R. Tefank",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Executive Director"
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Tefank"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "R."
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Executive Director"
+        ]
       }
-    ]
+    }
   },
   {
     "userKey": "8",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Elmer Davis",
+      "Captain III"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 3,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Elmer Davis",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain III"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x001",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "elmer.davis@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Davis"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Elmer"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain III"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x001"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "elmer.davis@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "9",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "William Hart",
+      "Captain I"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 3,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "William Hart",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain I"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x002",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "william.hart@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Hart"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "William"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain I"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x002"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "william.hart@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "10",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Bob Ginmala",
+      "Captain III"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 3,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Bob Ginmala",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain III"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x003",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "bob.ginmala@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Ginmala"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Bob"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain III"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x003"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "bob.ginmala@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "11",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Peter Wittingham",
+      "Captain I"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 1,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Peter Wittingham",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain I"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x004",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "peter.wittingham@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Wittingham"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Peter"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain I"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x004"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "peter.wittingham@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "12",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Elena Nathan",
+      "Captain III"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 1,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Elena Nathan",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain III"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x005",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "elena.nathan@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Nathan"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Elena"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain III"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x005"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "elena.nathan@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "13",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Rolphe DeLaTorre",
+      "Captain I"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 1,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Rolphe DeLaTorre",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain I"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x006",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "rolphe.delatorre@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "DeLaTorre"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Rolphe"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain I"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x006"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "rolphe.delatorre@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "14",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Mike Blake",
+      "Captain III"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 1,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Mike Blake",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain III"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x007",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "mike.blake@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Blake"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Mike"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain III"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x007"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "mike.blake@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "15",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Braeden Crump",
+      "Captain I"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 1,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Braeden Crump",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain I"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x007",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "braeden.crump@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Crump"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Braeden"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain I"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x007"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "braeden.crump@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "16",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Jeremy Peters",
+      "Captain III"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 1,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Jeremy Peters",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain III"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x007",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "jeremy.peters@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Peters"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Jeremy"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain III"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x007"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "jeremy.peters@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "17",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Jeff West",
+      "Captain I"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 12,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Jeff West",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain I"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x007",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "jeff.west@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "West"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Jeff"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain I"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x007"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "jeff.west@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "18",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Paul Fontanetta",
+      "Captain II"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 12,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Paul Fontanetta",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain II"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x007",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "paul.fontanetta@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          " Fontanetta"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Paul"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain II"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x007"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "paul.fontanetta@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   },
   {
     "userKey": "19",
-    "photoUrl": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
+    "displayNames": [
+      "Nadine Lauer",
+      "Captain II"
+    ],
+    "photoURL": "http://localhost:8080/pwm/public/resources/UserPhoto.png",
     "orgChartParentKey": 12,
-    "fields": [
-      {
-        "fieldId": "name",
-        "value": "Nadine Lauer",
-        "type": "person-link"
-      },
-      {
-        "fieldId": "title",
-        "value": "Captain II"
-      },
-      {
-        "fieldId": "phone",
-        "value": "(123) 456-7890 x007",
-        "type": "phone"
-      },
-      {
-        "fieldId": "email",
-        "value": "nadine.lauer@lapd.gov",
+    "detail": {
+      "sn": {
+        "name": "sn",
+        "values": [
+          "Lauer"
+        ],
+        "type": "text",
+        "label": "Last Name",
+        "searchable": true
+      },
+      "givenName": {
+        "name": "givenName",
+        "values": [
+          "Nadine"
+        ],
+        "type": "text",
+        "label": "First Name",
+        "searchable": true
+      },
+      "title": {
+        "values": [
+          "Captain II"
+        ]
+      },
+      "telephoneNumber": {
+        "values": [
+          "(123) 456-7890 x007"
+        ],
+        "type": "tel"
+      },
+      "mail": {
+        "values": [
+          "nadine.lauer@lapd.gov"
+        ],
         "type": "email"
       }
-    ]
+    }
   }
 ]

+ 13 - 2
src/main/angular/src/services/people.service.dev.ts

@@ -6,8 +6,8 @@ var peopleData = require('./people.data');
 
 export default class PeopleService implements IPeopleService {
     private people: Person[];
-
     static $inject = ['$q', '$timeout'];
+
     constructor(private $q: IQService, private $timeout: ITimeoutService) {
         this.people = peopleData.map((person) => new Person(person));
     }
@@ -64,11 +64,22 @@ export default class PeopleService implements IPeopleService {
         return deferred.promise;
     }
 
+    isOrgChartEnabled(id: string): angular.IPromise<boolean> {
+        var deferred = this.$q.defer<boolean>();
+
+        this.$timeout(() => {
+            deferred.resolve(true);
+        });
+
+        return deferred.promise;
+    }
+
     search(query: string): angular.IPromise<Person[]> {
         var deferred = this.$q.defer<Person[]>();
         var self = this;
         this.$timeout(() => {
-            var people = self.people.filter((person: Person) => person.userKey.toLowerCase().indexOf(query) === 0 );
+            var people = self.people.filter((person: Person) =>
+                person.detail.givenName.values[0].toLowerCase().indexOf(query.toLowerCase()) >= 0);
 
             deferred.resolve(people);
         });

+ 7 - 2
src/main/angular/src/services/people.service.ts

@@ -7,6 +7,7 @@ export interface IPeopleService {
     getDirectReports(personId: string): IPromise<Person[]>;
     getManagementChain(personId: string): IPromise<Person[]>;
     getPerson(id: string): IPromise<Person>;
+    isOrgChartEnabled(id: string): IPromise<boolean>;
     search(query: string): IPromise<Person[]>;
 }
 
@@ -14,15 +15,19 @@ export default class PeopleService implements IPeopleService {
     static $inject = ['$http'];
     constructor(private $http: IHttpService) {
     }
+
     getDirectReports(id: string): angular.IPromise<Person[]> {
         return undefined;
     }
-
     getManagementChain(id: string): angular.IPromise<Person[]> {
         return undefined;
     }
 
-    getPerson(id: string): IHttpPromise<Person> {
+    getPerson(id: string): IPromise<Person> {
+        return undefined;
+    }
+
+    isOrgChartEnabled(id: string): angular.IPromise<boolean> {
         return undefined;
     }