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
2f6e92f1
Commit
2f6e92f1
authored
Apr 29, 2021
by
Dallas Reedy
Committed by
David O'Regan
Apr 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the golden tanuki promo image to the informational popover
parent
f1a40767
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
5 deletions
+92
-5
ee/app/assets/javascripts/paid_feature_callouts/components/paid_feature_callout_popover.vue
...ture_callouts/components/paid_feature_callout_popover.vue
+21
-1
ee/app/assets/javascripts/paid_feature_callouts/index.js
ee/app/assets/javascripts/paid_feature_callouts/index.js
+4
-0
ee/app/views/shared/issuable/_approvals.html.haml
ee/app/views/shared/issuable/_approvals.html.haml
+1
-1
ee/spec/frontend/paid_feature_callouts/paid_feature_callout_popover_spec.js
...aid_feature_callouts/paid_feature_callout_popover_spec.js
+60
-3
locale/gitlab.pot
locale/gitlab.pot
+6
-0
No files found.
ee/app/assets/javascripts/paid_feature_callouts/components/paid_feature_callout_popover.vue
View file @
2f6e92f1
...
...
@@ -2,7 +2,7 @@
import
{
GlPopover
}
from
'
@gitlab/ui
'
;
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
n__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
__
,
n__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
Tracking
from
'
~/tracking
'
;
const
RESIZE_EVENT_DEBOUNCE_MS
=
150
;
...
...
@@ -34,6 +34,16 @@ export default {
type
:
String
,
required
:
true
,
},
promoImageAltText
:
{
type
:
String
,
required
:
false
,
default
:
__
(
'
SVG illustration
'
),
},
promoImagePath
:
{
type
:
String
,
required
:
false
,
default
:
undefined
,
},
targetId
:
{
type
:
String
,
required
:
true
,
...
...
@@ -107,6 +117,16 @@ export default {
>
<template
#title
>
{{
popoverTitle
}}
</
template
>
<div
v-if=
"promoImagePath"
class=
"gl-display-flex gl-justify-content-center gl-mt-n3 gl-mb-4"
>
<img
:src=
"promoImagePath"
:alt=
"promoImageAltText"
height=
"40"
width=
"40"
data-testid=
"promo-img"
/>
</div>
{{ popoverContent }}
</gl-popover>
</template>
ee/app/assets/javascripts/paid_feature_callouts/index.js
View file @
2f6e92f1
...
...
@@ -26,6 +26,8 @@ export const initPaidFeatureCalloutPopover = () => {
featureName
,
planNameForTrial
,
planNameForUpgrade
,
promoImageAltText
,
promoImagePath
,
targetId
,
}
=
el
.
dataset
;
...
...
@@ -39,6 +41,8 @@ export const initPaidFeatureCalloutPopover = () => {
featureName
,
planNameForTrial
,
planNameForUpgrade
,
promoImageAltText
,
promoImagePath
,
targetId
,
},
}),
...
...
ee/app/views/shared/issuable/_approvals.html.haml
View file @
2f6e92f1
...
...
@@ -12,7 +12,7 @@
-
feature_name
=
'merge request approvals'
.gl-xs-ml-3.gl-sm-mr-3.gl-mb-2.gl-order-1.gl-sm-order-init
#js-paid-feature-badge
{
data:
paid_feature_badge_data_attrs
(
feature_name
)
}
#js-paid-feature-popover
{
data:
paid_feature_popover_data_attrs
(
group:
root_group
,
feature_name:
feature_name
)
}
#js-paid-feature-popover
{
data:
paid_feature_popover_data_attrs
(
group:
root_group
,
feature_name:
feature_name
)
.
merge
(
promo_image_path:
image_path
(
'illustrations/golden_tanuki.svg'
),
promo_image_alt_text:
s_
(
'ImageAltText|Sparkling golden tanuki logo'
))
}
=
form
.
label
:approver_ids
,
"Approval rules"
.col-sm-10
=
render_if_exists
'shared/issuable/approver_suggestion'
,
issuable:
issuable
,
presenter:
presenter
ee/spec/frontend/paid_feature_callouts/paid_feature_callout_popover_spec.js
View file @
2f6e92f1
...
...
@@ -4,6 +4,7 @@ import { shallowMount } from '@vue/test-utils';
import
PaidFeatureCalloutPopover
from
'
ee/paid_feature_callouts/components/paid_feature_callout_popover.vue
'
;
import
{
mockTracking
}
from
'
helpers/tracking_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
describe
(
'
PaidFeatureCalloutPopover
'
,
()
=>
{
let
trackingSpy
;
...
...
@@ -20,9 +21,11 @@ describe('PaidFeatureCalloutPopover', () => {
};
const
createComponent
=
(
props
=
defaultProps
)
=>
{
return
shallowMount
(
PaidFeatureCalloutPopover
,
{
propsData
:
props
,
});
return
extendedWrapper
(
shallowMount
(
PaidFeatureCalloutPopover
,
{
propsData
:
props
,
}),
);
};
afterEach
(()
=>
{
...
...
@@ -64,6 +67,60 @@ describe('PaidFeatureCalloutPopover', () => {
});
});
describe
(
'
promo image
'
,
()
=>
{
const
findPromoImage
=
()
=>
wrapper
.
findByTestId
(
'
promo-img
'
);
describe
(
'
with the optional promoImagePath prop
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
...
defaultProps
,
promoImagePath
:
'
path/to/some/image.svg
'
,
});
});
it
(
'
renders the promo image
'
,
()
=>
{
expect
(
findPromoImage
().
exists
()).
toBe
(
true
);
});
describe
(
'
with the optional promoImageAltText prop
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
...
defaultProps
,
promoImagePath
:
'
path/to/some/image.svg
'
,
promoImageAltText
:
'
My fancy alt text
'
,
});
});
it
(
'
renders the promo image with the given alt text
'
,
()
=>
{
expect
(
findPromoImage
().
attributes
(
'
alt
'
)).
toBe
(
'
My fancy alt text
'
);
});
});
describe
(
'
without the optional promoImageAltText prop
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
...
defaultProps
,
promoImagePath
:
'
path/to/some/image.svg
'
,
});
});
it
(
'
renders the promo image with default alt text
'
,
()
=>
{
expect
(
findPromoImage
().
attributes
(
'
alt
'
)).
toBe
(
'
SVG illustration
'
);
});
});
});
describe
(
'
without the optional promoImagePath prop
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
();
});
it
(
'
does not render a promo image
'
,
()
=>
{
expect
(
findPromoImage
().
exists
()).
toBe
(
false
);
});
});
});
describe
(
'
onShown
'
,
()
=>
{
beforeEach
(()
=>
{
trackingSpy
=
mockTracking
(
undefined
,
undefined
,
jest
.
spyOn
);
...
...
locale/gitlab.pot
View file @
2f6e92f1
...
...
@@ -16453,6 +16453,9 @@ msgstr ""
msgid "Image details"
msgstr ""
msgid "ImageAltText|Sparkling golden tanuki logo"
msgstr ""
msgid "ImageDiffViewer|2-up"
msgstr ""
...
...
@@ -27933,6 +27936,9 @@ msgstr ""
msgid "SSL verification"
msgstr ""
msgid "SVG illustration"
msgstr ""
msgid "Satisfied"
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