diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs index 847af8338..b4f4bb412 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs @@ -138,8 +138,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Assets } else if (isDefaultQuery) { - // Cache total count by app and folder. - var totalKey = parentId.HasValue ? DomainId.Combine(appId, parentId.Value) : appId; + // Cache total count by app and asset folder. + var totalKey = $"{appId}_{parentId}"; assetTotal = await countCollection.GetOrAddAsync(totalKey, ct => Collection.Find(filter).CountDocumentsAsync(ct), ct); } diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryByQuery.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryByQuery.cs index 61467ae99..8ba11bc85 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryByQuery.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryByQuery.cs @@ -153,7 +153,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations else if (isDefault) { // Cache total count by app and schema. - var totalKey = DomainId.Combine(app.Id, schema.Id); + var totalKey = $"{app.Id}_{schema.Id}"; contentTotal = await countCollection.GetOrAddAsync(totalKey, ct => Collection.Find(filter).CountDocumentsAsync(ct), ct); } diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/MongoCountCollection.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/MongoCountCollection.cs index baf04f66e..e1775b56d 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/MongoCountCollection.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/MongoCountCollection.cs @@ -30,12 +30,6 @@ namespace Squidex.Domain.Apps.Entities.MongoDb return name; } - public Task GetOrAddAsync(DomainId key, Func> provider, - CancellationToken ct) - { - return GetOrAddAsync(key.ToString(), provider, ct); - } - public async Task GetOrAddAsync(string key, Func> provider, CancellationToken ct) { diff --git a/backend/src/Squidex/Areas/Api/Controllers/Statistics/UsagesController.cs b/backend/src/Squidex/Areas/Api/Controllers/Statistics/UsagesController.cs index 9c2da95c6..8cf17ca59 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Statistics/UsagesController.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Statistics/UsagesController.cs @@ -170,13 +170,12 @@ namespace Squidex.Areas.Api.Controllers.Statistics { var appId = DomainId.Create(dataProtector.Unprotect(token)); - var today = DateTime.UtcNow.Date; - - var fileName = $"Usage-{today:yyy-MM-dd}.csv"; + var fileDate = DateTime.UtcNow.Date; + var fileName = $"Usage-{fileDate:yyy-MM-dd}.csv"; var callback = new FileCallback((body, range, ct) => { - return appLogStore.ReadLogAsync(appId, today.AddDays(-30), today, body, ct); + return appLogStore.ReadLogAsync(appId, fileDate.AddDays(-30), fileDate, body, ct); }); return new FileCallbackResult("text/csv", callback) diff --git a/frontend/src/app/framework/angular/modals/dialog-renderer.component.html b/frontend/src/app/framework/angular/modals/dialog-renderer.component.html index ad1f1cfec..00d4b5a5a 100644 --- a/frontend/src/app/framework/angular/modals/dialog-renderer.component.html +++ b/frontend/src/app/framework/angular/modals/dialog-renderer.component.html @@ -43,8 +43,8 @@
+ [offsetY]="tooltip.offsetY" + [offsetX]="tooltip.offsetX"> {{tooltip.text | sqxTranslate}} diff --git a/frontend/src/app/framework/services/dialog.service.ts b/frontend/src/app/framework/services/dialog.service.ts index c23130f03..14a0991f9 100644 --- a/frontend/src/app/framework/services/dialog.service.ts +++ b/frontend/src/app/framework/services/dialog.service.ts @@ -60,6 +60,16 @@ export class DialogRequest { } export class Tooltip { + private readonly isHorizontal; + + public get offsetX() { + return this.isHorizontal ? 6 : 0; + } + + public get offsetY() { + return this.isHorizontal ? 0 : 6; + } + constructor( public readonly target: any, public readonly text: string | null | undefined, @@ -67,6 +77,13 @@ export class Tooltip { public readonly multiple?: boolean, public readonly shortcut?: string, ) { + this.isHorizontal = + textPosition === 'left-bottom' || + textPosition === 'left-center' || + textPosition === 'left-top' || + textPosition === 'right-bottom' || + textPosition === 'right-center' || + textPosition === 'right-top'; } } diff --git a/frontend/src/app/shared/components/contents/content-value.component.html b/frontend/src/app/shared/components/contents/content-value.component.html index 37c2bb8ba..00a0619c0 100644 --- a/frontend/src/app/shared/components/contents/content-value.component.html +++ b/frontend/src/app/shared/components/contents/content-value.component.html @@ -1,5 +1,5 @@ -
+
{{value}}
diff --git a/frontend/src/app/shared/components/contents/content-value.component.ts b/frontend/src/app/shared/components/contents/content-value.component.ts index 8904bc324..a809b12e1 100644 --- a/frontend/src/app/shared/components/contents/content-value.component.ts +++ b/frontend/src/app/shared/components/contents/content-value.component.ts @@ -35,6 +35,10 @@ export class ContentValueComponent extends ResourceOwner implements OnChanges { return !Types.is(this.value, HtmlValue); } + public get title() { + return this.isString ? this.value : undefined; + } + constructor( private readonly changeDetector: ChangeDetectorRef, ) {