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

Fix auto-naming counter and align id with name when creating new entity #69

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

martin-fleck-at
Copy link
Collaborator

  • Add tests for utility functions

Fixes #48

Copy link

github-actions bot commented Oct 7, 2024

Unit Test Results

 3 files  ±0  18 suites  ±0   2m 18s ⏱️ -35s
25 tests ±0  25 ✅ ±0  0 💤 ±0  0 ❌ ±0 
75 runs  ±0  75 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f49baa0. ± Comparison against base commit a38f61d.

♻️ This comment has been updated with latest results.

@harmen-xb
Copy link
Contributor

@martin-fleck-at

Changes look good, the behaviour on attribute is indeed as expected.

Two things I notice:

  • When creating an entity via the diagram, I cannot type the entity name before the actual entity is created (like I can via explorer, or like when adding attribute via the form). This means the ID of the Entity will be NewEntity, NewEntity1, etc.
  • When creating an entity with the ID NewEntity, adding some attributes and saving. And then removing the Entity, save. And then add a new Entity 'NewEntity' the deleted Entity is kinda re-used somehow, bevause the NewEntity has the attributes from the removed entity.

@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb Thank you for the review! The first thing I can re-produce. I'll see what we can do about that in the short-term to make that nicer. However, the second point, i cannot really reproduce. Does that happen in the diagram or what is the exact workflow here?

@harmen-xb
Copy link
Contributor

@martin-fleck-at

To reproduce:

  1. Create an entity via a system diagram without changig the name.
  2. Add some attributes to the entity and save.
  3. Remove the new entity from the diagram and object explorer.
  4. Add a new Entity via the diagram without specifying a name

Obervation: In the entity created in the last step attributes are already there as if the deleted entity object is re-used.

- Introduce edit behavior for entity names in diagram
- Fix problem of left-over text documents after deletion
@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb I had a deeper look into this and managed to fix both problems.

@harmen-xb
Copy link
Contributor

@martin-fleck-at This indeed works better :)

Is it possible to write the new entity file after the name is typed in the diagram? Cause now when you add a new entity to a diagram the 'NewEntity' file is already created (before typing the real name of the entity). Would be nice if file name would be the same as the ID.

@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb I think I could look into that but it would be like developing a complete new tool so it might be some effort. Would it be an idea to simply rename the file according to the new name, similar to what Java usually proposes?

@harmen-xb
Copy link
Contributor

harmen-xb commented Oct 18, 2024

@harmen-xb I think I could look into that but it would be like developing a complete new tool so it might be some effort. Would it be an idea to simply rename the file according to the new name, similar to what Java usually proposes?

@martin-fleck-at Yes, if you could rename the file if the Id changes that would be great! This would in the end be a generic behaviour for all files to rename the file if the Id changes. So we could also pick this up in a separate branch.

@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb Great, should we create a ticket for this and then merge this PR?

Copy link
Contributor

@harmen-xb harmen-xb left a comment

Choose a reason for hiding this comment

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

Code changs look good.

@harmen-xb
Copy link
Contributor

@harmen-xb Great, should we create a ticket for this and then merge this PR?

Yes, I reviewed code and approved it.

@martin-fleck-at martin-fleck-at merged commit 5bd00ad into main Oct 18, 2024
5 checks passed
@harmen-xb harmen-xb deleted the feature/issue-48 branch October 31, 2024 08:28
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.

Adding attribute via entity form results in incorrect entity file
2 participants