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

WIP: Refactoring ideas collection #137

Open
5 tasks
JannikStreek opened this issue Nov 15, 2022 · 0 comments
Open
5 tasks

WIP: Refactoring ideas collection #137

JannikStreek opened this issue Nov 15, 2022 · 0 comments

Comments

@JannikStreek
Copy link
Member

JannikStreek commented Nov 15, 2022

Refactoring ideas

Frontend

  • Mmp data types include non mmp related entities, like deletedAt => remove those from mmp types
  • Change flow of application: Async request to create the map, then redirect to the map.
  • Make a guard out of the admin id check in the gateway
  • Make use of a transaction for updateMap call in mapService. Currently, existing nodes are deleted before the json is imported. Thats fine but should be wrapped inside a transaction block. Otherwise the import fails and the map is completly empty.
  • Refactor file download logic, use window.URL.createObjectURL and try to to remove fakeLink, e.g. by using open
  public static downloadFile(name: string, content: string) {
    const fakeLink = document.createElement('a');

    const blob=new Blob([content]);
    const objectUrl = window.URL.createObjectURL(blob);

    fakeLink.href = objectUrl;
    fakeLink.download = name;

    document.body.appendChild(fakeLink);

    fakeLink.click();

    window.URL.revokeObjectURL(objectUrl)
    document.body.removeChild(fakeLink);
  }
@JannikStreek JannikStreek changed the title Refactoring ideas WIP: Refactoring ideas collection 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

1 participant