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
---

Bucket create `Label` changed to `Bucket Name` ([#11877](https://github.com/linode/manager/pull/11877))
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('Object Storage enrollment', () => {
.findByTitle('Create Bucket')
.should('be.visible')
.within(() => {
cy.findByLabelText('Label (required)')
cy.findByLabelText('Bucket Name (required)')
.should('be.visible')
.type(randomLabel());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('object storage end-to-end tests', () => {
.findByTitle('Create Bucket')
.should('be.visible')
.within(() => {
cy.findByText('Label').click();
cy.findByLabelText('Bucket Name (required)').click();
cy.focused().type(bucketLabel);
ui.regionSelect.find().click();
cy.focused().type(`${bucketRegion}{enter}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('object storage smoke tests', () => {
.findByTitle('Create Bucket')
.should('be.visible')
.within(() => {
cy.findByText('Label').click();
cy.findByLabelText('Bucket Name (required)').click();
cy.focused().type(bucketLabel);
ui.regionSelect.find().click();
cy.focused().type(`${bucketRegion}{enter}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('Object Storage Gen2 create bucket tests', () => {
.findByTitle('Create Bucket')
.should('be.visible')
.within(() => {
cy.findByText('Label').click();
cy.findByLabelText('Bucket Name (required)').click();
cy.focused().type(bucketLabel);
ui.regionSelect.find().click();
cy.focused().type(`${mockRegion.label}{enter}`);
Expand Down Expand Up @@ -329,7 +329,7 @@ describe('Object Storage Gen2 create bucket tests', () => {
.findByTitle('Create Bucket')
.should('be.visible')
.within(() => {
cy.findByText('Label').click();
cy.findByLabelText('Bucket Name (required)').click();
cy.focused().type(bucketLabel);
ui.regionSelect.find().click();
cy.focused().type(`${mockRegion.label}{enter}`);
Expand Down Expand Up @@ -455,7 +455,7 @@ describe('Object Storage Gen2 create bucket tests', () => {
.findByTitle('Create Bucket')
.should('be.visible')
.within(() => {
cy.findByText('Label').click();
cy.findByLabelText('Bucket Name (required)').click();
cy.focused().type(bucketLabel);
ui.regionSelect.find().click();
cy.focused().type(`${mockRegion.label}{enter}`);
Expand Down Expand Up @@ -579,7 +579,7 @@ describe('Object Storage Gen2 create bucket tests', () => {
.findByTitle('Create Bucket')
.should('be.visible')
.within(() => {
cy.findByText('Label').click();
cy.findByLabelText('Bucket Name (required)').click();
cy.focused().type(bucketLabel);
ui.regionSelect.find().click();
cy.focused().type(`${mockRegion.label}{enter}`);
Expand Down Expand Up @@ -716,10 +716,10 @@ describe('Object Storage Gen2 create bucket tests', () => {
.should('be.enabled')
.click();

cy.contains('Label is required.').should('be.visible');
cy.findByText('Label').click();
cy.contains('Bucket name is required.').should('be.visible');
cy.findByLabelText('Bucket Name (required)').click();
cy.focused().type(bucketLabel);
cy.contains('Label is required.').should('not.exist');
cy.contains('Bucket name is required.').should('not.exist');

// confirms (mock) API error appears
ui.buttonGroup
Expand Down Expand Up @@ -774,7 +774,7 @@ describe('Object Storage Gen2 create bucket modal has disabled fields for restri
cy.findByText(/You don't have permissions to create a Bucket./).should(
'be.visible'
);
cy.findByLabelText(/Label.*/)
cy.findByLabelText('Bucket Name (required)')
.should('be.visible')
.should('be.disabled');
ui.regionSelect.find().should('be.visible').should('be.disabled');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('Object Storage Multicluster Bucket create', () => {
.should('be.visible')
.within(() => {
// Enter label.
cy.contains('Label').click();
cy.findByLabelText('Bucket Name (required)').click();
cy.focused().type(mockBucket.label);
cy.log(`${mockRegionWithObj.label}`);
cy.contains('Region').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ export const CreateBucketDrawer = (props: Props) => {
data-testid="label"
disabled={isRestrictedUser}
errorText={fieldState.error?.message}
label="Label"
label="Bucket Name"
required
/>
)}
control={control}
name="label"
rules={{ required: 'Label is required' }}
rules={{ required: 'Bucket name is required' }}
/>
<Controller
render={({ field, fieldState }) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('OMC_CreateBucketDrawer', () => {
});

expect(getByTestId('drawer-title')).toBeVisible();
expect(getByText('Label')).toBeVisible();
expect(getByText('Bucket Name')).toBeVisible();
expect(getByText('Region')).toBeVisible();
expect(getByText('Cancel')).toBeVisible();
expect(getByTestId('create-bucket-button')).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export const OMC_CreateBucketDrawer = (props: Props) => {
data-testid="label"
disabled={isRestrictedUser}
errorText={errors.label?.message}
label="Label"
label="Bucket Name"
onBlur={field.onBlur}
onChange={field.onChange}
required
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/validation": Changed
---

Bucket create schema `Label` to `Bucket name` ([#11877](https://github.com/linode/manager/pull/11877))
14 changes: 7 additions & 7 deletions packages/validation/src/buckets.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ export const CreateBucketSchema = object()
.shape(
{
label: string()
.required('Label is required.')
.min(3, 'Label must be between 3 and 63 characters.')
.matches(/^\S*$/, 'Label must not contain spaces.')
.required('Bucket name is required.')
.min(3, 'Bucket name must be between 3 and 63 characters.')
.matches(/^\S*$/, 'Bucket name must not contain spaces.')
.matches(
/^[a-z0-9].*[a-z0-9]$/,
'Label must start and end with a lowercase letter or number.'
'Bucket name must start and end with a lowercase letter or number.'
)
.matches(
/^(?!.*[.-]{2})[a-z0-9.-]+$/,
'Label must contain only lowercase letters, numbers, periods (.), and hyphens (-). Adjacent periods and hyphens are not allowed.'
'Bucket name must contain only lowercase letters, numbers, periods (.), and hyphens (-). Adjacent periods and hyphens are not allowed.'
)
.max(63, 'Label must be between 3 and 63 characters.')
.max(63, 'Bucket name must be between 3 and 63 characters.')
.test(
'unique-label',
'A bucket with this label already exists in your selected region',
'A bucket with this name already exists in your selected region',
(value, context) => {
const { cluster, region } = context.parent;
const buckets = context.options.context?.buckets;
Expand Down