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

feat: add multiple options with one paste #1407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hamza221
Copy link
Contributor

@hamza221 hamza221 commented Nov 12, 2022

This fixes #337 by adding a NcDialog that let's you paste multiple options into a textfield and adds a new option per line.

Unbenannt.webm

Signed-off-by: hamza221 [email protected]

@hamza221 hamza221 marked this pull request as draft November 12, 2022 20:43
@hamza221 hamza221 changed the title add multiple options with one paste ##337 add multiple options with one paste #337 Nov 12, 2022
@hamza221 hamza221 marked this pull request as ready for review November 19, 2022 18:42
Copy link
Collaborator

@Chartman123 Chartman123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the specific layout problem, I also get some errors when I paste a blank line or remove the text from an option so that it's empty

src/components/Questions/AnswerInput.vue Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 24, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.67%. Comparing base (8e0f7e0) to head (b378a00).

Current head b378a00 differs from pull request most recent head ad1ac93

Please upload reports for the commit ad1ac93 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1407      +/-   ##
============================================
- Coverage     45.02%   37.67%   -7.36%     
+ Complexity      720      514     -206     
============================================
  Files            61       49      -12     
  Lines          2776     1911     -865     
============================================
- Hits           1250      720     -530     
+ Misses         1526     1191     -335     

@hamza221
Copy link
Contributor Author

hamza221 commented Dec 24, 2022

I pushed a quick POC of @jotoeri 's idea.

... How about a modal here, too? Just keep everything as it is with simple inputs and add a modal(-component) to the actions-menu, that has one large textarea? Or even better the NcRichContenteditable then...

If everyone agrees this is the way to go, I would appreciate some design advices. from @jancborchardt or anyone who has an input on the matter.

Happy holidays everyone 🎄

@Chartman123
Copy link
Collaborator

@hamza221 I like the modal 🎉 Especially the representation of the options below the input field. I think it might be useful to show a text that makes it clear that you have to use new lines for new options.

@susnux susnux added enhancement New feature or request 2. developing Work in progress labels Feb 6, 2023
@hamza221 hamza221 force-pushed the feat/multiple-options-paste branch from b378a00 to fc511c4 Compare May 22, 2023 19:52
@hamza221
Copy link
Contributor Author

I only rebased and fixed conflicts, still not ready for review

@susnux susnux marked this pull request as draft October 21, 2023 22:40
@Chartman123
Copy link
Collaborator

@susnux @hamza221 I did some rebasing and refactoring of the code. The modal/dialog itself works like expected. However the functionality and design still needs some more love. I think we could get this ready without too much effort for 4.3.

@Chartman123 Chartman123 added this to the 4.3 milestone May 18, 2024
@Chartman123 Chartman123 changed the title add multiple options with one paste #337 add multiple options with one paste May 18, 2024
@Chartman123 Chartman123 requested review from susnux and Chartman123 and removed request for Chartman123 May 20, 2024 11:33
@Chartman123 Chartman123 added 3. to review Waiting for reviews feature: 📑 form creation and removed 2. developing Work in progress labels May 20, 2024
@Chartman123 Chartman123 marked this pull request as ready for review May 20, 2024 11:33
@Chartman123 Chartman123 self-requested a review May 20, 2024 11:34
Chartman123
Chartman123 previously approved these changes May 20, 2024
@Chartman123 Chartman123 added the design Related to the design label May 20, 2024
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bubbles below with the recognized options (that's what it is, right?) could be using the regular tag style like in Mail. :)

@Chartman123
Copy link
Collaborator

The bubbles below with the recognized options (that's what it is, right?) could be using the regular tag style like in Mail. :)

Yes, that's what these are for :) good idea 👍🏻

@Chartman123
Copy link
Collaborator

@jancborchardt I think the NcSelect component fits our needs here as well and is less code to implement. I also added a loading indicator as it might take some time until all options get created on the server.

@susnux susnux force-pushed the feat/multiple-options-paste branch from ff1a3ff to edb6da2 Compare May 21, 2024 09:51
src/components/OptionInputModal.vue Outdated Show resolved Hide resolved
src/components/OptionInputModal.vue Outdated Show resolved Hide resolved
src/components/OptionInputModal.vue Outdated Show resolved Hide resolved
src/components/OptionInputModal.vue Outdated Show resolved Hide resolved
padding: 20px;
}

:deep(.v-select) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this custom styles for the select?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To have it the whole width of the dialog and a slightly bigger margin on top of it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@susnux Can we resolve this conversation or do you have a better solution for the styling?

src/components/Questions/QuestionDropdown.vue Outdated Show resolved Hide resolved
src/components/Questions/QuestionDropdown.vue Outdated Show resolved Hide resolved
@Chartman123 Chartman123 force-pushed the feat/multiple-options-paste branch 2 times, most recently from 571e7ef to 1582bb4 Compare May 24, 2024 08:44
@Chartman123 Chartman123 changed the title add multiple options with one paste feat: add multiple options with one paste May 24, 2024
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very nice, just some details :)

  • "Multiple options" should have a lowercase "o" as per "Sentence case"
  • "Entered options" wording is a bit strange, maybe better "Options summary"
  • The "Cancel" button should not have an icon as it’s not primary.
  • The loading time on adding the options is quite long, can that be optimized somehow?

@Chartman123
Copy link
Collaborator

Chartman123 commented Jun 5, 2024

  • The loading time on adding the options is quite long, can that be optimized somehow?

@jancborchardt We already looked into it. The problem is that we can only submit one option per API request at the moment. So we could do three things:

  • send all requests at basically the same time and await all responses to then store the server ID/order of the options to the front end. -> Options won't keep the original order from the input. (optional with checkbox?)

  • keep it that way and adjust API in the future to post several options in one request

  • keep it that way and adjust API in the future to add the order to the post request

  • "Entered options" wording is a bit strange, maybe better "Options summary"

What about just "Options"?

@susnux
Copy link
Collaborator

susnux commented Jun 8, 2024

What about just "Options"?

👍

@susnux
Copy link
Collaborator

susnux commented Jun 8, 2024

keep it that way and adjust API in the future to add the order to the post request

I think this is hard as setting the order requires to know the total amount of options which is hard to validate on the backend, e.g. if option 5 arrives before option 4.

send all requests at basically the same time and await all responses to then store the server ID/order of the options to the front end. -> Options won't keep the original order from the input. (optional with checkbox?)

For the mentioned reason this is bad UX

keep it that way and adjust API in the future to post several options in one request

I think this is the way to go

@Chartman123
Copy link
Collaborator

@susnux ok, so we merge this and do a follow up for the new API version?

@Chartman123 Chartman123 self-assigned this Jun 8, 2024
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me then, thanks for the explanation. :)

@Chartman123 Chartman123 force-pushed the feat/multiple-options-paste branch 2 times, most recently from f41fbb6 to 4231cf5 Compare June 13, 2024 22:13
Signed-off-by: hamza221 <[email protected]>
Signed-off-by: Christian Hartmann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews design Related to the design enhancement New feature or request feature: 📑 form creation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input Drop-Down list via csv file
5 participants