Browse Source

fix some errors

pull/10102/head
Mehmet Erim 5 years ago
parent
commit
0e11eebd28
  1. 8
      npm/ng-packs/packages/account-core/src/lib/tenant-box.service.ts
  2. 1
      npm/ng-packs/packages/core/src/lib/utils/date-utils.ts
  3. 1
      npm/ng-packs/packages/core/src/lib/utils/index.ts
  4. 3
      npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts
  5. 24
      npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts

8
npm/ng-packs/packages/account-core/src/lib/tenant-box.service.ts

@ -1,12 +1,11 @@
import { Injectable } from '@angular/core';
import { ToasterService } from '@abp/ng.theme.shared';
import { import {
AbpApplicationConfigurationService,
AbpTenantService, AbpTenantService,
ConfigStateService, ConfigStateService,
CurrentTenantDto, CurrentTenantDto,
SessionStateService, SessionStateService,
} from '@abp/ng.core'; } from '@abp/ng.core';
import { ToasterService } from '@abp/ng.theme.shared';
import { Injectable } from '@angular/core';
import { finalize } from 'rxjs/operators'; import { finalize } from 'rxjs/operators';
@Injectable() @Injectable()
@ -24,7 +23,6 @@ export class TenantBoxService {
private tenantService: AbpTenantService, private tenantService: AbpTenantService,
private sessionState: SessionStateService, private sessionState: SessionStateService,
private configState: ConfigStateService, private configState: ConfigStateService,
private appConfigService: AbpApplicationConfigurationService,
) {} ) {}
onSwitch() { onSwitch() {
@ -57,7 +55,7 @@ export class TenantBoxService {
private setTenant(tenant: CurrentTenantDto) { private setTenant(tenant: CurrentTenantDto) {
this.sessionState.setTenant(tenant); this.sessionState.setTenant(tenant);
this.appConfigService.get().subscribe(res => this.configState.setState(res)); this.configState.refreshAppState();
} }
private showError() { private showError() {

1
npm/ng-packs/packages/core/src/lib/utils/date-utils.ts

@ -1,4 +1,3 @@
import { ApplicationConfiguration } from '../models/application-configuration';
import { DateTimeFormatDto } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models'; import { DateTimeFormatDto } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
import { ConfigStateService } from '../services'; import { ConfigStateService } from '../services';

1
npm/ng-packs/packages/core/src/lib/utils/index.ts

@ -16,6 +16,5 @@ export * from './multi-tenancy-utils';
export * from './number-utils'; export * from './number-utils';
export * from './object-utils'; export * from './object-utils';
export * from './route-utils'; export * from './route-utils';
export * from './rxjs-utils';
export * from './string-utils'; export * from './string-utils';
export * from './tree-utils'; export * from './tree-utils';

3
npm/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts

@ -1,3 +0,0 @@
function isFunction(value) {
return typeof value === 'function';
}

24
npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts

@ -5,7 +5,6 @@ import {
EventEmitter, EventEmitter,
Inject, Inject,
Input, Input,
isDevMode,
OnDestroy, OnDestroy,
OnInit, OnInit,
Optional, Optional,
@ -144,9 +143,8 @@ export class ModalComponent implements OnInit, OnDestroy, DismissableModal {
setTimeout(() => this.listen(), 0); setTimeout(() => this.listen(), 0);
this.modalRef = this.modal.open(this.modalContent, { this.modalRef = this.modal.open(this.modalContent, {
// TODO: set size to 'lg' when removed the size variable size: 'lg',
size: this.size, centered: true,
centered: this.centered,
keyboard: false, keyboard: false,
scrollable: true, scrollable: true,
beforeDismiss: () => { beforeDismiss: () => {
@ -156,7 +154,7 @@ export class ModalComponent implements OnInit, OnDestroy, DismissableModal {
return !this.visible; return !this.visible;
}, },
...this.options, ...this.options,
windowClass: `${this.modalClass} ${this.options.windowClass || ''} ${this.modalIdentifier}`, windowClass: `${this.options.windowClass || ''} ${this.modalIdentifier}`,
}); });
this.appear.emit(); this.appear.emit();
@ -212,22 +210,6 @@ export class ModalComponent implements OnInit, OnDestroy, DismissableModal {
} }
}); });
setTimeout(() => {
if (!this.abpClose) return;
this.warnForDeprecatedClose();
fromEvent(this.abpClose.nativeElement, 'click')
.pipe(takeUntil(this.destroy$))
.subscribe(() => this.close());
}, 0);
this.init.emit(); this.init.emit();
} }
private warnForDeprecatedClose() {
if (isDevMode()) {
console.warn(
'Please use abpClose directive instead of #abpClose template variable. #abpClose will be removed in v5.0',
);
}
}
} }

Loading…
Cancel
Save