Skip to content

Commit

Permalink
fix: various bug fixes and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Nov 14, 2023
1 parent da98574 commit f7ca828
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 53 deletions.
50 changes: 50 additions & 0 deletions database/scripts/sync_index.sql
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion resources/js/Layouts/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</div>
</TransitionChild>
<div class="flex-shrink-0 flex items-center px-4">
<Link :href="route('dashboard')">
<Link :href="route('welcome')">
<jet-application-logo
class="block h-8 w-auto"
/>
Expand Down
31 changes: 14 additions & 17 deletions resources/js/Pages/Publish.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -930,8 +929,6 @@ export default {
"\n " + molecule.MOL.replaceAll('"', "")
);
return mol.toSVG(200, 200);
} else {
console.log(molecule);
}
},
toggleManageAuthor() {
Expand Down
5 changes: 2 additions & 3 deletions resources/js/Pages/Upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2541,7 +2541,7 @@ export default {
}),
smiles: "",
percentage: 1,
percentage: 100,
editor: null,
studyForm: this.$inertia.form({
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -3175,7 +3174,7 @@ export default {
// }
},
updateLoadingStatus(status) {
console.log(status);
// console.log(status);
this.loading = status;
},
fetchDrafts() {
Expand Down
45 changes: 24 additions & 21 deletions resources/js/Shared/Children.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<DisclosureButton>
<span v-if="file.loading">
<svg
class="animate-spin mr-3 ml-1 h-5 w-5 text-dark"
class="animate-spin mr-3 ml-1 h-5 w-5 text-dark inline"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
Expand Down Expand Up @@ -59,24 +59,24 @@
/>
</svg>
</span>
</DisclosureButton>
<span
:class="[
file.status == 'missing' ? 'text-red-800' : '',
]"
>
<span
v-if="file.type == 'directory'"
v-html="composeIcon(file)"
></span>
<span v-else>
<FolderIcon
class="inline -ml-1.5 mr-1 h-5 w-5 text-gray-700"
aria-hidden="true"
/>
:class="[
file.status == 'missing' ? 'text-red-800' : '',
]"
>
<span
v-if="file.type == 'directory'"
v-html="composeIcon(file)"
></span>
<span v-else>
<FolderIcon
class="inline -ml-1.5 mr-1 h-5 w-5 text-gray-700"
aria-hidden="true"
/>
</span>
{{ file.name }}
</span>
{{ file.name }}
</span>
</DisclosureButton>
</div>
<DisclosurePanel class="space-y-1">
<span v-for="sfile in file.children" :key="sfile.name">
Expand Down Expand Up @@ -113,10 +113,12 @@
displaySelected(sfile)
"
>
<DisclosureButton>
<DisclosureButton
class="w-full text-left truncate ..."
>
<span v-if="sfile.loading">
<svg
class="animate-spin ml-1 mr-3 h-5 w-5 text-dark"
class="animate-spin ml-1 mr-3 h-5 w-5 text-dark inline"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
Expand All @@ -142,7 +144,7 @@
open
? 'text-gray-700 rotate-90'
: 'text-gray-300',
'mr-2 -mt-2 inline flex-shrink-0 h-5 w-5 transform group-hover:text-gray-700 transition-colors ease-in-out duration-150',
'mr-2 flex-shrink-0 inline h-5 w-5 transform group-hover:text-gray-700 transition-colors ease-in-out duration-150',
]"
viewBox="0 0 20 20"
aria-hidden="true"
Expand All @@ -159,7 +161,8 @@
sfile.status ==
'missing'
? 'text-red-800'
: 'ellipsis',
: '',
'',
]"
style="
user-select: none;
Expand Down
1 change: 0 additions & 1 deletion resources/js/Shared/SpectraEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ export default {
}
}
if (data && data.source == "data") {
// console.log(type)
if (
e.origin != "https://nmriumdev.nmrxiv.org" &&
e.origin != "https://nmrium.nmrxiv.org"
Expand Down
21 changes: 20 additions & 1 deletion resources/js/Shared/StudyCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
<div
class="bg-white rounded-t-md flex justify-center items-center"
>
<span>
<span
v-if="
study.molecules[0] &&
study.molecules[0].CANONICAL_SMILES
"
>
<Depictor2D
class="py-2"
:molecule="
Expand All @@ -21,6 +26,20 @@
:show-download="false"
></Depictor2D>
</span>
<span v-else>
<div class="h-64">
<div
class="absolute inset-0 flex items-center justify-center"
>
<h2 class="text-gray-200 font-bold">
<i
>-- molecule(s) information
missing --</i
>
</h2>
</div>
</div>
</span>
</div>
</li>
</ul>
Expand Down
3 changes: 0 additions & 3 deletions resources/js/Shared/StudyInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ export default {
);
return mol.toSVG(200, 200);
}
// else {
// console.log(molecule);
// }
},
},
};
Expand Down
2 changes: 0 additions & 2 deletions resources/js/Shared/Submission.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1989,8 +1989,6 @@ export default {
"\n " + molecule.MOL.replaceAll('"', "")
);
return mol.toSVG(200, 200);
} else {
console.log(molecule);
}
},
autoGenerateDescription() {
Expand Down
8 changes: 4 additions & 4 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -56,7 +56,7 @@
return Dataset::where('is_public', true)->get()->unique('type')->count();
}),
]);
}
// }
})->name('welcome');

Route::supportBubble();
Expand Down

0 comments on commit f7ca828

Please sign in to comment.