Skip to content

Commit

Permalink
HUE-1237 [jobsub] FS example broken
Browse files Browse the repository at this point in the history
KO updates was missing in mapping.
Templates for CHMOD and MOVES was missing.
  • Loading branch information
generalpiston authored and romainr committed May 9, 2013
1 parent 8a64a06 commit 5efec71
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/jobsub/static/js/jobsub.templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ var Templates = (function($, ko) {
mkdirs: 'static/templates/widgets/folderchooser.html',
deletes: 'static/templates/widgets/folderchooser.html',
touchzs: 'static/templates/widgets/filechooser.html',
chmods: 'static/templates/widgets/filechooser.html',
moves: 'static/templates/widgets/filechooser.html',
chmods: 'static/templates/widgets/chmods.html',
moves: 'static/templates/widgets/moves.html',
job_properties: 'static/templates/widgets/properties.html',
prepares: 'static/templates/widgets/prepares.html',
arguments: 'static/templates/widgets/params.html',
Expand Down
26 changes: 26 additions & 0 deletions apps/jobsub/static/templates/widgets/chmods.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div class="control-group" data-bind="attr: {'class': {{ ko.error_class }} }">
<label class="control-label">{{ title }}</label>
<div class="controls">
<table class="table-condensed designTable" data-bind="visible: {{ ko.condition }}">
<tbody>
<thead>
<tr>
<th>Path</th>
<th>Permissions</th>
<th>Recursive</th>
<th></th>
</tr>
</thead>
<tbody data-bind="foreach: {{ ko.items }}">
<tr>
<td><input type="text" class="input span4 required pathFolderChooserKo" data-bind="fileChooser: $data, value: path, uniqueName: false" /></td>
<td><input type="text" class="input span2 required propKey" data-bind="value: permissions, uniqueName: false" /></td>
<td><input class="span1 required" type="checkbox" data-bind="checked: recursive, uniqueName: false"></td>
<td><a class="btn" href="javascript:void(0);" data-bind="click: {{ delete.func }}">{{ delete.name }}</a></td>
</tr>
</tbody>
</tbody>
</table>
<button class="btn" data-bind="click: {{ add.func }}">{{ add.name }}</button>
</div>
</div>
24 changes: 24 additions & 0 deletions apps/jobsub/static/templates/widgets/moves.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="control-group" data-bind="attr: {'class': {{ ko.error_class }} }">
<label class="control-label">{{ title }}</label>
<div class="controls">
<table class="table-condensed designTable" data-bind="visible: {{ ko.condition }}">
<tbody>
<thead>
<tr>
<th>Source</th>
<th>Destination</th>
<th></th>
</tr>
</thead>
<tbody data-bind="foreach: {{ ko.items }}">
<tr>
<td><input type="text" class="input span3 required pathFolderChooserKo" data-bind="fileChooser: $data, value: source, uniqueName: false" /></td>
<td><input type="text" class="input span3 required pathFolderChooserKo" data-bind="fileChooser: $data, value: destination, uniqueName: false" /></td>
<td><a class="btn" href="javascript:void(0);" data-bind="click: {{ delete.func }}">{{ delete.name }}</a></td>
</tr>
</tbody>
</tbody>
</table>
<button class="btn" data-bind="click: {{ add.func }}">{{ add.name }}</button>
</div>
</div>
44 changes: 41 additions & 3 deletions apps/oozie/static/js/workflow.models.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,18 @@ var MAPPING_OPTIONS = {
deletes: {
create: function(options) {
return map_params(options, function() {});
}
},
update: function(options) {
return map_params(options, function() {});
},
},
mkdirs: {
create: function(options) {
return map_params(options, function() {});
}
},
update: function(options) {
return map_params(options, function() {});
},
},
moves: {
create: function(options) {
Expand All @@ -190,6 +196,19 @@ var MAPPING_OPTIONS = {
});
};

return map_params(options, subscribe);
},
update: function(options) {
var parent = options.parent;
var subscribe = function(mapping) {
mapping.source.subscribe(function(value) {
parent.moves.valueHasMutated();
});
mapping.destination.subscribe(function(value) {
parent.moves.valueHasMutated();
});
};

return map_params(options, subscribe);
}
},
Expand All @@ -209,11 +228,30 @@ var MAPPING_OPTIONS = {
};

return map_params(options, subscribe);
}
},
update: function(options) {
var parent = options.parent;
var subscribe = function(mapping) {
mapping.path.subscribe(function(value) {
parent.chmods.valueHasMutated();
});
mapping.permissions.subscribe(function(value) {
parent.chmods.valueHasMutated();
});
mapping.recursive.subscribe(function(value) {
parent.chmods.valueHasMutated();
});
};

return map_params(options, subscribe);
},
},
touchzs: {
create: function(options) {
return map_params(options, function() {});
},
update: function(options) {
return map_params(options, function() {});
}
}
};
Expand Down

0 comments on commit 5efec71

Please sign in to comment.