constellation-app / constellation

A graph-focused data visualisation and interactive analysis application.
https://constellation-app.com
Apache License 2.0
385 stars 59 forks source link

Fix the issue when deleting templates #2156

Closed Auriga2 closed 1 month ago

Auriga2 commented 1 month ago

Prerequisites

Description of the Change

Templates can now be deleted (although the null pointer exception is thrown, which will be handled in a separate PR)

The cause was using File.pathSeparator ( ; ) in file path, which doesn't work with java.io.FILE E.g. C:\Users\user1\.CONSTELLATION\Graph Templates\au.gov.asd.tac.constellation.graph.schema.AnalyticSchemaFactory;New Template 1 doesn't exist to delete. Reverted back to use / instead.

Alternate Designs

Why Should This Be In Core?

No way to delete templates otherwise.

Benefits

Possible Drawbacks

Verification Process

  1. File Menu -> Select Manage Template
  2. Select a saved template from the dropdown list
  3. Click Delete button.
  4. Click Ok Button
  5. Open File -> Select Manage Template again and verify the above template is no longer available in the dropdown list

Applicable Issues

https://github.com/constellation-app/constellation/issues/2107

Auriga2 commented 1 month ago

Fixed the exception also in this PR, as it ended up being a few lines of code change.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud