mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-02-19 08:16:34 +00:00
When showing data from WikiTree, don't show "all relatives" chart option
This commit is contained in:
@@ -97,6 +97,8 @@ interface State {
|
||||
chartType: ChartType;
|
||||
/** Whether to show the error popup. */
|
||||
showErrorPopup: boolean;
|
||||
/** True if data is loaded from WikiTree. */
|
||||
wikiTreeSource: boolean;
|
||||
}
|
||||
|
||||
export class App extends React.Component<RouteComponentProps, {}> {
|
||||
@@ -106,6 +108,7 @@ export class App extends React.Component<RouteComponentProps, {}> {
|
||||
standalone: true,
|
||||
chartType: ChartType.Hourglass,
|
||||
showErrorPopup: false,
|
||||
wikiTreeSource: false,
|
||||
};
|
||||
chartRef: Chart | null = null;
|
||||
|
||||
@@ -291,6 +294,7 @@ export class App extends React.Component<RouteComponentProps, {}> {
|
||||
showSidePanel,
|
||||
standalone,
|
||||
chartType,
|
||||
wikiTreeSource: source === 'wikitree',
|
||||
}),
|
||||
);
|
||||
} catch (error) {
|
||||
@@ -427,6 +431,7 @@ export class App extends React.Component<RouteComponentProps, {}> {
|
||||
<TopBar
|
||||
{...props}
|
||||
gedcom={this.state.data && this.state.data.gedcom}
|
||||
allowAllRelativesChart={!this.state.wikiTreeSource}
|
||||
showingChart={
|
||||
!!(
|
||||
this.props.history.location.pathname === '/view' &&
|
||||
|
||||
@@ -40,9 +40,13 @@ interface EventHandlers {
|
||||
}
|
||||
|
||||
interface Props {
|
||||
/** True if the application is currently showing a chart. */
|
||||
showingChart: boolean;
|
||||
/** Data used for the search index. */
|
||||
gedcom?: GedcomData;
|
||||
standalone: boolean;
|
||||
/** Whether to show the "All relatives" chart type in the menu. */
|
||||
allowAllRelativesChart: boolean;
|
||||
eventHandlers: EventHandlers;
|
||||
}
|
||||
|
||||
@@ -320,13 +324,15 @@ export class TopBar extends React.Component<
|
||||
defaultMessage="Hourglass chart"
|
||||
/>
|
||||
</Dropdown.Item>
|
||||
<Dropdown.Item onClick={() => this.changeView('relatives')}>
|
||||
<Icon name="users" />
|
||||
<FormattedMessage
|
||||
id="menu.relatives"
|
||||
defaultMessage="All relatives"
|
||||
/>
|
||||
</Dropdown.Item>
|
||||
{this.props.allowAllRelativesChart ? (
|
||||
<Dropdown.Item onClick={() => this.changeView('relatives')}>
|
||||
<Icon name="users" />
|
||||
<FormattedMessage
|
||||
id="menu.relatives"
|
||||
defaultMessage="All relatives"
|
||||
/>
|
||||
</Dropdown.Item>
|
||||
) : null}
|
||||
<Dropdown.Item onClick={() => this.changeView('fancy')}>
|
||||
<Icon name="users" />
|
||||
<FormattedMessage
|
||||
|
||||
Reference in New Issue
Block a user