research-software-directory / RSD-as-a-service

This repo contains the new RSD-as-a-service implementation
https://research.software
22 stars 15 forks source link

feat: admins can set parent organisation #1178

Closed cmeessen closed 2 months ago

cmeessen commented 2 months ago

Admins can set parent organisation in frontend

Closes #1177

Changes proposed in this pull request:

image

How to test:

PR Checklist:

dmijatovic commented 2 months ago

One general remark. Changing the slug or the parent value will completely break the organisation page (404). This is solved on edit software slug page (see ...software/edit/information/AutosaveSoftwareTextField.tsx, line 55).

Maybe is more suitable to move the complete rsd admin section to rsd admin pages and extend editing the organisation props there? The other location could be parent organisation/add research unit?

I am curious what others think about the location of rsd admin feature(s).

cmeessen commented 2 months ago

One general remark. Changing the slug or the parent value will completely break the organisation page (404). This is solved on edit software slug page (see ...software/edit/information/AutosaveSoftwareTextField.tsx, line 55).

The page is now reloaded using the correct slug.

Maybe is more suitable to move the complete rsd admin section to rsd admin pages and extend editing the organisation props there? The other location could be parent organisation/add research unit?

That could potentially make sense, however as there were already fields that could only be set by admins I found it the most straight forward way to also set the parent here.

cmeessen commented 2 months ago

Ready to merge from my point of view

jmaassen commented 2 months ago

When I set or unset the parent ID and leave the focus of the parentID field I get redirected to an API endpoint?

For example, whet I create two organizations in an empty RSD (using ROR 00rbjv475 and 037aan677):

Screenshot 2024-04-24 at 12-36-58 Organisations Admin page Research Software Directory

And then copy the ID of NL eScience and set it as parent ID of NZ eScience:

Screenshot_2024-04-24_12-37-23

Then when leaving the ParentID field, the next screen I get is this:

Screenshot_2024-04-24_12-40-55

Is that the expected behavior? (I'm on firefox by the way).

cmeessen commented 2 months ago

Apologies, @dmijatovic was right, there was a typo with the url variable. I fixed it and it works now.

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed for 'rsd-frontend'

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud