Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Nov 24, 2016
1 parent 201e894 commit 5fb32b7
Show file tree
Hide file tree
Showing 34 changed files with 406 additions and 518 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
src/server/public/libs
src/server/public/scripts/admin-compiled.js
src/server/public/scripts/template-engine-compiled.js
src/server/public/scripts/template-engine-compiled.js
src/server/public/scripts/user-login-compiled.js
4 changes: 2 additions & 2 deletions src/cli/cms/editor/handlebars/printInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default function printInput (params, root) {
if(typeof params.value === 'string') params.value = params.value.replace(/\"/g, '"')

var disabled = `{{#isAuthorized '/abe/save/${params.status}/edit' "${root.user.role.workflow}"}}{{else}}disabled="disabled"{{/isAuthorized}}"`
if (params.tab == "slug") {
disabled = ""
if (params.tab == 'slug') {
disabled = ''
}
var inputClass = 'form-control form-abe'
var commonParams = `id="${params.key}"
Expand Down
1 change: 0 additions & 1 deletion src/cli/cms/operations/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
coreUtils,
cmsTemplates,
cmsOperations,
config,
abeExtend,
cmsData
} from '../../'
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cms/operations/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function reject(filePath, json, workflow) {
}
})
if (!found) {
rejectToWorkflow = "draft"
rejectToWorkflow = 'draft'
}

var p = new Promise((resolve) => {
Expand Down
12 changes: 6 additions & 6 deletions src/cli/cms/templates/handlebars/getCurrentuserRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import {
/**
* Handlebars helper, to print className and escape it string
*/
export default function getCurrentuserRole(obj, ctx) {
export default function getCurrentuserRole(obj) {
if(typeof obj.express !== 'undefined' && obj.express !== null) {
var cookies = new Cookies(obj.express.req, obj.express.res, {
secure: config.cookie.secure
});
var token = cookies.get('x-access-token');
})
var token = cookies.get('x-access-token')
if(typeof token !== 'undefined' && token !== null && token !== '') {
var secret = config.users.secret
var decoded = jwt.decode(token, secret);
var decoded = jwt.decode(token, secret)
var user = User.findSync(decoded.iss)
return user.role.workflow;
return user.role.workflow
}
}
return '';
return ''
}
3 changes: 0 additions & 3 deletions src/cli/cms/templates/handlebars/isAuthorized.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import Cookies from 'cookies'
import jwt from 'jwt-simple'

import {
config,
User
Expand Down
4 changes: 1 addition & 3 deletions src/cli/core/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import * as text from './text'
import locales from './locales'
import * as slug from './slug'
import * as file from './file'
import * as number from './number'

export {
array,
sort,
text,
locales,
slug,
file,
number
file
}
34 changes: 0 additions & 34 deletions src/cli/core/utils/number.js

This file was deleted.

Loading

0 comments on commit 5fb32b7

Please sign in to comment.