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

project affiliation #625

Closed
teemukataja opened this issue Jan 24, 2022 · 1 comment · Fixed by #696
Closed

project affiliation #625

teemukataja opened this issue Jan 24, 2022 · 1 comment · Fixed by #696
Assignees
Labels
backend backend issue enhancement New feature or request frontend frontend issue
Milestone

Comments

@teemukataja
Copy link

teemukataja commented Jan 24, 2022

This is a living issue that has not been thoroughly scoped yet
This backend branch can be used as a counterpart for developing
https://github.com/CSCfi/metadata-submitter/tree/feature/project-ownership

Background

Currently folders and templates are owned by the user. We can now get project affiliation information from the AAI in backend, and we can implement an ownership change where folders and templates are owned by projects, so that people in the same project can see and edit the same submissions.

Projects are mandatory

If a user does not have any project affiliations, they will be redirected to /noproject (name up for debate) by the backend. This page will explain, that the user needs to get project affiliation before being able to use the submitter. This page should include links to relevant resources to help the user get a project affiliation.

Deprecations

GET /users/current

  • folders and templates keys will be deprecated
{
    "templates":[],
    "folders":[],
    "userId":"c6ea3667daf04103964e2c69f8514b76",
    "name":"User test",
    "externalId":"[email protected]"
}

New Features

  • a dropdown selection in the navbar where user can select the current active project (similar to Pouta and Allas UIs)
    projectsprojects2

Endpoint changes

GET /users/current

  • new key projects that contain list of projects
  • projectId is the internal id that will be used in requests to the backend
  • projectNumber is the human-friendly name that comes from AAI
{
    "projects":[
        {
            "projectId":"6ae99149f12b4cb5a00f3ad9f3d4ef99",
            "projectNumber":"1000"
        },
        {
            "projectId":"cf18d387299f4b4b938a331bf07e1564",
            "projectNumber":"2000"
        },
        {
            "projectId":"2233398a8d7d4eb0956deadead5a7de8",
            "projectNumber":"3000"
        }
    ],
    "userId":"c6ea3667daf04103964e2c69f8514b76",
    "name":"User test",
    "externalId":"[email protected]"
}

POST /folders and /templates

  • new key projectId that is extracted from the current selected project
{
    "name":"Folder 1",
    "projectId":"6ae99149f12b4cb5a00f3ad9f3d4ef99",
    "description":"desc",
    "published":false,
    "metadataObjects":[
        
    ],
    "drafts":[
        
    ]
}

GET /folders and /templates

  • new query param projectId that is extracted from the current selected project
http://localhost:3000/folders?page=1&per_page=10&published=false&projectId=6ae99149f12b4cb5a00f3ad9f3d4ef99
http://localhost:3000/templates?projectId=6ae99149f12b4cb5a00f3ad9f3d4ef99

New templates endpoint returns the same templates-array that was previously in user data

No Changes

GET/PUT/PATCH/DELETE /folders/{folderId} and /templates/{schema}/{templateId}

  • no frontend changes, user and folder/template project affiliations are read from session
@teemukataja teemukataja added enhancement New feature or request backend backend issue frontend frontend issue labels Jan 24, 2022
@blankdots blankdots added this to the 0.12.0 milestone Feb 28, 2022
@teemukataja
Copy link
Author

PATCH /templates/schema/templateId
{
  "something": "something",
  "tags": {"displayTitle": "name"},
  "index": index
}

When updating a template, instead of 2 requests, only 1 request is now required, with tags and index that used to be in PATCH /userbeing put into the same request with PATCH /template

@hannyle hannyle linked a pull request Mar 10, 2022 that will close this issue
2 tasks
@hannyle hannyle mentioned this issue Mar 10, 2022
2 tasks
@juhtornr juhtornr modified the milestones: 0.12.0, 0.13.0 Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend backend issue enhancement New feature or request frontend frontend issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants