-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3913 from 3scale/THREESCALE-11419_notification_prefs
🦋 Update Notification Preferences page
- Loading branch information
Showing
8 changed files
with
80 additions
and
60 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 was deleted.
Oops, something went wrong.
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
15 changes: 0 additions & 15 deletions
15
app/views/provider/admin/user/notification_preferences/_form.html.slim
This file was deleted.
Oops, something went wrong.
40 changes: 29 additions & 11 deletions
40
app/views/provider/admin/user/notification_preferences/show.html.slim
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,12 +1,30 @@ | ||
- content_for :page_header_title, 'Notification Preferences' | ||
- content_for :page_header_body do | ||
' Events originate from interactions with the 3scale interface & the 3scale API. They can be | ||
' triggered by developers, you, your team & 3scale. You will only receive API-related | ||
' notifications for those APIs that you have access to. | ||
|
||
- if @preferences_form.categories.blank? | ||
p= t('.no_notification_preferences_html', account_name: current_user.account.name, | ||
username: current_user.account.first_admin.username, | ||
email: current_user.account.first_admin.email) | ||
- content_for :page_header_title, t('.header_title') | ||
- content_for :page_header_body, t('.header_body') | ||
|
||
- categories = @preferences.categories | ||
|
||
- if categories.blank? | ||
- admin = current_user.account.first_admin | ||
= render partial: 'shared/empty_state', locals: { title: t('.empty_state.title'), | ||
body: t('.empty_state.body_html', account: current_user.account.name, username: admin.username, email: admin.email), | ||
icon: :lock } | ||
- else | ||
= render 'form', preferences_form: @preferences_form | ||
- content_for :javascripts do | ||
= stylesheet_packs_chunks_tag 'pf_form' | ||
|
||
div class="pf-c-card" | ||
div class="pf-c-card__body" | ||
= semantic_form_for @preferences.model, url: provider_admin_user_notification_preferences_path, | ||
builder: Fields::PatternflyFormBuilder, | ||
method: :patch, | ||
html: { class: 'pf-c-form pf-m-limit-width' } do |f| | ||
|
||
- categories.each do |category| | ||
= f.inputs t(category.title_key, scope: :notification_category_titles) do | ||
= f.input :enabled_notifications, as: :patternfly_check_boxes, | ||
label: false, | ||
collection: category.notifications.map { |value| [t(value, scope: :notification_preference_titles), value] }, | ||
member_hint: ->(value) { t(value, scope: :notification_preference_hints) } | ||
|
||
= f.actions do | ||
= f.commit_button t('.submit_button_label') |
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