Skip to content

Commit

Permalink
Put backdrop position behind feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tf committed Apr 5, 2024
1 parent 716b55e commit 27d8a90
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
de:
pageflow:
backdrop_content_elements:
feature_name: "Inhaltselemente als Backdrop"
pageflow_scrolled:
editor:
common_content_element_attributes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
en:
pageflow:
backdrop_content_elements:
feature_name: "Backdrop content elements"
pageflow_scrolled:
editor:
common_content_element_attributes:
Expand Down
1 change: 1 addition & 0 deletions entry_types/scrolled/lib/pageflow_scrolled/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def configure(config)
c.features.register('image_gallery_content_element')
c.features.register('frontend_v2')
c.features.register('scrolled_entry_fragment_caching')
c.features.register('backdrop_content_elements')

c.additional_frontend_seed_data.register(
'frontendVersion',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import {editor} from 'pageflow-scrolled/editor';
import {ScrolledEntry} from 'editor/models/ScrolledEntry';
import {factories, normalizeSeed} from 'support';
import {features} from 'pageflow/frontend';

describe('ContentElement', () => {
describe('getAvailablePositions', () => {
beforeEach(() => {
features.enable('frontend', ['backdrop_content_elements']);

editor.contentElementTypes.register('inlineImage', {});
editor.contentElementTypes.register('soundDisclaimer', {supportedPositions: ['inline']});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
delayedDestroying
} from 'pageflow/editor';

import {features} from 'pageflow/frontend';
import {ContentElementConfiguration} from './ContentElementConfiguration';

const widths = {
Expand Down Expand Up @@ -97,10 +98,11 @@ export const ContentElement = Backbone.Model.extend({

getAvailablePositions() {
const layout = this.section.configuration.get('layout');
const backdrop = features.isEnabled('backdrop_content_elements') ? 'backdrop' : null;
const supportedByLayout =
layout === 'center' || layout === 'centerRagged' ?
['inline', 'left', 'right', 'standAlone', 'backdrop'] :
['inline', 'sticky', 'standAlone', 'backdrop'];
['inline', 'left', 'right', 'standAlone', backdrop] :
['inline', 'sticky', 'standAlone', backdrop];
const supportedByType = this.getType().supportedPositions;

if (supportedByType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {BackdropContentElementInputView} from './inputs/BackdropContentElementIn
import {EffectListInputView} from './inputs/EffectListInputView';
import {InlineFileRightsMenuItem} from '../models/InlineFileRightsMenuItem'
import I18n from 'i18n-js';
import {features} from 'pageflow/frontend';

import {EditMotifAreaDialogView} from './EditMotifAreaDialogView';

Expand All @@ -34,7 +35,9 @@ export const EditSectionView = EditConfigurationView.extend({

configurationEditor.tab('section', function() {
this.input('backdropType', SelectInputView, {
values: ['image', 'video', 'color', 'contentElement'],
values: features.isEnabled('backdrop_content_elements') ?
['image', 'video', 'color', 'contentElement'] :
['image', 'video', 'color'],
});

this.input('fullHeight', CheckBoxInputView, {
Expand Down

0 comments on commit 27d8a90

Please sign in to comment.