-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[agg_table] allow recursive rendering for passed in tableGroups
- Loading branch information
Spencer Alger
committed
Oct 27, 2014
1 parent
09a9adf
commit 030abd7
Showing
10 changed files
with
162 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@import (reference) "lesshat.less"; | ||
@import (reference) "../../styles/theme/_variables.less"; | ||
|
||
agg-table { | ||
.display(flex); | ||
.flex(1, 1, auto); | ||
.flex-direction(column); | ||
|
||
.agg-table { | ||
&-paginated-table { | ||
.flex(1, 1, auto); | ||
overflow: auto; | ||
|
||
th i.fa-sort { | ||
color: @gray-light; | ||
} | ||
|
||
.visualize-table-right, | ||
td.numeric-value { | ||
text-align: right; | ||
} | ||
} | ||
|
||
&-controls { | ||
.flex(0, 0, auto); | ||
.display(flex); | ||
.align-items(center); | ||
margin: 10px 5px; | ||
|
||
> paginate-controls { | ||
.flex(1, 0, auto); | ||
margin: 0; | ||
padding: 0; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<kbn-agg-table rows="rows" columns="columns" per-page="perPage"></kbn-agg-table> | ||
<kbn-agg-table table="table" per-page="perPage"></kbn-agg-table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
define(function (require) { | ||
var _ = require('lodash'); | ||
|
||
/** | ||
* Angular can't render directives that render themselves recursively: | ||
* http://stackoverflow.com/a/18609594/296172 | ||
*/ | ||
|
||
require('modules') | ||
.get('kibana') | ||
.service('compileRecursiveDirective', function ($compile) { | ||
return { | ||
/** | ||
* Manually compiles the element, fixing the recursion loop. | ||
* @param element | ||
* @param [link] A post-link function, or an object with function(s) registered via pre and post properties. | ||
* @returns An object containing the linking functions. | ||
*/ | ||
compile: function (element, link) { | ||
// Normalize the link parameter | ||
if (_.isFunction(link)) { | ||
link = { | ||
post: link | ||
}; | ||
} | ||
|
||
// Break the recursion loop by removing the contents | ||
var contents = element.contents().remove(); | ||
var compiledContents; | ||
return { | ||
pre: (link && link.pre) ? link.pre : null, | ||
/** | ||
* Compiles and re-adds the contents | ||
*/ | ||
post: function (scope, element) { | ||
// Compile the contents | ||
if (!compiledContents) { | ||
compiledContents = $compile(contents); | ||
} | ||
// Re-add the compiled contents to the element | ||
compiledContents(scope, function (clone) { | ||
element.append(clone); | ||
}); | ||
|
||
// Call the post-linking function, if any | ||
if (link && link.post) { | ||
link.post.apply(null, arguments); | ||
} | ||
} | ||
}; | ||
} | ||
}; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
030abd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you broke the code because you didn't include lesshat.less....
Really important to check before commit
030abd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@randavidovitz can you clarify what's broken? I'm not having any issues.
030abd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first i got error on lesshat.less not found (i copied manually), than i got the following error:
Running "less:src" (less) task
File C:/Projects/Private/kibana_dev/src/kibana/components/agg_table/agg_table.css created.
File C:/Projects/Private/kibana_dev/src/kibana/components/agg_table/lesshat.csscreated.
Aborted due to warnings.
Could it be that there are missing files ? (or am i missing some prereq)?
030abd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, looks like you've renamed the bootstrap file from
C:\Projects\Private\kibana_dev\src\kibana\styles\_bootstrap.less
toC:\Projects\Private\kibana_dev\src\kibana\styles_bootstrap.less
. If that is the case then the relative paths would need to be updated.Maybe I could help better if you described what you're trying to accomplish.
If you're just trying to get the development environment setup, then you shouldn't have any problem. Maybe you should start over and copy paste the entire log of what happens into a gist. Here are the following steps I would try to run, using cygwin or something similar.
Sorry you're having issues, none of the core developers use Windows, so the process may be a bit broken. Hopefully we can figure out the issue and document it for others :)