All files / nexshop-web-contents/src/model-factory scene.js

100% Statements 7/7
100% Branches 2/2
100% Functions 3/3
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241x 1x     56x 56x     1x 13x                            
import {HORIZONTAL_LAYOUTS, VERTICAL_LAYOUTS} from "../constants/layouts";
import _ from 'lodash';
 
export function createEmptySceneFromLayouts(id, orientation) {
    const layout = orientation === 'horizontal' ? HORIZONTAL_LAYOUTS : VERTICAL_LAYOUTS;
    return _.cloneDeep(layout.find(layout => layout.id === id));
}
 
export const createScene = (name, panels, folderId, resolution, orientation, relatedContents) => {
    return {
        name,
        metaData: {
            panels,
            display: {
                resolution,
                orientation,
            },
        },
        relatedContents,
        folderId,
        tags: [],
        type: 'scene'
    }
};