From 0f8a4501f76e44ffa9fd311ef9ddb11fcbf3de65 Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Tue, 24 Oct 2023 14:11:56 +0200 Subject: [PATCH 01/10] fix: add FAQs to welcome.vue --- resources/js/App/FAQs.vue | 77 ++++++++++++++++++++++++++++++++++ resources/js/Pages/Welcome.vue | 8 +++- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 resources/js/App/FAQs.vue diff --git a/resources/js/App/FAQs.vue b/resources/js/App/FAQs.vue new file mode 100644 index 00000000..7ac1a136 --- /dev/null +++ b/resources/js/App/FAQs.vue @@ -0,0 +1,77 @@ + + + diff --git a/resources/js/Pages/Welcome.vue b/resources/js/Pages/Welcome.vue index 489f5ea8..4bd712f5 100644 --- a/resources/js/Pages/Welcome.vue +++ b/resources/js/Pages/Welcome.vue @@ -367,7 +367,7 @@ -
+
+
+ +
+
Date: Tue, 24 Oct 2023 14:20:33 +0200 Subject: [PATCH 02/10] fix: add FAQ link in footer --- resources/js/Pages/Welcome.vue | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/resources/js/Pages/Welcome.vue b/resources/js/Pages/Welcome.vue index 4bd712f5..d14a2574 100644 --- a/resources/js/Pages/Welcome.vue +++ b/resources/js/Pages/Welcome.vue @@ -774,21 +774,25 @@ Quick links
    -
  • - + - Projects + {{ item.name }}
  • - - Spectra - + FAQs +
