mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
Merge remote-tracking branch 'upstream/main' into created-metadata-service-for-metadata-operations_contribute-main
This commit is contained in:
@@ -5,25 +5,47 @@
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
import { select, Store } from '@ngrx/store';
|
||||
import { CheckAuthenticationTokenAction } from './core/auth/auth.actions';
|
||||
import { CorrelationIdService } from './correlation-id/correlation-id.service';
|
||||
import { APP_INITIALIZER, Inject, Provider, Type } from '@angular/core';
|
||||
import { makeStateKey, TransferState } from '@angular/platform-browser';
|
||||
import { APP_CONFIG, AppConfig } from '../config/app-config.interface';
|
||||
import {
|
||||
APP_INITIALIZER,
|
||||
Inject,
|
||||
Provider,
|
||||
Type,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
makeStateKey,
|
||||
TransferState,
|
||||
} from '@angular/platform-browser';
|
||||
import { DYNAMIC_FORM_CONTROL_MAP_FN } from '@ng-dynamic-forms/core';
|
||||
import {
|
||||
select,
|
||||
Store,
|
||||
} from '@ngrx/store';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import { Observable } from 'rxjs';
|
||||
import {
|
||||
distinctUntilChanged,
|
||||
find,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
import {
|
||||
APP_CONFIG,
|
||||
APP_DATA_SERVICES_MAP,
|
||||
AppConfig,
|
||||
} from '../config/app-config.interface';
|
||||
import { environment } from '../environments/environment';
|
||||
import { AppState } from './app.reducer';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { LocaleService } from './core/locale/locale.service';
|
||||
import { Angulartics2DSpace } from './statistics/angulartics/dspace-provider';
|
||||
import { HeadTagService } from './core/metadata/head-tag.service';
|
||||
import { BreadcrumbsService } from './breadcrumbs/breadcrumbs.service';
|
||||
import { ThemeService } from './shared/theme-support/theme.service';
|
||||
import { CheckAuthenticationTokenAction } from './core/auth/auth.actions';
|
||||
import { isAuthenticationBlocking } from './core/auth/selectors';
|
||||
import { distinctUntilChanged, find } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
import { LAZY_DATA_SERVICES } from './core/data-services-map';
|
||||
import { LocaleService } from './core/locale/locale.service';
|
||||
import { HeadTagService } from './core/metadata/head-tag.service';
|
||||
import { CorrelationIdService } from './correlation-id/correlation-id.service';
|
||||
import { dsDynamicFormControlMapFn } from './shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn';
|
||||
import { MenuService } from './shared/menu/menu.service';
|
||||
import { ThemeService } from './shared/theme-support/theme.service';
|
||||
import { Angulartics2DSpace } from './statistics/angulartics/dspace-provider';
|
||||
|
||||
/**
|
||||
* Performs the initialization of the app.
|
||||
@@ -68,7 +90,7 @@ export abstract class InitService {
|
||||
public static providers(): Provider[] {
|
||||
if (!InitService.isPrototypeOf(this)) {
|
||||
throw new Error(
|
||||
'Initalization providers should only be generated from concrete subclasses of InitService'
|
||||
'Initalization providers should only be generated from concrete subclasses of InitService',
|
||||
);
|
||||
}
|
||||
return [
|
||||
@@ -82,7 +104,7 @@ export abstract class InitService {
|
||||
this.resolveAppConfig(transferState);
|
||||
return environment;
|
||||
},
|
||||
deps: [ TransferState ]
|
||||
deps: [ TransferState ],
|
||||
},
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
@@ -90,6 +112,14 @@ export abstract class InitService {
|
||||
deps: [ InitService ],
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
provide: APP_DATA_SERVICES_MAP,
|
||||
useValue: LAZY_DATA_SERVICES,
|
||||
},
|
||||
{
|
||||
provide: DYNAMIC_FORM_CONTROL_MAP_FN,
|
||||
useValue: dsDynamicFormControlMapFn,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -103,7 +133,7 @@ export abstract class InitService {
|
||||
* @protected
|
||||
*/
|
||||
protected static resolveAppConfig(
|
||||
transferState: TransferState
|
||||
transferState: TransferState,
|
||||
): void {
|
||||
// overriden in subclasses if applicable
|
||||
}
|
||||
@@ -158,8 +188,8 @@ export abstract class InitService {
|
||||
// Load all the languages that are defined as active from the config file
|
||||
this.translate.addLangs(
|
||||
environment.languages
|
||||
.filter((LangConfig) => LangConfig.active === true)
|
||||
.map((a) => a.code)
|
||||
.filter((LangConfig) => LangConfig.active === true)
|
||||
.map((a) => a.code),
|
||||
);
|
||||
|
||||
// Load the default language from the config file
|
||||
@@ -198,7 +228,7 @@ export abstract class InitService {
|
||||
return this.store.pipe(
|
||||
select(isAuthenticationBlocking),
|
||||
distinctUntilChanged(),
|
||||
find((b: boolean) => b === false)
|
||||
find((b: boolean) => b === false),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user