npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@uiowa/university-person

v15.1.5

Published

An Angular library for common University Person Search.

Downloads

5

Readme

University Person Search

An Angular library for common University Person Search.

Library Details

Default Setup

  • In your app.module:
    • Import UniversityPersonModule
    • Provide a substitute class for the UniversityPersonService

Models

  • CanEdit: boolean value that determines if the person is editable. Default is true.
  • IsInvalid: boolean value that determines if the person is invalid, this is to display the person and search field red. Default is false.
  • PersonDisplayTemplate: template that is used to customize the display of the chosen person. If not provided, the default person display will be used.
  • PersonSearchResultsTemplate: template that is used to customized the diplay of the search results in the popup modal. If not provided, the default person search display will be used.
  • OnNoPeopleFound: method that is called when there are no people found for the provided search criteria.
  • HelpText: string value to replace default help text

Features

  • Supports registering form control for Reactive Forms.

  • Supports customization for the display of the chosen person and the display of the search results in the popup modal. The personDisplayTemplate gives you access to all of the person properties through the person object variable. The personSearchResultsTemplate gives you access to the people found by the search through the people array variable. You can get access all of the properties and methods from the University Person component by adding a local variable (#universityPerson) to represent the component (https://angular.io/guide/component-interaction).

	<uiowa-university-person 
	  formControlName="person" 
	  [canEdit]="true" 
	  [personDisplayTemplate]="personDisplay" 
	  [personSearchResultsTemplate]="personSearchResults"
	  #universityPerson>
	</uiowa-university-person>

	<ng-template #personDisplay let-person>
	  <p class="mb-0">
	    <span class="font-weight-bold">{{person.displayName}}</span>
	    <button type="button" class="btn btn-sm btn-outline-secondary align-text-bottom ml-1" (click)="universityPerson.onChangePerson()" *ngIf="universityPerson.canEdit">
	      <i class="fa fa-user-edit"></i>
	    </button>
	    <button type="button" class="btn btn-sm btn-outline-danger align-text-bottom ml-1" (click)="universityPerson.onChangePerson()" *ngIf="universityPerson.canEdit">
	      <i class="fa fa-user-minus"></i>
	    </button>
	  </p>
	  <small class="form-text text-muted mt-0">{{person.hawkId}} | {{person.univId}} | {{person.emplId}}</small>
	  <small class="form-text text-muted mt-0">{{person.org}}-{{person.department}} | {{person.departmentDescr}}</small>
	  <small class="form-text text-muted mt-0">{{person.universityClassification}}</small>
	</ng-template>

	<ng-template #personSearchResults let-people>
	  <thead>
	    <tr>
	      <th></th>
	      <th>Name</th>
	      <th>University Classification</th>
	      <th>Department</th>
	      <th>Department Description</th>
	    </tr>
	  </thead>
	  <tbody>
	    <tr *ngFor="let person of people">
	      <td>
	        <button type="button" class="btn btn-primary btn-sm" (click)="universityPerson.onSelectPerson(person)">
	          <i class="fa fa-check-square"></i> Select
	        </button>
	      </td>
	      <td>{{person.displayName}}</td>
	      <td>{{person.universityClassification}}</td>
	      <td>{{person.org}}-{{person.department}}</td>
	      <td>{{person.departmentDescr}}</td>
	    </tr>
	  </tbody>
	</ng-template>
  • Allows the service to search for University people (UniversityPersonService) to be substituted at any level of your application. This means you can provide a substitute class at the app.module level as a default class for the whole application but can also substitute a different class at a lower level (https://angular.io/guide/dependency-injection-providers). For example, you can substitute the UniversityPersonService for a class that calls an endpoint which searches through all people at the app.module level but also substitute a different class that calls an endpoint which only searches through people with a certain property at a specific component level.
  import { UniversityPersonModule, UniversityPersonService } from '@uiowa/university-person';
  import { WhoKeyUniversityPersonService } from './shared/services';

  @NgModule({
    declarations: [AppComponent, HomeComponent],
    imports: [
      BrowserModule,
      BrowserAnimationsModule,
      NgbModule,
      ToastrModule.forRoot(),
      SessionExpirationAlert.forRoot(),
      CoreModule,
      AppRoutingModule,
      SpinnerModule,
      UniversityPersonModule
    ],
    providers: [
      {
        provide: UniversityPersonService,
        useClass: WhoKeyUniversityPersonService
      }
    ],
    bootstrap: [AppComponent]
  })
  export class AppModule {}