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 support to order tasks by drag drops and dragging mail items #22

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

ErikLevin
Copy link

@ErikLevin ErikLevin commented Sep 3, 2021

New features and bug fixes related to drag and drop, and to having INCLUDE_TODOS (mail items enabled).

With this change. task cards (both tasks and e-mail items) can be dragged within a column, and make the resulting order stick. This was done by setting the ToDoTaskOrdinal property of the TaskItem.

Added a new config parameter to enable or disable this feature, "USE_ORDINALS". If this is true, sorting on ordinals is forced and the other sorting config of individual columns will be ignored (it doesn't make sense to set ToDoTaskOrdinal and then sort on something else).

It is also possible to drag flagged mail items between the columns, as was suggested in #5. This is accomplished by setting the FlagRequest property. It is possible to drag it to and from the Completed column as well with expected results.

Renamed config parameter INCLUDE_TODOS_STATUS to INITIAL_MAIL_STATUS.

Fixed script errors with dragging a task item to another column, and dragging a mail item at all. Don't attempt to move tasks at all when INCLUDE_TODOS is set since all tasks come from the same "folder" in this case and it is not possible to have different subfolders when using this feature anyway. Don't attempt to set status for MailItems since that property does not exist for them.

Fixed so the buttons to add tasks work when INCLUDE_TODOS is set.

Changed default config slightly to avoid e-mails flagged as completed to appear in columns when INCLUDE_TODOS is enabled.

Some other small fixes.

When an item is dropped, will now set the Ordinal property of all items
in that column. This only works in to do-list mode... maybe? For now,
this feature is always enabled when INCLUDE_TODOS is, and all columns
are then sorted on Ordinals always, overriding sorting config.
Added configuration parameter USE_ORDINALS which if set will allow drag
and drop to sort issues in columns (and ignore any other sorting
settings).
Added filter for completed tasks to default config. This is to prevent
e-mails flagged as completed to show up in those columns.
Reverted unrelated change.
Ordinal property does not exist for MailItems, but ToDoTaskOrdinal
exists for both TaskItems and MailItems and can be used.
It now works to add new tasks to the board when using INCLUDE_TODOS. It
didn't work before because that folder is not allowed to Add to.

Sometimes the new task does not appear without a manual reload. Perhaps
it is a race condition between the reload on event AfterWrite and the
addition of the task to the To-Do List. Not sure. I have tried using
other events like Items.ItemAdd but have not managed to make it work.
Don't attempt to set status for MailItem objects, it is not possible.
It is now possible to drag flagged mail items between the columns and
they will stick to the dropped column. This is accomplished by setting
the FlagRequest property. It is possible to drag it to and from the
Completed column as well with expected results.

Renamed config parameter INCLUDE_TODOS_STATUS to INITIAL_MAIL_STATUS.
@ErikLevin ErikLevin changed the title Add possibility to drag tasks in columns to sort them Add support to order tasks by drag drops and dragging mail items Sep 4, 2021
@maltehi
Copy link
Owner

maltehi commented Sep 5, 2021

Thanks, that looks really good! Will hopefully get to try it out and merge it next week.

When an item is dropped, will now set the Ordinal property of all items
in that column. This only works in to do-list mode... maybe? For now,
this feature is always enabled when INCLUDE_TODOS is, and all columns
are then sorted on Ordinals always, overriding sorting config.
Added configuration parameter USE_ORDINALS which if set will allow drag
and drop to sort issues in columns (and ignore any other sorting
settings).
Added filter for completed tasks to default config. This is to prevent
e-mails flagged as completed to show up in those columns.
Reverted unrelated change.
Ordinal property does not exist for MailItems, but ToDoTaskOrdinal
exists for both TaskItems and MailItems and can be used.
It now works to add new tasks to the board when using INCLUDE_TODOS. It
didn't work before because that folder is not allowed to Add to.

Sometimes the new task does not appear without a manual reload. Perhaps
it is a race condition between the reload on event AfterWrite and the
addition of the task to the To-Do List. Not sure. I have tried using
other events like Items.ItemAdd but have not managed to make it work.
Don't attempt to set status for MailItem objects, it is not possible.
It is now possible to drag flagged mail items between the columns and
they will stick to the dropped column. This is accomplished by setting
the FlagRequest property. It is possible to drag it to and from the
Completed column as well with expected results.

Renamed config parameter INCLUDE_TODOS_STATUS to INITIAL_MAIL_STATUS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants