Commit 8f9932c7 authored by Giannis Kopanas's avatar Giannis Kopanas Committed by Alexandros Georgantas

fix(applicationmanager): set default componentType for missing wax config

parent 47b35387
import React, { Component } from 'react'
import styled, { keyframes, css } from 'styled-components'
import React from 'react'
import styled, { keyframes } from 'styled-components'
import { th } from '@pubsweet/ui-toolkit'
// import { flow } from 'lodash'
// import { DragSource, DropTarget } from 'react-dnd'
import BookComponentTitle from './BookComponentTitle'
import BookComponentActions from './BookComponentActions'
import ComponentTypeMenu from './ComponetTypeMenu'
import { ButtonWithoutLabel } from './Button'
import SecondRow from './SecondRow'
import FirstRow from './FirstRow'
// import {
......@@ -23,7 +22,7 @@ const BookComponentContainer = styled.div`
padding-left: ${({ shouldIndent }) => (shouldIndent ? '5%' : '0')};
margin-bottom: calc(3 * ${th('gridUnit')});
background-color: white;
width:100%;
width: 100%;
`
// const ActionsRight = styled.div`
// display: flex;
......
......@@ -266,7 +266,7 @@ const Footer = (handleSave, divisions, divisionType) => () => {
return JSON.stringify(divisions)
}
const disabled = text.replace(/\s/g, '')
const disabled = text ? text.replace(/\s/g, '') : false
return (
<>
......
......@@ -260,13 +260,15 @@ class Division extends React.Component {
let addButtons = null
if (canViewAddComponent) {
addButtons = map(componentConfig.allowedComponentTypes, componentType => (
<AddComponentButton
add={this.onAddClick}
label={`add ${componentType.title}`}
type={componentType.value}
/>
))
addButtons = map(componentConfig.allowedComponentTypes, componentType =>
componentType.predefined ? (
<AddComponentButton
add={this.onAddClick}
label={`add ${componentType.title}`}
type={componentType.value}
/>
) : null,
)
}
// const list = (
......
......@@ -15,9 +15,9 @@ const PrivateRoute = ({
if (currentUser) {
return (
<Component
{...props}
applicationParameter={applicationParameter}
currentUser={currentUser}
{...props}
/>
)
}
......
......@@ -259,7 +259,7 @@ export class WaxPubsweet extends React.Component {
menus:
config.wax[bookComponent.divisionType.toLowerCase()][
bookComponent.componentType
].menus,
] || ['component'].menus,
}
const { layout, autoSave, menus } = waxConfig
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment