Commit e99d50e6 authored by Alexandros Georgantas's avatar Alexandros Georgantas

Merge branch 'template-manager' into 'master'

Template manager

See merge request editoria/ucp!24
parents bc99cc17 fb1193f8
......@@ -21,6 +21,9 @@ import UnlockModal from 'pubsweet-component-bookbuilder/src/ui/src/modals/Unlock
import MetadataModal from 'pubsweet-component-bookbuilder/src/ui/src/modals/MetadataModal'
import WorkflowModal from 'pubsweet-component-bookbuilder/src/ui/src/modals/WorkflowModal'
import UnlockedModal from 'pubsweet-component-wax/src/modals/UnlockedModal'
import CreateTemplateModal from 'pubsweet-component-editoria-templates/src/ui/src/modals/TemplateModal'
import UpdateTemplateModal from 'pubsweet-component-editoria-templates/src/ui/src/modals/ConnectedUpdateTemplateModal'
import DeleteTemplateModal from 'pubsweet-component-editoria-templates/src/ui/src/modals/DeleteTemplateModal'
import theme from './theme'
......@@ -39,6 +42,9 @@ const modals = {
workflowModal: WorkflowModal,
errorModal: ErrorModal,
unlockedModal: UnlockedModal,
createTemplateModal: CreateTemplateModal,
updateTemplateModal: UpdateTemplateModal,
deleteTemplateModal: DeleteTemplateModal,
}
const rootEl = document.getElementById('root')
......
......@@ -18,6 +18,7 @@ import WithConfig from 'pubsweet-component-wax/src/WithConfig'
// Editoria
import BookBuilder from 'pubsweet-component-bookbuilder/src/ConnectedBookBuilder'
import Dashboard from 'pubsweet-component-editoria-dashboard/src/ConnectedDashboard'
import Templates from 'pubsweet-component-editoria-templates/src/ConnectedTemplates'
import PagedStyler from 'pubsweet-component-bookbuilder/src/PagedStyler/PagedStyler'
import Navigation from 'pubsweet-component-editoria-navigation/src/Navigation'
......@@ -40,7 +41,8 @@ const Editor = WithConfig(Wax, {
},
})
//
// debugger;
// console.log('temp', Templates)
const ConnectedNavigation = Connected(Navigation)
const GlobalStyle = createGlobalStyle`
......@@ -84,6 +86,7 @@ export default (
<Page>
<Switch>
<PrivateRoute component={Dashboard} exact path="/books" />
<PrivateRoute component={Templates} exact path="/templates" />
<PrivateRoute
component={PagedStyler}
path="/books/:id/pagedPreviewer/paged/:hashed"
......
......@@ -24,8 +24,12 @@
"editoria-data-model/src/bookTranslation",
"editoria-data-model/src/customTag",
"editoria-data-model/src/division",
"editoria-data-model/src/template",
"editoria-data-model/src/file",
"editoria-data-model/src/fileTranslation",
"editoria-data-model/src/team",
"editoria-data-model/src/user",
"editoria-data-model/src/dataloader",
"pubsweet-component-editoria-templates",
"editoria-api"
]
\ No newline at end of file
......@@ -96,6 +96,13 @@ module.exports = {
theme: 'editoria',
autoSave: false,
frontmatter: {
default: {
menus: {
topToolBar: 'ucpTopToolBar',
sideToolBar: 'ucpSideToolBarFront',
overlay: 'ucpOverlay',
},
},
component: {
menus: {
topToolBar: 'ucpTopToolBar',
......@@ -105,6 +112,13 @@ module.exports = {
},
},
body: {
default: {
menus: {
topToolBar: 'ucpTopToolBar',
sideToolBar: 'ucpSideToolBarBodyChapter',
overlay: 'ucpOverlay',
},
},
part: {
menus: {
topToolBar: 'ucpTopToolBar',
......@@ -122,7 +136,7 @@ module.exports = {
unnumbered: {
menus: {
topToolBar: 'ucpTopToolBar',
sideToolBar: 'ucpSideToolBarBodyPart',
sideToolBar: 'ucpSideToolBarBodyChapter',
overlay: 'ucpOverlay',
},
},
......@@ -131,6 +145,13 @@ module.exports = {
},
},
backmatter: {
default: {
menus: {
topToolBar: 'ucpTopToolBar',
sideToolBar: 'ucpSideToolBarBack',
overlay: 'ucpOverlay',
},
},
component: {
menus: {
topToolBar: 'ucpTopToolBar',
......
{
"ignoreRoot":[".git"]
}
\ No newline at end of file
......@@ -30,23 +30,25 @@
"authsome": "^0.1.0",
"codemirror": "^5.45.0",
"cypress": "^3.3.0",
"editoria-api": "^0.1.6",
"editoria-common": "^0.1.6",
"editoria-api": "^0.2.0",
"editoria-common": "^0.1.7",
"editoria-component-login": "^1.3.1",
"editoria-component-signup": "^1.1.3",
"editoria-data-model": "^0.1.2",
"editoria-data-model": "^0.2.0",
"formik": "^1.5.1",
"highlight.js": "^9.13.1",
"history": "^4.7.2",
"lodash": "4.17.4",
"nodemon": "^1.19.1",
"path-to-regexp": "^2.4.0",
"prop-types": "^15.6.0",
"pubsweet": "^4.1.2",
"pubsweet-client": "^9.2.3",
"pubsweet-component-bookbuilder": "^1.2.6",
"pubsweet-component-editoria-dashboard": "^0.2.6",
"pubsweet-component-editoria-global-teams": "^0.2.3",
"pubsweet-component-editoria-navigation": "^0.1.5",
"pubsweet-component-bookbuilder": "^1.3.0",
"pubsweet-component-editoria-dashboard": "^0.3.0",
"pubsweet-component-editoria-global-teams": "^0.2.4",
"pubsweet-component-editoria-navigation": "^0.2.0",
"pubsweet-component-editoria-templates": "^0.1.1",
"pubsweet-component-epub": "^0.5.19",
"pubsweet-component-ink-backend": "^0.1.1",
"pubsweet-component-ink-frontend": "^0.2.3",
......@@ -55,8 +57,8 @@
"pubsweet-component-password-reset-frontend": "3.0.7",
"pubsweet-component-theme-editoria": "^0.0.5",
"pubsweet-component-users-manager": "^3.0.0",
"pubsweet-component-vivliostyle-viewer": "^1.0.1",
"pubsweet-component-wax": "^0.9.1",
"pubsweet-component-vivliostyle-viewer": "^1.0.2",
"pubsweet-component-wax": "^0.10.0",
"pubsweet-server": "^13.4.2",
"pubsweet-theme-plugin": "^0.0.3",
"react": "^16.2.0",
......@@ -177,6 +179,7 @@
"setupdb": "pubsweet setupdb && npm run seed",
"start": "pubsweet start",
"server": "pubsweet start",
"watch": "DEBUG=knex:query nodemon --exec 'pubsweet server' --watch node_modules/editoria-api",
"cypress": "cypress open",
"resetdb": "pubsweet setupdb --clobber && npm run seed",
"start:services": "docker-compose up postgres",
......
const logger = require('@pubsweet/logger')
const { editoriaDataModel } = require('editoria-data-model')
const map = require('lodash/map')
const { models } = editoriaDataModel
const { BookComponentState } = models
const unfreezeUploading = async () => {
try {
const hanged = await BookComponentState.query().where('uploading', true)
logger.info(`Found ${hanged.length} with hanging uploading`)
await Promise.all(
map(hanged, async bookcomponentState => {
logger.info(`Unfreezing ${bookcomponentState.id}`)
return BookComponentState.query().patchAndFetchById(
bookcomponentState.id,
{
uploading: false,
},
)
}),
)
const after = await BookComponentState.query().where('uploading', true)
if (after.length === 0) {
logger.info('Job done')
} else {
logger.info(`Remaining ${after}`)
}
} catch (e) {
throw new Error(e)
}
}
module.exports = unfreezeUploading
unfreezeUploading()
This diff is collapsed.
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