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
9194297e
Commit
9194297e
authored
May 22, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
76bda5da
add00b69
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
2 deletions
+35
-2
app/helpers/page_layout_helper.rb
app/helpers/page_layout_helper.rb
+2
-1
changelogs/unreleased/62116-performance-issue-502-errors-on-rendering-of-issues-with-heavy-markdown-contents.yml
...s-on-rendering-of-issues-with-heavy-markdown-contents.yml
+6
-0
changelogs/unreleased/sh-project-import-visibility-error.yml
changelogs/unreleased/sh-project-import-visibility-error.yml
+5
-0
lib/gitlab/import_export/project_tree_restorer.rb
lib/gitlab/import_export/project_tree_restorer.rb
+1
-1
spec/helpers/page_layout_helper_spec.rb
spec/helpers/page_layout_helper_spec.rb
+8
-0
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+13
-0
No files found.
app/helpers/page_layout_helper.rb
View file @
9194297e
# coding: utf-8
# frozen_string_literal: true
# frozen_string_literal: true
module
PageLayoutHelper
module
PageLayoutHelper
...
@@ -36,7 +37,7 @@ module PageLayoutHelper
...
@@ -36,7 +37,7 @@ module PageLayoutHelper
if
description
.
present?
if
description
.
present?
@page_description
=
description
.
squish
@page_description
=
description
.
squish
elsif
@page_description
.
present?
elsif
@page_description
.
present?
sanitize
(
@page_description
,
tags:
[]).
truncate_words
(
30
)
sanitize
(
@page_description
.
truncate_words
(
30
),
tags:
[]
)
end
end
end
end
...
...
changelogs/unreleased/62116-performance-issue-502-errors-on-rendering-of-issues-with-heavy-markdown-contents.yml
0 → 100644
View file @
9194297e
---
title
:
Fix performance issue with large Markdown content in issue or merge request
description
merge_request
:
28597
author
:
type
:
performance
changelogs/unreleased/sh-project-import-visibility-error.yml
0 → 100644
View file @
9194297e
---
title
:
Fix invalid visibility string comparison in project import
merge_request
:
28612
author
:
type
:
fixed
lib/gitlab/import_export/project_tree_restorer.rb
View file @
9194297e
...
@@ -129,7 +129,7 @@ module Gitlab
...
@@ -129,7 +129,7 @@ module Gitlab
def
visibility_level
def
visibility_level
level
=
override_params
[
'visibility_level'
]
||
json_params
[
'visibility_level'
]
||
@project
.
visibility_level
level
=
override_params
[
'visibility_level'
]
||
json_params
[
'visibility_level'
]
||
@project
.
visibility_level
level
=
@project
.
group
.
visibility_level
if
@project
.
group
&&
level
>
@project
.
group
.
visibility_level
level
=
@project
.
group
.
visibility_level
if
@project
.
group
&&
level
.
to_i
>
@project
.
group
.
visibility_level
{
'visibility_level'
=>
level
}
{
'visibility_level'
=>
level
}
end
end
...
...
spec/helpers/page_layout_helper_spec.rb
View file @
9194297e
...
@@ -38,6 +38,14 @@ describe PageLayoutHelper do
...
@@ -38,6 +38,14 @@ describe PageLayoutHelper do
expect
(
helper
.
page_description
).
to
eq
'Bold Header'
expect
(
helper
.
page_description
).
to
eq
'Bold Header'
end
end
it
'truncates before sanitizing'
do
helper
.
page_description
(
'<b>Bold</b> <img> <img> <img> <h1>Header</h1> '
*
10
)
# 12 words because <img> was counted as a word
expect
(
helper
.
page_description
)
.
to
eq
(
'Bold Header Bold Header Bold Header Bold Header Bold Header Bold Header...'
)
end
end
end
describe
'page_image'
do
describe
'page_image'
do
...
...
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
9194297e
...
@@ -328,6 +328,19 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
...
@@ -328,6 +328,19 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
end
context
'when the project has overridden params in import data'
do
context
'when the project has overridden params in import data'
do
it
'handles string versions of visibility_level'
do
# Project needs to be in a group for visibility level comparison
# to happen
group
=
create
(
:group
)
project
.
group
=
group
project
.
create_import_data
(
data:
{
override_params:
{
visibility_level:
Gitlab
::
VisibilityLevel
::
INTERNAL
.
to_s
}
})
restored_project_json
expect
(
project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
INTERNAL
)
end
it
'overwrites the params stored in the JSON'
do
it
'overwrites the params stored in the JSON'
do
project
.
create_import_data
(
data:
{
override_params:
{
description:
"Overridden"
}
})
project
.
create_import_data
(
data:
{
override_params:
{
description:
"Overridden"
}
})
...
...
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