Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Mar 5, 2020
1 parent 2c4ceed commit 5e71093
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

export { ActionFactory, ActionWizard, ActionFactoryBaseConfig } from './action_wizard';
export { ActionFactory, ActionWizard, ActionBaseConfig } from './action_wizard';
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,41 @@ import {
txtEditDrilldownTitle,
} from './i18n';
import { FlyoutCreateDrilldownActionContext } from '../../actions';
import { ActionFactory, ActionFactoryBaseConfig } from '../../../../advanced_ui_actions/public';
import { ActionFactory, ActionBaseConfig } from '../../../../advanced_ui_actions/public';
import {
dashboardDrilldownActionFactory,
urlDrilldownActionFactory,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../advanced_ui_actions/public/components/action_wizard/test_data';

export interface DrilldownWizardConfig<
ActionFactoryConfig extends ActionFactoryBaseConfig = ActionFactoryBaseConfig
> {
export interface DrilldownWizardConfig<ActionConfig extends ActionBaseConfig = ActionBaseConfig> {
name: string;
actionFactory?: ActionFactory<ActionFactoryConfig>;
actionConfig?: ActionFactoryConfig;
actionFactory?: ActionFactory<ActionConfig>;
actionConfig?: ActionConfig;
}

export interface FlyoutDrilldownWizardProps<
CurrentActionFactoryConfig extends ActionFactoryBaseConfig = ActionFactoryBaseConfig
CurrentActionConfig extends ActionBaseConfig = ActionBaseConfig
> {
context: FlyoutCreateDrilldownActionContext;
onSubmit?: (drilldownWizardConfig: DrilldownWizardConfig) => void;
onDelete?: () => void;
onClose?: () => void;

mode?: 'create' | 'edit';
initialDrilldownWizardConfig?: DrilldownWizardConfig<CurrentActionFactoryConfig>;
initialDrilldownWizardConfig?: DrilldownWizardConfig<CurrentActionConfig>;
}

export function FlyoutDrilldownWizard<
CurrentActionFactoryConfig extends ActionFactoryBaseConfig = ActionFactoryBaseConfig
CurrentActionConfig extends ActionBaseConfig = ActionBaseConfig
>({
context,
onClose,
onSubmit = () => {},
initialDrilldownWizardConfig,
mode = 'create',
onDelete = () => {},
}: FlyoutDrilldownWizardProps<CurrentActionFactoryConfig>) {
}: FlyoutDrilldownWizardProps<CurrentActionConfig>) {
const [wizardConfig, setWizardConfig] = useState<DrilldownWizardConfig>(
() =>
initialDrilldownWizardConfig ?? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DrilldownHelloBar } from '../drilldown_hello_bar';
import { txtDrilldownAction, txtNameOfDrilldown, txtUntitledDrilldown } from './i18n';
import {
ActionFactory,
ActionFactoryBaseConfig,
ActionBaseConfig,
ActionWizard,
} from '../../../../advanced_ui_actions/public';
// TODO: this should be actual input to the component and should not be using test data
Expand All @@ -26,8 +26,8 @@ export interface FormDrilldownWizardProps {
currentActionFactory?: ActionFactory;
onActionFactoryChange?: (actionFactory: ActionFactory | null) => void;

actionConfig?: ActionFactoryBaseConfig;
onActionConfigChange?: (config: ActionFactoryBaseConfig) => void;
actionConfig?: ActionBaseConfig;
onActionConfigChange?: (config: ActionBaseConfig) => void;

actionFactories?: Array<ActionFactory<any>>;
}
Expand Down

0 comments on commit 5e71093

Please sign in to comment.