diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ad90ad5..9e7d3989 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [1.1.0-rc.21](https://github.com/NFDI4Chem/nmrxiv/compare/v1.0.0-rc.21...v1.1.0-rc.21) (2024-01-15) + + +### Features + +* updated OA schema to include enum values ([8534f88](https://github.com/NFDI4Chem/nmrxiv/commit/8534f882205559ab8e224b5b677bcd59d17c8be2)) + + +### Bug Fixes + +* added is_null check to request photo to avoid 500 error ([be04a3e](https://github.com/NFDI4Chem/nmrxiv/commit/be04a3e993ada4c210d0fbc97e9f6934df119584)) +* enabled file select ([e1680fa](https://github.com/NFDI4Chem/nmrxiv/commit/e1680fa5e0fafeb83547da8fa24b245c4cf0d3b8)) +* enabled select files on click ([16397a3](https://github.com/NFDI4Chem/nmrxiv/commit/16397a3193e3cf89aea3d82ea9450f7e477a34f7)) +* Issues with default sort (disabled for now) ([574b4f3](https://github.com/NFDI4Chem/nmrxiv/commit/574b4f374df7439ed9a57112d88bdf0e5278d988)) +* published project policy issues fix ([f03801f](https://github.com/NFDI4Chem/nmrxiv/commit/f03801f6085e4ff88dc7d32e43fe1f83718a5743)) +* removed deleted word concatenation to project name upon deletion ([0776172](https://github.com/NFDI4Chem/nmrxiv/commit/0776172eb084b8539e7d402dda443819af4448b2)) +* resolve cooloff period value. ([201f6ff](https://github.com/NFDI4Chem/nmrxiv/commit/201f6ff017ac57b83aba20e02e75aceef83931e3)), closes [#1014](https://github.com/NFDI4Chem/nmrxiv/issues/1014) +* resolved [#1018](https://github.com/NFDI4Chem/nmrxiv/issues/1018) ([677eb54](https://github.com/NFDI4Chem/nmrxiv/commit/677eb54f9ac48f0692b2b55f0f7424c4084387a8)) +* resolved permanent loading screen while navigation forward and backward between steps ([1447070](https://github.com/NFDI4Chem/nmrxiv/commit/14470702ecc728dc6062028d5eb67fdf14d7f804)) +* resolves [#1010](https://github.com/NFDI4Chem/nmrxiv/issues/1010) ([12a1363](https://github.com/NFDI4Chem/nmrxiv/commit/12a13630f5cbfd1587e204adc0ed2e10956f871d)) +* resolves [#996](https://github.com/NFDI4Chem/nmrxiv/issues/996) ([4471c3b](https://github.com/NFDI4Chem/nmrxiv/commit/4471c3b87f99053b08975bc4b2a26aaec1d1089a)) +* side bar layout changes ([a4b80f2](https://github.com/NFDI4Chem/nmrxiv/commit/a4b80f2098ec5869932ac71d2f89f02f9dabf453)) + ## [1.0.1-rc.20](https://github.com/NFDI4Chem/nmrxiv/compare/v1.0.0-rc.20...v1.0.1-rc.20) (2024-01-10) diff --git a/app/Actions/Project/DeleteProject.php b/app/Actions/Project/DeleteProject.php index ac8a9670..d4581293 100644 --- a/app/Actions/Project/DeleteProject.php +++ b/app/Actions/Project/DeleteProject.php @@ -37,7 +37,7 @@ public function delete($project) if ($draft) { $draft->update(['is_deleted' => true]); } - $project->name = $project->name.'- deleted'; + $project->name = $project->name; $project->deleted_on = Carbon::now(); $project->is_deleted = true; $project->sendNotification('deletion', $this->prepareSendList($project)); diff --git a/app/Actions/Project/UpdateProject.php b/app/Actions/Project/UpdateProject.php index ffdd99e1..7264901f 100644 --- a/app/Actions/Project/UpdateProject.php +++ b/app/Actions/Project/UpdateProject.php @@ -33,11 +33,12 @@ public function update(Project $project, array $input) if (array_key_exists('photo', $input)) { $image = $input['photo']; - $s3 = Storage::disk(env('FILESYSTEM_DRIVER_PUBLIC')); - $file_name = - uniqid().'.'.$image->getClientOriginalExtension(); - $s3filePath = '/projects/'.$file_name; - $s3->put($s3filePath, file_get_contents($image), 'public'); + if (! is_null($image)) { + $s3 = Storage::disk(env('FILESYSTEM_DRIVER_PUBLIC')); + $file_name = uniqid().'.'.$image->getClientOriginalExtension(); + $s3filePath = '/projects/'.$file_name; + $s3->put($s3filePath, file_get_contents($image), 'public'); + } } $is_public = array_key_exists('is_public', $input) ? $input['is_public'] : $project->is_public; diff --git a/app/Http/Controllers/API/DataController.php b/app/Http/Controllers/API/DataController.php index cf9926a0..7a2a50e9 100644 --- a/app/Http/Controllers/API/DataController.php +++ b/app/Http/Controllers/API/DataController.php @@ -18,7 +18,7 @@ class DataController extends Controller * @OA\Get( * path="/api/v1/list/{model}", * summary="Fetch all models", - * description="Fetch details for all publicly available models on nmrXiv.", + * description="Fetch details for all publicly available models (i.e. projects, samples, datasets) on nmrXiv.", * operationId="publicModels", * tags={"public"}, * @@ -30,7 +30,8 @@ class DataController extends Controller * * @OA\Schema( * type="string", - * ) + * enum={"projects", "samples", "datasets"} + * ) * ), * * @OA\Response( @@ -56,7 +57,6 @@ public function all(Request $request, $model) ->where('is_public', true) ->allowedSorts($allowedSorts) ->allowedFilters($allowedFilters) - ->defaultSort($defaultSort) ->paginate($per_page) ->appends(request()->query()) ); @@ -66,7 +66,6 @@ public function all(Request $request, $model) ->where('is_public', true) ->allowedSorts($allowedSorts) ->allowedFilters($allowedFilters) - ->defaultSort($defaultSort) ->paginate($per_page) ->appends(request()->query()) ); @@ -76,7 +75,6 @@ public function all(Request $request, $model) ->where('is_public', true) ->allowedSorts($allowedSorts) ->allowedFilters($allowedFilters) - ->defaultSort($defaultSort) ->paginate($per_page) ->appends(request()->query()) ); diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index db3d115b..47bbca14 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -14,16 +14,22 @@ public function dashboard(Request $request) $user = $request->user(); $team = $user->currentTeam; $projects = []; + $samples = []; if ($team) { $team->users = $team->allUsers(); if (! $team->personal_team) { $projects = Project::with('users', 'owner')->where([['team_id', $team->id], ['is_deleted', false]])->orderBy('updated_at', 'DESC')->get(); + $samples = Study::with('users', 'owner', 'sample.molecules')->where([['project_id', null], ['team_id', $team->id], ['is_deleted', false]])->orderBy('updated_at', 'DESC')->get(); } else { $projects = Project::with('users', 'owner')->where([['owner_id', $user->id], ['is_deleted', false]]) ->where('team_id', $team->id) ->orderBy('updated_at', 'DESC') ->get(); + + $samples = Study::with('users', 'owner')->where([['project_id', null], ['owner_id', $user->id], ['is_deleted', false]]) + ->where('team_id', $team->id) + ->orderBy('updated_at', 'DESC')->get(); } } @@ -31,6 +37,7 @@ public function dashboard(Request $request) 'filters' => $request->all('action', 'draft_id'), 'team' => $team, 'projects' => $projects->load('tags'), + 'samples' => $samples->load('sample.molecules'), 'teamRole' => $user->teamRole($team), ]); } diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 0ddaac2c..3fa95c16 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -386,7 +386,7 @@ public function destroy(Request $request, StatefulGuard $guard, Project $project ]); } - if ($project->status = 'processing' || $project->status = 'queued') { + if ($project->status == 'processing' || $project->status == 'queued') { return redirect()->route('dashboard')->with('error', 'It is not possible to delete a project that is currently being processed or queued.'); } else { $creator->delete($project); diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index b20628b4..e29f21ff 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -73,7 +73,7 @@ public function share(Request $request) 'SCOUT_PREFIX' => (env('SCOUT_PREFIX')), 'europemcWSApi' => (env('EUROPEMC_WS_API')), 'dataciteURL' => env('DATACITE_ENDPOINT'), - 'collOffPeriod' => env('COOL_OFF_PERIOD'), + 'coolOffPeriod' => env('COOL_OFF_PERIOD'), 'mailFromAddress' => env('MAIL_FROM_ADDRESS'), 'orcidSearchApi' => env('ORCID_ID_SEARCH_API'), 'orcidPersonApi' => env('ORCID_ID_PERSON_API'), diff --git a/app/Policies/ProjectPolicy.php b/app/Policies/ProjectPolicy.php index 57fda6b9..9bbd6fc3 100644 --- a/app/Policies/ProjectPolicy.php +++ b/app/Policies/ProjectPolicy.php @@ -65,7 +65,7 @@ public function createProject(User $user) */ public function updateProject(User $user, Project $project) { - if ($project->is_public || $project->is_archived || $project->is_deleted || $project->is_published) { + if ($project->is_public || $project->is_archived || $project->is_deleted || $project->is_published || (! $project->is_published && $project->doi)) { return false; } diff --git a/resources/js/Layouts/AppLayout.vue b/resources/js/Layouts/AppLayout.vue index 51ef424a..8ad65115 100644 --- a/resources/js/Layouts/AppLayout.vue +++ b/resources/js/Layouts/AppLayout.vue @@ -131,25 +131,59 @@ aria-label="Sidebar" class="flex flex-col items-center py-4 px-0" > - - {{ item.name }} - +
-