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

1294 categories for organisations #1315

Merged
merged 9 commits into from
Oct 24, 2024

Conversation

dmijatovic
Copy link
Contributor

@dmijatovic dmijatovic commented Oct 8, 2024

Categories for organisations

Closes #1294

Changes proposed in this pull request:

  • Organisation maintainer can create custom categories to be used by projects and software of the organisation
  • Software and project maintainers can select custom categories specific to organisation  
  • Organisation categories are shown on software page in the side panel on the left, under the logo
  • Organisation categories are shown on project page in the side panel on the left
  • Refactored code to reduce code duplication. ~5% is optimal amount in my opinion, otherwise we will need additional level of abstraction which in my opinion will further increase cognitive load.
  • Updated user documentation (software,project and organisation pages)

How to test:

  • make start to build and generate test data
  • navigate to organisations and select first organisation
  • login as rsd-admin (first login in dev mode)
  • navigate to organisation settings, categories tab
  • add categories to organisation:
    • create project specific categories (use "For projects" switch)
    • create software specific categories
    • create shared categories (check both for software and project switch)
  • navigate to software item and add organisation that you just added the categories to
  • confirm that categories modal appears and you can assign organisation categories
  • select some categories and confirm that these are shown on the software page
  • navigate to project item and add organisation that you just added the categories to
  • confirm that categories modal appears and you can assign organisation categories
  • select some categories and confirm that these are shown on the project page
  • bonus test: enable communities in the settings.json and test community categories for software

Example organisation categories

image

Example adding organisation categories to software or project

image

Example organisation categories on project page (bottom of side panel)

image

PR Checklist:

  • Increase version numbers in docker-compose.yml
  • Link to a GitHub issue
  • Update documentation
  • Tests

@dmijatovic dmijatovic changed the title 1294 categories for projects organisations 1294 categories for organisations Oct 8, 2024
@dmijatovic dmijatovic force-pushed the 1294-categories-for-projects-organisations branch 2 times, most recently from a6cbf7a to fa61a3d Compare October 11, 2024 14:50
@dmijatovic dmijatovic marked this pull request as ready for review October 14, 2024 18:04
@dmijatovic dmijatovic force-pushed the 1294-categories-for-projects-organisations branch from aaaeca9 to fc122b6 Compare October 14, 2024 21:35
@jmaassen
Copy link
Member

I seem to have run into a bug. This are the steps I took

  • create an empty RSD
  • created an organization "Netherlands eScience Center"
  • added category "Calls" with subcategories "ASDI2018, ASDI2020, ETEC2020, KD2019"
  • added category "Expertise" with subcategory "Computing" and subsubcategories "GPU, Low power, distributed"
  • added to category "Expertise" subcategory "Big data" and subsubcategories "Real time, Heterogeneous"

Next added project:

  • test
  • organization: "Netherlands eScience Center"
  • categories: Calls/ASDI2018, Expertise: Computing/GPU and Big Data/Real Time
  • publish project

Project page of "test" looks as expected

Next added another project:

  • test2
  • organization: "Netherlands eScience Center"
  • categories: Calls/ETEC2020, Expertise: Computing/Low Power and Big Data/Heterogeneous
  • publish project

Project page of "test2" looks as expected

But the categories of project "test" have now disappeared?

@dmijatovic dmijatovic force-pushed the 1294-categories-for-projects-organisations branch 3 times, most recently from 3ef4634 to a7d2546 Compare October 15, 2024 16:07
@dmijatovic dmijatovic force-pushed the 1294-categories-for-projects-organisations branch from a7d2546 to 545a8f5 Compare October 15, 2024 16:10
@dmijatovic
Copy link
Contributor Author

@jmaassen Well spotted! I have fixed bug. The PR is (again) ready for testing.

Copy link
Collaborator

@ewan-escience ewan-escience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will adapt/edit the row level security rules for the tables.

Copy link
Collaborator

@ewan-escience ewan-escience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When adding a new non-root category to an organisation, the two switches to enable/disable software and/or projects for this category is visible, untill you type something in one of the input fields.

Otherwise, nice work!

frontend/types/Category.ts Show resolved Hide resolved
@jmaassen
Copy link
Member

jmaassen commented Oct 16, 2024

During the demo for @bakhshir I ran into an issue with being able to add a category as a organization maintainer. What I did is the following:

  • create an empty RSD
  • sign in a maintainer
  • create an organization for the eScience Center
  • create some example categories for the eScience Center
  • get a maintainer link for the organization
  • log in as a different user
  • click the organization maintainer link
  • create a project page, select eScience Center as organization, select categories (works fine)
  • go to the organization page
  • try to add addition category

I then get a error about row level security:

Screenshot 2024-10-16 at 14-51-46 Netherlands eScience Center Research Software Directory

@ewan-escience
Copy link
Collaborator

Does that error still happen on the latest changes? I pushed some changes to the row level security earlier today.

@dmijatovic
Copy link
Contributor Author

@jmaassen I fixed the modal error Ewan noticed. Can you test again?

@ewan-escience ewan-escience force-pushed the 1294-categories-for-projects-organisations branch from 6075479 to 6ee1b57 Compare October 17, 2024 15:14
@jmaassen
Copy link
Member

The issue is gone now, and everything works as expected.

Copy link

Copy link

Quality Gate Failed Quality Gate failed for 'rsd-frontend'

Failed conditions
5.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@dmijatovic dmijatovic merged commit 851b8c7 into main Oct 24, 2024
6 of 7 checks passed
@dmijatovic dmijatovic deleted the 1294-categories-for-projects-organisations branch November 11, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable categories for organizations + projects?
3 participants