1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-04 13:48:56 +02:00

Merge pull request #82 from Unleash/editable-state

editable=false on strategies
This commit is contained in:
Sveinung Røsaker 2017-06-29 09:16:16 +02:00 committed by GitHub
commit 75ddedc5a6
2 changed files with 24 additions and 17 deletions

View File

@ -33,7 +33,11 @@ class StrategiesListComponent extends Component {
<strong>{strategy.name}</strong> <strong>{strategy.name}</strong>
</Link> </Link>
</ListItemContent> </ListItemContent>
<IconButton name="delete" onClick={() => removeStrategy(strategy)} /> {
strategy.editable === false ?
'' :
<IconButton name="delete" onClick={() => removeStrategy(strategy)} />
}
</ListItem> </ListItem>
)) : <ListItem>No entries</ListItem>} )) : <ListItem>No entries</ListItem>}
</List> </List>

View File

@ -60,21 +60,24 @@ export default class StrategyDetails extends Component {
const tabContent = this.getTabContent(activeTabId); const tabContent = this.getTabContent(activeTabId);
return ( return (<Grid className="mdl-color--white">
<Grid className="mdl-color--white"> <Cell col={12}>
<Cell col={12}> <HeaderTitle title={strategy.name} subtitle={strategy.description} />
<HeaderTitle title={strategy.name} subtitle={strategy.description} /> {strategy.editable === false ? '' : <Tabs activeTab={activeTabId} ripple>
<Tabs activeTab={activeTabId} ripple> <Tab onClick={() => this.goToTab('view')}>
<Tab onClick={() => this.goToTab('view')}>Details</Tab> Details
<Tab onClick={() => this.goToTab('edit')}>Edit</Tab> </Tab>
</Tabs> <Tab onClick={() => this.goToTab('edit')}>
<section> Edit
<div className="content"> </Tab>
{tabContent} </Tabs>}
</div>
</section> <section>
</Cell> <div className="content">
</Grid> {tabContent}
); </div>
</section>
</Cell>
</Grid>);
} }
} }