import { Component, Injector, ViewEncapsulation, ViewChild, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { NotifyService } from '@abp/notify/notify.service'; import { AppComponentBase } from '@shared/common/app-component-base'; import { TokenAuthServiceProxy, SupportCategoryTypesServiceProxy, VersionsServiceProxy, OrganizationUnitDto, TicketList, NameValueDto, PagedResultDtoOfNameValueDto, Page, GetAllVersionsInput, GetSupportTicketUsersInput } from '@shared/service-proxies/service-proxies'; import { UserServiceProxy, UserListDto, SupportTicketServiceProxy, SupportTicketStatusServiceProxy, SupportTicketTypeServiceProxy, TicketTypeList, TicketStatusList, CreateTicketDto, CreateAttachments, CreateNotes, GetTicketStatusInput } from '@shared/service-proxies/service-proxies'; import { appModuleAnimation } from '@shared/animations/routerTransition'; import { TicketNotesModalComponent } from './ticket-notes-modal.component'; import { AppSessionService } from '@shared/common/session/app-session.service'; import { Table } from 'primeng/components/table/table'; import { Paginator } from 'primeng/components/paginator/paginator'; import { LazyLoadEvent } from 'primeng/components/common/lazyloadevent'; import { FileDownloadService } from '@shared/utils/file-download.service'; import { EntityTypeHistoryModalComponent } from '@app/shared/common/entityHistory/entity-type-history-modal.component'; import * as _ from 'lodash'; import * as moment from 'moment'; import { Router } from '@angular/router'; import { BsDatepickerConfig } from 'ngx-bootstrap/datepicker'; import { HttpClient } from '@angular/common/http'; import { FormControl } from '@angular/forms'; import { Location } from '@angular/common'; import { AppConsts } from '@shared/AppConsts'; import { FormBuilder, FormGroup, Validators } from "@angular/forms"; import { NgxDropzoneModule } from 'ngx-dropzone'; import { SupportCategoryTypesComponent } from './supportCategoryTypes/supportCategoryTypes.component'; import { CommonLookupModalComponent } from '@app/shared/common/lookup/common-lookup-modal.component'; import { CommonLookupCheckboxModalComponent } from '@app/shared/common/lookup/common-lookup-checkbox-modal.component'; import { Observable } from 'rxjs' import { map } from 'rxjs/operators'; import { result } from 'lodash'; declare var $: any; @Component({ templateUrl: './create-support-ticket.component.html', encapsulation: ViewEncapsulation.None, animations: [appModuleAnimation()], styleUrls: ['./support-ticket.component.less'], }) export class CreateSupportTicketComponent extends AppComponentBase implements OnInit { @ViewChild('dataTable', { static: true }) dataTable: Table; @ViewChild('paginator', { static: true }) paginator: Paginator; @ViewChild('ticketNotesModal', { static: false }) ticketNotesModal: TicketNotesModalComponent; @ViewChild('ticketTypesList', {static: true}) ticketTypesList: CommonLookupModalComponent; @ViewChild('ticketStatusList', {static: true}) ticketStatusList: CommonLookupModalComponent; @ViewChild('environmentList', {static: true}) environmentList: CommonLookupModalComponent; @ViewChild('priorityList', {static: true}) priorityList: CommonLookupModalComponent; @ViewChild('userList', {static: true}) userList: CommonLookupModalComponent; @ViewChild('ticketList', {static: true}) ticketList: CommonLookupModalComponent; @ViewChild('effortHourList', {static: true}) effortHourList: CommonLookupModalComponent; @ViewChild('versionList', {static: true}) versionList: CommonLookupModalComponent; @ViewChild('unitList', {static: true}) unitList: CommonLookupModalComponent; @ViewChild('categoryTypesList', {static: true}) categoryTypesList: CommonLookupCheckboxModalComponent; bsConfig: Partial; //effortHours: TicketEffortHoursDto[]; id: any; defaultDate = new Date(); dueDate = new Date(); startDate = new Date(); //users: UserListDto = new UserListDto(); //contacts: ContactListDto= new ContactListDto(); incidentDate: any; incidentType: any; typesId: number; content: string; notes: any[] = []; users: UserListDto[] = []; ticketTypes: TicketTypeList[] = []; ticketStatuses: TicketStatusList[] = []; organizationUnits: OrganizationUnitDto[] = []; tickets: TicketList[] = []; today: any; uploadUrl: string; url: string; uploadedFiles: any[] = []; data: any[] = []; noteCreator: string; tenancy: boolean = false; hideNew: boolean = false; assignedToId: any; assignedTo: any; ticketTypeId: any; ticketStatusId: any; shortDescription: any; description: any; rootCause: string; // solution: string; environment: any; priority: any; effortHour?: number; showAlert: boolean = false; typeTrigger: any; categoryTypes: any; solution: string; categoryTypeIds: number[] assignedStatusId: any; testerId: any; tester: any; managerId: any; manager: any; developerId: any; developer: any; supportId: any; support: any; parentTicketId: any; unitId: any; unit: any; parentId: any; files: File[] = []; notesCreate: Array = []; attachMents: Array = []; statusClicked: boolean = false; userClicked: boolean = false; //versionList: any; typeInputValidation: boolean = false environmentInputValidation: boolean = false priorityValidation: boolean = false assignedValidation: boolean = false statusValidation: boolean = false searchTicketType: boolean; tickeTypeId: any; txtTicketTypeFilter: any; showSearchOnStartTicketType: any; selectedTicketType: any; searchTicketStatus: boolean; tickeStatusId: any; txtTicketStatusFilter: any; showSearchOnStartTicketStatus: any; selectedTicketStatus: any; searchEnvironment: boolean; environmentId: any; txtEnvironmentFilter: any; showSearchOnStartEnvironment: any; selectedEnvironment: any; searchPriority: boolean; priorityId: any; txtPriorityFilter: any; showSearchOnStartPriority: any; selectedPriority: any; searchTicket: boolean; txtTicketFilter: any; showSearchOnStartTicket: any; selectedTicket: any; searchEffort: boolean; txtEffortFilter: any; showSearchOnStartEffort: any; selectedEffort: any; searchVersion: boolean; txtVersionFilter: any; showSearchOnStartVersion: any; versionId: any; selectedVersion: any; searchUnit: boolean; txtUnitFilter: any; showSearchOnStartUnit: any; selectedUnit: any; searchUser: boolean; txtAssignedToFilter: any; txtTesterFilter: any; txtManagerFilter: any; txtDeveloperFilter: any; txtTechnicalSupportFilter: any; showSearchOnStartUser: any; selectedUser: any; searchField: any; categoryType = []; categoryTypeArray = []; constructor( injector: Injector, private _notifyService: NotifyService, private _userServiceProxy: UserServiceProxy, private _supportTicketServiceProxy: SupportTicketServiceProxy, private _supportTicketStatusServiceProxy: SupportTicketStatusServiceProxy, private _supportTicketTypeServiceProxy: SupportTicketTypeServiceProxy, private _supportCategoryTypeServiceProxy: SupportCategoryTypesServiceProxy, private _tokenAuth: TokenAuthServiceProxy, private _activatedRoute: ActivatedRoute, private _httpClient: HttpClient, private _router: Router, private _location: Location, private route: ActivatedRoute, //private _orderAppService: OrderServiceProxy, //private _incidentTypesService: IncidentTypesServiceProxy, //private _orderIncidentsService : OrderIncidentsServiceProxy, private _appSessionService: AppSessionService, private _versionService: VersionsServiceProxy ) { super(injector); this.uploadUrl = AppConsts.remoteServiceBaseUrl + '/DemoUiComponents/UploadFiles'; this.url = AppConsts.appBaseUrl; } ngOnInit(): void { let maxcount = 1000; this.route.paramMap.subscribe(params => { this.parentId = params.get("id") }) $('.kt-select2').select2(); this.showAllUsers(); //this.showAllTypes(); //this.showAllStatus(); //this.getCategoryTypes() //this.getEffortHours(); //this.getVersion(); this.today = new Date(); this.noteCreator = this._appSessionService.user.name + ' ' + this._appSessionService.user.surname; this.showSearchOnStartTicketStatus = true; this.showSearchOnStartTicketType = true; this.showSearchOnStartEnvironment = true; this.showSearchOnStartPriority = true; this.showSearchOnStartEnvironment = true; this.showSearchOnStartEffort = true; this.showSearchOnStartTicket = true; this.showSearchOnStartUnit = true; this.showSearchOnStartUser = true; this.showSearchOnStartVersion = true; if (this._appSessionService.tenant != undefined) { this.tenancy = true; this.statusValidation = true; this.hideNew = true; } var that = this; $('#assigned').on('change', function () { if ($('#assigned :selected').val() != "" && that.statusClicked == false) { $('#statusInputCreate').val(that.assignedStatusId); that.userClicked = true $('#statusInputCreate').trigger('change'); } that.assignedValidation = true that.statusValidation = true // console.log("as"+that.assignedValidation) // console.log("st"+that.statusValidation) }); $('#statusInputCreate').on('change', function () { if ($('#statusInputCreate :selected').val() == that.assignedStatusId && that.userClicked == false) { //that.selectedStatusId = that.assignedStatusId; let sample = $("#assigned"); sample.find('option:eq(1)').prop('selected', true) that.statusClicked = true $("#assigned").val(sample.val()).change(); // console.log(sample.val()) // $('#assigned').trigger('change'); } that.assignedValidation = true that.statusValidation = true // console.log("as"+that.assignedValidation) // console.log("st"+that.statusValidation) }); var re = "sandbox"; var str = this.url; if (str.search(re) == -1) { $('#environmentInput').val('Production'); $('#environmentInput').trigger('change'); } else { $('#environmentInput').val('Sandbox'); $('#environmentInput').trigger('change'); } this.typeTrigger = Number($('#typeInput').val()); // $('#typeInput').change(function () { // that.typeTrigger = $("#typeInput :selected").val(); // if (this.parentId == null) { // that.typeInputValidation = true // // console.log("ty"+that.typeInputValidation) // } // }); //trigger for validation // $('#environmentInput').change(function () { // //validation // if (this.parentId == null) { // that.environmentInputValidation = true // // console.log("en"+that.environmentInputValidation) // } // }); //trigger for validation // $('#priorityInput').change(function () { // //validation // if (this.parentId == null) { // that.priorityValidation = true // // console.log("prio"+that.priorityValidation) // } // }); this.getTicketTypesInit(); this.getTicketStatusInit(); this.getEnvironmentInit(); this.getPriorityInit(); this.getCategoryTypesInit(); this.getUserInit(); this.getTicketsInit(); this.getEffortHoursInit(); this.getVersionsInit(); this.getUnitInit(); } ngAfterViewInit() { $('.kt-select2').select2(); //$(".m-input").datepicker("setDate", new Date()); } onSelect(event) { // console.log(event.addedFiles); if (event.rejectedFiles.length != 0) { this.showAlert = true; } this.files.push(...event.addedFiles); let f = event.addedFiles; for (const file of f) { this.getData(file); } } onRemove(event) { // console.log(event.name); this.files.splice(this.files.indexOf(event), 1); //this.data.splice(this.data.indexOf(event), 1); _.remove(this.data, function (el) { return el.fileName === event.name; }); } closeAlert() { this.showAlert = false; } goBack() { this._location.back(); } getIncident(event?: LazyLoadEvent) { if (this.primengTableHelper.shouldResetPaging(event)) { this.paginator.changePage(0); return; } } reloadPage(): void { this.paginator.changePage(this.paginator.getPage()); } showAllUsers(): void { //this.active = true; this._supportTicketServiceProxy.getUsersForDropDown().subscribe((result) => { this.users = result.items; }); } showAllTypes(): void { //this.active = true; this._supportTicketTypeServiceProxy.getTicketTypeList().subscribe((result) => { this.ticketTypes = result.items; }); } showAllStatus(): void { //this.active = true; this._supportTicketStatusServiceProxy.getTicketStatusList().subscribe((result) => { this.ticketStatuses = result.items; for (var i = 0, len = result.items.length; i < len; i++) { if (result.items[i].code == 'ASSIGNED') { this.assignedStatusId = result.items[i].id; } } }); } save(): void { let that = this; this.spinnerService.show(); for (let item of this.notes) { let a = new CreateNotes({ ticketId: null, notes: item, creator: this.noteCreator, creationTime: this.today, }); this.notesCreate.push(a); } // if (this._appSessionService.tenant != undefined) { // this.assignedToId = null; // this.assignedTo = ""; // this.ticketStatusId = Number($('#statusNew').val()); // } // else { // this.assignedToId = Number($('#assigned').val()); // this.assignedTo = $('#assigned option:selected').text(); // this.ticketStatusId = Number($('#statusInputCreate').val()); // } this.ticketTypeId = this.ticketTypeId; this.environment = this.environmentId; this.priority = this.priorityId; // if (this._appSessionService.tenant == undefined) { // this.manager = Number((document.getElementById('manager')).value) == 0 ? '' : $('#manager option:selected').text(); // this.managerId = Number((document.getElementById('manager')).value) == 0 ? null : Number((document.getElementById('manager')).value); // this.developer = Number((document.getElementById('developer')).value) == 0 ? '' : $('#developer option:selected').text(); // this.developerId = Number((document.getElementById('developer')).value) == 0 ? null : Number((document.getElementById('developer')).value); // this.support = Number((document.getElementById('support')).value) == 0 ? '' : $('#support option:selected').text(); // this.supportId = Number((document.getElementById('support')).value) == 0 ? null : Number((document.getElementById('support')).value); // this.unit = Number((document.getElementById('unit')).value) == 0 ? '' : $('#unit option:selected').text(); // this.unitId = Number((document.getElementById('unit')).value) == 0 ? null : Number((document.getElementById('unit')).value); // this.parentTicketId = Number((document.getElementById('ticket')).value) == 0 ? null : Number((document.getElementById('ticket')).value); // } let checkEffort = this.effortHour; if (checkEffort == null) { this.effortHour = 0 } else { this.effortHour = checkEffort; } for (let item of this.data) { let a = new CreateAttachments({ fileName: item.fileName, base64EncodedData: item.base64EncodedData, ticketId: null, }); this.attachMents.push(a); } let input = new CreateTicketDto({ tenantId: null, parentId: 0, dueDate: moment(this.dueDate), startDate: moment(this.startDate), effortHour: this.effortHour != null ? this.effortHour : 0, assignedToId: this.assignedToId, ticketTypeId: this.ticketTypeId, ticketStatusId: this.ticketStatusId, shortDescription: this.shortDescription, assigned: this.assignedToId != null ? this.txtAssignedToFilter : '', creator: this.noteCreator, description: this.description, rootCause: this.rootCause == null ? "" : this.rootCause, solution: this.solution == null ? "" : this.solution, environment: this.environment, priority: this.priority, createAttachments: this.attachMents, createNotes: this.notesCreate, categoryTypeId: this.categoryTypeArray, versionId: this.versionId, testerUserId: this.testerId, tester: this.testerId != null ? this.txtTesterFilter : '', managerId: this.managerId, manager: this.managerId != null ? this.txtManagerFilter : '', developerId: this.developerId, developer: this.developerId != null ? this.txtDeveloperFilter : '', technicalSupportId: this.supportId, technicalSupport: this.supportId != null ? this.txtTechnicalSupportFilter : '', parentTicketId: this.parentTicketId, organizationalUnitId: this.unitId, organizationalUnit: this.unit }); if (moment(this.startDate).format('YYYY-MM-DD') <= moment(this.dueDate).format('YYYY-MM-DD')) { this._supportTicketServiceProxy.createTicket( input ).pipe().subscribe(result => { this.attachMents = []; this.notesCreate = []; this.spinnerService.hide(); this.notify.info(this.l('SavedSuccessfully')); this.goBack(); }); } else { this.spinnerService.hide(); this.message.info("Invalid Start and Due Date"); } } updateMyDate(newDate) { this.defaultDate = newDate; } ticketNotes(id?: any): void { this.ticketNotesModal.show(id, false); } onBeforeSend(event): void { event.xhr.setRequestHeader('Authorization', 'Bearer ' + abp.auth.getToken()); } /*getFile(event): void { for (const file of event.files) { this.getData(file); } }*/ /* remove(event): void { //this.data = this.data.filter(item => item = event.file.name); _.remove(this.data, function (el) { return el.fileName === event.file.name; }); console.log(this.data); }*/ getData(file) { var reader: any; let me = this; reader = new FileReader(); reader.readAsDataURL(file); //reader.onload = function () { //me.modelvalue = reader.result; //console.log(reader.result.toString().split(',')[1]); //}; reader.onload = function () { //me.modelvalue = reader.result.toString().split(',')[1]; //me.image.fileName = file.name; //me.image.base64EncodedData = me.modelvalue; me.data.push( { fileName: file.name, base64EncodedData: reader.result.toString().split(',')[1] }); }; reader.onerror = function (error) { // console.log('Error: ', error); }; } deleteRow(index) { this.notes.splice(index, 1); } getCategoryTypes() { this._supportCategoryTypeServiceProxy.getAll(undefined, undefined, undefined, undefined, undefined, 0, undefined, undefined, 1000) .subscribe(result => { this.categoryTypes = result.items }) } // getEffortHours() { // this._supportTicketStatusServiceProxy.getEffortHours().subscribe(result => { // this.effortHours = result; // }); // } // getVersion() { // this._versionService.getAll(undefined, undefined, undefined, undefined, undefined, undefined, 1000).subscribe(result => { // this.versionList = result.items; // }) // } getTicketTypesInit() { this.ticketTypesList.configure({ title: this.l('Select Ticket Type'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { return this._supportTicketTypeServiceProxy.getTicketTypePagedList(filter, undefined, skipCount, maxResultCount); } }); } getTicketTypeList(filter : any) { this.searchTicketType = false; this.ticketTypesList.show(); this.ticketTypesList.filterText = filter; } clearTicketTypeList(){ this.txtTicketTypeFilter = ''; this.ticketTypeId = null; this.showSearchOnStartTicketType = true; } selectTicketType(item) { var resultId = item.value; var name = item.name if(this.searchTicketType) { this.ticketTypeId = resultId; this.txtTicketTypeFilter = name; this.searchTicketType = false; this.selectedTicketType = name; } else{ this.ticketTypeId = resultId; this.txtTicketTypeFilter = name; this.selectedTicketType = name; this.showSearchOnStartTicketType = false; } if(name=="Emergency Protocol"){ (document.getElementById('ticketTypesFilter')).style.color="#FF3300"; (document.getElementById('ticketTypesFilter')).style.border="1px solid #FF3300"; }else{ (document.getElementById('ticketTypesFilter')).style.color="#646c9a"; } } getTicketStatusInit() { this.ticketStatusList.configure({ title: this.l('Select Ticket Status'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { let input = new GetTicketStatusInput(); input.filter = this.tenancy ? 'New' : filter; input.skipCount = skipCount; input.maxResultCount = maxResultCount; return this._supportTicketStatusServiceProxy.ticketStatusPagedList(input); } }); } getTicketStatusList(filter : any) { this.searchTicketType = false; this.ticketStatusList.show(); this.ticketStatusList.filterText = filter; } clearTicketStatusList(){ this.txtTicketStatusFilter = ''; this.ticketStatusId = null; this.showSearchOnStartTicketStatus = true; } selectTicketStatus(item) { var resultId = item.value; var name = item.name if (this.searchTicketStatus) { this.ticketStatusId = resultId; this.txtTicketStatusFilter = name; this.searchTicketStatus = false; this.selectedTicketStatus = name; } else { this.ticketStatusId = resultId; this.txtTicketStatusFilter = name; this.selectedTicketStatus = name; this.showSearchOnStartTicketStatus = false; } } getEnvironmentInit() { this.environmentList.configure({ title: this.l('Select Environment'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { return this._supportTicketServiceProxy.getEnvironmentTypeList(filter, undefined, skipCount, maxResultCount); } }); } getEnvironmentList(filter : any) { this.searchEnvironment = false; this.environmentList.show(); this.environmentList.filterText = filter; } clearEnvironmentList(){ this.txtEnvironmentFilter = ''; this.environmentId = null; this.showSearchOnStartEnvironment = true; } selectEnvironment(item) { var resultId = item.value; var name = item.name if (this.searchEnvironment) { this.environmentId = resultId; this.txtEnvironmentFilter = name; this.searchEnvironment = false; this.selectedEnvironment = name; } else { this.environmentId = resultId; this.txtEnvironmentFilter = name; this.selectedEnvironment = name; this.showSearchOnStartEnvironment = false; } } getPriorityInit() { this.priorityList.configure({ title: this.l('Select Priority'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { return this._supportTicketServiceProxy.getPriorityTypeList(filter, undefined, skipCount, maxResultCount); } }); } getPriorityList(filter : any) { this.searchPriority = false; this.priorityList.show(); this.priorityList.filterText = filter; } clearPriorityList(){ this.txtPriorityFilter = ''; this.priorityId = null; this.showSearchOnStartPriority = true; } selectPriority(item) { var resultId = item.value; var name = item.name if (this.searchPriority) { this.priorityId = resultId; this.txtPriorityFilter = name; this.searchPriority = false; this.selectedPriority = name; } else { this.priorityId = resultId; this.txtPriorityFilter = name; this.selectedPriority = name; this.showSearchOnStartPriority = false; } } getCategoryTypesInit() { this.categoryTypesList.configure({ title: this.l('Select Categories'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { return this._supportCategoryTypeServiceProxy.getCategoryTypesPagedList(filter, undefined, undefined, undefined, undefined, undefined, undefined, skipCount, maxResultCount); } }); } addCategory(categories: []){ categories.map(c => { this.categoryType.push(c) }) this.categoryTypeArray = this.categoryType.map(c => c.value); } removeCategory(item){ this.categoryType = this.categoryType.filter(c => c.routeCode != item.value); this.categoryTypeArray = this.categoryType.map(c => c.value); } addNewCategory() { this.categoryTypesList.show(this.categoryTypeArray); } getUserInit() { this.userList.configure({ title: this.l('Select User'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { let input = new GetSupportTicketUsersInput(); input.filter = filter; input.maxResultCount = maxResultCount; input.skipCount = skipCount; return this._supportTicketServiceProxy.usersList(input); } }); } getUserList(field : any) { this.searchUser = false; this.searchField = field; let filterText = ''; switch(field) { case 'Assigned': filterText = this.txtAssignedToFilter; break; case 'Tester': filterText = this.txtTesterFilter; break; case 'Manager': filterText = this.txtManagerFilter; break; case 'Developer': filterText = this.txtDeveloperFilter; break; case 'Support': filterText = this.txtTechnicalSupportFilter; break; } this.userList.show(); this.userList.filterText = filterText; } clearUserList(field: string) { switch(field) { case 'Assigned': this.assignedToId = null; this.assignedTo = null; this.txtAssignedToFilter = ''; break; case 'Tester': this.testerId = null; this.tester = null; this.txtTesterFilter = ''; break; case 'Manager': this.managerId = null; this.manager = null; this.txtManagerFilter = ''; break; case 'Developer': this.developerId = null; this.developer = null; this.txtDeveloperFilter = ''; break; case 'Support': this.supportId = null; this.support = null; this.txtTechnicalSupportFilter = ''; break; } this.showSearchOnStartUser = false; } selectUser(item: any) { var resultId = item.value; var name = item.name switch(this.searchField) { case 'Assigned': this.assignedToId = resultId; this.assignedTo = name; this.txtAssignedToFilter = name; break; case 'Tester': this.testerId = resultId; this.tester = name; this.txtTesterFilter = name; break; case 'Manager': this.managerId = resultId; this.manager = name; this.txtManagerFilter = name; break; case 'Developer': this.developerId = resultId; this.developer = name; this.txtDeveloperFilter = name; break; case 'Support': this.supportId = resultId; this.support = name; this.txtTechnicalSupportFilter = name; break; } } getUnitInit() { this.unitList.configure({ title: this.l('Select Unit'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { let input = new GetSupportTicketUsersInput(); input.filter = filter; input.skipCount = skipCount; input.maxResultCount = maxResultCount; return this._supportTicketServiceProxy.organizationalUnitsList(input); } }); } getUnitList(filter : any) { this.searchUnit = false; this.unitList.show(); this.unitList.filterText = filter; } clearUnitList(){ this.txtUnitFilter = ''; this.unitId = null; this.showSearchOnStartUnit = true; } selectUnit(item) { var resultId = item.value; var name = item.name if (this.searchUnit) { this.unitId = resultId; this.txtUnitFilter = name; this.searchUnit = false; this.unit = name; this.selectedUnit = name; } else { this.unitId = resultId; this.txtUnitFilter = name; //this.searchUnit = name; this.unit = name; this.showSearchOnStartUnit = false; } } getTicketsInit() { this.ticketList.configure({ title: this.l('Select Ticket'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { let input = new GetSupportTicketUsersInput(); input.filter = filter; input.skipCount = skipCount; input.maxResultCount = maxResultCount; return this._supportTicketServiceProxy.ticketsList(input); } }); } getTicketList(filter : any) { this.searchTicket = false; this.ticketList.show(); this.ticketList.filterText = filter; } clearTicketList(){ this.txtTicketFilter = ''; this.parentTicketId = null; this.showSearchOnStartTicket = true; } selectTicket(item) { var resultId = item.value; var name = item.name if (this.searchTicket) { this.parentTicketId = resultId; this.txtTicketFilter = name; this.searchTicket = false; this.selectedTicket = name; } else { this.parentTicketId = resultId; this.txtTicketFilter = name; this.searchTicket = name; this.showSearchOnStartTicket = false; } } getEffortHoursInit() { this.effortHourList.configure({ title: this.l('Select Effort'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { let input = new GetTicketStatusInput(); input.filter = filter; input.skipCount = skipCount; input.maxResultCount = maxResultCount; return this._supportTicketStatusServiceProxy.effortHoursList(input); } }); } getEffortHoursList(filter : any) { this.searchEffort = false; this.effortHourList.show(); this.effortHourList.filterText = filter; } clearEffortHoursList(){ this.txtEffortFilter = ''; this.effortHour = null; this.showSearchOnStartEffort = true; } selectEffortHours(item) { var resultId = item.value; var name = item.name if (this.searchEffort) { this.effortHour = resultId; this.txtEffortFilter = name; this.searchEffort = false; this.selectedEffort = name; } else { this.effortHour = resultId; this.txtEffortFilter = name; this.searchEffort = true; this.showSearchOnStartEffort = false; } } getVersionsInit() { this.versionList.configure({ title: this.l('Select Version'), dataSource: (skipCount: number, maxResultCount: number, filter: string, tenantId?: number, locationId?: number) => { let input = new GetAllVersionsInput(); input.filter = filter; input.skipCount = skipCount; input.maxResultCount = maxResultCount; return this._versionService.versionPagedList(input); } }); } getVersionList(filter : any) { this.searchVersion = false; this.versionList.show(); this.versionList.filterText = filter; } clearVersionList(){ this.txtVersionFilter = ''; this.versionId = null; this.showSearchOnStartVersion = true; } selectVersion(item) { var resultId = item.value; var name = item.name if (this.searchVersion) { this.versionId = resultId; this.txtVersionFilter = name; this.searchVersion = false; this.selectedEffort = name; } else { this.versionId = resultId; this.txtVersionFilter = name; this.searchVersion = true; this.showSearchOnStartVersion = false; } } }