Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
c2c2407e
Commit
c2c2407e
authored
Sep 04, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Projects Dropdown Project Item Component
parent
53d575ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
0 deletions
+96
-0
app/assets/javascripts/projects_dropdown/components/projects_list_item.vue
...ripts/projects_dropdown/components/projects_list_item.vue
+96
-0
No files found.
app/assets/javascripts/projects_dropdown/components/projects_list_item.vue
0 → 100644
View file @
c2c2407e
<
script
>
import
identicon
from
'
../../vue_shared/components/identicon.vue
'
;
export
default
{
components
:
{
identicon
,
},
props
:
{
matcher
:
{
type
:
String
,
required
:
false
,
},
projectId
:
{
type
:
Number
,
required
:
true
,
},
projectName
:
{
type
:
String
,
required
:
true
,
},
namespace
:
{
type
:
String
,
required
:
true
,
},
webUrl
:
{
type
:
String
,
required
:
true
,
},
avatarUrl
:
{
required
:
true
,
validator
(
value
)
{
return
value
===
null
||
typeof
value
===
'
string
'
;
},
},
},
computed
:
{
hasAvatar
()
{
return
this
.
avatarUrl
!==
null
;
},
highlightedProjectName
()
{
if
(
this
.
matcher
)
{
const
matcherRegEx
=
new
RegExp
(
this
.
matcher
,
'
gi
'
);
const
matches
=
this
.
projectName
.
match
(
matcherRegEx
);
if
(
matches
&&
matches
.
length
>
0
)
{
return
this
.
projectName
.
replace
(
matches
[
0
],
`<b>
${
matches
[
0
]}
</b>`
);
}
}
return
this
.
projectName
;
},
},
};
</
script
>
<
template
>
<li
class=
"projects-list-item-container"
>
<a
class=
"clearfix"
:href=
"webUrl"
>
<div
class=
"project-item-avatar-container"
>
<img
v-if=
"hasAvatar"
class=
"avatar s32"
:src=
"avatarUrl"
/>
<identicon
v-else
size-class=
"s32"
:entity-id=
projectId
:entity-name=
"projectName"
/>
</div>
<div
class=
"project-item-metadata-container"
>
<div
class=
"project-title"
:title=
"projectName"
v-html=
"highlightedProjectName"
>
</div>
<div
class=
"project-namespace"
:title=
"namespace"
>
{{
namespace
}}
</div>
</div>
</a>
</li>
</
template
>
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