Browse Source

feature(theme-shared): validation-error.component moved from theme-shared to theme-basic

pull/1768/head
mehmet-erim 7 years ago
parent
commit
ee9a56da7b
  1. 1
      npm/ng-packs/packages/theme-basic/src/lib/components/index.ts
  2. 0
      npm/ng-packs/packages/theme-basic/src/lib/components/validation-error/validation-error.component.ts
  3. 18
      npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts
  4. 1
      npm/ng-packs/packages/theme-shared/src/lib/components/index.ts
  5. 26
      npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts

1
npm/ng-packs/packages/theme-basic/src/lib/components/index.ts

@ -1,3 +1,4 @@
export * from './account-layout/account-layout.component';
export * from './application-layout/application-layout.component';
export * from './empty-layout/empty-layout.component';
export * from './validation-error/validation-error.component';

0
npm/ng-packs/packages/theme-shared/src/lib/components/errors/validation-error.component.ts → npm/ng-packs/packages/theme-basic/src/lib/components/validation-error/validation-error.component.ts

18
npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts

@ -10,11 +10,12 @@ import { ApplicationLayoutComponent } from './components/application-layout/appl
import { EmptyLayoutComponent } from './components/empty-layout/empty-layout.component';
import { LayoutComponent } from './components/layout/layout.component';
import { LayoutState } from './states/layout.state';
import { ValidationErrorComponent } from './components/validation-error/validation-error.component';
export const LAYOUTS = [ApplicationLayoutComponent, AccountLayoutComponent, EmptyLayoutComponent];
@NgModule({
declarations: [...LAYOUTS, LayoutComponent],
declarations: [...LAYOUTS, LayoutComponent, ValidationErrorComponent],
imports: [
CoreModule,
ThemeSharedModule,
@ -23,8 +24,21 @@ export const LAYOUTS = [ApplicationLayoutComponent, AccountLayoutComponent, Empt
ToastModule,
NgxValidateCoreModule,
NgxsModule.forFeature([LayoutState]),
NgxValidateCoreModule.forRoot({
targetSelector: '.form-group',
blueprints: {
email: `AbpAccount::ThisFieldIsNotAValidEmailAddress.`,
max: `AbpAccount::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]`,
maxlength: `AbpAccount::ThisFieldMustBeAStringWithAMaximumLengthOf{1}[{{ requiredLength }}]`,
min: `AbpAccount::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]`,
minlength: `AbpAccount::ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf[{{ min }},{{ max }}]`,
required: `AbpAccount::ThisFieldIsRequired.`,
passwordMismatch: `AbpIdentity::Identity.PasswordConfirmationFailed`,
},
errorTemplate: ValidationErrorComponent,
}),
],
exports: [...LAYOUTS],
entryComponents: [...LAYOUTS],
entryComponents: [...LAYOUTS, ValidationErrorComponent],
})
export class ThemeBasicModule {}

1
npm/ng-packs/packages/theme-shared/src/lib/components/index.ts

@ -6,4 +6,5 @@ export * from './confirmation/confirmation.component';
export * from './loader-bar/loader-bar.component';
export * from './modal/modal.component';
export * from './profile/profile.component';
export * from './table-empty-message/table-empty-message.component';
export * from './toast/toast.component';

26
npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts

@ -1,6 +1,5 @@
import { CoreModule, LazyLoadService } from '@abp/ng.core';
import { APP_INITIALIZER, Injector, ModuleWithProviders, NgModule } from '@angular/core';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { MessageService } from 'primeng/components/common/messageservice';
import { ToastModule } from 'primeng/toast';
import { forkJoin } from 'rxjs';
@ -11,7 +10,6 @@ import { ChangePasswordComponent } from './components/change-password/change-pas
import { ChartComponent } from './components/chart/chart.component';
import { ConfirmationComponent } from './components/confirmation/confirmation.component';
import { ErrorComponent } from './components/errors/error.component';
import { ValidationErrorComponent } from './components/errors/validation-error.component';
import { LoaderBarComponent } from './components/loader-bar/loader-bar.component';
import { ModalComponent } from './components/modal/modal.component';
import { ProfileComponent } from './components/profile/profile.component';
@ -19,6 +17,7 @@ import { ToastComponent } from './components/toast/toast.component';
import styles from './contants/styles';
import { ErrorHandler } from './handlers/error.handler';
import { chartJsLoaded$ } from './utils/widget-utils';
import { TableEmptyMessageComponent } from './components/table-empty-message/table-empty-message.component';
export function appendScript(injector: Injector) {
const fn = function() {
@ -41,23 +40,7 @@ export function appendScript(injector: Injector) {
}
@NgModule({
imports: [
CoreModule,
ToastModule,
NgxValidateCoreModule.forRoot({
targetSelector: '.form-group',
blueprints: {
email: `AbpAccount::ThisFieldIsNotAValidEmailAddress.`,
max: `AbpAccount::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]`,
maxlength: `AbpAccount::ThisFieldMustBeAStringWithAMaximumLengthOf{1}[{{ requiredLength }}]`,
min: `AbpAccount::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]`,
minlength: `AbpAccount::ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf[{{ min }},{{ max }}]`,
required: `AbpAccount::ThisFieldIsRequired.`,
passwordMismatch: `AbpIdentity::Identity.PasswordConfirmationFailed`,
},
errorTemplate: ValidationErrorComponent,
}),
],
imports: [CoreModule, ToastModule],
declarations: [
BreadcrumbComponent,
ButtonComponent,
@ -68,8 +51,8 @@ export function appendScript(injector: Injector) {
LoaderBarComponent,
ModalComponent,
ProfileComponent,
TableEmptyMessageComponent,
ToastComponent,
ValidationErrorComponent,
],
exports: [
BreadcrumbComponent,
@ -80,9 +63,10 @@ export function appendScript(injector: Injector) {
LoaderBarComponent,
ModalComponent,
ProfileComponent,
TableEmptyMessageComponent,
ToastComponent,
],
entryComponents: [ErrorComponent, ValidationErrorComponent],
entryComponents: [ErrorComponent],
})
export class ThemeSharedModule {
static forRoot(): ModuleWithProviders {

Loading…
Cancel
Save