Skip to content

Commit

Permalink
Merge pull request #10102 from abpframework/remove-deprecated-code
Browse files Browse the repository at this point in the history
Angular UI: Removed all deprecated code
  • Loading branch information
muhammedaltug committed Sep 22, 2021
2 parents aac65e9 + 0e11eeb commit 75cafb2
Show file tree
Hide file tree
Showing 30 changed files with 21 additions and 1,140 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Injectable } from '@angular/core';
import { ToasterService } from '@abp/ng.theme.shared';
import {
AbpApplicationConfigurationService,
AbpTenantService,
ConfigStateService,
CurrentTenantDto,
SessionStateService,
} from '@abp/ng.core';
import { ToasterService } from '@abp/ng.theme.shared';
import { Injectable } from '@angular/core';
import { finalize } from 'rxjs/operators';

@Injectable()
Expand All @@ -24,7 +23,6 @@ export class TenantBoxService {
private tenantService: AbpTenantService,
private sessionState: SessionStateService,
private configState: ConfigStateService,
private appConfigService: AbpApplicationConfigurationService,
) {}

onSwitch() {
Expand Down Expand Up @@ -57,7 +55,7 @@ export class TenantBoxService {

private setTenant(tenant: CurrentTenantDto) {
this.sessionState.setTenant(tenant);
this.appConfigService.get().subscribe(res => this.configState.setState(res));
this.configState.refreshAppState();
}

private showError() {
Expand Down
5 changes: 1 addition & 4 deletions npm/ng-packs/packages/core/src/lib/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import { InitDirective } from './directives/init.directive';
import { PermissionDirective } from './directives/permission.directive';
import { ReplaceableTemplateDirective } from './directives/replaceable-template.directive';
import { StopPropagationDirective } from './directives/stop-propagation.directive';
import { VisibilityDirective } from './directives/visibility.directive';
import { OAuthConfigurationHandler } from './handlers/oauth-configuration.handler';
import { RoutesHandler } from './handlers/routes.handler';
import { ApiInterceptor } from './interceptors/api.interceptor';
import { LocalizationModule } from './localization.module';
import { ABP } from './models/common';
import { LocalizationPipe } from './pipes/localization.pipe';
import { SortPipe } from './pipes/sort.pipe';
import { CookieLanguageProvider } from './providers/cookie-language.provider';
import { LocaleProvider } from './providers/locale.provider';
import { LocalizationService } from './services/localization.service';
import { oAuthStorage } from './strategies/auth-flow.strategy';
Expand All @@ -32,7 +32,6 @@ import { TENANT_KEY } from './tokens/tenant-key.token';
import { noop } from './utils/common-utils';
import './utils/date-extensions';
import { getInitialData, localeInitializer } from './utils/initial-utils';
import { CookieLanguageProvider } from './providers/cookie-language.provider';

export function storageFactory(): OAuthStorage {
return oAuthStorage;
Expand Down Expand Up @@ -65,7 +64,6 @@ export function storageFactory(): OAuthStorage {
RouterOutletComponent,
SortPipe,
StopPropagationDirective,
VisibilityDirective,
],
imports: [
OAuthModule,
Expand All @@ -90,7 +88,6 @@ export function storageFactory(): OAuthStorage {
RouterOutletComponent,
SortPipe,
StopPropagationDirective,
VisibilityDirective,
],
providers: [LocalizationPipe],
entryComponents: [
Expand Down
1 change: 0 additions & 1 deletion npm/ng-packs/packages/core/src/lib/directives/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ export * from './init.directive';
export * from './permission.directive';
export * from './replaceable-template.directive';
export * from './stop-propagation.directive';
export * from './visibility.directive';
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,12 @@ export class PermissionDirective implements OnDestroy, OnChanges {
.getGrantedPolicy$(this.condition)
.pipe(distinctUntilChanged())
.subscribe(isGranted => {
if (this.templateRef) this.initStructural(isGranted);
else this.initAttribute(isGranted);

this.vcRef.clear();
if (isGranted) this.vcRef.createEmbeddedView(this.templateRef);
this.cdRef.detectChanges();
});
}

private initStructural(isGranted: boolean) {
this.vcRef.clear();

if (isGranted) this.vcRef.createEmbeddedView(this.templateRef);
}

/**
* @deprecated Will be deleted in v5.0
*/
private initAttribute(isGranted: boolean) {
if (!isGranted) {
this.renderer.removeChild(this.elRef.nativeElement.parentElement, this.elRef.nativeElement);
}
}

ngOnDestroy(): void {
if (this.subscription) this.subscription.unsubscribe();
}
Expand Down

This file was deleted.

117 changes: 0 additions & 117 deletions npm/ng-packs/packages/core/src/lib/models/application-configuration.ts

This file was deleted.

1 change: 0 additions & 1 deletion npm/ng-packs/packages/core/src/lib/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './application-configuration';
export * from './auth';
export * from './common';
export * from './dtos';
Expand Down
15 changes: 0 additions & 15 deletions npm/ng-packs/packages/core/src/lib/models/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,5 @@ export namespace Session {
export interface State {
language: string;
tenant: CurrentTenantDto;
/**
*
* @deprecated To be deleted in v5.0
*/
sessionDetail: SessionDetail;
}

/**
*
* @deprecated To be deleted in v5.0
*/
export interface SessionDetail {
openedTabCount: number;
lastExitTime: number;
remember: boolean;
}
}

This file was deleted.

7 changes: 0 additions & 7 deletions npm/ng-packs/packages/core/src/lib/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ export class AuthService {
return this.strategy.logout(queryParams);
}

/**
* @deprecated Use navigateToLogin method instead. To be deleted in v5.0
*/
initLogin() {
this.strategy.navigateToLogin();
}

navigateToLogin(queryParams?: Params) {
this.strategy.navigateToLogin(queryParams);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { map, take, switchMap } from 'rxjs/operators';
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 } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/models';
import { InternalStore } from '../utils/internal-store-utils';
import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service';

@Injectable({
providedIn: 'root',
Expand All @@ -24,15 +24,7 @@ export class ConfigStateService {
private initUpdateStream() {
this.updateSubject
.pipe(switchMap(() => this.abpConfigService.get()))
.subscribe(res => this.setState(res));
}

/**
* @deprecated do not use this method directly, instead call refreshAppState
* This method will be private in v5.0
*/
setState(state: ApplicationConfigurationDto) {
this.store.set(state);
.subscribe(res => this.store.set(res));
}

refreshAppState() {
Expand Down
1 change: 0 additions & 1 deletion npm/ng-packs/packages/core/src/lib/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './application-configuration.service';
export * from './auth.service';
export * from './config-state.service';
export * from './content-projection.service';
Expand Down

0 comments on commit 75cafb2

Please sign in to comment.