Feat: Edit metadata resources#1188
Feat: Edit metadata resources#1188joachimvh merged 119 commits intoCommunitySolidServer:versions/5.0.0from
Conversation
…w metadata files to be edited when a resource is available
…h PUT to container
… operationhandlers
…ible to edit (read reset) metadata
d7cf765 to
a8063e9
Compare
joachimvh
left a comment
There was a problem hiding this comment.
Some high level changes are still going to be needed to make this a generic solution.
…eck to new patchhandler which is more generic
…handler down to DABS
… to DataAccessors (part 1)
…riteMetadata in DataAccessor.ts (now taking subject identifier instead of metadata resource identifier)
…efault in the (converting.json)
# Conflicts: # RELEASE_NOTES.md
joachimvh
left a comment
There was a problem hiding this comment.
Most comments are minor refactors. Only one that might still be an issue is the container generation issue.
Did not look at the tests because at this point it's hard to know where still to look there 😅. Let me know if there are tests of specific classes you want me to look at.
joachimvh
left a comment
There was a problem hiding this comment.
Very minor comments remaining as you can see. Can fix them myself if you prefer at this point.
| * The data of this representation which conforms to the RDF/JS Dataset interface | ||
| * (https://rdf.js.org/dataset-spec/#dataset-interface). | ||
| */ | ||
| dataset: Store; |
There was a problem hiding this comment.
| dataset: Store; | |
| dataset: Dataset; |
How much of a hassle would it be to use this type? Can be imported from rdf-js.
If the answer is that we would need multiple casts in several places then Store can stay, but if it changes (almost) nothing it would be better to use the correct interface here.
| ); | ||
| const immutablePatternMap = new Map<FilterPattern, Quad[]>(); | ||
| const baseSubject = namedNode(this.metadataStrategy.getSubjectIdentifier(input.identifier).path); | ||
|
|
| it('does not log warnings when container resource creation fails.', async(): Promise<void> => { | ||
| store.setRepresentation.mockRejectedValueOnce(new ConflictHttpError('bad input')); | ||
| generatorData = [ | ||
| { identifier: { path: 'http://test.com/foo/' }, representation: '/container/' as any }, | ||
| ]; | ||
| await expect(initializer.handle()).resolves.toBeUndefined(); | ||
| expect(generator.generate).toHaveBeenCalledTimes(1); | ||
| expect(store.setRepresentation).toHaveBeenCalledTimes(1); | ||
| }); |
There was a problem hiding this comment.
This test still succeeds even though the specific code for this was removed 😄. This test should have checked if the logger emitted a warning, but since that piece of code is gone again it can just be removed.
📁 Related issues
Closes #1027
✍️ Description
This PR implements the design choices from issue #1027.
Behaviour changes of a GET request:
Behaviour changes of a POST request (PostOperationHandler):
Behaviour changes of a PUT request (PutOperationHandler):
Behaviour changes of a PATCH request (PatchOperationHandler && RepresentationPatchHandler)
Behaviour changes of a DELETE request (DeleteOperationHandler):
✅ PR check list
Before this pull request can be merged, a core maintainer will check whether