Skip to content

Commit

Permalink
Merge branch 'main' into sso-login-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
muralibasani authored Jun 26, 2024
2 parents e46b539 + 25090b6 commit 308b94d
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 29 deletions.
4 changes: 2 additions & 2 deletions coral/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.0",
"remark-stringify": "^11.0.0",
"unified": "^11.0.4",
"unified": "^11.0.5",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down Expand Up @@ -99,7 +99,7 @@
"react-aria": "^3.33.1",
"react-test-renderer": "^18.3.1",
"rollup-plugin-visualizer": "^5.12.0",
"ts-jest": "^29.1.3",
"ts-jest": "^29.1.5",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"vite": "^4.5.3",
Expand Down
36 changes: 18 additions & 18 deletions coral/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions core/src/main/resources/static/js/envs.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,11 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {

$scope.addNewEnv = function() {

var defRepFactor = parseInt($scope.addNewEnv.defrepfctr,10)
var maxRepFactor = parseInt($scope.addNewEnv.maxrepfctr,10)
var defPartitions = parseInt($scope.addNewEnv.defparts,10)
var maxPartitions = parseInt($scope.addNewEnv.defmaxparts,10)

// Validation partitions
if($scope.addNewEnv.defparts.length<=0 || $scope.addNewEnv.defparts<=0)
{
Expand All @@ -713,7 +718,7 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
return;
}

if(isNaN($scope.addNewEnv.defparts)){
if(isNaN(defPartitions)){
$scope.alertnote = "Default partitions should be a valid number";
$scope.showAlertToast();
return;
Expand All @@ -726,13 +731,13 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
return;
}

if(isNaN($scope.addNewEnv.defmaxparts)){
if(isNaN(maxPartitions)){
$scope.alertnote = "Maximum partitions should be a valid number";
$scope.showAlertToast();
return;
}

if($scope.addNewEnv.defparts > $scope.addNewEnv.defmaxparts){
if(defPartitions > maxPartitions){
$scope.alertnote = "Default partitions should be less than Maximum partitions";
$scope.showAlertToast();
return;
Expand All @@ -747,26 +752,26 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
return;
}

if(isNaN($scope.addNewEnv.defrepfctr)){
if(isNaN(defRepFactor)){
$scope.alertnote = "Default replication factor should be a valid number";
$scope.showAlertToast();
return;
}

if($scope.addNewEnv.maxrepfctr.length<=0 || $scope.addNewEnv.maxrepfctr<=0)
if(defRepFactor<=0 || maxRepFactor<=0)
{
$scope.alertnote = "Maximum Replication factor should not be empty and should be greater than 0";
$scope.showAlertToast();
return;
}

if(isNaN($scope.addNewEnv.maxrepfctr)){
if(isNaN(maxRepFactor)){
$scope.alertnote = "Maximum Replication factor should be a valid number";
$scope.showAlertToast();
return;
}

if($scope.addNewEnv.defrepfctr > $scope.addNewEnv.maxrepfctr){
if(defRepFactor > maxRepFactor){
$scope.alertnote = "Default Replication factor should be less than Maximum Replication factor";
$scope.showAlertToast();
return;
Expand Down
14 changes: 14 additions & 0 deletions core/src/test/java/io/aiven/klaw/UtilMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,20 @@ public List<UserInfo> getUserInfoList(String username, String role) {
return userInfoList;
}

public List<UserInfo> getUserInfoList(int count, String usernamePrefix) {
List<UserInfo> userInfoList = new ArrayList<>();
for (int i = 0; i < count; i++) {
UserInfo userInfo = new UserInfo();
userInfo.setTeamId(i % 2);
userInfo.setSwitchAllowedTeamIds(Set.of((i + 1) % 2));
userInfo.setSwitchTeams(true);
userInfo.setUsername(usernamePrefix + i);
userInfoList.add(userInfo);
}

return userInfoList;
}

public List<UserInfoModelResponse> getUserInfoListModel(String username, String role) {
List<UserInfoModelResponse> userInfoList = new ArrayList<>();
UserInfoModelResponse userInfo = new UserInfoModelResponse();
Expand Down
Loading

0 comments on commit 308b94d

Please sign in to comment.