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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
eb44dc25
Commit
eb44dc25
authored
Jan 25, 2019
by
Kushal Pandya
Committed by
Filipa Lacerda
Jan 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Init GLForm instance on form while editing tags
parent
e055f7d3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
2 deletions
+97
-2
app/assets/javascripts/pages/projects/tags/releases/index.js
app/assets/javascripts/pages/projects/tags/releases/index.js
+8
-0
app/views/projects/tags/_tag.html.haml
app/views/projects/tags/_tag.html.haml
+1
-1
app/views/projects/tags/show.html.haml
app/views/projects/tags/show.html.haml
+1
-1
changelogs/unreleased/56424-fix-gl-form-init-tag-editing.yml
changelogs/unreleased/56424-fix-gl-form-init-tag-editing.yml
+5
-0
spec/features/projects/tags/user_edits_tags_spec.rb
spec/features/projects/tags/user_edits_tags_spec.rb
+82
-0
No files found.
app/assets/javascripts/pages/projects/tags/releases/index.js
0 → 100644
View file @
eb44dc25
import
$
from
'
jquery
'
;
import
ZenMode
from
'
~/zen_mode
'
;
import
GLForm
from
'
~/gl_form
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
new
ZenMode
();
// eslint-disable-line no-new
new
GLForm
(
$
(
'
.release-form
'
));
// eslint-disable-line no-new
});
app/views/projects/tags/_tag.html.haml
View file @
eb44dc25
...
...
@@ -28,7 +28,7 @@
=
render
'projects/buttons/download'
,
project:
@project
,
ref:
tag
.
name
,
pipeline:
@tags_pipelines
[
tag
.
name
]
-
if
can?
(
current_user
,
:push_code
,
@project
)
=
link_to
edit_project_tag_release_path
(
@project
,
tag
.
name
),
class:
'btn has-tooltip'
,
title:
s_
(
'TagsPage|Edit release notes'
),
data:
{
container:
"body"
}
do
=
link_to
edit_project_tag_release_path
(
@project
,
tag
.
name
),
class:
'btn
btn-edit
has-tooltip'
,
title:
s_
(
'TagsPage|Edit release notes'
),
data:
{
container:
"body"
}
do
=
icon
(
"pencil"
)
-
if
can?
(
current_user
,
:admin_project
,
@project
)
...
...
app/views/projects/tags/show.html.haml
View file @
eb44dc25
...
...
@@ -20,7 +20,7 @@
.nav-controls.controls-flex
-
if
can?
(
current_user
,
:push_code
,
@project
)
=
link_to
edit_project_tag_release_path
(
@project
,
@tag
.
name
),
class:
'btn controls-item has-tooltip'
,
title:
s_
(
'TagsPage|Edit release notes'
)
do
=
link_to
edit_project_tag_release_path
(
@project
,
@tag
.
name
),
class:
'btn
btn-edit
controls-item has-tooltip'
,
title:
s_
(
'TagsPage|Edit release notes'
)
do
=
icon
(
"pencil"
)
=
link_to
project_tree_path
(
@project
,
@tag
.
name
),
class:
'btn controls-item has-tooltip'
,
title:
s_
(
'TagsPage|Browse files'
)
do
=
icon
(
'files-o'
)
...
...
changelogs/unreleased/56424-fix-gl-form-init-tag-editing.yml
0 → 100644
View file @
eb44dc25
---
title
:
Fix form functionality for edit tag page
merge_request
:
24645
author
:
type
:
fixed
spec/features/projects/tags/user_edits_tags_spec.rb
0 → 100644
View file @
eb44dc25
# frozen_string_literal: true
require
'rails_helper'
describe
'Project > Tags'
,
:js
do
include
DropzoneHelper
let
(
:user
)
{
create
(
:user
)
}
let
(
:role
)
{
:developer
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
sign_in
(
user
)
project
.
add_role
(
user
,
role
)
end
describe
'when opening project tags'
do
before
do
visit
project_tags_path
(
project
)
end
context
'page with tags list'
do
it
'shows tag name'
do
page
.
within
first
(
'.tags > .content-list > li'
)
do
expect
(
page
.
find
(
'.row-main-content'
)).
to
have_content
'v1.1.0 Version 1.1.0'
end
end
it
'shows tag edit button'
do
page
.
within
first
(
'.tags > .content-list > li'
)
do
edit_btn
=
page
.
find
(
'.row-fixed-content.controls a.btn-edit'
)
expect
(
edit_btn
[
'href'
]).
to
have_content
'/tags/v1.1.0/release/edit'
end
end
end
context
'edit tag release notes'
do
before
do
find
(
'.tags > .content-list > li:first-child .row-fixed-content.controls a.btn-edit'
).
click
end
it
'shows tag name header'
do
page
.
within
(
'.content'
)
do
expect
(
page
.
find
(
'.sub-header-block'
)).
to
have_content
'Release notes for tag v1.1.0'
end
end
it
'shows release notes form'
do
page
.
within
(
'.content'
)
do
expect
(
page
).
to
have_selector
(
'form.release-form'
)
end
end
it
'toolbar buttons on release notes form are functional'
do
page
.
within
(
'.content form.release-form'
)
do
note_textarea
=
page
.
find
(
'.js-gfm-input'
)
# Click on Bold button
page
.
find
(
'.md-header-toolbar button.toolbar-btn:first-child'
).
click
expect
(
note_textarea
.
value
).
to
eq
(
'****'
)
end
end
it
'release notes form shows "Attach a file" button'
,
:js
do
page
.
within
(
'.content form.release-form'
)
do
expect
(
page
).
to
have_button
(
'Attach a file'
)
expect
(
page
).
not_to
have_selector
(
'.uploading-progress-container'
,
visible:
true
)
end
end
it
'shows "Attaching a file" message on uploading 1 file'
,
:js
do
slow_requests
do
dropzone_file
([
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'dk.png'
)],
0
,
false
)
expect
(
page
).
to
have_selector
(
'.attaching-file-message'
,
visible:
true
,
text:
'Attaching a file -'
)
end
end
end
end
end
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