selectDeployment() { const deployments = alt.stores.DeploymentsStore.getAll(this.props.cluster); const options = [ {title: intl('cancel')}, ...deployments.map(deployment => { const name = deployment.getIn(['metadata', 'name']); return { title: name, onPress: () => { this.setState({deployment, name}); this.refs.nameInput.setText(name); }, }; }).toJS(), ]; const title = deployments.size > 0 ? intl('service_new_choose_deployment_alert') : intl('service_new_no_deployments_alert'); ActionSheetUtils.showActionSheetWithOptions({options, title}); }
onNavigatorEvent(event) { const { cluster, node } = this.props; switch (event.id) { case 'yaml': this.props.navigator.push({ screen: 'cabin.EntitiesYaml', passProps: { cluster, entity: node }, }); break; case 'more': const options = [ { title: intl('cancel') }, { title: 'Put in maintenance', onPress: () => NodesActions.putInMaintenance({ cluster, node }), }, ]; ActionSheetUtils.showActionSheetWithOptions({options}); break; } }