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 @@
]"
>
-
-
-
-
-
@@ -1310,128 +1492,174 @@
-
-
- Cancel
-
-
-
-
-
- Drafts
-
-
- Cancel
-
+
+
+
+
+
+
+
+
+ Don't show this again
+
+
+
-
-
-
Proceed
-
-
-
- Back
-
-
- Cancel
-
-
-
-
@@ -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');