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

[Breaking] Removing id from form field wrapper #2102

Merged
merged 8 commits into from Jan 26, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

### Breaking

- Removing id from FormFieldWrapper @iFlameing
- Change default Listing Template to include only Text and renamed the old default Template to Summary Template @jackahl

### Feature
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/dexterity-controlpanel-schema.js
Expand Up @@ -31,9 +31,7 @@ if (Cypress.env('API') !== 'guillotina') {

// Add field
cy.get('button[id=addfield]').click();
cy.get('.modal [id="field-factory"] .react-select-container')
.click()
.type('Choice{enter}');
cy.get('.modal .react-select-container').click().type('Choice{enter}');
cy.get('.modal input[id="field-title"]')
.type('Color')
.should('have.value', 'Color');
Expand All @@ -54,7 +52,7 @@ if (Cypress.env('API') !== 'guillotina') {
cy.get(
'[data-rbd-draggable-id="Color"] .toolbar button[aria-label="Edit"]',
).click();
cy.get('.modal [id="field-parentFieldSet"] .react-select-container')
cy.get('.modal .react-select-container')
.click()
.type('Specifications{enter}');
cy.get('.modal textarea[id="field-values"]').type(
Expand Down
20 changes: 14 additions & 6 deletions cypress/integration/recurrence-widget.js
Expand Up @@ -56,7 +56,7 @@ if (Cypress.env('API') === 'plone') {
cy.get('.modal #recurrenceEndsUntil').check({ force: true });

//test add date
cy.get('.modal #field-addDate input').type('{selectall}05/20/2020');
cy.get('.modal input').type('{selectall}05/20/2020');
cy.get('.modal .occurences .list > .item').should('have.length', 14);

//test exclude date
Expand Down Expand Up @@ -88,7 +88,7 @@ if (Cypress.env('API') === 'plone') {
it.skip('Test Monday and Friday recurrence', function () {
//change freq

cy.get('.modal .field#field-freq')
cy.get('.modal .field .react-select-container')
.click()
.type('Monday and Friday {enter}');
cy.get('.modal .occurences .list > .item').should('have.length', 4);
Expand Down Expand Up @@ -126,7 +126,9 @@ if (Cypress.env('API') === 'plone') {

it.skip('Test Weekday recurrence', function () {
//change freq
cy.get('.modal .field#field-freq').click().type('Weekday {enter}');
cy.get('.modal .field .react-select-container')
.click()
.type('Weekday {enter}');
cy.get('.modal .occurences .list > .item').should('have.length', 10);

//test recurrence end after N recurrences
Expand Down Expand Up @@ -165,7 +167,9 @@ if (Cypress.env('API') === 'plone') {

it.skip('Test Weekly recurrence', function () {
//change freq
cy.get('.modal .field#field-freq').click().type('Weekly {enter}');
cy.get('.modal .field .react-select-container')
.click()
.type('Weekly {enter}');
cy.get('.modal .byday-field .ui.button.active').click(); //deactivate selected days

cy.get('.modal .byday-field .ui.button').contains('Tue').click(); //select Tuesday
Expand Down Expand Up @@ -209,7 +213,9 @@ if (Cypress.env('API') === 'plone') {

it.skip('Test Monthly recurrence', function () {
//change freq
cy.get('.modal .field#field-freq').click().type('Monthly {enter}');
cy.get('.modal .field .react-select-container')
.click()
.type('Monthly {enter}');

cy.get('.modal input#bymonthday').should('have.attr', 'value', '4');
cy.get('.modal .occurences .list .item:last-of-type .content').contains(
Expand Down Expand Up @@ -278,7 +284,9 @@ if (Cypress.env('API') === 'plone') {

it('Test Yearly recurrence', function () {
//change freq
cy.get('.modal .field#field-freq').click().type('Yearly {enter}');
cy.get('.modal .field .react-select-container')
.click()
.type('Yearly {enter}');

cy.get('.modal #until-date').type('{selectall}12/31/2030');
cy.get('.modal .occurences .list > .item').should('have.length', 11);
Expand Down
6 changes: 6 additions & 0 deletions docs/source/upgrade-guide/index.md
Expand Up @@ -12,6 +12,12 @@ This upgrade guide lists all breaking changes in Volto and explains the

## Upgrading to Volto 11.x.x

### id is removed from FormFieldWrapper

We have removed the id from the FormFieldWrapper because it is coincide with the label id if we don't provide the fieldset.
If you have cypress test which depends on this id then just remove the id from the test and if test fails then just
add `.react-select-container` instead of your id.
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

@iFlameing maybe we can show an example diff here or at least point to this PR, so people can check what actually changed.


### New Default Listing Template

!!! note
Expand Down
Expand Up @@ -30,7 +30,6 @@ exports[`renders an Image Block Sidebar component 1`] = `
>
<div
className="inline field text"
id="field-external"
>
<div
className="ui grid"
Expand Down Expand Up @@ -109,7 +108,6 @@ exports[`renders an Image Block Sidebar component 1`] = `
</div>
<div
className="inline field text"
id="field-alt"
>
<div
className="ui grid"
Expand Down Expand Up @@ -331,7 +329,6 @@ exports[`renders an Image Block Sidebar component 1`] = `
</div>
<div
className="inline field"
id="field-image_size"
>
<div
className="ui grid"
Expand Down Expand Up @@ -439,7 +436,6 @@ exports[`renders an Image Block Sidebar component 1`] = `
>
<div
className="inline field text"
id="field-link"
>
<div
className="ui grid"
Expand Down Expand Up @@ -518,7 +514,6 @@ exports[`renders an Image Block Sidebar component 1`] = `
</div>
<div
className="inline field"
id="field-openLinkInNewTab"
>
<div
className="ui grid"
Expand Down
Expand Up @@ -24,7 +24,6 @@ exports[`renders a Lead Image block Sidebar component 1`] = `
>
<div
className="inline field text"
id="field-alt"
>
<div
className="ui grid"
Expand Down Expand Up @@ -277,7 +276,6 @@ exports[`renders a Lead Image block Sidebar component 1`] = `
>
<div
className="inline field text"
id="field-link"
>
<div
className="ui grid"
Expand Down Expand Up @@ -356,7 +354,6 @@ exports[`renders a Lead Image block Sidebar component 1`] = `
</div>
<div
className="inline field"
id="field-openLinkInNewTab"
>
<div
className="ui grid"
Expand Down
Expand Up @@ -309,7 +309,6 @@ exports[`renders an Listing Data Sidebar component 1`] = `
</div>
<div
className="inline field"
id="field-listingblock-sort-on-reverse"
>
<div
className="ui grid"
Expand Down Expand Up @@ -351,7 +350,6 @@ exports[`renders an Listing Data Sidebar component 1`] = `
</div>
<div
className="inline field text"
id="field-limit"
>
<div
className="ui grid"
Expand Down Expand Up @@ -396,7 +394,6 @@ exports[`renders an Listing Data Sidebar component 1`] = `
</div>
<div
className="inline field text"
id="field-itembatchsize"
>
<div
className="ui grid"
Expand Down
Expand Up @@ -4,7 +4,6 @@ exports[`renders an Listing Data Sidebar component 1`] = `
Array [
<div
className="inline field text"
id="field-linkTitle"
>
<div
className="ui grid"
Expand Down Expand Up @@ -49,7 +48,6 @@ Array [
</div>,
<div
className="inline field text"
id="field-linkHref"
>
<div
className="ui grid"
Expand Down
Expand Up @@ -331,7 +331,6 @@ exports[`renders a Listing Block Sidebar component 1`] = `
</div>
<div
class="inline field"
id="field-listingblock-sort-on-reverse"
>
<div
class="ui grid"
Expand Down Expand Up @@ -369,7 +368,6 @@ exports[`renders a Listing Block Sidebar component 1`] = `
</div>
<div
class="inline field text"
id="field-limit"
>
<div
class="ui grid"
Expand Down Expand Up @@ -409,7 +407,6 @@ exports[`renders a Listing Block Sidebar component 1`] = `
</div>
<div
class="inline field text"
id="field-itembatchsize"
>
<div
class="ui grid"
Expand Down Expand Up @@ -465,7 +462,6 @@ exports[`renders a Listing Block Sidebar component 1`] = `
>
<div
class="inline field text"
id="field-linkTitle"
>
<div
class="ui grid"
Expand Down Expand Up @@ -505,7 +501,6 @@ exports[`renders a Listing Block Sidebar component 1`] = `
</div>
<div
class="inline field text"
id="field-linkHref"
>
<div
class="ui grid"
Expand Down
Expand Up @@ -16,7 +16,6 @@ exports[`renders an Image Block Sidebar component 1`] = `
>
<div
className="inline field text"
id="field-external"
>
<div
className="ui grid"
Expand Down
Expand Up @@ -16,7 +16,6 @@ exports[`renders an Image Block Sidebar component 1`] = `
>
<div
className="inline field text"
id="field-external"
>
<div
className="ui grid"
Expand Down Expand Up @@ -95,7 +94,6 @@ exports[`renders an Image Block Sidebar component 1`] = `
</div>
<div
className="inline field text"
id="field-video-preview-image"
>
<div
className="ui grid"
Expand Down
Expand Up @@ -21,7 +21,6 @@ exports[`ChangePassword renders a change password component 1`] = `
>
<div
className="inline required field help"
id="field-oldPassword"
>
<div
className="ui grid"
Expand Down Expand Up @@ -80,7 +79,6 @@ exports[`ChangePassword renders a change password component 1`] = `
</div>
<div
className="inline required field help"
id="field-newPassword"
>
<div
className="ui grid"
Expand Down Expand Up @@ -139,7 +137,6 @@ exports[`ChangePassword renders a change password component 1`] = `
</div>
<div
className="inline required field help"
id="field-newPasswordRepeat"
>
<div
className="ui grid"
Expand Down
Expand Up @@ -17,7 +17,6 @@ exports[`PersonalInformation renders a personal information component 1`] = `
>
<div
className="inline field help text"
id="field-fullname"
>
<div
className="ui grid"
Expand Down Expand Up @@ -75,7 +74,6 @@ exports[`PersonalInformation renders a personal information component 1`] = `
</div>
<div
className="inline required field help text"
id="field-email"
>
<div
className="ui grid"
Expand Down Expand Up @@ -133,7 +131,6 @@ exports[`PersonalInformation renders a personal information component 1`] = `
</div>
<div
className="inline field help"
id="field-portrait"
>
<div
className="ui grid"
Expand Down Expand Up @@ -221,7 +218,6 @@ exports[`PersonalInformation renders a personal information component 1`] = `
</div>
<div
className="inline field help text"
id="field-home_page"
>
<div
className="ui grid"
Expand Down Expand Up @@ -279,7 +275,6 @@ exports[`PersonalInformation renders a personal information component 1`] = `
</div>
<div
className="inline field help text"
id="field-location"
>
<div
className="ui grid"
Expand Down Expand Up @@ -413,7 +408,6 @@ exports[`PersonalInformation renders a personal information component embedded i
>
<div
className="inline field help text"
id="field-fullname"
>
<div
className="ui grid"
Expand Down Expand Up @@ -471,7 +465,6 @@ exports[`PersonalInformation renders a personal information component embedded i
</div>
<div
className="inline required field help text"
id="field-email"
>
<div
className="ui grid"
Expand Down Expand Up @@ -529,7 +522,6 @@ exports[`PersonalInformation renders a personal information component embedded i
</div>
<div
className="inline field help"
id="field-portrait"
>
<div
className="ui grid"
Expand Down Expand Up @@ -617,7 +609,6 @@ exports[`PersonalInformation renders a personal information component embedded i
</div>
<div
className="inline field help text"
id="field-home_page"
>
<div
className="ui grid"
Expand Down Expand Up @@ -675,7 +666,6 @@ exports[`PersonalInformation renders a personal information component embedded i
</div>
<div
className="inline field help text"
id="field-location"
>
<div
className="ui grid"
Expand Down
Expand Up @@ -17,7 +17,6 @@ exports[`PersonalPreferences renders a personal preferences component 1`] = `
>
<div
className="inline field help"
id="field-language"
>
<div
className="ui grid"
Expand Down
2 changes: 0 additions & 2 deletions src/components/manage/Widgets/FormFieldWrapper.jsx
Expand Up @@ -75,7 +75,6 @@ class FormFieldWrapper extends Component {
description,
required,
error,
fieldSet,
wrapped,
columns,
draggable,
Expand Down Expand Up @@ -103,7 +102,6 @@ class FormFieldWrapper extends Component {
required={required}
error={error.length > 0}
className={cx(description ? 'help' : '', className)}
id={`${fieldSet || 'field'}-${id}`}
>
<Grid>
<Grid.Row stretched>
Expand Down