Commit Graph

10 Commits

Author SHA1 Message Date
Javi Martín
d18c627392 Add and apply Layout/EmptyLinesAfterModuleInclusion rule
This rule was added in rubocop 1.79. We were inconsistent about it, so
we're adding it to get more consistency.
2025-11-05 14:27:12 +01:00
Javi Martín
11832cc07d Make it easier to customize allowed parameters
When customizing CONSUL, one of the most common actions is adding a new
field to a form.

This requires modifying the permitted/allowed parameters. However, in
most cases, the method returning these parameters returned an instance
of `ActionController::Parameters`, so adding more parameters to it
wasn't easy.

So customizing the code required copying the method returning those
parameters and adding the new ones. For example:

```
def something_params
  params.require(:something).permit(
    :one_consul_attribute,
    :another_consul_attribute,
    :my_custom_attribute
  )
end
```

This meant that, if the `something_params` method changed in CONSUL, the
customization of this method had to be updated as well.

So we're extracting the logic returning the parameters to a method which
returns an array. Now this code can be customized without copying the
original method:

```
alias_method :consul_allowed_params, :allowed_params

def allowed_params
  consul_allowed_params + [:my_custom_attribute]
end
```
2022-04-07 19:35:40 +02:00
taitus
ac144d172d Move document attributes to concern 2021-04-09 16:21:00 +02:00
decabeza
47985df4f3 Fix request_to_administrators checkbox on admin dashboard actions 2019-04-29 15:46:38 +02:00
decabeza
2cff3767c1 Remove open in new tab option for links 2019-04-24 13:58:13 +02:00
decabeza
91be3cf775 Fix more hound warnings 2019-03-27 15:22:14 +01:00
taitus
082cc41a1e Allow admin set published_proposal field 2019-02-02 17:45:55 +01:00
Juan Salvador Pérez García
491e6e4b6e Fixes action sorting
Administration of dashboard actions currently shows proposed actions as
well as resources mixed. This patch tries to improve how they're shown
making things easier for administrators:

Resources will be shown after proposed actions, never mixed.
Proposed actions will be sorted according to the order attribute.

Resources will be sort according the two attributes that define its
availability:

The number of supports required.
The number of days after the proposal publication.
2018-10-04 11:47:14 +02:00
Juan Salvador Pérez García
4d0359f334 Changed defaults for new proposed action/resource.
Previously, action as requesting some action from administrators by
default. Now this flag is false by default when a new proposed
action/resource is created.
2018-09-14 16:36:47 +02:00
Juan Salvador Pérez García
e5f9cf6710 Fixed #239
Proposals dashboard refactored to dashboard.
Added missing specs for the dashboard.
2018-07-24 15:52:43 +02:00