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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Changed
---

Logs Delivery copy based on tech writing updates ([#13556](https://github.com/linode/manager/pull/13556))
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('Create Destination', () => {
);

// Switch to manual mode and fill in values
cy.findByLabelText('Enter Bucket manually').click();
cy.findByLabelText('Enter Bucket details manually').click();
logsDestinationForm.setBucket('my-manual-bucket');
logsDestinationForm.setEndpoint('my-endpoint.com');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ describe('Edit Destination', () => {
]);

// Edit mode defaults to manual bucket entry
cy.findByLabelText('Enter Bucket manually').should('be.checked');
cy.findByLabelText('Enter Bucket details manually').should(
'be.checked'
);

// Endpoint should be enabled in manual mode
cy.findByLabelText('Endpoint').should('be.enabled');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const logsDestinationForm = {
cy.findByLabelText('Endpoint')
.should('be.visible')
.should('be.enabled')
.should('have.attr', 'placeholder', 'Endpoint for the destination')
.should('have.attr', 'placeholder', 'https://us-ord-1.linodeobjects.com')
.clear();
cy.focused().type(endpoint);
},
Expand Down Expand Up @@ -129,7 +129,7 @@ export const logsDestinationForm = {
data: AkamaiObjectStorageDetailsExtended
) => {
// Switch to manual bucket entry
cy.findByLabelText('Enter Bucket manually').click();
cy.findByLabelText('Enter Bucket details manually').click();

logsDestinationForm.setBucket(data.bucket_name);
logsDestinationForm.setEndpoint(data.host);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@
it('should render Endpoint input and allow to type text in manual mode', async () => {
renderDestinationCreate(flags);

const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'

Check warning on line 116 in packages/manager/src/features/Delivery/Destinations/DestinationForm/DestinationCreate.test.tsx

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Define a constant instead of duplicating this literal 5 times. Raw Output: {"ruleId":"sonarjs/no-duplicate-string","severity":1,"message":"Define a constant instead of duplicating this literal 5 times.","line":116,"column":11,"nodeType":"Literal","endLine":116,"endColumn":42}
);
await userEvent.click(manualRadio);

const endpointInput = screen.getByLabelText('Endpoint');
Expand All @@ -124,7 +126,9 @@
it('should render Bucket input and allow to type text in manual mode', async () => {
renderDestinationCreate(flags);

const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'
);
await userEvent.click(manualRadio);

const bucketInput = screen.getByLabelText('Bucket');
Expand Down Expand Up @@ -223,10 +227,12 @@
expect(endpointInput).toBeDisabled();
});

it('should enable the Endpoint field when "Enter Bucket manually" is selected', async () => {
it('should enable the Endpoint field when "Enter Bucket details manually" is selected', async () => {

Check warning on line 230 in packages/manager/src/features/Delivery/Destinations/DestinationForm/DestinationCreate.test.tsx

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Refactor this code to not nest functions more than 4 levels deep. Raw Output: {"ruleId":"sonarjs/no-nested-functions","severity":1,"message":"Refactor this code to not nest functions more than 4 levels deep.","line":230,"column":106,"nodeType":null,"endLine":230,"endColumn":108}
renderDestinationCreate(flags);

const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'
);
await userEvent.click(manualRadio);

const endpointInput = screen.getByLabelText('Endpoint');
Expand All @@ -237,7 +243,9 @@
renderDestinationCreate(flags);

// Switch to manual mode and fill in values
const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'
);
await userEvent.click(manualRadio);

const bucketInput = screen.getByLabelText('Bucket');
Expand Down Expand Up @@ -312,7 +320,9 @@
await userEvent.type(destinationNameInput, 'Test');

// Switch to manual bucket entry to allow typing
const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'
);
await userEvent.click(manualRadio);

const endpointInput = screen.getByLabelText('Endpoint');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ describe('DestinationEdit', () => {
await waitForElementToBeRemoved(loadingElement);
};

it('should default to "Enter Bucket manually" radio in edit mode', async () => {
it('should default to "Enter Bucket details manually" radio in edit mode', async () => {
await renderEditWithMockDestination();

const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'
);
expect(manualRadio).toBeChecked();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ export const DestinationAkamaiObjectStorageDetailsForm = ({
<Typography sx={{ mt: 2 }} variant="h3">
Bucket
</Typography>
<Typography
sx={{
mt: 2,
maxWidth: 440,
whiteSpace: 'preserve-spaces',
}}
>
Choose how to provide bucket details. Selecting a bucket associated with
your account will auto-fill the required settings. Entering a bucket
manually requires you to provide all connection details.
</Typography>
<RadioGroup
onChange={(_, value) => handleBucketConfigurationChange(value)}
sx={{ '&[role="radiogroup"]': { mb: 0 } }}
Expand All @@ -115,7 +126,7 @@ export const DestinationAkamaiObjectStorageDetailsForm = ({
/>
<FormControlLabel
control={<Radio />}
label="Enter Bucket manually"
label="Enter Bucket details manually"
value="bucket_entered_manually"
/>
</RadioGroup>
Expand Down Expand Up @@ -155,6 +166,7 @@ export const DestinationAkamaiObjectStorageDetailsForm = ({
);
}}
options={buckets}
placeholder="Select a Bucket"
textFieldProps={{
inputProps: {
'data-pendo-id': `${pendoPageId}Bucket`,
Expand Down Expand Up @@ -204,7 +216,8 @@ export const DestinationAkamaiObjectStorageDetailsForm = ({
onChange={(value) => {
field.onChange(value);
}}
placeholder="Endpoint for the destination"
placeholder="https://us-ord-1.linodeobjects.com"
tooltipText="The Object Storage service endpoint associated with your bucket's region"
value={field.value}
/>
)}
Expand All @@ -222,6 +235,7 @@ export const DestinationAkamaiObjectStorageDetailsForm = ({
label="Access Key ID"
onBlur={field.onBlur}
onChange={(value) => field.onChange(value)}
tooltipText="The access key identifier used for authentication"
value={field.value}
/>
)}
Expand All @@ -239,6 +253,7 @@ export const DestinationAkamaiObjectStorageDetailsForm = ({
label="Secret Access Key"
onBlur={field.onBlur}
onChange={(value) => field.onChange(value)}
tooltipText="The confidential security credential used with Access Key ID to access Object Storage"
value={field.value}
/>
)}
Expand Down Expand Up @@ -268,6 +283,7 @@ export const DestinationAkamaiObjectStorageDetailsForm = ({
optional
placeholder="Prefix for log storage path"
sx={{ maxWidth: 416 }}
tooltipText="The path prefix used for organizing uploaded objects"
value={field.value}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

it('should filter clusters by name', async () => {
await renderComponentWithoutSelectedClusters();
const input = screen.getByPlaceholderText('Search');
const input = screen.getByPlaceholderText('Search for a cluster');

Check warning on line 159 in packages/manager/src/features/Delivery/Streams/StreamForm/Clusters/StreamFormClusters.test.tsx

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Define a constant instead of duplicating this literal 3 times. Raw Output: {"ruleId":"sonarjs/no-duplicate-string","severity":1,"message":"Define a constant instead of duplicating this literal 3 times.","line":159,"column":47,"nodeType":"Literal","endLine":159,"endColumn":69}

// Type test value inside the search
await userEvent.click(input);
Expand All @@ -169,7 +169,7 @@

it('should filter clusters by region with search input', async () => {
await renderComponentWithoutSelectedClusters();
const input = screen.getByPlaceholderText('Search');
const input = screen.getByPlaceholderText('Search for a cluster');

// Type test value inside the search
await userEvent.click(input);
Expand All @@ -185,7 +185,7 @@

it('should filter clusters by log generation status with search input', async () => {
await renderComponentWithoutSelectedClusters();
const input = screen.getByPlaceholderText('Search');
const input = screen.getByPlaceholderText('Search for a cluster');

// Type test value inside the search
await userEvent.click(input);
Expand All @@ -198,7 +198,7 @@

it('should filter clusters by log generation status with autocomplete', async () => {
await renderComponentWithoutSelectedClusters();
const input = screen.getByPlaceholderText('Log Generation');
const input = screen.getByPlaceholderText('Logging Status');

// Enabled filter option
await userEvent.click(input);
Expand Down Expand Up @@ -488,7 +488,7 @@
it('should only display regions that have clusters and the required capability', async () => {
await renderComponentWithoutSelectedClusters();

const regionSelect = screen.getByPlaceholderText('Select Region');
const regionSelect = screen.getByPlaceholderText('Select a Region');
await userEvent.click(regionSelect);

const regionOptions = await screen.findAllByRole('option');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,20 @@ export const StreamFormClusters = (props: StreamFormClustersProps) => {
<ErrorState errorText="There was an error loading your Kubernetes clusters." />
) : (
<>
<Typography sx={{ mt: 2 }}>
Select the LKE clusters that will send audit logs to the configured
destination. Logging must be enabled for a cluster before it can be
selected. To enable logging for a cluster, use the Linode API to{' '}
<Link
external
hideIcon
to="https://techdocs.akamai.com/linode-api/reference/put-lke-cluster"
>
update the cluster
</Link>{' '}
to set <i>audit_logs_enabled</i> to <i>true</i>.
</Typography>
<div hidden={true}>
<Notice sx={{ mt: 2 }} variant="info">
Disabling this option allows you to manually define which clusters
will be included in the stream. Stream will not be updated
automatically with newly configured clusters.
</Notice>
<Controller
name={controlPaths.isAutoAddAllClustersEnabled}
render={({ field }) => (
Expand All @@ -258,25 +266,17 @@ export const StreamFormClusters = (props: StreamFormClustersProps) => {
}
await trigger('stream.details');
}}
sxFormLabel={{ ml: -1 }}
sxFormLabel={{ ml: -1, mt: 2 }}
text="Automatically include all existing and recently configured clusters."
/>
)}
/>
<Notice sx={{ mt: 2 }} variant="info">
Disable this option if you wish to manually define which clusters
are included in the stream. The stream won’t be automatically
updated when new clusters are configured.
</Notice>
</div>
<Typography sx={{ mt: 2 }}>
Select the LKE clusters that will send audit logs to the configured
destination. Logging must be enabled for a cluster before it can be
selected. To enable logging for a cluster, use the Linode API{' '}
<Link
external
hideIcon
to="https://techdocs.akamai.com/linode-api/reference/put-lke-cluster"
>
update the cluster
</Link>{' '}
to set audit_logs_enabled to true.
</Typography>
<StyledGrid
sx={{
alignItems: 'center',
Expand All @@ -302,7 +302,7 @@ export const StreamFormClusters = (props: StreamFormClustersProps) => {
}}
label="Search"
onSearch={(value) => setSearchText(value)}
placeholder="Search"
placeholder="Search for a cluster"
value={searchText}
/>
<StyledSelectsWrapper>
Expand All @@ -313,7 +313,7 @@ export const StreamFormClusters = (props: StreamFormClustersProps) => {
onChange={(_, region) => {
setRegionFilter(region?.id ?? '');
}}
placeholder="Select Region"
placeholder="Select a Region"
regionFilter="core"
regions={visibleRegions ?? []}
sx={{
Expand All @@ -325,7 +325,7 @@ export const StreamFormClusters = (props: StreamFormClustersProps) => {
label=""
onChange={(_, option) => setLogGenerationFilter(option?.value)}
options={logGenerationOptions}
placeholder="Log Generation"
placeholder="Logging Status"
sx={{
width: '160px !important',
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const StreamFormClusterTableContent = ({
>
Region
</TableSortCell>
<TableCell sx={{ width: '25%' }}>Log Generation</TableCell>
<TableCell sx={{ width: '25%' }}>Logging Status</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@
expect(endpointInput).toBeDisabled();

// Switch to manual mode
const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'

Check warning on line 244 in packages/manager/src/features/Delivery/Streams/StreamForm/Delivery/StreamFormDelivery.test.tsx

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Define a constant instead of duplicating this literal 4 times. Raw Output: {"ruleId":"sonarjs/no-duplicate-string","severity":1,"message":"Define a constant instead of duplicating this literal 4 times.","line":244,"column":13,"nodeType":"Literal","endLine":244,"endColumn":44}
);
await userEvent.click(manualRadio);

// Now Endpoint should be enabled
Expand All @@ -256,7 +258,9 @@
);

// Switch to manual mode
const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'
);
await userEvent.click(manualRadio);

// Type the test value inside the input
Expand Down Expand Up @@ -332,13 +336,15 @@
expect(endpointInput).toBeDisabled();
});

it('should enable the Endpoint field when "Enter Bucket manually" is selected', async () => {
it('should enable the Endpoint field when "Enter Bucket details manually" is selected', async () => {

Check warning on line 339 in packages/manager/src/features/Delivery/Streams/StreamForm/Delivery/StreamFormDelivery.test.tsx

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Refactor this code to not nest functions more than 4 levels deep. Raw Output: {"ruleId":"sonarjs/no-nested-functions","severity":1,"message":"Refactor this code to not nest functions more than 4 levels deep.","line":339,"column":106,"nodeType":null,"endLine":339,"endColumn":108}
await renderComponentAndAddNewDestinationName(
destinationType.AkamaiObjectStorage,
flags
);

const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'
);
await userEvent.click(manualRadio);

const endpointInput = screen.getByLabelText('Endpoint');
Expand All @@ -352,7 +358,9 @@
);

// Switch to manual mode and fill in values
const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'
);
await userEvent.click(manualRadio);

const bucketInput = screen.getByLabelText('Bucket');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export const StreamFormDelivery = (props: StreamFormDeliveryProps) => {
inputProps: {
'data-pendo-id': `Logs Delivery Streams ${capitalizedMode}-Destination Name`,
},
tooltipPosition: 'right',
tooltipText:
'Select an existing destination from the list or create a new one by entering a name and clicking Create.',
}}
value={field.value ? { label: field.value } : null}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ describe('StreamCreate', () => {
);
await userEvent.click(createNewTestDestination);

const manualRadio = screen.getByLabelText('Enter Bucket manually');
const manualRadio = screen.getByLabelText(
'Enter Bucket details manually'
);
await userEvent.click(manualRadio);

const endpointInput = screen.getByLabelText('Endpoint');
Expand Down
Loading
Loading