Skip to content

Commit

Permalink
Merge branch 'hotfix/v3.0.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeySafronov committed Nov 26, 2024
2 parents 2d899d0 + a0809c7 commit 101c818
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 28 deletions.
2 changes: 1 addition & 1 deletion common/ASC.Data.Storage/S3/S3Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ public override async Task DeleteDirectoryAsync(string domain, string path)
}
public override async Task DeleteDirectoryAsync(string domain, string path, Guid ownerId)
{
await DeleteFilesAsync(domain, path, "*", true);
await DeleteFilesAsync(domain, path, "*", true, ownerId);
}

public override async Task<long> GetFileSizeAsync(string domain, string path)
Expand Down
10 changes: 2 additions & 8 deletions common/services/ASC.ElasticSearch/Core/Selector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public Selector<T> Match(Expression<Func<T, object>> selector, string value)
{
_queryContainer &= Wrap(selector, (a, w) => w.MatchPhrase(r => r.Field(a).Query(value.TrimQuotes())));
}
else if (value.HasOtherLetter() || IsExactly(value))
else if (IsExactly(value))
{
_queryContainer &= Wrap(selector, (a, w) => w.Match(r => r.Field(a).Query(value.TrimQuotes())));
}
Expand Down Expand Up @@ -306,7 +306,7 @@ private void Match(Func<Fields> propsFunc, string value)
{
_queryContainer = _queryContainer && MultiPhrase(props, value.TrimQuotes());
}
else if (value.HasOtherLetter() || IsExactly(value))
else if (IsExactly(value))
{
_queryContainer = _queryContainer && MultiMatch(props, value.TrimQuotes());
}
Expand Down Expand Up @@ -431,12 +431,6 @@ private QueryContainer MultiPhrase(Fields fields, string value)

internal static class StringExtension
{
public static bool HasOtherLetter(this string value)
{
var specialChar = @"-=+;/\|№&#^<>()[]{}$%";
return specialChar.Any(value.Contains);
}

public static string WrapAsterisk(this string value)
{
var result = value;
Expand Down
8 changes: 2 additions & 6 deletions products/ASC.Files/Core/Core/Dao/TeamlabDao/FolderDao.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1559,9 +1559,7 @@ select t.ParentId
select rs.Indexing).FirstOrDefault() && f.EntryId == r.Id && f.TenantId == r.TenantId && f.EntryType == FileEntryType.Folder
select f.Order
).FirstOrDefault(),
Settings = (from f in filesDbContext.RoomSettings
where f.TenantId == r.TenantId && f.RoomId == r.Id
select f).FirstOrDefault()
Settings = filesDbContext.RoomSettings.Where(x => x.TenantId == r.TenantId && x.RoomId == r.Id).Distinct().FirstOrDefault()
});
}

Expand Down Expand Up @@ -1599,9 +1597,7 @@ select t.ParentId
select rs.Indexing).FirstOrDefault() && f.EntryId == r.Id && f.TenantId == r.TenantId && f.EntryType == FileEntryType.Folder
select f.Order
).FirstOrDefault(),
Settings = (from f in filesDbContext.RoomSettings
where f.TenantId == r.TenantId && f.RoomId == r.Id
select f).FirstOrDefault()
Settings = filesDbContext.RoomSettings.Where(x => x.TenantId == r.TenantId && x.RoomId == r.Id).Distinct().FirstOrDefault()
});
}

Expand Down
13 changes: 3 additions & 10 deletions products/ASC.Files/Core/Core/EF/Queries/FolderQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,7 @@ select f
.Skip(1)
.FirstOrDefault()
.ToString()),
Settings = (from f in ctx.RoomSettings
where f.TenantId == r.TenantId && f.RoomId == r.Id
select f).FirstOrDefault(),
Settings = ctx.RoomSettings.Where(x => x.TenantId == r.TenantId && x.RoomId == r.Id).Distinct().FirstOrDefault(),
Order = (
from f in ctx.FileOrder
where (
Expand Down Expand Up @@ -484,9 +482,7 @@ select t.ParentId
select rs.Indexing).FirstOrDefault() && f.EntryId == r.folder.Id && f.TenantId == r.folder.TenantId && f.EntryType == FileEntryType.Folder
select f.Order
).FirstOrDefault(),
Settings = (from f in ctx.RoomSettings
where f.TenantId == r.folder.TenantId && f.RoomId == r.folder.Id
select f).FirstOrDefault()
Settings = ctx.RoomSettings.Where(x => x.TenantId == r.folder.TenantId && x.RoomId == r.folder.Id).Distinct().FirstOrDefault()
}
));

Expand Down Expand Up @@ -923,10 +919,7 @@ select f
.Select(r => new DbFolderQuery
{
Folder = r.Folders,
Settings = (from f in ctx.RoomSettings
where f.TenantId == r.Folders.TenantId && f.RoomId == r.Folders.Id
select f)
.FirstOrDefault()
Settings = ctx.RoomSettings.Where(x => x.TenantId == r.Folders.TenantId && x.RoomId == r.Folders.Id).Distinct().FirstOrDefault()
})
.Skip(1)
.FirstOrDefault());
Expand Down
2 changes: 0 additions & 2 deletions products/ASC.Files/Core/Utils/EntryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ public async Task SetFileStatusAsync<T>(IEnumerable<File<T>> files)
file.LockedBy = lockedBy != Guid.Empty && lockedBy != authContext.CurrentAccount.ID
? await global.GetUserNameAsync(lockedBy)
: null;

continue;
}

if (tagsNew.Exists(r => r.EntryId.Equals(file.Id)))
Expand Down
3 changes: 2 additions & 1 deletion web/ASC.Web.Core/Users/UserManagerWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ public async Task<UserInfo> AddInvitedUserAsync(string email, EmployeeType type,
{
await userManager.AddUserIntoGroupAsync(newUser.Id, groupId, true);
}
else if (type == EmployeeType.RoomAdmin)

if (groupId == Guid.Empty && type == EmployeeType.RoomAdmin || type == EmployeeType.DocSpaceAdmin && user.Status == EmployeeStatus.Pending)
{
var (name, value) = await tenantQuotaFeatureStatHelper.GetStatAsync<CountPaidUserFeature, int>();
_ = quotaSocketManager.ChangeQuotaUsedValueAsync(name, value);
Expand Down

0 comments on commit 101c818

Please sign in to comment.