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

Added intelligent function when paste labels to another task #4161

Merged
merged 14 commits into from
Jan 17, 2022

Conversation

bsekachev
Copy link
Member

@bsekachev bsekachev commented Jan 13, 2022

Resolved #919
Resolved #3717

Motivation and context

  • Added intelligent paste labels function (when user pasts a text, the function filters all the "id" fields.
  • Added confirmation when delete labels via Raw editor (it was implicitly before)
  • A bit adjusted behaviour of labels editor in general

Screenshot_37

How has this been tested?

Manual testing

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT

@bsekachev bsekachev added the bug Something isn't working label Jan 13, 2022
@bsekachev bsekachev changed the title [WIP] Added intelligent function when paste labels to another task Added intelligent function when paste labels to another task Jan 13, 2022
@bsekachev
Copy link
Member Author

@klakhov Could you please review the patch? Try to value the solution and find cases when it does not work

@bsekachev
Copy link
Member Author

@nmanovic

Maybe additionally to delete on the server label/attribute IDs when create a new task/project?
And when updating a task/project, to delete any unknown IDs?

@klakhov
Copy link
Contributor

klakhov commented Jan 13, 2022

@bsekachev I've tried patch and it works as expected. No errors occur after labels copying.

Also I think its better to hide deleted labels/attributes paragraph if list is empty:
image

Btw why do we need to remove carriages if textarea does not contain them?

// remove all carriage characters (textarea value does not contain them)
replaced = replaced.replace(/\r/g, '');

@bsekachev bsekachev changed the title Added intelligent function when paste labels to another task [WIP] Added intelligent function when paste labels to another task Jan 13, 2022
@bsekachev
Copy link
Member Author

@nmanovic

I did the proposed changes above

@bsekachev
Copy link
Member Author

@klakhov

Also I think its better to hide deleted labels/attributes paragraph if list is empty:

Sure, I did.

Btw why do we need to remove carriages if textarea does not contain them?

It is related with textarea properties selectionStart, selectionEnd. They don't consider \r characters (maybe it is a bug, I don't know). Also when we enter something manually it does not add \r characters to the field (and does not add it when we fill out the field from a labels specification). So, I've decided just to ignore all such characters from clipboardData because they can appear only from this place.

@bsekachev bsekachev changed the title [WIP] Added intelligent function when paste labels to another task Added intelligent function when paste labels to another task Jan 14, 2022
@nmanovic
Copy link
Contributor

@bsekachev , I'm find with the PR. The only concern I have for now is about update operation and removing id. Could you please share your ideas why you think the implemented solution is right?

Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

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

LGTM

@bsekachev bsekachev merged commit 796991a into develop Jan 17, 2022
@bsekachev
Copy link
Member Author

@dvkruchinin

Could you please prepare a test with the following scenario:

  1. From an existing task copy all labels and attributes (from the Row tab of the labels editor) (It must have at least one task and one attribute)
  2. Go to the project create page, in the labels editor paste the copied text (ctrl + v)
  3. Inserted JSON copy must not contain any "id": fields
  4. A project can be created with no errors

@dvkruchinin
Copy link
Contributor

@dvkruchinin

Could you please prepare a test with the following scenario:

@bsekachev
Sure. A test will be prepared.

@bsekachev bsekachev deleted the bs/fixed_issue_3717 branch January 18, 2022 10:55
@nmanovic nmanovic mentioned this pull request Mar 4, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants