From ae45d0f6d98d6c99a2704e2ca414ca6b70a22879 Mon Sep 17 00:00:00 2001 From: Sagar Date: Fri, 5 Apr 2024 13:57:32 +0200 Subject: [PATCH 1/6] fix: updated version numbers of github actions - checkout (v3 to v4) - setup-node (v3 to v4) - configure-pages (v1 to v5) - upload-pages-artifact (v1 to v3) - deploy-pages (v2 to v4) - fixes the github actions deprecation warning for node v16 --- .github/workflows/deploy-docs.yml | 12 ++++++------ .github/workflows/dev-build.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 61bf18ba..d7b84906 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -14,20 +14,20 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 cache: npm - run: npm ci - name: Build run: npm run docs:build - - uses: actions/configure-pages@v2 - - uses: actions/upload-pages-artifact@v1 + - uses: actions/configure-pages@v5 + - uses: actions/upload-pages-artifact@v3 with: path: docs/.vitepress/dist - name: Deploy id: deployment - uses: actions/deploy-pages@v2.0.2 \ No newline at end of file + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 7bcb4a6b..a67eb55f 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -76,7 +76,7 @@ jobs: run: vendor/bin/phpunit --coverage-clover coverage.xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 env: CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} From ab3b0495b5455e588f8e0576aa04f2c3a1f249de Mon Sep 17 00:00:00 2001 From: Sagar Date: Fri, 5 Apr 2024 14:44:06 +0200 Subject: [PATCH 2/6] fix: reverted the codecov version v4 to v3 - Fixes the Warning: Codecov: Failed to properly create commit --- .github/workflows/dev-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index a67eb55f..7bcb4a6b 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -76,7 +76,7 @@ jobs: run: vendor/bin/phpunit --coverage-clover coverage.xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} From 526afa6c4461276f6a4253b23823d4dfff5ff6d6 Mon Sep 17 00:00:00 2001 From: NRayya <82588017+NRayya@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:00:11 +0200 Subject: [PATCH 3/6] feat: unify identifiers representation (molecules to projects and spectra) fixes #1118 --- resources/js/App/MoleculeCard.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/App/MoleculeCard.vue b/resources/js/App/MoleculeCard.vue index e68b1c47..349b5841 100644 --- a/resources/js/App/MoleculeCard.vue +++ b/resources/js/App/MoleculeCard.vue @@ -51,7 +51,7 @@
#NMRXIV:{{ molecule.identifier }}#NMRXIV:M{{ molecule.identifier }}
Date: Mon, 29 Apr 2024 16:01:13 +0200 Subject: [PATCH 4/6] fix: unpublished project - publish screen access policy updates --- app/Policies/ProjectPolicy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Policies/ProjectPolicy.php b/app/Policies/ProjectPolicy.php index 6341834f..54ad2b6b 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 || (! $project->is_published && $project->doi)) { + if ($project->is_public || $project->is_archived || $project->is_deleted || $project->is_published) { return false; } From a2df7f3901218d15b20c4a21bc8ca38344c944a8 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Tue, 30 Apr 2024 22:23:13 +0200 Subject: [PATCH 5/6] fix: republishing bug dix and formatting updates --- .../Bioschemas/BioschemasController.php | 4 +- .../Schemas/DataCite/DataCiteController.php | 4 +- app/Http/Controllers/API/SearchController.php | 2 +- .../Controllers/Admin/UsersController.php | 2 +- app/Http/Controllers/ProjectController.php | 136 +++++++++--------- app/Models/Project.php | 2 +- app/Models/Schemas/Study.php | 1 - 7 files changed, 77 insertions(+), 74 deletions(-) diff --git a/app/Http/Controllers/API/Schemas/Bioschemas/BioschemasController.php b/app/Http/Controllers/API/Schemas/Bioschemas/BioschemasController.php index f656cd3a..0634717d 100644 --- a/app/Http/Controllers/API/Schemas/Bioschemas/BioschemasController.php +++ b/app/Http/Controllers/API/Schemas/Bioschemas/BioschemasController.php @@ -30,8 +30,8 @@ class BioschemasController extends Controller * @param Illuminate\Http\Request $request * @param App\Models\User $username * @param App\Models\Project $projectName - * @param App\Models\Study $studyName Optional - * @param App\Models\Dataset $datasetName Optional + * @param App\Models\Study $studyName Optional + * @param App\Models\Dataset $datasetName Optional * @return object */ /** diff --git a/app/Http/Controllers/API/Schemas/DataCite/DataCiteController.php b/app/Http/Controllers/API/Schemas/DataCite/DataCiteController.php index 60322f99..f256856e 100644 --- a/app/Http/Controllers/API/Schemas/DataCite/DataCiteController.php +++ b/app/Http/Controllers/API/Schemas/DataCite/DataCiteController.php @@ -24,8 +24,8 @@ class DataCiteController extends Controller * @param Illuminate\Http\Request $request * @param App\Models\User $username * @param App\Models\Project $projectName - * @param App\Models\Study $studyName Optional - * @param App\Models\Dataset $datasetName Optional + * @param App\Models\Study $studyName Optional + * @param App\Models\Dataset $datasetName Optional * @return object */ /** diff --git a/app/Http/Controllers/API/SearchController.php b/app/Http/Controllers/API/SearchController.php index b8e3c681..020fa5be 100644 --- a/app/Http/Controllers/API/SearchController.php +++ b/app/Http/Controllers/API/SearchController.php @@ -252,7 +252,7 @@ public function search(Request $request) $statement = $statement.')'; } $statement = $statement.' LIMIT '.$limit; - // dd($statement ); + // dd($statement ); } else { if ($query) { $query = str_replace("'", "''", $query); diff --git a/app/Http/Controllers/Admin/UsersController.php b/app/Http/Controllers/Admin/UsersController.php index b2b4a5cf..131469a0 100644 --- a/app/Http/Controllers/Admin/UsersController.php +++ b/app/Http/Controllers/Admin/UsersController.php @@ -180,7 +180,7 @@ public function checkPassword(Request $request) /** * Delete the profile photo. * - * @return \Illuminate\Http\RedirectResponse + * @return \Illuminate\Http\RedirectResponse */ public function destroyPhoto(User $user, Request $request) { diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index ebdf2264..e1087e70 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -328,83 +328,87 @@ public function publish(Request $request, Project $project, PublishProject $publ if ($project) { $input = $request->all(); $release_date = $input['release_date']; - if (! $project->is_public && ! is_null($project->doi) && ! is_null($release_date)) { - $release_date = Carbon::parse($release_date); - if ($release_date->isPast()) { - $updater->update($project, $request->all()); - $publisher->publish($project); - $project->sendNotification('publish', $this->prepareSendList($project)); - } - } else { - - $enableProjectMode = $request->get('enableProjectMode'); - if ($enableProjectMode) { - $validation = $project->validation; - $validation->process(); - $validation = $validation->fresh(); - if ($validation['report']['project']['status']) { - $project->release_date = $request->get('release_date'); - $project->status = 'queued'; - $project->save(); - - ProcessSubmission::dispatch($project); - - return response()->json([ - 'project' => $project, - 'validation' => $validation, - ]); - } else { - return response()->json([ - 'errors' => 'Validation failing. Please provide all the required data and try again. If the problem persists, please contact us.', - 'validation' => $validation, - ], 422); - } - } else { - $draft = $project->draft; - $draft->project_enabled = false; - $draft->save(); - + // if (! $project->is_public && ! is_null($project->doi) && ! is_null($release_date)) { + // $release_date = Carbon::parse($release_date); + // if ($release_date->isPast()) { + // $updater->update($project, $input); + // $publisher->publish($project); + // $project->sendNotification('publish', $this->prepareSendList($project)); + // $project->status = 'complete'; + // $project->save(); + // return response()->json([ + // 'project' => $project + // ]); + // } + // } else { + $enableProjectMode = $request->get('enableProjectMode'); + if ($enableProjectMode) { + $validation = $project->validation; + $validation->process(); + $validation = $validation->fresh(); + if ($validation['report']['project']['status']) { $project->release_date = $request->get('release_date'); $project->status = 'queued'; $project->save(); - $validation = $project->validation; - $validation->process(); - $validation = $validation->fresh(); - - foreach ($project->studies as $study) { - $study->license_id = $project->license_id; - $study->save(); - foreach ($study->datasets as $dataset) { - $dataset->license_id = $project->license_id; - $dataset->save(); - } + ProcessSubmission::dispatch($project); + + return response()->json([ + 'project' => $project, + 'validation' => $validation, + ]); + } else { + return response()->json([ + 'errors' => 'Validation failing. Please provide all the required data and try again. If the problem persists, please contact us.', + 'validation' => $validation, + ], 422); + } + } else { + $draft = $project->draft; + $draft->project_enabled = false; + $draft->save(); + + $project->release_date = $request->get('release_date'); + $project->status = 'queued'; + $project->save(); + + $validation = $project->validation; + $validation->process(); + $validation = $validation->fresh(); + + foreach ($project->studies as $study) { + $study->license_id = $project->license_id; + $study->save(); + foreach ($study->datasets as $dataset) { + $dataset->license_id = $project->license_id; + $dataset->save(); } + } - $status = true; + $status = true; - foreach ($validation['report']['project']['studies'] as $study) { - if (! $study['status']) { - $status = false; - } - } - // add license check - if ($status) { - ProcessSubmission::dispatch($project); - - return response()->json([ - 'project' => $project, - 'validation' => $validation, - ]); - } else { - return response()->json([ - 'errors' => 'Validation failing. Please provide all the required data and try again. If the problem persists, please contact us.', - ], 422); + foreach ($validation['report']['project']['studies'] as $study) { + if (! $study['status']) { + $status = false; } } - + // add license check + if ($status) { + ProcessSubmission::dispatch($project); + + return response()->json([ + 'project' => $project, + 'validation' => $validation, + ]); + } else { + return response()->json([ + 'errors' => 'Validation failing. Please provide all the required data and try again. If the problem persists, please contact us.', + ], 422); + } } + // } + } } diff --git a/app/Models/Project.php b/app/Models/Project.php index b74fb48d..946848ff 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -339,7 +339,7 @@ public function citations() /** * Send Notification via email. * - * @param string $notifyType (deletion / deletionReminder / archival / archivalAdmin) + * @param string $notifyType (deletion / deletionReminder / archival / archivalAdmin) * @param array sendTo * @return void */ diff --git a/app/Models/Schemas/Study.php b/app/Models/Schemas/Study.php index 8266e329..c9d7b597 100644 --- a/app/Models/Schemas/Study.php +++ b/app/Models/Schemas/Study.php @@ -101,7 +101,6 @@ public function studyDomain($studyDomain) * drugs, etc. investigated by the study. * * @param \Spatie\SchemaOrg\Contracts\BioChemEntityContract|\Spatie\SchemaOrg\Contracts\MedicalEntityContract[] $studySubject - * @return static */ public function studySubject($studySubject) From ebaab7c8e7d35ca7323ff7c51bfd51cdf81c2ea4 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Tue, 30 Apr 2024 22:24:18 +0200 Subject: [PATCH 6/6] fix: more formatting updates --- app/Http/Controllers/ProjectController.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index e1087e70..b8267610 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -17,7 +17,6 @@ use App\Models\User; use App\Models\Validation; use Auth; -use Carbon\Carbon; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Contracts\Auth\StatefulGuard; use Illuminate\Http\JsonResponse; @@ -328,19 +327,6 @@ public function publish(Request $request, Project $project, PublishProject $publ if ($project) { $input = $request->all(); $release_date = $input['release_date']; - // if (! $project->is_public && ! is_null($project->doi) && ! is_null($release_date)) { - // $release_date = Carbon::parse($release_date); - // if ($release_date->isPast()) { - // $updater->update($project, $input); - // $publisher->publish($project); - // $project->sendNotification('publish', $this->prepareSendList($project)); - // $project->status = 'complete'; - // $project->save(); - // return response()->json([ - // 'project' => $project - // ]); - // } - // } else { $enableProjectMode = $request->get('enableProjectMode'); if ($enableProjectMode) { $validation = $project->validation; @@ -406,9 +392,6 @@ public function publish(Request $request, Project $project, PublishProject $publ ], 422); } } - - // } - } }