From d3b23682d742cd2c0d4c4556326c5284b178670a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= <30300440+bariscanyilmaz@users.noreply.github.com> Date: Thu, 2 Feb 2023 16:26:54 +0300 Subject: [PATCH 01/15] create card component --- .../components/card/card-body.component.ts | 7 +++++ .../components/card/card-title.component.ts | 7 +++++ .../src/lib/components/card/card.component.ts | 27 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts create mode 100644 npm/ng-packs/packages/theme-shared/src/lib/components/card/card-title.component.ts create mode 100644 npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts new file mode 100644 index 0000000000..fc540e0002 --- /dev/null +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts @@ -0,0 +1,7 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'abp-card-body', + template: ``, +}) +export class CardBodyComponent {} diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-title.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-title.component.ts new file mode 100644 index 0000000000..b40e5b1767 --- /dev/null +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-title.component.ts @@ -0,0 +1,7 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'abp-card-title', + template: ``, +}) +export class CardTitleComponent {} diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts new file mode 100644 index 0000000000..9a97fa33b2 --- /dev/null +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts @@ -0,0 +1,27 @@ +import { Component, ContentChild, Input } from '@angular/core'; +import { CardBodyComponent } from './card-body.component'; +import { CardTitleComponent } from './card-title.component'; + +@Component({ + selector: 'abp-card', + template: ` +
+
+ +
+
+ +
+
`, +}) +export class CardComponent { + @Input() class:string + + @Input() style:string + + @ContentChild(CardBodyComponent) + cardBodyTemplate?: CardBodyComponent; + + @ContentChild(CardTitleComponent) + cardTitleTemplate?: CardTitleComponent; +} From bb9f29a5a7ca341dc5ebc5be7c49bdf708d01c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= <30300440+bariscanyilmaz@users.noreply.github.com> Date: Thu, 2 Feb 2023 16:27:52 +0300 Subject: [PATCH 02/15] import card component to theme-shared module --- .../theme-shared/src/lib/components/index.ts | 3 +++ .../theme-shared/src/lib/theme-shared.module.ts | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/index.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/index.ts index 810d5a991a..09ae029a7e 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/index.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/index.ts @@ -11,3 +11,6 @@ export * from './modal/modal.component'; export * from './toast-container/toast-container.component'; export * from './toast/toast.component'; export * from './password/password.component'; +export * from './card/card.component'; +export * from './card/card-title.component'; +export * from './card/card-body.component'; \ No newline at end of file diff --git a/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts b/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts index fd9a0cd236..492cff0aa8 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts @@ -36,6 +36,9 @@ import { HTTP_ERROR_CONFIG, httpErrorConfigFactory } from './tokens/http-error.t import { DateParserFormatter } from './utils/date-parser-formatter'; import { CONFIRMATION_ICONS, DEFAULT_CONFIRMATION_ICONS } from './tokens/confirmation-icons.token'; import { PasswordComponent } from './components/password/password.component'; +import { CardComponent } from './components/card/card.component'; +import { CardTitleComponent } from './components/card/card-title.component'; +import { CardBodyComponent } from './components/card/card-body.component'; const declarationsWithExports = [ BreadcrumbComponent, @@ -52,6 +55,9 @@ const declarationsWithExports = [ NgxDatatableListDirective, LoadingDirective, ModalCloseDirective, + CardComponent, + CardTitleComponent, + CardBodyComponent, ]; @NgModule({ @@ -62,11 +68,14 @@ const declarationsWithExports = [ NgbPaginationModule, EllipsisModule, ], - declarations: [...declarationsWithExports, HttpErrorWrapperComponent], + declarations: [ + ...declarationsWithExports, + HttpErrorWrapperComponent, + ], exports: [NgxDatatableModule, EllipsisModule, NgxValidateCoreModule, ...declarationsWithExports], providers: [DatePipe], }) -export class BaseThemeSharedModule {} +export class BaseThemeSharedModule { } @NgModule({ imports: [BaseThemeSharedModule], From efc71e3ec7868e3c6ddc453ab4f53b5ec2869e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= <30300440+bariscanyilmaz@users.noreply.github.com> Date: Thu, 2 Feb 2023 16:31:56 +0300 Subject: [PATCH 03/15] use abp-card component instead of card class --- .../dev-app/src/app/home/home.component.html | 156 ++++++------------ 1 file changed, 54 insertions(+), 102 deletions(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html index 2d249da3d8..ae646f2b6b 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html @@ -10,15 +10,8 @@

