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
Léo-Paul Géneau
gitlab-ce
Commits
a96745d4
Commit
a96745d4
authored
Apr 19, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Runs prettier on some vue shared components
parent
0517e1d8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
257 additions
and
266 deletions
+257
-266
app/assets/javascripts/vue_shared/components/commit.vue
app/assets/javascripts/vue_shared/components/commit.vue
+103
-112
app/assets/javascripts/vue_shared/components/expand_button.vue
...ssets/javascripts/vue_shared/components/expand_button.vue
+27
-27
app/assets/javascripts/vue_shared/components/header_ci_component.vue
...javascripts/vue_shared/components/header_ci_component.vue
+66
-66
app/assets/javascripts/vue_shared/components/icon.vue
app/assets/javascripts/vue_shared/components/icon.vue
+59
-59
spec/javascripts/vue_shared/components/expand_button_spec.js
spec/javascripts/vue_shared/components/expand_button_spec.js
+2
-2
No files found.
app/assets/javascripts/vue_shared/components/commit.vue
View file @
a96745d4
<
script
>
import
commitIconSvg
from
'
icons/_icon_commit.svg
'
;
import
userAvatarLink
from
'
./user_avatar/user_avatar_link.vue
'
;
import
tooltip
from
'
../directives/tooltip
'
;
import
icon
from
'
../../vue_shared/components/icon.vue
'
;
import
UserAvatarLink
from
'
./user_avatar/user_avatar_link.vue
'
;
import
tooltip
from
'
../directives/tooltip
'
;
import
Icon
from
'
../../vue_shared/components/icon.vue
'
;
export
default
{
export
default
{
directives
:
{
tooltip
,
},
components
:
{
u
serAvatarLink
,
i
con
,
U
serAvatarLink
,
I
con
,
},
props
:
{
/**
...
...
@@ -94,10 +93,7 @@
* @returns {Boolean}
*/
hasAuthor
()
{
return
this
.
author
&&
this
.
author
.
avatar_url
&&
this
.
author
.
path
&&
this
.
author
.
username
;
return
this
.
author
&&
this
.
author
.
avatar_url
&&
this
.
author
.
path
&&
this
.
author
.
username
;
},
/**
* If information about the author is provided will return a string
...
...
@@ -106,14 +102,10 @@
* @returns {String}
*/
userImageAltDescription
()
{
return
this
.
author
&&
this
.
author
.
username
?
`
${
this
.
author
.
username
}
's avatar`
:
null
;
return
this
.
author
&&
this
.
author
.
username
?
`
${
this
.
author
.
username
}
's avatar`
:
null
;
},
},
created
()
{
this
.
commitIconSvg
=
commitIconSvg
;
},
};
};
</
script
>
<
template
>
<div
class=
"branch-commit"
>
...
...
@@ -141,11 +133,10 @@
{{
commitRef
.
name
}}
</a>
</
template
>
<
div
v-html=
"commitIconSvg
"
<
icon
name=
"commit
"
class=
"commit-icon js-commit-icon"
>
</div>
/>
<a
class=
"commit-sha"
...
...
app/assets/javascripts/vue_shared/components/expand_button.vue
View file @
a96745d4
<
script
>
import
{
__
}
from
'
~/locale
'
;
/**
import
{
__
}
from
'
~/locale
'
;
/**
* Port of detail_behavior expand button.
*
* @example
...
...
@@ -10,7 +10,7 @@
* </template>
* </expand-button>
*/
export
default
{
export
default
{
name
:
'
ExpandButton
'
,
data
()
{
return
{
...
...
@@ -27,7 +27,7 @@
this
.
isCollapsed
=
!
this
.
isCollapsed
;
},
},
};
};
</
script
>
<
template
>
<span>
...
...
app/assets/javascripts/vue_shared/components/header_ci_component.vue
View file @
a96745d4
<
script
>
import
c
iIconBadge
from
'
./ci_badge_link.vue
'
;
import
l
oadingIcon
from
'
./loading_icon.vue
'
;
import
t
imeagoTooltip
from
'
./time_ago_tooltip.vue
'
;
import
tooltip
from
'
../directives/tooltip
'
;
import
u
serAvatarImage
from
'
./user_avatar/user_avatar_image.vue
'
;
import
C
iIconBadge
from
'
./ci_badge_link.vue
'
;
import
L
oadingIcon
from
'
./loading_icon.vue
'
;
import
T
imeagoTooltip
from
'
./time_ago_tooltip.vue
'
;
import
tooltip
from
'
../directives/tooltip
'
;
import
U
serAvatarImage
from
'
./user_avatar/user_avatar_image.vue
'
;
/**
/**
* Renders header component for job and pipeline page based on UI mockups
*
* Used in:
* - job show page
* - pipeline show page
*/
export
default
{
export
default
{
components
:
{
c
iIconBadge
,
l
oadingIcon
,
t
imeagoTooltip
,
u
serAvatarImage
,
C
iIconBadge
,
L
oadingIcon
,
T
imeagoTooltip
,
U
serAvatarImage
,
},
directives
:
{
tooltip
,
...
...
@@ -72,7 +72,7 @@
this
.
$emit
(
'
actionClicked
'
,
action
);
},
},
};
};
</
script
>
<
template
>
...
...
app/assets/javascripts/vue_shared/components/icon.vue
View file @
a96745d4
<
script
>
/* This is a re-usable vue component for rendering a svg sprite
/* This is a re-usable vue component for rendering a svg sprite
icon
Sample configuration:
...
...
@@ -11,11 +10,11 @@
css-classes="top"
/>
*/
// only allow classes in images.scss e.g. s12
const
validSizes
=
[
8
,
12
,
16
,
18
,
24
,
32
,
48
,
72
];
*/
// only allow classes in images.scss e.g. s12
const
validSizes
=
[
8
,
12
,
16
,
18
,
24
,
32
,
48
,
72
];
export
default
{
export
default
{
props
:
{
name
:
{
type
:
String
,
...
...
@@ -70,7 +69,7 @@
return
this
.
size
?
`s
${
this
.
size
}
`
:
''
;
},
},
};
};
</
script
>
<
template
>
...
...
@@ -79,7 +78,8 @@
:width=
"width"
:height=
"height"
:x=
"x"
:y=
"y"
>
:y=
"y"
>
<use
v-bind=
"
{ 'xlink:href':spriteHref }" />
</svg>
</
template
>
spec/javascripts/vue_shared/components/expand_button_spec.js
View file @
a96745d4
...
...
@@ -3,10 +3,10 @@ import expandButton from '~/vue_shared/components/expand_button.vue';
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
describe
(
'
expand button
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
expandButton
);
let
vm
;
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
expandButton
);
vm
=
mountComponent
(
Component
,
{
slots
:
{
expanded
:
'
<p>Expanded!</p>
'
,
...
...
@@ -22,7 +22,7 @@ describe('expand button', () => {
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
'
...
'
);
});
it
(
'
hides expander on click
'
,
(
done
)
=>
{
it
(
'
hides expander on click
'
,
done
=>
{
vm
.
$el
.
querySelector
(
'
button
'
).
click
();
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
getAttribute
(
'
style
'
)).
toEqual
(
'
display: none;
'
);
...
...
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