diff --git a/.gitignore b/.gitignore index 06bdbc870..265ff97dc 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,5 @@ configmap.yml.secret .tool-versions .env .vscode + +package-lock.json diff --git a/.travis.yml b/.travis.yml index 94427ccce..784873c79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: xenial +dist: bionic language: node_js node_js: - 12 @@ -6,6 +6,7 @@ node_js: services: - docker - redis + - xvfb env: - TESTFOLDER=test/serverTest.js @@ -15,10 +16,7 @@ env: - TESTFOLDER=test/sessionEventAndCoC.js addons: - sauce_connect: - username: princu7 - jwt: - secure: FslueGK2gtPHkRANMpUlGyCGsr1jTVuaKpP+SvYUxBYh5zbz73GMq+VsqlE29IZ1ER1+xMfWuCCvg3VA7HePyN6hzoZ/t0LADureYVPur6R5ZJgqgQpBinjpytIjo2BhN3NqaNWaIJZTLDSAT76R7HuNm016jbuOEjO5foYWuz2F82B03viHmk42CRNl3eqXEMcwkkLfEkvu9iupeVAArPXepA2YCpaaFbV2D5ahTelzMROnc2YQ/HyAdaaLtto8L0CDmZSrFsPZtTGQKarFdOgKWeor2iD1AiYLHYdcbvXV5YbBVvi7tFJG8r5h0YBUu1JIkhvzWIi698GJRGwDCONStCaKVhrMvpL7C8fEpbzullxFSpWOVupTEjn+u0OGaxrugwSZ1dtSkbIu+2SlVR/QuXS8o6OMiDz7lrFhIc+hF6EvFRWI7UIjt9NPte1o3COA8WESaseCWKhLY0g/hgpRSM7pyfKx2NAj4UCXyPATTKRJNlEHcs/jMpgxu+RSjPYphK4rrWxm6O6bJxd+jNwQNBOmJ1lQgOPAxpA7SvRDpN5Et+L61tWttR1EEO1+sj0g/iGO+zrZfD8m+jxNnIGWih/ykSzggiaJ42VFbQcJFk5BCfxlty6c0p8DvJkdulcRkboU21nQx9irqWmSeedcA3VJX2r0womx3tZYnbY= + chrome: stable apt: sources: - ubuntu-toolchain-r-test diff --git a/README.md b/README.md index 85459b4ff..76a8c2b8f 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ # Open Event Website Generator ![Open Event webapp](./docs/images/wsgen_branding.png) -[![Build Status](https://travis-ci.org/fossasia/open-event-wsgen.svg?branch=development)](https://travis-ci.org/fossasia/open-event-wsgen?branch=development) -[![Heroku](https://heroku-badge.herokuapp.com/?app=opev-webgen-dev)](http://opev-webgen-dev.herokuapp.com) +[![Build Status](https://travis-ci.com/fossasia/open-event-wsgen.svg?branch=development)](https://travis-ci.com/fossasia/open-event-wsgen) +[![Heroku](https://heroku-badge.herokuapp.com/?app=open-event-wsgen-dev)](http://open-event-wsgen-dev.herokuapp.com) [![Dependencies](https://david-dm.org/fossasia/open-event-wsgen.svg)](https://david-dm.org/fossasia/open-event-wsgen) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/c5b7e2ca3e4640c9b38e2f3274072583)](https://www.codacy.com/app/dev_19/open-event-wsgen?utm_source=github.com&utm_medium=referral&utm_content=fossasia/open-event-wsgen&utm_campaign=Badge_Grade) -[![Code Climate](https://api.codeclimate.com/v1/badges/44552f8cc1b5ba1c760d/maintainability.svg)](https://codeclimate.com/github/fossasia/open-event-webapp) +[![Maintainability](https://api.codeclimate.com/v1/badges/6498f490127101665851/maintainability)](https://codeclimate.com/github/fossasia/open-event-wsgen/maintainability) [![codecov](https://codecov.io/gh/fossasia/open-event-wsgen/branch/development/graph/badge.svg)](https://codecov.io/gh/fossasia/open-event-wsgen) -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fossasia/open-event-wsgen?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com) +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fossasia/open-event-wsgen?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Mailing](https://img.shields.io/badge/Mailing-List-red.svg)](https://groups.google.com/forum/#!forum/open-event) +[![Twitter Follow](https://img.shields.io/twitter/follow/eventyay.svg?style=social&label=Follow&maxAge=2592000?style=flat-square)](https://twitter.com/eventyay) + The **Open Event Website Generator App** project has **TWO** components : - **An event website generator** @@ -140,9 +143,9 @@ The HTML pages of the generated website are created using Handelbars templates. ### Web App Generator Test Installation -* You can try out the web generator at https://opev-webgen.herokuapp.com +* You can try out the web generator at https://open-event-wsgen.herokuapp.com -* The `development-version` is available here: https://opev-webgen-dev.herokuapp.com +* The `development-version` is available here: https://open-event-wsgen-dev.herokuapp.com * You can use one of the event sample zip files here: https://github.com/fossasia/open-event/tree/master/sample diff --git a/config.json b/config.json index 0e6d9e40a..7e4ab912b 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "PORT": 5000, + "PORT": 3000, "DEFAULT_MAIL_STRATEGY": "Sendgrid", "DEFAULT_FROM_EMAIL": "info@eventyay.com", "SMTP_HOST": "mail.smtp2go.com", diff --git a/docs/INSTALLATION_LOCAL.md b/docs/INSTALLATION_LOCAL.md index 70d07ea32..4e8abc4b5 100644 --- a/docs/INSTALLATION_LOCAL.md +++ b/docs/INSTALLATION_LOCAL.md @@ -36,7 +36,7 @@ or npm run server.generator ``` -The app will be running on http://localhost:5000 +The app will be running on http://localhost:3000 Note : If you are running the app behind a proxy, set the proxy option in config.json to `http://username:password@proxy_url:proxy_port`, and make sure it is url encoded. diff --git a/package.json b/package.json index 9e44628e6..e589d3c19 100644 --- a/package.json +++ b/package.json @@ -24,55 +24,57 @@ }, "homepage": "https://github.com/fossasia/open-event-webapp#readme", "dependencies": { - "archiver": "^3.1.1", + "@babel/core": "^7.0.0", + "@babel/preset-env": "^7.12.1", + "@octokit/rest": "^14.0.0", + "archiver": "^5.0.2", "async": "^3.2.0", "aws-sdk": "^2.639.0", - "babel-preset-es2015": "^6.24.0", - "bee-queue": "^1.2.2", + "bee-queue": "^1.3.0", "bluebird": "^3.4.7", "body-parser": "^1.15.2", "chai": "^4.0.1", "compression": "^1.6.2", "connect-domain": "^0.5.0", - "cookie-parser": "^1.4.4", + "cookie-parser": "^1.4.5", "decompress-zip": "^0.3.0", - "del": "^5.1.0", + "del": "^6.0.0", "dotenv": "^8.2.0", "express": "^4.13.4", - "express-session": "^1.15.0", - "folder-hash": "^3.3.0", + "express-session": "^1.17.1", + "folder-hash": "^4.0.0", "fs": "0.0.2", - "fs-extra": "^3.0.1", - "ftp-deploy": "^2.3.6", - "github": "^9.2.0", + "fs-extra": "^9.0.1", + "ftp-deploy": "^2.3.7", "gulp": "^4.0.2", - "gulp-babel": "^6.1.2", + "gulp-babel": "^8.0.0", "gulp-concat": "^2.6.1", "gulp-htmlmin": "^5.0.1", "gulp-iife": "^0.4.0", "gulp-minify-css": "^1.2.4", "gulp-uglify": "^3.0.0", - "handlebars": "^4.0.5", + "handlebars": "^4.7.6", "html-minifier": "^4.0.0", "jsonapi-serializer": "^3.5.3", - "jsonfile": "^6.0.1", - "moment": "^2.13.0", - "node-sass": "^4.5.3", + "jsonfile": "^6.1.0", + "moment": "^2.27.0", + "node-sass": "^4.14.0", "node-uuid": "^1.4.7", - "nodemailer": "^6.4.5", + "nodemailer": "^6.4.15", "nodemailer-smtp-transport": "^2.7.2", - "npm": "^6.14.2", + "npm": "^6.14.7", "passport": "^0.4.1", "passport-github": "^1.1.0", "path": "^0.12.7", "progress-stream": "^2.0.0", + "promise-ftp-common": "^1.1.5", "raven": "^2.6.4", "recursive-readdir": "^2.1.0", "redis": "^3.0.2", "request": "^2.74.0", "selenium-webdriver": "^3.4.0", "sendgrid": "^5.1.1", - "sharp": "^0.25.1", + "sharp": "^0.26.2", "socket.io": "^2.0.2", "socket.io-stream": "^0.9.1", "socketio-file-upload": "^0.7.0", @@ -80,7 +82,7 @@ "url-join": "^4.0.1" }, "devDependencies": { - "eslint": "^6.8.0", + "eslint": "^7.13.0", "husky": "^0.14.3" } } diff --git a/src/backend/_scss/application.scss b/src/backend/_scss/application.scss index 563a9245f..04d7c1169 100644 --- a/src/backend/_scss/application.scss +++ b/src/backend/_scss/application.scss @@ -1079,7 +1079,6 @@ a { } margin-right: 10px; - display: inline-block; vertical-align: text-top; } @@ -1396,8 +1395,9 @@ a { } .speaker-description { + padding-top: 20px; text-align: center; - width: 50%; + width: 100%; } } } @@ -2469,3 +2469,14 @@ a.skip:hover { display: none; } } + +.date-list-search-filter { + + label { + display: inline; + + .fa { + margin-top: 13px; + } + } +} diff --git a/src/backend/deploy.js b/src/backend/deploy.js index 54958f166..1ce60c2f5 100644 --- a/src/backend/deploy.js +++ b/src/backend/deploy.js @@ -3,7 +3,7 @@ const distHelper = require('./dist.js'); const fs = require('fs'); -const Github = require('github'); +const Github = require('@octokit/rest'); const gh = new Github(); const async = require('async'); let results, bitmap, i, file, fullPath, eventName, repoName, total, counter, elem, fileName, sha; diff --git a/src/backend/dist.js b/src/backend/dist.js index 80124633e..f09e682ae 100644 --- a/src/backend/dist.js +++ b/src/backend/dist.js @@ -146,7 +146,7 @@ const extensionChange = function(image) { }; const optimizeBackground = function(image, socket, done) { - if (image !== null) { + if (image) { sharp(image) .resize({ width: 1150, @@ -480,7 +480,7 @@ module.exports = { }); unzipper.extract({ - path: appPath + '/zip' + path: 'dist/' + appFolder + '/zip' }); unzipper.on('extract', function(log) { @@ -499,7 +499,7 @@ module.exports = { const fPath = appPath + '/zip/' + file; function check(error) { - if (error !== null) { + if (error) { logger.addLog('Error', 'Error while copying folder', socket, error); cb(err); } else { @@ -538,7 +538,7 @@ module.exports = { default: cb(null); } }, function(error) { - if (error !== null) { + if (error) { return done(error); } @@ -581,7 +581,7 @@ module.exports = { // duplicate folder found logger.addLog('Info', 'Removing the duplicate folder', socket); fs.remove(removeFolder, function(error) { - if (error !== null) { + if (error) { logger.addLog('Error', 'Error occured during deletion of the duplicate folder', socket, error); return done(error); } diff --git a/src/backend/fold_v2.js b/src/backend/fold_v2.js index e90d256cb..155e2e577 100644 --- a/src/backend/fold_v2.js +++ b/src/backend/fold_v2.js @@ -440,7 +440,7 @@ function returnAttendees(attendeesData) { } function createSocialLinks(event) { - const sociallinks = Array.from(event['social-links']); + const sociallinks = Array.from(event['social-links']).filter(Boolean); sociallinks.forEach((link) => { link.show = true; @@ -488,7 +488,7 @@ function createSocialLinks(event) { } function extractEventUrls(event, speakers, sponsors, reqOpts, next) { - const sociallinks = Array.from(event['social-links']); + const sociallinks = Array.from(event['social-links']).filter(Boolean); let sociallink = ''; let featuresection = 0; let sponsorsection = 0; diff --git a/src/backend/generator.js b/src/backend/generator.js index 4ec96d06c..9dc6e7af4 100644 --- a/src/backend/generator.js +++ b/src/backend/generator.js @@ -252,7 +252,7 @@ exports.createDistDir = function(req, socket, callback) { socket.emit('live.process', {donePercent: 5, status: 'Cleaning temporary folder'}); } fs.remove(distHelper.distPath + '/' + appFolder, (err) => { - if (err !== null) { + if (err) { logger.addLog('Error', 'Failed to clean up the previously existing temporary folders', socket, err); callback(null); console.log(err); @@ -279,7 +279,7 @@ exports.createDistDir = function(req, socket, callback) { distHelper.copyAssets(appFolder, (copyerr) => { console.log('================================COPYING\n'); - if (copyerr !== null) { + if (copyerr) { console.log(copyerr); logger.addLog('Error', 'Error occured while copying assets into the appFolder', socket, copyerr); callback(null); @@ -296,7 +296,7 @@ exports.createDistDir = function(req, socket, callback) { logger.addLog('Info', 'Cleaning dependencies folder created as a part of copying assets inside the appFolder', socket); distHelper.removeDependency(appFolder, socket, (copyerr) => { console.log('============================Moving contents from dependency folder and deleting the dependency folder'); - if (copyerr !== null) { + if (copyerr) { logger.addLog('Error', 'Error while reading directory', socket, copyerr); callback(null); console.log(copyerr); @@ -331,7 +331,7 @@ exports.createDistDir = function(req, socket, callback) { console.log('================================FETCHING JSONS\n'); logger.addLog('Info', 'Fetching Jsons from the internet', socket); distHelper.fetchApiJsons(appFolder, req.body.apiendpoint, req.body.apiVersion, socket, (err) => { - if (err !== null) { + if (err) { console.log(err); callback(null); return done(err); @@ -359,7 +359,7 @@ exports.createDistDir = function(req, socket, callback) { if (!err) { logger.addLog('Success', 'SASS file compiled successfully', socket); fs.writeFile(distHelper.distPath + '/' + appFolder + '/css/schedule.css', result.css, (writeErr) => { - if (writeErr !== null) { + if (writeErr) { logger.addLog('Error', 'Error in writing css file', socket, writeErr); console.log(writeErr); return socket.emit('live.error', {status: 'Error in Writing css file'}); @@ -407,7 +407,7 @@ exports.createDistDir = function(req, socket, callback) { } logger.addLog('Info', 'Compiling the html pages from the templates', socket); - const jsonData = data; + const jsonData = data; eventName = fold.removeSpace(jsonData.eventurls.name); const backPath = distHelper.distPath + '/' + appFolder + '/' + jsonData.eventurls.background_path; const basePath = distHelper.distPath + '/' + appFolder + '/images'; @@ -554,7 +554,7 @@ exports.createDistDir = function(req, socket, callback) { } distHelper.removeDuplicateEventFolders(eventName, req.body.email, socket, (remerr) => { - if (remerr !== null) { + if (remerr) { logger.addLog('Error', 'Error occured while removing the duplicate event folders', socket, remerr); callback(null); console.log(remerr); @@ -578,7 +578,7 @@ exports.createDistDir = function(req, socket, callback) { const eventFolderSource = __dirname + '/../../dist/'; fs.move(eventFolderSource + appFolder, eventFolderSource + req.body.email + '/' + eventName, (moveerr) => { - if (moveerr !== null) { + if (moveerr) { logger.addLog('Error', 'Error in moving files to the event folders', socket, moveerr); callback(null); console.log(moveerr); diff --git a/src/backend/gulpfile.js b/src/backend/gulpfile.js index 35d73bdad..8637df289 100644 --- a/src/backend/gulpfile.js +++ b/src/backend/gulpfile.js @@ -19,7 +19,7 @@ exports.minifyJs = function(path, cb) { return gulp.src(src.map(file => dir + file)) .pipe(iife({useStrict: false})) .pipe(concat(dist + '.min.js')) - .pipe(babel({presets: ['es2015']})) + .pipe(babel({presets: ['@babel/preset-env']})) .pipe(uglify().on('error', function(e) { console.log(`Error while compiling ${dist}.js` + e); })) @@ -42,7 +42,7 @@ exports.minifyJs = function(path, cb) { function tracksJs() { return minifyPipeline('tracks', ['social.js', 'scroll.js', 'navbar.js', 'jquery.lazyload.js']); } - + function eventJs() { return minifyPipeline('event', ['map.js', 'scroll.js', 'navbar.js', 'popover.js', 'loklak-fetcher.js', 'tweets.js', 'jquery.lazyload.js']); } diff --git a/src/backend/templates/rooms.hbs b/src/backend/templates/rooms.hbs index 212f6ba5c..0ac9c340a 100644 --- a/src/backend/templates/rooms.hbs +++ b/src/backend/templates/rooms.hbs @@ -109,7 +109,7 @@ -
@@ -322,7 +322,7 @@ {{#if title}}