You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2017/02/17 22:57:22 UTC
[44/51] [abbrv] ambari git commit: AMBARI-19882. Search in recent
projects should also search in path and search should be case insensitive
(Venkata Sairam via pallavkul)
AMBARI-19882. Search in recent projects should also search in path and search should be case insensitive (Venkata Sairam via pallavkul)
(cherry picked from commit f2518aeed0d0bcf01bd1c471d746f2764f628ee9)
Change-Id: Ic8c014e6471bc94142dfc4818025b9f4ee53c538
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5ab3e427
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5ab3e427
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5ab3e427
Branch: refs/heads/branch-feature-BUG-74026
Commit: 5ab3e4278b722316e331987501d215eb37253595
Parents: 168f264
Author: pallavkul <pa...@gmail.com>
Authored: Tue Feb 7 17:45:42 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 08:49:15 2017 -0800
----------------------------------------------------------------------
.../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/5ab3e427/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/5ab3e427/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}}