Skip to content

Commit

Permalink
remove editable fields for ingredients
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyevil committed Oct 17, 2023
1 parent 3dd76ac commit fa49673
Showing 1 changed file with 43 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,50 @@
value: { text: get_notification_type_name(component.notification_type) },
},
if component.predefined?
{
key: { text: "Frame formulation" },
value: { text: get_frame_formulation_name(component.frame_formulation) },
actions: {
items: [
{
href: responsible_person_notification_product_path(notification.responsible_person, notification, :add_product_image),
text: "Edit",
visuallyHiddenText: "product image",
classes: ["govuk-link--no-visited-state"]
}
]
},
}
if component.notification.editable?
{
key: { text: "Frame formulation" },
value: { text: get_frame_formulation_name(component.frame_formulation) },
actions: {
items: [
{
href: responsible_person_notification_component_build_path(component.notification.responsible_person, component.notification, component, :select_frame_formulation),
text: "Edit",
visuallyHiddenText: "frame formulation",
classes: ["govuk-link--no-visited-state"]
}
]
},
}
else
{
key: { text: "Frame formulation" },
value: { text: get_frame_formulation_name(component.frame_formulation) },
}
end
elsif component.formulation_file.attached?
{
key: { text: "Formulation" },
value: { html: render("notifications/component_details_formulation_ingredients",
component: component) },
actions: {
items: [
{
href: responsible_person_notification_product_path(notification.responsible_person, notification, :add_product_image),
text: "Edit",
visuallyHiddenText: "product image",
classes: ["govuk-link--no-visited-state"]
}
]
},
}
if component.notification.editable?
{
key: { text: "Formulation" },
value: { html: render("notifications/component_details_formulation_ingredients",
component: component) },
actions: {
items: [
{
href: responsible_person_notification_component_build_path(component.notification.responsible_person, component.notification, component, :upload_ingredients_file),
text: "Edit",
visuallyHiddenText: "formulation",
classes: ["govuk-link--no-visited-state"]
}
]
},
}
else
{
key: { text: "Formulation" },
value: { html: render("notifications/component_details_formulation_ingredients", component: component) },
}
end
end
].compact
) %>
Expand Down

0 comments on commit fa49673

Please sign in to comment.