diff --git a/app/Console/Commands/SendFilterNotifications.php b/app/Console/Commands/SendFilterNotifications.php index f4d2e5fc..65c16470 100644 --- a/app/Console/Commands/SendFilterNotifications.php +++ b/app/Console/Commands/SendFilterNotifications.php @@ -15,7 +15,7 @@ class SendFilterNotifications extends Command * * @var string */ - protected $signature = 'notify:filters {-p|--print=0}'; + protected $signature = 'notify:filters {--print}'; /** * The console command description. diff --git a/app/Http/Controllers/FiltersController.php b/app/Http/Controllers/FiltersController.php index 9d87d981..e4658f67 100644 --- a/app/Http/Controllers/FiltersController.php +++ b/app/Http/Controllers/FiltersController.php @@ -146,7 +146,7 @@ public function create(Request $request, $with_observations = false) 'user_id' => $user->id, 'name' => $request->name, 'rules' => $request->all(), - 'notify_user' => false, + 'notify_user' => $request->notify_user, ]); } diff --git a/resources/assets/js/components/AdvancedFiltersModal.jsx b/resources/assets/js/components/AdvancedFiltersModal.jsx index ce08262c..fb71a72c 100644 --- a/resources/assets/js/components/AdvancedFiltersModal.jsx +++ b/resources/assets/js/components/AdvancedFiltersModal.jsx @@ -50,6 +50,7 @@ export default class AdvancedFiltersModal extends Component { endDate : null, groups : [], selectedGroup : -1, + notify_user : true, } } @@ -128,6 +129,7 @@ export default class AdvancedFiltersModal extends Component { start: this.state.startDate ? this.state.startDate.format('YYYY-MM-DD') : null, end : this.state.endDate ? this.state.endDate.format('YYYY-MM-DD') : null, }, + notify_user : this.state.notify_user, } if (this.props.applyFilters) { @@ -168,6 +170,10 @@ export default class AdvancedFiltersModal extends Component { this.setState({loading: false}) }) + + if(this.state.notify_user == true){ + console.log('triggered') + } } count(changed) { @@ -204,6 +210,7 @@ export default class AdvancedFiltersModal extends Component { start: this.state.startDate ? this.state.startDate.format('YYYY-MM-DD') : null, end : this.state.endDate ? this.state.endDate.format('YYYY-MM-DD') : null, }, + notify_user : filters.notify_user }).then(response => { this.setState({ loading : false, @@ -538,7 +545,7 @@ export default class AdvancedFiltersModal extends Component {

Maximum of 3 emails per week.