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
782cd3bc
Commit
782cd3bc
authored
May 18, 2020
by
Jiaan Louw
Committed by
Phil Hughes
May 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve tooltips for compliance framework badges
Adds more context to the compliance framework badge tooltips.
parent
41f6db67
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
2 deletions
+39
-2
ee/app/helpers/compliance_management/compliance_framework/project_settings_helper.rb
...anagement/compliance_framework/project_settings_helper.rb
+13
-0
ee/app/views/compliance_management/compliance_framework/_compliance_framework_badge.html.haml
...ompliance_framework/_compliance_framework_badge.html.haml
+2
-2
ee/changelogs/unreleased/jlouw-improve-compliance-framework-tooptips.yml
...nreleased/jlouw-improve-compliance-framework-tooptips.yml
+5
-0
ee/spec/helpers/compliance_management/compliance_framework/project_settings_helper_spec.rb
...ment/compliance_framework/project_settings_helper_spec.rb
+16
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/helpers/compliance_management/compliance_framework/project_settings_helper.rb
View file @
782cd3bc
...
@@ -20,6 +20,10 @@ module ComplianceManagement
...
@@ -20,6 +20,10 @@ module ComplianceManagement
compliance_framework_color_values
.
fetch
(
framework
.
to_sym
)
compliance_framework_color_values
.
fetch
(
framework
.
to_sym
)
end
end
def
compliance_framework_tooltip
(
framework
)
compliance_framework_tooltip_values
.
fetch
(
framework
.
to_sym
)
end
private
private
def
compliance_framework_option_values
def
compliance_framework_option_values
...
@@ -51,6 +55,15 @@ module ComplianceManagement
...
@@ -51,6 +55,15 @@ module ComplianceManagement
sox:
'gl-bg-orange-500'
sox:
'gl-bg-orange-500'
}.
freeze
}.
freeze
end
end
def
compliance_framework_tooltip_values
@compliance_framework_tooltip_values
||=
compliance_framework_title_values
.
map
{
|
k
,
v
|
[
k
,
get_compliance_framework_tooltip
(
v
)]
}.
to_h
end
def
get_compliance_framework_tooltip
(
framework
)
s_
(
"ComplianceFramework|This project is regulated by %{framework}."
%
{
framework:
framework
})
end
end
end
end
end
end
end
ee/app/views/compliance_management/compliance_framework/_compliance_framework_badge.html.haml
View file @
782cd3bc
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
-
framework
=
project
.
compliance_framework_setting
.
framework
-
framework
=
project
.
compliance_framework_setting
.
framework
-
color
=
compliance_framework_color
(
framework
)
-
color
=
compliance_framework_color
(
framework
)
-
title
=
compliance_framework_title
(
framework
)
-
title
=
compliance_framework_title
(
framework
)
-
description
=
compliance_framework_description
(
framework
)
-
tooltip
=
compliance_framework_tooltip
(
framework
)
%span
.badge.compliance-framework-pill.ml-2.has-tooltip
{
class:
color
,
data:
{
container:
'body'
},
title:
description
}
%span
.badge.compliance-framework-pill.ml-2.has-tooltip
{
class:
color
,
data:
{
container:
'body'
},
title:
tooltip
}
=
title
=
title
ee/changelogs/unreleased/jlouw-improve-compliance-framework-tooptips.yml
0 → 100644
View file @
782cd3bc
---
title
:
Improve tooltips for compliance framework badges
merge_request
:
31883
author
:
type
:
changed
ee/spec/helpers/compliance_management/compliance_framework/project_settings_helper_spec.rb
View file @
782cd3bc
...
@@ -62,4 +62,20 @@ describe ComplianceManagement::ComplianceFramework::ProjectSettingsHelper do
...
@@ -62,4 +62,20 @@ describe ComplianceManagement::ComplianceFramework::ProjectSettingsHelper do
it
{
expect
(
helper
.
compliance_framework_color
(
framework
)).
to
eq
(
color
)
}
it
{
expect
(
helper
.
compliance_framework_color
(
framework
)).
to
eq
(
color
)
}
end
end
end
end
describe
'#compliance_framework_tooltip'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:framework
,
:tooltip
)
do
:gdpr
|
'This project is regulated by GDPR.'
:hipaa
|
'This project is regulated by HIPAA.'
:pci_dss
|
'This project is regulated by PCI-DSS.'
:soc_2
|
'This project is regulated by SOC 2.'
:sox
|
'This project is regulated by SOX.'
end
with_them
do
it
{
expect
(
helper
.
compliance_framework_tooltip
(
framework
)).
to
eq
(
tooltip
)
}
end
end
end
end
locale/gitlab.pot
View file @
782cd3bc
...
@@ -5593,6 +5593,9 @@ msgstr ""
...
@@ -5593,6 +5593,9 @@ msgstr ""
msgid "ComplianceFramework|SOX - Sarbanes-Oxley"
msgid "ComplianceFramework|SOX - Sarbanes-Oxley"
msgstr ""
msgstr ""
msgid "ComplianceFramework|This project is regulated by %{framework}."
msgstr ""
msgid "Confidence: %{confidence}"
msgid "Confidence: %{confidence}"
msgstr ""
msgstr ""
...
...
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