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
fde871b8
Commit
fde871b8
authored
Apr 07, 2022
by
Marcel van Remmerden
Committed by
Miguel Rincon
Apr 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix required data for referenced commands
Changelog: fixed
parent
469ed24f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
3 deletions
+31
-3
app/assets/javascripts/vue_shared/components/markdown/field.vue
...sets/javascripts/vue_shared/components/markdown/field.vue
+1
-0
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+1
-1
ee/spec/helpers/ee/issuables_helper_spec.rb
ee/spec/helpers/ee/issuables_helper_spec.rb
+1
-1
spec/features/issues/user_creates_issue_spec.rb
spec/features/issues/user_creates_issue_spec.rb
+6
-0
spec/features/issues/user_edits_issue_spec.rb
spec/features/issues/user_edits_issue_spec.rb
+6
-0
spec/frontend/vue_shared/components/markdown/field_spec.js
spec/frontend/vue_shared/components/markdown/field_spec.js
+15
-0
spec/helpers/issuables_helper_spec.rb
spec/helpers/issuables_helper_spec.rb
+1
-1
No files found.
app/assets/javascripts/vue_shared/components/markdown/field.vue
View file @
fde871b8
...
...
@@ -376,6 +376,7 @@ export default {
<div
v-if=
"referencedCommands && previewMarkdown && !markdownPreviewLoading"
class=
"referenced-commands"
data-testid=
"referenced-commands"
v-html=
"referencedCommands /* eslint-disable-line vue/no-v-html */"
></div>
<div
v-if=
"shouldShowReferencedUsers"
class=
"referenced-users"
>
...
...
app/helpers/issuables_helper.rb
View file @
fde871b8
...
...
@@ -233,7 +233,7 @@ module IssuablesHelper
canUpdate:
can?
(
current_user
,
:"update_
#{
issuable
.
to_ability_name
}
"
,
issuable
),
canDestroy:
can?
(
current_user
,
:"destroy_
#{
issuable
.
to_ability_name
}
"
,
issuable
),
issuableRef:
issuable
.
to_reference
,
markdownPreviewPath:
preview_markdown_path
(
parent
),
markdownPreviewPath:
preview_markdown_path
(
parent
,
target_type:
issuable
.
model_name
,
target_id:
issuable
.
iid
),
markdownDocsPath:
help_page_path
(
'user/markdown'
),
lockVersion:
issuable
.
lock_version
,
issuableTemplateNamesPath:
template_names_path
(
parent
,
issuable
),
...
...
ee/spec/helpers/ee/issuables_helper_spec.rb
View file @
fde871b8
...
...
@@ -39,7 +39,7 @@ RSpec.describe IssuablesHelper do
issuesWebUrl:
"/groups/
#{
@group
.
full_path
}
/-/issues"
,
lockVersion:
epic
.
lock_version
,
markdownDocsPath:
'/help/user/markdown'
,
markdownPreviewPath:
"/groups/
#{
@group
.
full_path
}
/preview_markdown"
,
markdownPreviewPath:
"/groups/
#{
@group
.
full_path
}
/preview_markdown
?target_id=
#{
epic
.
iid
}
&target_type=Epic
"
,
projectsEndpoint:
"/api/v4/groups/
#{
@group
.
id
}
/projects"
,
updateEndpoint:
"/groups/
#{
@group
.
full_path
}
/-/epics/
#{
epic
.
iid
}
.json"
}
...
...
spec/features/issues/user_creates_issue_spec.rb
View file @
fde871b8
...
...
@@ -71,6 +71,12 @@ RSpec.describe "User creates issue" do
expect
(
preview
).
to
have_css
(
"gl-emoji"
)
expect
(
textarea
).
not_to
be_visible
click_button
(
"Write"
)
fill_in
(
"Description"
,
with:
"/confidential"
)
click_button
(
"Preview"
)
expect
(
form
).
to
have_content
(
'Makes this issue confidential.'
)
end
end
end
...
...
spec/features/issues/user_edits_issue_spec.rb
View file @
fde871b8
...
...
@@ -35,6 +35,12 @@ RSpec.describe "Issues > User edits issue", :js do
end
expect
(
form
).
to
have_button
(
"Write"
)
click_button
(
"Write"
)
fill_in
(
"Description"
,
with:
"/confidential"
)
click_button
(
"Preview"
)
expect
(
form
).
to
have_content
(
'Makes this issue confidential.'
)
end
it
'allows user to select unassigned'
do
...
...
spec/frontend/vue_shared/components/markdown/field_spec.js
View file @
fde871b8
...
...
@@ -101,6 +101,21 @@ describe('Markdown field component', () => {
expect
(
subject
.
find
(
'
.zen-backdrop textarea
'
).
element
).
not
.
toBeNull
();
});
it
(
'
renders referenced commands on markdown preview
'
,
async
()
=>
{
axiosMock
.
onPost
(
markdownPreviewPath
)
.
reply
(
200
,
{
references
:
{
users
:
[],
commands
:
'
test command
'
}
});
previewLink
=
getPreviewLink
();
previewLink
.
vm
.
$emit
(
'
click
'
,
{
target
:
{}
});
await
axios
.
waitFor
(
markdownPreviewPath
);
const
referencedCommands
=
subject
.
find
(
'
[data-testid="referenced-commands"]
'
);
expect
(
referencedCommands
.
exists
()).
toBe
(
true
);
expect
(
referencedCommands
.
text
()).
toContain
(
'
test command
'
);
});
describe
(
'
markdown preview
'
,
()
=>
{
beforeEach
(()
=>
{
axiosMock
.
onPost
(
markdownPreviewPath
).
reply
(
200
,
{
body
:
previewHTML
});
...
...
spec/helpers/issuables_helper_spec.rb
View file @
fde871b8
...
...
@@ -288,7 +288,7 @@ RSpec.describe IssuablesHelper do
canUpdate:
true
,
canDestroy:
true
,
issuableRef:
"#
#{
issue
.
iid
}
"
,
markdownPreviewPath:
"/
#{
@project
.
full_path
}
/preview_markdown"
,
markdownPreviewPath:
"/
#{
@project
.
full_path
}
/preview_markdown
?target_id=
#{
issue
.
iid
}
&target_type=Issue
"
,
markdownDocsPath:
'/help/user/markdown'
,
lockVersion:
issue
.
lock_version
,
projectPath:
@project
.
path
,
...
...
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