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
fd5e4517
Commit
fd5e4517
authored
Oct 12, 2020
by
Jeremy Elder
Committed by
Jacques Erasmus
Oct 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate Bootstrap button to GlButton in deprecated modal template
parent
e8062f27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
16 deletions
+25
-16
app/assets/javascripts/vue_shared/components/deprecated_modal_2.vue
.../javascripts/vue_shared/components/deprecated_modal_2.vue
+18
-15
changelogs/unreleased/229303-migrate-bootstrap-button-to-gitlab-ui-glbutton-in-app-assets-javas.yml
...trap-button-to-gitlab-ui-glbutton-in-app-assets-javas.yml
+6
-0
spec/frontend/vue_shared/components/deprecated_modal_2_spec.js
...frontend/vue_shared/components/deprecated_modal_2_spec.js
+1
-1
No files found.
app/assets/javascripts/vue_shared/components/deprecated_modal_2.vue
View file @
fd5e4517
<
script
>
<
script
>
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
const
buttonVariants
=
[
'
danger
'
,
'
primary
'
,
'
success
'
,
'
warning
'
];
const
buttonVariants
=
[
'
danger
'
,
'
primary
'
,
'
success
'
,
'
warning
'
];
const
sizeVariants
=
[
'
sm
'
,
'
md
'
,
'
lg
'
,
'
xl
'
];
const
sizeVariants
=
[
'
sm
'
,
'
md
'
,
'
lg
'
,
'
xl
'
];
...
@@ -7,6 +8,9 @@ const sizeVariants = ['sm', 'md', 'lg', 'xl'];
...
@@ -7,6 +8,9 @@ const sizeVariants = ['sm', 'md', 'lg', 'xl'];
export
default
{
export
default
{
name
:
'
DeprecatedModal2
'
,
// use GlModal instead
name
:
'
DeprecatedModal2
'
,
// use GlModal instead
components
:
{
GlButton
,
},
props
:
{
props
:
{
id
:
{
id
:
{
type
:
String
,
type
:
String
,
...
@@ -72,20 +76,21 @@ export default {
...
@@ -72,20 +76,21 @@ export default {
<div
:id=
"id"
class=
"modal fade"
tabindex=
"-1"
role=
"dialog"
>
<div
:id=
"id"
class=
"modal fade"
tabindex=
"-1"
role=
"dialog"
>
<div
:class=
"modalSizeClass"
class=
"modal-dialog"
role=
"document"
>
<div
:class=
"modalSizeClass"
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<div
class=
"modal-header
gl-pr-4
"
>
<slot
name=
"header"
>
<slot
name=
"header"
>
<h4
class=
"modal-title"
>
<h4
class=
"modal-title"
>
<slot
name=
"title"
>
{{
headerTitleText
}}
</slot>
<slot
name=
"title"
>
{{
headerTitleText
}}
</slot>
</h4>
</h4>
<button
<
gl-
button
:aria-label=
"s__('Modal|Close')"
:aria-label=
"s__('Modal|Close')"
type=
"button"
variant=
"default"
class=
"close js-modal-close-action"
category=
"tertiary"
size=
"small"
icon=
"close"
class=
"js-modal-close-action"
data-dismiss=
"modal"
data-dismiss=
"modal"
@
click=
"emitCancel($event)"
@
click=
"emitCancel($event)"
>
/>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</slot>
</slot>
</div>
</div>
...
@@ -93,23 +98,21 @@ export default {
...
@@ -93,23 +98,21 @@ export default {
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<slot
name=
"footer"
>
<slot
name=
"footer"
>
<button
<gl-button
type=
"button"
class=
"js-modal-cancel-action qa-modal-cancel-button"
class=
"btn js-modal-cancel-action qa-modal-cancel-button"
data-dismiss=
"modal"
data-dismiss=
"modal"
@
click=
"emitCancel($event)"
@
click=
"emitCancel($event)"
>
>
{{
s__
(
'
Modal|Cancel
'
)
}}
{{
s__
(
'
Modal|Cancel
'
)
}}
</button>
</
gl-
button>
<button
<
gl-
button
:class=
"`btn-$
{footerPrimaryButtonVariant}`"
:class=
"`btn-$
{footerPrimaryButtonVariant}`"
type="button"
class="js-modal-primary-action qa-modal-primary-button"
class="btn js-modal-primary-action qa-modal-primary-button"
data-dismiss="modal"
data-dismiss="modal"
@click="emitSubmit($event)"
@click="emitSubmit($event)"
>
>
{{
footerPrimaryButtonText
}}
{{
footerPrimaryButtonText
}}
</button>
</
gl-
button>
</slot>
</slot>
</div>
</div>
</div>
</div>
...
...
changelogs/unreleased/229303-migrate-bootstrap-button-to-gitlab-ui-glbutton-in-app-assets-javas.yml
0 → 100644
View file @
fd5e4517
---
title
:
Migrating deprecated buttons to GlButtons for modals that have not yet been
migrated to the new GlModal component
merge_request
:
44611
author
:
type
:
other
spec/frontend/vue_shared/components/deprecated_modal_2_spec.js
View file @
fd5e4517
...
@@ -78,7 +78,7 @@ describe('DeprecatedModal2', () => {
...
@@ -78,7 +78,7 @@ describe('DeprecatedModal2', () => {
});
});
it
(
'
sets the primary button text
'
,
()
=>
{
it
(
'
sets the primary button text
'
,
()
=>
{
const
primaryButton
=
vm
.
$el
.
querySelector
(
'
.
modal-footer button:last-of-type
'
);
const
primaryButton
=
vm
.
$el
.
querySelector
(
'
.
js-modal-primary-action .gl-button-text
'
);
expect
(
primaryButton
.
innerHTML
.
trim
()).
toBe
(
props
.
footerPrimaryButtonText
);
expect
(
primaryButton
.
innerHTML
.
trim
()).
toBe
(
props
.
footerPrimaryButtonText
);
});
});
...
...
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