Skip to content

Commit

Permalink
Merge branch 'master' into improve-custom-selections
Browse files Browse the repository at this point in the history
  • Loading branch information
alisman authored Mar 21, 2024
2 parents 5125bcc + 5e42b4c commit 518c1c3
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 11 deletions.
2 changes: 1 addition & 1 deletion end-to-end-test/local/docker_compose/keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
networks:
- cbio-net
container_name: keycloak
image: jboss/keycloak:11.0.3
image: quay.io/keycloak/keycloak:11.0.3
restart: unless-stopped
depends_on:
- kcdb
Expand Down
4 changes: 0 additions & 4 deletions end-to-end-test/local/runtime-config/portal.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ spring.datasource.username=cbio_user
spring.datasource.password=somepassword
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
db.user=cbio_user
db.password=somepassword
db.driver=com.mysql.jdbc.Driver
db.connection_string=jdbc:mysql://cbioportal-database:3306/cbioportal?useSSL=false&allowPublicKeyRetrieval=true
# set tomcat_resource_name when using dbconnector=jndi instead of the default
# dbconnector=dbcp. Note that dbconnector needs to be set in CATLINA_OPTS when
# using Tomcat (CATALINA_OPTS="-Ddbconnector=jndi"). It does not get picked up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ describe('oncoprint', function() {
const urlWithUserConfig = createUrlWithSettingsQueryParam(
MANUAL_TRACK_CONFIG
);
// go to home page first because navigating to same page with hash params doesn't cause change
goToUrlAndSetLocalStorage(CBIOPORTAL_URL, false);
goToUrlAndSetLocalStorage(urlWithUserConfig, false);
waitForOncoprint(ONCOPRINT_TIMEOUT);

Expand Down Expand Up @@ -172,9 +170,7 @@ describe('oncoprint', function() {
const urlWithUserConfig = createUrlWithSettingsQueryParam(
customConfig
);
// go to home page first because navigating to same page with hash params doesn't cause change
goToUrlAndSetLocalStorage(CBIOPORTAL_URL, false);
browser.url(urlWithUserConfig);
goToUrlAndSetLocalStorage(urlWithUserConfig, false);

waitForOncoprint(ONCOPRINT_TIMEOUT);

Expand Down
2 changes: 2 additions & 0 deletions end-to-end-test/shared/specUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ function goToUrlAndSetLocalStorage(url, authenticated = false) {
const currentUrl = browser.getUrl();
const needToLogin =
authenticated && (!currentUrl || !currentUrl.includes('http'));
// navigate to blank page first to prevent issues with url hash params
browser.url('about:blank');
if (!useExternalFrontend) {
browser.url(url);
console.log('Connecting to: ' + url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import _ from 'lodash';
import { Dropdown, Checkbox } from 'react-bootstrap';
import { DropdownToggleProps } from 'react-bootstrap/lib/DropdownToggle';
import { DropdownMenuProps } from 'react-bootstrap/lib/DropdownMenu';
import { action, computed } from 'mobx';

export interface IColumnVisibilityDef {
id: string;
Expand Down Expand Up @@ -40,6 +41,8 @@ export class ColumnVisibilityControls extends React.Component<
constructor(props: IColumnVisibilityControlsProps) {
super(props);
this.handleSelect = this.handleSelect.bind(this);
this.selectAll = this.selectAll.bind(this);
this.deselectAll = this.deselectAll.bind(this);
}

public render() {
Expand All @@ -52,6 +55,59 @@ export class ColumnVisibilityControls extends React.Component<
);
}

private toggleAllColumns(select: boolean) {
if (!this.props.columnVisibility) return;

const toggledColumns = new Set<string>();
this.props.columnVisibility.forEach(column => {
if (column.visible !== select) {
toggledColumns.add(column.id);
}
});

toggledColumns.forEach(columnId => {
if (this.props.onColumnToggled && columnId) {
this.props.onColumnToggled(
columnId,
this.props.columnVisibility
);
}
});
}

private selectAll() {
this.toggleAllColumns(true);
}

private deselectAll() {
this.toggleAllColumns(false);
}

get selectDeselectAllButtons() {
return (
<div
style={{
display: 'flex',
alignItems: 'baseline',
gap: '3px',
}}
>
<button
className="btn btn-default btn-xs"
onClick={this.selectAll}
>
{`Select all`}
</button>
<button
className="btn btn-default btn-xs"
onClick={this.deselectAll}
>
{'Deselect all'}
</button>
</div>
);
}

private get defaultDropdown() {
return (
<Dropdown className={this.props.className} id="dropdown-custom-1">
Expand All @@ -70,6 +126,9 @@ export class ColumnVisibilityControls extends React.Component<
whiteSpace: 'nowrap',
}}
>
<div style={{ marginTop: 10, marginBottom: 10 }}>
{this.selectDeselectAllButtons}
</div>
<ul className="list-unstyled">
{this.props.columnVisibility &&
_.map(
Expand Down
22 changes: 21 additions & 1 deletion src/shared/components/iframeLoader/IFrameLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import LoadingIndicator from '../loadingIndicator/LoadingIndicator';
import { observer } from 'mobx-react';
import { makeObservable, observable } from 'mobx';
import autobind from 'autobind-decorator';
import FontAwesome from 'react-fontawesome';
interface FrameLoaderProps {
url: string;
className?: string;
Expand Down Expand Up @@ -35,12 +36,30 @@ export default class IFrameLoader extends React.Component<
//NOTE: we need zindex to be higher than that of global loader
render() {
return (
<div style={{ position: 'relative', width: this.props.width }}>
<div
style={{
position: 'relative',
width: this.props.width,
marginTop: 5,
}}
>
<LoadingIndicator
center={true}
size={'big'}
isLoading={!this.iframeLoaded}
/>
<a
href={this.props.url}
target="_blank"
style={{
position: 'absolute',
fontSize: 12,
right: 0,
top: -18,
}}
>
Open in new window <FontAwesome name="external-link" />
</a>
<iframe
id={this.props.iframeId || ''}
className={this.props.className || ''}
Expand All @@ -50,6 +69,7 @@ export default class IFrameLoader extends React.Component<
zIndex: 100,
height: this.props.height,
border: 'none',
marginTop: 5,
}}
src={this.props.url}
onLoad={this.onLoad}
Expand Down

0 comments on commit 518c1c3

Please sign in to comment.