According to http://malsup.com/jquery/block/ , the plugin is designed to have functionality like:
$.blockUI({ message: '<h1> Just a moment...</h1>' });
That code does not display the message. Is there a way to do this with abp.ui.block(); or $.blockUI() in an apb project?
Thanks
Hello,
We have a business need to have duplicate Display Names in OrganizationUnits under the same parent. We have association metadata tables to differentiate between them. Is there a way to disable the check on save when using the IRepository<OrganizationUnit>? Currently we get the following error: "There is already an organization unit with name [name]. Two units with same name can not be created in same level." The documentation here does not mention this as a requirement.
Thank you for your time and effort.
We are running ABP MVC 5/ JQuery and upgraded today to 3.6.1. This code:
var tags = await _departmentRepository
.GetAllIncluding(x => x.OrganizationUnit)
.GroupJoin(_userOrganizationUnitRepository.GetAll(),
t => t.OrganizationUnitId,
a => a.OrganizationUnitId,
(t, a) => new { Assignments = a, Tag = t }
)
.Where(x => x.Tag.OrganizationUnit.ParentId == parentId)
.ToListAsync();
now throws: "The specified LINQ expression contains references to queries that are associated with different contexts." This error is occurring at run-time for multiple LINQ expressions similar to the one above. Do we need to change our code? Do you know what could be causing this?
Thank you for your time.
Hello,
What is the best way to mock this linq statement:
var results = _groupRepository
.GetAllIncluding(x => x.OrganizationUnit)
.Where(x => x.Id != id)
.ToList();
We have tried something like:
_groupRepository.Setup(x => x.GetAllIncluding(It.IsAny<Expression<Func<Group, object>>>)
.Where(It.IsAny<Expression<Func<Group, bool>>>))
.Returns(groups.AsQueryable);
This will not compiled due to " Error CS1503: Argument 1: cannot convert from 'method group' to 'Expression<Func<Group, object>>' " Is this possible?
Thanks.
Hello,
We are trying to implement SignalR changes in order to alert and sync different simultaneous users. We have followed [https://aspnetboilerplate.com/Pages/Documents/SignalR-Integration]) and have a mysterious issue.
We first posted here [https://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=10680]) and found it initially worked. Upon further testing, we found that occasionally the hub method (see below)
Clients.Others.saved(payload);
was broadcasting to the original sending client and not to the other clients. To be explicit we altered the save method to this:
public void Save(string payload)
{
var ownerId = Context.ConnectionId;
Clients.All.saved(new KeyValuePair<string, string>(ownerId, payload));
}
and on the client we are attempting to filter on the connectionId like this:
function processChangeFromAnotherUser(kvp) {
var id = kvp.Key;
console.log('owner', id);
var connectionId = hub.connection.id;
console.log('connectionId', connectionId);
if (connectionId === id) {
return;
};
var data = JSON.parse(kvp.Value);
}
Unfortunately we are seeing the same unexpected behavior. We are testing using two different browsers (Chrome 63 on the left and Firefox Dev Edition (quantum) v59 on the right ). The website is hosted by IIS Express on a developer's computer. The "saved" message at the top of the screen should appear only on the right browser, but it appears on the left instead. As you can see the right browser has a connectionId which matches the sender's ID (which should be the browser on the left). Please see a screenshot here
Do you have any ideas as to what could be responsible for this unexpected behavior?
We want a way to broadcast a message from the application service layer. However, signalR Hubs are only available in the Web layer. Therefore, we cannot call from a service into the Web layer. Using [https://aspnetboilerplate.com/Pages/Documents/Notification-System]) as a guide we have:
//server
public async Task PublishSaveAsync()
{
await _notificationPublisher.PublishAsync("message");
}
//client
function initializeHub() {
abp.event.on('abp.notifications.received', processSaved);
};
function processSaved(saveNotification) {
console.log('saveNotification', saveNotification);
};
The server code is executed, but the log statement is never written. Are we doing something incorrectly or is there a better way to do this?
Thanks.
Hello,
We are trying to join AbsUsersOrganizationUnits to a custom table called "departments" as below:
public class Department : Entity, IMustHaveOrganizationUnit
{
public const int MaximumIdLength = 50;
public const int MaximumTitleLength = 50;
public string CustomKey { get; set; }
public bool Locked { get; set; } = false;
public long OrganizationUnitId { get; set; }
public virtual OrganizationUnit OrganizationUnit { get; set; }
public Department()
{
}
public Department(long organizationUnitId, string cutomKey)
{
OrganizationUnitId = organizationUnitId;
CustomKey = cutomKey;
}
}
The specified cast from a materialized 'System.Data.Entity.Core.Objects.MaterializedDataRecord' type to the '<>f__AnonymousType142[<>f__AnonymousType12
2[Abp.Authorization.Users.UserOrganizationUnit,Abp.Organizations.OrganizationUnit],<>f__AnonymousType13`2[Abp.Authorization.Users.UserOrganizationUnit,MyCompanyName.AbpZeroTemplate.Departments.Department]]' type is not valid.
The code that is failing is here:
public async Task<Dictionary<long, string>> GetFirstCustomKeysByUserIdAsync(IReadOnlyList<long> ids)
{
var assignments = _userOrganizationUnitRepository
.GetAll()
.Where(x => ids.Contains(x.UserId));
var organizationUnits = _organizationUnitRepository
.GetAll();
var departments = _departmentRepository
.GetAll();
var first = assignments
.Join(organizationUnits,
a => a.OrganizationUnitId,
ou => ou.Id,
(a, ou) => new { Assignments = a, OrganizationUnits = ou });
var second = assignments
.Join(departments,
a => a.OrganizationUnitId,
d => d.OrganizationUnitId,
(p, d) => new { Projection = p, Departments = d });
var third = first.Join(second,
f => f.Assignments.OrganizationUnitId,
s => s.Departments.OrganizationUnitId,
(f, s) => new { First = f, Second = s });
var result = await third.ToDictionaryAsync(x => x.First.Assignments.UserId,
x => x.Second.Departments.CustomKey);
return result;
}
Any suggestions would be appreciated. Thank you for your time and effort.
Dear Abp Zero Support,
On my PC and a co-workers PC we both get the following message, >angular/[email protected] requires typescript@'>=2.1.0 <2.4.0' but 2.5.2 was found instead .
I have removed typescript via
npm uninstall -g typescript
but I still get that message. This is the first Google hit [https://github.com/angular/angular/issues/19287]) and it concerns 4.4.3. I've tried a few of their suggestions unsuccessfully.
Have you encountered this issue?
Hello,
We see that we can turn validation off via an attribute here: [https://aspnetboilerplate.com/Pages/Documents/Validating-Data-Transfer-Objects#disabling-validation]) We would like to disable this globally. We are using javascript calls and MVC forms in various combination. Then we perform our own business-specific validation server-side. If a piece of data is null or undefined then it gets an error that says "....A value is required but was not present...." We want to write custom validation to catch this. Is there a way to turn this validation off globally?
Hello,
Currently we pull all information back and filter it to get single records like this:
(await _userRepository.GetAllListAysnc()).FirstOrDefault(x => x.name == "Bob");
We would like to only pull back the information we need and write something like this:
_userRepository.GetAsync(x => x.name == "Bob")
or
_userRepository.GetAsync().Where(x => x.name == "Bob")
Is this possible? We see this project doing something similar: [https://github.com/zzzprojects/LINQ-Async])
Thank you for your time.