Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AboutPage] fixed alignment; added group_id to create_database #1560

Merged
merged 2 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions metaspace/graphql/src/modules/user/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ export const Resolvers = {
relations: ['credentials'],
})
if (update.email) {
// Check if the email is already in use
const existingUser = await entityManager.getRepository(UserModel).findOne({
where: { email: update.email },
})
if (existingUser && existingUser.id !== userId) { // email is already in use
throw new UserError('There was an error updating the user. Contact the administrator.')
}

await sendEmailVerificationToken(userObj.credentials, update.email)
}
const { email: notVerifiedEmail, primaryGroupId, ...rest } = update
Expand Down
2 changes: 1 addition & 1 deletion metaspace/python-client/metaspace/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.0.9'
__version__ = '2.0.10'

from metaspace.sm_annotation_utils import (
SMInstance,
Expand Down
18 changes: 14 additions & 4 deletions metaspace/python-client/metaspace/sm_annotation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,12 @@ def update_dataset(
self.query(query, variables)

def create_database(
self, local_path: Union[str, Path], name: str, version: str, is_public: bool = False
self,
local_path: Union[str, Path],
name: str,
version: str,
is_public: bool = False,
groupId: str = None,
) -> dict:
# TODO: s3 -> s3a in GraphQL
result = self.query("""query { currentUser { id } }""")
Expand All @@ -855,7 +860,7 @@ def create_database(
"version": version,
"isPublic": is_public,
"filePath": s3_path,
"groupId": self.get_primary_group_id(),
"groupId": groupId if groupId else self.get_primary_group_id(),
}
}
return self.query(query, variables)['createMolecularDB']
Expand Down Expand Up @@ -2112,9 +2117,14 @@ def databases(self) -> List[MolecularDB]:
return [MolecularDB(db) for db in dbs]

def create_database(
self, local_path: Union[str, Path], name: str, version: str, is_public: bool = False
self,
local_path: Union[str, Path],
name: str,
version: str,
is_public: bool = False,
groupId: str = None,
) -> dict:
return self._gqclient.create_database(local_path, name, version, is_public)
return self._gqclient.create_database(local_path, name, version, is_public, groupId)

def update_database(self, id: int, is_public: bool = None, archived: bool = None) -> dict:
return self._gqclient.update_database(id, is_public, archived)
Expand Down
46 changes: 24 additions & 22 deletions metaspace/webapp/src/modules/App/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,30 +258,32 @@ const AboutPage = defineComponent({
<div class="svg-container">
<EUFlag viewBox="0 0 810 540" alt="EU" />
</div>
<span>
<div>
<b>European Union Horizon2020 and Horizon Europe Programs</b>
<br />
under grant agreements
<a class="mx-1" href="https://cordis.europa.eu/project/id/634402">
634402
</a>
/
<a class="mx-1" href="https://cordis.europa.eu/project/id/773089">
773089
</a>
/
<a class="mx-1" href="https://cordis.europa.eu/project/id/773089">
825184
</a>
/
<a class="mx-1" href="https://cordis.europa.eu/project/id/101092644">
101092644
</a>
/
<a class="ml-1" href="https://cordis.europa.eu/project/id/101092646">
101092646
</a>
</span>
<div class="flex flex-wrap">
under grant agreements
<a class="mx-1" href="https://cordis.europa.eu/project/id/634402">
634402
</a>
/
<a class="mx-1" href="https://cordis.europa.eu/project/id/773089">
773089
</a>
/
<a class="mx-1" href="https://cordis.europa.eu/project/id/773089">
825184
</a>
/
<a class="mx-1" href="https://cordis.europa.eu/project/id/101092644">
101092644
</a>
/
<a class="ml-1" href="https://cordis.europa.eu/project/id/101092646">
101092646
</a>
</div>
</div>
</li>
<li>
<div class="svg-container">
Expand Down
7 changes: 5 additions & 2 deletions metaspace/webapp/src/modules/App/CiteMetaspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ export const CiteMetaspace = defineComponent({
<p class="cite-meta-p">
Please cite our publication (
<a href="http://www.nature.com/nmeth/journal/v14/n1/full/nmeth.4072.html">
Palmer et al., 2016, Nature Methods
Palmer et al., 2017, Nature Methods
</a>
) and refer to <a href="https://metaspace2020.eu">https://metaspace2020.eu</a>.
</p>
<p>
If you are preparing a scientific publication based on METASPACE annotations, create a
<RouterLink to="/projects">project</RouterLink> and follow the &lsquo;Scientific Publishing&rsquo; workflow.
<RouterLink to="/projects" class="ml-1">
project
</RouterLink>{' '}
and follow the &lsquo;Scientific Publishing&rsquo; workflow.
</p>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ exports[`PublicationsPage > should match snapshot 1`] = `
<h2 id=\\"others\\">Other publications</h2><a class=\\"publication-link flex items-center\\" href=\\"https://scholar.google.com/scholar?q=%22METASPACE%22+AND+%28%22imaging+mass+spectrometry%22+OR+%22mass+spectrometry+imaging%22%29\\" target=\\"_blank\\">Research articles using METASPACE (332)<i data-v-1083ec30=\\"\\" class=\\"flex h-4 w-4 pointer-events-none\\"><svg></svg></i></a><a class=\\"publication-link flex items-center mt-1\\" href=\\"https://scholar.google.com/scholar?q=%22METASPACE%22+AND+%28%22imaging+mass+spectrometry%22+OR+%22mass+spectrometry+imaging%22%29++AND+%22Review+article%22&amp;btnG=\\" target=\\"_blank\\">Reviews (34)<i data-v-1083ec30=\\"\\" class=\\"flex h-4 w-4 pointer-events-none\\"><svg></svg></i></a>
<div class=\\"cite-meta-wrapper\\">
<h3>How should I cite METASPACE?</h3>
<p class=\\"cite-meta-p\\">Please cite our publication (<a href=\\"http://www.nature.com/nmeth/journal/v14/n1/full/nmeth.4072.html\\">Palmer et al., 2016, Nature Methods</a>) and refer to <a href=\\"https://metaspace2020.eu\\">https://metaspace2020.eu</a>.</p>
<p class=\\"cite-meta-p\\">Please cite our publication (<a href=\\"http://www.nature.com/nmeth/journal/v14/n1/full/nmeth.4072.html\\">Palmer et al., 2017, Nature Methods</a>) and refer to <a href=\\"https://metaspace2020.eu\\">https://metaspace2020.eu</a>.</p>
<p>If you are preparing a scientific publication based on METASPACE annotations, create a
<div>project</div> and follow the ‘Scientific Publishing’ workflow.</p>
<div class=\\"ml-1\\">project</div> and follow the ‘Scientific Publishing’ workflow.</p>
</div>
</div>
</div>"
Expand Down