-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/project ownership #346
Conversation
Filename is needed for db entry (fileName and displayTitle) when new object created from file and is assigned to folder.
Moving responsibility for adding newly created object to a folder from frontend to object endpoint. Now folder id is required query parameter with POST object/. Tests updated.
Update spelling wordlist.
Refactor/patch object on save
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@7.0.0...7.0.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [pip-tools](https://github.com/jazzband/pip-tools) from 6.5.0 to 6.5.1. - [Release notes](https://github.com/jazzband/pip-tools/releases) - [Changelog](https://github.com/jazzband/pip-tools/blob/master/CHANGELOG.md) - [Commits](jazzband/pip-tools@6.5.0...6.5.1) --- updated-dependencies: - dependency-name: pip-tools dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bump pytest from 7.0.0 to 7.0.1
….5.1 Bump pip-tools from 6.5.0 to 6.5.1
The previous commit 00cec8f
|
I thought about this also initially and tested it, but it still errored, and I think it's also not the correct way to approach this, because it would stop the test This is the function It's based on this |
I think this: https://github.com/CSCfi/metadata-submitter/blob/feature/project-ownership/metadata_backend/api/operators.py#L395 might be more appropriate as you want object query not folder query and maybe pay attention to: https://github.com/CSCfi/metadata-submitter/blob/feature/project-ownership/metadata_backend/conf/conf.py#L113 |
wait you want |
however if you really want JOIN like from SQL i think https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/ is what you need. |
That is also the same, it uses For the query constructor, I don't think that is needed for this use case (seems overly complicated), because we only want to read 2 values (accessionId and title)
I didn't want to create new functionality, but re-use existing data to keep it simple. This is an endpoint that replaces
I will look into this if it makes it possible to request the data in one query |
Looks like lookup is used for joining data together into one object from separate collections, but we want to get a list of all objects from multiple collections that have the same project id |
Returned old object assigning code into use with templates-in-project (as opposed to templates-in-user). |
Description
Folders and templates were originally owned by users, now they will be owned by projects that users belong to, allowing multiple users to work on the same folders and templates at the same time.
Related issues
Fixes #282
Frontend issue CSCfi/metadata-submitter-frontend#625
Type of change
Changes Made
folders
andtemplates
keys from userprojects
to userprojectId
tofolder
andtemplate
collectionsproject
collectionsdSubmitProjects
sdSubmitProjects
they are redirected to/noproject
projectId
forGET /folders
GET /templates?projectId=...
that replacesGET /users/current "templates":[...]
projectId
is not mandatory when requesting specific resource, e.g.GET /folders/{folderId}
, the permissions are read from sessionprojectId
forPOST /folders and /templates
PATCH /user
index
andtags
inPATCH /templates/schema/templateId
which are the same values as previously used in the deprecatedPATCH /user
Other Points
Testing