Skip to content

Commit

Permalink
Make list items editable on profile detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Aug 6, 2013
1 parent be460bc commit ecd6744
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
6 changes: 5 additions & 1 deletion hawtio-web/src/main/webapp/app/core/js/corePlugin.ts
Expand Up @@ -387,7 +387,11 @@ angular.module('hawtioCore', ['bootstrap', 'ngResource', 'ui', 'ui.bootstrap.dia
scope.saveEdit = function () {
var value = $(element.find(":input[type=text]")[0]).val();
var obj = ngModel.$viewValue;
obj[attrs['property']] = value;
if (angular.isDefined(attrs['property'])) {
obj[attrs['property']] = value;
} else {
obj = value;
}
ngModel.$setViewValue(obj);
ngModel.$render();
scope.editing = false;
Expand Down
8 changes: 7 additions & 1 deletion hawtio-web/src/main/webapp/app/fabric/html/fabricView.html
Expand Up @@ -80,14 +80,20 @@
</div>

<div class="section-controls">

<i class="icon-plus clickable" title="Apply patch to Version" ng-show="activeVersionId && activeVersionId != ''"></i>

<i class="icon-plus clickable" title="Create new Version" ng-click="createVersionDialog = true"></i>

<!--
<a ng-href="#/wiki/branch/{{version.id}}/view/" ng-show="hasFabricWiki()"
title="View, edit or create configuration files for the profiles in this version">
<i class="icon-edit"></i>
</a>-->

<i class="icon-minus clickable" title="Delete this Version" ng-click="deleteVersionDialog = true" ng-show="activeVersionId && activeVersionId != '' && versionCanBeDeleted()"></i>


<i class="icon-minus clickable" title="Delete this Version" ng-click="deleteVersionDialog = true" ng-show="activeVersionId && activeVersionId != '' && versionCanBeDeleted()"></i>

<i class="icon-chevron-sign-right clickable" title="Apply to selected containers" ng-click="applyVersionToContainers()" ng-show="showMigrateButton()"></i>

Expand Down
10 changes: 6 additions & 4 deletions hawtio-web/src/main/webapp/app/fabric/html/profile.html
Expand Up @@ -66,7 +66,8 @@ <h2 style="display: inline;">/ <a ng-href="#/fabric/view?cv={{versionId}}&sp={{r
<dd>
<ul class="unstyled">
<li ng-repeat="feature in row.features">
{{feature}}
<i class="red clickable icon-remove" title="Delete {{feature}}" ng-click="deleteThing('Feature', 'Features', row.features, feature)"></i>
<editable-property ng-model="row.features" property="{{$index}}" on-save="updateThing('Feature', 'Features', row.features)"></editable-property>
</li>
<li>
<i class="clickable icon-edit" ng-click="goto('/fabric/profile/{{versionId}}/{{profileId}}/editFeatures')" title="Edit features"></i>
Expand All @@ -80,7 +81,8 @@ <h2 style="display: inline;">/ <a ng-href="#/fabric/view?cv={{versionId}}&sp={{r
<ul class="unstyled">
<li ng-repeat="fab in row.fabs">
<i class="red clickable icon-remove" title="Delete {{fab}}" ng-click="deleteThing('Fuse Application Bundle', 'Fabs', row.fabs, fab)"></i>
{{fab}}
<editable-property ng-model="row.fabs" property="{{$index}}" on-save="updateThing('Fuse Application Bundle', 'Fabs', row.fabs)"></editable-property>

</li>
<li>
<i class="clickable icon-plus" ng-click="addNewThing('Fuse Application Bundle', 'Fabs', row.fabs)" title="Add Fuse Application Bundle"></i>
Expand All @@ -94,7 +96,7 @@ <h2 style="display: inline;">/ <a ng-href="#/fabric/view?cv={{versionId}}&sp={{r
<ul class="unstyled">
<li ng-repeat="bundle in row.bundles">
<i class="red clickable icon-remove" title="Delete {{bundle}}" ng-click="deleteThing('Bundle', 'Bundles', row.bundles, bundle)"></i>
{{bundle}}
<editable-property ng-model="row.bundles" property="{{$index}}" on-save="updateThing('Bundle', 'Bundles', row.bundles)"></editable-property>
</li>
<li>
<i class="clickable icon-plus" ng-click="addNewThing('Bundle', 'Bundles', row.bundles)" title="Add Bundle"></i>
Expand All @@ -110,7 +112,7 @@ <h2 style="display: inline;">/ <a ng-href="#/fabric/view?cv={{versionId}}&sp={{r
<ul class="unstyled">
<li ng-repeat="repository in row.repositories">
<i class="red clickable icon-remove" title="Delete {{repository}}" ng-click="deleteThing('Feature Repository', 'Repositories', row.repositories, repository)"></i>
<editable-property ng-model="repository"></editable-property>
<editable-property ng-model="row.repositories" property="{{$index}}" on-save="updateThing('Feature Repository', 'Repositories', row.repositories)"></editable-property>
</li>
<li>
<i class="clickable icon-plus" ng-click="addNewThing('Feature Repository', 'Repositories', row.repositories)" title="Add Feature Repository"></i>
Expand Down
6 changes: 6 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/js/profile.ts
Expand Up @@ -92,6 +92,12 @@ module Fabric {
$scope.deleteThingDialog = true;
}

$scope.updateThing = (title, type, current) => {
$scope.thingName = title;
$scope.currentThing = current;
$scope.currentThingType = type;
$scope.callSetProfileThing("Changed", "change", title);
}

$scope.callSetProfileThing = function (success, error, thing) {
jolokia.request({
Expand Down

0 comments on commit ecd6744

Please sign in to comment.