UNPKG

ngx-monitorias-uniandes-lib

Version:

This library is used for Monitorias-Uniandes system.

54 lines 5.69 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var search_combo_box_generic_model_1 = require("../search-combo-box-generic/search-combo-box-generic.model"); var service_locator_1 = require("../../service-locator"); var search_combo_box_service_1 = require("../search-combo-box.service"); var search_academy_combo_box_component_1 = require("../search-academy-combo-box/search-academy-combo-box.component"); var core_2 = require("@ngx-translate/core"); var titlecase_academia_pipe_1 = require("../../utils/titlecase-academia.pipe"); var SearchPersonComboBoxComponent = /** @class */ (function (_super) { __extends(SearchPersonComboBoxComponent, _super); function SearchPersonComboBoxComponent(urlService, searchBoxUtils, transService, titlecasePipe) { var _this = _super.call(this, urlService, searchBoxUtils, transService, new search_combo_box_generic_model_1.SearchComboBoxGenericModel(urlService.getExternalPersonUrl(), [{ "name": "limit", "value": 10 }, { "name": "personType", "value": "3" }], null, "results", "completeName", "Search People"), titlecasePipe) || this; _this.urlService = urlService; _this.searchBoxUtils = searchBoxUtils; _this.transService = transService; _this.titlecasePipe = titlecasePipe; return _this; } SearchPersonComboBoxComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); this.searchBoxUtils.setUrlService(this.model, this.debugFlag); }; SearchPersonComboBoxComponent.prototype.getLabelsForStudents = function (types) { return this.searchBoxUtils.getLabelsForStudents(types); }; SearchPersonComboBoxComponent.decorators = [ { type: core_1.Component, args: [{ selector: 'search-person-combo-box', template: "\n <ng-template #customItemTemplate let-model=\"item\" let-index=\"index\">\n <div class=\"card-container\">\n <div class=\"item\">\n <img *ngIf=\"model.id; else facultyId\" width=\"80px\" height=\"60px\" src=\"/WebServicesAcademy/api/AcademyImages/photos/{{model.id}}.JPG\" onerror=\"this.src='https://academia.uniandes.edu.co/AcademyCv/assets/img/nophoto.png'\" alt=\"\">\n <ng-template #facultyId >\n <img width=\"80px\" height=\"60px\" src=\"/WebServicesAcademy/api/AcademyImages/photos/{{model.idFaculty}}.JPG\" onerror=\"this.src='https://academia.uniandes.edu.co/AcademyCv/assets/img/nophoto.png'\" alt=\"\">\n </ng-template>\n </div>\n <div class=\"item\">\n <div class=\"item-container\">\n <div class=\"detail\"><b>{{model.name}} {{model.lastName}}</b></div>\n <div *ngIf=\"model.alternativeEmail && model.types.includes(3)\" class=\"detail\"><i>{{model.alternativeEmail}}</i></div>\n <div *ngIf=\"model.username || model.userName\" class=\"detail\"><i>{{model.username}}{{model.userName}} [at] uniandes.edu.co</i></div>\n <ng-container *ngIf=\"model.types\">\n <div *ngIf=\"model.types.length > 0 && (model.types.includes(2) || \n model.types.includes(4) || model.types.includes(5) || \n model.types.includes(6) || model.types.includes(7))\" class=\"detail\"><i>{{getLabelsForStudents(model.types)}}</i>\n </div>\n <div *ngIf=\"model.types.length > 0 && model.types.includes(3)\" class=\"detail\">{{'EXTERNAL' | translate}}</div>\n </ng-container>\n <div *ngIf=\"model.position\" class=\"detail\">{{model.position | titleCaseAcademia}}</div>\n </div>\n </div>\n </div>\n </ng-template>\n\n <app-search-combo-box-generic [customTemplate]=\"customItemTemplate\" [preSelectedValue]= \"preSelectedValue\" [componentModel]=\"model\" [itemControl]=\"itemControl\" [isScrollable]=\"isScrollable\" (noResults)=\"sendNoResults($event)\" (itemSelected)=\"sendItemSelectedEvent($event)\"></app-search-combo-box-generic>\n ", styles: ["\n .card-container{\n display: grid;\n grid-template-columns: 100px auto;\n grid-template-rows: 100%;\n }\n\n .item{\n align-self: center;\n }\n\n .item .item-container .detail{\n align-self: center;\n }\n "] },] }, ]; /** @nocollapse */ SearchPersonComboBoxComponent.ctorParameters = function () { return [ { type: service_locator_1.ServiceLocator, }, { type: search_combo_box_service_1.SearchComboBoxService, }, { type: core_2.TranslateService, }, { type: titlecase_academia_pipe_1.TitleCaseAcademiaPipe, }, ]; }; return SearchPersonComboBoxComponent; }(search_academy_combo_box_component_1.SearchAcademyComboBoxComponent)); exports.SearchPersonComboBoxComponent = SearchPersonComboBoxComponent; //# sourceMappingURL=search-person-combo-box.component.js.map