Skip to content

Commit

Permalink
feat: remove frontend url column from all connectors-view for authori…
Browse files Browse the repository at this point in the history
…ty - and operator admins (#398)
  • Loading branch information
PaddseL authored Dec 17, 2024
1 parent 6f75f02 commit e3a2f44
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md).
- 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))
- Added a button to change the password in the user settings ([PR #397](https://github.com/sovity/authority-portal/pull/397))
- Removed link to frontend URL in all-connectors-view for authority- and operator admins ([PR #398](https://github.com/sovity/authority-portal/pull/398))

#### Patch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ class ConnectorManagementApiService(
deploymentEnvironmentService.assertValidEnvId(environmentId)

val connectors = connectorService.getConnectorsByEnvironment(environmentId)
return buildConnectorOverview(connectors)
return buildConnectorOverview(connectors, showFrontendUrl = false)
}

private fun buildConnectorOverview(connectors: List<ConnectorRecord>): ConnectorOverviewResult {
private fun buildConnectorOverview(
connectors: List<ConnectorRecord>,
showFrontendUrl: Boolean = true
): ConnectorOverviewResult {
val orgNames = organizationService.getAllOrganizationNames()

val connectorDtos = connectors.map {
Expand All @@ -122,7 +125,7 @@ class ConnectorManagementApiService(
environment = deploymentEnvironmentDtoService.findByIdOrThrow(it.environment),
name = it.name,
status = if (it.type == ConnectorType.CAAS) it.caasStatus.toDto() else it.onlineStatus.toDto(),
frontendUrl = it.frontendUrl
frontendUrl = if (showFrontendUrl) it.frontendUrl else null
)
}
return ConnectorOverviewResult(connectorDtos)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class ConnectorManagementApiServiceTest {
assertThat(result.connectors).hasSize(2)
assertThat(result.connectors).noneMatch { it.environment.environmentId != "test" }
assertThat(result.connectors).noneMatch { it.id == dummyDevConnectorId(0, 2) }
assertThat(result.connectors).allMatch { it.frontendUrl == null }

assertThat(result.connectors[0].id).isEqualTo(dummyDevConnectorId(0, 0))
assertThat(result.connectors[1].id).isEqualTo(dummyDevConnectorId(0, 1))
Expand Down Expand Up @@ -191,6 +192,7 @@ class ConnectorManagementApiServiceTest {
assertThat(result.connectors).noneMatch { it.environment.environmentId != "other-environment" }
assertThat(result.connectors).noneMatch { it.id == dummyDevConnectorId(0, 0) }
assertThat(result.connectors).noneMatch { it.id == dummyDevConnectorId(0, 1) }
assertThat(result.connectors).allMatch { it.frontendUrl == null }

assertThat(result.connectors[0].id).isEqualTo(dummyDevConnectorId(0, 2))
assertThat(result.connectors[0].environment.environmentId).isEqualTo("other-environment")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@
scope="col">
Environment
</th>

<th
class="py-3.5 text-sm font-normal text-gray-700 text-left"
scope="col">
Frontend
</th>
</tr>
</thead>

Expand Down Expand Up @@ -95,19 +89,6 @@
<td class="py-8 text-sm whitespace-nowrap text-gray-700">
{{ connector.environment.title }}
</td>
<td class="text-sm whitespace-nowrap">
<a
*ngIf="connector.frontendUrl"
class="flex items-center justify-center group active:scale-[0.98] p-4"
target="_blank"
[href]="connector.frontendUrl"
(click)="frontendLinkClicked = true">
<mat-icon
class="!text-[16px] !mt-[9px] !text-gray-600 group-hover:!text-brand-500"
>open_in_new</mat-icon
>
</a>
</td>
</tr>
</tbody>
</ng-container>
Expand Down

0 comments on commit e3a2f44

Please sign in to comment.