Skip to content

Commit

Permalink
#383 allow fields to be mapped to tabs using regular expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan committed Jul 8, 2013
1 parent f3a6fa0 commit c9972f2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
13 changes: 11 additions & 2 deletions hawtio-web/src/main/webapp/app/forms/js/simpleFormDirective.ts
Expand Up @@ -234,8 +234,17 @@ module Forms {
}

if (tabs.use) {
if (tabs.locations[id]) {
tabs.elements[tabs.locations[id]].append(input);
var tabkey = tabs.locations[id];
if (!tabkey) {
// lets try find a tab key using regular expressions
angular.forEach(tabs.locations, (value, key) => {
if (!tabkey && key !== "*" && id.match(key)) {
tabkey = value;
}
});
}
if (tabkey) {
tabs.elements[tabkey].append(input);
} else {
tabs.elements[tabs.locations['*']].append
(input);
Expand Down
8 changes: 8 additions & 0 deletions hawtio-web/src/main/webapp/app/wiki/js/dozerMappings.ts
Expand Up @@ -9,6 +9,14 @@ module Wiki {
$scope.selectedItems = [];
$scope.mappings = [];

// lets customize the schemas
io_hawt_dozer_schema_Field["tabs"] = {
'Fields': ['a.value', 'b.value'],
'From Field': ['a\\..*'],
'To Field': ['b\\..*'],
'Field Configuration': ['*']
};

$scope.gridOptions = {
selectedItems: $scope.selectedItems,
data: 'mappings',
Expand Down

0 comments on commit c9972f2

Please sign in to comment.