From 0306ec9688ffaf8b16ada88adab5a14d89eade4a Mon Sep 17 00:00:00 2001 From: Kamil Czaja <46053356+kamilczaja@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:18:18 +0200 Subject: [PATCH] feat: toggle logging house status (#261) --- CHANGELOG.md | 11 +++++++- .../api/model/DeploymentEnvironmentDto.kt | 4 +-- .../api/filtering/CatalogFilterService.kt | 20 +++++++++++-- .../authorityportal/web/UiResourceImpl.kt | 2 +- .../DeploymentEnvironmentConfiguration.kt | 3 +- .../DeploymentEnvironmentDtoService.kt | 10 +++---- .../CaasManagementApiService.kt | 12 ++++++-- .../thirdparty/uptimekuma/UptimeKumaClient.kt | 28 +++++++++---------- .../model/ComponentStatusOverview.kt | 4 +-- .../src/main/resources/application.properties | 6 ++-- .../tests/services/catalog/CatalogApiTest.kt | 5 ---- .../connector/CaasManagementApiServiceTest.kt | 7 +++-- authority-portal-frontend/.env.local-dev | 1 + authority-portal-frontend/.env.local-e2e-dev | 1 + .../app/core/services/config/app-config.ts | 3 ++ .../profiles/feature-sets/mds-features.ts | 1 + .../services/config/profiles/ui-feature.ts | 5 +++- .../choose-participant-caas.component.html | 9 +++++- .../choose-participant-caas.component.ts | 11 ++++++-- .../dashboard-page.component.html | 1 + .../organization-onboard-page.component.html | 4 ++- .../organization-rejected-page.component.html | 3 +- .../breadcrumb/breadcrumb.service.ts | 2 +- .../goals/production/README.md | 5 +++- 24 files changed, 108 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a75c29d66..df888dd2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md). - Fixed provider organization ID not showing up on CaaS connectors [#206](https://github.com/sovity/authority-portal/issues/206) - Keep in mind that sovity needs to be registered in the portal for the ID to show up. - Already registered connectors will be updated automatically, this process can take up to 24 hours +- Added a message when the CaaS request feature is not available +- Catalog: Removed dataspace filter when only one dataspace is known ### Known issues @@ -39,15 +41,22 @@ Environment variable changes: authority-portal.organization.id.prefix: "MDS" authority-portal.organization.id.length: "4" ``` +- New **mandatory** configuration variables: + - ```yaml + # Enables the client to connect to the CaaS service. If you weren't provided credentials for the feature by sovity, set this to false + quarkus.oidc-client.sovity.client-enabled: true + ``` #### Frontend Environment variable changes: -- New optional configuration variables - the values assigned here are the ones you should use to retain the current behavior: +- New **mandantory** configuration variables - the values assigned here are the ones you should use to retain the current behavior: - ```yaml # UI Branding profile AUTHORITY_PORTAL_FRONTEND_ACTIVE_PROFILE: mds-open-source # Short Dataspace name, used in some explanatory texts AUTHORITY_PORTAL_FRONTEND_DATASPACE_SHORT_NAME: MDS + # Portal name displayed in various texts + AUTHORITY_PORTAL_FRONTEND_PORTAL_DISPLAY_NAME: "MDS Portal" ``` #### Compatible Versions diff --git a/authority-portal-backend/authority-portal-api/src/main/java/de/sovity/authorityportal/api/model/DeploymentEnvironmentDto.kt b/authority-portal-backend/authority-portal-api/src/main/java/de/sovity/authorityportal/api/model/DeploymentEnvironmentDto.kt index f1ecf12b8..15bccbffc 100644 --- a/authority-portal-backend/authority-portal-api/src/main/java/de/sovity/authorityportal/api/model/DeploymentEnvironmentDto.kt +++ b/authority-portal-backend/authority-portal-api/src/main/java/de/sovity/authorityportal/api/model/DeploymentEnvironmentDto.kt @@ -25,6 +25,6 @@ data class DeploymentEnvironmentDto( val dapsTokenUrl: String, @field:Schema(description = "DAPS JWKS URL", requiredMode = Schema.RequiredMode.REQUIRED) val dapsJwksUrl: String, - @field:Schema(description = "Logging House URL", requiredMode = Schema.RequiredMode.REQUIRED) - val loggingHouseUrl: String, + @field:Schema(description = "Logging House URL", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + val loggingHouseUrl: String?, ) diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/broker/services/api/filtering/CatalogFilterService.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/broker/services/api/filtering/CatalogFilterService.kt index 67a4a9383..f7bcacc91 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/broker/services/api/filtering/CatalogFilterService.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/broker/services/api/filtering/CatalogFilterService.kt @@ -21,11 +21,16 @@ import de.sovity.authorityportal.broker.dao.pages.catalog.CatalogQueryFields import de.sovity.authorityportal.broker.dao.pages.catalog.models.CatalogQueryFilter import de.sovity.authorityportal.broker.dao.pages.catalog.models.CatalogQuerySelectedFilterQuery import de.sovity.authorityportal.broker.dao.utils.JsonDeserializationUtils.read2dStringList +import de.sovity.authorityportal.web.environment.CatalogDataspaceConfigService +import de.sovity.authorityportal.web.environment.DeploymentEnvironmentService import jakarta.enterprise.context.ApplicationScoped +import org.eclipse.microprofile.config.inject.ConfigProperty @ApplicationScoped class CatalogFilterService( - val catalogFilterAttributeDefinitionService: CatalogFilterAttributeDefinitionService + val catalogFilterAttributeDefinitionService: CatalogFilterAttributeDefinitionService, + val deploymentEnvironmentService: DeploymentEnvironmentService, + val catalogDataspaceConfigService: CatalogDataspaceConfigService ) { private val caseInsensitiveEmptyStringLast = Comparator { s1, s2 -> @@ -42,13 +47,13 @@ class CatalogFilterService( * * @return attribute definitions */ - get() = listOf( + get() = listOfNotNull( catalogFilterAttributeDefinitionService.forField( { fields: CatalogQueryFields -> fields.dataSourceAvailabilityLabel }, "dataSourceAvailability", "Data Offer Type" ), - catalogFilterAttributeDefinitionService.buildDataSpaceFilter(), + catalogFilterAttributeDefinitionService.buildDataSpaceFilter().takeIf { this.shouldSupportMultipleDataspaces() }, catalogFilterAttributeDefinitionService.forField( { fields: CatalogQueryFields -> fields.dataOfferTable.DATA_CATEGORY }, "dataCategory", @@ -166,4 +171,13 @@ class CatalogFilterService( .filter { it.selectedIds.isNotEmpty() } .associate { it.id to it.selectedIds } } + + private fun shouldSupportMultipleDataspaces(): Boolean { + deploymentEnvironmentService.findAll().forEach { + if (catalogDataspaceConfigService.forEnvironment(it.key).namesByConnectorId.isNotEmpty()) { + return true + } + } + return false + } } diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/UiResourceImpl.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/UiResourceImpl.kt index 2115d90d1..5f79782a6 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/UiResourceImpl.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/UiResourceImpl.kt @@ -394,7 +394,7 @@ class UiResourceImpl( override fun checkFreeCaasUsage(environmentId: String): CaasAvailabilityResponse { authUtils.requiresRole(Roles.UserRoles.PARTICIPANT_CURATOR) authUtils.requiresMemberOfAnyOrganization() - return caasManagementApiService.getFreeCaasUsageForOrganization(loggedInUser.organizationId!!, environmentId) + return caasManagementApiService.getCaasAvailabilityForOrganization(loggedInUser.organizationId!!, environmentId) } @Transactional diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/environment/DeploymentEnvironmentConfiguration.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/environment/DeploymentEnvironmentConfiguration.kt index 8d3e541e8..54ec8ce4f 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/environment/DeploymentEnvironmentConfiguration.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/environment/DeploymentEnvironmentConfiguration.kt @@ -15,6 +15,7 @@ package de.sovity.authorityportal.web.environment import io.smallrye.config.ConfigMapping import java.time.Duration +import java.util.Optional @ConfigMapping(prefix = "authority-portal.deployment") interface DeploymentEnvironmentConfiguration { @@ -25,7 +26,7 @@ interface DeploymentEnvironmentConfiguration { fun position(): Int fun daps(): DapsConfig fun dataCatalog(): DataCatalogConfig - fun loggingHouse(): LoggingHouseConfig + fun loggingHouse(): Optional interface DapsConfig { fun url(): String diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/environment/DeploymentEnvironmentDtoService.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/environment/DeploymentEnvironmentDtoService.kt index 2844a51cf..b20c78795 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/environment/DeploymentEnvironmentDtoService.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/environment/DeploymentEnvironmentDtoService.kt @@ -18,12 +18,12 @@ import de.sovity.authorityportal.web.environment.DeploymentEnvironmentConfigurat import de.sovity.authorityportal.web.environment.DeploymentEnvironmentConfiguration.DeploymentEnvironment.DapsConfig import jakarta.enterprise.context.ApplicationScoped import jakarta.inject.Inject +import kotlin.jvm.optionals.getOrNull @ApplicationScoped -class DeploymentEnvironmentDtoService { - - @Inject - lateinit var deploymentEnvironmentService: DeploymentEnvironmentService +class DeploymentEnvironmentDtoService( + val deploymentEnvironmentService: DeploymentEnvironmentService +) { fun findByIdOrThrow(envId: String): DeploymentEnvironmentDto = buildDto(envId, deploymentEnvironmentService.findByIdOrThrow(envId)) @@ -41,7 +41,7 @@ class DeploymentEnvironmentDtoService { title = deploymentEnvironment.title(), dapsJwksUrl = buildDapsJwksUrl(deploymentEnvironment.daps()), dapsTokenUrl = buildDapsTokenUrl(deploymentEnvironment.daps()), - loggingHouseUrl = deploymentEnvironment.loggingHouse().url() + loggingHouseUrl = deploymentEnvironment.loggingHouse().getOrNull()?.url() ) } diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/connectormanagement/CaasManagementApiService.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/connectormanagement/CaasManagementApiService.kt index 08c0d9c90..121fb6936 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/connectormanagement/CaasManagementApiService.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/connectormanagement/CaasManagementApiService.kt @@ -32,6 +32,7 @@ import de.sovity.authorityportal.web.utils.idmanagement.DataspaceComponentIdUtil import io.quarkus.logging.Log import jakarta.enterprise.context.ApplicationScoped import org.eclipse.microprofile.config.inject.ConfigProperty +import kotlin.jvm.optionals.getOrNull @ApplicationScoped class CaasManagementApiService( @@ -43,7 +44,8 @@ class CaasManagementApiService( val clientIdUtils: ClientIdUtils, val userService: UserService, val timeUtils: TimeUtils, - @ConfigProperty(name = "authority-portal.caas.sovity.limit-per-organization") val caasLimitPerOrganizationId: String + @ConfigProperty(name = "authority-portal.caas.sovity.limit-per-organization") val caasLimitPerOrganizationId: String, + @ConfigProperty(name = "quarkus.oidc-client.sovity.client-enabled") val isCaasClientEnabled: Boolean ) { fun createCaas( @@ -89,7 +91,11 @@ class CaasManagementApiService( return CreateConnectorResponse.ok(connectorId, timeUtils.now()) } - fun getFreeCaasUsageForOrganization(organizationId: String, environmentId: String): CaasAvailabilityResponse { + fun getCaasAvailabilityForOrganization(organizationId: String, environmentId: String): CaasAvailabilityResponse { + if (!isCaasClientEnabled) { + return CaasAvailabilityResponse(0, 0) + } + val caasLimit = caasLimitPerOrganizationId.toInt() val caasCount = connectorService.getCaasCountByOrganizationIdAndEnvironment(organizationId, environmentId) @@ -130,7 +136,7 @@ class CaasManagementApiService( connectorDescription = caasRequest.connectorDescription.trim(), participantOrganizationUrl = curatorOrganization.url, participantOrganizationLegalName = curatorOrganization.name, - clearingHouseUrl = deploymentEnvironmentService.findByIdOrThrow(environmentId).loggingHouse().url(), + clearingHouseUrl = deploymentEnvironmentService.findByIdOrThrow(environmentId).loggingHouse().getOrNull()?.url(), brokerUrl = "https://this-field-is-deprecated", dapsTokenUrl = buildDapsTokenUrl(environmentId), dapsJwksUrl = buildDapsJwksUrl(environmentId), diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/thirdparty/uptimekuma/UptimeKumaClient.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/thirdparty/uptimekuma/UptimeKumaClient.kt index 5770555af..98d4636db 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/thirdparty/uptimekuma/UptimeKumaClient.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/thirdparty/uptimekuma/UptimeKumaClient.kt @@ -19,22 +19,16 @@ import de.sovity.authorityportal.web.thirdparty.uptimekuma.model.ComponentStatus import de.sovity.authorityportal.web.thirdparty.uptimekuma.model.ComponentStatusOverview import io.quarkus.logging.Log import jakarta.enterprise.context.ApplicationScoped -import jakarta.inject.Inject import org.eclipse.microprofile.config.inject.ConfigProperty import java.util.Base64 +import kotlin.jvm.optionals.getOrNull @ApplicationScoped -class UptimeKumaClient { - - @Inject - lateinit var deploymentEnvironmentService: DeploymentEnvironmentService - - @Inject - lateinit var uptimeKumaClientResource: UptimeKumaClientResource - - @ConfigProperty(name = "authority-portal.kuma.api-key") - lateinit var uptimeKumaApiKey: String - +class UptimeKumaClient( + val deploymentEnvironmentService: DeploymentEnvironmentService, + val uptimeKumaClientResource: UptimeKumaClientResource, + @ConfigProperty(name = "authority-portal.kuma.api-key") val uptimeKumaApiKey: String, +) { fun getStatusByEnvironments(): Map { val basicAuthHeader = Base64.getEncoder().encodeToString(":$uptimeKumaApiKey".toByteArray()) @@ -44,11 +38,17 @@ class UptimeKumaClient { return environments.mapValues { getComponentStatusOverview(response, it.value) } } - private fun getComponentStatusOverview(response: String, envConfig: DeploymentEnvironment): ComponentStatusOverview = + private fun getComponentStatusOverview( + response: String, + envConfig: DeploymentEnvironment + ): ComponentStatusOverview = ComponentStatusOverview().also { it.daps = getComponentStatus(envConfig.daps().kumaName(), response) - it.loggingHouse = getComponentStatus(envConfig.loggingHouse().kumaName(), response) it.catalogCrawler = getComponentStatus(envConfig.dataCatalog().kumaName(), response) + it.loggingHouse = getComponentStatus( + envConfig.loggingHouse().get().kumaName(), + response + ).takeUnless { envConfig.loggingHouse().getOrNull()?.kumaName().isNullOrBlank() } } private fun getComponentStatus(componentName: String, response: String): ComponentStatus { diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/thirdparty/uptimekuma/model/ComponentStatusOverview.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/thirdparty/uptimekuma/model/ComponentStatusOverview.kt index c186c79da..032810343 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/thirdparty/uptimekuma/model/ComponentStatusOverview.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/thirdparty/uptimekuma/model/ComponentStatusOverview.kt @@ -19,8 +19,8 @@ import io.swagger.v3.oas.annotations.media.Schema class ComponentStatusOverview { @Schema(description = "DAPS status", requiredMode = Schema.RequiredMode.REQUIRED) var daps: ComponentStatus? = null - @Schema(description = "Logging House status", requiredMode = Schema.RequiredMode.REQUIRED) - var loggingHouse: ComponentStatus? = null @Schema(description = "Catalog crawler (Broker) status", requiredMode = Schema.RequiredMode.REQUIRED) var catalogCrawler: ComponentStatus? = null + @Schema(description = "Logging House status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + var loggingHouse: ComponentStatus? = null } diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/resources/application.properties b/authority-portal-backend/authority-portal-quarkus/src/main/resources/application.properties index fdf1611c1..470688e82 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/resources/application.properties +++ b/authority-portal-backend/authority-portal-quarkus/src/main/resources/application.properties @@ -94,6 +94,9 @@ quarkus.oidc-client.sovity.early-tokens-acquisition=false %test.quarkus.oidc-client.sovity.credentials.secret=secret %test.quarkus.oidc-client.sovity.client-enabled=false +# Defaults so that the AP can actually start without the Customer Portal +quarkus.oidc-client.sovity.client-enabled=false + # Authority Portal Configuration %dev.authority-portal.base-url=https://localhost:4200 %dev.authority-portal.config.api-key=secret @@ -137,8 +140,7 @@ quarkus.oidc-client.sovity.early-tokens-acquisition=false %dev.authority-portal.deployment.environments.dev.daps.client-id=client %dev.authority-portal.deployment.environments.dev.daps.client-secret=secret %dev.authority-portal.deployment.environments.dev.daps.kuma-name="DEV mds daps" -%dev.authority-portal.deployment.environments.dev.logging-house.url=https://url -%dev.authority-portal.deployment.environments.dev.logging-house.kuma-name="DEV mds logging-house" +%dev.authority-portal.deployment.environments.dev.data-catalog.dataspace-names.connector-ids.\"MDSL1234XX.C1234XX\"="Mobilithek" # Test properties %test.authority-portal.deployment.environments.test.title=Test Environment diff --git a/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/catalog/CatalogApiTest.kt b/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/catalog/CatalogApiTest.kt index 4df3b1aa7..713df0128 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/catalog/CatalogApiTest.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/catalog/CatalogApiTest.kt @@ -367,7 +367,6 @@ class CatalogApiTest { // assert assertThat(result.availableFilters.fields).allSatisfy { it.id in setOf( - "dataSpace", "dataCategory", "dataSubcategory", "dataModel", @@ -382,7 +381,6 @@ class CatalogApiTest { assertThat(result.availableFilters.fields).allSatisfy { it.title in setOf( - "Data Space", "Data Category", "Data Subcategory", "Data Model", @@ -395,9 +393,6 @@ class CatalogApiTest { ) } - val dataSpace = getAvailableFilter(result, "dataSpace") - assertThat(dataSpace.values).allSatisfy { it.id in setOf("MDS") } - val dataCategory = getAvailableFilter(result, "dataCategory") assertThat(dataCategory.values).allSatisfy { it.id in setOf("Data Category 1") } diff --git a/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/connector/CaasManagementApiServiceTest.kt b/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/connector/CaasManagementApiServiceTest.kt index c0acc3c48..cadf3d58b 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/connector/CaasManagementApiServiceTest.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/connector/CaasManagementApiServiceTest.kt @@ -162,7 +162,10 @@ class CaasManagementApiServiceTest { // assert assertThat(result).isNotNull - assertThat(result.limit).isEqualTo(1) - assertThat(result.current).isEqualTo(1) + + // This will always return 0/0 because the function checks if the OIDC Client is enabled. + // Unfortunately, the OIDC Client is not enabled in the test environment because Quarkus would refuse to start. + assertThat(result.limit).isEqualTo(0) + assertThat(result.current).isEqualTo(0) } } diff --git a/authority-portal-frontend/.env.local-dev b/authority-portal-frontend/.env.local-dev index ca21b0e73..054d23e2e 100644 --- a/authority-portal-frontend/.env.local-dev +++ b/authority-portal-frontend/.env.local-dev @@ -11,3 +11,4 @@ AUTHORITY_PORTAL_FRONTEND_LEGAL_NOTICE_URL=https://legal-notice-url AUTHORITY_PORTAL_FRONTEND_SUPPORT_URL=https://support-url AUTHORITY_PORTAL_FRONTEND_ACTIVE_PROFILE=sovity-open-source AUTHORITY_PORTAL_FRONTEND_DATASPACE_SHORT_NAME=sovity Dataspace +AUTHORITY_PORTAL_FRONTEND_PORTAL_DISPLAY_NAME=Authority Portal diff --git a/authority-portal-frontend/.env.local-e2e-dev b/authority-portal-frontend/.env.local-e2e-dev index 6608a813d..62d9d13a0 100644 --- a/authority-portal-frontend/.env.local-e2e-dev +++ b/authority-portal-frontend/.env.local-e2e-dev @@ -11,3 +11,4 @@ AUTHORITY_PORTAL_FRONTEND_LEGAL_NOTICE_URL=https://mobility-dataspace.eu/legal-n AUTHORITY_PORTAL_FRONTEND_SUPPORT_URL=https://support.mobility-dataspace.eu AUTHORITY_PORTAL_FRONTEND_ACTIVE_PROFILE=sovity-open-source AUTHORITY_PORTAL_FRONTEND_BRAND_SHORT_NAME=sovity +AUTHORITY_PORTAL_FRONTEND_PORTAL_DISPLAY_NAME=Authority Portal diff --git a/authority-portal-frontend/src/app/core/services/config/app-config.ts b/authority-portal-frontend/src/app/core/services/config/app-config.ts index aab249a23..8f67225f0 100644 --- a/authority-portal-frontend/src/app/core/services/config/app-config.ts +++ b/authority-portal-frontend/src/app/core/services/config/app-config.ts @@ -56,6 +56,7 @@ export interface AppConfig { useFakeBackend: boolean; useLocalBackend: boolean; brandDataspaceName: string; + portalName: string; } /** @@ -76,6 +77,7 @@ export interface AppConfigEnv { AUTHORITY_PORTAL_FRONTEND_SUPPORT_URL: string; AUTHORITY_PORTAL_FRONTEND_ACTIVE_PROFILE: string; AUTHORITY_PORTAL_FRONTEND_DATASPACE_SHORT_NAME: string; + AUTHORITY_PORTAL_FRONTEND_PORTAL_DISPLAY_NAME: string; } /** @@ -106,5 +108,6 @@ export function buildAppConfig(envVars: AppConfigEnv): AppConfig { legalNoticeUrl: envVars.AUTHORITY_PORTAL_FRONTEND_LEGAL_NOTICE_URL, supportUrl: envVars.AUTHORITY_PORTAL_FRONTEND_SUPPORT_URL, brandDataspaceName: envVars.AUTHORITY_PORTAL_FRONTEND_DATASPACE_SHORT_NAME, + portalName: envVars.AUTHORITY_PORTAL_FRONTEND_PORTAL_DISPLAY_NAME, }; } diff --git a/authority-portal-frontend/src/app/core/services/config/profiles/feature-sets/mds-features.ts b/authority-portal-frontend/src/app/core/services/config/profiles/feature-sets/mds-features.ts index 8931a8556..f33c4af8a 100644 --- a/authority-portal-frontend/src/app/core/services/config/profiles/feature-sets/mds-features.ts +++ b/authority-portal-frontend/src/app/core/services/config/profiles/feature-sets/mds-features.ts @@ -17,4 +17,5 @@ export const MDS_FEATURES: UiFeature[] = [ 'catalogue', 'iframe-in-home', 'enable-home', + 'uses-logging-house', ]; diff --git a/authority-portal-frontend/src/app/core/services/config/profiles/ui-feature.ts b/authority-portal-frontend/src/app/core/services/config/profiles/ui-feature.ts index e80ed9ce3..676a2cfeb 100644 --- a/authority-portal-frontend/src/app/core/services/config/profiles/ui-feature.ts +++ b/authority-portal-frontend/src/app/core/services/config/profiles/ui-feature.ts @@ -25,4 +25,7 @@ export type UiFeature = | 'catalogue' // Enables the 'Powered by sovity' footer to be used in instances hosted by sovity - | 'powered-by-sovity'; + | 'powered-by-sovity' + + // Enables the Dashboard to display the Logging House status + | 'uses-logging-house'; diff --git a/authority-portal-frontend/src/app/pages/choose-participant-caas/choose-participant-caas/choose-participant-caas.component.html b/authority-portal-frontend/src/app/pages/choose-participant-caas/choose-participant-caas/choose-participant-caas.component.html index 9bda52e3f..218c817a6 100644 --- a/authority-portal-frontend/src/app/pages/choose-participant-caas/choose-participant-caas/choose-participant-caas.component.html +++ b/authority-portal-frontend/src/app/pages/choose-participant-caas/choose-participant-caas/choose-participant-caas.component.html @@ -15,11 +15,18 @@

Request a Connector-as-a-Service

-

+

As {{ inferArticle(this.appConfig.brandDataspaceName) }} {{ this.appConfig.brandDataspaceName }} member, you have the option to request {{ this.sponsoredCaasAmount }} free CaaS per environment.

+ +

+ Your dataspace authority has not configured this feature yet. Contact + sovity to purchase an individual + CaaS subscription. +

+
diff --git a/authority-portal-frontend/src/app/pages/choose-participant-caas/choose-participant-caas/choose-participant-caas.component.ts b/authority-portal-frontend/src/app/pages/choose-participant-caas/choose-participant-caas/choose-participant-caas.component.ts index 3ad13a5ab..46418cbfb 100644 --- a/authority-portal-frontend/src/app/pages/choose-participant-caas/choose-participant-caas/choose-participant-caas.component.ts +++ b/authority-portal-frontend/src/app/pages/choose-participant-caas/choose-participant-caas/choose-participant-caas.component.ts @@ -84,12 +84,17 @@ export class ChooseParticipantCaasComponent implements OnInit, OnDestroy { this.sponsoredCaasAmount = x.limit; const isLimitReached = x.current >= x.limit; + const isUnconfigured = x.limit == 0; this.selectionBox.action = { - label: `Request CaaS (${x.current}/${x.limit})`, + label: isUnconfigured + ? 'Unavailable' + : `Request CaaS (${x.current}/${x.limit})`, url: 'my-organization/connectors/new/provided', - isDisabled: isLimitReached, - hint: isLimitReached + isDisabled: isLimitReached || isUnconfigured, + hint: isUnconfigured + ? 'Your dataspace authority has not configured this feature' + : isLimitReached ? 'The existing CaaS connector needs to be removed before requesting a new one' : '', }; diff --git a/authority-portal-frontend/src/app/pages/dashboard-page/dashboard-page/dashboard-page.component.html b/authority-portal-frontend/src/app/pages/dashboard-page/dashboard-page/dashboard-page.component.html index a29498b73..fef396120 100644 --- a/authority-portal-frontend/src/app/pages/dashboard-page/dashboard-page/dashboard-page.component.html +++ b/authority-portal-frontend/src/app/pages/dashboard-page/dashboard-page/dashboard-page.component.html @@ -7,6 +7,7 @@ label="DAPS" [data]="dapsData"> {{ ('mds-id' | isActiveFeature) ? 'Thank you for onboarding on the MDS Portal!' - : 'Thank you for onboarding on our Portal!' + : 'Thank you for onboarding on the ' + + appConfig.portalName + + '!' }}

diff --git a/authority-portal-frontend/src/app/pages/registration-pages/organization-rejected-page/organization-rejected-page/organization-rejected-page.component.html b/authority-portal-frontend/src/app/pages/registration-pages/organization-rejected-page/organization-rejected-page/organization-rejected-page.component.html index 6c449f88c..7ee8598f9 100644 --- a/authority-portal-frontend/src/app/pages/registration-pages/organization-rejected-page/organization-rejected-page/organization-rejected-page.component.html +++ b/authority-portal-frontend/src/app/pages/registration-pages/organization-rejected-page/organization-rejected-page/organization-rejected-page.component.html @@ -37,7 +37,8 @@

Thank you for signing up!

Our team has thoroughly reviewed your profile, but unfortunately, we are currently unable to grant you access to the - Portal. Please note that access to the Portal is exclusive to + Portal. Please note that access to the {{ appConfig.portalName }} is + exclusive to {{ appConfig.brandDataspaceName }} members.

diff --git a/authority-portal-frontend/src/app/shared/common/portal-layout/breadcrumb/breadcrumb.service.ts b/authority-portal-frontend/src/app/shared/common/portal-layout/breadcrumb/breadcrumb.service.ts index 03a7f3871..2e2250bb6 100644 --- a/authority-portal-frontend/src/app/shared/common/portal-layout/breadcrumb/breadcrumb.service.ts +++ b/authority-portal-frontend/src/app/shared/common/portal-layout/breadcrumb/breadcrumb.service.ts @@ -44,7 +44,7 @@ export class BreadcrumbService { document.title = `${ this.activeFeatureSet.usesMdsId() ? 'MDS ' - : breadcrumb[breadcrumb.length - 1].label || 'Portal' + : breadcrumb[breadcrumb.length - 1].label || 'Authority Portal' }`; this.breadcrumb$.next(breadcrumb); }, diff --git a/docs/deployment-guide/goals/production/README.md b/docs/deployment-guide/goals/production/README.md index 83ab1818c..3fb3cef1e 100644 --- a/docs/deployment-guide/goals/production/README.md +++ b/docs/deployment-guide/goals/production/README.md @@ -197,6 +197,8 @@ quarkus.oidc-client.sovity.client-id: "[CAAS_CLIENT_ID]" quarkus.oidc-client.sovity.credentials.secret: "[CAAS_CLIENT_SECRET]" # Amount of free sovity CaaS per participant authority-portal.caas.sovity.limit-per-organization: "1" +# Enables the connection (set to false if you don't have the data to fill out the variables above) +quarkus.oidc-client.sovity.client-enabled: true # Must equal the root URL/home URl from the Keycloak configuration - see above) authority-portal.base-url: "https://[AP_FQDN]" @@ -236,7 +238,7 @@ authority-portal.deployment.environments.test.data-catalog.kuma-name: broker # Required: Default Dataspace name authority-portal.deployment.environments.test.data-catalog.dataspace-names.default: "MDS" # Optional: Additional connectors to be given a dataspace name -authority-portal.deployment.environments.test.data-catalog.dataspace-names.connectorIds."MDSL1234XX.C1234XX": "Mobilithek" +authority-portal.deployment.environments.test.data-catalog.dataspace-names.connector-ids."MDSL1234XX.C1234XX": "Mobilithek" # Environment DAPS # Env: DAPS URL @@ -293,6 +295,7 @@ AUTHORITY_PORTAL_FRONTEND_PRIVACY_POLICY_URL: https://mobility-dataspace.online/ AUTHORITY_PORTAL_FRONTEND_SUPPORT_URL: https://support.mobility-dataspace.eu # Support page URL AUTHORITY_PORTAL_FRONTEND_ACTIVE_PROFILE: mds-open-source # UI Branding profile AUTHORITY_PORTAL_FRONTEND_DATASPACE_SHORT_NAME: MDS # Short Dataspace name, used in some explanatory texts +AUTHORITY_PORTAL_FRONTEND_PORTAL_DISPLAY_NAME: "MDS Portal" # Portal name displayed in various texts ``` ### Data Catalog Crawlers