import * as React from 'react'; import { getServerConfig } from 'config/config'; import { Link } from 'react-router-dom'; import { AppStore } from '../../../AppStore'; import LoadingIndicator from '../loadingIndicator/LoadingIndicator'; import { observer } from 'mobx-react'; import { observable, computed, makeObservable } from 'mobx'; import { buildCBioPortalPageUrl } from '../../api/urls'; export class UserDataAccessToken { @observable.ref token: string; @observable.ref creationDate: string; @observable.ref expirationDate: string; @observable.ref username: string; constructor( token: string, creationDate: string, expirationDate: string, username: string ) { makeObservable(this); this.token = token; this.creationDate = creationDate; this.expirationDate = expirationDate; this.username = username; } } export interface IDataAccessTokensProps { token?: string; creationDate?: string; expirationDate?: string; loadingComponent?: JSX.Element; appStore: AppStore; } @observer export class DataAccessTokensDropdown extends React.Component< IDataAccessTokensProps, {} > { public static defaultProps: Partial = { loadingComponent: , }; constructor(props: IDataAccessTokensProps) { super(props); makeObservable(this); } @computed get getDatDropdownList(): any { const listItems = [ { id: 'signout', action: ( Sign out ), hide: false, }, { id: 'datDownload', action: ( Data Access Token ), hide: this.props.appStore.isSocialAuthenticated || (getServerConfig().dat_method !== 'uuid' && getServerConfig().dat_method !== 'jwt' && getServerConfig().dat_method !== 'oauth2'), }, ]; const shownListItems = listItems.filter(l => { return !l.hide; }); return shownListItems.map(l => { return
  • {l.action}
  • ; }); } render() { return ; } }