Skip to content

Commit

Permalink
Fix class interface bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sonsoleslp committed Nov 13, 2020
1 parent 906f4f0 commit 8416d74
Show file tree
Hide file tree
Showing 9 changed files with 7,274 additions and 32 deletions.
15 changes: 8 additions & 7 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ const methodOverride = require("method-override");
const dotenv = require("dotenv");
const i18n = require("i18n-express");
const cors = require("cors");
const compression = require('compression');
//const helmet = require('helmet');
const compression = require("compression");
// Const helmet = require('helmet');

dotenv.config();
const api = require("./routes/api");
const index = require("./routes/index"),

app = express();// View engine setup
//to compress all routes
app.use(compression());
//security headers, commented because it fails with CSP
//TODO, study options and configure accordingly
//app.use(helmet());
// To compress all routes

app.use(compression());
// Security headers, commented because it fails with CSP
// TODO, study options and configure accordingly
// App.use(helmet());


app.set("views", path.join(__dirname, "views"));
Expand Down
40 changes: 20 additions & 20 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
module.exports = {
apps : [{
name: "ESCAPP",
script: 'bin/www',
watch: false,
instances: 1,
env: {
"NODE_ENV": "production",
"apps": [
{
"name": "ESCAPP",
"script": "bin/www",
"watch": false,
"instances": 1,
"env": {"NODE_ENV": "production"}
}
],
"deploy": {
"production": {
"user": "SSH_USERNAME",
"host": "SSH_HOSTMACHINE",
"ref": "origin/master",
"repo": "GIT_REPOSITORY",
"path": "DESTINATION_PATH",
"pre-deploy-local": "",
"post-deploy": "npm install && pm2 reload ecosystem.config.js --env production",
"pre-setup": ""
}
}
}],
deploy : {
production : {
user : 'SSH_USERNAME',
host : 'SSH_HOSTMACHINE',
ref : 'origin/master',
repo : 'GIT_REPOSITORY',
path : 'DESTINATION_PATH',
'pre-deploy-local': '',
'post-deploy' : 'npm install && pm2 reload ecosystem.config.js --env production',
'pre-setup': ''
}
}
};
5 changes: 5 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,11 @@
"activateTurnosBC": "Manage shifts",
"resetProgress": "Reset this shift",
"status": "Status",
"statuses": {
"active": "Active",
"finished": "Finished",
"pending": "Pending"
},
"noTurnAvailable": "No turn available for this ER",
"theres": "There is",
"thereare": "There are",
Expand Down
5 changes: 5 additions & 0 deletions i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,11 @@
"areYouSureStart": "¿Seguro que deseas comenzar este turno?",
"activateTurnosBC": "Administrar turnos",
"status": "Estado",
"statuses": {
"active": "Activo",
"finished": "Finalizado",
"pending": "Pendiente"
},
"fullTurno": "El turno seleccionado está lleno. Elige otro.",
"notActive": "Esta escape room no está activa para tu usuario",
"selectActivate": "Selecciona el turno que quieres activar/desactivar",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@sendgrid/mail": "^6.4.0",
"body-parser": "^1.19.0",
"cloudinary": "^1.22.0",
"connect-session-sequelize": "^6.0.0",
"compression": "^1.7.4",
"connect-session-sequelize": "^6.0.0",
"cookie-parser": "^1.4.3",
"cors": "^2.8.5",
"debug": "~2.6.9",
Expand Down
4 changes: 2 additions & 2 deletions public/js/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ const onHintResponse = async ({code, hintOrder: hintOrderPlus, puzzleOrder: puzz

};

const onInitialInfo = ({code, erState}) => {
if (code && code === "NOK") {
const onInitialInfo = ({code, erState, participation}) => {
if (participation != "AUTHOR" && (code && code === "NOK")) {
window.location = `/escapeRooms/${escapeRoomId}/`;
}

Expand Down
2 changes: 1 addition & 1 deletion queries/escapeRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ exports.ids = (ids) => {
"include": [
{
"model": models.turno,
"attributes": ["id","date","status", "capacity", "from", "to"],
"attributes": ["id", "date", "status", "capacity", "from", "to"],
"required": true,
"include": [
{
Expand Down
2 changes: 1 addition & 1 deletion views/turnos/_indexActivate.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div class="flex-cell flex-turno">
<%= turno.date ? getFullDate(turno.date): i18n.turno.alwaysOpen%> <%if(turno.place){%>(<%= turno.place %>)<%}%>
</div>
<div class="flex-cell flex-status"><b><%=turno.status.toUpperCase()%></b></div>
<div class="flex-cell flex-status"><b><%=i18n.turno.statuses[turno.status]%></b></div>
<div class="flex-cell flex-links">
<a href="/escapeRooms/<%=escapeRoom.id%>/analytics?turnId=<%=turno.id%>">
Expand Down
Loading

0 comments on commit 8416d74

Please sign in to comment.