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

Add homepage_website to consortia pages #1192

Merged
merged 2 commits into from
Mar 20, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""consortia_add_homepage_website

Revision ID: b4b234bd55cf
Revises: 6fbdea177f37
Create Date: 2024-03-19 17:03:00.214065

"""

from typing import Optional

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = "b4b234bd55cf"
down_revision: Optional[str] = "6fbdea177f37"
branch_labels: Optional[str] = None
depends_on: Optional[str] = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"study",
sa.Column(
"homepage_website",
postgresql.JSONB(astext_type=sa.Text()), # type: ignore
nullable=True,
),
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("study", "homepage_website")
# ### end Alembic commands ###
1 change: 1 addition & 0 deletions nmdc_server/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class Study(Base, AnnotatedModel):
gold_study_identifiers = Column(JSONB, nullable=True)

study_category = Column(String, nullable=True)
homepage_website = Column(JSONB, nullable=True)
part_of = Column(JSONB, nullable=True)
children = Column(JSONB, nullable=True)

Expand Down
1 change: 1 addition & 0 deletions nmdc_server/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ class StudyBase(AnnotatedBase):
relevant_protocols: Optional[List[str]]
funding_sources: Optional[List[str]]
gold_study_identifiers: Optional[List[str]]
homepage_website: Optional[List[str]]
part_of: Optional[List[str]]
study_category: Optional[str]
children: Optional[List[Study]] = []
Expand Down
6 changes: 6 additions & 0 deletions web/src/components/TeamInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export default defineComponent({
/>
</span>
</div>
<div
v-if="item.homepage_website && item.homepage_website[0]"
class="text-h5 py-2 primary--text"
>
Consortium Homepage: <a :href="item.homepage_website">{{ item.homepage_website[0] }}</a>
</div>
<div
v-if="team"
class="text-h5 py-2 primary--text"
Expand Down
1 change: 1 addition & 0 deletions web/src/data/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export interface StudySearchResults extends BaseSearchResult {
gold_study_identifiers: string[];
sample_count: number;
study_category: string;
homepage_website: string[] | null;
part_of: string[] | null;
children: StudySearchResults[];
has_credit_associations: {
Expand Down
Loading