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

Add CSS body class in Babel view. Improve marker for language indepen… #3027

Merged
merged 1 commit into from
Feb 2, 2022
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@

### Internal

- Add CSS body class in Babel view. Improve marker for language independent fields in Babel view too. @sneridagh

### Docs

Update documentation for internal proxy & other smaller reorganisation for quicker onboarding of
Update documentation for internal proxy & other smaller reorganisation for quicker onboarding of
new users/evaluators. @fredvd

## 14.7.0 (2022-01-28)
Expand Down
75 changes: 39 additions & 36 deletions src/components/manage/Add/Add.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Helmet } from '@plone/volto/helpers';
import { BodyClass, Helmet } from '@plone/volto/helpers';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { keys, isEmpty } from 'lodash';
Expand Down Expand Up @@ -400,41 +400,44 @@ class Add extends Component {
);

return translationObject ? (
<Grid
celled="internally"
stackable
columns={2}
id="page-add-translation"
>
<Grid.Column className="source-object">
<TranslationObject
translationObject={translationObject}
schema={this.props.schema}
pathname={this.props.pathname}
visual={visual}
isFormSelected={
this.state.formSelected === 'translationObjectForm'
}
onSelectForm={() => {
this.setState({
formSelected: 'translationObjectForm',
});
}}
/>
</Grid.Column>
<Grid.Column>
<div className="new-translation">
<Menu pointing secondary attached tabular>
<Menu.Item name={translateTo.toUpperCase()} active={true}>
{`${this.props.intl.formatMessage(messages.translateTo, {
lang: translateTo,
})}`}
</Menu.Item>
</Menu>
{pageAdd}
</div>
</Grid.Column>
</Grid>
<>
<BodyClass className="babel-view" />
<Grid
celled="internally"
stackable
columns={2}
id="page-add-translation"
>
<Grid.Column className="source-object">
<TranslationObject
translationObject={translationObject}
schema={this.props.schema}
pathname={this.props.pathname}
visual={visual}
isFormSelected={
this.state.formSelected === 'translationObjectForm'
}
onSelectForm={() => {
this.setState({
formSelected: 'translationObjectForm',
});
}}
/>
</Grid.Column>
<Grid.Column>
<div className="new-translation">
<Menu pointing secondary attached tabular>
<Menu.Item name={translateTo.toUpperCase()} active={true}>
{`${this.props.intl.formatMessage(messages.translateTo, {
lang: translateTo,
})}`}
</Menu.Item>
</Menu>
{pageAdd}
</div>
</Grid.Column>
</Grid>
</>
) : (
pageAdd
);
Expand Down
3 changes: 2 additions & 1 deletion theme/themes/pastanaga/extras/widgets.less
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@

// Fake "disabled" field for language independent fields
// Only on Add form
#page-add-translation #page-add .language-independent-field {
body.babel-view #page-add-translation #page-add .language-independent-field,
body.babel-view .field .language-independent-field {
pointer-events: none;

input,
Expand Down