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
1bc65d29
Commit
1bc65d29
authored
Apr 27, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use popover to show help text
parent
88ccc95f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
28 deletions
+65
-28
ee/app/assets/javascripts/geo_nodes/components/geo_node_detail_item.vue
...javascripts/geo_nodes/components/geo_node_detail_item.vue
+35
-16
ee/app/assets/javascripts/geo_nodes/components/node_detail_sections/node_details_section_verification.vue
...ode_detail_sections/node_details_section_verification.vue
+22
-6
ee/app/assets/javascripts/geo_nodes/constants.js
ee/app/assets/javascripts/geo_nodes/constants.js
+2
-0
spec/javascripts/geo_nodes/components/geo_node_detail_item_spec.js
...scripts/geo_nodes/components/geo_node_detail_item_spec.js
+6
-6
No files found.
ee/app/assets/javascripts/geo_nodes/components/geo_node_detail_item.vue
View file @
1bc65d29
<
script
>
import
{
s__
}
from
'
~/locale
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
popover
from
'
~/vue_shared/directives/popover
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
s
tackedProgressBar
from
'
~/vue_shared/components/stacked_progress_bar.vue
'
;
import
S
tackedProgressBar
from
'
~/vue_shared/components/stacked_progress_bar.vue
'
;
import
{
VALUE_TYPE
,
CUSTOM_TYPE
}
from
'
../constants
'
;
import
g
eoNodeSyncSettings
from
'
./geo_node_sync_settings.vue
'
;
import
g
eoNodeEventStatus
from
'
./geo_node_event_status.vue
'
;
import
G
eoNodeSyncSettings
from
'
./geo_node_sync_settings.vue
'
;
import
G
eoNodeEventStatus
from
'
./geo_node_event_status.vue
'
;
export
default
{
components
:
{
Icon
,
s
tackedProgressBar
,
g
eoNodeSyncSettings
,
g
eoNodeEventStatus
,
S
tackedProgressBar
,
G
eoNodeSyncSettings
,
G
eoNodeEventStatus
,
},
directives
:
{
tooltip
,
popover
,
},
props
:
{
itemTitle
:
{
...
...
@@ -62,15 +62,15 @@
required
:
false
,
default
:
false
,
},
help
Text
:
{
type
:
String
,
help
Info
:
{
type
:
[
Boolean
,
Object
]
,
required
:
false
,
default
:
''
,
default
:
false
,
},
},
computed
:
{
hasHelp
Text
()
{
return
t
his
.
helpText
!==
'
'
;
hasHelp
Info
()
{
return
t
ypeof
this
.
helpInfo
===
'
object
'
;
},
isValueTypePlain
()
{
return
this
.
itemValueType
===
VALUE_TYPE
.
PLAIN
;
...
...
@@ -84,6 +84,26 @@
isCustomTypeSync
()
{
return
this
.
customType
===
CUSTOM_TYPE
.
SYNC
;
},
popoverConfig
()
{
return
{
html
:
true
,
trigger
:
'
click
'
,
placement
:
'
top
'
,
template
:
`
<div class="popover geo-node-detail-popover" role="tooltip">
<div class="arrow"></div>
<p class="popover-title"></p>
<div class="popover-content"></div>
</div>
`
,
title
:
this
.
helpInfo
.
title
,
content
:
`
<a href="
${
this
.
helpInfo
.
url
}
">
${
this
.
helpInfo
.
urlText
}
</a>
`
,
};
},
},
};
</
script
>
...
...
@@ -95,12 +115,11 @@
{{
itemTitle
}}
</span>
<icon
v-
tooltip
v-if=
"hasHelp
Text
"
v-
popover=
"popoverConfig"
v-if=
"hasHelp
Info
"
css-classes=
"node-detail-help-text prepend-left-5"
name=
"question"
:size=
"12"
:title=
"helpText"
/>
</div>
<div
...
...
ee/app/assets/javascripts/geo_nodes/components/node_detail_sections/node_details_section_verification.vue
View file @
1bc65d29
...
...
@@ -2,7 +2,7 @@
import
{
s__
}
from
'
~/locale
'
;
import
{
numberToHumanSize
}
from
'
~/lib/utils/number_utils
'
;
import
{
VALUE_TYPE
}
from
'
../../constants
'
;
import
{
VALUE_TYPE
,
HELP_INFO_URLS
}
from
'
../../constants
'
;
import
GeoNodeDetailItem
from
'
../geo_node_detail_item.vue
'
;
import
SectionRevealButton
from
'
./section_reveal_button.vue
'
;
...
...
@@ -55,7 +55,11 @@
successLabel
:
s__
(
'
GeoNodes|Checksummed
'
),
neutraLabel
:
s__
(
'
GeoNodes|Not checksummed
'
),
failureLabel
:
s__
(
'
GeoNodes|Failed
'
),
helpText
:
s__
(
'
GeoNodes|Repositories checksummed for verification with their counterparts on Secondary nodes
'
),
helpInfo
:
{
title
:
s__
(
'
GeoNodes|Repositories checksummed for verification with their counterparts on Secondary nodes
'
),
url
:
HELP_INFO_URLS
.
REPOSITORY_VERIFICATION
,
urlText
:
s__
(
'
GeoNodes|Learn more about Repository checksum progress
'
),
},
},
{
itemTitle
:
s__
(
'
GeoNodes|Wiki checksum progress
'
),
...
...
@@ -64,7 +68,11 @@
successLabel
:
s__
(
'
GeoNodes|Checksummed
'
),
neutraLabel
:
s__
(
'
GeoNodes|Not checksummed
'
),
failureLabel
:
s__
(
'
GeoNodes|Failed
'
),
helpText
:
s__
(
'
GeoNodes|Wikis checksummed for verification with their counterparts on Secondary nodes
'
),
helpInfo
:
{
title
:
s__
(
'
GeoNodes|Wikis checksummed for verification with their counterparts on Secondary nodes
'
),
url
:
HELP_INFO_URLS
.
REPOSITORY_VERIFICATION
,
urlText
:
s__
(
'
GeoNodes|Learn more about Wiki checksum progress
'
),
},
},
);
}
...
...
@@ -101,7 +109,11 @@
successLabel
:
s__
(
'
GeoNodes|Verified
'
),
neutraLabel
:
s__
(
'
GeoNodes|Unverified
'
),
failureLabel
:
s__
(
'
GeoNodes|Failed
'
),
helpText
:
s__
(
'
GeoNodes|Repositories verified with their counterparts on the Primary node
'
),
helpInfo
:
{
title
:
s__
(
'
GeoNodes|Repositories verified with their counterparts on the Primary node
'
),
url
:
HELP_INFO_URLS
.
REPOSITORY_VERIFICATION
,
urlText
:
s__
(
'
GeoNodes|Learn more about Repository checksum progress
'
),
},
},
{
itemTitle
:
s__
(
'
GeoNodes|Wiki verification progress
'
),
...
...
@@ -110,7 +122,11 @@
successLabel
:
s__
(
'
GeoNodes|Verified
'
),
neutraLabel
:
s__
(
'
GeoNodes|Unverified
'
),
failureLabel
:
s__
(
'
GeoNodes|Failed
'
),
helpText
:
s__
(
'
GeoNodes|Wikis verified with their counterparts on the Primary node
'
),
helpInfo
:
{
title
:
s__
(
'
GeoNodes|Wikis verified with their counterparts on the Primary node
'
),
url
:
HELP_INFO_URLS
.
CHECKSUMS
,
urlText
:
s__
(
'
GeoNodes|Learn more about Wiki checksum progress
'
),
},
},
];
...
...
@@ -149,7 +165,7 @@
:neutral-label=
"nodeDetailItem.neutraLabel"
:failure-label=
"nodeDetailItem.failureLabel"
:custom-type=
"nodeDetailItem.customType"
:help-
text=
"nodeDetailItem.helpText
"
:help-
info=
"nodeDetailItem.helpInfo
"
/>
</div>
</
template
>
...
...
ee/app/assets/javascripts/geo_nodes/constants.js
View file @
1bc65d29
...
...
@@ -27,3 +27,5 @@ export const TIME_DIFF = {
FIVE_MINS
:
300
,
HOUR
:
3600
,
};
export
const
HELP_INFO_URLS
=
{
REPOSITORY_VERIFICATION
:
'
https://docs.gitlab.com/ee/administration/geo/disaster_recovery/background_verification.html#repository-verification
'
,
CHECKSUMS
:
'
https://docs.gitlab.com/ee/administration/geo/disaster_recovery/background_verification.html#using-checksums-to-compare-geo-nodes
'
};
spec/javascripts/geo_nodes/components/geo_node_detail_item_spec.js
View file @
1bc65d29
...
...
@@ -37,13 +37,13 @@ describe('GeoNodeDetailItemComponent', () => {
vm
.
$destroy
();
});
it
(
'
renders item title help
text icon and tooltip
'
,
()
=>
{
const
help
Text
=
'
Foo title tooltip
'
;
const
vm
=
createComponent
({
help
Text
});
const
helpTextEl
=
vm
.
$el
.
querySelector
(
'
.node-detail-help-text
'
);
it
(
'
renders item title help
info icon and popover with help info
'
,
()
=>
{
const
help
Info
=
{
title
:
'
Foo title tooltip
'
,
url
:
'
https://docs.gitlab.com
'
,
urlText
:
'
Help
'
}
;
const
vm
=
createComponent
({
help
Info
});
const
helpText
Icon
El
=
vm
.
$el
.
querySelector
(
'
.node-detail-help-text
'
);
expect
(
helpTextEl
).
not
.
toBeNull
();
expect
(
helpText
El
.
dataset
.
originalTitle
).
toBe
(
helpText
);
expect
(
helpText
Icon
El
).
not
.
toBeNull
();
expect
(
helpText
IconEl
.
querySelector
(
'
use
'
).
getAttribute
(
'
xlink:href
'
)).
toContain
(
'
question
'
);
vm
.
$destroy
();
});
...
...
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