Skip to content

Commit

Permalink
Merge pull request #999 from populationgenomics/dev
Browse files Browse the repository at this point in the history
Release - Waterproofing 2024-11-27
  • Loading branch information
dancoates authored Nov 27, 2024
2 parents b91e2e2 + 9c5aca1 commit ea2ee86
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
24 changes: 24 additions & 0 deletions db/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1865,4 +1865,28 @@
remarks="Migration of family external IDs to separate table"
/>
</changeSet>
<changeSet author="dan.coates" id="2024-11-27_clean_up_project_table">
<sql>SET @@system_versioning_alter_history = 1;</sql>

<dropForeignKeyConstraint baseTableName="project"
constraintName="FK_PROJECT_READ_GROUP_GROUP_ID" />
<dropForeignKeyConstraint baseTableName="project"
constraintName="FK_PROJECT_WRITE_GROUP_GROUP_ID" />
<dropColumn
tableName="project"
columnName="read_group_id"
/>
<dropColumn
tableName="project"
columnName="write_group_id"
/>
<dropColumn
tableName="project"
columnName="read_group_name"
/>
<dropColumn
tableName="project"
columnName="write_group_name"
/>
</changeSet>
</databaseChangeLog>
17 changes: 14 additions & 3 deletions web/src/shared/components/Header/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { Link } from 'react-router-dom'
import { Link, LinkProps } from 'react-router-dom'
import { Dropdown, Menu, Popup } from 'semantic-ui-react'

import { BillingApi } from '../../../sm-api'
Expand Down Expand Up @@ -55,24 +55,34 @@ interface MenuItem {
url: string
icon: JSX.Element
submenu?: MenuItem[]
reloadDocument?: boolean
}
interface MenuItemProps {
index: number
item: MenuItem
}

// A link component that reloads the document when clicked
// This is used for the graphiql link which doesn't render
// properly without a reload
const ReloadingLink = (props: LinkProps) => {
return <Link reloadDocument={true} {...props} />
}

const MenuItem: React.FC<MenuItemProps> = ({ index, item }) => {
const theme = React.useContext(ThemeContext)
const isDarkMode = theme.theme === 'dark-mode'

const MenuLinkComponent = item.reloadDocument ? ReloadingLink : Link

const dropdown = (item: MenuItem) => (
<Dropdown id="navDrop" text={item.title} key={index} inverted={isDarkMode}>
<Dropdown.Menu id="navDropMenu">
{item.submenu &&
item.submenu.map((subitem, subindex) => (
<Dropdown.Item
id="navDropMenuItem"
as={Link}
as={MenuLinkComponent}
to={subitem.url}
key={subindex}
>
Expand Down Expand Up @@ -105,7 +115,7 @@ const MenuItem: React.FC<MenuItemProps> = ({ index, item }) => {
return item.submenu ? (
<Menu.Item className="headerMenuItem">{popup(dropdown(item), item.icon)}</Menu.Item>
) : (
<Menu.Item className="headerMenuItem" as={Link} to={item.url} key={index}>
<Menu.Item className="headerMenuItem" as={MenuLinkComponent} to={item.url} key={index}>
{popup(item.title, item.icon)}
</Menu.Item>
)
Expand Down Expand Up @@ -141,6 +151,7 @@ const NavBar = () => {
{
title: 'GraphQL',
url: '/graphql',
reloadDocument: true,
icon: <TroubleshootIcon />,
},
InsightsPages,
Expand Down

0 comments on commit ea2ee86

Please sign in to comment.