-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inside comments column some partials are rendered, now it renders webui2 ones. Instead of adding the comment's form after the comment itself, it replaces it. After changing the form we realized that we needed to update/save the attribute value in ProjectController#edit_comment. Co-authored-by: Björn Geuken <bgeuken@suse.de>
- Loading branch information
Showing
7 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/api/app/views/webui2/webui/project/_edit_comment.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%div | ||
|
||
- if @error | ||
%i.fa.fa-exclamation-triangle.text-warning | ||
= @error | ||
|
||
= render partial: 'status_comment', locals: { package_name: @package.name, editable: true, comment: @comment, project: @project } | ||
|
16 changes: 16 additions & 0 deletions
16
src/api/app/views/webui2/webui/project/_status_comment.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- if comment | ||
= h(comment) | ||
- if User.current.can_modify?(project.api_obj) | ||
- if editable | ||
= link_to(edit_comment_form_path(project: project, package: package_name, comment: comment), remote: true) do | ||
%i.fas.fa-edit.text-secondary | ||
- else | ||
= link_to(clear_failed_comment_path(project: project, package: package_name), remote: true) do | ||
%i.fas.fa-times-circle.text-danger | ||
|
||
- elsif editable | ||
%span.unknown_failure | ||
Unknown build failure | ||
- if User.current.can_modify?(project.api_obj) | ||
= link_to(edit_comment_form_path(project: project, package: package_name, comment: ''), remote: true) do | ||
%i.fas.fa-edit.text-secondary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$('td[data-package-name="<%= @package.name %>"]'). | ||
html('<%= escape_javascript(render(partial: 'edit_comment')) %>'); |
4 changes: 2 additions & 2 deletions
4
src/api/app/views/webui2/webui/project/edit_comment_form.js.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
$('#<%= params[:update] %>').replaceWith('<%= escape_javascript(render(:partial => 'edit_comment_form')) %>'); | ||
|
||
$('td[data-package-name="<%= params[:package] %>"]'). | ||
html('<%= escape_javascript(render(partial: 'edit_comment_form')) %>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters