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

[INGEST_MANAGER] Make package config name blank for endpoint on Package Config create #73082

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
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@ export const StepDefinePackageConfig: React.FunctionComponent<{
.sort();

updatePackageConfig({
name: `${packageInfo.name}-${
dsWithMatchingNames.length ? dsWithMatchingNames[dsWithMatchingNames.length - 1] + 1 : 1
}`,
name:
// For Endpoint packages, the user must fill in the name, thus we don't attempt to generate
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a FIXME comment to improve this in the next release? :) I'm not sure if there is an issue filed but adding the URL of the issue would be great too.

// a default one here.
// FIXME: Improve package configs name uniqueness - https://github.com/elastic/kibana/issues/72948
packageInfo.name !== 'endpoint'
? `${packageInfo.name}-${
dsWithMatchingNames.length
? dsWithMatchingNames[dsWithMatchingNames.length - 1] + 1
: 1
}`
: '',
package: {
name: packageInfo.name,
title: packageInfo.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
expect(endpointConfig).not.to.be(undefined);
});

it('should have empty value for package configuration name', async () => {
await pageObjects.ingestManagerCreatePackageConfig.selectAgentConfig();
expect(await pageObjects.ingestManagerCreatePackageConfig.getPackageConfigName()).to.be('');
});

it('should redirect user back to Policy List after a successful save', async () => {
const newPolicyName = `endpoint policy ${Date.now()}`;
await pageObjects.ingestManagerCreatePackageConfig.selectAgentConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ export function IngestManagerCreatePackageConfig({
}
},

/**
* Returns the package config name currently populated on the input field
*/
async getPackageConfigName() {
return testSubjects.getAttribute('packageConfigNameInput', 'value');
},

/**
* Set the name of the package config on the input field
* @param name
Expand Down