diff --git a/app/index.html b/app/index.html index a9fcfdb50f..c1dac98967 100644 --- a/app/index.html +++ b/app/index.html @@ -312,7 +312,7 @@

JavaScript Required

- + diff --git a/app/scripts/directives/createSecret.js b/app/scripts/directives/createSecret.js index 8c4053006a..b442387151 100644 --- a/app/scripts/directives/createSecret.js +++ b/app/scripts/directives/createSecret.js @@ -70,6 +70,15 @@ angular.module("openshiftConsole") label: "Webhook Secret" } ] + }, + generic: { + label: "Generic Secret", + authTypes: [ + { + id: "Opaque", + label: "Generic Secret" + } + ] } }; @@ -95,7 +104,11 @@ angular.module("openshiftConsole") $scope.newSecret = { type: "source", authType: "kubernetes.io/basic-auth", - data: {}, + data: { + genericKeyValues: { + data: {} + } + }, linkSecret: false, pickedServiceAccountToLink: "", }; @@ -173,6 +186,9 @@ angular.module("openshiftConsole") if (data.webhookSecretKey) { secret.stringData.WebHookSecretKey = data.webhookSecretKey; } + if (data.genericKeyValues.data) { + secret.stringData = data.genericKeyValues.data; + } break; } return secret; diff --git a/app/scripts/directives/editConfigMap.js b/app/scripts/directives/editConfigMapOrSecret.js similarity index 81% rename from app/scripts/directives/editConfigMap.js rename to app/scripts/directives/editConfigMapOrSecret.js index 0954e5e4b9..5bd15a6392 100644 --- a/app/scripts/directives/editConfigMap.js +++ b/app/scripts/directives/editConfigMapOrSecret.js @@ -1,16 +1,17 @@ "use strict"; angular.module("openshiftConsole") - .directive("editConfigMap", + .directive("editConfigMapOrSecret", function(DNS1123_SUBDOMAIN_VALIDATION) { return { require: '^form', restrict: 'E', scope: { - configMap: "=model", - showNameInput: "=" + map: "=model", + showNameInput: "=", + type: "@" }, - templateUrl: 'views/directives/edit-config-map.html', + templateUrl: 'views/directives/edit-config-map-or-secret.html', link: function($scope, element, attrs, formCtl) { $scope.form = formCtl; @@ -32,7 +33,7 @@ angular.module("openshiftConsole") }; // Load the data once when it is first set. - var clearWatch = $scope.$watch('configMap.data', function(data) { + var clearWatch = $scope.$watch('map.data', function(data) { if (!data) { return; } @@ -53,14 +54,14 @@ angular.module("openshiftConsole") clearWatch(); - // Update `$scope.configMap` as the form data changes. + // Update `$scope.map` as the form data changes. $scope.$watch('data', function(data) { var map = {}; _.each(data, function(keyValuePair) { map[keyValuePair.key] = keyValuePair.value; }); - _.set($scope, 'configMap.data', map); + _.set($scope, 'map.data', map); }, true); }); } diff --git a/app/views/create-config-map.html b/app/views/create-config-map.html index 2befbf19b6..f53d7725a4 100644 --- a/app/views/create-config-map.html +++ b/app/views/create-config-map.html @@ -12,7 +12,7 @@

Create Config Map

- +
-
+
@@ -350,6 +350,9 @@
+
+ +
\n" + "Cancel\n" + @@ -6143,7 +6143,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "\n" + "\n" + - "
\n" + + "
\n" + "
\n" + "\n" + "\n" + @@ -6327,6 +6327,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "
\n" + "
\n" + + "
\n" + + "\n" + + "
\n" + "\n" + "
\n" + "\n" + @@ -6653,73 +6656,73 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( ); - $templateCache.put('views/directives/edit-config-map.html', - "\n" + + $templateCache.put('views/directives/edit-config-map-or-secret.html', + "\n" + "
\n" + "\n" + "
\n" + - "\n" + + "\n" + "\n" + - "
\n" + - "\n" + + "
\n" + + "\n" + "
\n" + "
\n" + - "A unique name for the config map within the project.\n" + + "A unique name for the {{type}} within the project.\n" + "
\n" + - "
\n" + + "
\n" + "\n" + "{{nameValidation.description}}\n" + "\n" + "
\n" + - "
\n" + + "
\n" + "\n" + "Name is required.\n" + "\n" + "
\n" + - "
\n" + + "
\n" + "\n" + "Can't be longer than {{nameValidation.maxlength}} characters.\n" + "\n" + "
\n" + "
\n" + "
\n" + - "

The config map has no items.

\n" + + "

The {{type}} has no items.

\n" + "Add Item\n" + "
\n" + "
\n" + "
\n" + "\n" + "\n" + - "
\n" + + "
\n" + "\n" + "
\n" + "
\n" + - "A unique key for this config map entry.\n" + + "A unique key for this {{type}} entry.\n" + "
\n" + - "
\n" + + "
\n" + "\n" + "Key is required.\n" + "\n" + "
\n" + - "
\n" + + "
\n" + "\n" + - "Duplicate key \"{{item.key}}\". Keys must be unique within the config map.\n" + + "Duplicate key \"{{item.key}}\". Keys must be unique within the {{type}}.\n" + "\n" + "
\n" + - "
\n" + + "
\n" + "\n" + - "Config map keys may only consist of letters, numbers, periods, hyphens, and underscores.\n" + + "Keys may only consist of letters, numbers, periods, hyphens, and underscores.\n" + "\n" + "
\n" + - "
\n" + + "
\n" + "\n" + - "Config map keys may not be longer than 253 characters.\n" + + "Keys may not be longer than 253 characters.\n" + "\n" + "
\n" + "
\n" + "
\n" + "\n" + - "\n" + + "\n" + "
\n" + "
\n" + - "\n" + + "\n" + "
\n" + "\n" + "Cancel\n" +