Review feedback

pull/9685/head
Oliver Günther 3 years ago
parent fa5d40d0bf
commit f4f3730561
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 4
      app/services/notifications/create_from_model_service.rb
  2. 2
      app/services/notifications/create_from_model_service/comment_strategy.rb
  3. 2
      app/services/notifications/create_from_model_service/message_strategy.rb
  4. 2
      app/services/notifications/create_from_model_service/news_strategy.rb
  5. 2
      app/services/notifications/create_from_model_service/wiki_content_strategy.rb
  6. 4
      app/services/notifications/create_from_model_service/work_package_strategy.rb
  7. 13
      frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.html
  8. 2
      frontend/src/app/features/user-preferences/reminder-settings/reminder-time/reminder-settings-daily-time.component.html
  9. 4
      frontend/src/app/features/user-preferences/reminder-settings/reminder-time/reminder-settings-daily-time.component.ts
  10. 2
      modules/documents/app/services/notifications/create_from_model_service/document_strategy.rb

@ -120,7 +120,7 @@ class Notifications::CreateFromModelService
def settings_of_mentioned
project_applicable_settings(mentioned_ids,
project,
:mentioned)
NotificationSetting::MENTIONED)
end
def settings_of_assigned
@ -139,7 +139,7 @@ class Notifications::CreateFromModelService
# Subscribed is a collection of events for non-work packages
# which currently ignore project-specific overrides
settings_for_allowed_users(strategy.subscribed_users(model),
strategy.notification_reason(model))
strategy.subscribed_notification_reason(model))
end
def settings_of_watched

@ -53,7 +53,7 @@ module Notifications::CreateFromModelService::CommentStrategy
User.notified_globally notification_reason(comment)
end
def self.notification_reason(_comment)
def self.subscribed_notification_reason(_comment)
NotificationSetting::NEWS_COMMENTED
end

@ -53,7 +53,7 @@ module Notifications::CreateFromModelService::MessageStrategy
User.notified_globally notification_reason(journal)
end
def self.notification_reason(_journal)
def self.subscribed_notification_reason(_journal)
NotificationSetting::FORUM_MESSAGES
end

@ -58,7 +58,7 @@ module Notifications::CreateFromModelService::NewsStrategy
end
end
def self.notification_reason(_journal)
def self.subscribed_notification_reason(_journal)
NotificationSetting::NEWS_ADDED
end

@ -53,7 +53,7 @@ module Notifications::CreateFromModelService::WikiContentStrategy
User.notified_globally notification_reason(journal)
end
def self.notification_reason(journal)
def self.subscribed_notification_reason(journal)
if journal.initial?
NotificationSetting::WIKI_PAGE_ADDED
else

@ -49,10 +49,6 @@ module Notifications::CreateFromModelService::WorkPackageStrategy
true
end
def self.subscribed_users(journal)
User.notified_on_all(journal.data.project)
end
def self.watcher_users(journal)
User.watcher_recipients(journal.journable)
end

@ -24,11 +24,10 @@
<p [textContent]="text.alerts.explanation"></p>
<op-email-alerts-settings></op-email-alerts-settings>
</section>
<div class="generic-table--action-buttons">
<button
class="button -highlight"
[textContent]="text.save"
type="submit"
></button>
</div>
<div class="form--space"></div>
<button
class="button -highlight"
[textContent]="text.save"
type="submit"
></button>
</form>

@ -21,7 +21,7 @@
[ngModel]="isActive(time)"
(ngModelChange)="toggleActive($event, i, selectedTimes)"
[ngModelOptions]="{standalone: true}"
[disabled]="activeTimes.length === 0 || activeTimes.length === 1 && activeTimes[0] === time"
[disabled]="isDisabled(time, activeTimes)"
class="op-reminder-settings-daily-time--active"
attr.data-qa-selector="op-settings-daily-time--active-{{i + 1}}">
<label

@ -191,6 +191,10 @@ export class ReminderSettingsDailyTimeComponent implements OnInit {
);
}
isDisabled(time:string, activeTimes:string[]):boolean {
return activeTimes.length === 0 || (activeTimes.length === 1 && activeTimes[0] === time);
}
private storeTimes(selectedTimes:string[]) {
const times = selectedTimes
.filter(

@ -53,7 +53,7 @@ module Notifications::CreateFromModelService::DocumentStrategy
User.notified_globally notification_reason(journal)
end
def self.notification_reason(_journal)
def self.subscribed_notification_reason(_journal)
NotificationSetting::DOCUMENT_ADDED
end

Loading…
Cancel
Save