diff --git a/api/src/migrations/002_create_sample_data.sql b/api/src/migrations/002_create_sample_data.sql index 39a1c81..c1da6b5 100644 --- a/api/src/migrations/002_create_sample_data.sql +++ b/api/src/migrations/002_create_sample_data.sql @@ -11,15 +11,13 @@ INSERT INTO doom_user (first_name, last_name, email, privacy_settings, password_ INSERT INTO doom_user (first_name, last_name, email, privacy_settings, password_hash) VALUES ('Thor','Odinson','thundergod@asgard.ca', 'Private','$2b$12$rF.modokh7SuBpRHdg/xA.KN/zYvx0HmaxasTXmzWIiWcLPlhfWH2'); INSERT INTO doom_user (first_name, last_name, email, privacy_settings, password_hash) VALUES ('Loki','Laufeyson','mischief@jotunheim.ca', 'Private','$2b$12$rF.modokh7SuBpRHdg/xA.KN/zYvx0HmaxasTXmzWIiWcLPlhfWH2'); - -- 3 events insert into Event (creator_id, name, start_time, end_time, capacity_type, max_capacity, current_capacity, website, location_link) values (3,'CUSEC',TIMESTAMP '2019-10-23 8:30:00+02', TIMESTAMP '2019-11-27 10:30:00+02', 'FCFS_E',6,0,'http://2018.cusec.net/','https://goo.gl/maps/w38KNq2BNLB2'); INSERT INTO Event (creator_id, name, start_time, end_time, capacity_type, max_capacity) VALUES (2,'Animefest',TIMESTAMP '2019-10-21 12:30:00+02', TIMESTAMP '2019-11-29 10:30:00+02', 'FCFS_P',3); -INSERT INTO Event (creator_id, name, start_time, end_time, capacity_type) VALUES (1,'Doomsday convention',TIMESTAMP '2018-10-30 1:00:00', TIMESTAMP '2018-11-02 10:30:00', 'FFA'); +INSERT INTO Event (creator_id, name, start_time, end_time, capacity_type) VALUES (1,'Doomsday convention',TIMESTAMP '2018-09-04 1:00:00', TIMESTAMP '2018-12-13 10:30:00', 'FFA'); INSERT INTO Event (creator_id, name, start_time, end_time, capacity_type,max_capacity) VALUES (6,'Avenger Meetup',TIMESTAMP '2019-05-03 10:30:00', TIMESTAMP '2019-11-24 10:30:00', 'FCFS_E',5); INSERT INTO Event (creator_id, name, start_time, end_time, capacity_type,max_capacity) VALUES (5,'Wizarding War',TIMESTAMP '2018-11-03 10:30:00', TIMESTAMP '2019-12-24 10:30:00', 'FCFS_P',10); - insert into Event_Organizer (user_id, event_id) values (3,1); insert into Event_Organizer (user_id, event_id) values (2,2); insert into Event_Organizer (user_id, event_id) values (1,3); @@ -30,8 +28,7 @@ insert into Event_Organizer (user_id, event_id) values (3,4); insert into Event_Organizer (user_id, event_id) values (5,5); - -INSERT INTO Seminar (event_id, name, start_time, end_time, capacity_type) VALUES (3,'Preparing for your doom',TIMESTAMP '2019-10-20 10:30:00+02', TIMESTAMP '2019-11-20 12:30:00+02', 'FFA'); +INSERT INTO Seminar (event_id, name, start_time, end_time, capacity_type) VALUES (3,'Preparing for your doom',TIMESTAMP '2018-09-10 10:30:00+02', TIMESTAMP '2018-10-22 12:30:00+02', 'FFA'); INSERT INTO Seminar (event_id, name, start_time, end_time, capacity_type, max_capacity) VALUES (2,'How to Weeb',TIMESTAMP '2019-10-22 12:30:00+02', TIMESTAMP '2019-11-22 13:30:00+02', 'FCFS_E',2); INSERT INTO Seminar (event_id, name, start_time, end_time, capacity_type, max_capacity) VALUES (1,'Hackathon',TIMESTAMP '2019-10-24 8:30:00+02', TIMESTAMP '2019-11-24 10:30:00+02', 'FCFS_P',6); INSERT INTO Seminar (event_id, name, start_time, end_time, capacity_type, max_capacity) VALUES (3,'Alpha Demo',TIMESTAMP '2018-10-31 14:50:00', TIMESTAMP '2018-10-31 15:00:00', 'FCFS_P',5); @@ -64,7 +61,7 @@ INSERT INTO Event_Participation (user_id, event_id, attending) VALUES (9,4,True) INSERT INTO Event_Participation (user_id, event_id, following) VALUES (10,4,True); -- Adding users to seminars -INSERT INTO Seminar_Participation (user_id, seminar_id, attending) VALUES (2,2,True); +INSERT INTO Seminar_Participation (user_id, seminar_id, attending) VALUES (1,2,True); INSERT INTO Seminar_Participation (user_id, seminar_id, following) VALUES (3,2,True); INSERT INTO Seminar_Participation (user_id, seminar_id, attending) VALUES (5,2,True); @@ -79,14 +76,12 @@ INSERT INTO Seminar_Participation (user_id, seminar_id, attending) VALUES (5,5,T INSERT INTO Seminar_Wait_list (user_id, seminar_id,date_added) VALUES (3,2, TIMESTAMP '2019-10-23 8:30:00+02'); INSERT INTO Event_Wait_list (user_id, event_id,date_added) VALUES (10,2, TIMESTAMP '2019-10-29 8:30:00+02'); - -- 2 Annoucements INSERT INTO Event_Announcement (event_id, message, date_created, date_modified) VALUES (3,'The end is nigh, remember your wallet',TIMESTAMP '2018-10-31 8:30:00', TIMESTAMP '2018-10-31 19:00:00'); INSERT INTO Event_Announcement (event_id, message, date_created, date_modified) VALUES (3,'Remember your doom',TIMESTAMP '2018-10-31 8:30:00', TIMESTAMP '2018-11-01 8:45:00'); INSERT INTO Seminar_Announcement (seminar_id, message, date_created, date_modified) VALUES (4,'Bug Fixing Party',TIMESTAMP '2018-10-31 8:30:00', TIMESTAMP '2018-10-13 8:30:00'); INSERT INTO Seminar_Announcement (seminar_id, message, date_created, date_modified) VALUES (3,'Reminder to participants to bring laptops',TIMESTAMP '2018-10-23 8:30:00+02', TIMESTAMP '2018-10-23 8:30:00+02'); - -- One user following INSERT INTO User_Following (user_id, following_user_id) VALUES (4,1); @@ -95,8 +90,6 @@ DO $do$ BEGIN FOR i IN 1..5 LOOP - - UPDATE "event" SET current_capacity =subquery.count FROM @@ -112,9 +105,6 @@ BEGIN FROM seminar_participation WHERE seminar_id = i AND attending = true) AS subquery WHERE seminar.id=i; - - - END LOOP; END $do$; diff --git a/api/src/mutations/event.js b/api/src/mutations/event.js index 24d297a..97e19f4 100644 --- a/api/src/mutations/event.js +++ b/api/src/mutations/event.js @@ -1,5 +1,5 @@ const { db } = require("../db"); -const { queryEventByID } = require("../resolvers/event"); +const { queryEventByID, getEventByID } = require("../resolvers/event"); const { querySeminarsByEventID } = require("../resolvers/seminar"); const { alreadyAttendingEvent } = require("../resolvers/user"); const { @@ -102,6 +102,165 @@ async function insertNewEvent(eventInput) { }; } +/* +NOTE: Remember she'll always give me the whole object +*/ +async function updateEvent(eventid, event) { + let { + name, + description, + location, + picture_path, + website, + location_link, + start_time, + end_time, + capacity_type, + max_capacity, + organizer_ids + } = event; + + let simpleEvent = { + name, + description, + location, + picture_path, + website, + location_link + }; + + if (Object.keys(simpleEvent).length === 0) return; + + let queryString = `UPDATE event SET`; + let first = 1; + const vals = []; + // Adding basic properties of simpleEvent to queryString + for (var key in simpleEvent) { + if (simpleEvent[key] !== null && simpleEvent[key] !== undefined) { + if (!first) queryString = `${queryString}, `; + first = 0; + queryString = `${queryString} ${key} = ?`; + vals.push(simpleEvent[key]); + } + } + originalEvent = await getEventByID(eventid); + + // Validating the event start time with its end time + const event_start_time = new Date(start_time); + const event_end_time = new Date(end_time); + + if (event_start_time > event_end_time) { + console.log("Invalid Start Time: Event cannot start after Event ends"); + return new Error( + "Unable to create a Event: Invalid Start Time: Event cannot start after Event ends" + ); + } + // Validating the event start time/end time with its seminar's start/end + earliestStart = null; + latestEnd = null; + firstSem = null; + lastSem = null; + originalEvent["seminars"].forEach(seminar => { + if ( + earliestStart == null || + Date.parse(seminar.start_time) < earliestStart + ) { + earliestStart = seminar.start_time; + firstSem = seminar.name; + } + if (latestEnd == null || Date.parse(seminar.end_time) > latestEnd) { + latestEnd = seminar.end_time; + lastSem = seminar.name; + } + }); + + if (!earliestStart || !latestEnd) { + console.log("Life is a scam"); + } else if (event_start_time > Date.parse(earliestStart)) { + return new Error( + "Invalid Event start date: First Seminar: ", + firstSem, + " starts at ", + earliestStart, + ", event must start prior" + ); + } else if (event_end_time < Date.parse(latestEnd)) { + return new Error( + "Invalid Event end date: Last Seminar: " + + lastSem + + " ends at " + + latestEnd + + "+ event must end after" + ); + } + if (max_capacity && max_capacity < originalEvent["current_capacity"]) { + return new Error("Max Capacity cannot be less than Current Capacity"); + } + queryString = `${queryString}, start_time = '${event_start_time.toISOString()}'`; + queryString = `${queryString}, end_time = '${event_end_time.toISOString()}'`; + queryString = `${queryString}, capacity_type = '${capacity_type}'`; + + if (capacity_type == "FFA") { + max_capacity = null; + queryString = `${queryString}, max_capacity = ${max_capacity}`; + } else { + queryString = `${queryString}, max_capacity = '${max_capacity}'`; + } + queryString = `${queryString} WHERE id = ? RETURNING *;`; + vals.push(eventid); + await db.raw(queryString, vals); + + // Check if there are people on the waitlist and updates accordingly + if ( + max_capacity == null || + (max_capacity > originalEvent["max_capacity"] && + originalEvent["max_capacity"] == originalEvent["current_capacity"]) + ) { + var top = await getWaitlistTop(eventid); + var newCapacity = await updateCurrentCapacity(eventid); + while ( + (top && max_capacity == null) || + (top && newCapacity < max_capacity) + ) { + if (top) { + await updateEventWaitlist(top, eventid, false); + await updateEventParticipation({ + userid: top, + participationType: "ATTENDING", + eventid: eventid + }); + } + top = await getWaitlistTop(eventid); + newCapacity = await updateCurrentCapacity(eventid); + } + } + await updateCurrentCapacity(eventid); + + var oldOrganizerIDs = []; + originalEvent["organizers"].forEach(organizer => { + oldOrganizerIDs.push(organizer.id); + }); + + // NOTE: revise this method to make use of set operations + // Simplest sol'n atm was remove all organizers then add them all back + // Cannot remove creator of event + for (var i = 0; i < oldOrganizerIDs.length; i++) { + const queryString = `delete from event_organizer where user_id = ? and event_id = ?; `; + if (originalEvent["creator_id"] != oldOrganizerIDs[i]) { + await db.raw(`${queryString}`, [oldOrganizerIDs[i], eventid]); + } + } + + for (var i = 0; i < organizer_ids.length; i++) { + const queryString = `INSERT INTO Event_Organizer + (user_id,event_id) VALUES (?, ?); `; + if (originalEvent["creator_id"] != organizer_ids[i]) { + await db.raw(`${queryString}`, [organizer_ids[i], eventid]); + } + } + return; +} + async function updateCurrentCapacity(eventid) { // Will recalculate and update the table's current capacity var queryString = `UPDATE "event" @@ -118,7 +277,6 @@ async function updateCurrentCapacity(eventid) { async function getWaitlistTop(eventid) { // Returns the id of the user who's at the top of the waitlist given an eventid var queryString = null; - var userid = null; queryString = `SELECT user_id FROM event_wait_list WHERE event_id=? ORDER BY date_added LIMIT 1;`; vals = [eventid]; const res = await db.raw(`${queryString}`, vals); @@ -245,5 +403,6 @@ async function updateEventParticipation( module.exports = { insertNewEvent, updateEventParticipation, - updateEventWaitlist + updateEventWaitlist, + updateEvent }; diff --git a/api/src/mutations/index.js b/api/src/mutations/index.js index bf59b69..8bf2c1e 100644 --- a/api/src/mutations/index.js +++ b/api/src/mutations/index.js @@ -1,12 +1,14 @@ const { insertNewEvent, updateEventParticipation, - updateEventWaitlist + updateEventWaitlist, + updateEvent } = require("./event"); const { insertNewSeminar, updateSeminarParticipation, - updateSeminarWaitlist + updateSeminarWaitlist, + updateSeminar } = require("./seminar"); const { registerUser, @@ -14,6 +16,8 @@ const { updateUserFollowing } = require("./user"); const { insertNewAnnouncement } = require("./announcement"); +const { getEventByID } = require("../resolvers/event"); +const { getSeminarByID } = require("../resolvers/seminar"); const mutations = { Mutation: { @@ -151,6 +155,28 @@ const mutations = { return new Error("Unable to update user profile"); } }, + async editEvent(_, args) { + const { eventID, event } = args; + try { + errors = await updateEvent(eventID, event); + if (errors) return errors; + return await getEventByID(eventID); + } catch (err) { + console.log(err); + return new Error("Unable to update event"); + } + }, + async editSeminar(_, args) { + const { seminarID, seminar } = args; + try { + errors = await updateSeminar(seminarID, seminar); + if (errors) return errors; + return await getSeminarByID(seminarID); + } catch (err) { + console.log(err); + return new Error("Unable to update seminar"); + } + }, async followUser(_, args) { try { const { userID, followingID } = args; diff --git a/api/src/mutations/seminar.js b/api/src/mutations/seminar.js index 3887113..4596d7b 100644 --- a/api/src/mutations/seminar.js +++ b/api/src/mutations/seminar.js @@ -1,6 +1,6 @@ const { db } = require("../db"); const { queryEventByID } = require("../resolvers/event"); -const { querySeminarByID } = require("../resolvers/seminar"); +const { querySeminarByID, getSeminarByID } = require("../resolvers/seminar"); const { queryOrganizerByTypeID } = require("../resolvers/searchResults"); const { isAttendingEvent, @@ -130,6 +130,157 @@ async function insertNewSeminar(seminarInput) { }; } +/* User is not allowed to change eventid */ +async function updateSeminar(seminarid, seminar) { + let { + name, + description, + location, + picture_path, + website, + location_link, + start_time, + end_time, + capacity_type, + max_capacity, + organizer_ids + } = seminar; + + let simpleSeminar = { + name, + description, + location, + picture_path, + website, + location_link + }; + + if (Object.keys(simpleSeminar).length === 0) return; + + let queryString = `UPDATE seminar SET`; + let first = 1; + const vals = []; + + // Adding basic properties of simpleSeminar to queryString + for (var key in simpleSeminar) { + if (simpleSeminar[key] !== null && simpleSeminar[key] !== undefined) { + if (!first) queryString = `${queryString}, `; + first = 0; + queryString = `${queryString} ${key} = ?`; + vals.push(simpleSeminar[key]); + } + } + + originalSeminar = await getSeminarByID(seminarid); + const parentEvent = await queryEventByID(originalSeminar.event_id); + + // Validating time + const sem_start_time = new Date(start_time); + const sem_end_time = new Date(end_time); + if (sem_start_time > sem_end_time) { + console.log("Invalid Start Time: Seminar cannot start after Seminar ends"); + return new Error( + "Unable to create a Seminar: Invalid Start Time: Seminar cannot start after Seminar ends" + ); + } + if (sem_start_time < parentEvent.start_time) { + console.log("Invalid Start Time: Seminar cannot start before Event starts"); + return new Error( + "Unable to create a Seminar: Invalid Start Time: Seminar cannot start before Event starts" + ); + } + if (sem_start_time > parentEvent.end_time) { + console.log("Invalid Start Time: Seminar cannot start after Event ends"); + return new Error( + "Unable to create a Seminar: Invalid Start Time: Seminar cannot start after Event ends" + ); + } + if (sem_end_time > parentEvent.end_time) { + console.log("Invalid End Time: Seminar cannot end after Event ends"); + return new Error( + "Unable to create a Seminar: Invalid End Time: Seminar cannot end after Event ends" + ); + } + + if (max_capacity < originalSeminar["current_capacity"]) { + return new Error("Max Capacity cannot be less than Current Capacity"); + } + + // adding the more complex parts of the query post validation + queryString = `${queryString}, start_time = '${sem_start_time.toISOString()}'`; + queryString = `${queryString}, end_time = '${sem_end_time.toISOString()}'`; + queryString = `${queryString}, capacity_type = '${capacity_type}'`; + if (capacity_type == "FFA") { + max_capacity = null; + queryString = `${queryString}, max_capacity = ${max_capacity}`; + } else { + queryString = `${queryString}, max_capacity = '${max_capacity}'`; + } + queryString = `${queryString} WHERE id = ? RETURNING *;`; + vals.push(seminarid); + await db.raw(queryString, vals); + + // Check if there are people on the waitlist and updates accordingly + if ( + max_capacity == null || + (max_capacity > originalSeminar["max_capacity"] && + originalSeminar["max_capacity"] == originalSeminar["current_capacity"]) + ) { + var top = await getWaitlistTop(seminarid); + var newCapacity = await updateCurrentCapacity(seminarid); + while ( + (top && max_capacity == null) || + (top && newCapacity < max_capacity) + ) { + if (top) { + await updateSeminarWaitlist(top, seminarid, false); + await updateSeminarParticipation({ + userid: top, + participationType: "ATTENDING", + seminarid: seminarid + }); + } + top = await getWaitlistTop(seminarid); + newCapacity = await updateCurrentCapacity(seminarid); + } + } + await updateCurrentCapacity(seminarid); + + /* + NOTE: revise this method to make use of set operations + Simplest sol'n atm was remove all organizers then add them all back + */ + //retrieving old organizers + var oldOrganizerIDs = []; + originalSeminar["organizers"].forEach(organizer => { + oldOrganizerIDs.push(organizer.id); + }); + + for (var i = 0; i < oldOrganizerIDs.length; i++) { + const queryString = `delete from seminar_organizer where user_id = ? and seminar_id = ?; `; + if (originalSeminar["creator_id"] != oldOrganizerIDs[i]) { + await db.raw(`${queryString}`, [oldOrganizerIDs[i], seminarid]); + } + } + + // adding organizers from the event + const organizers = await queryOrganizerByTypeID(originalSeminar.event_id); + organizers.forEach(user => { + organizer_ids.push(user.id); + }); + organizer_ids = new Set(organizer_ids); + organizer_ids = Array.from(organizer_ids); + + // inserting organizers into the table + for (var i = 0; i < organizer_ids.length; i++) { + const queryString = `INSERT INTO seminar_Organizer + (user_id, seminar_id) VALUES (?, ?); `; + await db.raw(`${queryString}`, [organizer_ids[i], seminarid]); + } + + return; +} + async function updateCurrentCapacity(seminarid) { // Will recalculate and update the table's current capacity var queryString = `UPDATE "seminar" @@ -251,5 +402,6 @@ async function updateSeminarParticipation( module.exports = { insertNewSeminar, updateSeminarParticipation, - updateSeminarWaitlist + updateSeminarWaitlist, + updateSeminar }; diff --git a/api/src/resolvers/event.js b/api/src/resolvers/event.js index c6ce84e..3a2bfc8 100644 --- a/api/src/resolvers/event.js +++ b/api/src/resolvers/event.js @@ -1,5 +1,7 @@ const { db } = require("../db"); - +const { querySeminarsByEventID } = require("./seminar"); +const { queryAnnouncementByTypeID } = require("./announcement"); +const { queryOrganizerByTypeID } = require("./searchResults"); async function queryEventByID(id) { return await db .raw("select * from Event where id = ?;", [id]) @@ -12,4 +14,17 @@ async function queryEventByID(id) { }); } -module.exports = { queryEventByID }; +async function getEventByID(id) { + try { + const newEvent = await queryEventByID(id); + newEvent.announcements = await queryAnnouncementByTypeID(id, "Event"); + newEvent.organizers = await queryOrganizerByTypeID(id, "Event"); + newEvent.seminars = await querySeminarsByEventID(id); + return newEvent; + } catch (err) { + console.log(err); + return new Error("Unable to retrieve event"); + } +} + +module.exports = { queryEventByID, getEventByID }; diff --git a/api/src/resolvers/seminar.js b/api/src/resolvers/seminar.js index 740e543..eb99c77 100644 --- a/api/src/resolvers/seminar.js +++ b/api/src/resolvers/seminar.js @@ -1,4 +1,6 @@ const { db } = require("../db"); +const { queryAnnouncementByTypeID } = require("./announcement"); +const { queryOrganizerByTypeID } = require("./searchResults"); async function querySeminarByID(id) { return await db @@ -43,4 +45,16 @@ async function querySeminarsByEventID(id, offset = null, limit = null) { }); } -module.exports = { querySeminarByID, querySeminarsByEventID }; +async function getSeminarByID(id) { + try { + const newSeminar = await querySeminarByID(id); + newSeminar.announcements = await queryAnnouncementByTypeID(id, "Seminar"); + newSeminar.organizers = await queryOrganizerByTypeID(id, "Seminar"); + return newSeminar; + } catch (err) { + console.log(err); + return new Error("Unable to retrieve seminar"); + } +} + +module.exports = { querySeminarByID, querySeminarsByEventID, getSeminarByID }; diff --git a/api/src/schema.js b/api/src/schema.js index da4fc4b..a9a1576 100644 --- a/api/src/schema.js +++ b/api/src/schema.js @@ -63,6 +63,9 @@ const SchemaDefinition = ` createSeminarAnnouncement(announcement: AnnouncementInput!): Announcement! editProfile(userID: Int!, user: UserUpdateInput!): User! + + editEvent(eventID: Int!, event: EventUpdateInput!): Event! + editSeminar(seminarID: Int!, seminar: SeminarUpdateInput!): Seminar! followUser(userID: Int!, followingID: Int!): User! unfollowUser(userID: Int!, followingID: Int!): User! diff --git a/api/src/types/Event.js b/api/src/types/Event.js index 8260e9e..0d66b2b 100644 --- a/api/src/types/Event.js +++ b/api/src/types/Event.js @@ -19,7 +19,6 @@ const Event = ` # still need to add photo picture_path: String - #Testing attaching announcements to an event announcements: [Announcement!] organizers: [User!] seminars: [Seminar!] @@ -47,15 +46,29 @@ const Event = ` website: String } + input EventUpdateInput { + name: String! + description: String + + start_time: String! + end_time: String! + + capacity_type: capacity_type! + max_capacity: Int + + organizer_ids: [Int!]! + + location: String + location_link: String + picture_path: String + website: String + } input EventParticipationInput { userid: Int! eventid: Int! participationType: participation_type! - } - - `; module.exports = { Event }; diff --git a/api/src/types/Seminar.js b/api/src/types/Seminar.js index 6cfdbb2..6830cd3 100644 --- a/api/src/types/Seminar.js +++ b/api/src/types/Seminar.js @@ -9,13 +9,12 @@ const Seminar = ` capacity_type: capacity_type! max_capacity: Int current_capacity: Int - location: Int + location: String location_link: String picture_path: Int website: String announcements: [Announcement!] organizers: [User!] - } input SeminarInput { @@ -35,14 +34,30 @@ const Seminar = ` picture_path: String website: String } + + input SeminarUpdateInput { + name: String + description: String + + start_time: String! + end_time: String! + + capacity_type: capacity_type! + max_capacity: Int + + organizer_ids: [Int!]! + + location: String + location_link: String + picture_path: String + website: String + } -input SeminarParticipationInput { - userid: Int! - seminarid: Int! - participationType: participation_type! - -} - + input SeminarParticipationInput { + userid: Int! + seminarid: Int! + participationType: participation_type! + } `; module.exports = { Seminar }; diff --git a/frontend/package-lock.json b/frontend/package-lock.json index e2b4f9b..9dfd318 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1832,7 +1832,6 @@ "version": "3.0.0-beta.6", "resolved": "https://registry.npmjs.org/@vue/cli-service/-/cli-service-3.0.0-beta.6.tgz", "integrity": "sha1-sim1/Txdsz8N+YJPC5nKCB+jjSA=", - "dev": true, "requires": { "@vue/cli-overlay": "^3.0.0-beta.6", "@vue/cli-shared-utils": "^3.0.0-beta.6", @@ -2035,7 +2034,6 @@ "version": "3.0.0-beta.6", "resolved": "https://registry.npmjs.org/@vue/cli-shared-utils/-/cli-shared-utils-3.0.0-beta.6.tgz", "integrity": "sha1-Ep2lNTTWjJFiSms/dmc/rOtdpi0=", - "dev": true, "requires": { "chalk": "^2.3.0", "cmd-shim": "^2.0.2", @@ -2308,8 +2306,7 @@ "ansi-escapes": { "version": "1.4.0", "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", - "dev": true + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" }, "ansi-html": { "version": "0.0.7", @@ -3337,7 +3334,6 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", - "dev": true, "requires": { "babel-plugin-check-es2015-constants": "^6.22.0", "babel-plugin-syntax-trailing-function-commas": "^6.22.0", @@ -3486,7 +3482,6 @@ "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, "requires": { "cache-base": "^1.0.1", "class-utils": "^0.3.5", @@ -3969,7 +3964,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, "requires": { "collection-visit": "^1.0.0", "component-emitter": "^1.2.1", @@ -4855,7 +4849,6 @@ "version": "4.5.1", "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.5.1.tgz", "integrity": "sha512-OlTo6DYg0XfTKOF8eLf79wcHm4Ut10xU2cRBRPMW/NA5F9VMjZGTfRHWDIYC3s+1kObGYrBLshXWU1K0hILkNQ==", - "dev": true, "requires": { "cacache": "^10.0.4", "find-cache-dir": "^1.0.0", @@ -4955,7 +4948,6 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", - "dev": true, "requires": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -4996,7 +4988,6 @@ "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, "requires": { "browserify-cipher": "^1.0.0", "browserify-sign": "^4.0.0", @@ -5020,7 +5011,6 @@ "version": "0.28.10", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.28.10.tgz", "integrity": "sha512-X1IJteKnW9Llmrd+lJ0f7QZHh9Arf+11S7iRcoT2+riig3BK0QaCaOtubAulMK6Itbo08W6d3l8sW21r+Jhp5Q==", - "dev": true, "requires": { "babel-code-frame": "^6.26.0", "css-selector-tokenizer": "^0.7.0", @@ -5158,7 +5148,6 @@ "version": "3.10.0", "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-3.10.0.tgz", "integrity": "sha1-Tzj2zqK5sX+gFJDyPx3GjqZcHDg=", - "dev": true, "requires": { "autoprefixer": "^6.3.1", "decamelize": "^1.1.2", @@ -5633,8 +5622,7 @@ "minimist": { "version": "1.2.0", "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "supports-color": { "version": "5.1.0", @@ -5859,7 +5847,6 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", - "dev": true, "requires": { "globby": "^5.0.0", "is-path-cwd": "^1.0.0", @@ -6923,7 +6910,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", - "dev": true, "requires": { "arr-flatten": "^1.1.0", "array-unique": "^0.3.2", @@ -6969,7 +6955,6 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, "requires": { "debug": "^2.3.3", "define-property": "^0.2.5", @@ -7017,7 +7002,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, "requires": { "array-unique": "^0.3.2", "define-property": "^1.0.0", @@ -7168,7 +7152,6 @@ "version": "3.1.9", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.9.tgz", "integrity": "sha512-SlIz6sv5UPaAVVFRKodKjCg48EbNoIhgetzfK/Cy0v5U52Z6zB136M8tp0UC9jM53LYbmIRihJszvvqpKkfm9g==", - "dev": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -7601,7 +7584,6 @@ "block-stream": { "version": "0.0.9", "bundled": true, - "optional": true, "requires": { "inherits": "~2.0.0" } @@ -7623,8 +7605,7 @@ }, "buffer-shims": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "caseless": { "version": "0.12.0", @@ -7638,13 +7619,11 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "combined-stream": { "version": "1.0.5", "bundled": true, - "optional": true, "requires": { "delayed-stream": "~1.0.0" } @@ -7655,18 +7634,15 @@ }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "cryptiles": { "version": "2.0.5", "bundled": true, - "optional": true, "requires": { "boom": "2.x.x" } @@ -7701,8 +7677,7 @@ }, "delayed-stream": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "delegates": { "version": "1.0.0", @@ -7729,8 +7704,7 @@ }, "extsprintf": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "forever-agent": { "version": "0.6.1", @@ -7839,7 +7813,6 @@ "hawk": { "version": "3.1.3", "bundled": true, - "optional": true, "requires": { "boom": "2.x.x", "cryptiles": "2.x.x", @@ -7881,7 +7854,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -7893,8 +7865,7 @@ }, "isarray": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "isstream": { "version": "0.1.2", @@ -7957,13 +7928,11 @@ }, "mime-db": { "version": "1.27.0", - "bundled": true, - "optional": true + "bundled": true }, "mime-types": { "version": "2.1.15", "bundled": true, - "optional": true, "requires": { "mime-db": "~1.27.0" } @@ -8031,8 +8000,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "oauth-sign": { "version": "0.8.2", @@ -8081,8 +8049,7 @@ }, "process-nextick-args": { "version": "1.0.7", - "bundled": true, - "optional": true + "bundled": true }, "punycode": { "version": "1.4.1", @@ -8115,7 +8082,6 @@ "readable-stream": { "version": "2.2.9", "bundled": true, - "optional": true, "requires": { "buffer-shims": "~1.0.0", "core-util-is": "~1.0.0", @@ -8164,8 +8130,7 @@ }, "safe-buffer": { "version": "5.0.1", - "bundled": true, - "optional": true + "bundled": true }, "semver": { "version": "5.3.0", @@ -8185,7 +8150,6 @@ "sntp": { "version": "1.0.9", "bundled": true, - "optional": true, "requires": { "hoek": "2.x.x" } @@ -8216,7 +8180,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -8226,7 +8189,6 @@ "string_decoder": { "version": "1.0.1", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.0.1" } @@ -8251,7 +8213,6 @@ "tar": { "version": "2.2.1", "bundled": true, - "optional": true, "requires": { "block-stream": "*", "fstream": "^1.0.2", @@ -8301,8 +8262,7 @@ }, "util-deprecate": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "uuid": { "version": "3.0.1", @@ -9471,7 +9431,6 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.0.6.tgz", "integrity": "sha1-01sEUqrhKaip8/rEShaaYl2M8/o=", - "dev": true, "requires": { "html-minifier": "^3.2.3", "loader-utils": "^0.2.16", @@ -9727,7 +9686,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", - "dev": true, "requires": { "ansi-escapes": "^3.0.0", "chalk": "^2.0.0", @@ -10299,7 +10257,6 @@ "version": "11.6.2", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.2.tgz", "integrity": "sha512-pAeZhpbSlUp5yQcS6cBQJwkbzmv4tWFaYxHbFVSxzXefqjvtRA851Z5N2P+TguVG9YeUDcgb8pdeVQRJh0XR3Q==", - "dev": true, "requires": { "abab": "^1.0.4", "acorn": "^5.3.0", @@ -10450,7 +10407,6 @@ "version": "2.85.0", "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", - "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.6.0", @@ -10693,7 +10649,6 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/listr/-/listr-0.12.0.tgz", "integrity": "sha1-a84sD1YD+klYDqF81qAMwOX6RRo=", - "dev": true, "requires": { "chalk": "^1.1.3", "cli-truncate": "^0.2.1", @@ -10746,7 +10701,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz", "integrity": "sha1-yoDhd5tOcCZoB+ju0a1qvjmFUPk=", - "dev": true, "requires": { "chalk": "^1.1.3", "cli-truncate": "^0.2.1", @@ -11323,7 +11277,6 @@ "version": "2.3.11", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, "requires": { "arr-diff": "^2.0.0", "array-unique": "^0.2.1", @@ -11491,7 +11444,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/mocha-webpack/-/mocha-webpack-1.0.1.tgz", "integrity": "sha512-E/gGw0knbee7/8OWnjoD3VwUXSKLc1wYXsWgpMeLtM60JjR6k24j0J8UCAqRK5/iFrRBoKWDJWuuZ+E32/nUwQ==", - "dev": true, "requires": { "babel-runtime": "^6.18.0", "chalk": "^1.1.3", @@ -11686,7 +11638,6 @@ "version": "1.2.9", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", - "dev": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -11846,7 +11797,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", - "dev": true, "requires": { "lower-case": "^1.1.1" } @@ -11896,7 +11846,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", - "dev": true, "requires": { "assert": "^1.1.1", "browserify-zlib": "^0.2.0", @@ -12005,7 +11954,6 @@ "version": "2.79.0", "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", - "dev": true, "requires": { "aws-sign2": "~0.6.0", "aws4": "^1.2.1", @@ -12359,8 +12307,7 @@ "onetime": { "version": "1.1.0", "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", - "dev": true + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" }, "opn": { "version": "5.2.0", @@ -15563,7 +15510,6 @@ "version": "2.81.0", "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", - "dev": true, "requires": { "aws-sign2": "~0.6.0", "aws4": "^1.2.1", @@ -15908,7 +15854,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", - "dev": true, "requires": { "camelcase": "^3.0.0", "cliui": "^3.2.0", @@ -16333,8 +16278,7 @@ "slice-ansi": { "version": "0.0.4", "resolved": "http://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", - "dev": true + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=" }, "snapdragon": { "version": "0.8.2", @@ -17671,7 +17615,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.3.tgz", "integrity": "sha512-as/50351uuJGiQbhVvE510SCqM/YOWghCzIFJeEOu5oVE0QOZ3/vu2QcnVvu0Lz+vNd0rKsiCFAlbcw0i/YH2w==", - "dev": true, "requires": { "cacache": "^10.0.4", "find-cache-dir": "^1.0.0", @@ -18287,7 +18230,6 @@ "version": "14.2.1", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-14.2.1.tgz", "integrity": "sha512-QSsDSWzKYxyC2LHpp9+2oteUg/ObHeP1VkZAiFTtkTR3lBV7mobcfxzHdQl9mBeJEjdCZpjzWiIUCAErE0K1EA==", - "dev": true, "requires": { "consolidate": "^0.14.0", "hash-sum": "^1.0.2", @@ -18507,7 +18449,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", - "dev": true, "requires": { "arr-flatten": "^1.1.0", "array-unique": "^0.3.2", @@ -18545,7 +18486,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.2.tgz", "integrity": "sha512-l32Hw3wqB0L2kGVmSbK/a+xXLDrUEsc84pSgMkmwygHvD7ubRsP/vxxHa5BtB6oix1XLLVCHyYMsckRXxThmZw==", - "dev": true, "requires": { "anymatch": "^2.0.0", "async-each": "^1.0.0", @@ -18573,7 +18513,6 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, "requires": { "debug": "^2.3.3", "define-property": "^0.2.5", @@ -18621,7 +18560,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, "requires": { "array-unique": "^0.3.2", "define-property": "^1.0.0", @@ -18772,7 +18710,6 @@ "version": "3.1.9", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.9.tgz", "integrity": "sha512-SlIz6sv5UPaAVVFRKodKjCg48EbNoIhgetzfK/Cy0v5U52Z6zB136M8tp0UC9jM53LYbmIRihJszvvqpKkfm9g==", - "dev": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -18834,7 +18771,6 @@ "version": "3.11.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.11.0.tgz", "integrity": "sha512-3kOFejWqj5ISpJk4Qj/V7w98h9Vl52wak3CLiw/cDOfbVTq7FeoZ0SdoHHY9PYlHr50ZS42OfvzE2vB4nncKQg==", - "dev": true, "requires": { "acorn": "^5.0.0", "acorn-dynamic-import": "^2.0.0", @@ -19061,7 +18997,6 @@ "version": "8.0.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", - "dev": true, "requires": { "camelcase": "^4.1.0", "cliui": "^3.2.0", @@ -19208,7 +19143,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", - "dev": true, "requires": { "arr-flatten": "^1.1.0", "array-unique": "^0.3.2", @@ -19246,7 +19180,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.2.tgz", "integrity": "sha512-l32Hw3wqB0L2kGVmSbK/a+xXLDrUEsc84pSgMkmwygHvD7ubRsP/vxxHa5BtB6oix1XLLVCHyYMsckRXxThmZw==", - "dev": true, "requires": { "anymatch": "^2.0.0", "async-each": "^1.0.0", @@ -19279,7 +19212,6 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, "requires": { "debug": "^2.3.3", "define-property": "^0.2.5", @@ -19335,7 +19267,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, "requires": { "array-unique": "^0.3.2", "define-property": "^1.0.0", @@ -19505,7 +19436,6 @@ "version": "3.1.9", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.9.tgz", "integrity": "sha512-SlIz6sv5UPaAVVFRKodKjCg48EbNoIhgetzfK/Cy0v5U52Z6zB136M8tp0UC9jM53LYbmIRihJszvvqpKkfm9g==", - "dev": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -19526,7 +19456,6 @@ "version": "6.6.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=", - "dev": true, "requires": { "camelcase": "^3.0.0", "cliui": "^3.2.0", @@ -19741,7 +19670,6 @@ "version": "4.8.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", - "dev": true, "requires": { "cliui": "^3.2.0", "decamelize": "^1.1.1", diff --git a/frontend/src/components/addEvent.vue b/frontend/src/components/addEvent.vue index d005d5f..22ab1b7 100644 --- a/frontend/src/components/addEvent.vue +++ b/frontend/src/components/addEvent.vue @@ -17,9 +17,9 @@ export default { }, methods: { createEvent() { - this.$store.commit('resetEditState','Event') + this.$store.commit("setEdit",{editMode: false}) this.$router.push('CreateEvent') - }, - }, + } + } } \ No newline at end of file diff --git a/frontend/src/components/addSeminar.vue b/frontend/src/components/addSeminar.vue index 95f3cdb..4929360 100644 --- a/frontend/src/components/addSeminar.vue +++ b/frontend/src/components/addSeminar.vue @@ -17,7 +17,7 @@ export default { }, methods: { createSeminar() { - this.$store.commit('resetEditState','Seminar') + this.$store.commit("setEdit",{editMode: false}) this.$router.push('CreateSeminar') }, }, diff --git a/frontend/src/store.js b/frontend/src/store.js index e265a36..3354fc4 100644 --- a/frontend/src/store.js +++ b/frontend/src/store.js @@ -21,6 +21,7 @@ export default new Vuex.Store({ user: {}, event: {}, seminar: {}, + editMode: false, otherUser: {}, }, mutations: { @@ -134,12 +135,8 @@ export default new Vuex.Store({ }); } }, - resetEditState(state, payload) { - if (payload === "Event") { - state.event.manage = false; - } else if (payload === "Seminar") { - state.seminar.manage = false; - } + setEdit(state, payload) { + state.editMode = payload.editMode }, addToWaitlist(state, payload) { diff --git a/frontend/src/views/pages/CreateEvent.vue b/frontend/src/views/pages/CreateEvent.vue index e9dc2b7..f7cd8cc 100644 --- a/frontend/src/views/pages/CreateEvent.vue +++ b/frontend/src/views/pages/CreateEvent.vue @@ -20,13 +20,14 @@ v-model="startDate" value-format="yyyy-MM-dd" type="date" - placeholder="Start Date"> clearable + placeholder="Start Date"> @@ -36,48 +37,52 @@ v-model="endDate" value-format="yyyy-MM-dd" type="date" - placeholder="End Date"> clearable + placeholder="End Date">

Capacity Type

+ Free for all - First come first serve (physically) - First come first serve (electronically) - - - - - - +
+ First come first serve (physically) + + +
+
+ First come first serve (electronically) + + +

Location

-

Country

- -

City

- -

Postal Code

- -

Address

- +
+ + + +
+

Address

+

Website

@@ -103,8 +108,10 @@
- Create Event - Cancel + Update Event + Create Event + Cancel + Cancel @@ -128,20 +135,25 @@ export default { endTime: '', capacityType: 'FFA', capacityNum: 1, - countryInput: '', - cityInput: '', - postalInput: '', addressInput: '', urlInput: '', descriptionInput: '', transferData: [], selectedOrganizers: [], - editEvent: this.$store.state.event.manage, + editEvent: this.$store.state.editMode, + locationLink:'', + capacityVisibleFCFSP: false, + capacityVisibleFCFSE: false }; }, mounted() { - + + if (this.editEvent == false) + console.log("EDIT MODE FALSE"); + else + console.log("EDIT MODE TRUE"); + // fetches a list of organizers to be displayed in the transfer component fetch({ query: `{ @@ -154,7 +166,7 @@ export default { }` }).then(res => { if (res.data) { - + console.log(res.data); // store all the organizers name into a variable // you shouldn't be allowed to choose yourself as a user res.data.searchUsersByName.forEach(element => { @@ -178,30 +190,34 @@ export default { var eventInfo = this.$store.state.event - console.log("Name: " + eventInfo.name); - console.log("Description: " + eventInfo.description); - console.log("start date: " + moment(parseInt(eventInfo.start_time,10)).format("YYYY-MM-DD")); - console.log("end date: " + moment(parseInt(eventInfo.end_time,10)).format("YYYY-MM-DD")); - console.log("capacity type: " + eventInfo.capacity_type); - console.log("max capacity: " + eventInfo.max_capacity); - - // this.eventName = eventInfo.name - // this.descriptionInput = eventInfo.description - // this.start_date = toString(moment(parseInt(eventInfo.start_time,10)).format("YYYY-MM-DD")) - // this.end_date = moment(parseInt(eventInfo.end_time,10)).format("YYYY-MM-DD") - // this.start_time = moment(parseInt(eventInfo.start_time,10)).format("HH:mm") - // this.end_time = moment(parseInt(eventInfo.end_time,10)).format("HH:mm") - // this.capacityType = eventInfo.capacity_type - // this.capacityNum = eventInfo.max_capacity - - this.eventName = "Vivian's Nap Time" - this.descriptionInput = " Do not disturb Vivian's nap time" - this.startDate = "2014-10-10" - this.endDate = "2018-11-17" - this.startTime = "08:30" - this.endTime = "10:30" - this.capacityType = "FCFS_E" - this.capacityNum = 100 + // displays current event info + this.eventName = eventInfo.name + this.descriptionInput = eventInfo.description + this.startDate = moment(parseInt(eventInfo.start_time_utc,10)).format("YYYY-MM-DD") + this.endDate = moment(parseInt(eventInfo.end_time_utc,10)).format("YYYY-MM-DD") + this.startTime = moment(parseInt(eventInfo.start_time_utc,10)).format("HH:mm") + this.endTime = moment(parseInt(eventInfo.end_time_utc,10)).format("HH:mm") + this.capacityType = eventInfo.capacity_type + this.capacityNum = eventInfo.max_capacity + this.addressInput = eventInfo.location + this.locationLink = eventInfo.location_link + this.urlInput = eventInfo.website + + for (var i = 0; i < eventInfo.organizers.length; i++) { + this.selectedOrganizers.push(eventInfo.organizers[i].id) + } + + console.log("Name: " + this.eventName); + console.log("Description: " + this.descriptionInput); + console.log("start date: " + this.startDate); + console.log("start time: " + this.startTime); + console.log("end date: " + this.endDate); + console.log("end time: " + this.endTime); + console.log("capacity type: " + this.capacityType); + console.log("max capacity: " + this.capacityNum); + console.log("organizers: " + this.selectedOrganizers); + console.log("location: "+ this.addressInput); + console.log("website: " + this.urlInput); } }, @@ -213,17 +229,10 @@ export default { this.startTime && this.endTime && this.capacityType) { - var temp = '' + console.log("STARTTIME: " + this.startTime); + console.log("ENDTIME: " + this.endTime); - // parse the start time - temp = this.startTime.toString().split(" ") - temp = temp[4].toString().split(":") - var startT = temp[0] + ":" + temp[1] - - // parse the end time - temp = this.endTime.toString().split(" ") - temp = temp[4].toString().split(":") - var endT = temp[0] + ":" + temp[1] + var temp = '' // set the number of capacity to null if it is FFA if (this.capacityType == "FFA") { @@ -233,13 +242,71 @@ export default { // Add yourself as the organizer // this.selectedOrganizers.push(this.user.id) + console.log("startTime: "+ this.startTime); + console.log("endTime: "+ this.endTime); + + console.log("name: " + this.eventName) - console.log("start_time: " + this.startDate + " " + startT) - console.log("end_time: " + this.endDate + " " + endT) + console.log("start_time: " + this.startDate + " " + this.startTime) + console.log("end_time: " + this.endDate + " " + this.endTime) console.log("capacity_type: " + this.capacityType) console.log("max_capacity: " + this.capacityNum) console.log("organizer_ids: " + this.selectedOrganizers) + if (this.editEvent === true) { + console.log("---------"); + console.log('EVENT ID: ' + this.$store.state.event.id); + console.log("******"); + console.log("description: " + this.descriptionInput); + console.log("max_capacity: " + this.capacityNum); + console.log("start_time: " + this.startDate + " " + this.startTime); + console.log("end_time: " + this.endDate + " " + this.endTime); + console.log("name: " + this.eventName); + console.log("capacity_type: " + this.capacityType); + console.log("organizer_ids: " + this.selectedOrganizers); + + fetch({ + query: `mutation editEvent($myid: Int!, $myEvent: EventUpdateInput!){ + editEvent(eventID:$myid, event: $myEvent){ + name + id + } + }`, + variables: { + myid: this.$store.state.event.id, + myEvent: { + description: this.descriptionInput, + max_capacity: this.capacityNum, + start_time: this.startDate + " " + this.startTime, + end_time: this.endDate + " " + this.endTime, + name: this.eventName, + capacity_type: this.capacityType, + organizer_ids: this.selectedOrganizers, + location_link: this.locationLink, + location: this.addressInput, + website: this.urlInput + } + } + }).then(res => { + console.log(res.data) + if (res.data) { + alert("Event updated successfully!") + var payload = { + __typename: "Event", + id: res.data.editEvent.id + } + this.$store.commit("addToManage",payload) + this.$router.push('ManageEvents') + } else { + console.log(res.errors) + alert(res.errors[0].message) + } + }).catch(err => { + console.log(err); + }) + + } else { + fetch({ query: `mutation createEvent($event: EventInput!){ createEvent(event: $event){ @@ -251,12 +318,14 @@ export default { creator_id: this.user.id, name: this.eventName, description: this.descriptionInput, - start_time: this.startDate + " " + startT, - end_time: this.endDate + " " + endT, + start_time: this.startDate + " " + this.startTime, + end_time: this.endDate + " " + this.endTime, capacity_type: this.capacityType, max_capacity: this.capacityNum, - location: this.addressInput + ", " + this.cityInput + ", " + this.countryInput + ", " + this.postalInput, - organizer_ids: this.selectedOrganizers + organizer_ids: this.selectedOrganizers, + location_link: this.locationLink, + location: this.addressInput, + website: this.urlInput } } }).then(res => { @@ -271,10 +340,13 @@ export default { this.$router.push('ManageEvents') } else { console.log(res.errors) + alert(res.errors[0].message) } }).catch(err => { console.log(err); }); + + } } // Make sure the user enter information in the required fields @@ -334,6 +406,25 @@ export default { message: 'Delete canceled' }); }); + }, + onCancell() { + this.$confirm('The event information will be discarded. Continue?', 'Warning', { + confirmButtonText: 'OK', + cancelButtonText: 'Cancel', + type: 'warning', + center: true + }).then(() => { + this.$message({ + type: 'success', + message: 'No changes were made' + }); + this.$router.push('ManageEvents') + }).catch(() => { + this.$message({ + type: 'info', + message: 'Delete canceled' + }); + }); } } //METHODS }; @@ -361,5 +452,6 @@ img { position: relative; } + diff --git a/frontend/src/views/pages/CreateSeminar.vue b/frontend/src/views/pages/CreateSeminar.vue index 241e094..f489e55 100644 --- a/frontend/src/views/pages/CreateSeminar.vue +++ b/frontend/src/views/pages/CreateSeminar.vue @@ -3,7 +3,9 @@
-

Creating an seminar

+ +

Editing an event

+

Creating an seminar

@@ -14,7 +16,14 @@

Related Event

- + + + {{ i.name }} + + + + {{ i.name }} @@ -34,6 +43,7 @@ @@ -50,42 +60,48 @@

Capacity Type

Free for all - First come first serve (physically) - First come first serve (electronically) - - - - - - +
+
+ First come first serve (physically) + + +
+
+
+ First come first serve (electronically) + + +

Location

-

Country

- -

City

- -

Postal Code

- -

Address

- +
+ + + +
+

Address

+ +

Website

@@ -110,8 +126,10 @@
- Create Seminar - Cancel + Update Seminar + Create Seminar + Cancel + Cancel
@@ -119,6 +137,7 @@