From cc33844ff7613b4c535c5a02272c1bbb87e4f807 Mon Sep 17 00:00:00 2001 From: Piotr Siatkowski Date: Mon, 13 Nov 2017 14:07:32 +0000 Subject: [PATCH 1/6] Progress. --- src/studio/main.scss | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/studio/main.scss b/src/studio/main.scss index ef11ef1..6803c2b 100644 --- a/src/studio/main.scss +++ b/src/studio/main.scss @@ -1,33 +1,19 @@ -//bootstrap +@import './stylesheets/font-awesome.scss'; + +// Overrides for bootstrap variables. @import "./stylesheets/bootstrap-variables"; -@import "~bootstrap-sass/assets/stylesheets/bootstrap"; -//bb + +// Overrides for core bookingbug variables. @import "./stylesheets/bb-variables"; -@import './stylesheets/font-awesome.scss'; -@import '~bookingbug-angular/src/core/_stylesheets/project_version'; -//bb admin lte + +// Overrides for Admin LTE variables. @import "./stylesheets/adminlte-variables"; -@import "~bookingbug-angular/src/admin-dashboard/_stylesheets/admin-lte/AdminLTE.scss"; #bb { - //bb - @import "~bookingbug-angular/src/core/main"; - @import "~bookingbug-angular/src/member/main"; - @import "~bookingbug-angular/src/public-booking/main"; - @import "~bookingbug-angular/src/admin-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; - a { - text-decoration: none; - } - //client + @import "~bookingbug-angular/src/admin-dashboard/main"; + + // Client theme for customization. @import "./stylesheets/client_theme"; -} -//bb -@import "~bookingbug-angular/src/admin-dashboard/main"; \ No newline at end of file +} From 75bdcee1aab3bb9258221c1297f72ad7fd3b10a9 Mon Sep 17 00:00:00 2001 From: Piotr Siatkowski Date: Tue, 21 Nov 2017 10:18:41 +0000 Subject: [PATCH 2/6] Fixing styles. --- src/public/images/bb-logo.svg | 12 ------------ src/public/main.module.js | 3 --- src/public/main.scss | 29 ++++++++++------------------- src/studio/images/bb-logo.svg | 12 ------------ src/studio/main.module.js | 3 --- src/studio/main.scss | 15 +++++++-------- src/studio/www/index.html | 10 +++------- 7 files changed, 20 insertions(+), 64 deletions(-) delete mode 100644 src/public/images/bb-logo.svg delete mode 100644 src/studio/images/bb-logo.svg diff --git a/src/public/images/bb-logo.svg b/src/public/images/bb-logo.svg deleted file mode 100644 index 0cc433a..0000000 --- a/src/public/images/bb-logo.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/public/main.module.js b/src/public/main.module.js index ba2759c..25737bb 100644 --- a/src/public/main.module.js +++ b/src/public/main.module.js @@ -13,9 +13,6 @@ 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 import './main.scss'; import './stylesheets/font-awesome.config'; // font awesome js settings diff --git a/src/public/main.scss b/src/public/main.scss index 30a1fe9..cb8ffd1 100644 --- a/src/public/main.scss +++ b/src/public/main.scss @@ -1,23 +1,14 @@ -//bootstrap -@import "./stylesheets/bootstrap-variables"; -@import "~bootstrap-sass/assets/stylesheets/bootstrap"; -@import "~bootstrap-sass/assets/stylesheets/bootstrap/mixins"; -//bb -@import "./stylesheets/bb-variables"; +// Font awesome overrides. @import './stylesheets/font-awesome.scss'; -@import '~bookingbug-angular/src/core/_stylesheets/project_version'; -#bb { - //bb - @import "~bookingbug-angular/src/public-booking/main"; +// Overrides for bootstrap variables. +@import "./stylesheets/bootstrap-variables"; + +// Overrides for core bookingbug variables. +@import "./stylesheets/bb-variables"; - margin: 0; - font-family: $font-family-base; - font-size: $font-size-base; - line-height: $line-height-base; - color: $text-color; - background-color: $body-bg; +// Actual booking journey styles. +@import "~bookingbug-angular/src/public-booking/main"; - //client - @import "./stylesheets/client_theme"; -} \ No newline at end of file +// Client theme for customization. +@import "./stylesheets/client_theme"; \ No newline at end of file diff --git a/src/studio/images/bb-logo.svg b/src/studio/images/bb-logo.svg deleted file mode 100644 index 0cc433a..0000000 --- a/src/studio/images/bb-logo.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/studio/main.module.js b/src/studio/main.module.js index 344b3d1..d64dd15 100644 --- a/src/studio/main.module.js +++ b/src/studio/main.module.js @@ -10,9 +10,6 @@ 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 import './main.scss'; import './stylesheets/font-awesome.config'; // font awesome js settings diff --git a/src/studio/main.scss b/src/studio/main.scss index 6803c2b..1798931 100644 --- a/src/studio/main.scss +++ b/src/studio/main.scss @@ -1,19 +1,18 @@ +// Font awesome overrides. @import './stylesheets/font-awesome.scss'; // Overrides for bootstrap variables. @import "./stylesheets/bootstrap-variables"; -// Overrides for core bookingbug variables. -@import "./stylesheets/bb-variables"; - // Overrides for Admin LTE variables. @import "./stylesheets/adminlte-variables"; -#bb { +// Overrides for core bookingbug variables. +@import "./stylesheets/bb-variables"; - @import "~bookingbug-angular/src/admin-dashboard/main"; +// Actual studio project. +@import "~bookingbug-angular/src/admin-dashboard/main"; - // Client theme for customization. - @import "./stylesheets/client_theme"; +// Client theme for customization. +@import "./stylesheets/client_theme"; -} diff --git a/src/studio/www/index.html b/src/studio/www/index.html index 4844607..72a91cf 100644 --- a/src/studio/www/index.html +++ b/src/studio/www/index.html @@ -1,5 +1,5 @@ - + BookingBug Dashboard @@ -12,15 +12,11 @@ - - -
- - - +
+ From cdf719b3ea1080f480fcfabc19c1bc37d8fb2bed Mon Sep 17 00:00:00 2001 From: Piotr Siatkowski Date: Fri, 24 Nov 2017 15:48:05 +0000 Subject: [PATCH 3/6] Progress. --- package.json | 1 + src/public/stylesheets/_client_theme.scss | 7 ------- .../font-awesome.config.js | 0 .../font-awesome.config.scss | 5 ++++- src/studio/main.module.js | 19 ++++++++++--------- src/studio/main.scss | 2 +- src/studio/stylesheets/_client_theme.scss | 7 ------- src/studio/stylesheets/font-awesome.scss | 2 +- 8 files changed, 17 insertions(+), 26 deletions(-) rename src/studio/{stylesheets => font-awesome}/font-awesome.config.js (100%) rename src/studio/{stylesheets => font-awesome}/font-awesome.config.scss (53%) diff --git a/package.json b/package.json index 8ef4007..0cb3261 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,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", diff --git a/src/public/stylesheets/_client_theme.scss b/src/public/stylesheets/_client_theme.scss index 51592a6..e69de29 100644 --- a/src/public/stylesheets/_client_theme.scss +++ b/src/public/stylesheets/_client_theme.scss @@ -1,7 +0,0 @@ -body{ - font-family: $font-family-base; - font-size: $font-size-base; - line-height: $line-height-base; - color: $text-color; - background-color: $body-bg; -} \ No newline at end of file diff --git a/src/studio/stylesheets/font-awesome.config.js b/src/studio/font-awesome/font-awesome.config.js similarity index 100% rename from src/studio/stylesheets/font-awesome.config.js rename to src/studio/font-awesome/font-awesome.config.js diff --git a/src/studio/stylesheets/font-awesome.config.scss b/src/studio/font-awesome/font-awesome.config.scss similarity index 53% rename from src/studio/stylesheets/font-awesome.config.scss rename to src/studio/font-awesome/font-awesome.config.scss index a2699ee..0a10b51 100644 --- a/src/studio/stylesheets/font-awesome.config.scss +++ b/src/studio/font-awesome/font-awesome.config.scss @@ -1 +1,4 @@ -//$fa-var-map-marker: "\f183"; // test: replace map icon with male icon \ No newline at end of file +//$fa-var-map-marker: "\f183"; // test: replace map icon with male icon + +//$fa-inverse: #eee; +//$fa-border-color: #ddd; \ No newline at end of file diff --git a/src/studio/main.module.js b/src/studio/main.module.js index f639076..378c1fb 100644 --- a/src/studio/main.module.js +++ b/src/studio/main.module.js @@ -1,31 +1,32 @@ -import bbAdminDashboardModule from 'bookingbug-angular/src/admin-dashboard/main.module'; +/*import bbAdminDashboardModule from 'bookingbug-angular/src/admin-dashboard/main.module'; import 'bookingbug-angular/src/admin-dashboard/globs_to_remove';//TODO remove once globs removed on sdk -import './sdk-templates/**/*.html'; +import './sdk-templates/!**!/!*.html'; import '../../tmp/config.constants'; // 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'; +import 'file-loader?name=fonts/[name].[ext]!./fonts/bb-icons.svg';*/ // styles -import './main.scss'; -//import './stylesheets/font-awesome.config'; // font awesome js settings - +// import './main.scss'; +// import './stylesheets/font-awesome.config'; // font awesome js settings +import 'font-awesome-loader!./font-awesome/font-awesome.config.js'; +/* // 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'; import config from './main.config'; import run from './main.run'; -import versionModule from './version/version.module'; +import versionModule from './version/version.module';*/ export default angular .module('studio', [ - bbAdminDashboardModule, - versionModule +/* bbAdminDashboardModule, + versionModule*/ ]) .config(config) .run(run) diff --git a/src/studio/main.scss b/src/studio/main.scss index 1798931..686e1a2 100644 --- a/src/studio/main.scss +++ b/src/studio/main.scss @@ -1,5 +1,5 @@ // Font awesome overrides. -@import './stylesheets/font-awesome.scss'; +// @import './stylesheets/font-awesome.scss'; // Overrides for bootstrap variables. @import "./stylesheets/bootstrap-variables"; diff --git a/src/studio/stylesheets/_client_theme.scss b/src/studio/stylesheets/_client_theme.scss index 51592a6..e69de29 100644 --- a/src/studio/stylesheets/_client_theme.scss +++ b/src/studio/stylesheets/_client_theme.scss @@ -1,7 +0,0 @@ -body{ - font-family: $font-family-base; - font-size: $font-size-base; - line-height: $line-height-base; - color: $text-color; - background-color: $body-bg; -} \ No newline at end of file diff --git a/src/studio/stylesheets/font-awesome.scss b/src/studio/stylesheets/font-awesome.scss index c9badbf..d094305 100644 --- a/src/studio/stylesheets/font-awesome.scss +++ b/src/studio/stylesheets/font-awesome.scss @@ -1,6 +1,6 @@ $fa-font-path: "fonts"; @import '~bookingbug-angular/node_modules/font-awesome/scss/variables'; -@import './font-awesome.config.scss'; // font awesome overrides +@import '../font-awesome/font-awesome.config'; // font awesome overrides @import '~bookingbug-angular/node_modules/font-awesome/scss/mixins'; @import '~bookingbug-angular/node_modules/font-awesome/scss/path'; @import '~bookingbug-angular/node_modules/font-awesome/scss/core'; From 31bd6ba410fbadce94a612245ad1d0eec969c0ed Mon Sep 17 00:00:00 2001 From: Piotr Siatkowski Date: Tue, 28 Nov 2017 17:11:25 +0000 Subject: [PATCH 4/6] Sorting out problem with fonts and font-awesome loader. --- package.json | 6 ++++-- src/studio/font-awesome/font-awesome.config.js | 17 +++++++++++++++++ .../font-awesome/font-awesome.config.scss | 2 ++ src/studio/main.module.js | 3 ++- src/studio/main.scss | 2 +- src/studio/stylesheets/font-awesome.config.js | 11 ----------- src/studio/stylesheets/font-awesome.config.scss | 1 - src/studio/stylesheets/font-awesome.scss | 15 --------------- 8 files changed, 26 insertions(+), 31 deletions(-) create mode 100644 src/studio/font-awesome/font-awesome.config.js create mode 100644 src/studio/font-awesome/font-awesome.config.scss delete mode 100644 src/studio/stylesheets/font-awesome.config.js delete mode 100644 src/studio/stylesheets/font-awesome.config.scss delete mode 100644 src/studio/stylesheets/font-awesome.scss diff --git a/package.json b/package.json index 8ef4007..8596529 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "s-prod": "gulp --root studio --env production" }, "dependencies": { - "bookingbug-angular": "3.3.1" + "bookingbug-angular": "3.3.1", + "loader-utils": "^1.1.0" }, "devDependencies": { "babel-core": "~6.26.0", @@ -38,11 +39,12 @@ "deep-rename-keys": "~0.2.1", "deepmerge": "~1.5.0", "del": "~3.0.0", + "eslint": "~4.11.0", "exports-loader": "~0.6.4", "extract-sass-variables-loader": "~0.0.4", "extract-text-webpack-plugin": "~3.0.0", "file-loader": "~1.1.5", - "font-awesome-loader": "~1.0.2", + "font-awesome-npm-loader": "^1.0.2", "fs": "~0.0.1-security", "fs-extra": "~4.0.2", "fs-finder": "~1.8.1", diff --git a/src/studio/font-awesome/font-awesome.config.js b/src/studio/font-awesome/font-awesome.config.js new file mode 100644 index 0000000..df939a6 --- /dev/null +++ b/src/studio/font-awesome/font-awesome.config.js @@ -0,0 +1,17 @@ +module.exports = { + styles: { + 'variables': true, + 'mixins': true, + 'path': true, + 'core': true, + 'larger': true, + 'fixed-width': true, + 'list': true, + 'bordered-pulled': true, + 'animated': true, + 'rotated-flipped': true, + 'stacked': true, + 'icons': true, + 'screen-reader': true + } +}; \ No newline at end of file diff --git a/src/studio/font-awesome/font-awesome.config.scss b/src/studio/font-awesome/font-awesome.config.scss new file mode 100644 index 0000000..ff30396 --- /dev/null +++ b/src/studio/font-awesome/font-awesome.config.scss @@ -0,0 +1,2 @@ +// Override font awesome variables here. +// $fa-font-path: 'fonts'; \ No newline at end of file diff --git a/src/studio/main.module.js b/src/studio/main.module.js index 21f318e..4ed427e 100644 --- a/src/studio/main.module.js +++ b/src/studio/main.module.js @@ -15,7 +15,8 @@ import './images/bb-logo.svg'; // styles import './main.scss'; -//import './stylesheets/font-awesome.config'; // font awesome js settings + +import './font-awesome/font-awesome.config'; // chosen angular translations import 'file-loader?name=angular-i18n/[name].[ext]!bookingbug-angular/node_modules/angular-i18n/angular-locale_en.js'; diff --git a/src/studio/main.scss b/src/studio/main.scss index 268b602..12fbb66 100644 --- a/src/studio/main.scss +++ b/src/studio/main.scss @@ -1,9 +1,9 @@ + //bootstrap @import "./stylesheets/bootstrap-variables"; @import "~bookingbug-angular/node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; //bb @import "./stylesheets/bb-variables"; -@import './stylesheets/font-awesome.scss'; @import '~bookingbug-angular/src/core/_stylesheets/project_version'; //bb admin lte @import "./stylesheets/adminlte-variables"; diff --git a/src/studio/stylesheets/font-awesome.config.js b/src/studio/stylesheets/font-awesome.config.js deleted file mode 100644 index f65ff22..0000000 --- a/src/studio/stylesheets/font-awesome.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - styles: { - 'mixins': true, - - 'core': true, - 'icons': true, - - 'larger': true, - 'path': true, - } -}; diff --git a/src/studio/stylesheets/font-awesome.config.scss b/src/studio/stylesheets/font-awesome.config.scss deleted file mode 100644 index a2699ee..0000000 --- a/src/studio/stylesheets/font-awesome.config.scss +++ /dev/null @@ -1 +0,0 @@ -//$fa-var-map-marker: "\f183"; // test: replace map icon with male icon \ No newline at end of file diff --git a/src/studio/stylesheets/font-awesome.scss b/src/studio/stylesheets/font-awesome.scss deleted file mode 100644 index c9badbf..0000000 --- a/src/studio/stylesheets/font-awesome.scss +++ /dev/null @@ -1,15 +0,0 @@ -$fa-font-path: "fonts"; -@import '~bookingbug-angular/node_modules/font-awesome/scss/variables'; -@import './font-awesome.config.scss'; // font awesome overrides -@import '~bookingbug-angular/node_modules/font-awesome/scss/mixins'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/path'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/core'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/larger'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/fixed-width'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/list'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/bordered-pulled'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/animated'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/rotated-flipped'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/stacked'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/icons'; -@import '~bookingbug-angular/node_modules/font-awesome/scss/screen-reader'; \ No newline at end of file From 679b1c5133a9b8f55b377e5409b3a65bb56e02d2 Mon Sep 17 00:00:00 2001 From: Piotr Siatkowski Date: Wed, 31 Jan 2018 09:48:29 +0000 Subject: [PATCH 5/6] Progress. --- .eslintrc.js | 169 +++++++++++++----- docs/local_sdk_vs_released_sdk.md | 4 +- docs/migrating_v2_to_v3.md | 6 +- package.json | 9 +- src/public/main.module.js | 3 + src/public/main.run.js | 1 - src/public/stylesheets/_client-variables.scss | 7 + .../stylesheets/variables/_bb-variables.scss | 1 - .../variables/_bootstrap-variables.scss | 3 - src/studio/main.module.js | 4 +- src/studio/stylesheets/_client-variables.scss | 24 +++ .../variables/_adminlte-variables.scss | 9 - .../stylesheets/variables/_bb-variables.scss | 1 - .../variables/_bootstrap-variables.scss | 9 - 14 files changed, 169 insertions(+), 81 deletions(-) create mode 100644 src/public/stylesheets/_client-variables.scss delete mode 100644 src/public/stylesheets/variables/_bb-variables.scss delete mode 100644 src/public/stylesheets/variables/_bootstrap-variables.scss create mode 100644 src/studio/stylesheets/_client-variables.scss delete mode 100644 src/studio/stylesheets/variables/_adminlte-variables.scss delete mode 100644 src/studio/stylesheets/variables/_bb-variables.scss delete mode 100644 src/studio/stylesheets/variables/_bootstrap-variables.scss diff --git a/.eslintrc.js b/.eslintrc.js index 4a70929..e82baea 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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 }], } }; diff --git a/docs/local_sdk_vs_released_sdk.md b/docs/local_sdk_vs_released_sdk.md index c2ee922..f76b20a 100644 --- a/docs/local_sdk_vs_released_sdk.md +++ b/docs/local_sdk_vs_released_sdk.md @@ -4,12 +4,12 @@ ### ```npm run i``` Install released version of SDK -1) removes node_modules, yarn.lock +1) removes node_modules 2) install all dependencies listed in package.json file ### ```npm run il``` Install local version of SDK -1) removes node_modules, yarn.lock +1) removes node_modules 2) prepares new version of package.json inside .tmp directory 3) modifies ./tmp/package.json so bookingbug-angular dependency points to your local repository (BB_SDK_SRC_DIR) 4) install ./tmp/package.json diff --git a/docs/migrating_v2_to_v3.md b/docs/migrating_v2_to_v3.md index 556c7da..8a23ee0 100755 --- a/docs/migrating_v2_to_v3.md +++ b/docs/migrating_v2_to_v3.md @@ -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. @@ -67,8 +69,8 @@ For the purpose of this example migration, let's assume we're migrating an exist 9) If your project loads angular translations by configuring 'release.copy' section in PROJECT_ROOT/bower.json file, then replace with the following imports on top of PROJECT_ROOT/src/studio/main.module.js file: ```javascript - import 'file-loader?name=angular-i18n/[name].[ext]!angular-i18n/angular-locale_en.js'; - import 'file-loader?name=angular-i18n/[name].[ext]!angular-i18n/angular-locale_fr.js'; + 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'; ``` 10) Move any 3rd party public dependencies from PROJECT_ROOT/bower.json into PROJECT_ROOT/package.json. diff --git a/package.json b/package.json index f0f4caa..05eccf4 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "babel-loader": "~7.1.1", "babel-plugin-transform-async-to-generator": "~6.24.1", "babel-plugin-transform-es2015-classes": "~6.24.1", + "babel-plugin-transform-object-rest-spread": "~6.26.0", "babel-preset-env": "~1.6.0", "babel-preset-es2015": "~6.24.1", "babel-preset-es2016": "~6.24.1", @@ -39,6 +40,7 @@ "deepmerge": "~1.5.0", "del": "~3.0.0", "eslint": "~4.11.0", + "eslint-plugin-angular": "~3.1.1", "exports-loader": "~0.6.4", "extract-sass-variables-loader": "~0.0.4", "extract-text-webpack-plugin": "~3.0.0", @@ -101,13 +103,12 @@ "resolve-url-loader": "~2.2.0", "run-sequence": "~2.1.0", "sass-loader": "~6.0.6", - "sass-resources-loader": "^1.3.1", "style-loader": "~0.19.0", - "uglifyjs-webpack-plugin": "~1.1.2", + "uglifyjs-webpack-plugin": "~1.1.4", "url-loader": "~0.6.2", - "webpack": "~3.9.1", + "webpack": "~3.10.0", "webpack-bundle-analyzer": "~2.9.1", - "webpack-dev-server": "~2.9.5", + "webpack-dev-server": "~2.9.7", "webpack-require-http": "~0.4.3", "wrap-loader": "^0.2.0", "yargs": "~10.0.3" diff --git a/src/public/main.module.js b/src/public/main.module.js index 43d9166..d516926 100644 --- a/src/public/main.module.js +++ b/src/public/main.module.js @@ -8,6 +8,9 @@ import './sdk-templates/**/*.html'; // Configuration. import '../../tmp/config.constants'; +// 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'; diff --git a/src/public/main.run.js b/src/public/main.run.js index a07a3cc..de7de63 100644 --- a/src/public/main.run.js +++ b/src/public/main.run.js @@ -1,6 +1,5 @@ function moduleRun(bbConfig) { 'ngInject'; - } export default moduleRun; diff --git a/src/public/stylesheets/_client-variables.scss b/src/public/stylesheets/_client-variables.scss new file mode 100644 index 0000000..3fcc91b --- /dev/null +++ b/src/public/stylesheets/_client-variables.scss @@ -0,0 +1,7 @@ +/* + * All variables are shared. If some variables are defined twice, the first definition takes precedence. + */ + +// Override bookingbug, bootstrap or other variables here. +$bootstrap-sass-asset-helper: true; +$icon-font-path: if($bootstrap-sass-asset-helper, "~bootstrap-sass/assets/fonts/bootstrap/", "/fonts/"); \ No newline at end of file diff --git a/src/public/stylesheets/variables/_bb-variables.scss b/src/public/stylesheets/variables/_bb-variables.scss deleted file mode 100644 index 52f5519..0000000 --- a/src/public/stylesheets/variables/_bb-variables.scss +++ /dev/null @@ -1 +0,0 @@ -// Override bookingbug variables here. \ No newline at end of file diff --git a/src/public/stylesheets/variables/_bootstrap-variables.scss b/src/public/stylesheets/variables/_bootstrap-variables.scss deleted file mode 100644 index 5387000..0000000 --- a/src/public/stylesheets/variables/_bootstrap-variables.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Override bootstrap variables here. -$bootstrap-sass-asset-helper: true; -$icon-font-path: if($bootstrap-sass-asset-helper, "~bootstrap-sass/assets/fonts/bootstrap/", "/fonts/"); diff --git a/src/studio/main.module.js b/src/studio/main.module.js index 1a04d0d..b421477 100644 --- a/src/studio/main.module.js +++ b/src/studio/main.module.js @@ -5,8 +5,8 @@ import 'bookingbug-angular/src/admin-dashboard/globs_to_remove'; // TODO remove // Template overrides. import './sdk-templates/**/*.html'; -// Injected variables need to be imported to be watched. -import './stylesheets/variables/_bootstrap-variables.scss'; +// Injected variables need to be imported explicitly so that they can be watched. +import './stylesheets/_client-variables.scss'; // Configuration. import '../../tmp/config.constants'; diff --git a/src/studio/stylesheets/_client-variables.scss b/src/studio/stylesheets/_client-variables.scss new file mode 100644 index 0000000..74d407a --- /dev/null +++ b/src/studio/stylesheets/_client-variables.scss @@ -0,0 +1,24 @@ +/* + * All variables are shared. If some variables are defined twice, the first definition takes precedence. + */ + +// Override admin-lte variables here. +$boxed-layout-bg-image-path : "../images/bg-gray.png"; +$sidebar-light-bg : #f8f8f8; +$sidebar-light-hover-bg : lighten(#f0f0f1, 2%); +$sidebar-light-color : #444; +$sidebar-light-hover-color : #000; +$sidebar-light-submenu-bg : $sidebar-light-hover-bg; +$sidebar-light-submenu-color : #777; +$sidebar-light-submenu-hover-color : #000; + + +// Override bootstrap variables here. +$brand-primary : #8cc96c; +$brand-success : #0cc0e1; +$brand-info : #087f94; +$link-color : $brand-primary; +$input-color : #555; +$font-family-sans-serif : 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; +$bootstrap-sass-asset-helper : true; +$icon-font-path: if($bootstrap-sass-asset-helper, "~bootstrap-sass/assets/fonts/bootstrap/", "/fonts/"); \ No newline at end of file diff --git a/src/studio/stylesheets/variables/_adminlte-variables.scss b/src/studio/stylesheets/variables/_adminlte-variables.scss deleted file mode 100644 index 962db79..0000000 --- a/src/studio/stylesheets/variables/_adminlte-variables.scss +++ /dev/null @@ -1,9 +0,0 @@ -// Override admin-lte variables here. -$boxed-layout-bg-image-path : "../images/bg-gray.png"; -$sidebar-light-bg : #f8f8f8; -$sidebar-light-hover-bg : lighten(#f0f0f1, 2%); -$sidebar-light-color : #444; -$sidebar-light-hover-color : #000; -$sidebar-light-submenu-bg : $sidebar-light-hover-bg; -$sidebar-light-submenu-color : #777; -$sidebar-light-submenu-hover-color : #000; diff --git a/src/studio/stylesheets/variables/_bb-variables.scss b/src/studio/stylesheets/variables/_bb-variables.scss deleted file mode 100644 index 52f5519..0000000 --- a/src/studio/stylesheets/variables/_bb-variables.scss +++ /dev/null @@ -1 +0,0 @@ -// Override bookingbug variables here. \ No newline at end of file diff --git a/src/studio/stylesheets/variables/_bootstrap-variables.scss b/src/studio/stylesheets/variables/_bootstrap-variables.scss deleted file mode 100644 index b73b35a..0000000 --- a/src/studio/stylesheets/variables/_bootstrap-variables.scss +++ /dev/null @@ -1,9 +0,0 @@ -// Override bootstrap variables here. -$brand-primary : #8cc96c; -$brand-success : #0cc0e1; -$brand-info : #087f94; -$link-color : $brand-primary; -$input-color : #555; -$font-family-sans-serif : 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; -$bootstrap-sass-asset-helper: true; -$icon-font-path: if($bootstrap-sass-asset-helper, "~bootstrap-sass/assets/fonts/bootstrap/", "/fonts/"); \ No newline at end of file From 10bdb2f6d4ae7746133bb9c07e92104f6d2f8674 Mon Sep 17 00:00:00 2001 From: Piotr Siatkowski Date: Wed, 31 Jan 2018 10:10:31 +0000 Subject: [PATCH 6/6] Progress. --- src/public/config.json | 2 +- src/studio/config.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/public/config.json b/src/public/config.json index e483c10..55a3982 100644 --- a/src/public/config.json +++ b/src/public/config.json @@ -11,7 +11,7 @@ "uglify": true }, "core": { - "google_maps_key": "AIzaSyDFAIV9IW8riXGAzlupPb9_6X14dxmUMt8", + "google_maps_key": "AIzaSyDqsstcumrpBVUW8t3yEM9-AeTK87zxuUI", "analytics": { "enable_piwik": false }, diff --git a/src/studio/config.json b/src/studio/config.json index 20911e7..ad589a5 100644 --- a/src/studio/config.json +++ b/src/studio/config.json @@ -11,7 +11,7 @@ "uglify": true }, "core": { - "google_maps_key": "AIzaSyDFAIV9IW8riXGAzlupPb9_6X14dxmUMt8", + "google_maps_key": "AIzaSyDqsstcumrpBVUW8t3yEM9-AeTK87zxuUI", "analytics": { "enable_piwik": false },