Skip to content

Update network button #533

@georgiana-b

Description

@georgiana-b

As part of georgiana-b/defense-elvis-backend#19 we already added the functionality to update a network.

However, as discussed with the clients, we don't want to set off the update automatically because we want to give the user the opportunity to take a photo of the existing network before regenerating it, just in case they want to do a comparison later.

Therefore, we need to create a mechanism to:

  1. signal to the user that an existing network needs updating
  2. provide the controller logic to actually set off the update

On the backend, a new field will be added to the Network: need_update: true/false. This field will be set to true after a new data import, to signal that the network needs to be regenerated in order to include the latest data.

Then on frontend, on GET /network/{id}, if the network has needs_update: true and the user is the owner of the network, we will display a message that says:

The underlying data of this network has been updated. Please regenerate the network to make sure you see the latest data and avoid inconsistencies: [BUTTON TO REGENERATE]

I suggest we use the word REGENERATE instead of UPDATE just because we want to convey to the user that some of the data will be lost.
However I think it's also necessary to have a tooltip with extra information explaining that: Some of the nodes will be removed, some will be added and some will be updated. We will keep in the cluster the nodes that haven't been removed and we will recalculate the cluster based on their latest values.

Pushing REGENERATE will sent a request on PUT /network/{id} that will return the updated network. Then we just render the update network as we would after a GET or CREATE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions