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/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..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,83 +327,71 @@ 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(); - + $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) 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; } 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 @@