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

fix(angular-ui): New enums for kafkaFlavor and clusterType break existing UI #2326

Merged
merged 2 commits into from
Feb 27, 2024
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
9 changes: 9 additions & 0 deletions core/src/main/resources/static/js/envs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// edit
// solution for transaction
// message store / key / gui

var app = angular.module('envsApp',[]);

app.directive('onReadFile', function ($parse) {
Expand Down Expand Up @@ -32,6 +33,14 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {

$scope.kafkaClusters = [ { label: 'Non-Aiven', value: 'nonaiven' }, { label: 'Aiven', value: 'aiven' } ];

$scope.kafkaFlavorToString = {
APACHE_KAFKA: "Apache Kafka",
AIVEN_FOR_APACHE_KAFKA: "Aiven for Apache Kafka",
CONFLUENT: "Confluent",
CONFLUENT_CLOUD: "Confluent Cloud",
OTHERS: "others",
};

// Set http service defaults
// We force the "Accept" header to be only "application/json"
// otherwise we risk the Accept header being set by default to:
Expand Down
10 changes: 9 additions & 1 deletion core/src/main/resources/static/js/modifyEnvs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
var app = angular.module('modifyEnvsApp',[]);

app.controller("modifyEnvsCtrl", function($scope, $http, $location, $window) {


$scope.kafkaFlavorToString = {
APACHE_KAFKA: "Apache Kafka",
AIVEN_FOR_APACHE_KAFKA: "Aiven for Apache Kafka",
CONFLUENT: "Confluent",
CONFLUENT_CLOUD: "Confluent Cloud",
OTHERS: "others",
};

// Set http service defaults
// We force the "Accept" header to be only "application/json"
// otherwise we risk the Accept header being set by default to:
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/resources/templates/clusters.html
Original file line number Diff line number Diff line change
Expand Up @@ -518,16 +518,16 @@ <h4 class="mb-3">Shortcuts</h4>
<td> {{ allenv.protocol}} </td>

<td ng-show="allenv.clusterType == 'KAFKA'" >
<span class="badge badge-success">{{ allenv.clusterType }}</span></td>
<span class="badge badge-success">Kafka</span></td>

<td ng-show="allenv.clusterType == 'SCHEMA_REGISTRY'" >
<span class="badge badge-info">{{ allenv.clusterType }}</span></td>
<span class="badge badge-info">Schema Registry</span></td>

<td ng-show="allenv.clusterType == 'KAFKA_CONNECT'" >
<span class="badge badge-warning">{{ allenv.clusterType }}</span></td>
<span class="badge badge-warning">Kafka Connect</span></td>


<td>{{ allenv.kafkaFlavor }}</td>
<td>{{ kafkaFlavorToString[allenv.kafkaFlavor] }}</td>

<td>{{ allenv.associatedServers }}</td>

Expand Down
12 changes: 6 additions & 6 deletions core/src/main/resources/templates/modifyCluster.html
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ <h4 class="mb-3">Shortcuts</h4>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label">Kafka Flavor : </label>
<label><span class="badge badge-info">{{ clusterDetails.kafkaFlavor }}</span> </label>
<label class="control-label">Kafka Flavor: </label>
<label><span class="badge badge-info">{{ kafkaFlavorToString[clusterDetails.kafkaFlavor] }}</span> </label>
</div>
</div>
</div>
Expand Down Expand Up @@ -636,8 +636,8 @@ <h4 class="mb-3">Shortcuts</h4>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label">Kafka Flavor : </label>
<label><span class="badge badge-info">{{ clusterDetails.kafkaFlavor }}</span> </label>
<label class="control-label">Kafka Flavor: </label>
<label><span class="badge badge-info">{{ kafkaFlavorToString[clusterDetails.kafkaFlavor] }}</span> </label>
</div>
</div>
</div>
Expand Down Expand Up @@ -712,8 +712,8 @@ <h4 class="mb-3">Shortcuts</h4>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label">Kafka Flavor : </label>
<label><span class="badge badge-info">{{ clusterDetails.kafkaFlavor }}</span> </label>
<label class="control-label">Kafka Flavor: </label>
<label><span class="badge badge-info">{{ kafkaFlavorToString[clusterDetails.kafkaFlavor] }}</span> </label>
</div>
</div>
</div>
Expand Down