Skip to content

Commit

Permalink
Merge pull request #1226 from SUSE/fix-add-service-localisation
Browse files Browse the repository at this point in the history
Fix a few service instance bugs
  • Loading branch information
nwmac authored Aug 21, 2017
2 parents c92c19a + bdedfb1 commit 0133a53
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="select-input-field">
<span class="select-input-value"
ng-class="{ 'text-muted': !selectInputCtrl.ngModelCtrl.$modelValue }">
{{ selectInputCtrl.modelLabel || selectInputCtrl.placeholder | conditionalTranslate:selectInputCtrl.translateOptionLabels }}
{{ (selectInputCtrl.modelLabel | conditionalTranslate:selectInputCtrl.translateOptionLabels) || (selectInputCtrl.placeholder | translate) }}
</span>
<i class="dropdown-toggle material-icons">arrow_drop_down</i>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

it('should use default placeholder text when value is not defined', function () {
expect(selectInputCtrl.placeholder).toBe('select-input.placeholder');
expect(element.find('span').text().trim()).toBe('select-input.placeholder');
expect(element.find('span').text().trim()).toBe('Select');
});

it('should toggle menu on click', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@
</div>
<div class="panel panel-default">
<div class="panel-body"
ng-if="!applicationSummaryCtrl.serviceInstances.length" translate>
ng-if="!appCtrl.model.application.summary.services.length" translate>
app.app-info.app-tabs.summary.service-instances-panel.none
</div>
<table class="table table-actionable"
ng-if="applicationSummaryCtrl.serviceInstances.length">
ng-if="appCtrl.model.application.summary.services.length">
<thead>
<tr>
<th translate>app.app-info.app-tabs.summary.service-instances-panel.name-label</th>
Expand All @@ -295,7 +295,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="service in applicationSummaryCtrl.serviceInstances">
<tr ng-repeat="service in appCtrl.model.application.summary.services">
<td>{{ service.name }}</td>
<td>{{ service.service_plan.service.label }}</td>
<td>{{ service.service_plan.name }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@
var plans = _.map(servicePlans, function (o) { return { label: o.entity.name, value: o }; });
[].push.apply(vm.options.servicePlans, plans);

vm.options.servicePlanMap = _.keyBy(servicePlans,
function (o) { return o.metadata.guid; });
if (vm.options.servicePlans.length) {
vm.options.userInput.plan = vm.options.servicePlans[0].value;
}

vm.options.servicePlanMap = _.keyBy(servicePlans, function (o) { return o.metadata.guid; });
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,22 @@
});

application.showSummary();

// Test that the service is shown in the summary page
// Check that we have at least one service
var serviceInstances = table.wrap(element(by.css('.summary-service-instances table')));
serviceInstances.getRows().then(function (rows) {
expect(rows.length).toBeGreaterThan(0);
});
// Table should contain our service
var column = serviceInstances.getElement().all(by.css('td')).filter(function (elem) {
return elem.getText().then(function (text) {
return text === SERVICE_NAME;
});
}).first();
expect(column).toBeDefined();

// Test CLI Info
application.invokeAction('CLI Info');

// cf push acceptance.e2e.1484149644648
Expand Down
7 changes: 0 additions & 7 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,6 @@ $ gulp dev

In both cases the console should be available via https://localhost:3100

> **Note:** If you see the following error when running 'gulp dev' you may need to increase your OS ulimit.
```
Error: ENFILE: file table overflow, scandir <snip>;
at Error (native)
-bash: /dev/null: Too many open files in system
```

### Linting
We use eslint to executing linting. To run these execute...
```
Expand Down

0 comments on commit 0133a53

Please sign in to comment.