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
b399aa12
Commit
b399aa12
authored
Apr 21, 2021
by
Phil Hughes
Committed by
Natalia Tepluhina
Apr 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new emoji picker to project snippets
parent
b711f134
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletion
+19
-1
app/assets/javascripts/pages/projects/snippets/show/index.js
app/assets/javascripts/pages/projects/snippets/show/index.js
+8
-0
app/controllers/projects/snippets_controller.rb
app/controllers/projects/snippets_controller.rb
+4
-0
app/helpers/snippets_helper.rb
app/helpers/snippets_helper.rb
+6
-0
app/views/projects/snippets/show.html.haml
app/views/projects/snippets/show.html.haml
+1
-1
No files found.
app/assets/javascripts/pages/projects/snippets/show/index.js
View file @
b399aa12
import
'
~/snippet/snippet_show
'
;
const
awardEmojiEl
=
document
.
getElementById
(
'
js-vue-awards-block
'
);
if
(
awardEmojiEl
)
{
import
(
'
~/emoji/awards_app
'
)
.
then
((
m
)
=>
m
.
default
(
awardEmojiEl
))
.
catch
(()
=>
{});
}
app/controllers/projects/snippets_controller.rb
View file @
b399aa12
...
...
@@ -13,6 +13,10 @@ class Projects::SnippetsController < Projects::Snippets::ApplicationController
before_action
:authorize_read_snippet!
,
except:
[
:new
,
:index
]
before_action
:authorize_update_snippet!
,
only: :edit
before_action
only:
[
:show
]
do
push_frontend_feature_flag
(
:improved_emoji_picker
,
@project
,
default_enabled: :yaml
)
end
def
index
@snippet_counts
=
::
Snippets
::
CountService
.
new
(
current_user
,
project:
@project
)
...
...
app/helpers/snippets_helper.rb
View file @
b399aa12
...
...
@@ -72,4 +72,10 @@ module SnippetsHelper
concat
(
file_count
)
end
end
def
project_snippets_award_api_path
(
snippet
)
if
Feature
.
enabled?
(
:improved_emoji_picker
,
snippet
.
project
,
default_enabled: :yaml
)
api_v4_projects_snippets_award_emoji_path
(
id:
snippet
.
project
.
id
,
snippet_id:
snippet
.
id
)
end
end
end
app/views/projects/snippets/show.html.haml
View file @
b399aa12
...
...
@@ -6,6 +6,6 @@
#js-snippet-view
{
data:
{
'qa-selector'
:
'snippet_view'
,
'snippet-gid'
:
@snippet
.
to_global_id
}
}
.row-content-block.top-block.content-component-block
=
render
'award_emoji/awards_block'
,
awardable:
@snippet
,
inline:
true
=
render
'award_emoji/awards_block'
,
awardable:
@snippet
,
inline:
true
,
api_awards_path:
project_snippets_award_api_path
(
@snippet
)
#notes
.limited-width-notes
=
render
"shared/notes/notes_with_form"
,
:autocomplete
=>
true
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