Skip to content

Commit

Permalink
Fixed project creating bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzapp committed Jun 11, 2017
1 parent 64d0e21 commit 79aba94
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 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.8.0",
"version": "0.8.1",
"description": "The pluggable CMS",
"main": "hashbrown.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions public/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2352,6 +2352,8 @@
_this.element = _this.$element[0];
}

_this.element.innerHTML = '';

_this.element.style.position = 'absolute';
_this.element.style.zIndex = 1200;
_this.element.style.top = _this.pos.y;
Expand Down
3 changes: 3 additions & 0 deletions public/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,8 @@
_this.element = _this.$element[0];
}

_this.element.innerHTML = '';

_this.element.style.position = 'absolute';
_this.element.style.zIndex = 1200;
_this.element.style.top = _this.pos.y;
Expand Down Expand Up @@ -22134,6 +22136,7 @@

project.id = id;

project.settings.usedBy = 'project';
project.settings.info = {
name: name
};
Expand Down
1 change: 1 addition & 0 deletions src/common/models/Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Project extends Entity {

project.id = id;

project.settings.usedBy = 'project';
project.settings.info = {
name: name
};
Expand Down
5 changes: 2 additions & 3 deletions src/server/helpers/ProjectHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class ProjectHelper {
let names = [];

for(let setting of allSettings) {
if(setting.usedBy === 'project') { continue; }
if(!setting.usedBy || setting.usedBy === 'project') { continue; }

names.push(setting.usedBy);
}
Expand Down Expand Up @@ -164,7 +164,6 @@ class ProjectHelper {
project,
'settings',
{ usedBy: environment },
{ usedBy: environment },
{ upsert: true }
);
}
Expand Down Expand Up @@ -233,7 +232,7 @@ class ProjectHelper {
if(name && userId) {
let project = Project.create(name);

MongoHelper.insertOne(project.id, 'settings', project.settings.info)
MongoHelper.insertOne(project.id, 'settings', project.settings)
.then(() => {
// The user that creates a project gets all scopes
return UserHelper.addUserProjectScope(userId, project.id, [ 'users', 'settings', 'connections', 'schemas' ]);
Expand Down

0 comments on commit 79aba94

Please sign in to comment.