Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to paste multiple ingredients/instructions at once #325

Closed
stativ opened this issue Oct 1, 2020 · 3 comments · Fixed by #379
Closed

Ability to paste multiple ingredients/instructions at once #325

stativ opened this issue Oct 1, 2020 · 3 comments · Fixed by #379
Assignees
Labels
enhancement New feature or request

Comments

@stativ
Copy link

stativ commented Oct 1, 2020

Use Case
I have a recipe with ingredients with each ingredient on a separate line. I dare to say this is a common format that is used across many websites. Assume I have the recipe in a text file or I have found the recipe on a website that doesn't use schema.org. Now I want to enter it into the Cookbook. A similar case applies to the instructions, where steps can be separated by an empty line.

Current Situation
Right now I have to copy-paste each ingredient separately.

Suggested Solution
When multiple lines are pasted into the ingredient input field, they are automatically split by newline and entered as several ingredients. An example of such behaviour can be found in the Gourmet Recipe Manager where pasting multiline input into the ingredient field automatically adds multiple ingredients. A similar behaviour can be also found in OpenEats which uses a single form to enter ingredients one ingredient per line.

For instructions, it would be nice to split them into separate steps at empty lines.

@stativ stativ added the enhancement New feature or request label Oct 1, 2020
@christianlupus
Copy link
Collaborator

@sam-19 I assume, this is no big issue to realize this from the GUI perspective, right? It should be sufficient to make the input field multiline.

I see two ways:

  1. The multiline text is kept during the editing view. After sending to the backend the lines are split accordingly. The recipe is then viewed and the ingredients/instructions are separated accordingly.
  2. Once a newline character is entered using pasting, in Vue the splitting is done. Thus, during editing the individual entries are already separated and the backend can work just as it is doing now.

What do you think of that? In the backend I can help. Please tell me your thoughts.

@sam-19
Copy link
Contributor

sam-19 commented Oct 11, 2020

I would prefer option 2, as this is more WYSIWYG and the recipe doesn't come back looking different after it has been saved. I'll take a look at this soon.

@seyfeb
Copy link
Collaborator

seyfeb commented Nov 9, 2020

I created PR #379 for this feature. Please check it out.
Currently it’s only creating new fields for tools and ingredients since i wasn’t sure if it would also be expected behavior for the recipe steps.

Edit: On second thought, and reading this thread again, it probably makes sense to have the same behavior for the instructions, so I added it there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants