Skip to content

Commit

Permalink
fix FeatureConfig & Feature compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Jun 25, 2020
1 parent a58916d commit 923e842
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion x-pack/plugins/features/common/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export interface FeatureConfig {
* This does not restrict access to your feature based on license.
* Its only purpose is to inform the space and roles UIs on which features to display.
*/
validLicenses?: Array<'basic' | 'standard' | 'gold' | 'platinum' | 'enterprise' | 'trial'>;
validLicenses?: ReadonlyArray<
'basic' | 'standard' | 'gold' | 'platinum' | 'enterprise' | 'trial'
>;

/**
* An optional EUI Icon to be used when displaying your feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class ManageSpacePage extends Component<Props, State> {

<EnabledFeatures
space={this.state.space}
features={this.state.features.map((f) => f.toRaw())}
features={this.state.features}
onChange={this.onSpaceChange}
getUrlForApp={this.props.getUrlForApp}
securityEnabled={this.props.securityEnabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { ApplicationStart, Capabilities, NotificationsStart, ScopedHistory } from 'src/core/public';
import { FeatureConfig, FeaturesPluginStart } from '../../../../features/public';
import { Feature, FeaturesPluginStart } from '../../../../features/public';
import { isReservedSpace } from '../../../common';
import { DEFAULT_SPACE_ID } from '../../../common/constants';
import { Space } from '../../../common/model/space';
Expand All @@ -46,7 +46,7 @@ interface Props {

interface State {
spaces: Space[];
features: FeatureConfig[];
features: Feature[];
loading: boolean;
showConfirmDeleteModal: boolean;
selectedSpace: Space | null;
Expand Down Expand Up @@ -228,7 +228,7 @@ export class SpacesGridPage extends Component<Props, State> {
this.setState({
loading: false,
spaces,
features: features.map((f) => f.toRaw()),
features,
});
} catch (error) {
this.setState({
Expand Down

0 comments on commit 923e842

Please sign in to comment.