Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export const CustomUrlEditor: FC<CustomUrlEditorProps> = ({
onChange={onLabelChange}
isInvalid={isInvalidLabel}
compressed
data-test-subj="mlJobCustomUrlLabelInput"
/>
</EuiFormRow>
<EuiFormRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const CustomUrlList: FC<CustomUrlListProps> = ({ job, customUrls, setCust
: [];

return (
<EuiFlexGroup key={`url_${index}`}>
<EuiFlexGroup key={`url_${index}`} data-test-subj={`mlJobEditCustomUrlItem_${index}`}>
<EuiFlexItem grow={false}>
<EuiFormRow
label={
Expand All @@ -160,6 +160,7 @@ export const CustomUrlList: FC<CustomUrlListProps> = ({ job, customUrls, setCust
value={label}
isInvalid={isInvalidLabel}
onChange={e => onLabelChange(e, index)}
data-test-subj={`mlJobEditCustomUrlLabelInput_${index}`}
/>
</EuiFormRow>
</EuiFlexItem>
Expand Down Expand Up @@ -266,5 +267,5 @@ export const CustomUrlList: FC<CustomUrlListProps> = ({ job, customUrls, setCust
);
});

return <>{customUrlRows}</>;
return <div data-test-subj="mlJobEditCustomUrlsList">{customUrlRows}</div>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ export class CustomUrls extends Component<CustomUrlsProps, CustomUrlsState> {
: true;

const addButton = (
<EuiButton onClick={this.addNewCustomUrl} isDisabled={!isValidEditorSettings}>
<EuiButton
onClick={this.addNewCustomUrl}
isDisabled={!isValidEditorSettings}
data-test-subj="mlJobAddCustomUrl"
>
<FormattedMessage
id="xpack.ml.jobsList.editJobFlyout.customUrls.addButtonLabel"
defaultMessage="Add"
Expand Down Expand Up @@ -270,7 +274,12 @@ export class CustomUrls extends Component<CustomUrlsProps, CustomUrlsState> {
</EuiPanel>
) : (
<EuiOverlayMask>
<EuiModal onClose={this.closeEditor} initialFocus="[name=label]" style={{ width: 500 }}>
<EuiModal
onClose={this.closeEditor}
initialFocus="[name=label]"
style={{ width: 500 }}
data-test-subj="mlJobNewCustomUrlFormModal"
>
<EuiModalHeader>
<EuiModalHeaderTitle>
<FormattedMessage
Expand Down Expand Up @@ -299,7 +308,11 @@ export class CustomUrls extends Component<CustomUrlsProps, CustomUrlsState> {
<>
<EuiSpacer size="m" />
{(!editorOpen || editMode === 'modal') && (
<EuiButton size="s" onClick={this.editNewCustomUrl}>
<EuiButton
size="s"
onClick={this.editNewCustomUrl}
data-test-subj="mlJobOpenCustomUrlFormButton"
>
<FormattedMessage
id="xpack.ml.jobsList.editJobFlyout.customUrls.addCustomUrlButtonLabel"
defaultMessage="Add custom URL"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,24 @@ export const AdditionalSection: FC<Props> = ({ additionalExpanded, setAdditional
buttonContent={ButtonContent}
onToggle={setAdditionalExpanded}
initialIsOpen={additionalExpanded}
data-test-subj="mlJobWizardToggleAdditionalSettingsSection"
>
<EuiSpacer />
<section data-test-subj="mlJobWizardAdditionalSettingsSection">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

curious why section is being used here, it seems to me to be a misuse of this tag.
A div might be more appropriate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

so it's semantically a section for additional settings

Copy link
Copy Markdown
Member

@jgowdyelastic jgowdyelastic Dec 6, 2019

Choose a reason for hiding this comment

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

Do not use the section element as a generic container; this is what div is for

IMO section is for documents, not web apps.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's not a problem, i was just wondering if there was some specific reason for using it here as i've only ever seen it being used for documents or webpages where the contents are similar in theme.
Searching through the rest of kibana i see It's been used in a similar way a couple of times.

<EuiSpacer />

<EuiFlexGroup gutterSize="xl" style={{ marginLeft: '0px', marginRight: '0px' }}>
<EuiFlexItem>
<CustomUrlsSelection />
</EuiFlexItem>
</EuiFlexGroup>
<EuiFlexGroup gutterSize="xl" style={{ marginLeft: '0px', marginRight: '0px' }}>
<EuiFlexItem>
<CustomUrlsSelection />
</EuiFlexItem>
</EuiFlexGroup>

<EuiFlexGroup gutterSize="xl" style={{ marginLeft: '0px', marginRight: '0px' }}>
<EuiFlexItem>
<CalendarsSelection />
</EuiFlexItem>
<EuiFlexItem />
</EuiFlexGroup>
<EuiFlexGroup gutterSize="xl" style={{ marginLeft: '0px', marginRight: '0px' }}>
<EuiFlexItem>
<CalendarsSelection />
</EuiFlexItem>
<EuiFlexItem />
</EuiFlexGroup>
</section>
</EuiAccordion>
</Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const CalendarsSelection: FC = () => {
<Description>
<EuiFlexGroup gutterSize="xs" alignItems="center">
<EuiFlexItem>
<EuiComboBox {...comboBoxProps} />
<EuiComboBox {...comboBoxProps} data-test-subj="mlJobWizardComboBoxCalendars" />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiToolTip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ export default function({ getService }: FtrProviderContext) {
this.tags(['smoke', 'mlqa']);
before(async () => {
await esArchiver.load('ml/ecommerce');
await ml.api.createCalendar('wizard-test-calendar');
});

after(async () => {
Comment thread
pheyos marked this conversation as resolved.
Expand Down Expand Up @@ -464,6 +465,18 @@ export default function({ getService }: FtrProviderContext) {
await ml.jobWizardCommon.assertJobGroupSelection(testData.jobGroups);
});

it('job creation opens the additional settings section', async () => {
await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen();
});

it('job creation adds a new custom url', async () => {
await ml.jobWizardCommon.addCustomUrl({ label: 'check-kibana-dashboard' });
});

it('job creation assigns calendars', async () => {
await ml.jobWizardCommon.addCalendar('wizard-test-calendar');
});

it('job creation displays the model plot switch', async () => {
await ml.jobWizardCommon.assertModelPlotSwitchExists({ withAdvancedSection: false });
});
Expand Down Expand Up @@ -709,6 +722,18 @@ export default function({ getService }: FtrProviderContext) {
await ml.jobWizardCommon.assertJobGroupSelection(testData.jobGroupsClone);
});

it('job cloning opens the additional settings section', async () => {
await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen();
});

it('job cloning persists custom urls', async () => {
await ml.customUrls.assertCustomUrlItem(0, 'check-kibana-dashboard');
});

it('job cloning persists assigned calendars', async () => {
await ml.jobWizardCommon.assertCalendarsSelection(['wizard-test-calendar']);
});

it('job cloning pre-fills the model plot switch', async () => {
await ml.jobWizardCommon.assertModelPlotSwitchExists({ withAdvancedSection: false });
await ml.jobWizardCommon.assertModelPlotSwitchCheckedState(false, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default function({ getService }: FtrProviderContext) {
this.tags(['smoke', 'mlqa']);
before(async () => {
await esArchiver.load('ml/farequote');
await ml.api.createCalendar('wizard-test-calendar');
});

after(async () => {
Comment thread
pheyos marked this conversation as resolved.
Expand Down Expand Up @@ -170,6 +171,18 @@ export default function({ getService }: FtrProviderContext) {
await ml.jobWizardCommon.assertJobGroupSelection(jobGroups);
});

it('job creation opens the additional settings section', async () => {
await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen();
});

it('job creation adds a new custom url', async () => {
await ml.jobWizardCommon.addCustomUrl({ label: 'check-kibana-dashboard' });
});

it('job creation assigns calendars', async () => {
await ml.jobWizardCommon.addCalendar('wizard-test-calendar');
});

it('job creation opens the advanced section', async () => {
await ml.jobWizardCommon.ensureAdvancedSectionOpen();
});
Expand Down Expand Up @@ -306,6 +319,18 @@ export default function({ getService }: FtrProviderContext) {
await ml.jobWizardCommon.assertJobGroupSelection(jobGroupsClone);
});

it('job cloning opens the additional settings section', async () => {
await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen();
});

it('job cloning persists custom urls', async () => {
await ml.customUrls.assertCustomUrlItem(0, 'check-kibana-dashboard');
});

it('job cloning persists assigned calendars', async () => {
await ml.jobWizardCommon.assertCalendarsSelection(['wizard-test-calendar']);
});

it('job cloning opens the advanced section', async () => {
await ml.jobWizardCommon.ensureAdvancedSectionOpen();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default function({ getService }: FtrProviderContext) {
this.tags(['smoke', 'mlqa']);
before(async () => {
await esArchiver.load('ml/ecommerce');
await ml.api.createCalendar('wizard-test-calendar');
});

after(async () => {
Comment thread
pheyos marked this conversation as resolved.
Expand Down Expand Up @@ -197,6 +198,18 @@ export default function({ getService }: FtrProviderContext) {
await ml.jobWizardCommon.assertJobGroupSelection(jobGroups);
});

it('job creation opens the additional settings section', async () => {
await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen();
});

it('job creation adds a new custom url', async () => {
await ml.jobWizardCommon.addCustomUrl({ label: 'check-kibana-dashboard' });
});

it('job creation assigns calendars', async () => {
await ml.jobWizardCommon.addCalendar('wizard-test-calendar');
});

it('job creation opens the advanced section', async () => {
await ml.jobWizardCommon.ensureAdvancedSectionOpen();
});
Expand Down Expand Up @@ -344,6 +357,18 @@ export default function({ getService }: FtrProviderContext) {
await ml.jobWizardCommon.assertJobGroupSelection(jobGroupsClone);
});

it('job cloning opens the additional settings section', async () => {
await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen();
});

it('job cloning persists custom urls', async () => {
await ml.customUrls.assertCustomUrlItem(0, 'check-kibana-dashboard');
});

it('job cloning persists assigned calendars', async () => {
await ml.jobWizardCommon.assertCalendarsSelection(['wizard-test-calendar']);
});

it('job cloning opens the advanced section', async () => {
await ml.jobWizardCommon.ensureAdvancedSectionOpen();
});
Expand Down
Loading