diff --git a/app/scripts/directives/create/nextSteps.js b/app/scripts/directives/create/nextSteps.js index bc492ba14c..6c8f974dcf 100644 --- a/app/scripts/directives/create/nextSteps.js +++ b/app/scripts/directives/create/nextSteps.js @@ -15,7 +15,11 @@ createdBuildConfig: '<', onContinue: '<', showProjectName: '<', - name: '<' + // Optional kind to show in front of the name + kind: '', + name: '<', + // Optional action to use instead of "created" (for example, "imported") + actionLabel: '' }, templateUrl: 'views/directives/next-steps.html' }); @@ -23,6 +27,7 @@ function NextSteps(ProcessedTemplateService, Navigate) { var ctrl = this; ctrl.showParamsTable = false; + ctrl.actionLabel = ctrl.actionLabel || 'created'; var processedTemplateData = ProcessedTemplateService.getTemplateData(); ctrl.parameters = processedTemplateData.params; diff --git a/app/scripts/directives/fromFile.js b/app/scripts/directives/fromFile.js index f395520c97..e3630c321a 100644 --- a/app/scripts/directives/fromFile.js +++ b/app/scripts/directives/fromFile.js @@ -302,7 +302,9 @@ angular.module("openshiftConsole") } else if ($scope.isDialog) { $scope.$emit('fileImportedFromYAMLOrJSON', { - project: $scope.input.selectedProject + project: $scope.input.selectedProject, + resource: $scope.resource, + isList: $scope.isList }); } else { diff --git a/app/scripts/directives/fromFileDialog.js b/app/scripts/directives/fromFileDialog.js index 34772c6adc..4e7b7c4960 100644 --- a/app/scripts/directives/fromFileDialog.js +++ b/app/scripts/directives/fromFileDialog.js @@ -62,7 +62,14 @@ ctrl.vendor = annotation(message.template, "openshift.io/provider-display-name"); ctrl.docUrl = annotation(ctrl.template, "openshift.io/documentation-url"); ctrl.supportUrl = annotation(ctrl.template, "openshift.io/support-url"); - ctrl.name = "YAML / JSON"; + ctrl.actionLabel = "imported"; + if (message.isList) { + ctrl.name = "YAML / JSON"; + ctrl.kind = null; + } else if (message.resource) { + ctrl.kind = message.resource.kind; + ctrl.name = message.resource.metadata.name; + } // Need to let the current digest loop finish so the template config step becomes visible or the wizard will throw an error // from the change to currentStep $timeout(function() { @@ -73,6 +80,8 @@ $scope.$on('templateInstantiated', function(event, message) { ctrl.selectedProject = message.project; ctrl.name = $filter('displayName')(ctrl.template); + ctrl.actionLabel = null; + ctrl.kind = null; ctrl.currentStep = "Results"; }); diff --git a/app/views/directives/from-file-dialog.html b/app/views/directives/from-file-dialog.html index 61cbf7045a..4af7c7f532 100644 --- a/app/views/directives/from-file-dialog.html +++ b/app/views/directives/from-file-dialog.html @@ -98,7 +98,9 @@ login-base-url="$ctrl.loginBaseUrl" on-continue="$ctrl.close" show-project-name="$ctrl.showProjectName" - name="$ctrl.name"> + kind="$ctrl.kind" + name="$ctrl.name" + action-label="$ctrl.actionLabel"> diff --git a/app/views/directives/next-steps.html b/app/views/directives/next-steps.html index 6974d22ea9..8997245ef1 100644 --- a/app/views/directives/next-steps.html +++ b/app/views/directives/next-steps.html @@ -5,7 +5,8 @@ Pending
@@ -16,17 +17,21 @@