diff --git a/CHANGELOG.md b/CHANGELOG.md index f5f95cd15..050211b09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md). #### Minor - Uptime Kuma is no longer mandatory and the status dashboard can be disabled +- Added Owning Organization in Admin Connector Overview ([#355](https://github.com/sovity/authority-portal/issues/355)) #### Patch diff --git a/authority-portal-backend/authority-portal-api/src/main/java/de/sovity/authorityportal/api/model/ConnectorOverviewEntryDto.kt b/authority-portal-backend/authority-portal-api/src/main/java/de/sovity/authorityportal/api/model/ConnectorOverviewEntryDto.kt index 86192db6a..784d08aa6 100644 --- a/authority-portal-backend/authority-portal-api/src/main/java/de/sovity/authorityportal/api/model/ConnectorOverviewEntryDto.kt +++ b/authority-portal-backend/authority-portal-api/src/main/java/de/sovity/authorityportal/api/model/ConnectorOverviewEntryDto.kt @@ -19,6 +19,8 @@ import io.swagger.v3.oas.annotations.media.Schema data class ConnectorOverviewEntryDto( @field:Schema(description = "Connector ID", requiredMode = Schema.RequiredMode.REQUIRED) val id: String, + @field:Schema(description = "Organization Name", requiredMode = Schema.RequiredMode.REQUIRED) + val organizationName: String, @field:Schema(description = "Host Name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) val hostName: String?, @field:Schema(description = "Type", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/seeds/utils/DevUserId.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/seeds/utils/DevUserId.kt index 35d5a47d5..93b396951 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/seeds/utils/DevUserId.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/seeds/utils/DevUserId.kt @@ -22,6 +22,7 @@ import java.time.ZoneOffset */ fun dummyDevUserUuid(i: Int): String = "00000000-0000-0000-0000-${i.toString().padStart(12, '0')}" fun dummyDevOrganizationId(i: Int): String = "MDSL${i.toString().padStart(6, '0')}" +fun dummyDevOrganizationName(i: Int): String = "Organization $i" fun dummyDevConnectorId(orgId: Int, connectorId: Int) = "${dummyDevOrganizationId(orgId)}.${dummyDevConnectorIdComponent(connectorId)}" fun dummyDevConnectorIdComponent(i: Int): String = "CONN${i.toString().padStart(3, '0')}" diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/seeds/utils/ScenarioData.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/seeds/utils/ScenarioData.kt index bfe3e1be6..8f5b1c395 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/seeds/utils/ScenarioData.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/seeds/utils/ScenarioData.kt @@ -117,7 +117,7 @@ class ScenarioData { fun organization(orgId: Int, createdByUserId: Int, applyer: (OrganizationRecord) -> Unit = {}) { OrganizationRecord().also { it.id = dummyDevOrganizationId(orgId) - it.name = "Organization $orgId" + it.name = dummyDevOrganizationName(orgId) it.address = "Address" it.url = "https://url" it.createdBy = dummyDevUserUuid(createdByUserId) diff --git a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/connectormanagement/ConnectorManagementApiService.kt b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/connectormanagement/ConnectorManagementApiService.kt index d99dbb576..50d92670e 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/connectormanagement/ConnectorManagementApiService.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/main/kotlin/de/sovity/authorityportal/web/pages/connectormanagement/ConnectorManagementApiService.kt @@ -116,6 +116,7 @@ class ConnectorManagementApiService( val connectorDtos = connectors.map { ConnectorOverviewEntryDto( id = it.connectorId, + organizationName = orgNames[it.organizationId] ?: "", hostName = if (it.type == ConnectorType.CAAS) "sovity GmbH" else orgNames[it.providerOrganizationId] ?: "", type = it.type.toDto(), environment = deploymentEnvironmentDtoService.findByIdOrThrow(it.environment), diff --git a/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/connector/ConnectorManagementApiServiceTest.kt b/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/connector/ConnectorManagementApiServiceTest.kt index e9d38f8a3..05dac3750 100644 --- a/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/connector/ConnectorManagementApiServiceTest.kt +++ b/authority-portal-backend/authority-portal-quarkus/src/test/kotlin/de/sovity/authorityportal/web/tests/services/connector/ConnectorManagementApiServiceTest.kt @@ -27,6 +27,7 @@ import de.sovity.authorityportal.seeds.utils.ScenarioData import de.sovity.authorityportal.seeds.utils.ScenarioInstaller import de.sovity.authorityportal.seeds.utils.dummyDevConnectorId import de.sovity.authorityportal.seeds.utils.dummyDevOrganizationId +import de.sovity.authorityportal.seeds.utils.dummyDevOrganizationName import de.sovity.authorityportal.seeds.utils.dummyDevUserUuid import de.sovity.authorityportal.web.Roles import de.sovity.authorityportal.web.tests.loadTestResource @@ -439,9 +440,11 @@ class ConnectorManagementApiServiceTest { assertThat(result.connectors).hasSize(3) assertThat(result.connectors).noneMatch { it.id == dummyDevConnectorId(1, 3) } assertThat(result.connectors).noneMatch { it.environment.environmentId != "test" } - assertThat(result.connectors[0].id).isEqualTo(dummyDevConnectorId(0, 0)) - assertThat(result.connectors[1].id).isEqualTo(dummyDevConnectorId(0, 1)) - assertThat(result.connectors[2].id).isEqualTo(dummyDevConnectorId(0, 2)) + + result.connectors.forEachIndexed { i, connector -> + assertThat(connector.id).isEqualTo(dummyDevConnectorId(0, i)) + assertThat(connector.organizationName).isEqualTo(dummyDevOrganizationName(0)) + } } @Test diff --git a/authority-portal-frontend/src/app/core/api/fake-backend/impl/fake-connectors.ts b/authority-portal-frontend/src/app/core/api/fake-backend/impl/fake-connectors.ts index fc78bc803..baf0e9693 100644 --- a/authority-portal-frontend/src/app/core/api/fake-backend/impl/fake-connectors.ts +++ b/authority-portal-frontend/src/app/core/api/fake-backend/impl/fake-connectors.ts @@ -158,6 +158,7 @@ export const getListOfConnectorsForTable = ( ).map((c) => { return { id: c.connectorId, + organizationName: c.organizationName, hostOrganizationName: c.hostOrganizationName, type: c.type, environment: c.environment, @@ -195,6 +196,7 @@ export const getListOfOwnConnectorsForTable = (): ConnectorOverviewResult => { ).map((c) => { return { id: c.connectorId, + organizationName: c.organizationName, hostOrganizationName: c.hostOrganizationName, type: c.type, environment: c.environment, @@ -220,6 +222,7 @@ export const getListOfAllConnectorsForTable = (): ConnectorOverviewResult => { connectors: TEST_CONNECTORS.map((c) => { return { id: c.connectorId, + organizationName: c.organizationName, hostOrganizationName: c.hostOrganizationName, type: c.type, environment: c.environment, diff --git a/authority-portal-frontend/src/app/pages/authority-connector-list-page/authority-connector-list-page/authority-connector-list-page.component.html b/authority-portal-frontend/src/app/pages/authority-connector-list-page/authority-connector-list-page/authority-connector-list-page.component.html index a4eca59bb..ce318be28 100644 --- a/authority-portal-frontend/src/app/pages/authority-connector-list-page/authority-connector-list-page/authority-connector-list-page.component.html +++ b/authority-portal-frontend/src/app/pages/authority-connector-list-page/authority-connector-list-page/authority-connector-list-page.component.html @@ -14,11 +14,19 @@ scope="col"> Connector ID +