Skip to content

Commit

Permalink
fix(angular-ui): New enums for kafkaFlavor and clusterType break exis…
Browse files Browse the repository at this point in the history
…ting UI (#2326)

* Add string instead of ENUM to cluster page.
* Add string instead of ENUM to cluster modify page.

---------

Signed-off-by: Mirjam Aulbach <[email protected]>
  • Loading branch information
programmiri authored Feb 27, 2024
1 parent e4b4e4c commit b95e496
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
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

0 comments on commit b95e496

Please sign in to comment.