Skip to content

Commit

Permalink
Version bumped to v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzapp committed May 25, 2017
1 parent bd6c775 commit 64d0e21
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 113 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hashbrown-cms",
"repository": "https://github.com/Putaitu/hashbrown-cms.git",
"version": "0.7.2",
"version": "0.8.0",
"description": "The pluggable CMS",
"main": "hashbrown.js",
"scripts": {
Expand Down
28 changes: 1 addition & 27 deletions public/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -36577,32 +36577,6 @@
});
}

/**
* Sanity check for site settings Schema
*
* @param {Object} schema
*
* @returns {Object} Checked Schema
*/

}, {
key: 'checkSiteSettings',
value: function checkSiteSettings(schema) {
schema = schema || {};

schema.icon = 'wrench';
schema.id = 'siteSettings';
schema.name = 'Site settings';
schema.parentSchemaId = 'contentBase';
schema.hiddenProperties = ['allowedChildSchemas', 'parentSchemaId', 'name', 'icon'];

if (schema instanceof ContentSchema === false) {
schema = new ContentSchema(schema);
}

return schema;
}

/**
* Gets the appropriate model
*
Expand Down Expand Up @@ -36687,7 +36661,7 @@
module.exports = {
"name": "hashbrown-cms",
"repository": "https://github.com/Putaitu/hashbrown-cms.git",
"version": "0.7.2",
"version": "0.8.0",
"description": "The pluggable CMS",
"main": "hashbrown.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -20991,7 +20991,7 @@
module.exports = {
"name": "hashbrown-cms",
"repository": "https://github.com/Putaitu/hashbrown-cms.git",
"version": "0.7.2",
"version": "0.8.0",
"description": "The pluggable CMS",
"main": "hashbrown.js",
"scripts": {
Expand Down
28 changes: 0 additions & 28 deletions src/common/helpers/SchemaHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,6 @@ class SchemaHelper {
});
}

/**
* Sanity check for site settings Schema
*
* @param {Object} schema
*
* @returns {Object} Checked Schema
*/
static checkSiteSettings(schema) {
schema = schema || {};

schema.icon = 'wrench';
schema.id = 'siteSettings'
schema.name = 'Site settings';
schema.parentSchemaId = 'contentBase';
schema.hiddenProperties = [
'allowedChildSchemas',
'parentSchemaId',
'name',
'icon'
];

if(schema instanceof ContentSchema === false) {
schema = new ContentSchema(schema);
}

return schema;
}

/**
* Gets the appropriate model
*
Expand Down
56 changes: 0 additions & 56 deletions src/server/helpers/SchemaHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ class SchemaHelper extends SchemaHelperCommon {
}

return SyncHelper.mergeResource(project, environment, 'schemas', schemas, { customOnly: true });
})
.then((schemas) => {
// Last sanity check for site settings
schemas.siteSettings = SchemaHelper.checkSiteSettings(schemas.siteSettings || {});

return Promise.resolve(schemas);
});
}

Expand Down Expand Up @@ -244,45 +238,6 @@ class SchemaHelper extends SchemaHelperCommon {
});
}

/**
* Gets the site settings Schema
*
* @param {String} project
* @param {String} environment
*
* @return {Promise} ContentSchema
*/
static getSiteSettingsSchema(
project = requiredParam('project'),
environment = requiredParam('environment')
) {
let collection = environment + '.schemas';

// First attempt to find site settings in the database
return MongoHelper.findOne(
project,
collection,
{
id: 'siteSettings'
}
).then((schemaData) => {
// If that fails, try to find it using the synced remote
if(!schemaData || Object.keys(schemaData).length < 1) {
return SyncHelper.getResourceItem(project, environment, 'schemas', 'siteSettings');
}

// If successful, resolve with Schema data
return Promise.resolve(schemaData);
})
.catch(() => {
// If site settings were not found on synced instance, never mind
return Promise.resolve();
})
.then((schemaData) => {
return Promise.resolve(SchemaHelper.checkSiteSettings(schemaData));
});
}

/**
* Gets a Schema by id
*
Expand All @@ -297,11 +252,6 @@ class SchemaHelper extends SchemaHelperCommon {
environment = requiredParam('environment'),
id = requiredParam('id')
) {
// Special case for the "siteSettings" id
if(id === 'siteSettings') {
return SchemaHelper.getSiteSettingsSchema(project, environment);
}

let collection = environment + '.schemas';

if(id) {
Expand Down Expand Up @@ -535,12 +485,6 @@ class SchemaHelper extends SchemaHelperCommon {

schema = schema || {};

// Special case for site settings schema
if(id === 'siteSettings') {
schema = SchemaHelper.checkSiteSettings(schema).getObject();
create = true;
}

// Unset automatic flags
schema.locked = false;
schema.remote = false;
Expand Down

0 comments on commit 64d0e21

Please sign in to comment.