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

Conflict between new Administration (owner) and new administration (partner) #782

Open
fredericlestage-vdm opened this issue Aug 28, 2019 · 4 comments
Labels

Comments

@fredericlestage-vdm
Copy link
Contributor

The way it is currently set up, new partner administration under the same gov. level will overwrite the changes to a new administration as the owner of the code project, or user of a software/standard

@fredericlestage-vdm
Copy link
Contributor Author

Just for clarity:
Partner administration refers to a new administration created via the partners field
Owner administration refers to an administration created through the new administration "pop up" which gives the file its name (for code and partnership).

@fredericlestage-vdm
Copy link
Contributor Author

Potential solution:

Adapt the getNewPartnerPromise function

  • Move it to the adminForm (since its function will be to add administrations)
  • Rename it getNewAdminPromise
  • Changes its parameters to allow for the partner object AND the new owner administration
  • Add the new owner administration in the loop so its data is also added to the administration file
  • Update the submit function(s) in the [type]Form.js files to reflect that change.
    • PartnershipForm.js should be relatively easy since I changed the submit function flow to be more linear
    • The other might be a tad more complicated since there's two functions, one for submitting the form with a new administration and the other without. It might be a good idea to change it so the flow follows the same idea as the partnership submit function, it might be easier that way.

@fredericlestage-vdm
Copy link
Contributor Author

Another potential solution:

Add a functionality to filewriter.merge

  • Instead of fetching content from the file specified in the parameters of the merge function, allow passing content directly as a parameter.
  • That way we could update the content of a file without loosing previous changes made to it.
  • Then, when we add a new owner administration, put the file value (the object is already returned by the .merge function) in a variable, and when the new partner administration needs to be created, instead of using merge directly and overwriting the previous change, use the changed content stored in the variable instead and merge on that.

@simon332114
Copy link
Contributor

simon332114 commented Apr 23, 2020

Attempted to replicate this bug with the code form since software/standard don't have a partners field. The code file was created with no problem. However, only the new partner administration was added to the _data/administrations/municipal.yml file, with the new administration itself nowhere to be found. Doesn't seem to be the same bug as described here.
Test done with PR #1141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants