-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added dismissible and required features to announcements (#3667)
* Added dismissible and required features to announcements * Implementation improvements for dismissible and required features for Annoncements * Added 404 JSON reponse to projects.show method * Fixed SettingsController read parameters method * Simplfied SettingsController logic based on feedback from review
- Loading branch information
Showing
14 changed files
with
296 additions
and
36 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
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
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,20 @@ | ||
<% @announcements.select(&:valid?).reject(&:completed?).each do |announcement| %> | ||
<div id="announcement-<%=announcement.id%>" class="alert alert-<%= announcement.type %> announcement" role="alert"> | ||
<div class="announcement-body"><%= raw OodAppkit.markdown.render(announcement.msg) %></div> | ||
<% if announcement.dismissible? %> | ||
<div class="d-grid gap-2 d-md-flex justify-content-md-end"> | ||
<%= | ||
button_to( | ||
settings_path, | ||
method: :post, | ||
form_class: 'announcement-form', | ||
class: "btn btn-#{announcement.type} me-md-2 announcement-button", | ||
params: { settings: { announcements: { announcement.id => Time.now.localtime.strftime('%Y-%m-%d %H:%M:%S') } } } | ||
) do | ||
announcement.button_text | ||
end | ||
%> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> |
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
2 changes: 2 additions & 0 deletions
2
apps/dashboard/test/fixtures/config/announcements/announcement_id.yml
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 @@ | ||
type: info | ||
msg: This is yaml |
1 change: 1 addition & 0 deletions
1
apps/dashboard/test/fixtures/config/announcements/announcement_md.md
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 @@ | ||
This is md |
4 changes: 4 additions & 0 deletions
4
apps/dashboard/test/fixtures/config/announcements/announcement_view.yml
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,4 @@ | ||
type: danger | ||
msg: This is the announcement. | ||
id: view_id | ||
dismissible: true |
5 changes: 5 additions & 0 deletions
5
apps/dashboard/test/fixtures/config/announcements/announcement_yml.yml
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,5 @@ | ||
type: danger | ||
msg: This is yaml | ||
id: yml_id | ||
dismissible: true | ||
required: true |
3 changes: 3 additions & 0 deletions
3
apps/dashboard/test/fixtures/file_output/user_settings/announcements.yml
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,3 @@ | ||
--- | ||
announcements: | ||
completed_id: '2024-07-11 13:37:03' |
29 changes: 23 additions & 6 deletions
29
apps/dashboard/test/integration/announcement_views_test.rb
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
Oops, something went wrong.