Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Controls] Field first control creation #131461

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
ThomThomson marked this conversation as resolved.
Show resolved Hide resolved
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: 'Control size',
}),
getControlSettingsTitle: () =>
i18n.translate('controls.controlGroup.manageControl.controlSettingsTitle', {
defaultMessage: 'Control settings',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should use the friendly name of the selected Control Type here, so it would read Options List settings or Range slider settings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point! @andreadelrio what are your thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking if we need to show that label at all? Label and Width are settings too right so no need to have a separate section for (other) settings? or are you trying to keep the toggle for width under Minimum width and so you need a heading for the rest of the settings?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreadelrio Yeah, it seemed to me like grouping the type-specific control settings with the Minimum width settings was confusing - so either the type-specific settings should go above the Minimum width (which would cause shifting when switching between Options list and Range slider fields) or I think these type-specific settings should have their own label.

What do you think, though?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could either group them under something like Additional settings? or give each toggle its own title so something like:

  • Multiple selections

Allow multiple selections in dropdown

  • Timeout

Run past timeout

What do you think @KOTungseth ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like Additional settings but definitely interested in hearing @KOTungseth's thoughts! :)

}),
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',
}),
},
management: {
getAddControlTitle: () =>
Expand Down
Loading