Skip to content

Commit

Permalink
frontend: Uses feature keys to retrieve flag values
Browse files Browse the repository at this point in the history
  • Loading branch information
amrutac committed Apr 27, 2018
1 parent efb15f6 commit 76b5f7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions frontend/public/components/cluster-overview-container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class ClusterOverviewContainer_ extends SafetyFirst {

componentDidMount() {
super.componentDidMount();
if (this.props.flags.SECURITY_LABELLER) {
if (this.props.flags[FLAGS.SECURITY_LABELLER]) {
this._checkFixableIssues();
this._checkScannedPods();
}
}

componentWillReceiveProps (nextProps) {
if (this.props.flags.SECURITY_LABELLER || !nextProps.flags.SECURITY_LABELLER) {
if (this.props.flags[FLAGS.SECURITY_LABELLER] || !nextProps.flags[FLAGS.SECURITY_LABELLER]) {
return;
}
if (_.isFinite(this.state.fixableIssues) || _.isFinite(this.state.scannedPods)) {
Expand Down
7 changes: 4 additions & 3 deletions frontend/public/components/namespace.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,17 @@ const NamespaceDropdown = connect(() => ({activeNamespace: getActiveNamespace()}
});

const NamespaceSelector_ = props => {
if (props.flags.OPENSHIFT === undefined) {
const openshiftFlag = props.flags[FLAGS.OPENSHIFT];
if (openshiftFlag === undefined) {
// Wait until the flag is initialized.
return <div className="co-namespace-selector" />;
}

const model = getModel(props.flags.OPENSHIFT);
const model = getModel(openshiftFlag);
const resources = [{ kind: model.kind, prop: 'namespace', isList: true }];

return <Firehose resources={resources}>
<NamespaceDropdown useProjects={props.flags.OPENSHIFT} />
<NamespaceDropdown useProjects={openshiftFlag} />
</Firehose>;
};

Expand Down

0 comments on commit 76b5f7e

Please sign in to comment.