diff --git a/.jshintrc b/.jshintrc index 81f6d84..2cd5bbb 100644 --- a/.jshintrc +++ b/.jshintrc @@ -12,17 +12,16 @@ "undef": true, // Require all non-global variables be declared before they are used. "unused": false, // Warn unused variables. "strict": false, // Don' require `use strict` pragma in every file. - "globals": { // Globals variables. + "globals": { "angular": true, "io": true, "ApplicationConfiguration": true, - "_": true + "_": true, + "domtoimage": true, + "inject": true, + "by": true, + "browser": true, + "element": true }, - "predef": [ // Extra globals. - "inject", - "by", - "browser", - "element" - ], "devel": true // Allow development statements e.g. `console.log();` } diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..521a9f7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true diff --git a/.travis.yml b/.travis.yml index 92ca12a..768339d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,19 @@ language: node_js sudo: required node_js: -- "8" -- "10" + - "8" + - "10" + - "12" env: -- NODE_ENV=travis + - NODE_ENV=travis services: -- mongodb + - mongodb before_install: -- gem update --system -- gem install sass --version "=3.3.7" -- npm i nsp -g + - gem update --system + - gem install sass --version "=3.3.7" + - npm i nsp -g after_script: -- nsp audit-package + - nsp audit-package notifications: webhooks: urls: diff --git a/LICENSE.md b/LICENSE.md index 988dbd5..365bc6d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2017-2018 Andriy Ermolenko +Copyright (c) 2017-2020 Andrii Yermolenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/bower.json b/bower.json index 1708b6a..3c38cf6 100644 --- a/bower.json +++ b/bower.json @@ -12,7 +12,9 @@ "angular-file-upload": "1.1.5", "angular-messages": "~1.3.17", "owasp-password-strength-test": "~1.3.0", - "lodash": "^4.17.4" + "lodash": "^4.17.4", + "file-saver": "^2.0.2", + "dom-to-image": "^2.6.0" }, "resolutions": { "angular": "~1.3" diff --git a/config/assets/default.js b/config/assets/default.js index 9995baf..bc0d2e1 100644 --- a/config/assets/default.js +++ b/config/assets/default.js @@ -18,6 +18,8 @@ module.exports = { 'public/lib/angular-file-upload/angular-file-upload.min.js', 'public/lib/owasp-password-strength-test/owasp-password-strength-test.js', 'public/lib/lodash/dist/lodash.min.js', + 'public/lib/dom-to-image/dist/dom-to-image.min.js', + 'public/lib/file-saver/dist/FileSaver.min.js' ], tests: ['public/lib/angular-mocks/angular-mocks.js'] }, diff --git a/config/env/default.js b/config/env/default.js index 28e2bd4..8a3f1a1 100644 --- a/config/env/default.js +++ b/config/env/default.js @@ -22,7 +22,7 @@ module.exports = { // sessionSecret should be changed for security measures and concerns sessionSecret: process.env.SESSION_SECRET || 'MEAN', // sessionKey is set to the generic sessionId key used by PHP applications - // for obsecurity reasons + // for security reasons sessionKey: 'sessionId', sessionCollection: 'sessions', logo: 'modules/core/client/img/brand/logo.png', @@ -31,7 +31,7 @@ module.exports = { profileUpload: { dest: './modules/users/client/img/profile/uploads/', // Profile upload destination path limits: { - fileSize: 1*1024*1024 // Max file size in bytes (1 MB) + fileSize: 1024*1024 // Max file size in bytes (1 MB) } } } diff --git a/config/env/development.js b/config/env/development.js index 903c5eb..cf35541 100644 --- a/config/env/development.js +++ b/config/env/development.js @@ -7,7 +7,8 @@ module.exports = { user: '', pass: '', useNewUrlParser: true, - useCreateIndex: true + useCreateIndex: true, + useUnifiedTopology: true }, // Enable mongoose debug mode debug: process.env.MONGODB_DEBUG || false @@ -75,11 +76,11 @@ module.exports = { } } }, - livereload: true, + livereload: false, seedDB: { - seed: process.env.MONGO_SEED === 'true' ? true : false, + seed: process.env.MONGO_SEED === 'true', options: { - logResults: process.env.MONGO_SEED_LOG_RESULTS === 'false' ? false : true, + logResults: process.env.MONGO_SEED_LOG_RESULTS !== 'false', seedUser: { username: process.env.MONGO_SEED_USER_USERNAME || 'user', provider: 'local', diff --git a/config/env/production.js b/config/env/production.js index 0618581..573b85e 100644 --- a/config/env/production.js +++ b/config/env/production.js @@ -10,7 +10,9 @@ module.exports = { options: { // user: '', // pass: '', - useNewUrlParser: true + useNewUrlParser: true, + useCreateIndex: true, + useUnifiedTopology: true }, // Enable mongoose debug mode debug: process.env.MONGODB_DEBUG || false diff --git a/config/lib/express.js b/config/lib/express.js index 63e2dfd..7b07fd8 100644 --- a/config/lib/express.js +++ b/config/lib/express.js @@ -15,6 +15,7 @@ const consolidate = require('consolidate'); const config = require('../config'); const logger = require('./logger'); +const { version } = require('../../package'); /** * Initialize local variables @@ -34,6 +35,7 @@ module.exports.initLocalVariables = (app) => { app.locals.livereload = config.livereload; app.locals.logo = config.logo; app.locals.favicon = config.favicon; + app.locals.version = version; // Passing the request url to environment locals app.use((req, res, next) => { @@ -146,7 +148,7 @@ module.exports.initHelmetHeaders = (app) => { app.use(helmet.ieNoOpen()); app.use(helmet.hsts({ maxAge: SIX_MONTHS, - includeSubdomains: true, + includeSubDomains: true, force: true })); app.disable('x-powered-by'); diff --git a/modules/core/client/controllers/header.client.controller.js b/modules/core/client/controllers/header.client.controller.js index 9613e34..ad95427 100644 --- a/modules/core/client/controllers/header.client.controller.js +++ b/modules/core/client/controllers/header.client.controller.js @@ -1,7 +1,7 @@ 'use strict'; -angular.module('core').controller('HeaderController', ['$scope', '$state', 'Authentication', 'Menus', 't','$http', - function ($scope, $state, Authentication, Menus, t, $http) { +angular.module('core').controller('HeaderController', ['$scope', '$state', 'Authentication', 'Menus', 't', + function ($scope, $state, Authentication, Menus, t) { $scope.t = t; // Expose view variables $scope.$state = $state; @@ -16,10 +16,6 @@ angular.module('core').controller('HeaderController', ['$scope', '$state', 'Auth $scope.isCollapsed = !$scope.isCollapsed; }; - $http.get('/version').success(function (data) { - $scope.version = data.version; - }); - // Collapsing the menu after navigation $scope.$on('$stateChangeSuccess', function () { $scope.isCollapsed = false; diff --git a/modules/core/client/css/core.css b/modules/core/client/css/core.css index be5846a..591946d 100644 --- a/modules/core/client/css/core.css +++ b/modules/core/client/css/core.css @@ -1,6 +1,11 @@ .content { margin-top: 50px; } + +.content-footer { + min-height: calc(100vh - 67px); +} + .undecorated-link:hover { text-decoration: none; } @@ -69,3 +74,27 @@ a:hover .header-profile-image { .hero-widget var { display: block; height: 64px; font-size: 64px; line-height: 64px; font-style: normal; } .hero-widget label { font-size: 17px; } .hero-widget .options { margin-top: 10px; } + +.footer { + height: 17px; + text-align: center; +} + +.footer-version { + color: #333; + font-weight: bold; + font-size: 12px; + font-family: Calibri; +} + +.item-payed { + background: yellow; +} + +.item-send { + background: lightgreen; +} + +.item-left { + background: #ff9700; +} diff --git a/modules/core/client/services/translate.client.service.js b/modules/core/client/services/translate.client.service.js index 62b14a6..da54fdf 100644 --- a/modules/core/client/services/translate.client.service.js +++ b/modules/core/client/services/translate.client.service.js @@ -30,6 +30,10 @@ angular.module('core').factory('t', [function () { ORDER_STATUS_READY: 'Готові', ORDER_STATUS_TOGO: 'Можна збирати', ORDER_STATUS_DONE: 'Зібрані', + ORDER_STATUS_SENT: 'Відправлено', + ORDER_STATUS_CARE: 'Зберігання', + ORDER_STATUS_SELF: 'Самовивіз', + ORDER_STATUS_OUT: 'Роздача', CLIENT_NEW: 'Додати клієнта', CLIENT_EDIT: 'Редагувати клыэнта', OK: 'Так', @@ -37,6 +41,7 @@ angular.module('core').factory('t', [function () { CONFIRM: 'Підтвердження', REMOVE_ORDER_CONF: 'Видалити дане замовлення?', PAY_ORDER_CONF: 'Оплатити дане замовлення?', + SEND_ORDER_CONF: 'Відправити дане замовлення?', EDIT_ORDER_NUM: 'Редагувати замовлення #', NEW_ORDER: 'Нове замовлення', EDIT_MANUALLY: 'Ввести вручну', @@ -116,6 +121,10 @@ angular.module('core').factory('t', [function () { EDIT_CLIENT: 'Редагувати клієнта', PLACE_DELIVER_DEFAULT: 'Місце отримання за замовчуванням', TOTAL_ORDERS_TO_SHOW: 'Показано замовлень', - ACTIVE: 'Активний' + ACTIVE: 'Активний', + BAR: 'IRIS', + VOLUME: 'Об\'єм, мл', + COMMENTS: 'Коментарі', + GOOD_OLD_TYPES: 'Залишок' }; }]); diff --git a/modules/core/client/views/confirm.client.view.html b/modules/core/client/views/confirm.client.view.html index 99af783..903fb49 100644 --- a/modules/core/client/views/confirm.client.view.html +++ b/modules/core/client/views/confirm.client.view.html @@ -1,5 +1,5 @@