diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 558f5de0..689d2991 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -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(); + } + } } diff --git a/app/Http/Resources/DatasetResource.php b/app/Http/Resources/DatasetResource.php index 8278388d..4f95c8d5 100644 --- a/app/Http/Resources/DatasetResource.php +++ b/app/Http/Resources/DatasetResource.php @@ -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), diff --git a/app/Models/Validation.php b/app/Models/Validation.php index 29144978..4d0e1715 100644 --- a/app/Models/Validation.php +++ b/app/Models/Validation.php @@ -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, diff --git a/database/migrations/2022_11_04_135000_add_primer_column.php b/database/migrations/2022_11_04_135000_add_primer_column.php new file mode 100644 index 00000000..1ee0bec3 --- /dev/null +++ b/database/migrations/2022_11_04_135000_add_primer_column.php @@ -0,0 +1,32 @@ +boolean('primed')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function($table) { + $table->dropColumn('primed'); + }); + } +}; diff --git a/public/img/primer.png b/public/img/primer.png new file mode 100644 index 00000000..5457f7a3 Binary files /dev/null and b/public/img/primer.png differ diff --git a/resources/js/Pages/Public/Project/Dataset.vue b/resources/js/Pages/Public/Project/Dataset.vue index 87ea089e..cfaaaa60 100644 --- a/resources/js/Pages/Public/Project/Dataset.vue +++ b/resources/js/Pages/Public/Project/Dataset.vue @@ -298,6 +298,11 @@ class="mt-2 text-2xl font-bold break-words text-gray-900" > {{ dataset.data.name }} + - ({{ + dataset.data.type.replace(/,\s*$/, "") + }})
{{ dataset.name }} + ({{ + dataset.type.replace(/,\s*$/, "") + }}) - #{{ dataset.identifier }} diff --git a/resources/js/Pages/Study/Datasets.vue b/resources/js/Pages/Study/Datasets.vue index 84dbc2c6..87cad356 100644 --- a/resources/js/Pages/Study/Datasets.vue +++ b/resources/js/Pages/Study/Datasets.vue @@ -126,9 +126,16 @@ :key="dataset.slug" :value="dataset" > - {{ dataset.name }} - #{{ - dataset.id - }} + {{ dataset.name }} + ({{ + dataset.type.replace( + /,\s*$/, + "" + ) + }}) + - #{{ dataset.id }}
diff --git a/resources/js/Shared/DatasetCard.vue b/resources/js/Shared/DatasetCard.vue index b16d1868..0a2c21ff 100644 --- a/resources/js/Shared/DatasetCard.vue +++ b/resources/js/Shared/DatasetCard.vue @@ -41,7 +41,7 @@ {{ dataset.name }}

Project:
@@ -195,7 +195,7 @@

Project:
diff --git a/resources/js/Shared/FileSystemBrowser.vue b/resources/js/Shared/FileSystemBrowser.vue index ed815191..7263bb52 100644 --- a/resources/js/Shared/FileSystemBrowser.vue +++ b/resources/js/Shared/FileSystemBrowser.vue @@ -9,72 +9,84 @@ ]" >

-
- - Learn more about folder structuring +
+
- - + > + + + + +
@@ -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, @@ -424,6 +437,7 @@ export default { CheckIcon, SelectInput, TrashIcon, + ToolTip, }, props: ["draft", "readonly"], data() { diff --git a/resources/js/Shared/SpectraEditor.vue b/resources/js/Shared/SpectraEditor.vue index af7de25a..aba758fc 100644 --- a/resources/js/Shared/SpectraEditor.vue +++ b/resources/js/Shared/SpectraEditor.vue @@ -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)) { @@ -502,7 +502,7 @@ export default { data: { spectra: spectra, molecules: mols, - version: nmriumVersion + version: nmriumVersion, }, type: "nmrium", }; @@ -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) => { diff --git a/resources/js/Shared/SpectraViewer.vue b/resources/js/Shared/SpectraViewer.vue index 7a61930d..e6ff89b9 100644 --- a/resources/js/Shared/SpectraViewer.vue +++ b/resources/js/Shared/SpectraViewer.vue @@ -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"])) { @@ -386,7 +386,7 @@ export default { data: { spectra: spectra, molecules: mols, - version: nmriumVersion + version: nmriumVersion, }, type: "nmrium", }; diff --git a/resources/js/Shared/Submission.vue b/resources/js/Shared/Submission.vue index 134226c0..d8f6750a 100644 --- a/resources/js/Shared/Submission.vue +++ b/resources/js/Shared/Submission.vue @@ -5,69 +5,80 @@ @close="openCreateDatasetDialog = false" > @@ -172,521 +183,671 @@
-
-
-
-
-
@@ -1514,7 +1742,7 @@ export default { { id: "02", step: "v-step-20", - name: "Assignments & Meta data", + name: "Assignments & Metadata", description: "Cursus semper viverra.", href: "#", status: "upcoming", @@ -1560,6 +1788,8 @@ export default { selectedDataset: null, currentMolecules: [], + showPrimer: false, + smiles: "", percentage: 1, editor: null, @@ -1599,6 +1829,10 @@ export default { }; }, computed: { + primed() { + return this.$page.props.user.primed; + }, + currentStep() { return this.steps.filter((s) => s.status == "current")[0]; }, @@ -1656,6 +1890,7 @@ export default { } else { this.loading = false; } + this.showPrimer = !this.primed; } }); }; @@ -1663,6 +1898,17 @@ export default { }, unmounted() {}, methods: { + hidePrimer() { + axios.post("/primer/skip").then(() => { + Inertia.reload({ + only: ["user", "user.permissions", "user.roles"], + }); + }); + var pattern = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/; + }, + skipPrimer() { + this.showPrimer = false; + }, getSVGString(molecule) { if (molecule.MOL) { let mol = OCL.Molecule.fromMolfile( @@ -1977,9 +2223,28 @@ export default { }, createNewDraft() { - this.defaultDraft.name = - "Untitled Project - " + new Date().toLocaleString(); - this.selectDraft(this.defaultDraft); + if (!this.primed) { + this.showPrimer = true; + this.newDraft(); + } else { + this.newDraft(); + } + }, + + newDraft() { + if (this.defaultDraft) { + this.defaultDraft.name = + "Untitled Project - " + new Date().toLocaleString(); + this.selectDraft(this.defaultDraft); + } else { + this.fetchDrafts().then((response) => { + this.defaultDraft = response.data.default; + this.loading = false; + this.defaultDraft.name = + "Untitled Project - " + new Date().toLocaleString(); + this.selectDraft(this.defaultDraft); + }); + } }, hasStudies(file) { @@ -2146,6 +2411,7 @@ export default { this.draftForm.description = this.currentDraft.description; let tags = []; this.file = null; + this.draftForm.tags = []; if (this.currentDraft.tags) { this.currentDraft.tags.forEach((t) => { tags.push({ diff --git a/routes/web.php b/routes/web.php index 854b55ec..da2ee2d9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -75,6 +75,9 @@ Route::post('/onboarding/{status}', [DashboardController::class, 'onboardingStatus']) ->name('onboarding.complete'); + Route::post('/primer/skip', [DashboardController::class, 'skipPrimer']) + ->name('primer.skip'); + Route::get('projects/status/{project}/queue', [ProjectController::class, 'status']) ->name('project.status');