Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kohanajs/mod-cms

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kohanajs/mod-cms - npm Package Compare versions

Comparing version 8.0.0 to 9.0.0

14

CHANGELOG.md

@@ -5,2 +5,16 @@ # Changelog

## [9.0.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v8.0.0...v9.0.0) (2022-07-26)
### ⚠ BREAKING CHANGES
* use content.sqlite as draft database name
### Features
* content list page with published status ([1882160](https://gitlab.com/kohana-js/proposals/level0/mod-cms/commit/18821604e9f0d28bb72e147f9e3c4fe4104766be))
* use content.sqlite as draft database name ([21c959a](https://gitlab.com/kohana-js/proposals/level0/mod-cms/commit/21c959a404d1158960bc5b61c3e973a5e19252e1))
## [8.0.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v7.1.5...v8.0.0) (2022-05-20)

@@ -7,0 +21,0 @@

2

classes/controller/admin/API.js

@@ -15,3 +15,3 @@ const {SQL} = require('@kohanajs/constants');

databases: new Map([
['draft', `${KohanaJS.config.cms.databasePath}/content-draft.sqlite`],
['draft', `${KohanaJS.config.cms.databasePath}/content.sqlite`],
['tag', `${KohanaJS.config.cms.databasePath}/www/tag.sqlite`],

@@ -18,0 +18,0 @@ ]),

@@ -12,3 +12,4 @@ const path = require('path');

databases: new Map([
['draft', `${KohanaJS.config.cms.databasePath}/content-draft.sqlite`],
['live', `${KohanaJS.config.cms.databasePath}/www/content.sqlite`],
['draft', `${KohanaJS.config.cms.databasePath}/content.sqlite`],
]),

@@ -19,3 +20,3 @@ orderBy: new Map([['weight', 'ASC'], ['created_at', 'DESC']]),

templates: new Map([
['index', KohanaJS.config.cms.blueprint[request.params['page_type']] ? `templates/admin/page/page_types/${request.params['page_type']}/index` : `templates/admin/page/page_types/default/index`],
['index', `templates/admin/page/page_types/default/index`],
]),

@@ -31,3 +32,16 @@ ...options,

const database = this.state.get(ControllerMixinDatabase.DATABASES).get('live');
const livePages = await ORM.readBy(Page, 'page_type', [page_type], {database});
const livePageMap = new Map(livePages.map(page => [page.id, page]));
const items = instances.filter(it => it.page_type === page_type);
items.forEach(page => {
const livePage = livePageMap.get(page.id);
page.published = !!livePage;
if(page.published){
page.live_weight = livePage.weight;
page.synced = page.weight === livePage.weight && page.original === livePage.original;
}
});

@@ -34,0 +48,0 @@ Object.assign(

@@ -16,3 +16,3 @@ const { ControllerAdmin } = require('@kohanajs/mod-admin');

databases: new Map([
['draft', `${KohanaJS.config.cms.databasePath}/content-draft.sqlite`],
['draft', `${KohanaJS.config.cms.databasePath}/content.sqlite`],
['live', `${KohanaJS.config.cms.databasePath}/www/content.sqlite`],

@@ -19,0 +19,0 @@ ['tag', `${KohanaJS.config.cms.databasePath}/www/tag.sqlite`],

@@ -15,3 +15,3 @@ const {ControllerMixinDatabase, ControllerMixinView, KohanaJS, ORM} = require("kohanajs");

databases: new Map([
['draft', `${KohanaJS.config.cms.databasePath}/content-draft.sqlite`],
['draft', `${KohanaJS.config.cms.databasePath}/content.sqlite`],
['tag', `${KohanaJS.config.cms.databasePath}/www/tag.sqlite`],

@@ -18,0 +18,0 @@ ]),

@@ -61,3 +61,3 @@ const path = require('path');

const uploadPath = `${dateFolder}/${fileField.tmpName}-${fileField.filename}`
const uploadPath = `${dateFolder}/${fileField.tmpName}-${fileField.filename.replace(/[^a-z0-9-_]/gi, "")}`;
await copyFile(fileField.tmp, path.normalize(uploadFolder + '/' + uploadPath));

@@ -64,0 +64,0 @@ await unlink(fileField.tmp);

{
"name": "@kohanajs/mod-cms",
"version": "8.0.0",
"version": "9.0.0",
"description": "The CMS module for KohanaJS",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -16,3 +16,3 @@ const path = require('path');

`${__dirname}/exports/content-draft.sql`,
`${__dirname}/default/db/content-draft.sqlite`,
`${__dirname}/default/db/content.sqlite`,
path.normalize(`${__dirname}/classes/contentDraft/model`)

@@ -19,0 +19,0 @@ );

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc