Thank you Yekalkan
The problem only occurs when i have navigation properties included it seems. normal entities with only primitive properties work as should.
sure, here it is:
That is what I don't understand, everything looks fine and it is an extremely weird scenario where I can't find where the data mappings go wrong.
i have about 4 entities if i remember correctly which is currently doing this.
<div [@routerTransition]> <div class="m-subheader"> <div class="d-flex align-items-center"> <div class="mr-auto col-xs-6"> <h3 class="m-subheader__title m-subheader__title--separator"> <span>{{l("ServiceCallTasks")}}</span> </h3> <span class="m-section__sub"> {{l("ServiceCallTasksHeaderInfo")}} </span> </div> <div class="col-xs-6 text-right"> <button (click)="exportToExcel()" class="btn btn-outline-success"><i class="fa fa-file-excel-o"></i> {{l("ExportToExcel")}}</button> <button *ngIf="isGranted('Pages.ServiceCallTasks.Create')" (click)="createServiceCallTask()" class="btn btn-primary blue"><i class="fa fa-plus"></i> {{l("CreateNewServiceCallTask")}}</button> </div> </div> </div> <div class="m-content"> <div class="m-portlet m-portlet--mobile"> <div class="m-portlet__body">
<form class="horizontal-form" autocomplete="off">
<div class="m-form m-form--label-align-right">
<div class="row align-items-center m--margin-bottom-10">
<div class="col-xl-12">
<div class="form-group m-form__group align-items-center">
<div class="input-group">
<input [(ngModel)]="filterText" name="filterText" autoFocus class="form-control m-input" [placeholder]="l('SearchWithThreeDot')" type="text">
<span class="input-group-btn">
<button (click)="getServiceCallTasks()" class="btn btn-primary" type="submit"><i class="flaticon-search-1"></i></button>
</span>
</div>
</div>
</div>
</div>
<div class="row m--margin-bottom-10" [hidden]="!advancedFiltersAreShown">
<div class="col-md-12">
<div class="m-separator m-separator--dashed"></div>
</div>
<div class="col-md-3">
<div class="m-stack m-stack--ver m-stack--general m-stack--demo">
<div class="form-group">
<div class="m-stack__item">
<label>{{l("Task")}}</label>
<div class="m-separator m-separator--dashed"></div>
<input type="text" class="form-control" name="taskFilter" [(ngModel)]="taskFilter">
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="m-stack m-stack--ver m-stack--general m-stack--demo">
<div class="form-group">
<div class="m-stack__item">
<label>{{l("Details")}}</label>
<div class="m-separator m-separator--dashed"></div>
<input type="text" class="form-control" name="detailsFilter" [(ngModel)]="detailsFilter">
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="m-stack m-stack--ver m-stack--general m-stack--demo">
<div class="form-group">
<div class="m-stack__item">
<label>{{l("MinMax")}} {{l("HoursRequired")}}</label>
<div class="m-separator m-separator--dashed"></div>
<input type="number" class="form-control" [(ngModel)]="minHoursRequiredFilter" placeholder="{{l('MinValue')}}" name="minHoursRequiredFilter" />
</div>
<div class="m-stack__item">
<input type="number" class="form-control" [(ngModel)]="maxHoursRequiredFilter" placeholder="{{l('MaxValue')}}" name="maxHoursRequiredFilter" />
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="m-stack m-stack--ver m-stack--general m-stack--demo">
<div class="m-stack__item">
<label for="CompletedFilterSelect">{{l("Completed")}}</label>
<div class="m-separator m-separator--dashed"></div>
<select class="form-control" name="CompletedFilter" id="CompletedFilterSelect" [(ngModel)]="completedFilter">
<option value="-1">{{l("All")}}</option>
<option value="0">{{l("False")}}</option>
<option value="1">{{l("True")}}</option>
</select>
</div>
</div>
</div>
<div class="col-md-3">
<div class="m-stack m-stack--ver m-stack--general m-stack--demo">
<div class="form-group">
<div class="m-stack__item">
<label>({{l("ServiceCall")}}) {{l("Subject")}}</label>
<div class="m-separator m-separator--dashed"></div>
<input type="text" class="form-control" name="serviceCallSubjectFilter" [(ngModel)]="serviceCallSubjectFilter">
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="m-stack m-stack--ver m-stack--general m-stack--demo">
<div class="form-group">
<div class="m-stack__item">
<label>({{l("ServiceCallSchedule")}}) {{l("Subject")}}</label>
<div class="m-separator m-separator--dashed"></div>
<input type="text" class="form-control" name="serviceCallScheduleSubjectFilter" [(ngModel)]="serviceCallScheduleSubjectFilter">
</div>
</div>
</div>
</div>
</div>
<div class="row margin-bottom-10">
<div class="col-sm-12">
<span class="clickable-item text-muted" *ngIf="!advancedFiltersAreShown" (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i class="fa fa-angle-down"></i> {{l("ShowAdvancedFilters")}}</span>
<span class="clickable-item text-muted" *ngIf="advancedFiltersAreShown" (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i class="fa fa-angle-up"></i> {{l("HideAdvancedFilters")}}</span>
</div>
</div>
</div>
</form>
<div class="row align-items-center">
<div class="primeng-datatable-container"
[busyIf]="primengTableHelper.isLoading">
<p-table #dataTable
(onLazyLoad)="getServiceCallTasks($event)"
[value]="primengTableHelper.records"
rows="{{primengTableHelper.defaultRecordsCountPerPage}}"
[paginator]="false"
[lazy]="true"
[scrollable]="true"
ScrollWidth="100%"
[responsive]="primengTableHelper.isResponsive"
[resizableColumns]="primengTableHelper.resizableColumns">
<ng-template pTemplate="header">
<tr>
<th style="width: 130px" [hidden]="!isGrantedAny('Pages.ServiceCallTasks.Edit', 'Pages.ServiceCallTasks.Delete')">{{l('Actions')}}</th>
<th style="width: 150px" pSortableColumn="serviceCallTask.task">
{{l('Task')}}
<p-sortIcon field="serviceCallTask.task"></p-sortIcon>
</th>
<th style="width: 150px" pSortableColumn="serviceCallTask.details">
{{l('Details')}}
<p-sortIcon field="serviceCallTask.details"></p-sortIcon>
</th>
<th style="width: 150px" pSortableColumn="serviceCallTask.hoursRequired">
{{l('HoursRequired')}}
<p-sortIcon field="serviceCallTask.hoursRequired"></p-sortIcon>
</th>
<th style="width: 150px" pSortableColumn="serviceCallTask.completed">
{{l('Completed')}}
<p-sortIcon field="serviceCallTask.completed"></p-sortIcon>
</th>
<th style="width: 150px" pSortableColumn="serviceCallSubject">
{{l('Subject')}}
<p-sortIcon field="serviceCallSubject"></p-sortIcon>
</th>
<th style="width: 150px" pSortableColumn="serviceCallScheduleSubject">
{{l('Subject')}}
<p-sortIcon field="serviceCallScheduleSubject"></p-sortIcon>
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-record="$implicit">
<tr>
<td style="width: 130px"
[hidden]="!isGrantedAny('Pages.ServiceCallTasks.Edit', 'Pages.ServiceCallTasks.Delete')">
<div class="btn-group dropdown" normalizePosition>
<button class="dropdown-toggle btn btn-sm btn-primary"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
<i class="fa fa-cog"></i><span class="caret"></span> {{l("Actions")}}
</button>
<ul class="dropdown-menu">
<li>
<a
(click)="viewServiceCallTaskModal.show(record)">{{l('View')}}</a>
</li>
<li>
<a *ngIf="permission.isGranted('Pages.ServiceCallTasks.Edit')"
(click)="createOrEditServiceCallTaskModal.show(record.serviceCallTask.id)">{{l('Edit')}}</a>
</li>
<li>
<a *ngIf="permission.isGranted('Pages.ServiceCallTasks.Delete')"
(click)="deleteServiceCallTask(record.serviceCallTask)">{{l('Delete')}}</a>
</li>
</ul>
</div>
</td>
<td style="width:150px">{{record.serviceCallSubject}}</td>
<td style="width:150px">{{record.serviceCallScheduleSubject}}</td>
<td style="width:150px">{{record.serviceCallTask.task}}</td>
<td style="width:150px">{{record.serviceCallTask.details}}</td>
<td style="width:150px">{{record.serviceCallTask.hoursRequired}}</td>
<td style="width:150px">
<div *ngIf="record.serviceCallTask.completed" class="text-center"><i class="fa fa-check-circle m--font-success" title="True"></i></div>
<div *ngIf="!record.serviceCallTask.completed" class="text-center"><i class="fa fa-times-circle" title="False"></i></div>
</td>
</tr>
</ng-template>
</p-table>
<div class="primeng-paging-container">
<p-paginator rows="{{primengTableHelper.defaultRecordsCountPerPage}}"
#paginator
(onPageChange)="getServiceCallTasks($event)"
[totalRecords]="primengTableHelper.totalRecordsCount"
[rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
</p-paginator>
<span class="total-records-count">
{{l('TotalRecordsCount', primengTableHelper.totalRecordsCount)}}
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<createOrEditServiceCallTaskModal #createOrEditServiceCallTaskModal (modalSave)="getServiceCallTasks()"></createOrEditServiceCallTaskModal>
<viewServiceCallTaskModal #viewServiceCallTaskModal></viewServiceCallTaskModal>
</div>
The entity itself is fine by the looks of it and the updating and viewing handles the data correctly. The only weird part is the grid.
Yes, the entity loads correctly.
The bindings in the html side looks fine and i can't really see anything wrong on the componen.ts either.
Here is the component.ts:
import { Component, Injector, ViewEncapsulation, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Http } from '@angular/http'; import { ServiceCallTasksServiceProxy, ServiceCallTaskDto } from '@shared/service-proxies/service-proxies'; import { NotifyService } from '@abp/notify/notify.service'; import { AppComponentBase } from '@shared/common/app-component-base'; import { TokenAuthServiceProxy } from '@shared/service-proxies/service-proxies'; import { CreateOrEditServiceCallTaskModalComponent } from './create-or-edit-serviceCallTask-modal.component'; import { ViewServiceCallTaskModalComponent } from './view-serviceCallTask-modal.component'; import { appModuleAnimation } from '@shared/animations/routerTransition'; 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 * as moment from 'moment';
@Component({ templateUrl: './serviceCallTasks.component.html', encapsulation: ViewEncapsulation.None, animations: [appModuleAnimation()] }) export class ServiceCallTasksComponent extends AppComponentBase {
@ViewChild('createOrEditServiceCallTaskModal') createOrEditServiceCallTaskModal: CreateOrEditServiceCallTaskModalComponent;
@ViewChild('viewServiceCallTaskModalComponent') viewServiceCallTaskModal: ViewServiceCallTaskModalComponent;
@ViewChild('dataTable') dataTable: Table;
@ViewChild('paginator') paginator: Paginator;
advancedFiltersAreShown = false;
filterText = '';
taskFilter = '';
detailsFilter = '';
maxHoursRequiredFilter : number;
maxHoursRequiredFilterEmpty : number;
minHoursRequiredFilter : number;
minHoursRequiredFilterEmpty : number;
completedFilter = -1;
serviceCallSubjectFilter = '';
serviceCallScheduleSubjectFilter = '';
constructor(
injector: Injector,
private _http: Http,
private _serviceCallTasksServiceProxy: ServiceCallTasksServiceProxy,
private _notifyService: NotifyService,
private _tokenAuth: TokenAuthServiceProxy,
private _activatedRoute: ActivatedRoute,
private _fileDownloadService: FileDownloadService
) {
super(injector);
}
getServiceCallTasks(event?: LazyLoadEvent) {
if (this.primengTableHelper.shouldResetPaging(event)) {
this.paginator.changePage(0);
return;
}
this.primengTableHelper.showLoadingIndicator();
this._serviceCallTasksServiceProxy.getAll(
this.filterText,
this.taskFilter,
this.detailsFilter,
this.maxHoursRequiredFilter == null ? this.maxHoursRequiredFilterEmpty: this.maxHoursRequiredFilter,
this.minHoursRequiredFilter == null ? this.minHoursRequiredFilterEmpty: this.minHoursRequiredFilter,
this.completedFilter,
this.serviceCallSubjectFilter,
this.serviceCallScheduleSubjectFilter,
this.primengTableHelper.getSorting(this.dataTable),
this.primengTableHelper.getSkipCount(this.paginator, event),
this.primengTableHelper.getMaxResultCount(this.paginator, event)
).subscribe(result => {
this.primengTableHelper.totalRecordsCount = result.totalCount;
this.primengTableHelper.records = result.items;
this.primengTableHelper.hideLoadingIndicator();
});
}
reloadPage(): void {
this.paginator.changePage(this.paginator.getPage());
}
createServiceCallTask(): void {
this.createOrEditServiceCallTaskModal.show();
}
deleteServiceCallTask(serviceCallTask: ServiceCallTaskDto): void {
this.message.confirm(
'',
(isConfirmed) => {
if (isConfirmed) {
this._serviceCallTasksServiceProxy.delete(serviceCallTask.id)
.subscribe(() => {
this.reloadPage();
this.notify.success(this.l('SuccessfullyDeleted'));
});
}
}
);
}
exportToExcel(): void {
this._serviceCallTasksServiceProxy.getServiceCallTasksToExcel(
this.filterText,
this.taskFilter,
this.detailsFilter,
this.maxHoursRequiredFilter == null ? this.maxHoursRequiredFilterEmpty: this.maxHoursRequiredFilter,
this.minHoursRequiredFilter == null ? this.minHoursRequiredFilterEmpty: this.minHoursRequiredFilter,
this.completedFilter,
this.serviceCallSubjectFilter,
this.serviceCallScheduleSubjectFilter,
)
.subscribe(result => {
this._fileDownloadService.downloadTempFile(result);
});
}
}
Hi @yekalkan
Thank you, was a misunderstanding on my side (Lack of knowledge relating to swagger).
I ended up moving Lookup/Link DTOs which are used more than once to a shared folder and just removing the newly created ones as suggested.
Love the RAD tool. The linked entities how it is implemented now with the RAD tool is saving me sooooo much time.
Hi,
Sorry I might be interpreting this wrong but the Lookup Table DTO's are causing the conflicts:
The below only happens once you link an object more than once.
System.InvalidOperationException: Conflicting schemaIds: Identical schemaIds detected for types Abp.Application.Services.Dto.PagedResultDto1[[BMS.Products.Dtos.ProductDepartmentLookupTableDto, BMS.Application.Shared, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]] and Abp.Application.Services.Dto.PagedResultDto
1[BMS.DiscountGroups.Dtos.ProductDepartmentLookupTableDto]. See config settings - "CustomSchemaIds" for a workaround
at Swashbuckle.AspNetCore.SwaggerGen.SchemaIdManager.IdFor(Type type)
at Swashbuckle.AspNetCore.SwaggerGen.SchemaRegistry.CreateReferenceSchema(Type type, Queue1 referencedTypes) at Swashbuckle.AspNetCore.SwaggerGen.SchemaRegistry.GetOrRegister(Type type) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateResponse(ApiResponseType apiResponseType, ISchemaRegistry schemaRegistry) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector, IEqualityComparer1 comparer) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateOperation(ApiDescription apiDescription, ISchemaRegistry schemaRegistry) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItem(IEnumerable
1 apiDescriptions, ISchemaRegistry schemaRegistry)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func
2 keySelector, Func2 elementSelector, IEqualityComparer
1 comparer)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath, String[] schemes)
Hi,
In normal circumstances, I would be able to but on this specific server, I am unable to remove(untick) it in Roles & Features.
I'll stick with this method in case the client needs to use WebDAV at some stage for something else.
Thank you.
Regards, Gideon Badenhorst
Funny enough, it is not that CORS is the problem. The main culprit, in this case, is WebDAV.
You need to configure the webconfig file to remove webdav module and webdav in order to fix things like posts being handled as puts and stuff like that. The below fixes the issue it seems. As I can't remove WebDAV from IIS, the only way is to remove it this way.
<system.webServer> <ins><modules runAllManagedModulesForAllRequests="true"> <remove name="WebDAVModule" /> </modules></ins> <handlers> <ins><remove name="WebDAV" /></ins> <add name="aspNetCore" path="" verb="" modules="AspNetCoreModule" resourceType="Unspecified" /> </handlers>
HI,
I have the logs on (stdout=true). I also have full access assigned to the deployment folders. However, I have not managed to get them working as of yet. They always give the error that they can't be created, no matter where I deploy them.
Warning: Could not create stdoutLogFile \?\C:\inetpub\BMS_API\logs\stdout_5720_20183832812.log, ErrorCode = -2147024891.
I have seen several posts regarding fixes for this but most of them relate to editing the csproj file as a "workaround". I would rather have the correct way to resolve such a scenario than a quick fix which has been around since Core 1.0.
Is there something else I am missing, I assume someone has had this with the ASP.Net Zero project at some point?
The thing that I don't understand about this whole scenario of CORS. 70% of my functionality is default methods generated with all the basics of the ASP Net Power tools and they work. But Delete and system related updates don't work. I tried updating the Visual settings now and I get CORS error when I save.