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
d572106d
Commit
d572106d
authored
Jan 25, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
fa911c37
15a7f3c6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
154 additions
and
6 deletions
+154
-6
app/assets/javascripts/diffs/store/utils.js
app/assets/javascripts/diffs/store/utils.js
+3
-2
app/assets/javascripts/pages/projects/tags/releases/index.js
app/assets/javascripts/pages/projects/tags/releases/index.js
+8
-0
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+2
-2
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
spec/javascripts/diffs/store/utils_spec.js
spec/javascripts/diffs/store/utils_spec.js
+52
-0
No files found.
app/assets/javascripts/diffs/store/utils.js
View file @
d572106d
import
_
from
'
underscore
'
;
import
{
diffModes
}
from
'
~/ide/constants
'
;
import
{
truncatePathMiddleToLength
}
from
'
~/lib/utils/text_utility
'
;
import
{
LINE_POSITION_LEFT
,
LINE_POSITION_RIGHT
,
...
...
@@ -306,7 +307,7 @@ export const getLowestSingleFolder = folder => {
if
(
shouldGetFolder
)
{
const
firstFolder
=
getFolder
(
file
);
path
.
push
(
firstFolder
.
path
);
path
.
push
(
...
firstFolder
.
path
);
tree
.
push
(...
firstFolder
.
tree
);
}
...
...
@@ -321,7 +322,7 @@ export const getLowestSingleFolder = folder => {
const
{
path
,
tree
}
=
getFolder
(
folder
,
[
folder
.
name
]);
return
{
path
:
path
.
join
(
'
/
'
),
path
:
truncatePathMiddleToLength
(
path
.
join
(
'
/
'
),
40
),
treeAcc
:
tree
.
length
?
tree
[
tree
.
length
-
1
].
tree
:
null
,
};
};
...
...
app/assets/javascripts/pages/projects/tags/releases/index.js
0 → 100644
View file @
d572106d
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/assets/stylesheets/pages/diff.scss
View file @
d572106d
...
...
@@ -1029,7 +1029,7 @@
position
:
sticky
;
$top-pos
:
$header-height
+
$mr-tabs-height
+
$mr-version-controls-height
+
10px
;
top
:
$header-height
+
$mr-tabs-height
+
$mr-version-controls-height
+
10px
;
max-height
:
calc
(
100vh
-
$top-pos
);
max-height
:
calc
(
100vh
-
#{
$top-pos
}
);
padding-right
:
$gl-padding
;
.file-row
{
...
...
@@ -1040,7 +1040,7 @@
.with-performance-bar
&
{
$performance-bar-top-pos
:
$performance-bar-height
+
$top-pos
;
top
:
$performance-bar-top-pos
;
max-height
:
calc
(
100vh
-
$performance-bar-top-pos
);
max-height
:
calc
(
100vh
-
#{
$performance-bar-top-pos
}
);
}
}
...
...
app/views/projects/tags/_tag.html.haml
View file @
d572106d
...
...
@@ -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 @
d572106d
...
...
@@ -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 @
d572106d
---
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 @
d572106d
# 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
spec/javascripts/diffs/store/utils_spec.js
View file @
d572106d
...
...
@@ -665,6 +665,47 @@ describe('DiffsStoreUtils', () => {
},
],
},
{
type
:
'
tree
'
,
name
:
'
ee
'
,
tree
:
[
{
type
:
'
tree
'
,
name
:
'
lib
'
,
tree
:
[
{
type
:
'
tree
'
,
name
:
'
ee
'
,
tree
:
[
{
type
:
'
tree
'
,
name
:
'
gitlab
'
,
tree
:
[
{
type
:
'
tree
'
,
name
:
'
checks
'
,
tree
:
[
{
type
:
'
tree
'
,
name
:
'
longtreenametomakepath
'
,
tree
:
[
{
type
:
'
blob
'
,
name
:
'
diff_check.rb
'
,
tree
:
[],
},
],
},
],
},
],
},
],
},
],
},
],
},
{
type
:
'
tree
'
,
name
:
'
spec
'
,
...
...
@@ -696,6 +737,17 @@ describe('DiffsStoreUtils', () => {
},
],
},
{
type
:
'
tree
'
,
name
:
'
ee/lib/…/…/…/longtreenametomakepath
'
,
tree
:
[
{
name
:
'
diff_check.rb
'
,
tree
:
[],
type
:
'
blob
'
,
},
],
},
{
type
:
'
tree
'
,
name
:
'
spec
'
,
...
...
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