[CORD-1338] Inline navigation for related models
Change-Id: I58ff4a4675d1ce1140fe162f1f8360f2dc9a6527
diff --git a/src/app/core/index.ts b/src/app/core/index.ts
index 64d295c..33db0ae 100644
--- a/src/app/core/index.ts
+++ b/src/app/core/index.ts
@@ -32,7 +32,8 @@
.module('xosCore', [
'ui.router',
'toastr',
- 'ui.bootstrap.typeahead'
+ 'ui.bootstrap.typeahead',
+ 'ui.bootstrap.tabs'
])
.config(routesConfig)
.provider('XosRuntimeStates', XosRuntimeStates)
diff --git a/src/app/core/services/helpers/config.helpers.ts b/src/app/core/services/helpers/config.helpers.ts
index ed3f0c0..5dbd74e 100644
--- a/src/app/core/services/helpers/config.helpers.ts
+++ b/src/app/core/services/helpers/config.helpers.ts
@@ -80,9 +80,10 @@
pluralize.addPluralRule(/slice$/i, 'slices');
pluralize.addSingularRule(/slice$/i, 'slice');
pluralize.addPluralRule(/library$/i, 'librarys');
- pluralize.addPluralRule(/imagedeployments/i, 'imagedeploymentses');
- pluralize.addPluralRule(/controllerimages/i, 'controllerimageses');
- pluralize.addPluralRule(/servicedependency/i, 'servicedependencies');
+ pluralize.addPluralRule(/imagedeployments/i, 'imagedeploymentss');
+ pluralize.addPluralRule(/controllerimages/i, 'controllerimagess');
+ pluralize.addPluralRule(/servicedependency/i, 'servicedependencys');
+ pluralize.addPluralRule(/servicemonitoringagentinfo/i, 'servicemonitoringagentinfoes');
}
public pluralize(string: string, quantity?: number, count?: boolean): string {
diff --git a/src/app/core/services/runtime-states.ts b/src/app/core/services/runtime-states.ts
index 1f495ba..17b3052 100644
--- a/src/app/core/services/runtime-states.ts
+++ b/src/app/core/services/runtime-states.ts
@@ -1,6 +1,8 @@
+import {IXosModelRelation} from '../../views/crud/crud';
export interface IXosState extends angular.ui.IState {
data: {
- model: string
+ model: string,
+ relations?: IXosModelRelation[]
};
};
diff --git a/src/app/core/table/table.html b/src/app/core/table/table.html
index 6621e5b..8583fd9 100644
--- a/src/app/core/table/table.html
+++ b/src/app/core/table/table.html
@@ -12,7 +12,7 @@
<table ng-class="vm.classes">
<thead>
<tr>
- <th ng-repeat="col in vm.columns">
+ <th ng-repeat="col in vm.config.columns">
{{col.label}}
<div ng-if="vm.config.order">
<a href="" ng-click="vm.orderBy = col.prop; vm.reverse = false">
@@ -28,7 +28,7 @@
</thead>
<tbody ng-if="vm.config.filter == 'field'">
<tr>
- <td ng-repeat="col in vm.columns">
+ <td ng-repeat="col in vm.config.columns">
<input
ng-if="col.type !== 'boolean' && col.type !== 'array' && col.type !== 'object' && col.type !== 'custom'"
class="form-control"
@@ -49,7 +49,7 @@
</tbody>
<tbody>
<tr ng-repeat="item in vm.data | filter:vm.query | orderBy:vm.orderBy:vm.reverse | pagination:vm.currentPage * vm.config.pagination.pageSize | limitTo: (vm.config.pagination.pageSize || vm.data.length) track by $index">
- <td ng-repeat="col in vm.columns" xos-link-wrapper>
+ <td ng-repeat="col in vm.config.columns" xos-link-wrapper>
<span ng-if="!col.type || col.type === 'text'">{{item[col.prop]}}</span>
<span ng-if="col.type === 'boolean'">
<i class="fa"
diff --git a/src/app/core/table/table.spec.ts b/src/app/core/table/table.spec.ts
index c7856f3..c2d8f2f 100644
--- a/src/app/core/table/table.spec.ts
+++ b/src/app/core/table/table.spec.ts
@@ -93,7 +93,7 @@
it('should contain 2 columns', function() {
const th = element[0].getElementsByTagName('th');
expect(th.length).toEqual(2);
- expect(isolatedScope.columns.length).toEqual(2);
+ expect(isolatedScope.config.columns.length).toEqual(2);
});
it('should contain 3 rows', function() {
@@ -476,7 +476,7 @@
it('should have 3 columns', () => {
const th = element[0].getElementsByTagName('th');
expect(th.length).toEqual(3);
- expect(isolatedScope.columns.length).toEqual(2);
+ expect(isolatedScope.config.columns.length).toEqual(2);
});
it('when clicking on action should invoke callback', () => {
diff --git a/src/app/core/table/table.ts b/src/app/core/table/table.ts
index 5fb884c..23960e1 100644
--- a/src/app/core/table/table.ts
+++ b/src/app/core/table/table.ts
@@ -127,7 +127,7 @@
this.currentPage = 0;
}
- this.columns = this.config.columns;
+ // this.columns = this.config.columns;
}