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
90264a0a
Commit
90264a0a
authored
Mar 04, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
510ed5e5
83b0a4b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
3 deletions
+43
-3
changelogs/unreleased/sh-fix-kroki-format-filtering.yml
changelogs/unreleased/sh-fix-kroki-format-filtering.yml
+5
-0
lib/gitlab/kroki.rb
lib/gitlab/kroki.rb
+0
-3
spec/lib/gitlab/kroki_spec.rb
spec/lib/gitlab/kroki_spec.rb
+38
-0
No files found.
changelogs/unreleased/sh-fix-kroki-format-filtering.yml
0 → 100644
View file @
90264a0a
---
title
:
Fix disabling of Kroki optional formats
merge_request
:
55665
author
:
type
:
fixed
lib/gitlab/kroki.rb
View file @
90264a0a
...
...
@@ -31,9 +31,6 @@ module Gitlab
DIAGRAMS_FORMATS
end
# No additional diagram formats
return
diagram_formats
unless
current_settings
.
kroki_formats
.
present?
# Diagrams that require a companion container must be explicitly enabled from the settings
diagram_formats
.
select
do
|
diagram_type
|
current_settings
.
kroki_format_supported?
(
diagram_type
)
...
...
spec/lib/gitlab/kroki_spec.rb
0 → 100644
View file @
90264a0a
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Kroki
do
using
RSpec
::
Parameterized
::
TableSyntax
describe
'.formats'
do
def
default_formats
%w[bytefield c4plantuml ditaa erd graphviz nomnoml plantuml svgbob umlet vega vegalite wavedrow]
.
freeze
end
subject
{
described_class
.
formats
(
Gitlab
::
CurrentSettings
)
}
where
(
:enabled_formats
,
:expected_formats
)
do
''
|
default_formats
'blockdiag'
|
default_formats
+
%w[actdiag blockdiag nwdiag packetdiag rackdiag seqdiag]
'bpmn'
|
default_formats
+
%w[bpmn]
'excalidraw'
|
default_formats
+
%w[excalidraw]
end
with_them
do
before
do
kroki_formats
=
if
enabled_formats
.
present?
{
enabled_formats
=>
true
}
else
{}
end
stub_application_setting
(
kroki_enabled:
true
,
kroki_url:
"http://localhost:8000"
,
kroki_formats:
kroki_formats
)
end
it
'returns the expected formats'
do
expect
(
subject
).
to
match_array
(
expected_formats
)
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