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

Add task configurations download as csv #4491

Merged
merged 14 commits into from
Mar 31, 2020

Conversation

MichaelBuessemeyer
Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer commented Mar 20, 2020

This PR adds the download one or multiple task configurations as csv to wk. The download is available

  • when creating one or multiple tasks
  • in the task list view for each individual task
  • at the top of of the table in the task list view to download the configurations of all loaded and filtered tasks

URL of deployed dev instance (used for testing):

Steps to test:

  • Open the single task creation form and create a task. Upon success, a download of a CSV containing the configurations of the created task should be triggered,
  • The same goes for the bulk creation. Please test whether the download works correctly for multiple tasks at the same time.
  • In the task list view please also check the individual configurations download and the download of all tasks shown in the table.

Issues:


@MichaelBuessemeyer
Copy link
Contributor Author

@normanrz I'll unassign you as @philippotto is available

@MichaelBuessemeyer MichaelBuessemeyer requested review from philippotto and removed request for normanrz March 24, 2020 10:38
@MichaelBuessemeyer
Copy link
Contributor Author

@philippotto Could you please review this PR? I just added the changelog entry and the code should be cleaned up 🧹

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Cool stuff! However, see my few suggestions. Most notably, the format of the CSV should match the existing format which is currently shown in the modal.

Also, I think that constructing a CSV does not make much sense if it contains only one line. To solve this, I'd simply show a modal (as before) with the CSV content (only if tasks.length < 50 or so) and an additional "download as csv" button. If there are more than 50 tasks, the modal should still open and it would say "too many tasks to display in the browser. please download as csv" or something like that.
This has the additional benefit, that the user is in control over the download (i.e., they have to click a download button) and not surprised by it (or even worse he might even miss that something was downloaded).
Sorry for the change of plans, but I hope that it's not too much trouble :)

frontend/javascripts/admin/task/task_list_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_list_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_list_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_search_form.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_create_form_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_create_form_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_create_form_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_create_form_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_create_form_view.js Outdated Show resolved Hide resolved
@MichaelBuessemeyer
Copy link
Contributor Author

@philippotto Thanks for your feedback 👍

Sorry for the change of plans, but I hope that it's not too much trouble :)

No problem, this does not bother me. My main goal is to have clean code and the best UX. I missed that some browsers are configured to automatically download files without any pop-up. In my case firefox always opens a dialog and asks whether to download a file. That's why I did not see this as a problem :)

Just give me some time to implement this

@MichaelBuessemeyer
Copy link
Contributor Author

@philippotto The newest version should include all of your feedback. Could you please have a look at the changes again 😄?

 * remove individual download in task list view
@MichaelBuessemeyer
Copy link
Contributor Author

This file might be useful for testing the bulk creation. It should contain some valid tasks and some broken ones 👍
bulk_creation_test.txt

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Awesome! This will be a pretty nice update for the admins :)

I left some minor remarks, and I also have some suggestions to make the UI a bit nicer:

image

in summary:

  • bold labels
  • max-height: 300px and overflow: auto
  • right-aligned download buttons
  • spacer

Also, the UI for the "too many tasks" case looks a bit unpolished:
image

I suggest to change it like this (note that I centered the download button, since it's the main content of that section):
image

frontend/javascripts/messages.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_search_form.js Outdated Show resolved Hide resolved
handleFormSubmit = (isRandom: boolean, event: ?SyntheticInputEvent<*>) => {
handleFormSubmitWithSubsequentCall = (
isRandom: boolean,
subsequentMethod: QueryObject => Promise<void>,
Copy link
Member

Choose a reason for hiding this comment

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

subsequentMethod is quite an unusual name, in my opinion. I'd go with onFinish, onFinishCallback or onFinishFunction instead. Also, the method name can remain at handleFormSubmit, since the method name doesn't need to explain its parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As you noticed correctly, I had problems with finding a good naming here. 😕
The reason why I renamed the handleFormSubmit method is, that this name was already used in line 142.

But in my opinion, the naming should be fine now in the newest changes. 👍

frontend/javascripts/admin/task/task_create_form_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_create_form_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_create_form_view.js Outdated Show resolved Hide resolved
frontend/javascripts/admin/task/task_create_form_view.js Outdated Show resolved Hide resolved
@MichaelBuessemeyer
Copy link
Contributor Author

Thanks a lot for your very detailed feedback and also for the very good suggestions on how to improving the UI 😄

The look of the current version:
image

image

@philippotto Could you please review the newest changes / version of this PR? (I hope I did not miss something 🙈 )

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Awesome :) 🕺

@MichaelBuessemeyer MichaelBuessemeyer merged commit 969d6ff into master Mar 31, 2020
@philippotto philippotto deleted the add-task-settings-as-csv-download branch June 14, 2022 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow to download taskid-editposition mapping after task creation later
2 participants