diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index 6d7754b4b0..ec0746b964 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -73,7 +73,7 @@ import { provideRepositoryUrl, } from '@geonetwork-ui/api/repository' import { BrowserAnimationsModule } from '@angular/platform-browser/animations' -import { LOGIN_URL } from '@geonetwork-ui/api/repository/gn4' +import { LOGIN_URL, provideGn4 } from '@geonetwork-ui/api/repository/gn4' import { RecordRelatedRecordsComponent } from './record/record-related-records/record-related-records.component' import { RecordMetadataComponent } from './record/record-metadata/record-metadata.component' import { RecordOtherlinksComponent } from './record/record-otherlinks/record-otherlinks.component' @@ -148,6 +148,7 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : [] providers: [ importProvidersFrom(FeatureAuthModule), provideRepositoryUrl(() => getGlobalConfig().GN4_API_URL), + provideGn4(), { provide: RouterService, useClass: DatahubRouterService }, { provide: GN_UI_VERSION, useValue: environment.version }, { diff --git a/libs/api/repository/src/lib/gn4/gn4.provider.ts b/libs/api/repository/src/lib/gn4/gn4.provider.ts new file mode 100644 index 0000000000..96661cb9b1 --- /dev/null +++ b/libs/api/repository/src/lib/gn4/gn4.provider.ts @@ -0,0 +1,14 @@ +import { Provider } from '@angular/core' +import { PlatformServiceInterface } from '@geonetwork-ui/common/domain/platform.service.interface' +import { Gn4PlatformService } from './platform/gn4-platform.service' +import { Gn4PlatformMapper } from './platform/gn4-platform.mapper' + +export function provideGn4(): Provider[] { + return [ + { + provide: PlatformServiceInterface, + useClass: Gn4PlatformService, + }, + Gn4PlatformMapper, + ] +} diff --git a/libs/api/repository/src/lib/gn4/index.ts b/libs/api/repository/src/lib/gn4/index.ts index bfbbbd4fee..2e56374154 100644 --- a/libs/api/repository/src/lib/gn4/index.ts +++ b/libs/api/repository/src/lib/gn4/index.ts @@ -5,3 +5,4 @@ export * from './settings/gn4-settings.service' export * from './auth' export * from './favorites/favorites.service' export * from './selection/selection.service' +export * from './gn4.provider'