-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-151' into martha/5752-join-hh
- Loading branch information
Showing
167 changed files
with
2,110 additions
and
713 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
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
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
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
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
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,40 @@ | ||
### | ||
# Copyright 2016 - 2025 Green River Data Analysis, LLC | ||
# | ||
# License detail: https://github.com/greenriver/hmis-warehouse/blob/production/LICENSE.md | ||
### | ||
|
||
class ImportThresholdsController < ApplicationController | ||
include AjaxModalRails::Controller | ||
before_action :require_can_view_imports_projects_or_organizations!, only: [:show] | ||
before_action :data_source | ||
before_action :import_threshold | ||
|
||
def show | ||
end | ||
|
||
def update | ||
import_threshold.update!(import_threshold_params) | ||
respond_with(import_threshold, location: data_source_import_threshold_path) | ||
end | ||
|
||
private def import_threshold_params | ||
params.require(:grda_warehouse_import_threshold). | ||
permit(*GrdaWarehouse::ImportThreshold.known_params) | ||
end | ||
|
||
private def data_source_scope | ||
GrdaWarehouse::DataSource.viewable_by(current_user, permission: :can_view_projects) | ||
end | ||
|
||
private def data_source | ||
@data_source ||= data_source_scope.find_safely(params[:data_source_id]) | ||
end | ||
helper_method :data_source | ||
|
||
# Ensure the import threshold is saved so the related notifications can be added | ||
private def import_threshold | ||
@import_threshold ||= data_source.import_threshold || GrdaWarehouse::ImportThreshold.create!(data_source_id: data_source.id) | ||
end | ||
helper_method :import_threshold | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
### | ||
# Copyright 2016 - 2025 Green River Data Analysis, LLC | ||
# | ||
# License detail: https://github.com/greenriver/hmis-warehouse/blob/production/LICENSE.md | ||
### | ||
|
||
class NotificationConfigurationsController < ApplicationController | ||
include AjaxModalRails::Controller | ||
before_action :require_can_view_imports_projects_or_organizations!, only: [:show] | ||
before_action :data_source | ||
before_action :import_threshold | ||
|
||
def new | ||
@form_url = data_source_import_threshold_notification_configurations_path(notification_slug: import_threshold.valid_notification_slug(params[:notification_slug])) | ||
end | ||
|
||
def edit | ||
@form_url = data_source_import_threshold_notification_configuration_path(notification_slug: import_threshold.valid_notification_slug(params[:notification_slug])) | ||
end | ||
|
||
def create | ||
notification_configuration.update!(notification_configuration_params.merge(notification_slug: import_threshold.valid_notification_slug(params[:notification_slug]))) | ||
respond_with(notification_configuration, location: data_source_import_threshold_path) | ||
end | ||
|
||
def update | ||
notification_configuration.update!(notification_configuration_params) | ||
respond_with(notification_configuration, location: data_source_import_threshold_path) | ||
end | ||
|
||
def destroy | ||
notification_configuration.destroy! | ||
respond_with(notification_configuration, location: data_source_import_threshold_path) | ||
end | ||
|
||
private def notification_configuration_params | ||
params.require(:grda_warehouse_notification_configuration). | ||
permit(:user_id, :active) | ||
end | ||
|
||
private def data_source_scope | ||
GrdaWarehouse::DataSource.viewable_by(current_user, permission: :can_view_projects) | ||
end | ||
|
||
private def data_source | ||
@data_source ||= data_source_scope.find(params[:data_source_id].to_i) | ||
end | ||
helper_method :data_source | ||
|
||
private def import_threshold | ||
@import_threshold ||= data_source.import_threshold | ||
end | ||
helper_method :import_threshold | ||
|
||
def notification_configuration | ||
@notification_configuration ||= if params[:id].present? | ||
GrdaWarehouse::NotificationConfiguration.find_safely(params[:id]) | ||
else | ||
GrdaWarehouse::NotificationConfiguration.new( | ||
source: import_threshold, | ||
notification_slug: import_threshold.valid_notification_slug(params[:notification_slug]), | ||
) | ||
end | ||
end | ||
helper_method :notification_configuration | ||
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
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.