@@ -1024,6 +1028,10 @@ const footerNavigation = { // { name: "Browse", href: "/projects" }, // { name: "Advanced Search", href: "/projects" }, // ], + quicklinks: [ + { name: "Projects", href: "/projects"}, + { name: "Spectra", href: "/spectra"} + ], support: [ { name: "Documentation", href: "https://docs.nmrxiv.org" }, { From 13da87a23c23ced2539cd446e1d239bc54264a94 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Mon, 13 Nov 2023 12:30:38 +0100 Subject: [PATCH 03/10] fix: resolves #804 download issue --- app/Http/Controllers/DownloadController.php | 17 +++++++++++------ app/Jobs/ArchiveProject.php | 16 ++++++++++------ app/Jobs/ArchiveStudy.php | 17 +++++++++++------ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/app/Http/Controllers/DownloadController.php b/app/Http/Controllers/DownloadController.php index 9364f4ec..6ef0ebf3 100644 --- a/app/Http/Controllers/DownloadController.php +++ b/app/Http/Controllers/DownloadController.php @@ -102,17 +102,22 @@ public function downloadFromProject(Request $request, $username, $project, $key array_push($s3keys, substr($fsObj->path, 1)); } } else { - $command = $s3Client->getCommand('ListObjects'); - $command['Bucket'] = $bucket; + + $command = [ + 'Bucket' => $bucket, + ]; if ($path[0] == '/') { $command['Prefix'] = ltrim($path, $path[0]).'/'; } else { $command['Prefix'] = $path.'/'; } - $result = $s3Client->execute($command); - if ($result['Contents']) { - foreach ($result['Contents'] as $file) { - array_push($s3keys, $file['Key']); + $results = $s3Client->getPaginator('ListObjects', $command); + foreach ($results as $result) { + $contents = $result->get('Contents'); + if ($contents) { + foreach ($contents as $file) { + array_push($s3keys, $file['Key']); + } } } } diff --git a/app/Jobs/ArchiveProject.php b/app/Jobs/ArchiveProject.php index 1d248758..b203abca 100644 --- a/app/Jobs/ArchiveProject.php +++ b/app/Jobs/ArchiveProject.php @@ -72,17 +72,21 @@ public function handle(): void array_push($s3keys, substr($fsObject->path, 1)); } } else { - $command = $s3Client->getCommand('ListObjects'); - $command['Bucket'] = $bucket; + $command = [ + 'Bucket' => $bucket, + ]; if ($path[0] == '/') { $command['Prefix'] = ltrim($path, $path[0]).'/'; } else { $command['Prefix'] = $path.'/'; } - $result = $s3Client->execute($command); - if ($result['Contents']) { - foreach ($result['Contents'] as $file) { - array_push($s3keys, $file['Key']); + $results = $s3Client->getPaginator('ListObjects', $command); + foreach ($results as $result) { + $contents = $result->get('Contents'); + if ($contents) { + foreach ($contents as $file) { + array_push($s3keys, $file['Key']); + } } } } diff --git a/app/Jobs/ArchiveStudy.php b/app/Jobs/ArchiveStudy.php index f6111300..5ba6748b 100644 --- a/app/Jobs/ArchiveStudy.php +++ b/app/Jobs/ArchiveStudy.php @@ -59,17 +59,22 @@ public function handle(): void array_push($s3keys, substr($fsObject->path, 1)); } } else { - $command = $s3Client->getCommand('ListObjects'); - $command['Bucket'] = $bucket; + + $command = [ + 'Bucket' => $bucket, + ]; if ($path[0] == '/') { $command['Prefix'] = ltrim($path, $path[0]).'/'; } else { $command['Prefix'] = $path.'/'; } - $result = $s3Client->execute($command); - if ($result['Contents']) { - foreach ($result['Contents'] as $file) { - array_push($s3keys, $file['Key']); + $results = $s3Client->getPaginator('ListObjects', $command); + foreach ($results as $result) { + $contents = $result->get('Contents'); + if ($contents) { + foreach ($contents as $file) { + array_push($s3keys, $file['Key']); + } } } } From da9857406fa305f9c658d13d47f50ea8ff28f871 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Mon, 13 Nov 2023 12:55:36 +0100 Subject: [PATCH 04/10] fix: resolved #645 --- app/Http/Controllers/DraftController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/DraftController.php b/app/Http/Controllers/DraftController.php index 2f4bc894..eacde9f6 100644 --- a/app/Http/Controllers/DraftController.php +++ b/app/Http/Controllers/DraftController.php @@ -548,7 +548,13 @@ public function isJcampDX($folder) $isDX = true; } - if ($isJDX || $isDX) { + $fileTypes = ['jcamp']; + $isJCAMP = false; + if (array_intersect($fileTypes, $extensions) == $fileTypes) { + $isJCAMP = true; + } + + if ($isJDX || $isDX || $isJCAMP) { return true; } From f7ca828d6a04b8fc485645f54103fe4dac624477 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Tue, 14 Nov 2023 03:47:06 +0100 Subject: [PATCH 05/10] fix: various bug fixes and updates --- database/scripts/sync_index.sql | 50 +++++++++++++++++++++++++++ resources/js/Layouts/AppLayout.vue | 2 +- resources/js/Pages/Publish.vue | 31 ++++++++--------- resources/js/Pages/Upload.vue | 5 ++- resources/js/Shared/Children.vue | 45 +++++++++++++----------- resources/js/Shared/SpectraEditor.vue | 1 - resources/js/Shared/StudyCard.vue | 21 ++++++++++- resources/js/Shared/StudyInfo.vue | 3 -- resources/js/Shared/Submission.vue | 2 -- routes/web.php | 8 ++--- 10 files changed, 115 insertions(+), 53 deletions(-) create mode 100644 database/scripts/sync_index.sql diff --git a/database/scripts/sync_index.sql b/database/scripts/sync_index.sql new file mode 100644 index 00000000..6fe93e66 --- /dev/null +++ b/database/scripts/sync_index.sql @@ -0,0 +1,50 @@ +SELECT setval('announcements_id_seq', max(id)) FROM announcements; +SELECT setval('assays_id_seq', max(id)) FROM assays; +SELECT setval('audits_id_seq', max(id)) FROM audits; +SELECT setval('author_project_id_seq', max(id)) FROM author_project; +SELECT setval('authors_id_seq', max(id)) FROM authors; +SELECT setval('citation_project_id_seq', max(id)) FROM citation_project; +SELECT setval('citations_id_seq', max(id)) FROM citations; +SELECT setval('dataset_invitations_id_seq', max(id)) FROM dataset_invitations; +SELECT setval('dataset_molecule_id_seq', max(id)) FROM dataset_molecule; +SELECT setval('dataset_user_id_seq', max(id)) FROM dataset_user; +SELECT setval('datasets_id_seq', max(id)) FROM datasets; +SELECT setval('drafts_id_seq', max(id)) FROM drafts; +SELECT setval('failed_jobs_id_seq', max(id)) FROM failed_jobs; +SELECT setval('file_system_objects_id_seq', max(id)) FROM file_system_objects; +SELECT setval('licenses_id_seq', max(id)) FROM licenses; +SELECT setval('linked_social_accounts_id_seq', max(id)) FROM linked_social_accounts; +SELECT setval('markable_reactions_id_seq', max(id)) FROM markable_reactions; +SELECT setval('markable_likes_id_seq', max(id)) FROM markable_likes; +SELECT setval('markable_favorites_id_seq', max(id)) FROM markable_favorites; +SELECT setval('markable_bookmarks_id_seq', max(id)) FROM markable_bookmarks; +SELECT setval('migrations_id_seq', max(id)) FROM migrations; +-- model_has_permissions -- combi +-- model_has_roles SELECT setval('molecule_sample_id_seq', max(id)) FROM molecule_sample; -- combi +SELECT setval('molecule_sample_id_seq', max(id)) FROM molecule_sample; +SELECT setval('molecules_id_seq', max(id)) FROM molecules; +SELECT setval('nmrium_id_seq', max(id)) FROM nmrium; +-- SELECT setval('notifications_id_seq', max(id)) FROM notifications; UUID +-- SELECT setval('password_resets_id_seq', max(id)) FROM password_resets; no pkey +SELECT setval('permissions_id_seq', max(id)) FROM permissions; +SELECT setval('personal_access_tokens_id_seq', max(id)) FROM personal_access_tokens; +SELECT setval('project_invitations_id_seq', max(id)) FROM project_invitations; +SELECT setval('project_user_id_seq', max(id)) FROM project_user; +SELECT setval('projects_id_seq', max(id)) FROM projects; +-- role_has_permissions SELECT setval('role_has_permissions_id_seq', max(id)) FROM role_has_permissions; -- combi +SELECT setval('roles_id_seq', max(id)) FROM roles; +SELECT setval('samples_id_seq', max(id)) FROM samples; +-- SELECT setval('sessions_id_seq', max(id)) FROM sessions; UUID +SELECT setval('studies_id_seq', max(id)) FROM studies; +SELECT setval('study_invitations_id_seq', max(id)) FROM study_invitations; +SELECT setval('study_user_id_seq', max(id)) FROM study_user; +-- SELECT setval('taggables_id_seq', max(id)) FROM taggables; no pkey +SELECT setval('tags_id_seq', max(id)) FROM tags; +SELECT setval('team_invitations_id_seq', max(id)) FROM team_invitations; +SELECT setval('team_user_id_seq', max(id)) FROM team_user; +SELECT setval('teams_id_seq', max(id)) FROM teams; +SELECT setval('templates_id_seq', max(id)) FROM templates; +SELECT setval('tickers_id_seq', max(id)) FROM tickers; +SELECT setval('users_id_seq', max(id)) FROM users; +SELECT setval('validations_id_seq', max(id)) FROM validations; +SELECT setval('versions_version_id_seq', max(version_id)) FROM versions; \ No newline at end of file diff --git a/resources/js/Layouts/AppLayout.vue b/resources/js/Layouts/AppLayout.vue index c46e6c7a..b33879ef 100644 --- a/resources/js/Layouts/AppLayout.vue +++ b/resources/js/Layouts/AppLayout.vue @@ -59,7 +59,7 @@
- + diff --git a/resources/js/Pages/Publish.vue b/resources/js/Pages/Publish.vue index b703951e..32a9c19e 100644 --- a/resources/js/Pages/Publish.vue +++ b/resources/js/Pages/Publish.vue @@ -865,21 +865,20 @@ export default { updateProject() { if (this.publishForm.enableProjectMode) { this.loadingStep = true; - axios - .put(route("dashboard.project.update", this.project.id), { - name: this.publishForm.project.name, - description: this.publishForm.project.description, - tags: this.publishForm.project.tags, - tags_array: this.publishForm.project.tags - ? this.publishForm.project.tags.map((a) => a.text) - : [], - license_id: this.license ? this.license.id : null, - species: this.publishForm.project.species, - release_date: this.publishForm.releaseDate, - }) - .then((res) => { - console.log("success"); - }); + axios.put(route("dashboard.project.update", this.project.id), { + name: this.publishForm.project.name, + description: this.publishForm.project.description, + tags: this.publishForm.project.tags, + tags_array: this.publishForm.project.tags + ? this.publishForm.project.tags.map((a) => a.text) + : [], + license_id: this.license ? this.license.id : null, + species: this.publishForm.project.species, + release_date: this.publishForm.releaseDate, + }); + // .then((res) => { + // console.log("success"); + // }); } }, updateSpecies(species) { @@ -930,8 +929,6 @@ export default { "\n " + molecule.MOL.replaceAll('"', "") ); return mol.toSVG(200, 200); - } else { - console.log(molecule); } }, toggleManageAuthor() { diff --git a/resources/js/Pages/Upload.vue b/resources/js/Pages/Upload.vue index e82b898a..6cfbab65 100644 --- a/resources/js/Pages/Upload.vue +++ b/resources/js/Pages/Upload.vue @@ -2541,7 +2541,7 @@ export default { }), smiles: "", - percentage: 1, + percentage: 100, editor: null, studyForm: this.$inertia.form({ @@ -2778,7 +2778,6 @@ export default { this.hasStudies(this.$refs.fsbRef.file); this.fetchProjectDetails().then( (response) => { - console.log(response); this.loadingStep = false; this.project = response.data.project; this.studies = response.data.studies; @@ -3175,7 +3174,7 @@ export default { // } }, updateLoadingStatus(status) { - console.log(status); + // console.log(status); this.loading = status; }, fetchDrafts() { diff --git a/resources/js/Shared/Children.vue b/resources/js/Shared/Children.vue index 01852616..f8ff6d43 100644 --- a/resources/js/Shared/Children.vue +++ b/resources/js/Shared/Children.vue @@ -22,7 +22,7 @@ - - - - - {{ file.name }} - +
@@ -113,10 +113,12 @@ displaySelected(sfile) " > - + + + +
+
+

+ -- molecule(s) information + missing -- +

+
+
+
diff --git a/resources/js/Shared/StudyInfo.vue b/resources/js/Shared/StudyInfo.vue index a385113c..f36fa582 100644 --- a/resources/js/Shared/StudyInfo.vue +++ b/resources/js/Shared/StudyInfo.vue @@ -135,9 +135,6 @@ export default { ); return mol.toSVG(200, 200); } - // else { - // console.log(molecule); - // } }, }, }; diff --git a/resources/js/Shared/Submission.vue b/resources/js/Shared/Submission.vue index 4b5ac78a..9860b3e8 100644 --- a/resources/js/Shared/Submission.vue +++ b/resources/js/Shared/Submission.vue @@ -1989,8 +1989,6 @@ export default { "\n " + molecule.MOL.replaceAll('"', "") ); return mol.toSVG(200, 200); - } else { - console.log(molecule); } }, autoGenerateDescription() { diff --git a/routes/web.php b/routes/web.php index bd1b46b9..b2952034 100644 --- a/routes/web.php +++ b/routes/web.php @@ -39,9 +39,9 @@ }); Route::get('/', function () { - if (Auth::check()) { - return redirect()->route('dashboard'); - } else { + // if (Auth::check()) { + // return redirect()->route('dashboard'); + // } else { return Inertia::render('Welcome', [ 'spectra' => Cache::rememberForever('stats.spectra', function () { return Dataset::where('is_public', true)->get()->count(); @@ -56,7 +56,7 @@ return Dataset::where('is_public', true)->get()->unique('type')->count(); }), ]); - } + // } })->name('welcome'); Route::supportBubble(); From ca44ca98932512decaa46331a90618d2f8cb71cb Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Tue, 14 Nov 2023 04:03:02 +0100 Subject: [PATCH 06/10] fix: FSBrowser folder truncate enabled --- resources/js/Shared/Children.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/Shared/Children.vue b/resources/js/Shared/Children.vue index f8ff6d43..f5b70370 100644 --- a/resources/js/Shared/Children.vue +++ b/resources/js/Shared/Children.vue @@ -19,7 +19,7 @@ ]" @click.stop="displaySelected(file)" > - + Date: Tue, 14 Nov 2023 08:31:16 +0100 Subject: [PATCH 07/10] fix: updated messages in the upload screen and also formatting changes --- resources/js/Pages/Upload.vue | 22 ++++++---------------- routes/web.php | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/resources/js/Pages/Upload.vue b/resources/js/Pages/Upload.vue index 6cfbab65..6e76db0f 100644 --- a/resources/js/Pages/Upload.vue +++ b/resources/js/Pages/Upload.vue @@ -737,6 +737,7 @@
  • Pending: {{ + studies.length - inprogressStudies.length }} out @@ -778,23 +779,12 @@ class="mt-2 max-w-xl text-sm text-gray-500" >

    - Looks - like - we're - missing - some + Some important Spectra - metadata. - No - worries, - though - – - We - got - your - back - covered! + metadata + are + needed. Would you like @@ -3362,7 +3352,7 @@ export default { } this.spectraLoadingMessage = "
    Pending: " + - this.importPendingSamples.length + + (this.studies.length - this.importPendingSamples.length) + "/" + this.studies.length + "
    Processing Spectra from Sample: " + diff --git a/routes/web.php b/routes/web.php index b2952034..6770bf8b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -42,20 +42,20 @@ // if (Auth::check()) { // return redirect()->route('dashboard'); // } else { - return Inertia::render('Welcome', [ - 'spectra' => Cache::rememberForever('stats.spectra', function () { - return Dataset::where('is_public', true)->get()->count(); - }), - 'projects' => Cache::rememberForever('stats.projects', function () { - return Project::where('is_public', true)->get()->count(); - }), - 'compounds' => Cache::rememberForever('stats.compounds', function () { - return Molecule::whereNotNull('identifier')->get()->count(); - }), - 'techniques' => Cache::rememberForever('stats.techniques', function () { - return Dataset::where('is_public', true)->get()->unique('type')->count(); - }), - ]); + return Inertia::render('Welcome', [ + 'spectra' => Cache::rememberForever('stats.spectra', function () { + return Dataset::where('is_public', true)->get()->count(); + }), + 'projects' => Cache::rememberForever('stats.projects', function () { + return Project::where('is_public', true)->get()->count(); + }), + 'compounds' => Cache::rememberForever('stats.compounds', function () { + return Molecule::whereNotNull('identifier')->get()->count(); + }), + 'techniques' => Cache::rememberForever('stats.techniques', function () { + return Dataset::where('is_public', true)->get()->unique('type')->count(); + }), + ]); // } })->name('welcome'); From 87099f376aa0833c792bae48c2a2255043501ebf Mon Sep 17 00:00:00 2001 From: NishaSharma14 Date: Tue, 14 Nov 2023 09:55:43 +0100 Subject: [PATCH 08/10] fix: update postgres version to 15.4 --- resources/ops/docker/app/app.dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/ops/docker/app/app.dockerfile b/resources/ops/docker/app/app.dockerfile index 1ab67b31..eda6cacb 100644 --- a/resources/ops/docker/app/app.dockerfile +++ b/resources/ops/docker/app/app.dockerfile @@ -11,7 +11,8 @@ RUN docker-php-ext-install sockets RUN pecl install apcu RUN docker-php-ext-enable apcu RUN docker-php-ext-install pcntl -RUN apk update && apk add postgresql-client +#RUN apk update && apk add postgresql-client +RUN apk --update add postgresql15-client --repository=https://dl-cdn.alpinelinux.org/alpine/edge/main RUN set -ex \ && apk --no-cache add \ From cca8fcedf053d0b341b3bf26846b590289bcaac3 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Tue, 14 Nov 2023 10:44:38 +0100 Subject: [PATCH 09/10] fix: added titles to public pages and various other minor updates --- app/Http/Controllers/StudyController.php | 4 +-- app/Providers/AppServiceProvider.php | 3 ++- resources/js/Pages/Public/Project/Dataset.vue | 26 +++++++------------ resources/js/Pages/Public/Project/Files.vue | 3 +++ resources/js/Pages/Public/Project/Layout.vue | 1 + resources/js/Pages/Public/Project/License.vue | 3 +++ resources/js/Pages/Public/Project/Samples.vue | 3 +++ resources/js/Pages/Public/Project/Show.vue | 3 +++ resources/js/Pages/Public/Project/Study.vue | 3 +++ resources/js/Pages/Publish.vue | 2 -- resources/js/Pages/Upload.vue | 2 +- resources/js/Shared/StudyCardPublic.vue | 2 +- resources/js/Shared/StudyInfo.vue | 10 +++---- 13 files changed, 37 insertions(+), 28 deletions(-) diff --git a/app/Http/Controllers/StudyController.php b/app/Http/Controllers/StudyController.php index 787b71a0..d915383d 100644 --- a/app/Http/Controllers/StudyController.php +++ b/app/Http/Controllers/StudyController.php @@ -213,7 +213,7 @@ public function nmriumInfo(Request $request, Study $study) $studyFSObject = $study->fsObject; $datasetFSObject = $dataset->fsObject; $path = '/'.$studyFSObject->name.'/'.$datasetFSObject->name; - + $pathsMatch = false; foreach ($nmriumInfo['data']['spectra'] as $spectra) { unset($_nmriumJSON['data']['spectra']); @@ -229,7 +229,7 @@ public function nmriumInfo(Request $request, Study $study) break; } } - if ($pathsMatch){ + if ($pathsMatch) { $_nmriumJSON['data']['spectra'] = [$spectra]; $_nmrium = $dataset->nmrium; if ($_nmrium) { diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index a83c403d..747ebd94 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use Illuminate\Support\Facades\App; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -26,7 +27,7 @@ public function register() */ public function boot() { - if ($this->app->environment('production')) { + if (App::environment() == 'production') { \URL::forceScheme('https'); } } diff --git a/resources/js/Pages/Public/Project/Dataset.vue b/resources/js/Pages/Public/Project/Dataset.vue index f70c4f32..63375fa6 100644 --- a/resources/js/Pages/Public/Project/Dataset.vue +++ b/resources/js/Pages/Public/Project/Dataset.vue @@ -1,4 +1,5 @@