Skip to content

Commit

Permalink
Merge commit '7720143d5d50dec882dd7f979a09d0b0c807fefa' into prod-hel…
Browse files Browse the repository at this point in the history
…m-deploy
  • Loading branch information
CS76 committed May 2, 2024
2 parents 11c8224 + 7720143 commit e272d79
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 84 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
uses: actions/deploy-pages@v4
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [1.2.0](https://github.com/NFDI4Chem/nmrxiv/compare/v1.1.1...v1.2.0) (2024-05-02)


### Features

* unify identifiers representation (molecules to projects and spectra) ([526afa6](https://github.com/NFDI4Chem/nmrxiv/commit/526afa6c4461276f6a4253b23823d4dfff5ff6d6)), closes [#1118](https://github.com/NFDI4Chem/nmrxiv/issues/1118)


### Bug Fixes

* more formatting updates ([ebaab7c](https://github.com/NFDI4Chem/nmrxiv/commit/ebaab7c8e7d35ca7323ff7c51bfd51cdf81c2ea4))
* republishing bug dix and formatting updates ([a2df7f3](https://github.com/NFDI4Chem/nmrxiv/commit/a2df7f3901218d15b20c4a21bc8ca38344c944a8))
* reverted the codecov version v4 to v3 ([ab3b049](https://github.com/NFDI4Chem/nmrxiv/commit/ab3b0495b5455e588f8e0576aa04f2c3a1f249de))
* unpublished project - publish screen access policy updates ([fbc7a7a](https://github.com/NFDI4Chem/nmrxiv/commit/fbc7a7a3965681bde07fbd1baed3672e144c907f))
* updated version numbers of github actions ([ae45d0f](https://github.com/NFDI4Chem/nmrxiv/commit/ae45d0f6d98d6c99a2704e2ca414ca6b70a22879))

## [1.1.1](https://github.com/NFDI4Chem/nmrxiv/compare/v1.1.0...v1.1.1) (2024-04-05)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
/**
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
123 changes: 55 additions & 68 deletions app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

}

}
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
1 change: 0 additions & 1 deletion app/Models/Schemas/Study.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/Policies/ProjectPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion resources/js/App/MoleculeCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</div>
<div class="font-bold text-md mb-2">
<a class="font-semibold text-gray-600 hover:underline"
>#NMRXIV:{{ molecule.identifier }}</a
>#NMRXIV:M{{ molecule.identifier }}</a
>
</div>
<div
Expand Down

0 comments on commit e272d79

Please sign in to comment.