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 9.0.0 to 9.1.0

7

CHANGELOG.md

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

## [9.1.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v9.0.0...v9.1.0) (2022-07-26)
### Features
* publish weights ([44c57bb](https://gitlab.com/kohana-js/proposals/level0/mod-cms/commit/44c57bb4d554b57c5413c58e4a87a24e4593111e))
## [9.0.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v8.0.0...v9.0.0) (2022-07-26)

@@ -7,0 +14,0 @@

3

classes/controller/admin/Content.js

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

const items = instances.filter(it => it.page_type === page_type);

@@ -42,3 +41,3 @@ items.forEach(page => {

page.live_weight = livePage.weight;
page.synced = page.weight === livePage.weight && page.original === livePage.original;
page.synced = page.original === livePage.original;
}

@@ -45,0 +44,0 @@ });

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

async publish_weights(){
const $_POST = this.state.get(ControllerMixinMultipartForm.POST_DATA);
const database = this.state.get(ControllerMixinDatabase.DATABASES).get('live');
const weightMap = new Map();
Object.keys($_POST).forEach(key => {
const matches = key.match(/^\((\d+)\):weight$/i);
if(matches === null)return;
weightMap.set(matches[1], $_POST[key]);
});
const livePages = await ORM.readBy(Page, 'id', [...weightMap.keys()], {database, asArray:true});
await Promise.all(livePages.map(async page=>{
const inputWeight = parseInt(weightMap.get(String(page.id)));
if(page.weight === inputWeight)return;
page.weight = inputWeight;
await page.write();
}));
}
async action_update() {
const $_POST = this.state.get(ControllerMixinMultipartForm.POST_DATA);
if($_POST.action === 'publish_weights')await this.publish_weights()
//if no param id, create page proxy

@@ -33,3 +59,2 @@ const instance = this.state.get('instance');

const $_POST = this.state.get(ControllerMixinMultipartForm.POST_DATA);
const original = HelperPageText.getOriginal(instance);

@@ -36,0 +61,0 @@ //update original

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

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

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