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

* support copying tags #2

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

Conversation

jbostoen
Copy link

Tested on iTop 2.7; but not on iTop 3 (I think it will work though).

I added a similar hack to the existing ones to support tags.

Basically the main issue is that while you attempt to copy an object, the "orig_value" correctly gets set. In the GUI, it means tags are visible when creating a copy of an object (before confirmation). However, the elements are therefore not present in the "added" part. Resulting in the lack of tags when objects are created.

This implementation also allows adding/removing tags during the process (before clicking [Create]).

Basically right before submission, the value of the attribute gets rewritten:

  • from the original attribute values, all the elements are kept which have not been removed by the user
  • a combination of the above + tags added manually by the user is created
  • orig_value and removed are both cleared
  • added becomes the result of above

@Molkobain Molkobain added this to First review needed in Combodo PR dashboard via automation Apr 29, 2022
@Molkobain Molkobain added the enhancement New feature or request label Apr 29, 2022
@Molkobain Molkobain moved this from First review needed to Pending technical review in Combodo PR dashboard Mar 7, 2023
@Molkobain Molkobain self-assigned this Mar 7, 2023
@Molkobain
Copy link
Member

Molkobain commented Mar 7, 2023

Hello Jeffrey,

Thanks for the PR but the fix is incorrect, it should not be done using a JS hack. The right place for this to work would be in iTopObjectCopier::CopyAttribute().

Do you feel like reworking the PR or should I close it?

@Molkobain Molkobain moved this from Pending technical review to Pending contributor update in Combodo PR dashboard Mar 7, 2023
@jbostoen
Copy link
Author

jbostoen commented Mar 7, 2023

Hello Jeffrey,

Thanks for the PR but the fix is incorrect, it should be done using a JS hack. The right place for this to work would be in iTopObjectCopier::CopyAttribute().

Do you feel like reworking the PR or should I close it?

Do you mean "without" or not with a JS hack?

Been using it myself for quite a while now.

I could make a different version, if it would be considered?

@Molkobain
Copy link
Member

I meant "without" indeed, thanks.
A different version would definitively be considered if it uses the right approach. :)

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
Status: Pending contributor update
Combodo PR dashboard
  
Pending contributor update
2 participants