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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3a2afd34
Commit
3a2afd34
authored
Apr 10, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add helpText support to item title
parent
20b2d7bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
ee/app/assets/javascripts/geo_nodes/components/geo_node_detail_item.vue
...javascripts/geo_nodes/components/geo_node_detail_item.vue
+25
-1
spec/javascripts/geo_nodes/components/geo_node_detail_item_spec.js
...scripts/geo_nodes/components/geo_node_detail_item_spec.js
+12
-2
No files found.
ee/app/assets/javascripts/geo_nodes/components/geo_node_detail_item.vue
View file @
3a2afd34
<
script
>
import
{
s__
}
from
'
~/locale
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
stackedProgressBar
from
'
~/vue_shared/components/stacked_progress_bar.vue
'
;
import
{
VALUE_TYPE
,
CUSTOM_TYPE
}
from
'
../constants
'
;
...
...
@@ -9,10 +11,14 @@
export
default
{
components
:
{
Icon
,
stackedProgressBar
,
geoNodeSyncSettings
,
geoNodeEventStatus
,
},
directives
:
{
tooltip
,
},
props
:
{
itemTitle
:
{
type
:
String
,
...
...
@@ -56,8 +62,16 @@
required
:
false
,
default
:
false
,
},
helpText
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
computed
:
{
hasHelpText
()
{
return
this
.
helpText
!==
''
;
},
isValueTypePlain
()
{
return
this
.
itemValueType
===
VALUE_TYPE
.
PLAIN
;
},
...
...
@@ -77,7 +91,17 @@
<
template
>
<div
class=
"node-detail-item prepend-top-15 prepend-left-10"
>
<div
class=
"node-detail-title"
>
{{
itemTitle
}}
<span>
{{
itemTitle
}}
</span>
<icon
v-tooltip
v-if=
"hasHelpText"
css-classes=
"node-detail-help-text prepend-left-5"
name=
"question"
:size=
"12"
:title=
"helpText"
/>
</div>
<div
v-if=
"isValueTypePlain"
...
...
spec/javascripts/geo_nodes/components/geo_node_detail_item_spec.js
View file @
3a2afd34
...
...
@@ -8,7 +8,7 @@ import { rawMockNodeDetails } from '../mock_data';
const
createComponent
=
(
config
)
=>
{
const
Component
=
Vue
.
extend
(
geoNodeDetailItemComponent
);
const
defaultConfig
=
Object
.
assign
({
itemTitle
:
'
GitLab version
:
'
,
itemTitle
:
'
GitLab version
'
,
cssClass
:
'
node-version
'
,
itemValue
:
'
10.4.0-pre
'
,
successLabel
:
'
Synced
'
,
...
...
@@ -26,7 +26,7 @@ describe('GeoNodeDetailItemComponent', () => {
const
vm
=
createComponent
();
expect
(
vm
.
$el
.
classList
.
contains
(
'
node-detail-item
'
)).
toBeTruthy
();
expect
(
vm
.
$el
.
querySelectorAll
(
'
.node-detail-title
'
).
length
).
not
.
toBe
(
0
);
expect
(
vm
.
$el
.
querySelector
(
'
.node-detail-title
'
).
innerText
.
trim
()).
toBe
(
'
GitLab version
:
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.node-detail-title
'
).
innerText
.
trim
()).
toBe
(
'
GitLab version
'
);
vm
.
$destroy
();
});
...
...
@@ -37,6 +37,16 @@ describe('GeoNodeDetailItemComponent', () => {
vm
.
$destroy
();
});
it
(
'
renders item title help text icon and tooltip
'
,
()
=>
{
const
helpText
=
'
Foo title tooltip
'
;
const
vm
=
createComponent
({
helpText
});
const
helpTextEl
=
vm
.
$el
.
querySelector
(
'
.node-detail-help-text
'
);
expect
(
helpTextEl
).
not
.
toBeNull
();
expect
(
helpTextEl
.
dataset
.
originalTitle
).
toBe
(
helpText
);
vm
.
$destroy
();
});
it
(
'
renders graph item value
'
,
()
=>
{
const
vm
=
createComponent
({
itemValueType
:
VALUE_TYPE
.
GRAPH
,
...
...
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