{{ '::LongWelcomeMessage' | abpLocalization }}

- + {{ 'AbpAccount::Login' | abpLocalization }} @@ -26,11 +19,11 @@

Let's improve your application!

Here are some links to help you get started:

-
-
+ + +
- + "> - + "> - + ">
- + ">

- - + + "> - + style="width: 72px; height: 28px; border: none; display: inline-block">

- + "> - + ">
-
-
+ +

Meet the ABP Commercial

A Complete Web Application Platform Built on the ABP Framework

- -
-
+ +

ABP Commercial is a platform based on the open source ABP framework. It provides pre-built application modules, rapid @@ -199,8 +174,7 @@

- + "> - + "> - + "> - + "> - + "> - + ">
-
-
+ + +

- Abp Framework - Abp Commercial - abpframework + Abp Framework + Abp Commercial + abpframework

@@ -295,17 +256,9 @@ {{ context.title }}

- - {{ link.label }} + + {{ link.label + }} @@ -316,9 +269,8 @@
- Details + Details
@@ -338,4 +290,4 @@ border-left: 0 !important; } } - + \ No newline at end of file From a9651a14910dd98232323617fb5526dd8e035d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= <30300440+bariscanyilmaz@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:38:33 +0300 Subject: [PATCH 04/15] lint html --- npm/ng-packs/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index e45e1d255c..72c8ffd062 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -131,8 +131,8 @@ }, "dependencies": {}, "lint-staged": { - "**/*.{js,jsx,ts,tsx}": [ + "**/*.{js,jsx,ts,tsx,html,css,scss}": [ "npx prettier --write --config .prettierrc " ] } -} +} \ No newline at end of file From bbd2ad99f3e3be857507f3a0d70333e04b4b7e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= <30300440+bariscanyilmaz@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:59:10 +0300 Subject: [PATCH 05/15] move card components to card module --- .../components/card/card-body.component.ts | 4 +++- .../components/card/card-title.component.ts | 4 +++- .../src/lib/components/card/card.component.ts | 17 ++++++----------- .../src/lib/components/card/card.module.ts | 14 ++++++++++++++ .../src/lib/theme-shared.module.ts | 19 +++++++++---------- 5 files changed, 35 insertions(+), 23 deletions(-) create mode 100644 npm/ng-packs/packages/theme-shared/src/lib/components/card/card.module.ts diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts index fc540e0002..b7efd90236 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts @@ -2,6 +2,8 @@ import { Component } from '@angular/core'; @Component({ selector: 'abp-card-body', - template: ``, + template: `
+ +
`, }) export class CardBodyComponent {} diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-title.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-title.component.ts index b40e5b1767..f629636854 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-title.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card-title.component.ts @@ -2,6 +2,8 @@ import { Component } from '@angular/core'; @Component({ selector: 'abp-card-title', - template: ``, + template: `
+ +
`, }) export class CardTitleComponent {} diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts index 9a97fa33b2..317e5800b9 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts @@ -4,20 +4,15 @@ import { CardTitleComponent } from './card-title.component'; @Component({ selector: 'abp-card', - template: ` -
-
- -
-
- -
-
`, + template: `
+ + +
`, }) export class CardComponent { - @Input() class:string + @Input() cardClass: string; - @Input() style:string + @Input() cardStyle: string; @ContentChild(CardBodyComponent) cardBodyTemplate?: CardBodyComponent; diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.module.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.module.ts new file mode 100644 index 0000000000..d8050a40cd --- /dev/null +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.module.ts @@ -0,0 +1,14 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { CardBodyComponent } from './card-body.component'; +import { CardTitleComponent } from './card-title.component'; +import { CardComponent } from './card.component'; + +const declarationsWithExports = [CardComponent, CardBodyComponent, CardTitleComponent]; + +@NgModule({ + declarations: [...declarationsWithExports], + imports: [CommonModule], + exports: [...declarationsWithExports], +}) +export class CardModule {} diff --git a/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts b/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts index 492cff0aa8..58f93b1bda 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts @@ -36,9 +36,7 @@ import { HTTP_ERROR_CONFIG, httpErrorConfigFactory } from './tokens/http-error.t import { DateParserFormatter } from './utils/date-parser-formatter'; import { CONFIRMATION_ICONS, DEFAULT_CONFIRMATION_ICONS } from './tokens/confirmation-icons.token'; import { PasswordComponent } from './components/password/password.component'; -import { CardComponent } from './components/card/card.component'; -import { CardTitleComponent } from './components/card/card-title.component'; -import { CardBodyComponent } from './components/card/card-body.component'; +import { CardModule } from './components/card/card.module'; const declarationsWithExports = [ BreadcrumbComponent, @@ -55,9 +53,6 @@ const declarationsWithExports = [ NgxDatatableListDirective, LoadingDirective, ModalCloseDirective, - CardComponent, - CardTitleComponent, - CardBodyComponent, ]; @NgModule({ @@ -67,15 +62,19 @@ const declarationsWithExports = [ NgxValidateCoreModule, NgbPaginationModule, EllipsisModule, + CardModule, ], - declarations: [ + declarations: [...declarationsWithExports, HttpErrorWrapperComponent], + exports: [ + NgxDatatableModule, + EllipsisModule, + NgxValidateCoreModule, ...declarationsWithExports, - HttpErrorWrapperComponent, + CardModule, ], - exports: [NgxDatatableModule, EllipsisModule, NgxValidateCoreModule, ...declarationsWithExports], providers: [DatePipe], }) -export class BaseThemeSharedModule { } +export class BaseThemeSharedModule {} @NgModule({ imports: [BaseThemeSharedModule], From b486e2619d3b25919536a7b344e7efb66e78b2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= <30300440+bariscanyilmaz@users.noreply.github.com> Date: Thu, 2 Feb 2023 18:00:09 +0300 Subject: [PATCH 06/15] use cardClass --- .../dev-app/src/app/home/home.component.html | 144 ++++++++++++------ 1 file changed, 96 insertions(+), 48 deletions(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html index ae646f2b6b..7024ab69e5 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html @@ -10,8 +10,15 @@

{{ '::LongWelcomeMessage' | abpLocalization }}

- + {{ 'AbpAccount::Login' | abpLocalization }} @@ -19,11 +26,11 @@

Let's improve your application!

Here are some links to help you get started:

- - +
- + " + > - + " + > - + " + >
- + " + >

- - + + " + > - + style="width: 72px; height: 28px; border: none; display: inline-block" + >

- + " + > - + " + >
@@ -165,7 +189,7 @@

Meet the ABP Commercial

A Complete Web Application Platform Built on the ABP Framework

- +

ABP Commercial is a platform based @@ -174,7 +198,8 @@

- + " + > - + " + > - + " + > - + " + > - + " + > - + " + >
- + @@ -256,9 +295,17 @@ {{ context.title }}

- - {{ link.label - }} + + {{ link.label }} @@ -269,8 +316,9 @@
- Details + Details
@@ -290,4 +338,4 @@ border-left: 0 !important; } } - \ No newline at end of file + From 9c7efc346cc21046e989317e0f385d51538c2fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= <30300440+bariscanyilmaz@users.noreply.github.com> Date: Thu, 2 Feb 2023 18:12:32 +0300 Subject: [PATCH 07/15] export card module --- .../packages/theme-shared/src/lib/components/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/index.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/index.ts index 09ae029a7e..095af5ef26 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/index.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/index.ts @@ -11,6 +11,4 @@ export * from './modal/modal.component'; export * from './toast-container/toast-container.component'; export * from './toast/toast.component'; export * from './password/password.component'; -export * from './card/card.component'; -export * from './card/card-title.component'; -export * from './card/card-body.component'; \ No newline at end of file +export * from './card/index'; From de5a33026e8981efe22060520564583ee8465141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= <30300440+bariscanyilmaz@users.noreply.github.com> Date: Thu, 2 Feb 2023 18:13:28 +0300 Subject: [PATCH 08/15] export card components from input --- .../packages/theme-shared/src/lib/components/card/index.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 npm/ng-packs/packages/theme-shared/src/lib/components/card/index.ts diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/card/index.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/card/index.ts new file mode 100644 index 0000000000..8d6bbd86d8 --- /dev/null +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/card/index.ts @@ -0,0 +1,4 @@ +export * from './card.module'; +export * from './card.component'; +export * from './card-body.component'; +export * from './card-title.component'; From af343a4c4c76460006d2002757df1ce4db70abc7 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Fri, 3 Feb 2023 18:57:44 +0300 Subject: [PATCH 09/15] Fix 3 test --- .../application-localization.service.spec.ts | 17 +++++++++++++++++ .../src/lib/tests/config-state.service.spec.ts | 17 +++++++++-------- .../core/src/lib/tests/date-utils.spec.ts | 2 +- .../src/lib/tests/localization-utils.spec.ts | 3 +++ .../src/lib/tests/localization.service.spec.ts | 9 +++++++++ .../core/src/lib/tests/permission.guard.spec.ts | 4 +++- 6 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 npm/ng-packs/packages/core/src/lib/tests/application-localization.service.spec.ts diff --git a/npm/ng-packs/packages/core/src/lib/tests/application-localization.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/application-localization.service.spec.ts new file mode 100644 index 0000000000..4e81b39f59 --- /dev/null +++ b/npm/ng-packs/packages/core/src/lib/tests/application-localization.service.spec.ts @@ -0,0 +1,17 @@ +export const APPLICATION_LOCALIZATION_DATA = { + resources: { + Default: { texts: {}, baseResources: [] }, + MyProjectName: { + texts: { + "'{0}' and '{1}' do not match.": "'{0}' and '{1}' do not match.", + }, + baseResources: [], + }, + AbpIdentity: { + texts: { + Identity: 'identity', + }, + baseResources: [], + }, + }, +}; diff --git a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts index 3dc1b45732..58040e8652 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts @@ -8,6 +8,9 @@ import { } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models'; import { ConfigStateService } from '../services'; import { CORE_OPTIONS } from '../tokens'; +import { IncludeLocalizationResourcesProvider } from '../providers'; +import { APPLICATION_LOCALIZATION_DATA } from './application-localization.service.spec'; +import { AbpApplicationLocalizationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service'; export const CONFIG_STATE_DATA = { environment: { @@ -34,14 +37,7 @@ export const CONFIG_STATE_DATA = { layouts: [null, null, null], }, localization: { - values: { - MyProjectName: { - "'{0}' and '{1}' do not match.": "'{0}' and '{1}' do not match.", - }, - AbpIdentity: { - Identity: 'identity', - }, - }, + values: {}, languages: [ { cultureName: 'cs', @@ -115,6 +111,11 @@ describe('ConfigStateService', () => { provide: AbpApplicationConfigurationService, useValue: { get: () => of(CONFIG_STATE_DATA) }, }, + { + provide: AbpApplicationLocalizationService, + useValue: { get: () => APPLICATION_LOCALIZATION_DATA }, + }, + IncludeLocalizationResourcesProvider, ], }); diff --git a/npm/ng-packs/packages/core/src/lib/tests/date-utils.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/date-utils.spec.ts index 20ef2e4a48..33f02dfb4f 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/date-utils.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/date-utils.spec.ts @@ -15,7 +15,7 @@ describe('Date Utils', () => { let config: ConfigStateService; beforeEach(() => { - config = new ConfigStateService(null); + config = new ConfigStateService(null, null, null); }); describe('#getShortDateFormat', () => { diff --git a/npm/ng-packs/packages/core/src/lib/tests/localization-utils.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/localization-utils.spec.ts index c12b7b61ce..4af0755d6c 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/localization-utils.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/localization-utils.spec.ts @@ -57,6 +57,7 @@ describe('Localization Utils', () => { languages: [], languageFilesMap: null, languagesMap: null, + resources: {}, }); test.each` @@ -100,6 +101,7 @@ describe('Localization Utils', () => { languages: [], languageFilesMap: null, languagesMap: null, + resources: {}, }); test.each` @@ -148,6 +150,7 @@ describe('Localization Utils', () => { languages: [], languageFilesMap: null, languagesMap: null, + resources: {}, }); test.each` diff --git a/npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts index 5aedd28f6e..d2eb653a85 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts @@ -8,8 +8,12 @@ import { SessionStateService } from '../services/session-state.service'; import { LocalizationService } from '../services/localization.service'; import { CORE_OPTIONS } from '../tokens/options.token'; import { CONFIG_STATE_DATA } from './config-state.service.spec'; +import { AbpApplicationLocalizationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service'; +import { APPLICATION_LOCALIZATION_DATA } from './application-localization.service.spec'; +import { IncludeLocalizationResourcesProvider } from '../providers'; const appConfigData$ = new BehaviorSubject(CONFIG_STATE_DATA); +const appLocalizationData$ = new BehaviorSubject(APPLICATION_LOCALIZATION_DATA); describe('LocalizationService', () => { let spectator: SpectatorService; @@ -22,6 +26,7 @@ describe('LocalizationService', () => { entryComponents: [], mocks: [Router], providers: [ + IncludeLocalizationResourcesProvider, { provide: CORE_OPTIONS, useValue: { registerLocaleFn: () => Promise.resolve(), cultureNameLocaleFileMap: {} }, @@ -30,6 +35,10 @@ describe('LocalizationService', () => { provide: AbpApplicationConfigurationService, useValue: { get: () => appConfigData$ }, }, + { + provide: AbpApplicationLocalizationService, + useValue: { get: () => appLocalizationData$ }, + }, ], }); diff --git a/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts index 4369b8434f..372f3434f3 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts @@ -9,6 +9,7 @@ import { HttpErrorReporterService } from '../services/http-error-reporter.servic import { PermissionService } from '../services/permission.service'; import { RoutesService } from '../services/routes.service'; import { CORE_OPTIONS } from '../tokens/options.token'; +import { IncludeLocalizationResourcesProvider } from '../providers'; describe('PermissionGuard', () => { let spectator: SpectatorService; @@ -36,7 +37,7 @@ describe('PermissionGuard', () => { }, }, ], - { relativeLinkResolution: 'legacy' }, + {}, ), ], providers: [ @@ -45,6 +46,7 @@ describe('PermissionGuard', () => { useValue: '/', }, { provide: CORE_OPTIONS, useValue: { skipGetAppConfiguration: true } }, + IncludeLocalizationResourcesProvider, ], }); From f94657bd16a91bb186ae4590edaf7ac75b246395 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Wed, 15 Feb 2023 16:43:29 +0800 Subject: [PATCH 10/15] Update WithProviders comment --- .../Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs index 14cd0d405b..1a1e2ece3b 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs @@ -124,7 +124,7 @@ public class FeatureDefinition : ICanCreateChildFeature } /// - /// Sets a property in the dictionary. + /// Adds one or more providers to the list. /// This is a shortcut for nested calls on this object. /// public virtual FeatureDefinition WithProviders(params string[] providers) From b407da2f0985b0107d61b763904dcede70a09d82 Mon Sep 17 00:00:00 2001 From: Hamza Albreem <94292623+braim23@users.noreply.github.com> Date: Wed, 15 Feb 2023 12:26:38 +0300 Subject: [PATCH 11/15] Fixing the namespaces in the documentation --- docs/en/Tutorials/Todo/Single-Layer/Index.md | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/en/Tutorials/Todo/Single-Layer/Index.md b/docs/en/Tutorials/Todo/Single-Layer/Index.md index 744aff88ad..ac6a89faea 100644 --- a/docs/en/Tutorials/Todo/Single-Layer/Index.md +++ b/docs/en/Tutorials/Todo/Single-Layer/Index.md @@ -255,7 +255,7 @@ Before starting to implement these use cases, first we need to create a DTO clas [Application services](../../../Application-Services.md) typically get and return DTOs ([Data Transfer Objects](../../../Data-Transfer-Objects.md)) instead of entities. So, create a new `TodoItemDto` class under the `Services/Dtos` folder{{if UI=="Blazor"}} of your `TodoApp.Contracts` project{{end}}: ```csharp -namespace TodoApp{{if UI=="Blazor"}}.Contracts{{end}}.Services.Dtos; +namespace TodoApp.Services.Dtos; public class TodoItemDto { @@ -273,10 +273,10 @@ This is a very simple DTO class that has the same properties as the `TodoItem` e Create a `ITodoAppService` interface under the `Services` folder of the `TodoApp.Contracts` project, as shown below: ```csharp -using TodoApp.Contracts.Services.Dtos; +using TodoApp.Services.Dtos; using Volo.Abp.Application.Services; -namespace TodoApp.Contracts.Services; +namespace TodoApp.Services; public interface ITodoAppService : IApplicationService { @@ -296,17 +296,18 @@ Create a `TodoAppService` class under the `Services` folder of {{if UI=="Blazor" ```csharp {{if UI=="Blazor"}} -using TodoApp.Contracts.Services; -using TodoApp.Contracts.Services.Dtos; -using TodoApp.Host.Entities; +using TodoApp.Services; +using TodoApp.Services.Dtos; +using TodoApp.Entities; using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; {{else}} using TodoApp.Entities; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; -{{end}} -namespace TodoApp{{if UI=="Blazor"}}.Host{{end}}.Services; + +namespace TodoApp.Services; public class TodoAppService : ApplicationService{{if UI=="Blazor"}}, ITodoAppService{{end}} { @@ -562,8 +563,8 @@ Open the `Index.razor.cs` file in the `Pages` folder{{if UI=="Blazor"}} in your ```csharp {{if UI=="Blazor"}} using Microsoft.AspNetCore.Components; -using TodoApp.Contracts.Services; -using TodoApp.Contracts.Services.Dtos; +using TodoApp.Services; +using TodoApp.Services.Dtos; {{else}} using Microsoft.AspNetCore.Components; using TodoApp.Services; From f940c0c4d5d44224540f1caf8f1e44092b2a6341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= <30300440+bariscanyilmaz@users.noreply.github.com> Date: Wed, 15 Feb 2023 14:01:41 +0300 Subject: [PATCH 12/15] fix lint --- .../theme-shared/src/lib/directives/visible.directive.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/directives/visible.directive.ts b/npm/ng-packs/packages/theme-shared/src/lib/directives/visible.directive.ts index 9c2c408d0e..9613779472 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/directives/visible.directive.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/directives/visible.directive.ts @@ -8,7 +8,7 @@ export class AbpVisibleDirective implements OnDestroy, OnInit { conditionSubscription: Subscription | undefined; isVisible: boolean | undefined; - @Input('abpVisible') set abpVisible( + @Input() set abpVisible( value: boolean | Promise | Observable | undefined | null, ) { this.condition$ = checkType(value); From a43438708426a0738192d1af7079d24b947a2afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20=C3=87A=C4=9EDA=C5=9E?= Date: Thu, 16 Feb 2023 11:30:04 +0300 Subject: [PATCH 13/15] use bash for installing lepton and bootstrap-icons commands --- docs/en/Themes/LeptonXLite/Angular.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/en/Themes/LeptonXLite/Angular.md b/docs/en/Themes/LeptonXLite/Angular.md index 7ebb649aca..56b003e606 100644 --- a/docs/en/Themes/LeptonXLite/Angular.md +++ b/docs/en/Themes/LeptonXLite/Angular.md @@ -14,11 +14,15 @@ To add `LeptonX-lite` into your project, - Install `@abp/ng.theme.lepton-x` -`yarn add @abp/ng.theme.lepton-x@preview` +```bash +yarn add @abp/ng.theme.lepton-x +``` - Install `bootstrap-icons` -`yarn add bootstrap-icons` +```bash +yarn add bootstrap-icons +``` - Then, we need to edit the styles array in `angular.json` to replace the existing style with the new one in the following link : From 2d1f34ce801e0710049283487ed630697bce8e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 16 Feb 2023 11:34:47 +0300 Subject: [PATCH 14/15] Switch Angular Dev-App to LeptonX-Lite --- npm/ng-packs/angular.json | 51 +++++++++++++++++-- .../apps/dev-app/src/app/app.module.ts | 6 ++- npm/ng-packs/package.json | 29 ++++++----- 3 files changed, 66 insertions(+), 20 deletions(-) diff --git a/npm/ng-packs/angular.json b/npm/ng-packs/angular.json index 01e482cd85..7138cb5a38 100644 --- a/npm/ng-packs/angular.json +++ b/npm/ng-packs/angular.json @@ -195,15 +195,55 @@ "assets": ["apps/dev-app/src/favicon.ico", "apps/dev-app/src/assets"], "styles": [ { - "input": "node_modules/bootstrap/dist/css/bootstrap.rtl.min.css", + "input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/bootstrap-dim.css", "inject": false, - "bundleName": "bootstrap-rtl.min" + "bundleName": "bootstrap-dim" }, { - "input": "node_modules/bootstrap/dist/css/bootstrap.min.css", - "inject": true, - "bundleName": "bootstrap-ltr.min" + "input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/ng-bundle.css", + "inject": false, + "bundleName": "ng-bundle" + }, + { + "input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/side-menu/layout-bundle.css", + "inject": false, + "bundleName": "layout-bundle" + }, + { + "input": "node_modules/@abp/ng.theme.lepton-x/assets/css/abp-bundle.css", + "inject": false, + "bundleName": "abp-bundle" + }, + { + "input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/bootstrap-dim.rtl.css", + "inject": false, + "bundleName": "bootstrap-dim.rtl" + }, + { + "input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/ng-bundle.rtl.css", + "inject": false, + "bundleName": "ng-bundle.rtl" + }, + { + "input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/side-menu/layout-bundle.rtl.css", + "inject": false, + "bundleName": "layout-bundle.rtl" + }, + { + "input": "node_modules/@abp/ng.theme.lepton-x/assets/css/abp-bundle.rtl.css", + "inject": false, + "bundleName": "abp-bundle.rtl" + }, + { + "input":"node_modules/@volo/ngx-lepton-x.lite/assets/css/font-bundle.rtl.css", + "inject":false, + "bundleName":"font-bundle.rtl" }, + { + "input":"node_modules/@volo/ngx-lepton-x.lite/assets/css/font-bundle.css", + "inject":false, + "bundleName":"font-bundle" + }, { "input": "node_modules/@fortawesome/fontawesome-free/css/all.min.css", "inject": true, @@ -234,6 +274,7 @@ "inject": false, "bundleName": "ng-zorro-antd-tree" }, + "node_modules/bootstrap-icons/font/bootstrap-icons.css", "apps/dev-app/src/styles.scss" ], "scripts": [] diff --git a/npm/ng-packs/apps/dev-app/src/app/app.module.ts b/npm/ng-packs/apps/dev-app/src/app/app.module.ts index 52ebd38362..86e29cf0d1 100644 --- a/npm/ng-packs/apps/dev-app/src/app/app.module.ts +++ b/npm/ng-packs/apps/dev-app/src/app/app.module.ts @@ -4,7 +4,8 @@ import { registerLocale } from '@abp/ng.core/locale'; import { IdentityConfigModule } from '@abp/ng.identity/config'; import { SettingManagementConfigModule } from '@abp/ng.setting-management/config'; import { TenantManagementConfigModule } from '@abp/ng.tenant-management/config'; -import { ThemeBasicModule } from '@abp/ng.theme.basic'; +import { ThemeLeptonXModule } from "@abp/ng.theme.lepton-x"; +import { SideMenuLayoutModule } from "@abp/ng.theme.lepton-x/layouts"; import { ThemeSharedModule } from '@abp/ng.theme.shared'; import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; @@ -34,7 +35,8 @@ import { AbpOAuthModule } from '@abp/ng.oauth'; TenantManagementConfigModule.forRoot(), FeatureManagementModule.forRoot(), SettingManagementConfigModule.forRoot(), - ThemeBasicModule.forRoot(), + ThemeLeptonXModule.forRoot(), + SideMenuLayoutModule.forRoot() ], providers: [APP_ROUTE_PROVIDER], declarations: [AppComponent], diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index 7e302ee20d..600c047ff4 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -42,6 +42,18 @@ }, "private": true, "devDependencies": { + "@abp/ng.account": "~7.1.0-rc.1", + "@abp/ng.account.core": "~7.1.0-rc.1", + "@abp/ng.core": "~7.1.0-rc.1", + "@abp/ng.feature-management": "~7.1.0-rc.1", + "@abp/ng.identity": "~7.1.0-rc.1", + "@abp/ng.oauth": "~7.1.0-rc.1", + "@abp/ng.permission-management": "~7.1.0-rc.1", + "@abp/ng.schematics": "~7.1.0-rc.1", + "@abp/ng.setting-management": "~7.1.0-rc.1", + "@abp/ng.tenant-management": "~7.1.0-rc.1", + "@abp/ng.theme.basic": "~7.1.0-rc.1", + "@abp/ng.theme.shared": "~7.1.0-rc.1", "@abp/utils": "~7.1.0-rc.1", "@angular-devkit/build-angular": "~15.0.1", "@angular-devkit/build-ng-packagr": "^0.1002.0", @@ -61,18 +73,6 @@ "@angular/platform-browser": "~15.0.1", "@angular/platform-browser-dynamic": "~15.0.1", "@angular/router": "~15.0.1", - "@abp/ng.account": "~7.1.0-rc.1", - "@abp/ng.account.core": "~7.1.0-rc.1", - "@abp/ng.core": "~7.1.0-rc.1", - "@abp/ng.oauth": "~7.1.0-rc.1", - "@abp/ng.feature-management": "~7.1.0-rc.1", - "@abp/ng.identity": "~7.1.0-rc.1", - "@abp/ng.permission-management": "~7.1.0-rc.1", - "@abp/ng.schematics": "~7.1.0-rc.1", - "@abp/ng.setting-management": "~7.1.0-rc.1", - "@abp/ng.tenant-management": "~7.1.0-rc.1", - "@abp/ng.theme.basic": "~7.1.0-rc.1", - "@abp/ng.theme.shared": "~7.1.0-rc.1", "@fortawesome/fontawesome-free": "^5.15.4", "@ng-bootstrap/ng-bootstrap": "^14.0.0", "@ngneat/spectator": "^10.0.0", @@ -129,7 +129,10 @@ "typescript": "4.8.4", "zone.js": "0.11.4" }, - "dependencies": {}, + "dependencies": { + "@abp/ng.theme.lepton-x": "^2.1.0-rc.1", + "bootstrap-icons": "^1.10.3" + }, "lint-staged": { "**/*.{js,jsx,ts,tsx}": [ "npx prettier --write --config .prettierrc " From 5586e5a7871c58ab473ad4a8272622cd36c5f844 Mon Sep 17 00:00:00 2001 From: Hamza Albreem <94292623+braim23@users.noreply.github.com> Date: Thu, 16 Feb 2023 14:21:55 +0300 Subject: [PATCH 15/15] Fix the missing {{end}} in the Minimalist TodoApp doc --- docs/en/Tutorials/Todo/Single-Layer/Index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Tutorials/Todo/Single-Layer/Index.md b/docs/en/Tutorials/Todo/Single-Layer/Index.md index ac6a89faea..fe09c57e3f 100644 --- a/docs/en/Tutorials/Todo/Single-Layer/Index.md +++ b/docs/en/Tutorials/Todo/Single-Layer/Index.md @@ -305,7 +305,7 @@ using Volo.Abp.Domain.Repositories; using TodoApp.Entities; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; - +{{end}} namespace TodoApp.Services;