Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 122 additions & 47 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,84 +2,159 @@

module.exports = {

"extends": "eslint:recommended",
extends: 'eslint:recommended',

"parser": "espree",
parser: 'espree',

"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
parserOptions: {
'ecmaVersion': 8,
'sourceType': 'module',
'ecmaFeatures': {
'experimentalObjectRestSpread': true
}
},

"env": {
"browser": true,
"es6": true,
"jasmine": true
env: {
'browser': true,
'es6': true,
'jasmine': true
},

"globals": {
"angular": true,
"_": true,
"$": true,
"jQuery": true,
"moment": true
plugins: ['angular'],

globals: {
'angular': true,
'_': true,
'$': true,
'jQuery': true,
'moment': true
},

"rules": {
rules: {
/* Angular linting rules */
//'angular/avoid-scope-typos': 0, TODO : check for bug fix for this rule
'angular/module-getter': 1,
'angular/module-setter': 1,
//'angular/no-private-call': [2,{'allow':['$$parentForm', '$$value$$', '$$phase']}],
'angular/no-private-call': 0,

/* Best practises */
'angular/component-limit': 0,
'angular/controller-as-route': 2,
'angular/controller-as': 0,
'angular/di-unused': 2,
'angular/directive-restrict': 0,
'angular/empty-controller': 2,
'angular/no-controller': 0,
'angular/no-inline-template': 2,
'angular/no-run-logic': 2,
'angular/no-services': [2,['$q', '$filter']],
'angular/on-watch': 0,
'angular/prefer-component': 0,

/* Avoid deprecated features */
'angular/no-cookiestore': 0,
'angular/no-directive-replace': 0,
'angular/no-http-callback': 0,

/* Naming */
'angular/component-name': 0,
'angular/constant-name': 0,
'angular/controller-name': 0,
'angular/directive-name': 0,
'angular/factory-name': 0,
'angular/file-name': 0,
'angular/filter-name': 0,
'angular/module-name': 0,
'angular/provider-name': 0,
'angular/service-name': 0,
'angular/value-name': 0,

/* Conventions */
'angular/di-order': 0,
'angular/di': 0,
'angular/dumb-inject': 0,
'angular/function-type': 0,
'angular/module-dependency-order': 0,
'angular/no-service-method': 0,
'angular/one-dependency-per-line': 0,
'angular/rest-service': 0,
'angular/watchers-execution': 0,

/* Angular wrappers */
'angular/angularelement': 0,
'angular/definedundefined': 0,
'angular/document-service': 0,
'angular/foreach': 0,
'angular/interval-service': 0,
'angular/json-function': 0,
'angular/log': 0,
'angular/no-angular-mock': 0,
'angular/no-jquery-angularelement': 0,
'angular/timeout-service': 0,
'angular/typecheck-array': 0,
'angular/typecheck-date': 0,
'angular/typecheck-function': 0,
'angular/typecheck-number': 0,
'angular/typecheck-object': 0,
'angular/typecheck-string': 0,
'angular/typecheck-service': 0,

'angular/on-destroy': 0,

"semi": "error",
'semi': 'error',

"block-spacing": "error", // warn if no space in braces like {key: val}
'block-spacing': 'error', // warn if no space in braces like {key: val}

"brace-style": ["error", "1tbs"], // warn for not using "one true brace style"
'brace-style': ['error', '1tbs'], // warn for not using 'one true brace style'

"comma-spacing": ["error", {"before": false, "after": true}], // warn if no space after comma [thing1,thing2,...]
'comma-spacing': ['error', {'before': false, 'after': true}], // warn if no space after comma [thing1,thing2,...]

"indent": ["off", 4], // TODO
'indent': ['off', 4], // TODO

"key-spacing": ["error", {"beforeColon": false, "afterColon": true}], // warn if space before colon & not after colon in object literals like { key : val } or { key:val }
'key-spacing': ['error', {'beforeColon': false, 'afterColon': true}], // warn if space before colon & not after colon in object literals like { key : val } or { key:val }

"keyword-spacing": ["error", {"before": true, "after": true}],
'keyword-spacing': ['error', {'before': true, 'after': true}],

"no-console": ["off", {}], // TODO
'no-console': ['off', {}], // TODO

"no-empty": ["error", {"allowEmptyCatch": true}],
'no-empty': ['error', {'allowEmptyCatch': true}],

"no-undef": ["off", {}], // TODO
'no-undef': ['off', {}], // TODO

"no-unused-vars": ["error", {"vars": "all", "args": "none", "ignoreRestSiblings": false}],
'no-unused-vars': ['error', {'vars': 'all', 'args': 'none', 'ignoreRestSiblings': true}],

"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
'space-before-function-paren': ['error', {
'anonymous': 'always',
'named': 'never',
'asyncArrow': 'always'
}],

"no-useless-escape": ["off",{}], //TODO
'no-useless-escape': ['off',{}], //TODO

"quotes": ["error", "single"],
'quotes': ['error', 'single'],

"arrow-parens": ["error", "as-needed", { "requireForBlockBody": true }],
'arrow-parens': ['error', 'as-needed', { 'requireForBlockBody': true }],

"prefer-const": ["error", { "destructuring": "all", "ignoreReadBeforeAssign": true }],
'prefer-const': ['error', { 'destructuring': 'all', 'ignoreReadBeforeAssign': true }],

"no-new-object": "error",
'no-new-object': 'error',

"no-var": "error",
'no-var': 'error',

"no-confusing-arrow": ['error', {
"allowParens": true,
'no-confusing-arrow': ['error', {
'allowParens': true,
}],
"prefer-arrow-callback": ['error', {
"allowNamedFunctions": false,
"allowUnboundThis": true,

'prefer-arrow-callback': ['error', {
'allowNamedFunctions': false,
'allowUnboundThis': true,
}],

"arrow-spacing": ['error', { "before": true, "after": true }],
"object-shorthand": ['error', 'always', {"ignoreConstructors": false, "avoidQuotes": true,}],
'arrow-spacing': ['error', { 'before': true, 'after': true }],

'object-shorthand': ['error', 'always', {'ignoreConstructors': false, 'avoidQuotes': true,}],

"quote-props": ['error', 'as-needed', { "keywords": false, "unnecessary": true, "numbers": false }],
'quote-props': ['error', 'as-needed', { 'keywords': false, 'unnecessary': true, 'numbers': false }],
}
};
2 changes: 2 additions & 0 deletions docs/migrating_v2_to_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Migrating SDK v2 to SDK v3

## These instructions assume that you have downloaded the demo project from here: https://github.com/BookingBug/demo ##

We want to keep all projects created for one client inside one repository.

If you're migrating a bespoke 'studio' project, take [studio](https://github.com/BookingBug/demo/tree/master/src/studio) as an example.
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"ignore-loader": "~0.1.2",
"import-glob-loader": "~1.1.0",
"include-all": "~4.0.3",
"inject-sass-imports-loader": "^1.0.5",
"inquirer": "~3.2.1",
"ip": "~1.1.5",
"isparta": "~4.0.0",
Expand All @@ -92,6 +93,7 @@
"ng-cache-loader": "~0.0.26",
"node-sass": "~4.7.1",
"open-browser-webpack-plugin": "~0.0.5",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"path": "~0.12.7",
"postcss-loader": "~2.0.6",
"progress-bar-webpack-plugin": "~1.10.0",
Expand All @@ -106,6 +108,7 @@
"webpack-bundle-analyzer": "~2.9.1",
"webpack-dev-server": "~2.9.7",
"webpack-require-http": "~0.4.3",
"wrap-loader": "^0.2.0",
"yargs": "~10.0.3"
}
}
2 changes: 1 addition & 1 deletion src/public/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"uglify": true
},
"core": {
"google_maps_key": "AIzaSyDFAIV9IW8riXGAzlupPb9_6X14dxmUMt8",
"google_maps_key": "AIzaSyDqsstcumrpBVUW8t3yEM9-AeTK87zxuUI",
"analytics": {
"enable_piwik": false
},
Expand Down
12 changes: 0 additions & 12 deletions src/public/images/bb-logo.svg

This file was deleted.

19 changes: 12 additions & 7 deletions src/public/main.module.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
// Public booking dashboard module.
import bbPublicBookingModule from 'bookingbug-angular/src/public-booking/entry.module';

// Template overrides.
import './sdk-templates/**/*.html';

// Configuration.
import '../../tmp/config.constants';

//templates
// Injected variables need to be imported explicitly so that they can be watched.
import './stylesheets/_client-variables.scss';

// Additional templates.
import './templates/main-steps/main_appointment.html';

// fonts
// Additional fonts.
import './fonts/bb-icons.eot';
import './fonts/bb-icons.ttf';
import './fonts/bb-icons.woff';
import 'file-loader?name=fonts/[name].[ext]!./fonts/bb-icons.svg';

// images
import './images/bb-logo.svg';

// styles
// Styles.
import './main.scss';

// chosen angular translations
// Chosen angular translations.
import 'file-loader?name=angular-i18n/[name].[ext]!bookingbug-angular/node_modules/angular-i18n/angular-locale_en.js';
import 'file-loader?name=angular-i18n/[name].[ext]!bookingbug-angular/node_modules/angular-i18n/angular-locale_fr.js';

// Studio module bootstrap files.
import config from './main.config';
import run from './main.run';
import versionModule from './version/version.module';
Expand Down
1 change: 0 additions & 1 deletion src/public/main.run.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function moduleRun(bbConfig) {
'ngInject';

}

export default moduleRun;
Expand Down
25 changes: 4 additions & 21 deletions src/public/main.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
//bootstrap
@import "./stylesheets/bootstrap-variables";
@import "~bookingbug-angular/node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
@import "~bookingbug-angular/node_modules/bootstrap-sass/assets/stylesheets/bootstrap/mixins";
//bb
@import "./stylesheets/bb-variables";
@import '~bookingbug-angular/src/core/_stylesheets/project_version';
// Actual booking journey styles.
@import "~bookingbug-angular/src/public-booking/main";

#bb {
//bb
@import "~bookingbug-angular/src/public-booking/main";

margin: 0;
font-family: $font-family-base;
font-size: $font-size-base;
line-height: $line-height-base;
color: $text-color;
background-color: $body-bg;

//client
@import "./stylesheets/client_theme";
}
// Client theme for customization.
@import "./stylesheets/client_theme";
9 changes: 0 additions & 9 deletions src/public/stylesheets/_bb-variables.scss

This file was deleted.

Loading