From 6f12ff18c8bb0640ac0bbbfa09db855c6c3ba29f Mon Sep 17 00:00:00 2001 From: Cole Connelly <30357632+cdconn00@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:30:33 -0600 Subject: [PATCH] Release v1.2.0 (#31) --- controllers/EventController.js | 8 +-- controllers/FeedbackController.js | 4 +- models/TrainingMilestone.js | 6 ++- seeds/certifications.json | 82 +++++++++++++++++-------------- 4 files changed, 54 insertions(+), 46 deletions(-) diff --git a/controllers/EventController.js b/controllers/EventController.js index 8c37662..f593f1f 100644 --- a/controllers/EventController.js +++ b/controllers/EventController.js @@ -316,28 +316,28 @@ router.put('/:slug', getUser, auth(['atm', 'datm', 'ec']), upload.single('banner computedPositions.push({ pos, type: thePos[2], - code: 'zab', + code: 'enroute', }) } if(['APP', 'DEP'].includes(thePos[2])) { computedPositions.push({ pos, type: thePos[2], - code: (thePos[1] === "PHX") ? 'p50app' : 'app', + code: (thePos[1] === "PHX") ? 'p50' : 'app', }) } if(['TWR'].includes(thePos[2])) { computedPositions.push({ pos, type: thePos[2], - code: (thePos[1] === "PHX") ? 'p50twr' : 'twr', + code: (thePos[1] === "PHX") ? 'kphxtower' : 'twr', }) } if(['GND', 'DEL'].includes(thePos[2])) { computedPositions.push({ pos, type: thePos[2], - code: (thePos[1] === "PHX") ? 'p50gnd' : 'gnd', + code: (thePos[1] === "PHX") ? 'kphxground' : 'gnd', }) } } diff --git a/controllers/FeedbackController.js b/controllers/FeedbackController.js index bbdc16a..2eba6ed 100644 --- a/controllers/FeedbackController.js +++ b/controllers/FeedbackController.js @@ -6,7 +6,7 @@ import Notification from '../models/Notification.js'; import getUser from '../middleware/getUser.js'; import auth from '../middleware/auth.js'; -router.get('/', getUser, auth(['atm', 'datm', 'ta']), async (req, res) => { // All feedback +router.get('/', getUser, auth(['atm', 'datm', 'ta', 'ec']), async (req, res) => { // All feedback try { const page = +req.query.page || 1; const limit = +req.query.limit || 20; @@ -85,7 +85,7 @@ router.get('/controllers', async ({res}) => { // Controller list on feedback pag return res.json(res.stdRes); }); -router.get('/unapproved', getUser, auth(['atm', 'datm', 'ta']), async ({res}) => { // Get all unapproved feedback +router.get('/unapproved', getUser, auth(['atm', 'datm', 'ta', 'ec']), async ({res}) => { // Get all unapproved feedback try { const feedback = await Feedback.find({deletedAt: null, approved: false}).populate('controller', 'fname lname cid').sort({createdAt: 'desc'}).lean(); res.stdRes.data = feedback; diff --git a/models/TrainingMilestone.js b/models/TrainingMilestone.js index 4611414..dce8e29 100644 --- a/models/TrainingMilestone.js +++ b/models/TrainingMilestone.js @@ -3,8 +3,10 @@ import m from 'mongoose'; const trainingMilestoneSchema = new m.Schema({ code: String, name: String, - rating: Number, - certCode: String + rating: Number, // Legacy field, replaced by "availableAtRatings". + certCode: String, // Legacy field, replaced by "hiddenWhenControllerHasTierOne". + availableAtRatings: Array, + hiddenWhenControllerHasTierOne: Boolean }); export default m.model('TrainingMilestone', trainingMilestoneSchema, 'trainingMilestones'); \ No newline at end of file diff --git a/seeds/certifications.json b/seeds/certifications.json index d22c863..82e2fec 100644 --- a/seeds/certifications.json +++ b/seeds/certifications.json @@ -1,43 +1,49 @@ -[{ - "name": "Minor Ground", - "code": "gnd", +[ +{ + "name": "KPHX GND", + "code": "kphxground", + "order": 4, + "class": "tier-one" +}, +{ + "name": "KPHX TWR", + "code": "kphxtower", + "order": 3, + "class": "tier-one" +}, +{ + "name": "P50", + "code": "p50", + "order": 2, + "class": "tier-one" +}, +{ + "name": "Enroute", + "code": "enroute", + "order": 1, + "class": "tier-one" +}, +{ + "name": "KABQ", + "code": "kabq", "order": 1, - "class": "minor", - "facility": "gnd" -},{ - "name": "Major Ground", - "code": "p50gnd", + "class": "tier-two" +}, +{ + "name": "KFLG", + "code": "kflg", "order": 2, - "class": "major", - "facility": "gnd" -},{ - "name": "Minor Tower", - "code": "twr", + "class": "tier-two" +}, +{ + "name": "KLUF", + "code": "kluf", "order": 3, - "class": "minor", - "facility": "twr" -},{ - "name": "Major Tower", - "code": "p50twr", + "class": "tier-two" +}, +{ + "name": "KSAF", + "code": "ksaf", "order": 4, - "class": "major", - "facility": "twr" -},{ - "name": "Minor Approach", - "code": "app", - "order": 5, - "class": "minor", - "facility": "app" -},{ - "name": "Major Approach", - "code": "p50app", - "order": 6, - "class": "major", - "facility": "app" -},{ - "name": "Albuquerque Center", - "code": "zab", - "order": 7, - "class": "center", - "facility": "ctr" + "class": "tier-two" }] \ No newline at end of file