ICRAR / EAGLE

Editor for the Astronomical Graph Language Environment
GNU Lesser General Public License v3.0
0 stars 1 forks source link

EAGLE-1333: Remove Eagle.FileType.Daliuge #763

Closed james-strauss-uwa closed 1 week ago

james-strauss-uwa commented 1 week ago

This filetype was added back when we were considering having a completely new file type to include the GraphConfigs. A "daliuge" file. In the end, we just placed the graph configs inside the LogicalGraph, removing the need for a new file type.

Also, changed the "type" attribute on the Field class from a string to a Daliuge.DataType. This is a little unusual, since the "type" for a field can be anything. "MeasurementSet" or "Object.Observation" etc. It doesn't just have to be a known value within the Enum. But typescript allows you to give arbitrary values to Enums, so it is not an issue in practice. And it does have some advantages in code completion/typing.

Summary by Sourcery

Enhancements:

sourcery-ai[bot] commented 1 week ago

Reviewer's Guide by Sourcery

This PR removes the unused Eagle.FileType.Daliuge and updates the Field class's type attribute from string to Daliuge.DataType enum. The changes primarily involve removing code related to the Daliuge file type and adjusting file type handling throughout the codebase.

Updated class diagram for the Eagle class

classDiagram
    class Eagle {
        + logicalGraph() LogicalGraph
        + saveGraphToDisk(graph: LogicalGraph)
        + showEagleIsLoading()
        + showUserMessage(title: string, message: string)
        + determineEagleVersion(dataObject: any) string
    }
    note for Eagle "Removed handling for Eagle.FileType.Daliuge."

File-Level Changes

Change Details Files
Removed Eagle.FileType.Daliuge enum value and related code
  • Removed Daliuge from FileType enum
  • Removed file extension handling for .dlg files
  • Updated file type number mapping sequence
  • Removed Daliuge-specific JSON validation logic
  • Removed Daliuge file type handling from file operations
src/Eagle.ts
src/Utils.ts
src/Repositories.ts
src/Modals.ts
src/RepositoryFile.ts
Changed Field class type attribute from string to Daliuge.DataType
  • Updated type attribute declaration to use Daliuge.DataType
  • Modified type-related method signatures to use Daliuge.DataType
  • Added type casting for string concatenation with Daliuge.DataType
  • Updated type comparison to use toString() for compatibility
src/Field.ts
src/Utils.ts
src/Eagle.ts

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).