Skip to content

Commit

Permalink
Merged in CHOUETTE-3262-migrate-workgroup-aggregat (pull request #1549)
Browse files Browse the repository at this point in the history
CHOUETTE-3262 - migrate slave master workgroups aggregate/merge options behavior to alpine

Approved-by: Luc Donnet
  • Loading branch information
Guillaume Perot authored and Luc Donnet committed Dec 12, 2023
2 parents 9ae3b4a + c2ab856 commit 9aca5b8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
3 changes: 0 additions & 3 deletions app/packs/entrypoints/workgroups/edit_aggregate.js

This file was deleted.

3 changes: 0 additions & 3 deletions app/packs/entrypoints/workgroups/edit_merge.js

This file was deleted.

20 changes: 9 additions & 11 deletions app/views/workgroups/edit_aggregate.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- breadcrumb :workgroup_aggregation_settings, resource
- page_header_content_for resource
- javascript_additional_packs 'workgroups/edit_aggregate'
- workbenches = resource.workbenches.joins(:organisation).order('organisations.name')

.page_content
Expand All @@ -10,17 +9,16 @@
.col-lg-12
h3= I18n.t('workgroups.edit_aggregate.nightly_aggregate')

.row
.col-lg-12
= f.input :nightly_aggregate_enabled, as: :switchable_checkbox
.row x-data="{ nightlyAggregateEnabled: #{resource.nightly_aggregate_enabled} || false}"
.col-lg-12
.slave data-master="#workgroup_nightly_aggregate_enabled" data-value="true"
= f.input :nightly_aggregate_time, as: :time_picker
= f.input :nightly_aggregate_days, as: :day_type
= f.input :nightly_aggregate_notification_target,
collection: Aggregate.notification_target.values.delete_if{|value| value == "user"}.map { |k| [k && "enumerize.notification_target.#{k}".t, k] },
selected: f.object.nightly_aggregate_notification_target,
input_html: { style: 'max-width: 350px;' }
= f.input :nightly_aggregate_enabled, as: :switchable_checkbox, input_html: { 'x-on:click': 'nightlyAggregateEnabled = !nightlyAggregateEnabled' }
.col-lg-12 x-show="nightlyAggregateEnabled"
= f.input :nightly_aggregate_time, as: :time_picker
= f.input :nightly_aggregate_days, as: :day_type
= f.input :nightly_aggregate_notification_target,
collection: Aggregate.notification_target.values.delete_if{|value| value == "user"}.map { |k| [k && "enumerize.notification_target.#{k}".t, k] },
selected: f.object.nightly_aggregate_notification_target,
input_html: { style: 'max-width: 350px;' }
.row
.col-lg-12= I18n.t('workgroups.edit_aggregate.disclaimer').html_safe

Expand Down
13 changes: 6 additions & 7 deletions app/views/workgroups/edit_merge.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- breadcrumb :workgroup_edit_merge, resource
- page_header_content_for resource
- javascript_additional_packs 'workgroups/edit_merge'

.page_content
.container-fluid
Expand All @@ -13,12 +12,12 @@
.row
.form-group
- if has_feature?(:purge_merged_data)
.col-lg-12
h3= I18n.t('workgroups.edit_merge.edit_purge_settings')
.col-lg-12
= f.input :enable_purge_merged_data, as: :switchable_checkbox
.col-lg-12
.slave data-master="#workgroup_enable_purge_merged_data" data-value="true"
.enable_purge_merged_data x-data="{ enablePurgeMergedData: #{resource.enable_purge_merged_data} || false}"
.col-lg-12
h3= I18n.t('workgroups.edit_merge.edit_purge_settings')
.col-lg-12
= f.input :enable_purge_merged_data, as: :switchable_checkbox, input_html: { 'x-on:click': 'enablePurgeMergedData = !enablePurgeMergedData' }
.col-lg-12 x-show="enablePurgeMergedData"
= f.input :maximum_data_age, label: "workgroup.maximum_data_age".tmf, hint: "formtastic.hints.workgroup.maximum_data_age".t, input_html: {value: f.object.maximum_data_age || 0 }

= cancel_button
Expand Down

0 comments on commit 9aca5b8

Please sign in to comment.