2022-11-30 10:13:17 +01:00
|
|
|
|
class Profile::APITokenComponent < ApplicationComponent
|
|
|
|
|
def initialize(api_token:, packed_token: nil)
|
|
|
|
|
@api_token = api_token
|
|
|
|
|
@packed_token = packed_token
|
|
|
|
|
end
|
2023-02-28 16:33:22 +01:00
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def procedures_to_allow_options
|
2023-09-12 17:06:55 +02:00
|
|
|
|
@api_token.targetable_procedures.map { ["#{_1.id} – #{_1.libelle}", _1.id] }
|
2023-02-28 16:33:22 +01:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def procedures_to_allow_select_options
|
2023-09-12 17:06:55 +02:00
|
|
|
|
{ selected: @api_token.targetable_procedures.first&.id }
|
2023-02-28 16:33:22 +01:00
|
|
|
|
end
|
2022-11-30 10:13:17 +01:00
|
|
|
|
end
|