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

[Display Layouts] Should use composition API for adding and removing children, not mutation #3482

Closed
akhenry opened this issue Oct 30, 2020 · 3 comments

Comments

@akhenry
Copy link
Contributor

akhenry commented Oct 30, 2020

Composition changes (adding and removing children) should always use the composition API. Right now display layouts are directly mutating object composition. Our API allows composition providers to define and store composition any way they want (eg. on a server via web services), but unfortunately right now some of our views assume that composition is always held on an object.

Instead of directly mutating the composition property, developers should use the composition API like so:

openmct.composition.get(domainObject).remove(childObject);
@AliMuhammadOfficial
Copy link

I want to work on this patch. it would be honor for me to send PR.

@ozyx
Copy link
Member

ozyx commented Nov 10, 2022

Testing Notes

  1. Create a Display Layout
  2. Add / remove objects to / from the layout
  3. Save
  4. Call this.openmct.composition.get(domainObject) in the console and verify that the composition is correct after each save
  5. Reorder the objects in the Elements Pool
  6. Save
  7. Call this.openmct.composition.get(domainObject) in the console and verify that the order of the composition is correct
  8. Repeat the same steps for Flexible Layout

@unlikelyzero
Copy link
Collaborator

Verified

@unlikelyzero unlikelyzero removed their assignment Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants