Skip to content

Commit

Permalink
[Controls] Field first control creation (#131461)
Browse files Browse the repository at this point in the history
* Field first *creation*

* Field first *editing*

* Add support for custom control options

* Add i18n

* Make field picker accept predicate again + clean up imports

* Fix functional tests

* Attempt 1 at case sensitivity

* Works both ways

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Clean up code

* Use React useMemo to calculate field registry

* Fix functional tests

* Fix default state + control settings label

* Fix functional tests

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
Heenawter and kibanamachine authored May 19, 2022
1 parent e282735 commit 8de3401
Show file tree
Hide file tree
Showing 21 changed files with 479 additions and 636 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const OPTIONS_LIST_CONTROL = 'optionsListControl';
export interface OptionsListEmbeddableInput extends DataControlInput {
selectedOptions?: string[];
runPastTimeout?: boolean;
textFieldName?: string;
singleSelect?: boolean;
loading?: boolean;
}
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/controls/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ export type ControlInput = EmbeddableInput & {

export type DataControlInput = ControlInput & {
fieldName: string;
parentFieldName?: string;
childFieldName?: string;
dataViewId: string;
};
20 changes: 20 additions & 0 deletions src/plugins/controls/public/control_group/control_group_strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ export const ControlGroupStrings = {
i18n.translate('controls.controlGroup.manageControl.editFlyoutTitle', {
defaultMessage: 'Edit control',
}),
getDataViewTitle: () =>
i18n.translate('controls.controlGroup.manageControl.dataViewTitle', {
defaultMessage: 'Data view',
}),
getFieldTitle: () =>
i18n.translate('controls.controlGroup.manageControl.fielditle', {
defaultMessage: 'Field',
}),
getTitleInputTitle: () =>
i18n.translate('controls.controlGroup.manageControl.titleInputTitle', {
defaultMessage: 'Label',
Expand All @@ -56,6 +64,10 @@ export const ControlGroupStrings = {
i18n.translate('controls.controlGroup.manageControl.widthInputTitle', {
defaultMessage: 'Minimum width',
}),
getControlSettingsTitle: () =>
i18n.translate('controls.controlGroup.manageControl.controlSettingsTitle', {
defaultMessage: 'Additional settings',
}),
getSaveChangesTitle: () =>
i18n.translate('controls.controlGroup.manageControl.saveChangesTitle', {
defaultMessage: 'Save and close',
Expand All @@ -64,6 +76,14 @@ export const ControlGroupStrings = {
i18n.translate('controls.controlGroup.manageControl.cancelTitle', {
defaultMessage: 'Cancel',
}),
getSelectFieldMessage: () =>
i18n.translate('controls.controlGroup.manageControl.selectFieldMessage', {
defaultMessage: 'Please select a field',
}),
getSelectDataViewMessage: () =>
i18n.translate('controls.controlGroup.manageControl.selectDataViewMessage', {
defaultMessage: 'Please select a data view',
}),
getGrowSwitchTitle: () =>
i18n.translate('controls.controlGroup.manageControl.growSwitchTitle', {
defaultMessage: 'Expand width to fit available space',
Expand Down
Loading

0 comments on commit 8de3401

Please sign in to comment.