Skip to content

Commit

Permalink
Merge pull request #576 from NFDI4Chem/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
NishaSharma14 authored Nov 8, 2022
2 parents a8c3656 + 7203837 commit 49bfa47
Show file tree
Hide file tree
Showing 14 changed files with 1,425 additions and 1,078 deletions.
15 changes: 15 additions & 0 deletions app/Http/Controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,19 @@ public function onboardingStatus(Request $request, $status)
}
}
}

/**
* Update the database to skip displaying primer
*
* @return void
*/
public function skipPrimer(Request $request)
{
$user = $request->user();

if ($user) {
$user->primed = true;
$user->save();
}
}
}
4 changes: 2 additions & 2 deletions app/Http/Resources/DatasetResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public function toArray($request)
'identifier' => $this->identifier,
'doi' => $this->doi,
'project' => [
'name' => $this->project ? $this->project->slug : '',
'name' => $this->project ? $this->project->name : '',
'public_url' => $this->project ? $this->project->public_url : null,
],
'study' => [
'name' => $this->study ? $this->study->slug : '',
'name' => $this->study ? $this->study->name : '',
'public_url' => $this->study ? $this->study->public_url : null,
],
'owner' => new UserResource($this->owner),
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function process()
];

$values = [
'files' => $dataset->fsObject->instrument_type,
'files' => $dataset->fsObject ? $dataset->fsObject->instrument_type : null,
'nmrium_info' => $dataset->has_nmrium ? $dataset->has_nmrium : null,
'assay' => $dataset->assay,
'assignments' => $dataset->has_nmrium ? $dataset->has_nmrium : null,
Expand Down
32 changes: 32 additions & 0 deletions database/migrations/2022_11_04_135000_add_primer_column.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->boolean('primed')->default(false);
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function($table) {
$table->dropColumn('primed');
});
}
};
Binary file added public/img/primer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions resources/js/Pages/Public/Project/Dataset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@
class="mt-2 text-2xl font-bold break-words text-gray-900"
>
{{ dataset.data.name }}
<span v-if="dataset.data.type"
>- ({{
dataset.data.type.replace(/,\s*$/, "")
}})</span
>
</h1>
<div class="my-7">
<SpectraViewer
Expand Down
5 changes: 5 additions & 0 deletions resources/js/Pages/Public/Project/Study.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@
:value="dataset"
>
{{ dataset.name }}
<span v-if="dataset.type"
>({{
dataset.type.replace(/,\s*$/, "")
}})</span
>
<span class="text-gray-200"
>- #{{ dataset.identifier }}</span
>
Expand Down
13 changes: 10 additions & 3 deletions resources/js/Pages/Study/Datasets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,16 @@
:key="dataset.slug"
:value="dataset"
>
{{ dataset.name }} - #{{
dataset.id
}}
{{ dataset.name }}
<span v-if="dataset.type"
>({{
dataset.type.replace(
/,\s*$/,
""
)
}})</span
>
- #{{ dataset.id }}
</option>
</select>
</div>
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Shared/DatasetCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{{ dataset.name }}
</p>
<p
class="mt-0 text-sm capitalize text-gray-800 line-clamp-4"
class="mt-0 text-sm text-gray-800 line-clamp-4"
>
<small class="text-gray-400">Project:</small
><br />
Expand Down Expand Up @@ -195,7 +195,7 @@
</Link>
</p>
<p
class="mt-0 text-sm capitalize text-gray-800 line-clamp-4"
class="mt-0 text-sm text-gray-800 line-clamp-4"
>
<small class="text-gray-400">Project:</small
><br />
Expand Down
140 changes: 77 additions & 63 deletions resources/js/Shared/FileSystemBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,84 @@
]"
>
<div>
<div :class="[fullScreen ? 'px-6 py-4' : '', 'flex justify-end']">
<span
class="float-right text-xs cursor-pointer hover:text-blue-700 mt-2 mr-2"
>
<a
href="https://docs.nmrxiv.org/docs/submission-guides/submission/folder-structure"
target="_blank"
>Learn more about folder structuring</a
<div :class="[fullScreen ? 'px-6 py-4' : '', 'flex']">
<div class="w-full">
<div
class="float-left text-sm cursor-pointer hover:text-blue-700 mt-2 mr-10"
>
</span>
<button class="right" @click="toggleFullScreen">
<span v-if="fullScreen">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
<i
><a
href="https://docs.nmrxiv.org/docs/submission-guides/submission/folder-structure"
target="_blank"
class="mb-4"
>
<ToolTip
class="w-3.5 h-3.5"
text="To submit data you will need an account with nmrXiv, so you will be redirected to our register page and once registered you can then go ahead and submit data. For more information please checkout our <a target='_blank' href='//docs.nmrxiv.org' class='text-gray-400' target='_blank'>documentation</a>."
></ToolTip>
<span class="ml-4">
Learn more about folder structuring
</span>
</a></i
>
<path
d="M9 19V15M9 15H5M9 15L4 20"
stroke="black"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M15 5V9M15 9H19M15 9L20 4"
stroke="black"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M9 5V9M9 9H5M9 9L4 4"
stroke="black"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M15 19V15M15 15H19M15 15L20 20"
stroke="black"
</div>
<button class="float-right" @click="toggleFullScreen">
<span v-if="fullScreen">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9 19V15M9 15H5M9 15L4 20"
stroke="black"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M15 5V9M15 9H19M15 9L20 4"
stroke="black"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M9 5V9M9 9H5M9 9L4 4"
stroke="black"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M15 19V15M15 15H19M15 15L20 20"
stroke="black"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</span>
<span v-else>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</span>
<span v-else>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"
/>
</svg>
</span>
</button>
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"
/>
</svg>
</span>
</button>
</div>
</div>
<div v-if="!readonly" :class="[fullScreen ? 'px-6 py-4' : '', '']">
<form class="py-2 mb-3">
Expand Down Expand Up @@ -392,6 +404,7 @@ import { Dropzone } from "dropzone";
import axiosRetry from "axios-retry";
import FileDetails from "@/Shared/FileDetails.vue";
import SelectInput from "@/Shared/SelectInput.vue";
import ToolTip from "@/Shared/ToolTip.vue";
import {
FolderIcon,
Expand Down Expand Up @@ -424,6 +437,7 @@ export default {
CheckIcon,
SelectInput,
TrashIcon,
ToolTip,
},
props: ["draft", "readonly"],
data() {
Expand Down
6 changes: 3 additions & 3 deletions resources/js/Shared/SpectraEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export default {
} else {
let nmriumVersion = 3;
if (nmrium_info && nmrium_info["version"]) {
nmriumVersion = nmrium_info["version"]
nmriumVersion = nmrium_info["version"];
}
let mols = [];
if (this.isString(nmrium_info.molecules)) {
Expand All @@ -502,7 +502,7 @@ export default {
data: {
spectra: spectra,
molecules: mols,
version: nmriumVersion
version: nmriumVersion,
},
type: "nmrium",
};
Expand Down Expand Up @@ -554,7 +554,7 @@ export default {
{
spectra: this.selectedSpectraData,
molecules: this.currentMolecules,
version: this.version ? this.version : 3
version: this.version ? this.version : 3,
}
)
.catch((err) => {
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Shared/SpectraViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export default {
);
let nmriumVersion = 3;
if (nmrium_info && nmrium_info["version"]) {
nmriumVersion = nmrium_info["version"]
nmriumVersion = nmrium_info["version"];
}
if (nmrium_info && nmrium_info["spectra"]) {
if (this.isString(nmrium_info["spectra"])) {
Expand Down Expand Up @@ -386,7 +386,7 @@ export default {
data: {
spectra: spectra,
molecules: mols,
version: nmriumVersion
version: nmriumVersion,
},
type: "nmrium",
};
Expand Down
Loading

0 comments on commit 49bfa47

Please sign in to comment.