Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
origin-web-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Java-于龙
origin-web-common
Commits
93b4c07b
Commit
93b4c07b
authored
Apr 05, 2017
by
David Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added searchProjects filter
parent
51c089e8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
0 deletions
+66
-0
origin-web-common-ui.js
dist/origin-web-common-ui.js
+22
-0
origin-web-common.js
dist/origin-web-common.js
+22
-0
origin-web-common.min.js
dist/origin-web-common.min.js
+0
-0
resources.js
src/filters/resources.js
+22
-0
No files found.
dist/origin-web-common-ui.js
View file @
93b4c07b
...
...
@@ -1004,6 +1004,28 @@ angular.module('openshiftCommonUI')
return
displayName
;
};
})
.
filter
(
'searchProjects'
,
function
(
displayNameFilter
)
{
return
function
(
projects
,
text
)
{
if
(
!
text
)
{
return
projects
;
}
// Lowercase the search string and project display name to perform a case-insensitive search.
text
=
text
.
toLowerCase
();
return
_
.
filter
(
projects
,
function
(
project
)
{
if
(
_
.
includes
(
project
.
metadata
.
name
,
text
))
{
return
true
;
}
var
displayName
=
displayNameFilter
(
project
,
true
);
if
(
displayName
&&
_
.
includes
(
displayName
.
toLowerCase
(),
text
))
{
return
true
;
}
return
false
;
});
};
})
.
filter
(
'label'
,
function
()
{
return
function
(
resource
,
key
)
{
if
(
resource
&&
resource
.
metadata
&&
resource
.
metadata
.
labels
)
{
...
...
dist/origin-web-common.js
View file @
93b4c07b
...
...
@@ -1211,6 +1211,28 @@ angular.module('openshiftCommonUI')
return
displayName
;
};
}])
.
filter
(
'searchProjects'
,
[
"displayNameFilter"
,
function
(
displayNameFilter
)
{
return
function
(
projects
,
text
)
{
if
(
!
text
)
{
return
projects
;
}
// Lowercase the search string and project display name to perform a case-insensitive search.
text
=
text
.
toLowerCase
();
return
_
.
filter
(
projects
,
function
(
project
)
{
if
(
_
.
includes
(
project
.
metadata
.
name
,
text
))
{
return
true
;
}
var
displayName
=
displayNameFilter
(
project
,
true
);
if
(
displayName
&&
_
.
includes
(
displayName
.
toLowerCase
(),
text
))
{
return
true
;
}
return
false
;
});
};
}])
.
filter
(
'label'
,
function
()
{
return
function
(
resource
,
key
)
{
if
(
resource
&&
resource
.
metadata
&&
resource
.
metadata
.
labels
)
{
...
...
dist/origin-web-common.min.js
View file @
93b4c07b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/filters/resources.js
View file @
93b4c07b
...
...
@@ -67,6 +67,28 @@ angular.module('openshiftCommonUI')
return
displayName
;
};
})
.
filter
(
'searchProjects'
,
function
(
displayNameFilter
)
{
return
function
(
projects
,
text
)
{
if
(
!
text
)
{
return
projects
;
}
// Lowercase the search string and project display name to perform a case-insensitive search.
text
=
text
.
toLowerCase
();
return
_
.
filter
(
projects
,
function
(
project
)
{
if
(
_
.
includes
(
project
.
metadata
.
name
,
text
))
{
return
true
;
}
var
displayName
=
displayNameFilter
(
project
,
true
);
if
(
displayName
&&
_
.
includes
(
displayName
.
toLowerCase
(),
text
))
{
return
true
;
}
return
false
;
});
};
})
.
filter
(
'label'
,
function
()
{
return
function
(
resource
,
key
)
{
if
(
resource
&&
resource
.
metadata
&&
resource
.
metadata
.
labels
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment