Browse Source

Fix break-changes issues

pull/14077/head
Mahmut Gundogdu 4 years ago
parent
commit
a66954d4cc
  1. 2
      npm/ng-packs/packages/core/src/lib/directives/permission.directive.ts
  2. 17
      npm/ng-packs/packages/core/src/lib/services/config-state.service.ts
  3. 2
      npm/ng-packs/packages/core/src/lib/services/http-wait.service.ts
  4. 2
      npm/ng-packs/packages/core/src/lib/services/list.service.ts
  5. 2
      npm/ng-packs/packages/core/src/lib/services/router-wait.service.ts
  6. 4
      npm/ng-packs/packages/core/src/lib/tests/api.interceptor.spec.ts
  7. 2
      npm/ng-packs/packages/core/src/lib/tests/routes.service.spec.ts
  8. 6
      npm/ng-packs/packages/core/src/lib/validators/url.validator.ts
  9. 2
      npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts
  10. 2
      npm/ng-packs/packages/theme-shared/src/lib/tests/modal.component.spec.ts

2
npm/ng-packs/packages/core/src/lib/directives/permission.directive.ts

@ -23,7 +23,7 @@ export class PermissionDirective implements OnDestroy, OnChanges, AfterViewInit
subscription!: Subscription;
cdrSubject = new ReplaySubject();
cdrSubject = new ReplaySubject<void>();
rendered = false;

17
npm/ng-packs/packages/core/src/lib/services/config-state.service.ts

@ -2,7 +2,10 @@ import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { map, switchMap, take } from 'rxjs/operators';
import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';
import { ApplicationConfigurationDto, ApplicationGlobalFeatureConfigurationDto } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
import {
ApplicationConfigurationDto,
ApplicationGlobalFeatureConfigurationDto,
} from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
import { InternalStore } from '../utils/internal-store-utils';
@Injectable({
@ -15,7 +18,7 @@ export class ConfigStateService {
return this.store.sliceUpdate;
}
private updateSubject = new Subject();
private updateSubject = new Subject<void>();
constructor(private abpConfigService: AbpApplicationConfigurationService) {
this.initUpdateStream();
@ -147,8 +150,11 @@ export class ConfigStateService {
return this.store.sliceState(state => state.globalFeatures);
}
private isGlobalFeatureEnabled(key: string, globalFeatures: ApplicationGlobalFeatureConfigurationDto) {
const features = globalFeatures.enabledFeatures || []
private isGlobalFeatureEnabled(
key: string,
globalFeatures: ApplicationGlobalFeatureConfigurationDto,
) {
const features = globalFeatures.enabledFeatures || [];
return features.some(f => key === f);
}
@ -159,9 +165,6 @@ export class ConfigStateService {
getGlobalFeatureIsEnabled$(key: string) {
return this.store.sliceState(state => this.isGlobalFeatureEnabled(key, state.globalFeatures));
}
}
function splitKeys(keys: string[] | string): string[] {

2
npm/ng-packs/packages/core/src/lib/services/http-wait.service.ts

@ -24,7 +24,7 @@ export class HttpWaitService {
});
private delay: number;
private destroy$ = new Subject();
private destroy$ = new Subject<void>();
constructor(injector: Injector) {
this.delay = injector.get(LOADER_DELAY, 500);

2
npm/ng-packs/packages/core/src/lib/services/list.service.ts

@ -80,7 +80,7 @@ export class ListService<QueryParamsType = ABP.PageQueryParams | any> implements
private _isLoading$ = new BehaviorSubject(false);
private destroy$ = new Subject();
private destroy$ = new Subject<void>();
private delay: MonoTypeOperatorFunction<QueryParamsType>;

2
npm/ng-packs/packages/core/src/lib/services/router-wait.service.ts

@ -15,7 +15,7 @@ export interface RouterWaitState {
})
export class RouterWaitService {
private store = new InternalStore<RouterWaitState>({ loading: false });
private destroy$ = new Subject();
private destroy$ = new Subject<void>();
private delay: number;
constructor(private routerEvents: RouterEvents, injector: Injector) {
this.delay = injector.get(LOADER_DELAY, 500);

4
npm/ng-packs/packages/core/src/lib/tests/api.interceptor.spec.ts

@ -36,7 +36,7 @@ describe('ApiInterceptor', () => {
sessionState.getTenant.andReturn({ id: 'Volosoft', name: 'Volosoft' });
const request = new HttpRequest('GET', 'https://abp.io');
const handleRes$ = new Subject();
const handleRes$ = new Subject<void>();
const handler = {
handle: (req: HttpRequest<any>) => {
@ -59,7 +59,7 @@ describe('ApiInterceptor', () => {
const spyDeleteRequest = jest.spyOn(httpWaitService, 'deleteRequest');
const request = new HttpRequest('GET', 'https://abp.io');
const handleRes$ = new Subject();
const handleRes$ = new Subject<void>();
const handler = {
handle: (req: HttpRequest<any>) => {

2
npm/ng-packs/packages/core/src/lib/tests/routes.service.spec.ts

@ -4,7 +4,7 @@ import { RoutesService } from '../services';
import { DummyInjector } from './utils/common.utils';
import { mockPermissionService } from './utils/permission-service.spec.utils';
const updateStream$ = new Subject();
const updateStream$ = new Subject<void>();
export const mockRoutesService = (injectorPayload = {} as { [key: string]: any }) => {
const injector = new DummyInjector({

6
npm/ng-packs/packages/core/src/lib/validators/url.validator.ts

@ -1,5 +1,5 @@
import { AbstractControl, ValidatorFn } from '@angular/forms';
import { isNullOrUndefined } from '../utils';
import { isNullOrEmpty } from '../utils';
export interface UrlError {
url: true;
@ -7,11 +7,11 @@ export interface UrlError {
export function validateUrl(): ValidatorFn {
return (control: AbstractControl): UrlError | null => {
if (isNullOrUndefined(control.value)) return null;
if (isNullOrEmpty(control.value)) return null;
return isValidUrl(control.value) ? null : { url: true };
};
}
}
function isValidUrl(value: string): boolean {
if (/^http(s)?:\/\/[^/]/.test(value) || /^ftp:\/\/[^/]/.test(value)) {

2
npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts

@ -13,7 +13,7 @@ export class ConfirmationService {
private containerComponentRef!: ComponentRef<ConfirmationComponent>;
clear = (status: Confirmation.Status = Confirmation.Status.dismiss) => {
this.confirmation$.next();
this.confirmation$.next(null);
this.status$.next(status);
};

2
npm/ng-packs/packages/theme-shared/src/lib/tests/modal.component.spec.ts

@ -178,7 +178,7 @@ describe('ModalComponent', () => {
.pipe(
take(2),
delay(0),
reduce<Event[]>((acc, v) => acc.concat(v), []),
reduce<Event[]>((acc, v) => acc.concat(v)),
)
.subscribe(([event1, event2]) => {
expect(event1.returnValue).toBe(false);

Loading…
Cancel
Save