-
Notifications
You must be signed in to change notification settings - Fork 4
Related objects dev to main #95
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
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
53dcc9f
w.i.p. download schema as json file + set schema.source for upload
WilcoLouwerse d293ad5
Merge branch 'development' into feature/REGISTERS-30/from-schema-to-json
WilcoLouwerse bee2868
Merge branch 'development' into feature/REGISTERS-30/from-schema-to-json
WilcoLouwerse fe86d3e
Merge branch 'development' into feature/REGISTERS-30/from-schema-to-json
WilcoLouwerse b2733d5
Fix fields for Register & change how download response is stuctured
WilcoLouwerse 4de5988
Merge branch 'development' into feature/REGISTERS-30/from-schema-to-json
WilcoLouwerse 665eeeb
Merge branch 'development' into feature/REGISTERS-30/from-schema-to-json
WilcoLouwerse e60b076
Fixes downloadService
WilcoLouwerse 0afb9c9
More fixes for DownloadService
WilcoLouwerse 2fded41
style fixes
WilcoLouwerse 24f85d1
Merge remote-tracking branch 'origin/development' into feature/REGIST…
remko48 131dbf9
Removed some old code that didn't do anything
WilcoLouwerse ebf48e3
Merge branch 'development' into feature/REGISTERS-30/from-schema-to-json
WilcoLouwerse f9d6be7
Show empty schema property config unless used for validation / download
WilcoLouwerse aaaf88b
Merge branch 'development' into feature/REGISTERS-30/from-schema-to-json
WilcoLouwerse 13676d1
Merge branch 'development' into feature/REGISTERS-30/from-schema-to-json
WilcoLouwerse 3c42542
Small rename for variable
WilcoLouwerse 943fb34
Merge branch 'development' into feature/REGISTERS-30/from-schema-to-json
WilcoLouwerse f8f69c6
Merge pull request #49 from ConductionNL/feature/REGISTERS-30/from-sc…
WilcoLouwerse 0727635
Object and file tabs
rubenvdlinde 1680445
Merge branch 'development' into feature/REGISTER-66/ui
rubenvdlinde a99799d
First draft for ui logic
rubenvdlinde 7f3da5d
First fixes
rubenvdlinde a52a45d
Save sub schema as the proper schema
rubenvdlinde e8fc791
Setting up the usses list
rubenvdlinde cdf6895
Made used by view and fix for searching in relations by uuid
rubenvdlinde e33e3bc
Allow filtering on relations and support non internal relations
rubenvdlinde 9070566
Bit of testing on grapping the relations
rubenvdlinde 8f7b607
Fix for relating to self
rubenvdlinde 95f9101
Lint
remko48 50f0b3f
Small changes for updating return object
rjzondervan e3af0f0
Added changes to EditSchemaProperty
remko48 816468c
Merge pull request #94 from ConductionNL/feature/REGISTER-66/ui
remko48 0d84b95
dev to main PR fixes
rjzondervan aebe523
Added docblock for downloadService
WilcoLouwerse 7f59d25
small fix in code style
WilcoLouwerse 4440208
Merge pull request #96 from ConductionNL/fix/PR-comments
rjzondervan e91b64d
Added uploadService class docblock
WilcoLouwerse d01be00
Merge pull request #97 from ConductionNL/fix/PR-comments
WilcoLouwerse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,6 +219,8 @@ public function upload(?int $id = null): JSONResponse | |
| return $phpArray; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this controller have a class docblock? |
||
| } | ||
|
|
||
| //@todo Maybe check if Schema already exists? If uploaded with url, check if schema with this $phpArray['source'] exists? | ||
|
|
||
| // Set default title if not provided or empty | ||
| if (empty($phpArray['title']) === true) { | ||
| $phpArray['title'] = 'New Schema'; | ||
|
|
@@ -236,43 +238,30 @@ public function upload(?int $id = null): JSONResponse | |
|
|
||
| /** | ||
| * Creates and return a json file for a Schema. | ||
| * @todo move most of this code to DownloadService and make it even more Abstract using Entity->jsonSerialize instead of Schema->jsonSerialize, etc. | ||
| * | ||
| * @NoAdminRequired | ||
| * @NoCSRFRequired | ||
| * | ||
| * @param int $id The ID of the schema to return json file for | ||
| * @return JSONResponse A json Response containing the json | ||
| * @throws \Exception | ||
| */ | ||
| public function download(int $id): JSONResponse | ||
| { | ||
| try { | ||
| $schema = $this->schemaMapper->find($id); | ||
| } catch (DoesNotExistException $exception) { | ||
| return new JSONResponse(data: ['error' => 'Not Found'], statusCode: 404); | ||
| } | ||
|
|
||
| $contentType = $this->request->getHeader('Content-Type'); | ||
| $accept = $this->request->getHeader('Accept'); | ||
|
|
||
| if (empty($contentType) === true) { | ||
| return new JSONResponse(data: ['error' => 'Request is missing header Content-Type'], statusCode: 400); | ||
| if (empty($accept) === true) { | ||
| return new JSONResponse(data: ['error' => 'Request is missing header Accept'], statusCode: 400); | ||
| } | ||
|
|
||
| switch ($contentType) { | ||
| case 'application/json': | ||
| $type = 'json'; | ||
| $responseData = [ | ||
| 'jsonArray' => $schema->jsonSerialize(), | ||
| 'jsonString' => json_encode($schema->jsonSerialize()) | ||
| ]; | ||
| break; | ||
| default: | ||
| return new JSONResponse(data: ['error' => "The Content-Type $contentType is not supported."], statusCode: 400); | ||
| } | ||
| $responseData = $this->downloadService->download(objectType: 'schema', id: $id, accept: $accept); | ||
|
|
||
| // @todo Create a downloadable json file and return it. | ||
| $file = $this->downloadService->download(type: $type); | ||
| $statusCode = 200; | ||
| if (isset($responseData['statusCode']) === true) { | ||
| $statusCode = $responseData['statusCode']; | ||
| unset($responseData['statusCode']); | ||
| } | ||
|
|
||
| return new JSONResponse($responseData); | ||
| return new JSONResponse(data: $responseData, statusCode: $statusCode); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this controller have a class docblock?