Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove frontend url column from all connectors-view for authority- and operator admins #398

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading