From 6e139f68096991d35a056155a10d156c2e3aae5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castanheira=20Sim=C3=B5es?= Date: Sat, 5 Apr 2025 14:37:55 +0100 Subject: [PATCH 01/39] Add ROW_RECORD injection token and update ExtensibleTableComponent to use it --- .../extensible-table/extensible-table.component.ts | 11 ++++++++--- .../extensible/src/lib/tokens/extensions.token.ts | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts index 86de7f0ff2..404621cefa 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts @@ -47,6 +47,7 @@ import { ENTITY_PROP_TYPE_CLASSES, EXTENSIONS_IDENTIFIER, PROP_DATA_STREAM, + ROW_RECORD, } from '../../tokens/extensions.token'; import { GridActionsComponent } from '../grid-actions/grid-actions.component'; @@ -196,6 +197,10 @@ export class ExtensibleTableComponent implements OnChanges, AfterViewIn provide: PROP_DATA_STREAM, useValue: value, }, + { + provide: ROW_RECORD, + useValue: record, + }, ], parent: this.#injector, }); @@ -231,8 +236,8 @@ export class ExtensibleTableComponent implements OnChanges, AfterViewIn ngAfterViewInit(): void { this.list?.requestStatus$?.pipe(filter(status => status === 'loading')).subscribe(() => { - this.data = []; - this.cdr.markForCheck(); - }); + this.data = []; + this.cdr.markForCheck(); + }); } } diff --git a/npm/ng-packs/packages/components/extensible/src/lib/tokens/extensions.token.ts b/npm/ng-packs/packages/components/extensible/src/lib/tokens/extensions.token.ts index 0a2df45a00..bafaf29908 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/tokens/extensions.token.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/tokens/extensions.token.ts @@ -18,6 +18,9 @@ export const PROP_DATA_STREAM = new InjectionToken>('PROP_DATA_S type EntityPropTypeClassMap = { [key in ePropType]: string; }; + +export const ROW_RECORD = new InjectionToken('ROW_RECORD'); + export type EntityPropTypeClass = Partial; export const ENTITY_PROP_TYPE_CLASSES = new InjectionToken( 'ENTITY_PROP_TYPE_CLASSES', From af9cffe21e7e3d43070b0f10e213116c7d7ec145 Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Tue, 8 Apr 2025 15:15:55 +0300 Subject: [PATCH 02/39] timezone service added --- .../packages/core/src/lib/services/index.ts | 1 + .../core/src/lib/services/timezone.service.ts | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 npm/ng-packs/packages/core/src/lib/services/timezone.service.ts diff --git a/npm/ng-packs/packages/core/src/lib/services/index.ts b/npm/ng-packs/packages/core/src/lib/services/index.ts index c47bef3106..2fa7d134b5 100644 --- a/npm/ng-packs/packages/core/src/lib/services/index.ts +++ b/npm/ng-packs/packages/core/src/lib/services/index.ts @@ -23,3 +23,4 @@ export * from './window.service'; export * from './internet-connection-service'; export * from './local-storage-listener.service'; export * from './title-strategy.service'; +export * from './timezone.service'; diff --git a/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts b/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts new file mode 100644 index 0000000000..5862b5be04 --- /dev/null +++ b/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts @@ -0,0 +1,34 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root', +}) +export class TimezoneService { + private readonly cookieKey = '__timezone'; + + getBrowserTimezone(): string { + return Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + getTimezone(): string { + const fromCookie = this.getCookie(this.cookieKey); + return fromCookie || this.getBrowserTimezone(); + } + + setTimezone(timezone: string): void { + document.cookie = `${this.cookieKey}=${timezone}; path=/`; + } + + convertUtcToLocal(date: string | Date): Date { + return new Date(date + 'Z'); + } + + convertLocalToUtc(date: Date): string { + return date.toISOString(); + } + + private getCookie(name: string): string | null { + const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); + return match ? decodeURIComponent(match[2]) : null; + } +} From b4db4b3d41281f3b835ab3b67ec10f06215f75eb Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Tue, 8 Apr 2025 15:27:58 +0300 Subject: [PATCH 03/39] timezone interceptor service added --- .../core/src/lib/interceptors/index.ts | 1 + .../lib/interceptors/timezone.interceptor.ts | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts diff --git a/npm/ng-packs/packages/core/src/lib/interceptors/index.ts b/npm/ng-packs/packages/core/src/lib/interceptors/index.ts index d7479a7684..ddcc17e23d 100644 --- a/npm/ng-packs/packages/core/src/lib/interceptors/index.ts +++ b/npm/ng-packs/packages/core/src/lib/interceptors/index.ts @@ -1 +1,2 @@ export * from './api.interceptor'; +export * from './timezone.interceptor'; diff --git a/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts b/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts new file mode 100644 index 0000000000..1a6d7be8a3 --- /dev/null +++ b/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts @@ -0,0 +1,21 @@ +import { inject, Injectable } from '@angular/core'; +import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; +import { TimezoneService } from '../services'; +import { Observable } from 'rxjs'; + +@Injectable() +export class TimezoneInterceptor implements HttpInterceptor { + protected readonly timezoneService = inject(TimezoneService); + + intercept(req: HttpRequest, next: HttpHandler): Observable> { + const timezone = this.timezoneService.getTimezone(); + if (timezone) { + req = req.clone({ + setHeaders: { + __timezone: timezone, + }, + }); + } + return next.handle(req); + } +} From 8f2bb4838e225b9567dc6fe4e52f5dbc6bcd650b Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Tue, 8 Apr 2025 15:58:33 +0300 Subject: [PATCH 04/39] utc-to-local pipe added --- .../packages/core/src/lib/core.module.ts | 3 ++ .../packages/core/src/lib/pipes/index.ts | 1 + .../core/src/lib/pipes/utc-to-local.pipe.ts | 45 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts diff --git a/npm/ng-packs/packages/core/src/lib/core.module.ts b/npm/ng-packs/packages/core/src/lib/core.module.ts index 83881a5246..e6e8c3355a 100644 --- a/npm/ng-packs/packages/core/src/lib/core.module.ts +++ b/npm/ng-packs/packages/core/src/lib/core.module.ts @@ -30,6 +30,7 @@ import { ShortTimePipe } from './pipes/short-time.pipe'; import { ShortDatePipe } from './pipes/short-date.pipe'; import { SafeHtmlPipe } from './pipes/safe-html.pipe'; import { provideAbpCoreChild, provideAbpCore, withOptions } from './providers'; +import { UtcToLocalPipe } from './pipes'; const standaloneDirectives = [ AutofocusDirective, @@ -64,6 +65,7 @@ const standaloneDirectives = [ ShortDateTimePipe, ShortTimePipe, ShortDatePipe, + UtcToLocalPipe, ...standaloneDirectives, ], imports: [ @@ -85,6 +87,7 @@ const standaloneDirectives = [ ShortDateTimePipe, ShortTimePipe, ShortDatePipe, + UtcToLocalPipe, ], providers: [LocalizationPipe, provideHttpClient(withInterceptorsFromDi())], }) diff --git a/npm/ng-packs/packages/core/src/lib/pipes/index.ts b/npm/ng-packs/packages/core/src/lib/pipes/index.ts index 1a981ca041..f0c7b4ff60 100644 --- a/npm/ng-packs/packages/core/src/lib/pipes/index.ts +++ b/npm/ng-packs/packages/core/src/lib/pipes/index.ts @@ -5,3 +5,4 @@ export * from './to-injector.pipe'; export * from './short-date.pipe'; export * from './short-time.pipe'; export * from './short-date-time.pipe'; +export * from './utc-to-local.pipe'; diff --git a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts new file mode 100644 index 0000000000..6e5245fc6e --- /dev/null +++ b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts @@ -0,0 +1,45 @@ +import { Pipe, PipeTransform, Injectable, inject } from '@angular/core'; +import { TimezoneService } from '../services'; + +@Injectable() +@Pipe({ + name: 'utcToLocal', + standalone: false, +}) +export class UtcToLocalPipe implements PipeTransform { + protected readonly timezoneService = inject(TimezoneService); + private readonly timezone: string; + + constructor() { + this.timezone = this.timezoneService.getTimezone(); + } + + transform( + value: string | Date | null | undefined, + locale: string = navigator.language, + options?: Intl.DateTimeFormatOptions, + ): string { + if (!value) return ''; + + try { + const utcDate = new Date(value + 'Z'); // Ensure it's treated as UTC + + const formatOptions: Intl.DateTimeFormatOptions = options || { + year: 'numeric', + month: 'short', + day: 'numeric', + hour: '2-digit', + minute: '2-digit', + }; + + const formatter = new Intl.DateTimeFormat(locale, { + ...formatOptions, + timeZone: this.timezone, + }); + + return formatter.format(utcDate); + } catch (err) { + return ''; + } + } +} From 7a56fec99a7a9ce9695b3b0fdb5ae61a962582d2 Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Tue, 8 Apr 2025 18:45:02 +0300 Subject: [PATCH 05/39] timezone service refactoring --- .../lib/interceptors/timezone.interceptor.ts | 4 +++- .../core/src/lib/services/timezone.service.ts | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts b/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts index 1a6d7be8a3..aa6320f206 100644 --- a/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts +++ b/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts @@ -3,7 +3,9 @@ import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/c import { TimezoneService } from '../services'; import { Observable } from 'rxjs'; -@Injectable() +@Injectable({ + providedIn: 'root', +}) export class TimezoneInterceptor implements HttpInterceptor { protected readonly timezoneService = inject(TimezoneService); diff --git a/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts b/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts index 5862b5be04..de112023d0 100644 --- a/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts @@ -1,10 +1,21 @@ -import { Injectable } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; +import { DOCUMENT } from '@angular/common'; +import { ConfigStateService } from './config-state.service'; @Injectable({ providedIn: 'root', }) export class TimezoneService { + protected readonly configState = inject(ConfigStateService); + protected readonly document = inject(DOCUMENT); private readonly cookieKey = '__timezone'; + private timeZoneNameFromSettings: string | null | undefined; + + constructor() { + this.configState.getOne$('timing').subscribe(timezoneSettings => { + this.timeZoneNameFromSettings = timezoneSettings?.timeZone?.iana?.timeZoneName; + }); + } getBrowserTimezone(): string { return Intl.DateTimeFormat().resolvedOptions().timeZone; @@ -12,11 +23,11 @@ export class TimezoneService { getTimezone(): string { const fromCookie = this.getCookie(this.cookieKey); - return fromCookie || this.getBrowserTimezone(); + return this.timeZoneNameFromSettings || fromCookie || this.getBrowserTimezone(); } setTimezone(timezone: string): void { - document.cookie = `${this.cookieKey}=${timezone}; path=/`; + this.document.cookie = `${this.cookieKey}=${timezone}; path=/`; } convertUtcToLocal(date: string | Date): Date { @@ -28,7 +39,7 @@ export class TimezoneService { } private getCookie(name: string): string | null { - const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); + const match = this.document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); return match ? decodeURIComponent(match[2]) : null; } } From eb8b74429cb97a02488a12e85d70fc906b2a06ab Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Tue, 8 Apr 2025 19:42:09 +0300 Subject: [PATCH 06/39] extensible table timezone support --- .../packages/core/src/lib/core.module.ts | 3 +- .../core/src/lib/pipes/utc-to-local.pipe.ts | 29 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/core.module.ts b/npm/ng-packs/packages/core/src/lib/core.module.ts index e6e8c3355a..4238bcdb1e 100644 --- a/npm/ng-packs/packages/core/src/lib/core.module.ts +++ b/npm/ng-packs/packages/core/src/lib/core.module.ts @@ -65,7 +65,6 @@ const standaloneDirectives = [ ShortDateTimePipe, ShortTimePipe, ShortDatePipe, - UtcToLocalPipe, ...standaloneDirectives, ], imports: [ @@ -74,6 +73,7 @@ const standaloneDirectives = [ ReactiveFormsModule, RouterModule, LocalizationModule, + UtcToLocalPipe, ...standaloneDirectives, ], declarations: [ @@ -87,7 +87,6 @@ const standaloneDirectives = [ ShortDateTimePipe, ShortTimePipe, ShortDatePipe, - UtcToLocalPipe, ], providers: [LocalizationPipe, provideHttpClient(withInterceptorsFromDi())], }) diff --git a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts index 6e5245fc6e..5667e1a4fc 100644 --- a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts +++ b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts @@ -1,28 +1,27 @@ import { Pipe, PipeTransform, Injectable, inject } from '@angular/core'; -import { TimezoneService } from '../services'; +import { LocalizationService, TimezoneService } from '../services'; @Injectable() @Pipe({ - name: 'utcToLocal', - standalone: false, + name: 'abpUtcToLocal', }) export class UtcToLocalPipe implements PipeTransform { protected readonly timezoneService = inject(TimezoneService); - private readonly timezone: string; - - constructor() { - this.timezone = this.timezoneService.getTimezone(); - } + protected readonly localizationService = inject(LocalizationService); transform( value: string | Date | null | undefined, - locale: string = navigator.language, options?: Intl.DateTimeFormatOptions, - ): string { + ): string | Date { if (!value) return ''; try { - const utcDate = new Date(value + 'Z'); // Ensure it's treated as UTC + const dateInput = new Date(value); + + if (isNaN(dateInput.getTime())) { + // Invalid date + return ''; + } const formatOptions: Intl.DateTimeFormatOptions = options || { year: 'numeric', @@ -32,14 +31,14 @@ export class UtcToLocalPipe implements PipeTransform { minute: '2-digit', }; - const formatter = new Intl.DateTimeFormat(locale, { + const formatter = new Intl.DateTimeFormat('en-US', { ...formatOptions, - timeZone: this.timezone, + timeZone: this.timezoneService.getTimezone(), }); - return formatter.format(utcDate); + return formatter.format(dateInput); } catch (err) { - return ''; + return value; } } } From 1b4f4fe0ea70fc5c16ee4e92129e82c31d99dca6 Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Wed, 9 Apr 2025 11:17:06 +0300 Subject: [PATCH 07/39] refactoring --- .../extensible-table/extensible-table.component.ts | 6 ++++++ .../packages/core/src/lib/pipes/utc-to-local.pipe.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts index 86de7f0ff2..94b73dba1d 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts @@ -31,6 +31,7 @@ import { LocalizationModule, PermissionDirective, PermissionService, + UtcToLocalPipe, } from '@abp/ng.core'; import { AbpVisibleDirective, @@ -64,6 +65,7 @@ const DEFAULT_ACTIONS_COLUMN_WIDTH = 150; NgxDatatableListDirective, PermissionDirective, LocalizationModule, + UtcToLocalPipe, AsyncPipe, NgTemplateOutlet, NgComponentOutlet, @@ -235,4 +237,8 @@ export class ExtensibleTableComponent implements OnChanges, AfterViewIn this.cdr.markForCheck(); }); } + + isDateType(prop: EntityProp) { + return prop.type === ePropType.Date || prop.type === ePropType.DateTime; + } } diff --git a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts index 5667e1a4fc..3c878cef22 100644 --- a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts +++ b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts @@ -11,8 +11,10 @@ export class UtcToLocalPipe implements PipeTransform { transform( value: string | Date | null | undefined, + apply: boolean, options?: Intl.DateTimeFormatOptions, ): string | Date { + if (!apply) return value; if (!value) return ''; try { @@ -30,7 +32,7 @@ export class UtcToLocalPipe implements PipeTransform { hour: '2-digit', minute: '2-digit', }; - + console.log(this.timezoneService.getTimezone()); const formatter = new Intl.DateTimeFormat('en-US', { ...formatOptions, timeZone: this.timezoneService.getTimezone(), From 8633edb6508c87cd6166e8a032e31ee8e98480c7 Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Wed, 9 Apr 2025 11:50:22 +0300 Subject: [PATCH 08/39] refactoring --- .../core/src/lib/interceptors/timezone.interceptor.ts | 3 +++ .../packages/core/src/lib/services/timezone.service.ts | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts b/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts index aa6320f206..10d32a3672 100644 --- a/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts +++ b/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts @@ -10,6 +10,9 @@ export class TimezoneInterceptor implements HttpInterceptor { protected readonly timezoneService = inject(TimezoneService); intercept(req: HttpRequest, next: HttpHandler): Observable> { + if (!this.timezoneService.isUtcClockEnabled) { + return next.handle(req); + } const timezone = this.timezoneService.getTimezone(); if (timezone) { req = req.clone({ diff --git a/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts b/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts index de112023d0..a7ae4121b2 100644 --- a/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts @@ -10,11 +10,15 @@ export class TimezoneService { protected readonly document = inject(DOCUMENT); private readonly cookieKey = '__timezone'; private timeZoneNameFromSettings: string | null | undefined; + public isUtcClockEnabled: boolean | undefined; constructor() { this.configState.getOne$('timing').subscribe(timezoneSettings => { this.timeZoneNameFromSettings = timezoneSettings?.timeZone?.iana?.timeZoneName; }); + this.configState.getOne$('clock').subscribe(clock => { + this.isUtcClockEnabled = clock?.kind === 'Utc'; + }); } getBrowserTimezone(): string { @@ -27,7 +31,9 @@ export class TimezoneService { } setTimezone(timezone: string): void { - this.document.cookie = `${this.cookieKey}=${timezone}; path=/`; + if (this.isUtcClockEnabled) { + this.document.cookie = `${this.cookieKey}=${timezone}; path=/`; + } } convertUtcToLocal(date: string | Date): Date { From e7b21110d080fbf6163793721d65a674fbef19dc Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Wed, 9 Apr 2025 12:16:57 +0300 Subject: [PATCH 09/39] refactoring --- .../core/src/lib/pipes/utc-to-local.pipe.ts | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts index 3c878cef22..aaa26eb873 100644 --- a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts +++ b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts @@ -1,5 +1,5 @@ import { Pipe, PipeTransform, Injectable, inject } from '@angular/core'; -import { LocalizationService, TimezoneService } from '../services'; +import { ConfigStateService, LocalizationService, TimezoneService } from '../services'; @Injectable() @Pipe({ @@ -7,13 +7,10 @@ import { LocalizationService, TimezoneService } from '../services'; }) export class UtcToLocalPipe implements PipeTransform { protected readonly timezoneService = inject(TimezoneService); + protected readonly configState = inject(ConfigStateService); protected readonly localizationService = inject(LocalizationService); - transform( - value: string | Date | null | undefined, - apply: boolean, - options?: Intl.DateTimeFormatOptions, - ): string | Date { + transform(value: string | Date | null | undefined, apply: boolean): string | Date { if (!apply) return value; if (!value) return ''; @@ -24,21 +21,10 @@ export class UtcToLocalPipe implements PipeTransform { // Invalid date return ''; } - - const formatOptions: Intl.DateTimeFormatOptions = options || { - year: 'numeric', - month: 'short', - day: 'numeric', - hour: '2-digit', - minute: '2-digit', - }; - console.log(this.timezoneService.getTimezone()); - const formatter = new Intl.DateTimeFormat('en-US', { - ...formatOptions, + const localization = this.configState.getOne('localization'); + return dateInput.toLocaleString(localization?.currentCulture?.cultureName ?? 'en-US', { timeZone: this.timezoneService.getTimezone(), }); - - return formatter.format(dateInput); } catch (err) { return value; } From 4d57345cabfeef58db5a293dcef3f50b85085f28 Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Wed, 9 Apr 2025 16:57:54 +0300 Subject: [PATCH 10/39] abp-extensible-table props validation according to timezone --- .../extensible-table.component.html | 27 ++++++++++++++----- .../extensible-table.component.ts | 4 --- .../packages/core/src/lib/core.module.ts | 12 ++++++++- .../lib/interceptors/timezone.interceptor.ts | 4 +-- .../core/src/lib/pipes/utc-to-local.pipe.ts | 14 ++++++---- .../core/src/lib/services/timezone.service.ts | 10 ++++--- 6 files changed, 48 insertions(+), 23 deletions(-) diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html index 471aad0f15..9104caf6ce 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html @@ -49,18 +49,33 @@ @if (!row['_' + prop.name].component) { -
+ } @else { +
+ [ngClass]="entityPropTypeClasses[prop.type]" + [class.pointer]="prop.action" + > + } } @else { @if (!row['_' + prop.name].component) { - @if (prop.type === 'datetime') { + @if (prop.type === 'datetime' || prop.type === 'date' || prop.type === 'time') {
' @@ -158,12 +153,6 @@ export class ExtensibleTableComponent implements OnChanges, AfterViewIn switch (prop.type) { case ePropType.Boolean: return this.getIcon(value); - case ePropType.Date: - return this.getDate(value, getShortDateFormat(this.config)); - case ePropType.Time: - return this.getDate(value, getShortTimeFormat(this.config)); - case ePropType.DateTime: - return this.getDate(value, getShortDateShortTimeFormat(this.config)); case ePropType.Enum: return this.getEnum(value, prop.enumList || []); default: diff --git a/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts b/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts index 1789eff2fb..6d5855433e 100644 --- a/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts +++ b/npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts @@ -10,8 +10,7 @@ export class TimezoneInterceptor implements HttpInterceptor { protected readonly timezoneService = inject(TimezoneService); intercept(req: HttpRequest, next: HttpHandler): Observable> { - const timezone = this.timezoneService.getTimezone(); - console.log(timezone); + const timezone = this.timezoneService.timezone; if (timezone) { req = req.clone({ setHeaders: { diff --git a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts index d0e1452fc5..2d0687a24d 100644 --- a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts +++ b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts @@ -1,5 +1,7 @@ -import { Pipe, PipeTransform, Injectable, inject } from '@angular/core'; +import { Pipe, PipeTransform, Injectable, inject, LOCALE_ID } from '@angular/core'; import { ConfigStateService, LocalizationService, TimezoneService } from '../services'; +import { getShortDateFormat, getShortDateShortTimeFormat, getShortTimeFormat } from '../utils'; +import { formatDate } from '@angular/common'; @Injectable() @Pipe({ @@ -9,23 +11,51 @@ export class UtcToLocalPipe implements PipeTransform { protected readonly timezoneService = inject(TimezoneService); protected readonly configState = inject(ConfigStateService); protected readonly localizationService = inject(LocalizationService); + protected readonly locale = inject(LOCALE_ID); - transform(value: string | Date | null | undefined): string | Date { + transform( + value: string | Date | null | undefined, + propType: 'date' | 'datetime' | 'time', + ): string | Date { if (!value) return ''; try { - const dateInput = new Date(value); - - if (isNaN(dateInput.getTime())) { - return ''; + let format: string; + switch (propType) { + case 'date': + format = getShortDateFormat(this.configState); + break; + case 'datetime': + format = getShortDateShortTimeFormat(this.configState); + break; + case 'time': + format = getShortTimeFormat(this.configState); + break; + default: + format = getShortDateShortTimeFormat(this.configState); } - const localization = this.configState.getOne('localization'); - const locale = localization?.currentCulture?.cultureName ?? 'en-US'; - const options: Intl.DateTimeFormatOptions = this.timezoneService.isUtcClockEnabled - ? { timeZone: this.timezoneService.getTimezone() } - : undefined; - return dateInput.toLocaleString(locale, options); + if (this.timezoneService.isUtcClockEnabled) { + const timeZone = this.timezoneService.timezone; + const options: Intl.DateTimeFormatOptions = { timeZone }; + let localeStr: string; + switch (propType) { + case 'date': + localeStr = new Date(value).toLocaleDateString(this.locale, options); + break; + case 'datetime': + localeStr = new Date(value).toLocaleString(this.locale, options); + break; + case 'time': + localeStr = new Date(value).toLocaleTimeString(this.locale, options); + break; + default: + localeStr = new Date(value).toLocaleString(this.locale, options); + } + return formatDate(localeStr, format, this.locale); + } else { + return formatDate(value, format, this.locale, format); + } } catch (err) { return value; } diff --git a/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts b/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts index ee3587cfdf..b3b5fe9cff 100644 --- a/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/timezone.service.ts @@ -25,7 +25,7 @@ export class TimezoneService { return Intl.DateTimeFormat().resolvedOptions().timeZone; } - getTimezone(): string { + get timezone(): string { if (!this.isUtcClockEnabled) { return this.getBrowserTimezone(); } From eda18d65b3653099e065539ee85edcc6b422ef48 Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Fri, 11 Apr 2025 11:12:05 +0300 Subject: [PATCH 13/39] refactoring --- .../extensible-table.component.html | 4 +- .../core/src/lib/pipes/utc-to-local.pipe.ts | 65 ++++++++++--------- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html index ad3fbd690a..bcba0967cd 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html @@ -53,8 +53,8 @@
Date: Tue, 22 Apr 2025 14:06:08 +0300 Subject: [PATCH 16/39] timezone http interceptor added to provideAbpCore --- .../core/src/lib/providers/core-module-config.provider.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/npm/ng-packs/packages/core/src/lib/providers/core-module-config.provider.ts b/npm/ng-packs/packages/core/src/lib/providers/core-module-config.provider.ts index 2b44117acb..4e816b6228 100644 --- a/npm/ng-packs/packages/core/src/lib/providers/core-module-config.provider.ts +++ b/npm/ng-packs/packages/core/src/lib/providers/core-module-config.provider.ts @@ -24,6 +24,7 @@ import { DEFAULT_DYNAMIC_LAYOUTS } from '../constants'; import { LocalizationService, LocalStorageListenerService, AbpTitleStrategy } from '../services'; import { DefaultQueueManager, getInitialData, localeInitializer } from '../utils'; import { CookieLanguageProvider, IncludeLocalizationResourcesProvider, LocaleProvider } from './'; +import { TimezoneInterceptor } from '../interceptors'; export enum CoreFeatureKind { Options, @@ -128,6 +129,11 @@ export function provideAbpCore(...features: CoreFeature[]) { provide: TitleStrategy, useExisting: AbpTitleStrategy, }, + { + provide: 'HTTP_INTERCEPTORS', + useClass: TimezoneInterceptor, + multi: true, + }, ]; for (const feature of features) { From ccae5fcbb0056908b4c4cbf8984e7e0717943abc Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Tue, 22 Apr 2025 14:40:03 +0300 Subject: [PATCH 17/39] timezone http interceptor added to provideAbpCore --- .../core/src/lib/providers/core-module-config.provider.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/providers/core-module-config.provider.ts b/npm/ng-packs/packages/core/src/lib/providers/core-module-config.provider.ts index 4e816b6228..fafb51ff6d 100644 --- a/npm/ng-packs/packages/core/src/lib/providers/core-module-config.provider.ts +++ b/npm/ng-packs/packages/core/src/lib/providers/core-module-config.provider.ts @@ -1,6 +1,7 @@ import { makeEnvironmentProviders, Provider, inject, provideAppInitializer } from '@angular/core'; import { TitleStrategy } from '@angular/router'; import { + HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi, withXsrfConfiguration, @@ -130,7 +131,7 @@ export function provideAbpCore(...features: CoreFeature[]) { useExisting: AbpTitleStrategy, }, { - provide: 'HTTP_INTERCEPTORS', + provide: HTTP_INTERCEPTORS, useClass: TimezoneInterceptor, multi: true, }, From 5ab765b0ed5bb3ac727c3284a825c4dade67fe0a Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Thu, 24 Apr 2025 15:23:46 +0300 Subject: [PATCH 18/39] luxon peer dependency added to core module --- npm/ng-packs/package.json | 1 - npm/ng-packs/packages/core/package.json | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index 4583169b7b..e17d6c6f18 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -111,7 +111,6 @@ "just-compare": "^2.0.0", "lerna": "^4.0.0", "lint-staged": "^13.0.0", - "luxon": "^3.6.1", "ng-packagr": "~19.1.0", "ng-zorro-antd": "~19.0.0", "nx": "~20.3.0", diff --git a/npm/ng-packs/packages/core/package.json b/npm/ng-packs/packages/core/package.json index b5efd135b9..845925af1a 100644 --- a/npm/ng-packs/packages/core/package.json +++ b/npm/ng-packs/packages/core/package.json @@ -13,6 +13,9 @@ "ts-toolbelt": "^9.0.0", "tslib": "^2.0.0" }, + "peerDependencies": { + "luxon": "^3.5.0" + }, "publishConfig": { "access": "public" }, From 923655aaa75cdcdeb28b6706f9366d517f7deeae Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Thu, 24 Apr 2025 16:52:20 +0300 Subject: [PATCH 19/39] luxon dependency added to core module --- npm/ng-packs/packages/core/ng-package.json | 3 ++- npm/ng-packs/packages/core/package.json | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/core/ng-package.json b/npm/ng-packs/packages/core/ng-package.json index b73dba2fb7..9f9100d2fa 100644 --- a/npm/ng-packs/packages/core/ng-package.json +++ b/npm/ng-packs/packages/core/ng-package.json @@ -9,6 +9,7 @@ "angular-oauth2-oidc", "just-compare", "just-clone", - "ts-toolbelt" + "ts-toolbelt", + "luxon" ] } diff --git a/npm/ng-packs/packages/core/package.json b/npm/ng-packs/packages/core/package.json index 845925af1a..91ed63778d 100644 --- a/npm/ng-packs/packages/core/package.json +++ b/npm/ng-packs/packages/core/package.json @@ -11,10 +11,8 @@ "just-clone": "^6.0.0", "just-compare": "^2.0.0", "ts-toolbelt": "^9.0.0", - "tslib": "^2.0.0" - }, - "peerDependencies": { - "luxon": "^3.5.0" + "tslib": "^2.0.0", + "luxon": "^3.6.1" }, "publishConfig": { "access": "public" From deb7b61fdaf3ca59ebdd81de3c9717f5aab6235d Mon Sep 17 00:00:00 2001 From: Masum ULU <49063256+masum-ulu@users.noreply.github.com> Date: Tue, 29 Apr 2025 09:27:54 +0300 Subject: [PATCH 20/39] Update package.json --- npm/ng-packs/packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/package.json b/npm/ng-packs/packages/core/package.json index 91ed63778d..7a10820ead 100644 --- a/npm/ng-packs/packages/core/package.json +++ b/npm/ng-packs/packages/core/package.json @@ -12,7 +12,7 @@ "just-compare": "^2.0.0", "ts-toolbelt": "^9.0.0", "tslib": "^2.0.0", - "luxon": "^3.6.1" + "luxon": "^3.0.0" }, "publishConfig": { "access": "public" From b4656e6b69d9939cab21704428890d80129f8406 Mon Sep 17 00:00:00 2001 From: Masum ULU <49063256+masum-ulu@users.noreply.github.com> Date: Tue, 29 Apr 2025 09:38:50 +0300 Subject: [PATCH 21/39] Update core.module.ts --- npm/ng-packs/packages/core/src/lib/core.module.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/core.module.ts b/npm/ng-packs/packages/core/src/lib/core.module.ts index 33d7f0ad94..8fc0b90bbc 100644 --- a/npm/ng-packs/packages/core/src/lib/core.module.ts +++ b/npm/ng-packs/packages/core/src/lib/core.module.ts @@ -90,15 +90,7 @@ const standaloneDirectives = [ ShortTimePipe, ShortDatePipe, ], - providers: [ - LocalizationPipe, - provideHttpClient(withInterceptorsFromDi()), - { - provide: HTTP_INTERCEPTORS, - useClass: TimezoneInterceptor, - multi: true, - }, - ], + providers: [LocalizationPipe, provideHttpClient(withInterceptorsFromDi())], }) export class BaseCoreModule {} From 7f26390ce5dfb7a7bba0b84fceab1377d71d945f Mon Sep 17 00:00:00 2001 From: Masum ULU <49063256+masum-ulu@users.noreply.github.com> Date: Tue, 29 Apr 2025 09:47:23 +0300 Subject: [PATCH 22/39] Update core.module.ts --- npm/ng-packs/packages/core/src/lib/core.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/core.module.ts b/npm/ng-packs/packages/core/src/lib/core.module.ts index 8fc0b90bbc..4505253aba 100644 --- a/npm/ng-packs/packages/core/src/lib/core.module.ts +++ b/npm/ng-packs/packages/core/src/lib/core.module.ts @@ -32,7 +32,6 @@ import { ShortDatePipe } from './pipes/short-date.pipe'; import { SafeHtmlPipe } from './pipes/safe-html.pipe'; import { provideAbpCoreChild, provideAbpCore, withOptions } from './providers'; import { UtcToLocalPipe } from './pipes'; -import { TimezoneInterceptor } from './interceptors'; const standaloneDirectives = [ AutofocusDirective, From f0380b9b01facd0272c71bacc229c2951b2e5dd1 Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 30 Apr 2025 18:15:07 +0800 Subject: [PATCH 23/39] Downgrade Microsoft.Extensions.Caching.Hybrid version. --- Directory.Packages.props | 2 +- .../src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9916d0b2bd..05ca968762 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -88,7 +88,7 @@ - + diff --git a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs index de5f60ee4e..da900447df 100644 --- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs +++ b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs @@ -28,7 +28,9 @@ public class AbpCachingModule : AbpModule context.Services.AddSingleton(typeof(IDistributedCache<>), typeof(DistributedCache<>)); context.Services.AddSingleton(typeof(IDistributedCache<,>), typeof(DistributedCache<,>)); +#pragma warning disable EXTEXP0018 context.Services.AddHybridCache().AddSerializerFactory(); +#pragma warning restore EXTEXP0018 context.Services.AddSingleton(typeof(IHybridCache<>), typeof(AbpHybridCache<>)); context.Services.AddSingleton(typeof(IHybridCache<,>), typeof(AbpHybridCache<,>)); From 9f89f16048529f3c8a821d9540c92db338184335 Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 30 Apr 2025 18:21:46 +0800 Subject: [PATCH 24/39] Downgrade MongoSandbox package versions to 1.0.1 --- Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 05ca968762..50a05dbba1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,10 +38,10 @@ - - + + - + From 6b0097a379dd0ba57a236b400eb249ee313ef890 Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 30 Apr 2025 18:44:28 +0800 Subject: [PATCH 25/39] Compatible with the new version of `HybridCache`. --- Directory.Packages.props | 2 +- .../Volo/Abp/Caching/AbpCachingModule.cs | 4 ---- .../Volo/Abp/Caching/Hybrid/AbpHybridCache.cs | 15 ++++++++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 50a05dbba1..07eaa65740 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -88,7 +88,7 @@ - + diff --git a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs index da900447df..632bfa416e 100644 --- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs +++ b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs @@ -1,7 +1,5 @@ using Microsoft.Extensions.DependencyInjection; using System; -using Microsoft.Extensions.Caching.Hybrid; -using Microsoft.Extensions.DependencyInjection.Extensions; using Volo.Abp.Caching.Hybrid; using Volo.Abp.Json; using Volo.Abp.Modularity; @@ -28,9 +26,7 @@ public class AbpCachingModule : AbpModule context.Services.AddSingleton(typeof(IDistributedCache<>), typeof(DistributedCache<>)); context.Services.AddSingleton(typeof(IDistributedCache<,>), typeof(DistributedCache<,>)); -#pragma warning disable EXTEXP0018 context.Services.AddHybridCache().AddSerializerFactory(); -#pragma warning restore EXTEXP0018 context.Services.AddSingleton(typeof(IHybridCache<>), typeof(AbpHybridCache<>)); context.Services.AddSingleton(typeof(IHybridCache<,>), typeof(AbpHybridCache<,>)); diff --git a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/Hybrid/AbpHybridCache.cs b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/Hybrid/AbpHybridCache.cs index 2894af9f3d..66506a0b56 100644 --- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/Hybrid/AbpHybridCache.cs +++ b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/Hybrid/AbpHybridCache.cs @@ -75,7 +75,7 @@ public class AbpHybridCache : IHybridCache : IHybridCache>.Instance; KeyNormalizer = keyNormalizer; @@ -215,10 +215,15 @@ public class AbpHybridCache : IHybridCache(bytes, 0, bytes.Length));; + // Because HybridCache wraps the cache in L2(distributed cache), we can’t unwrap it directly and can only retrieve the value through its API + return await HybridCache.GetOrCreateAsync( + key: NormalizeKey(key), + factory: async cancel => await factory(), + options: optionsFactory?.Invoke(), + tags: null, + cancellationToken: token); } value = await factory(); From 0f1c32644f5ae36480c503e5c1e1d6f50a9dec78 Mon Sep 17 00:00:00 2001 From: sumeyye Date: Wed, 30 Apr 2025 15:45:56 +0300 Subject: [PATCH 26/39] update: use `abpLazyLocalization` instead for theme basic route name localization --- .../src/lib/components/routes/routes.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.html index 77e190957f..9f4fdd900d 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.html @@ -12,7 +12,7 @@ @if (route.iconClass) { } - {{ route.name | abpLazyTranslate | async }} + {{ route.name | abpLazyLocalization | async }} @@ -39,7 +39,7 @@ @if (route.iconClass) { } - {{ route.name | abpLazyTranslate | async }} + {{ route.name | abpLazyLocalization | async }}
Date: Wed, 30 Apr 2025 16:14:11 +0300 Subject: [PATCH 27/39] update: transfer lazy localization from theme basic to core package --- .../core/src/lib/localization.module.ts | 4 +- .../packages/core/src/lib/pipes/index.ts | 1 + .../src/lib/pipes/lazy-localization.pipe.ts | 41 +++++++++++++++++++ .../theme-basic/src/lib/pipes/index.ts | 1 - .../src/lib/pipes/lazy-translate.pipe.ts | 20 --------- .../theme-basic/src/lib/theme-basic.module.ts | 2 - .../packages/theme-basic/src/public-api.ts | 1 - 7 files changed, 45 insertions(+), 25 deletions(-) create mode 100644 npm/ng-packs/packages/core/src/lib/pipes/lazy-localization.pipe.ts delete mode 100644 npm/ng-packs/packages/theme-basic/src/lib/pipes/index.ts delete mode 100644 npm/ng-packs/packages/theme-basic/src/lib/pipes/lazy-translate.pipe.ts diff --git a/npm/ng-packs/packages/core/src/lib/localization.module.ts b/npm/ng-packs/packages/core/src/lib/localization.module.ts index 315f27b1ff..9335e944fa 100644 --- a/npm/ng-packs/packages/core/src/lib/localization.module.ts +++ b/npm/ng-packs/packages/core/src/lib/localization.module.ts @@ -1,8 +1,10 @@ import { NgModule } from '@angular/core'; import { LocalizationPipe } from './pipes/localization.pipe'; +import { LazyLocalizationPipe } from './pipes'; @NgModule({ - exports: [LocalizationPipe], + imports: [LazyLocalizationPipe], + exports: [LocalizationPipe, LazyLocalizationPipe], declarations: [LocalizationPipe], }) export class LocalizationModule {} diff --git a/npm/ng-packs/packages/core/src/lib/pipes/index.ts b/npm/ng-packs/packages/core/src/lib/pipes/index.ts index 1a981ca041..f2d810dda5 100644 --- a/npm/ng-packs/packages/core/src/lib/pipes/index.ts +++ b/npm/ng-packs/packages/core/src/lib/pipes/index.ts @@ -5,3 +5,4 @@ export * from './to-injector.pipe'; export * from './short-date.pipe'; export * from './short-time.pipe'; export * from './short-date-time.pipe'; +export * from './lazy-localization.pipe'; diff --git a/npm/ng-packs/packages/core/src/lib/pipes/lazy-localization.pipe.ts b/npm/ng-packs/packages/core/src/lib/pipes/lazy-localization.pipe.ts new file mode 100644 index 0000000000..b715b25ad8 --- /dev/null +++ b/npm/ng-packs/packages/core/src/lib/pipes/lazy-localization.pipe.ts @@ -0,0 +1,41 @@ +import { inject, Injectable, Pipe, PipeTransform } from '@angular/core'; +import { + Observable, + of, + filter, + take, + switchMap, + map, + startWith, + distinctUntilChanged, +} from 'rxjs'; +import { ConfigStateService, LocalizationService } from '../services'; + +@Injectable() +@Pipe({ + name: 'abpLazyLocalization', +}) +export class LazyLocalizationPipe implements PipeTransform { + private localizationService = inject(LocalizationService); + private configStateService = inject(ConfigStateService); + + transform(key: string, ...params: (string | string[])[]): Observable { + if (!key) { + return of(''); + } + + const flatParams = params.reduce( + (acc, val) => (Array.isArray(val) ? acc.concat(val) : [...acc, val]), + [], + ); + + return this.configStateService.getAll$().pipe( + filter(config => !!config.localization), + take(1), + switchMap(() => this.localizationService.get(key, ...flatParams)), + map(translation => (translation && translation !== key ? translation : '')), + startWith(''), + distinctUntilChanged(), + ); + } +} diff --git a/npm/ng-packs/packages/theme-basic/src/lib/pipes/index.ts b/npm/ng-packs/packages/theme-basic/src/lib/pipes/index.ts deleted file mode 100644 index 0bde64d742..0000000000 --- a/npm/ng-packs/packages/theme-basic/src/lib/pipes/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './lazy-translate.pipe'; diff --git a/npm/ng-packs/packages/theme-basic/src/lib/pipes/lazy-translate.pipe.ts b/npm/ng-packs/packages/theme-basic/src/lib/pipes/lazy-translate.pipe.ts deleted file mode 100644 index d7b36a0c32..0000000000 --- a/npm/ng-packs/packages/theme-basic/src/lib/pipes/lazy-translate.pipe.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { LocalizationService, ConfigStateService } from '@abp/ng.core'; -import { inject, Pipe, PipeTransform } from '@angular/core'; -import { Observable, filter, take, switchMap, shareReplay } from 'rxjs'; - -@Pipe({ - name: 'abpLazyTranslate', -}) -export class LazyTranslatePipe implements PipeTransform { - private localizationService = inject(LocalizationService); - private configStateService = inject(ConfigStateService); - - transform(key: string): Observable { - return this.configStateService.getAll$().pipe( - filter(config => !!config.localization), - take(1), - switchMap(() => this.localizationService.get(key)), - shareReplay({ bufferSize: 1, refCount: true }), - ); - } -} diff --git a/npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts b/npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts index d68d112ac5..d959509dfd 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts @@ -16,7 +16,6 @@ import { PageAlertContainerComponent } from './components/page-alert-container/p import { RoutesComponent } from './components/routes/routes.component'; import { ValidationErrorComponent } from './components/validation-error/validation-error.component'; import { provideThemeBasicConfig } from './providers'; -import { LazyTranslatePipe } from './pipes'; export const LAYOUTS = [ApplicationLayoutComponent, AccountLayoutComponent, EmptyLayoutComponent]; @@ -49,7 +48,6 @@ export const LAYOUTS = [ApplicationLayoutComponent, AccountLayoutComponent, Empt NgbCollapseModule, NgbDropdownModule, NgxValidateCoreModule, - LazyTranslatePipe, ], }) export class BaseThemeBasicModule {} diff --git a/npm/ng-packs/packages/theme-basic/src/public-api.ts b/npm/ng-packs/packages/theme-basic/src/public-api.ts index ec57cc892e..5c607ca06d 100644 --- a/npm/ng-packs/packages/theme-basic/src/public-api.ts +++ b/npm/ng-packs/packages/theme-basic/src/public-api.ts @@ -6,7 +6,6 @@ export * from './lib/components'; export * from './lib/enums'; export * from './lib/handlers'; export * from './lib/models'; -export * from './lib/pipes'; export * from './lib/providers'; export * from './lib/theme-basic.module'; export * from './lib/tokens'; From 3124a0cc0f51cacad9cb2f59049ca6b11380a1a2 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 1 May 2025 11:19:16 +0800 Subject: [PATCH 28/39] Update MongoSandbox pcakages. --- Directory.Packages.props | 12 ++++-------- .../Volo.Abp.MongoDB.Tests.csproj | 6 +++--- .../Volo.Abp.AuditLogging.MongoDB.Tests.csproj | 6 +++--- .../Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj | 6 +++--- ...olo.Abp.BlobStoring.Database.MongoDB.Tests.csproj | 6 +++--- .../Volo.Blogging.MongoDB.Tests.csproj | 6 +++--- .../Volo.CmsKit.MongoDB.Tests.csproj | 6 +++--- .../Volo.Docs.MongoDB.Tests.csproj | 6 +++--- .../Volo.Abp.FeatureManagement.MongoDB.Tests.csproj | 6 +++--- .../Volo.Abp.Identity.MongoDB.Tests.csproj | 6 +++--- .../Volo.Abp.IdentityServer.MongoDB.Tests.csproj | 6 +++--- .../Volo.Abp.OpenIddict.MongoDB.Tests.csproj | 6 +++--- ...olo.Abp.PermissionManagement.MongoDB.Tests.csproj | 6 +++--- .../Volo.Abp.SettingManagement.MongoDB.Tests.csproj | 6 +++--- .../Volo.Abp.TenantManagement.MongoDB.Tests.csproj | 6 +++--- .../MyCompanyName.MyProjectName.MongoDB.Tests.csproj | 6 +++--- .../MyCompanyName.MyProjectName.MongoDB.Tests.csproj | 6 +++--- 17 files changed, 52 insertions(+), 56 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 07eaa65740..72405c55cf 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -34,14 +34,10 @@ - - - - - - - - + + + + diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj b/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj index e2328fdca3..524533f890 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj @@ -16,9 +16,9 @@ - - - + + + diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj index a33c1c74f8..1b9925261b 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj index a3f84bb18a..a1a1a47d2c 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj index 61c0d81d02..f5c1f561af 100644 --- a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj +++ b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj index 7dcac50e69..c71d73c65d 100644 --- a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj +++ b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/Volo.CmsKit.MongoDB.Tests.csproj b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/Volo.CmsKit.MongoDB.Tests.csproj index 9c8dc44660..a537cf8943 100644 --- a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/Volo.CmsKit.MongoDB.Tests.csproj +++ b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/Volo.CmsKit.MongoDB.Tests.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj index 90df72d01d..2087f2118c 100644 --- a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj +++ b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj index 2f7f5ee7d0..d11f989f7d 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj index 311ee9fa69..f764dc3b93 100644 --- a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj +++ b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj index 07377805af..289276595e 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/modules/openiddict/test/Volo.Abp.OpenIddict.MongoDB.Tests/Volo.Abp.OpenIddict.MongoDB.Tests.csproj b/modules/openiddict/test/Volo.Abp.OpenIddict.MongoDB.Tests/Volo.Abp.OpenIddict.MongoDB.Tests.csproj index d5f8903293..60a422fd38 100644 --- a/modules/openiddict/test/Volo.Abp.OpenIddict.MongoDB.Tests/Volo.Abp.OpenIddict.MongoDB.Tests.csproj +++ b/modules/openiddict/test/Volo.Abp.OpenIddict.MongoDB.Tests/Volo.Abp.OpenIddict.MongoDB.Tests.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj index 0f9e0169e8..f42d7c0385 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj @@ -20,9 +20,9 @@ - - - + + + diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj index 9c2c2f36a9..9bbb27387d 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj @@ -19,9 +19,9 @@ - - - + + + diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj index 2913a0ed53..4ad25e0218 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj @@ -19,9 +19,9 @@ - - - + + + diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj index bff0099e07..68848d75c2 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj @@ -16,9 +16,9 @@ - - - + + + diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj index 60bd4f1fe8..f29fb32a5a 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj @@ -11,9 +11,9 @@ - - - + + + From fed0e973415eb3fbf93673ad6424357bb1df5e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 1 May 2025 18:02:35 +0300 Subject: [PATCH 29/39] Add ServiceConfigurationContext.Configuration property --- .../Volo/Abp/Modularity/ServiceConfigurationContext.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ServiceConfigurationContext.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ServiceConfigurationContext.cs index 6141777cec..f1e55b85d8 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ServiceConfigurationContext.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ServiceConfigurationContext.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using JetBrains.Annotations; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace Volo.Abp.Modularity; @@ -8,6 +9,13 @@ public class ServiceConfigurationContext { public IServiceCollection Services { get; } + public IConfiguration Configuration { + get { + return _configuration ??= Services.GetConfiguration(); + } + } + private IConfiguration? _configuration; + public IDictionary Items { get; } /// @@ -29,4 +37,4 @@ public class ServiceConfigurationContext Services = Check.NotNull(services, nameof(services)); Items = new Dictionary(); } -} +} \ No newline at end of file From 0f03b04992014eda30fcec9c2c645660b3c7503f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 1 May 2025 18:16:30 +0300 Subject: [PATCH 30/39] Enhance the configuration document --- .../architecture/modularity/basics.md | 2 - .../framework/fundamentals/configuration.md | 51 ++++++++++++++++++- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/docs/en/framework/architecture/modularity/basics.md b/docs/en/framework/architecture/modularity/basics.md index f92e6edc3b..2b3aaad214 100644 --- a/docs/en/framework/architecture/modularity/basics.md +++ b/docs/en/framework/architecture/modularity/basics.md @@ -1,7 +1,5 @@ # Modularity -## Introduction - ABP was designed to support to build fully modular applications and systems where every module may have entities, services, database integration, APIs, UI components and so on; * This document introduces the basics of the module system. diff --git a/docs/en/framework/fundamentals/configuration.md b/docs/en/framework/fundamentals/configuration.md index 7611017b7e..94476f25ab 100644 --- a/docs/en/framework/fundamentals/configuration.md +++ b/docs/en/framework/fundamentals/configuration.md @@ -1,3 +1,52 @@ # Configuration -ASP.NET Core has an flexible and extensible key-value based configuration system. In fact, the configuration system is a part of Microsoft.Extensions libraries and it is independent from ASP.NET Core. That means it can be used in any type of application. See [Microsoft's documentation](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/) to learn the configuration infrastructure. ABP is 100% compatible with the configuration system. \ No newline at end of file +ASP.NET Core has an flexible and extensible key-value based configuration system. The configuration system is a part of Microsoft.Extensions libraries and it is independent from ASP.NET Core. That means it can be used in any type of application. + +See [Microsoft's documentation](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/) to learn the configuration infrastructure. ABP is 100% compatible with the configuration system. + +## Getting the Configuration + +You may need to get the `IConfiguration` service in various places in your codebase. The following section shows two common ways. + +### In Module Classes + +You typically need to get configuration while initializing your application. You can get the `IConfiguration` service using the `ServiceConfigurationContext.Configuration` property inside your [module class](../architecture/modularity/basics.md) as the following example: + +````csharp +public class MyAppModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var connectionString = context.Configuration["ConnectionStrings:Default"]; + } +} +```` + +`context.Configuration` is a shortcut property for the `context.Services.GetConfiguration()` method. You can use any of them (`IServiceCollection.GetConfiguration` is an extension method that can be used whenever you have an `IServiceCollection` object). + +### In Your Services + +You can directly [inject](dependency-injection.md) the `IConfiguration` service into your services: + +````csharp +public class MyService : ITransientDependency +{ + private readonly IConfiguration _configuration; + + public MyService(IConfiguration configuration) + { + _configuration = configuration; + } + + public string? GetConnectionString() + { + return _configuration["ConnectionStrings:Default"]; + } +} +```` + +## See Also + +* [Microsoft's Configuration Documentation](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/) +* [The Options Pattern](options.md) + From 085688ad37f0debb8e8c8ebd4fb839914ffb7526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 1 May 2025 18:19:28 +0300 Subject: [PATCH 31/39] Update docs/en/framework/fundamentals/configuration.md Good suggestion from AI :) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/en/framework/fundamentals/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/framework/fundamentals/configuration.md b/docs/en/framework/fundamentals/configuration.md index 94476f25ab..997d347d2a 100644 --- a/docs/en/framework/fundamentals/configuration.md +++ b/docs/en/framework/fundamentals/configuration.md @@ -22,7 +22,7 @@ public class MyAppModule : AbpModule } ```` -`context.Configuration` is a shortcut property for the `context.Services.GetConfiguration()` method. You can use any of them (`IServiceCollection.GetConfiguration` is an extension method that can be used whenever you have an `IServiceCollection` object). +`context.Configuration` is a shortcut property for the `context.Services.GetConfiguration()` method. In general, prefer using `context.Configuration` for simplicity and readability when working within module classes. Use `context.Services.GetConfiguration()` in other contexts where you have an `IServiceCollection` object but do not have access to the `context.Configuration` property. (`IServiceCollection.GetConfiguration` is an extension method that can be used whenever you have an `IServiceCollection` object). ### In Your Services From f485c815e95b1ca1e6a7ac056a57cb22037e5f65 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 2 May 2025 10:34:56 +0800 Subject: [PATCH 32/39] Update timezone help text. --- .../VirtualFileLocalizationResourceContributorBase.cs | 11 +++++++++-- .../Resources/AbpSettingManagement/ar.json | 2 +- .../Resources/AbpSettingManagement/cs.json | 2 +- .../Resources/AbpSettingManagement/de.json | 2 +- .../Resources/AbpSettingManagement/en.json | 2 +- .../Resources/AbpSettingManagement/es.json | 2 +- .../Resources/AbpSettingManagement/fi.json | 2 +- .../Resources/AbpSettingManagement/fr.json | 2 +- .../Resources/AbpSettingManagement/hi.json | 2 +- .../Resources/AbpSettingManagement/hr.json | 2 +- .../Resources/AbpSettingManagement/hu.json | 2 +- .../Resources/AbpSettingManagement/is.json | 2 +- .../Resources/AbpSettingManagement/it.json | 2 +- .../Resources/AbpSettingManagement/nl.json | 2 +- .../Resources/AbpSettingManagement/pl-PL.json | 2 +- .../Resources/AbpSettingManagement/pt-BR.json | 2 +- .../Resources/AbpSettingManagement/ro-RO.json | 2 +- .../Resources/AbpSettingManagement/ru.json | 2 +- .../Resources/AbpSettingManagement/sk.json | 2 +- .../Resources/AbpSettingManagement/sl.json | 2 +- .../Resources/AbpSettingManagement/tr.json | 2 +- .../Resources/AbpSettingManagement/vi.json | 2 +- .../Resources/AbpSettingManagement/zh-Hans.json | 2 +- .../Resources/AbpSettingManagement/zh-Hant.json | 2 +- 24 files changed, 32 insertions(+), 25 deletions(-) diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/VirtualFiles/VirtualFileLocalizationResourceContributorBase.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/VirtualFiles/VirtualFileLocalizationResourceContributorBase.cs index b25bd9ec6e..d151dc78df 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/VirtualFiles/VirtualFileLocalizationResourceContributorBase.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/VirtualFiles/VirtualFileLocalizationResourceContributorBase.cs @@ -103,7 +103,7 @@ public abstract class VirtualFileLocalizationResourceContributorBase : ILocaliza { continue; } - + if (dictionaries.ContainsKey(dictionary.CultureName)) { throw new AbpException($"{file.GetVirtualOrPhysicalPathOrNull()} dictionary has a culture name '{dictionary.CultureName}' which is already defined! Localization resource: {_resource.ResourceName}"); @@ -121,7 +121,14 @@ public abstract class VirtualFileLocalizationResourceContributorBase : ILocaliza { using (var stream = file.CreateReadStream()) { - return CreateDictionaryFromFileContent(Utf8Helper.ReadStringFromStream(stream)); + try + { + return CreateDictionaryFromFileContent(Utf8Helper.ReadStringFromStream(stream)); + } + catch (Exception e) + { + throw new AbpException("Invalid localization file format: " + (file.GetVirtualOrPhysicalPathOrNull() ?? file.Name), e); + } } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ar.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ar.json index b5ef3930fb..ec35f5286f 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ar.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ar.json @@ -20,7 +20,7 @@ "Menu:Emailing": "إرسال بالبريد الإلكتروني", "Menu:TimeZone": "وحدة زمنية", "DisplayName:Timezone": "وحدة زمنية", - "TimezoneHelpText": "يُستخدم هذا الإعداد على مستوى التطبيق أو على أساس المستأجر. ستحاول الوحدة الزمنية الافتراضية استخدام وحدة زمنية المتصفح أو وحدة زمنية الخادم.", + "TimezoneHelpText": "تتيح لك هذه الميزة تعيين منطقة زمنية افتراضية لخادمك، بينما يمكن للمستخدمين اختيار منطقتهم الزمنية الخاصة. إذا اختلفت المنطقة الزمنية للمستخدم عن المنطقة الزمنية للخادم، فسيتم تعديل جميع الأوقات وفقًا لذلك. على سبيل المثال، مع تعيين الخادم على أوروبا/لندن(00:00) ومستخدم في أوروبا/باريس(+01:00)، سيتم تعديل الأوقات بساعة واحدة لذلك المستخدم. سيؤدي اختيار 'المنطقة الزمنية الافتراضية' إلى استخدام المنطقة الزمنية للخادم أو المتصفح تلقائيًا.", "DefaultTimeZone": "الوحدة الزمنية الافتراضية", "SmtpHost": "مضيف", "SmtpPort": "ميناء", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/cs.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/cs.json index 0ad113214a..cd9d4d78d1 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/cs.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/cs.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Zasílání e-mailem", "Menu:TimeZone": "Časové Pásmo", "DisplayName:Timezone": "Časové pásmo", - "TimezoneHelpText": "Toto nastavení se používá pro celou aplikaci nebo pro klienty. Výchozí časové pásmo se pokusí použít časové pásmo prohlížeče nebo serveru.", + "TimezoneHelpText": "Tato funkce vám umožňuje nastavit výchozí časové pásmo pro váš server, zatímco uživatelé si mohou vybrat své vlastní. Pokud se časové pásmo uživatele liší od časového pásma serveru, všechny časy budou odpovídajícím způsobem upraveny. Například, když je server nastaven na Evropa/Londýn(00:00) a uživatel je v Evropa/Paříž(+01:00), časy budou pro tohoto uživatele upraveny o 1 hodinu. Výběrem 'Výchozí časové pásmo' se automaticky použije časové pásmo serveru nebo prohlížeče.", "DefaultTimeZone": "Výchozí časové pásmo", "SmtpHost": "Hostitel", "SmtpPort": "Přístav", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de.json index a36781a157..7f8debc508 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/de.json @@ -20,7 +20,7 @@ "Menu:Emailing": "E-Mail senden", "Menu:TimeZone": "Zeitzone", "DisplayName:Timezone": "Zeitzone", - "TimezoneHelpText": "Diese Einstellung wird anwendungsweit oder mandantenbasiert verwendet.", + "TimezoneHelpText": "Diese Funktion ermöglicht es Ihnen, eine Standardzeitzone für Ihren Server festzulegen, während Benutzer ihre eigene auswählen können. Wenn sich die Zeitzone eines Benutzers von der des Servers unterscheidet, werden alle Zeiten entsprechend angepasst. Zum Beispiel: Wenn der Server auf Europa/London(00:00) eingestellt ist und ein Benutzer in Europa/Paris(+01:00) ist, werden die Zeiten für diesen Benutzer um 1 Stunde angepasst. Die Auswahl von 'Standardzeitzone' verwendet automatisch die Zeitzone des Servers oder Browsers.", "DefaultTimeZone": "Standardzeitzone", "DefaultTimeZoneInfo": "Die Standardzeitzone wird versuchen, die Zeitzone des Browsers oder des Servers zu verwenden.", "SmtpHost": "Gastgeber", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json index 1afbfa81cb..84933fe44b 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Emailing", "Menu:TimeZone": "Time Zone", "DisplayName:Timezone": "Time zone", - "TimezoneHelpText": "This setting is used for application-wide or tenant-based. The default timezone will try to use the browser's or the server's timezone.", + "TimezoneHelpText": "This feature allows you to set a default time zone for your server, while users can select their own. If a user's time zone differs from the server's, all times will adjust accordingly. For example, with the server set to Europe/London(00:00) and a user in Europe/Paris(+01:00), times will be adjusted by 1 hour for that user. Selecting 'Default Timezone' will automatically use the server's or browser's time zone.", "DefaultTimeZone": "Default time zone", "SmtpHost": "Host", "SmtpPort": "Port", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json index 202404917c..bfc0ab6a3b 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/es.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Configuración", "Menu:TimeZone": "Zona Horaria", "DisplayName:Timezone": "Zona horaria", - "TimezoneHelpText": "Esta configuración se utiliza para toda la aplicación o basada en inquilinos. La zona horaria predeterminada intentará usar la zona horaria del navegador o del servidor.", + "TimezoneHelpText": "Esta función le permite establecer una zona horaria predeterminada para su servidor, mientras que los usuarios pueden seleccionar la suya propia. Si la zona horaria de un usuario difiere de la del servidor, todas las horas se ajustarán en consecuencia. Por ejemplo, con el servidor configurado en Europa/Londres(00:00) y un usuario en Europa/París(+01:00), las horas se ajustarán 1 hora para ese usuario. Al seleccionar 'Zona horaria predeterminada' se utilizará automáticamente la zona horaria del servidor o del navegador.", "DefaultTimeZone": "Zona horaria predeterminada", "SmtpHost": "Host", "SmtpPort": "Puerto", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/fi.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/fi.json index 24ffd3fd5c..f9b52baf2b 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/fi.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/fi.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Sähköpostiviestit", "Menu:TimeZone": "Aikavyöhyke", "DisplayName:Timezone": "Aikavyöhyke", - "TimezoneHelpText": "Tätä asetusta käytetään sovelluksenlaajuisesti tai vuokraajakohtaisesti. Oletusaikavyöhyke yrittää käyttää selaimen tai palvelimen aikavyöhykettä.", + "TimezoneHelpText": "Tämä ominaisuus antaa sinun asettaa oletusaikavyöhykkeen palvelimellesi, kun taas käyttäjät voivat valita oman aikavyöhykkeensä. Jos käyttäjän aikavyöhyke poikkeaa palvelimen aikavyöhykkeestä, kaikki ajat mukautetaan vastaavasti. Esimerkiksi, kun palvelin on asetettu Eurooppa/Lontoo(00:00) ja käyttäjä on Eurooppa/Pariisi(+01:00), ajat mukautetaan tunnilla kyseiselle käyttäjälle. 'Oletusaikavyöhyke' -valinta käyttää automaattisesti palvelimen tai selaimen aikavyöhykettä.", "DefaultTimeZone": "Oletusaikavyöhyke", "SmtpHost": "Isäntä", "SmtpPort": "Portti", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/fr.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/fr.json index eb2c2f6620..758e9a090c 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/fr.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/fr.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Envoi par e-mail", "Menu:TimeZone": "Fuseau Horaire", "DisplayName:Timezone": "Fuseau horaire", - "TimezoneHelpText": "Ce paramètre est utilisé à l'échelle de l'application ou basé sur le client. Le fuseau horaire par défaut tentera d'utiliser le fuseau horaire du navigateur ou du serveur.", + "TimezoneHelpText": "Cette fonctionnalité vous permet de définir un fuseau horaire par défaut pour votre serveur, tandis que les utilisateurs peuvent sélectionner le leur. Si le fuseau horaire d'un utilisateur diffère de celui du serveur, tous les horaires seront ajustés en conséquence. Par exemple, avec le serveur réglé sur Europe/Londres(00:00) et un utilisateur en Europe/Paris(+01:00), les horaires seront ajustés d'une heure pour cet utilisateur. La sélection de 'Fuseau horaire par défaut' utilisera automatiquement le fuseau horaire du serveur ou du navigateur.", "DefaultTimeZone": "Fuseau horaire par défaut", "SmtpHost": "Hôte", "SmtpPort": "Port", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hi.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hi.json index ae23e424f2..8dacb200e4 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hi.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hi.json @@ -20,7 +20,7 @@ "Menu:Emailing": "ईमेल से भेजना", "Menu:TimeZone": "समय क्षेत्र", "DisplayName:Timezone": "समय क्षेत्र", - "TimezoneHelpText": "इस सेटिंग का उपयोग एप्लिकेशन-व्यापी या किरायेदार-आधारित के लिए किया जाता है। डिफ़ॉल्ट समय क्षेत्र ब्राउज़र या सर्वर के समय क्षेत्र का उपयोग करने का प्रयास करेगा।", + "TimezoneHelpText": "यह सुविधा आपको अपने सर्वर के लिए एक डिफ़ॉल्ट समय क्षेत्र सेट करने की अनुमति देती है, जबकि उपयोगकर्ता अपना स्वयं का चुन सकते हैं। यदि किसी उपयोगकर्ता का समय क्षेत्र सर्वर के समय क्षेत्र से भिन्न है, तो सभी समय तदनुसार समायोजित किए जाएंगे। उदाहरण के लिए, सर्वर को यूरोप/लंदन(00:00) पर सेट किए जाने पर और एक उपयोगकर्ता यूरोप/पेरिस(+01:00) में होने पर, उस उपयोगकर्ता के लिए समय 1 घंटे के लिए समायोजित किया जाएगा। 'डिफ़ॉल्ट समय क्षेत्र' का चयन स्वचालित रूप से सर्वर या ब्राउज़र के समय क्षेत्र का उपयोग करेगा।", "DefaultTimeZone": "डिफ़ॉल्ट समय क्षेत्र", "SmtpHost": "मेज़बान", "SmtpPort": "बंदरगाह", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hr.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hr.json index 02347180a6..133233a10f 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hr.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hr.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Slanje e-poštom", "Menu:TimeZone": "Vremenska Zona", "DisplayName:Timezone": "Vremenska zona", - "TimezoneHelpText": "Ova se postavka koristi za cijelu aplikaciju ili zakupce.", + "TimezoneHelpText": "Ova značajka omogućuje vam postavljanje zadanog vremenskog pojasa za vaš poslužitelj, dok korisnici mogu odabrati svoj vlastiti. Ako se vremenski pojas korisnika razlikuje od vremenskog pojasa poslužitelja, sva vremena će se prilagoditi u skladu s tim. Na primjer, kada je poslužitelj postavljen na Europa/London(00:00) i korisnik je u Europa/Pariz(+01:00), vremena će se prilagoditi za 1 sat za tog korisnika. Odabirom 'Zadani vremenski pojas' automatski će se koristiti vremenski pojas poslužitelja ili preglednika.", "DefaultTimeZone": "Zadana vremenska zona", "DefaultTimeZoneInfo": "Zadana vremenska zona pokušat će koristiti vremensku zonu preglednika ili poslužitelja.", "SmtpHost": "Domaćin", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hu.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hu.json index 1273c17f50..4aed2b5688 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hu.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hu.json @@ -20,7 +20,7 @@ "Menu:Emailing": "E-mailezés", "Menu:TimeZone": "Időzóna", "DisplayName:Timezone": "Időzóna", - "TimezoneHelpText": "Ez a beállítás az egész alkalmazásra vagy a bérlőre vonatkozik. Az alapértelmezett időzóna megpróbálja használni a böngésző vagy a szerver időzónáját.", + "TimezoneHelpText": "Ez a funkció lehetővé teszi, hogy alapértelmezett időzónát állítson be a szerveréhez, miközben a felhasználók sajátot választhatnak. Ha egy felhasználó időzónája eltér a szerver időzónájától, az összes idő ennek megfelelően módosul. Például, ha a szerver Európa/London(00:00) időzónára van állítva, és egy felhasználó Európa/Párizs(+01:00) időzónában van, az időket 1 órával módosítják ennél a felhasználónál. Az 'Alapértelmezett időzóna' kiválasztása automatikusan a szerver vagy a böngésző időzónáját használja.", "DefaultTimeZone": "Alapértelmezett időzóna", "SmtpHost": "Házigazda", "SmtpPort": "Kikötő", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/is.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/is.json index d6b1bd1f21..2106b156bc 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/is.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/is.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Senda tölvupóst", "Menu:TimeZone": "Tímabelti", "DisplayName:Timezone": "Tímabelti", - "TimezoneHelpText": "Þessi stilling er notuð fyrir allt forrit eða leigjanda. Sjálfgefna tímabeltið mun reyna að nota tímabelti vafrans eða þjónsins.", + "TimezoneHelpText": "Þessi eiginleiki gerir þér kleift að setja sjálfgefna tímabelti fyrir þjóninn þinn, á meðan notendur geta valið sitt eigið. Ef tímabelti notanda er frábrugðið tímabelti þjónsins, verða allir tímar aðlagaðir í samræmi við það. Til dæmis, þegar þjónninn er stilltur á Evrópa/London(00:00) og notandi er í Evrópa/París(+01:00), verða tímar aðlagaðir um 1 klukkutíma fyrir þann notanda. Með því að velja 'Sjálfgefið tímabelti' verður sjálfkrafa notað tímabelti þjónsins eða vafrans.", "DefaultTimeZone": "Sjálfgefitt tímabelti", "SmtpHost": "Smtp Host", "SmtpPort": "Port", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/it.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/it.json index 4f27439374..487078c449 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/it.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/it.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Invio di e-mail", "Menu:TimeZone": "Fuso Orario", "DisplayName:Timezone": "Fuso orario", - "TimezoneHelpText": "Questa impostazione viene utilizzata per l'intera applicazione o in base al tenant. Il fuso orario predefinito tenterà di utilizzare il fuso orario del browser o del server.", + "TimezoneHelpText": "Questa funzione ti permette di impostare un fuso orario predefinito per il tuo server, mentre gli utenti possono selezionare il proprio. Se il fuso orario di un utente differisce da quello del server, tutti gli orari verranno adeguati di conseguenza. Ad esempio, con il server impostato su Europa/Londra(00:00) e un utente in Europa/Parigi(+01:00), gli orari verranno adeguati di 1 ora per quell'utente. Selezionando 'Fuso orario predefinito' verrà utilizzato automaticamente il fuso orario del server o del browser.", "DefaultTimeZone": "Fuso orario predefinito", "SmtpHost": "Host", "SmtpPort": "Porta", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/nl.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/nl.json index 806b8006c3..06f07346e5 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/nl.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/nl.json @@ -20,7 +20,7 @@ "Menu:Emailing": "E-mail", "Menu:TimeZone": "Tijdzone", "DisplayName:Timezone": "Tijdzone", - "TimezoneHelpText": "Deze instelling wordt gebruikt voor de hele toepassing of op tenantbasis. De standaardtijdzone zal proberen de tijdzone van de browser of de server te gebruiken.", + "TimezoneHelpText": "Deze functie stelt u in staat om een standaardtijdzone in te stellen voor uw server, terwijl gebruikers hun eigen tijdzone kunnen kiezen. Als de tijdzone van een gebruiker verschilt van die van de server, worden alle tijden dienovereenkomstig aangepast. Bijvoorbeeld, met de server ingesteld op Europa/Londen(00:00) en een gebruiker in Europa/Parijs(+01:00), worden de tijden met 1 uur aangepast voor die gebruiker. Door 'Standaardtijdzone' te selecteren wordt automatisch de tijdzone van de server of browser gebruikt.", "DefaultTimeZone": "Standaardtijdzone", "SmtpHost": "Host", "SmtpPort": "Poort", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/pl-PL.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/pl-PL.json index 5b5c3c5c43..35038ee043 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/pl-PL.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/pl-PL.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Wysyłanie e-maili", "Menu:TimeZone": "Strefa Czasowa", "DisplayName:Timezone": "Strefa czasowa", - "TimezoneHelpText": "To ustawienie jest używane w przypadku całej aplikacji lub opartej na dzierżawie. Domyślna strefa czasowa spróbuje użyć strefy czasowej przeglądarki lub serwera.", + "TimezoneHelpText": "Ta funkcja pozwala ustawić domyślną strefę czasową dla serwera, podczas gdy użytkownicy mogą wybrać własną. Jeśli strefa czasowa użytkownika różni się od strefy czasowej serwera, wszystkie czasy zostaną odpowiednio dostosowane. Na przykład, gdy serwer jest ustawiony na Europa/Londyn(00:00), a użytkownik jest w Europie/Paryżu(+01:00), czasy zostaną dostosowane o 1 godzinę dla tego użytkownika. Wybranie opcji 'Domyślna strefa czasowa' automatycznie wykorzysta strefę czasową serwera lub przeglądarki.", "DefaultTimeZone": "Domyślna strefa czasowa", "SmtpHost": "Gospodarz", "SmtpPort": "Port", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/pt-BR.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/pt-BR.json index 5baf3abff9..9a8cf0317b 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/pt-BR.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/pt-BR.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Enviando por e-mail", "Menu:TimeZone": "Fuso Horário", "DisplayName:Timezone": "Fuso horário", - "TimezoneHelpText": "Essa configuração é usada para todo o aplicativo ou com base em locatário. O fuso horário padrão tentará usar o fuso horário do navegador ou do servidor.", + "TimezoneHelpText": "Este recurso permite que você defina um fuso horário padrão para seu servidor, enquanto os usuários podem selecionar o seu próprio. Se o fuso horário de um usuário for diferente do fuso horário do servidor, todos os horários serão ajustados de acordo. Por exemplo, com o servidor definido como Europa/Londres(00:00) e um usuário na Europa/Paris(+01:00), os horários serão ajustados em 1 hora para esse usuário. Selecionar 'Fuso horário padrão' usará automaticamente o fuso horário do servidor ou do navegador.", "DefaultTimeZone": "Fuso horário padrão", "SmtpHost": "Hospedeiro", "SmtpPort": "Porta", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ro-RO.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ro-RO.json index b14d3703dd..8029a43734 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ro-RO.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ro-RO.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Emailing", "Menu:TimeZone": "Fus Orar", "DisplayName:Timezone": "Fus orar", - "TimezoneHelpText": "Această setare este utilizată pentru aplicație sau pentru chiriași. Fusul orar implicit va încerca să folosească fusul orar al browserului sau al serverului.", + "TimezoneHelpText": "Această funcționalitate vă permite să setați un fus orar implicit pentru serverul dvs., în timp ce utilizatorii pot selecta propriul lor. Dacă fusul orar al unui utilizator diferă de cel al serverului, toate orele vor fi ajustate în consecință. De exemplu, cu serverul setat la Europa/Londra(00:00) și un utilizator în Europa/Paris(+01:00), orele vor fi ajustate cu 1 oră pentru acel utilizator. Selectarea 'Fus orar implicit' va folosi automat fusul orar al serverului sau browserului.", "DefaultTimeZone": "Fus orar implicit", "SmtpHost": "Host", "SmtpPort": "Port", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ru.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ru.json index 788a4e23d1..0ab1535a3b 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ru.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/ru.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Отправка по электронной почте", "Menu:TimeZone": "Часовой пояс", "DisplayName:Timezone": "Часовой пояс", - "TimezoneHelpText": "Этот параметр используется для всего приложения или на уровне клиента. Часовой пояс по умолчанию попытается использовать часовой пояс браузера или сервера.", + "TimezoneHelpText": "Эта функция позволяет вам установить часовой пояс по умолчанию для вашего сервера, в то время как пользователи могут выбрать свой собственный. Если часовой пояс пользователя отличается от часового пояса сервера, все время будет соответствующим образом скорректировано. Например, если сервер установлен на Европа/Лондон(00:00), а пользователь находится в Европа/Париж(+01:00), время будет скорректировано на 1 час для этого пользователя. При выборе 'Часовой пояс по умолчанию' будет автоматически использоваться часовой пояс сервера или браузера.", "DefaultTimeZone": "Часовой пояс по умолчанию", "SmtpHost": "Хозяин", "SmtpPort": "Порт", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/sk.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/sk.json index 13b8dce96b..1c68a43ae5 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/sk.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/sk.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Posielanie emailov", "Menu:TimeZone": "Časové Pásmo", "DisplayName:Timezone": "Časové pásmo", - "TimezoneHelpText": "Toto nastavenie sa používa pre celú aplikáciu alebo pre nájomníkov. Predvolené časové pásmo sa pokúsi použiť časové pásmo prehliadača alebo servera.", + "TimezoneHelpText": "Táto funkcia vám umožňuje nastaviť predvolené časové pásmo pre váš server, zatiaľ čo používatelia si môžu vybrať svoje vlastné. Ak sa časové pásmo používateľa líši od časového pásma servera, všetky časy sa príslušne upravia. Napríklad, keď je server nastavený na Európa/Londýn(00:00) a používateľ je v Európa/Paríž(+01:00), časy sa pre tohto používateľa upravia o 1 hodinu. Výberom 'Predvolené časové pásmo' sa automaticky použije časové pásmo servera alebo prehliadača.", "DefaultTimeZone": "Predvolené časové pásmo", "SmtpHost": "Host", "SmtpPort": "Port", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/sl.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/sl.json index d79e045fd7..4805b28994 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/sl.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/sl.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Pošiljanje po e-pošti", "Menu:TimeZone": "Časovni Pas", "DisplayName:Timezone": "Časovni pas", - "TimezoneHelpText": "Ta nastavitev se uporablja za celotno aplikacijo ali za najemnika. Privzeto časovno pas bo poskusilo uporabiti časovni pas brskalnika ali strežnika.", + "TimezoneHelpText": "Ta funkcija vam omogoča nastavitev privzetega časovnega pasu za vaš strežnik, medtem ko lahko uporabniki izberejo svojega. Če se časovni pas uporabnika razlikuje od časovnega pasu strežnika, se vsi časi ustrezno prilagodijo. Na primer, ko je strežnik nastavljen na Evropa/London(00:00) in je uporabnik v Evropa/Pariz(+01:00), se časi za tega uporabnika prilagodijo za 1 uro. Z izbiro 'Privzeti časovni pas' se samodejno uporabi časovni pas strežnika ali brskalnika.", "DefaultTimeZone": "Privzeto časovno pas", "SmtpHost": "Gostitelj", "SmtpPort": "pristanišče", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json index ad2cbbb8ef..3b7fc2ac5f 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Email", "Menu:TimeZone": "Zaman Dilimi", "DisplayName:Timezone": "Zaman dilimi", - "TimezoneHelpText": "Bu ayar uygulama genelinde veya müşteri tabanlı olarak kullanılır. Varsayılan saat dilimi, tarayıcının veya sunucunun saat dilimini kullanmaya çalışacaktır.", + "TimezoneHelpText": "Bu özellik, kullanıcılar kendi saat dilimlerini seçebilirken, sunucunuz için varsayılan bir saat dilimi ayarlamanıza olanak tanır. Bir kullanıcının saat dilimi sunucunun saat diliminden farklıysa, tüm saatler buna göre ayarlanacaktır. Örneğin, sunucu Avrupa/Londra(00:00) olarak ayarlandığında ve bir kullanıcı Avrupa/Paris(+01:00)'te olduğunda, o kullanıcı için saatler 1 saat ayarlanacaktır. 'Varsayılan Saat Dilimi' seçimi otomatik olarak sunucunun veya tarayıcının saat dilimini kullanacaktır.", "DefaultTimeZone": "Varsayılan saat dilimi", "SmtpHost": "Sunucu", "SmtpPort": "Port", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/vi.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/vi.json index 200c437d44..a9cc466fdb 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/vi.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/vi.json @@ -20,7 +20,7 @@ "Menu:Emailing": "Gửi email", "Menu:TimeZone": "Múi Giờ", "DisplayName:Timezone": "Múi giờ", - "TimezoneHelpText": "Cài đặt này được sử dụng cho toàn bộ ứng dụng hoặc dựa trên đối tượng thuê. Múi giờ mặc định sẽ cố gắng sử dụng múi giờ của trình duyệt hoặc máy chủ.", + "TimezoneHelpText": "Tính năng này cho phép bạn đặt múi giờ mặc định cho máy chủ của mình, trong khi người dùng có thể chọn múi giờ của riêng họ. Nếu múi giờ của người dùng khác với múi giờ của máy chủ, tất cả thời gian sẽ được điều chỉnh tương ứng. Ví dụ: với máy chủ được đặt ở Châu Âu/Luân Đôn(00:00) và người dùng ở Châu Âu/Paris(+01:00), thời gian sẽ được điều chỉnh 1 giờ cho người dùng đó. Chọn 'Múi giờ mặc định' sẽ tự động sử dụng múi giờ của máy chủ hoặc trình duyệt.", "DefaultTimeZone": "Múi giờ mặc định", "SmtpHost": "Tổ chức", "SmtpPort": "Hải cảng", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json index 76e9cd3526..3aad0b9e8a 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json @@ -20,7 +20,7 @@ "Menu:Emailing": "邮件", "Menu:TimeZone": "时区", "DisplayName:Timezone": "时区", - "TimezoneHelpText": "此设置用于应用程序范围或基于租户。默认时区将尝试使用浏览器的时区或服务器的时区。", + "TimezoneHelpText": "此功能允许您为服务器设置默认时区,同时用户可以选择自己的时区。如果用户的时区与服务器的时区不同,所有时间将相应调整。例如,如果服务器设置为欧洲/伦敦(00:00),而用户在欧洲/巴黎(+01:00),则该用户的时间将调整1小时。选择'默认时区'将自动使用服务器或浏览器的时区。", "DefaultTimeZone": "默认时区", "SmtpHost": "主机", "SmtpPort": "端口", diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hant.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hant.json index 8ce6679659..77c586efe4 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hant.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hant.json @@ -20,7 +20,7 @@ "Menu:Emailing": "信箱", "Menu:TimeZone": "時區", "DisplayName:Timezone": "時區", - "TimezoneHelpText": "此設置用於應用程序範圍或基於租戶。預設時區將嘗試使用瀏覽器的時區或伺服器的時區。", + "TimezoneHelpText": "此功能允許您為伺服器設置預設時區,同時用戶可以選擇自己的時區。如果用戶的時區與伺服器的時區不同,所有時間將相應調整。例如,如果伺服器設置為歐洲/倫敦(00:00),而用戶在歐洲/巴黎(+01:00),則該用戶的時間將調整1小時。選擇'預設時區'將自動使用伺服器或瀏覽器的時區。", "DefaultTimeZone": "預設時區", "SmtpHost": "主機", "SmtpPort": "Port", From 808a4a5b2aec4afbe12bfa1063dbd060a33ce205 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 2 May 2025 17:38:32 +0800 Subject: [PATCH 33/39] Fix date object assignment in timezone adjustment logic --- npm/packs/core/src/abp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/packs/core/src/abp.js b/npm/packs/core/src/abp.js index 8d11ad1fec..a1175b0b79 100644 --- a/npm/packs/core/src/abp.js +++ b/npm/packs/core/src/abp.js @@ -778,7 +778,7 @@ var abp = abp || {}; var formattedDate = now.toLocaleString('en-US', { timeZone: timeZone, timeZoneName: 'longOffset' }); var match = formattedDate.match(/GMT([+-]\d+)/); var targetOffsetHours = match ? parseInt(match[1], 10) : 0; - var dateObj = new Date(dateObj.getTime() - (targetOffsetHours * 60 * 60 * 1000)); + dateObj = new Date(dateObj.getTime() - (targetOffsetHours * 60 * 60 * 1000)); addZulu = true; } From 929b2a89511d0094ca68149d05cda8e02abcab04 Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Sat, 3 May 2025 16:29:30 +0800 Subject: [PATCH 34/39] Add favicon to basic theme layouts --- .../Themes/Basic/Layouts/Account.cshtml | 1 + .../Themes/Basic/Layouts/Application.cshtml | 1 + .../Themes/Basic/Layouts/Empty.cshtml | 1 + .../wwwroot/themes/basic/favicon.svg | 8 ++++++++ 4 files changed, 11 insertions(+) create mode 100644 modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/favicon.svg diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml index 9a62892b5e..ccfb6fe354 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml @@ -34,6 +34,7 @@ + @(ViewBag.Title == null ? BrandingProvider.AppName : ViewBag.Title) diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml index c694c68424..58d6c7f700 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml @@ -40,6 +40,7 @@ + @pageTitle diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml index aaef7898c3..68748796be 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml @@ -38,6 +38,7 @@ + @pageTitle @if (ViewBag.Description != null) diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/favicon.svg b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/favicon.svg new file mode 100644 index 0000000000..7610fe9a37 --- /dev/null +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/favicon.svg @@ -0,0 +1,8 @@ + + + + + + + + From f34c8f254705e0bd1add28c0ac91c1c97f6b475a Mon Sep 17 00:00:00 2001 From: maliming Date: Sat, 3 May 2025 17:23:27 +0800 Subject: [PATCH 35/39] Add 'use-switch-checkbox' attribute to AbpInputTagHelper. --- .../TagHelpers/Form/AbpInputTagHelper.cs | 4 +++- .../TagHelpers/Form/AbpInputTagHelperService.cs | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelper.cs index 62cae94413..af1538bbde 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelper.cs @@ -47,11 +47,13 @@ public class AbpInputTagHelper : AbpTagHelper } if (isCheckBox) { - output.Attributes.AddClass("custom-checkbox"); - output.Attributes.AddClass("custom-control"); + if (!TagHelper.UseSwitchCheckBox) + { + output.Attributes.AddClass("custom-checkbox"); + output.Attributes.AddClass("custom-control"); + } + else + { + output.Attributes.AddClass("form-switch"); + } + output.Attributes.AddClass("form-check"); } } @@ -266,7 +274,7 @@ public class AbpInputTagHelperService : AbpTagHelperService } protected virtual async Task GetLabelAsHtmlAsync(TagHelperContext context, TagHelperOutput output, TagHelperOutput inputTag, bool isCheckbox) - { + { if (IsOutputHidden(inputTag) || TagHelper.SuppressLabel) { return string.Empty; @@ -395,7 +403,7 @@ public class AbpInputTagHelperService : AbpTagHelperService } innerOutput.Content.AppendHtml($" "); } - + innerOutput.Content.AppendHtml(GetRequiredSymbol(context, output)); return innerOutput.Render(_encoder); From 35450984307b6e84cb40110adb8f78a19853aaa5 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 5 May 2025 13:40:31 +0800 Subject: [PATCH 36/39] Chagne current tenant before read cache. --- ...entityDynamicClaimsPrincipalContributorCache.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDynamicClaimsPrincipalContributorCache.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDynamicClaimsPrincipalContributorCache.cs index 6051914adc..c0b5023386 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDynamicClaimsPrincipalContributorCache.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDynamicClaimsPrincipalContributorCache.cs @@ -58,9 +58,9 @@ public class IdentityDynamicClaimsPrincipalContributorCache : ITransientDependen return emptyCacheItem; } - return await DynamicClaimCache.GetOrAddAsync(AbpDynamicClaimCacheItem.CalculateCacheKey(userId, tenantId), async () => + using (CurrentTenant.Change(tenantId)) { - using (CurrentTenant.Change(tenantId)) + return await DynamicClaimCache.GetOrAddAsync(AbpDynamicClaimCacheItem.CalculateCacheKey(userId, tenantId), async () => { Logger.LogDebug($"Filling dynamic claims cache for user: {userId}"); @@ -82,11 +82,11 @@ public class IdentityDynamicClaimsPrincipalContributorCache : ITransientDependen } return dynamicClaims; - } - }, () => new DistributedCacheEntryOptions - { - AbsoluteExpirationRelativeToNow = CacheOptions.Value.CacheAbsoluteExpiration - }); + }, () => new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = CacheOptions.Value.CacheAbsoluteExpiration + }); + } } public virtual async Task ClearAsync(Guid userId, Guid? tenantId = null) From bd18cf015079aed5820036b4e437d72caa968e36 Mon Sep 17 00:00:00 2001 From: Mansur Besleney Date: Mon, 5 May 2025 09:02:13 +0300 Subject: [PATCH 37/39] Update en.json --- .../AbpIoLocalization/Www/Localization/Resources/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json index e60ed4cf59..91f0fd81a3 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json @@ -1889,6 +1889,6 @@ "FaqIyzicoPaymentIssuesExplanation8": "ABP website doesn't save or process your credit card. We use payment gateways for this and the entire transaction is handled by payment gateways. We have no authority to interfere with the payment process or fix the payment steps. If you have further questions or need additional support, feel free to contact us at abp.io/contact.", "BiographyContainsUrlValidationMessage": "Biography cannot contain URL.", "CreatePostSEOTitleInfo": "SEO URL is a clean, readable, keyword-rich URL that helps both users and search engines understand what this post is about. Keep it short with 60 characters. SEO titles over 60 characters will be truncated. Use hyphens (-) to separate words (not underscores). Include target keywords near the start. Lowercase only. No stop words unless needed (e.g: \"and\", \"or\", \"the\").", - "SEOTitle": "SEO Title" + "SEOTitle": "SEO URL" } } From 40b341d6b74c8482fa016ec7129f219a93d22e06 Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Mon, 5 May 2025 17:20:53 +0800 Subject: [PATCH 38/39] Remove unnecessary color override for dark navbar links --- .../wwwroot/libs/abp/css/theme.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/wwwroot/libs/abp/css/theme.css b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/wwwroot/libs/abp/css/theme.css index 881028a09d..d216a348af 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/wwwroot/libs/abp/css/theme.css +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/wwwroot/libs/abp/css/theme.css @@ -82,10 +82,6 @@ div.dataTables_wrapper div.dataTables_length label { /* TEMP */ -.navbar-dark .navbar-nav .nav-link { - color: #000 !important; -} - .navbar-nav > .nav-item > .nav-link, .navbar-nav > .nav-item > .dropdown > .nav-link { color: #fff !important; From b8b18dd22d56966dadd2b1107264bf6475551164 Mon Sep 17 00:00:00 2001 From: selman koc <64414348+skoc10@users.noreply.github.com> Date: Tue, 6 May 2025 09:06:30 +0300 Subject: [PATCH 39/39] Update version to release 9.2.0-rc.3 --- common.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.props b/common.props index 1e35c43bae..81b7cb8ecb 100644 --- a/common.props +++ b/common.props @@ -1,8 +1,8 @@ latest - 9.2.0-rc.2 - 4.2.0-rc.2 + 9.2.0-rc.3 + 4.2.0-rc.3 $(NoWarn);CS1591;CS0436 https://abp.io/assets/abp_nupkg.png https://abp.io/