Skip to content

Commit

Permalink
Merge pull request #1378 from cfchase/no-discon-hello-world
Browse files Browse the repository at this point in the history
Text and validation warning deploying OCP sample app on disconnected
  • Loading branch information
jmrodri committed Feb 17, 2017
2 parents a5ecabe + 6ba7985 commit 6e66094
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 32 deletions.
6 changes: 6 additions & 0 deletions fusor-ember-cli/app/styles/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,12 @@ input.form-control.can-show-password {
display: inline-block;
}

.checkbox-help-label {
margin-left: 10px;
font-style: italic;
color: #737373;
}

.osp-autogeneric-label {
font-weight:normal !important;
padding-left: 15px;
Expand Down
2 changes: 1 addition & 1 deletion fusor-ember-cli/app/templates/components/check-f.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
checked=checked
id=cssId
data-qci=cssId}}

{{yield}}
{{/base-f}}
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@
<br />

<p>
Select OpenShift sample applications
Select OpenShift sample applications.
</p>

<div class="ose-sample-apps">
{{check-f label='Hello World'
{{#check-f label='Hello World'
checked=model.openshift_sample_helloworld
cssId='openshift_hello_world'
isRequired=false
helpText='A Hello World sample HTML application'}}
<span class="checkbox-help-label">Requires external network access.</span>
{{/check-f}}
</div>

</form>
Expand Down
6 changes: 6 additions & 0 deletions server/app/lib/fusor/validators/deployment_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ def validate_openshift_parameters(deployment)
validate_openshift_subdomain(deployment, subdomain)
end

if deployment.openshift_sample_helloworld && deployment.is_disconnected
add_warning(deployment,
_("You have chosen to deploy an OpenShift sample application during a disconnected deployment. " \
"The sample application requires external network access."))
end

validate_openshift_storage(deployment)
end

Expand Down
33 changes: 33 additions & 0 deletions server/test/models/deployment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,39 @@ class DeploymentTest < ActiveSupport::TestCase
assert ose_d.valid?, "single node OCP deployment on baremetal was invalid"
assert_empty ose_d.warnings, "single node OCP deployment on nested virt had warnings"
end

test "should set warning if disconnected and deploying sample app" do
ose_d = fusor_deployments(:rhev_and_ose)
ose_d.is_disconnected = true
ose_d.openshift_sample_helloworld = true
assert ose_d.valid?, "Deploying sample app on disconnected was invalid"
assert_match /sample application during a disconnected deployment/, ose_d.warnings.first, "Deploying sample app on disconnected did not warn"
end

test "should not set warning if disconnected and not deploying sample app" do
ose_d = fusor_deployments(:rhev_and_ose)
ose_d.is_disconnected = true
ose_d.openshift_sample_helloworld = false
assert ose_d.valid?, "Deploying sample app on connected deployment was invalid"
assert_empty ose_d.warnings, "Deploying sample app on connected deployment had warnings"
end

test "should not set warning if connected and deploying sample app" do
ose_d = fusor_deployments(:rhev_and_ose)
ose_d.is_disconnected = false
ose_d.openshift_sample_helloworld = true
assert ose_d.valid?, "Connected deployment with no sample app was invalid"
assert_empty ose_d.warnings, "Connected deployment with no sample app had warnings"
end

test "should not set warning if not deploying OpenShift" do
ose_d = fusor_deployments(:rhev_and_ose)
ose_d.is_disconnected = true
ose_d.openshift_sample_helloworld = true
ose_d.deploy_openshift = false
assert ose_d.valid?, "Deployment without OpenShift app was invalid"
assert_empty ose_d.warnings, "Deployment without OpenShift had warnings for sample app"
end
end

describe "cfme deployment" do
Expand Down
82 changes: 65 additions & 17 deletions ui/app/assets/javascripts/fusor_ui/fusor-ember-cli.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/app/assets/javascripts/fusor_ui/fusor-ember-cli.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions ui/app/assets/stylesheets/fusor_ui/fusor-ember-cli.css

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

22 changes: 11 additions & 11 deletions ui/app/assets/stylesheets/fusor_ui/fusor-ember-cli.css.map

Large diffs are not rendered by default.

0 comments on commit 6e66094

Please sign in to comment.