Hi,
Took some time to make this work. I tried out workarounds here : [https://github.com/primefaces/primeng/issues/807]). But didn't work for me.
After, I installed quill from npm package "ngx-quill".
Now, it's working perfectly :)
Cheers
Hello,
Yes, Editor component from ngPrime is an angular component with Quill dependency.
Quill reference is the lastest item in my angular-cli file. My Quill version is 1.3.2, I've checked differences between 1.3.0 but just bugg fixes ; normally, should not have impact.
By the way, I've tried to implement another editor : this time I select TinyMce editor (they have an angular version of it). It is also not working with error TinyMce is not defined.
Can this be caused by a wrong typings configuration ? It is stange that both editor components have quite the same problem...
OK, I found the difference with my implementation. My entity was inheriting from FullAuditedEntity. I passed it to CreationAuditedEntity and it works has expected.
I removed AddTemporarySigningCredential by AddSigningCredential by passing my SSL certificate but it doesn't work. App crash when trying to find the certificate. Do you have an other solution for your own servers ?
I will let AddTemporarySigningCredential for now but it would be better to add an IF ENDIF to remove it from production. Also, app-settings should be used to pass data to AddSigningCredential on production context.
Would it be possible to add something like that in next releases ?
Hi,
It works with following code. As you said @alper, I need to update parent entity alone first and then childs entity. Tks !
public async Task UpdateEventEdit(EventEditDto input)
{
var _event = await _eventRepository.GetAsync(input.Id);
input.MapTo(_event);
_event.EventUsers.Clear();
var updatedEvent = await _eventRepository.UpdateAsync(_event);
//Update EventUsers separatly
if (input.EventUsers.Count > 0)
{
foreach (var eventUser in input.EventUsers)
{
updatedEvent.EventUsers.Add(await UserManager.GetUserByIdAsync(eventUser.Id));
}
await _eventRepository.UpdateAsync(updatedEvent);
}
}
Issue solved. I just update VS 2017 to the latest release.
Cheers
Hi alper,
Thanks, I will do it with primeng.
Yes sure, here it is :
DTO's
public class GetEventsInput : PagedAndSortedInputDto, IShouldNormalize
{
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public string Description { get; set; }
public void Normalize()
{
if (Sorting.IsNullOrWhiteSpace())
{
Sorting = "Begin DESC";
}
}
}
[AutoMapFrom(typeof(Event))]
public class EventListDto : FullAuditedEntityDto<long>
{
public long AddressId { get; set; }
public DateTime Begin { get; set; }
public DateTime End { get; set; }
public string Description { get; set; }
public long? MainUserId { get; set; }
public List<MainUserDto> EventUsers { get; set; }
}
[AutoMap(typeof(Event))]
public class EventEditDto : EntityDto<long>
{
[Required]
public DateTime Begin { get; set; }
[Required]
public DateTime End { get; set; }
public string Description { get; set; }
public List<MainUserDto> EventUsers { get; set; }
}
[AutoMap(typeof(Event))]
public class CreateEventInput
{
[Required]
public long AddressId { get; set; }
[Required]
public string Begin { get; set; }
[Required]
public string End { get; set; }
public string Description { get; set; }
public long? MainUserId { get; set; }
public List<MainUserDto> EventUsers { get; set; }
}
[AutoMap(typeof(User))]
public class MainUserDto : EntityDto<long>
{
public string Name { get; set; }
public string Surname { get; set; }
public string UserName { get; set; }
public string EmailAddress { get; set; }
public string PhoneNumber { get; set; }
public Guid? ProfilePictureId { get; set; }
}
And AppService's
[AbpAuthorize(AppPermissions.Pages_Tenant_Events_Create)]
public async Task CreateEvent(CreateEventInput input)
{
var eventVar = input.MapTo<Event>();
eventVar.EventUsers.Clear();
for (int i = 0; i < input.EventUsers.Count; i++)
{
eventVar.EventUsers.Add(await UserManager.GetUserByIdAsync(input.EventUsers[i].Id));
}
await _eventRepository.InsertAsync(eventVar);
}
public async Task<PagedResultDto<EventListDto>> GetEvents(GetEventsInput input)
{
var events = _eventRepository
.GetAll()
.Include(c=>c.EventUsers)
.Where(
p => (p.Begin >= input.StartDate &&
p.End <= input.EndDate)
);
var resultCount = await events.CountAsync();
var results = await events
.OrderBy(input.Sorting)
.PageBy(input)
.ToListAsync();
var eventListDtos = results.MapTo<List<EventListDto>>();
return new PagedResultDto<EventListDto>(resultCount, eventListDtos);
}
[AbpAuthorize(AppPermissions.Pages_Tenant_Events_Edit)]
public async Task<EventEditDto> GetEventEdit(EntityDto<long> input)
{
var _event = await _eventRepository.GetAll()
.Include(c => c.EventUsers)
.FirstAsync(c => c.Id == input.Id);
var _eventDto = _event.MapTo<EventEditDto>();
return _eventDto;
}
[AbpAuthorize(AppPermissions.Pages_Tenant_Events_Edit)]
public async Task UpdateEventEdit(EventEditDto input)
{
var _event = await _eventRepository.GetAsync(input.Id);
_event.EventUsers.Clear();
input.MapTo(_event);
await _eventRepository.UpdateAsync(_event);
}
Still having issues when updating entities : error log is " Validation failed for one or more entities". I've tried the same design with other entities that I've created (not with user entity from abp) and still having same issue for updates.
Yes for sure, I'm extending AppComponentBase.
By digging on this issue this afternoon I found the problem : I used simple quotes instead of double. Now it's working.
This code doesn't work : <input class="form-control" type="text" name="DoorCode" <span style="color:#FF0000">placeholder="{{l("DoorCode")}}" </span>[(ngModel)]="address.doorCode" >
This one works well : <input class="form-control" type="text" name="DoorCode" <span style="color:#0040FF">placeholder='{{l("DoorCode")}}' </span>[(ngModel)]="address.doorCode" >
Thks for the hint. I will do so ;)