You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by pa...@apache.org on 2017/02/07 12:16:36 UTC
ambari git commit: AMBARI-19882. Search in recent projects should
also search in path and search should be case insensitive (Venkata Sairam via
pallavkul)
Repository: ambari
Updated Branches:
refs/heads/trunk d3ff926cc -> 9b8055cc4
AMBARI-19882. Search in recent projects should also search in path and search should be case insensitive (Venkata Sairam via pallavkul)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9b8055cc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9b8055cc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9b8055cc
Branch: refs/heads/trunk
Commit: 9b8055cc47135da590ccb969019a699f612e9b9c
Parents: d3ff926
Author: pallavkul <pa...@gmail.com>
Authored: Tue Feb 7 17:45:42 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Tue Feb 7 17:45:42 2017 +0530
----------------------------------------------------------------------
.../resources/ui/app/components/drafts-wf.js | 53 +++++++-------------
.../ui/app/templates/components/drafts-wf.hbs | 19 +++----
2 files changed, 23 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9b8055cc/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
index 33533db..86c8dc9 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
@@ -25,42 +25,23 @@ export default Ember.Component.extend({
"isWorkflow": true,
"sortProp": ['updatedAt:desc'],
"filteredModels": Ember.computed("model", "search", "isBundle", "isCoordinator", "isWorkflow", function(){
- Ember.run.later(()=>{
- this.$('.actions').hide();
- }, 10);
- var condition = "", condition1 = "", condition2 = "", searchTxt = this.get("search");
- if(searchTxt && searchTxt.length){
- condition1 = "(role.get('name') && role.get('name').indexOf(searchTxt)>-1)";
- }
- if(this.get("isWorkflow")){
- if(condition2.length){
- condition2 = condition2 + " role.get('type') == 'WORKFLOW'";
- } else {
- condition2 = condition2 + " role.get('type') == 'WORKFLOW'";
- }
- }
- if(this.get("isCoordinator")){
- if(condition2.length){
- condition2 = condition2 + " || role.get('type') == 'COORDINATOR'";
- } else {
- condition2 = condition2 + "role.get('type') == 'COORDINATOR'";
- }
- }
- if(this.get("isBundle")){
- if(condition2.length) {
- condition2 = condition2 + " || role.get('type') == 'BUNDLE'";
- } else {
- condition2 = condition2 + " role.get('type') == 'BUNDLE'";
- }
- }
- if(condition1.length && condition2.length) {
- condition = condition1 + "&&(" + condition2+ ")";
- } else if(condition2.length) {
- condition = condition2;
- }
- return this.get("model").filter( (role) => {
- return eval(condition);
- });
+ var score = 0, condition = true, searchTxt = this.get("search").toLowerCase(), isWorkflow = this.get("isWorkflow"), isCoordinator = this.get("isCoordinator"), isBundle = this.get("isBundle");
+ return this.get("model").filter( (role) => {
+ score = 0
+ if(searchTxt && searchTxt.length) {
+ condition = role.get('name') && role.get('name').toLowerCase().indexOf(searchTxt)>-1;
+ }
+ if(isWorkflow && role.get('type') === 'WORKFLOW') {
+ score++;
+ }
+ if(isCoordinator && role.get('type') === 'COORDINATOR') {
+ score++;
+ }
+ if(isBundle && role.get('type') === 'BUNDLE') {
+ score++;
+ }
+ return condition && score > 0;
+ });
}),
modelSorted : Ember.computed.sort("filteredModels", "sortProp"),
"isDeleteDraftConformation": false,
http://git-wip-us.apache.org/repos/asf/ambari/blob/9b8055cc/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs
index 802a8bc..632d6bd 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs
@@ -19,10 +19,10 @@
{{spin-spinner lines=13 length=20 width=10}}
</div>
<div class="searchWorkflows">
- {{input type="checkbox" name="isWorkflow" checked=isWorkflow}}Workflow
- {{input type="checkbox" name="isCoordinator" checked=isCoordinator}}Coordinator
- {{input type="checkbox" name="isBundle" checked=isBundle}}Bundle
- {{input type="text" class="l-input" value=search placeholder="Workflow Name"}}
+ {{input type="checkbox" class="marginright5" name="isWorkflow" checked=isWorkflow}}Workflow
+ {{input type="checkbox" class="marginright5" name="isCoordinator" checked=isCoordinator}}Coordinator
+ {{input type="checkbox" class="marginright5" name="isBundle" checked=isBundle}}Bundle
+ {{input type="text" class="l-input" value=search placeholder="Type Workflow name or path"}}
</div>
{{#if modelSorted}}
<div id="draftsTable">
@@ -35,7 +35,6 @@
<th>Name</th>
<th>Path</th>
<th>Updated at</th>
- <th>Action</th>
</tr>
</thead>
<tbody>
@@ -53,8 +52,8 @@
<i class="fa fa-cubes marginright5"></i>
{{/if}}
</td>
- <td title={{job.name}}>
- <div class="width100">
+ <td title={{job.name}} class="pointer action-link">
+ <div class="width100" {{action "importActionToEditor" job.workflowDefinitionPath job.type}}>
{{job.name}}
</div>
</td>
@@ -68,12 +67,6 @@
{{format-unicode-date job.updatedAt}}
</div>
</td>
- <td class=" no-sort fixed-col">
- <button {{action "importActionToEditor" job.workflowDefinitionPath job.type}} type="button"
- class="btn btn-default">
- Open
- </button>
- </td>
</tr>
{{/if}}
{{/each}}