From 873d8d717e2012d692d5bbafd7f051bb682d7488 Mon Sep 17 00:00:00 2001 From: Jeffrey Li <46302202+DrCheddar@users.noreply.github.com> Date: Fri, 11 Sep 2020 22:04:26 -0400 Subject: [PATCH] Development (#372) * Optimized landing page - Scaled down background to 4k width - Web-optimized images * fix: move backup images to backup folder * feat: delete notes option * feat : discord linking works * fix: user exp bar division * fix: add general and physed subject options * fix: homepage width styles * created cloud build yaml file * timeout fail test * cloud build time out to 900s * feat: standard responsive avatar bar * feat: image paste posting NOT FINISHED * fix: do not mutate vuex state error when posting second note used list deconstruct on the images list, so when the original list is modified the one stored in the vuex state isnt mutated as well * feat: image posting through https on call function * feat: image posting mixin + image posting on edit notes and questions * fix: vuex state error obj destructure image list, delete image from storeImages if not included in content * fix: vuex image list error * padding fix and label removal for notes upload * fix: gitignroe sw.js * feat: expandable textbox * feat: textarea markdown options * feat: add more markdown options * markdown editor menu position fix * notes pills position fix * fix: router fix * fix: redirect to splash or home * color changes and post new question modal changes (#203) * character limit on post new note * Update envars.ts * edit notes character limit and style change * added back button to newsletters * Fixed profile button + styled settings page * Added firebase connection * fix: dumb filter error * Finished Edit Profile Page * a * Revert "a" This reverts commit 54b9d378bc5da7bb8ce9bf831f00add0e009b1c3. * Made changes requested * feat: integrate analytics * fix: redirect queries will persist through login * fix: redirect override from timeout function * feat : notification bar * Added viewable profile * remove console logs * auth.ts userInfo.user error fixed * login issue fixed * login issue fixed V2(previous one still had same issue) * pr changes added, Error message made clear * fix: error handling done correctly * error thrown back * Feature: Signup now doesn't allow signup with invalid names, emails, passwords etc * fix user signup conflicts with redirect query * feat : add grades 7, 8 * feat: email auth verification, watch user auth state redirects * feat: add notifications options checkbox * feat: add eula content accept * refactor: use 1 total exp stat for read/write efficiency * added character limit to questions page * character limit change * feat: add scroll bar * fix: allows new users to go back to sign up from verify email * feat: sort by popular option * fix: show scrollbar on chrome * feat: add phy ed as a favouritable subject * fix: md list rendering on chromium * fix: add firebase sw to gitignore * feat: add scroll bar * fix: tooltip doesn't die error * refactor: use 1 total exp stat for read/write efficiency * BETA 1.1.3 BUG FIXES - SCROLLBAR, LOGIN FLOW (#270) (#273) * Optimized landing page - Scaled down background to 4k width - Web-optimized images * fix: move backup images to backup folder * feat: delete notes option * feat : discord linking works * fix: user exp bar division * fix: add general and physed subject options * fix: homepage width styles * created cloud build yaml file * timeout fail test * cloud build time out to 900s * feat: standard responsive avatar bar * feat: image paste posting NOT FINISHED * fix: do not mutate vuex state error when posting second note used list deconstruct on the images list, so when the original list is modified the one stored in the vuex state isnt mutated as well * feat: image posting through https on call function * feat: image posting mixin + image posting on edit notes and questions * fix: vuex state error obj destructure image list, delete image from storeImages if not included in content * fix: vuex image list error * padding fix and label removal for notes upload * fix: gitignroe sw.js * feat: expandable textbox * feat: textarea markdown options * feat: add more markdown options * markdown editor menu position fix * notes pills position fix * fix: router fix * fix: redirect to splash or home * color changes and post new question modal changes (#203) * character limit on post new note * Update envars.ts * edit notes character limit and style change * added back button to newsletters * Fixed profile button + styled settings page * Added firebase connection * fix: dumb filter error * Finished Edit Profile Page * a * Revert "a" This reverts commit 54b9d378bc5da7bb8ce9bf831f00add0e009b1c3. * Made changes requested * feat: integrate analytics * fix: redirect queries will persist through login * fix: redirect override from timeout function * feat : notification bar * Added viewable profile * remove console logs * auth.ts userInfo.user error fixed * login issue fixed * login issue fixed V2(previous one still had same issue) * pr changes added, Error message made clear * fix: error handling done correctly * error thrown back * Feature: Signup now doesn't allow signup with invalid names, emails, passwords etc * fix user signup conflicts with redirect query * feat : add grades 7, 8 * feat: email auth verification, watch user auth state redirects * feat: add notifications options checkbox * feat: add eula content accept * refactor: use 1 total exp stat for read/write efficiency * added character limit to questions page * character limit change * feat: add scroll bar * fix: allows new users to go back to sign up from verify email * feat: sort by popular option * fix: show scrollbar on chrome * feat: add phy ed as a favouritable subject * fix: md list rendering on chromium * fix: add firebase sw to gitignore * feat: add scroll bar * fix: tooltip doesn't die error * refactor: use 1 total exp stat for read/write efficiency Co-authored-by: Andre Benedito <38482987+andr-dev@users.noreply.github.com> Co-authored-by: Vansh Sethi <44345210+Vansh-Sethi@users.noreply.github.com> Co-authored-by: Jeff Huang Co-authored-by: Eshwar Chock Co-authored-by: Jeffrey Zhang Co-authored-by: Andre Benedito <38482987+andr-dev@users.noreply.github.com> Co-authored-by: Vansh Sethi <44345210+Vansh-Sethi@users.noreply.github.com> Co-authored-by: Jeff Huang Co-authored-by: Eshwar Chock Co-authored-by: Jeffrey Zhang * feat: add search bar for notes * feat: add global topnav searchbar * fix: invalid date algolia error * feat: combined notes + questions search * feat: add school category for notes and questions + sort and search * feat: combined notes + questions search * Update classes.spec.ts * fix: remove commented edit notes funciton * Fonts changes * more!!!! * Update index.vue automatically load more * Update Suggestions.vue * Update index.vue * Update index.vue * Update Suggestions.vue * Update profile.vue * fix unclickable note bug * Development (#240) BETA 1.1.2 - EDIT USER SETTINGS, USER SIGNUP FIXES, NOTIFICATIONS * Optimized landing page - Scaled down background to 4k width - Web-optimized images * fix: move backup images to backup folder * feat: delete notes option * feat : discord linking works * fix: user exp bar division * fix: add general and physed subject options * fix: homepage width styles * created cloud build yaml file * timeout fail test * cloud build time out to 900s * feat: standard responsive avatar bar * feat: image paste posting NOT FINISHED * fix: do not mutate vuex state error when posting second note used list deconstruct on the images list, so when the original list is modified the one stored in the vuex state isnt mutated as well * feat: image posting through https on call function * feat: image posting mixin + image posting on edit notes and questions * fix: vuex state error obj destructure image list, delete image from storeImages if not included in content * fix: vuex image list error * padding fix and label removal for notes upload * fix: gitignroe sw.js * feat: expandable textbox * feat: textarea markdown options * feat: add more markdown options * markdown editor menu position fix * notes pills position fix * fix: router fix * fix: redirect to splash or home * color changes and post new question modal changes (#203) * Update envars.ts * added back button to newsletters * Fixed profile button + styled settings page * Added firebase connection * fix: dumb filter error * Finished Edit Profile Page * a * Revert "a" This reverts commit 54b9d378bc5da7bb8ce9bf831f00add0e009b1c3. * Made changes requested * feat: integrate analytics * fix: redirect queries will persist through login * fix: redirect override from timeout function * feat : notification bar * Added viewable profile * remove console logs * auth.ts userInfo.user error fixed * login issue fixed * login issue fixed V2(previous one still had same issue) * pr changes added, Error message made clear * fix: error handling done correctly * error thrown back * Feature: Signup now doesn't allow signup with invalid names, emails, passwords etc * fix user signup conflicts with redirect query * feat : add grades 7, 8 * feat: email auth verification, watch user auth state redirects * feat: add notifications options checkbox * feat: add eula content accept Co-authored-by: Andre Benedito <38482987+andr-dev@users.noreply.github.com> Co-authored-by: Vansh Sethi <44345210+Vansh-Sethi@users.noreply.github.com> Co-authored-by: Jeff Huang Co-authored-by: Eshwar Chock Co-authored-by: Jeffrey Zhang * BETA 1.1.3 BUG FIXES - SCROLLBAR, LOGIN FLOW (#270) * Optimized landing page - Scaled down background to 4k width - Web-optimized images * fix: move backup images to backup folder * feat: delete notes option * feat : discord linking works * fix: user exp bar division * fix: add general and physed subject options * fix: homepage width styles * created cloud build yaml file * timeout fail test * cloud build time out to 900s * feat: standard responsive avatar bar * feat: image paste posting NOT FINISHED * fix: do not mutate vuex state error when posting second note used list deconstruct on the images list, so when the original list is modified the one stored in the vuex state isnt mutated as well * feat: image posting through https on call function * feat: image posting mixin + image posting on edit notes and questions * fix: vuex state error obj destructure image list, delete image from storeImages if not included in content * fix: vuex image list error * padding fix and label removal for notes upload * fix: gitignroe sw.js * feat: expandable textbox * feat: textarea markdown options * feat: add more markdown options * markdown editor menu position fix * notes pills position fix * fix: router fix * fix: redirect to splash or home * color changes and post new question modal changes (#203) * character limit on post new note * Update envars.ts * edit notes character limit and style change * added back button to newsletters * Fixed profile button + styled settings page * Added firebase connection * fix: dumb filter error * Finished Edit Profile Page * a * Revert "a" This reverts commit 54b9d378bc5da7bb8ce9bf831f00add0e009b1c3. * Made changes requested * feat: integrate analytics * fix: redirect queries will persist through login * fix: redirect override from timeout function * feat : notification bar * Added viewable profile * remove console logs * auth.ts userInfo.user error fixed * login issue fixed * login issue fixed V2(previous one still had same issue) * pr changes added, Error message made clear * fix: error handling done correctly * error thrown back * Feature: Signup now doesn't allow signup with invalid names, emails, passwords etc * fix user signup conflicts with redirect query * feat : add grades 7, 8 * feat: email auth verification, watch user auth state redirects * feat: add notifications options checkbox * feat: add eula content accept * refactor: use 1 total exp stat for read/write efficiency * added character limit to questions page * character limit change * feat: add scroll bar * fix: allows new users to go back to sign up from verify email * feat: sort by popular option * fix: show scrollbar on chrome * feat: add phy ed as a favouritable subject * fix: md list rendering on chromium * fix: add firebase sw to gitignore * feat: add scroll bar * fix: tooltip doesn't die error * refactor: use 1 total exp stat for read/write efficiency Co-authored-by: Andre Benedito <38482987+andr-dev@users.noreply.github.com> Co-authored-by: Vansh Sethi <44345210+Vansh-Sethi@users.noreply.github.com> Co-authored-by: Jeff Huang Co-authored-by: Eshwar Chock Co-authored-by: Jeffrey Zhang * Update README.md added and changed somethings about the documentation * fix: trigger on scroll instead of timeout * cosmetic last touches * fixed textbox errors * fix:Change font family * Remove dissent from the code all hail clean language * cards redesigned * some basic gorups card formatting * fix: link scroll trigger height to window height * css issue fix * feat: rewrite questions index page to be standard layout * fix: infinite like exploit * defualt notes image changed, image hidden on mobile, notes dropdown bug fix * fix: scroll up on page * Added Template, indenting, etc. Just a lot of small things * enhance: improve popular querying alg * question cards * Funny redirects * Tidying up Main Layout * Finally, inner peace * Added Follower Modal * Added Open Sans Font * feat: personalized notes feed without int firebase reads * enhance: cooler loading screen to make the generate feed less painful * fix: generate feed if lastUpdated is undefined * enhance: add loading text * refactor: persistent personalized feed setting * fix: firebase timestamp import * refactor: move timestamp type to env.utils * decline + accept friend requests + refined modal * HTML Things * Update env.utils.ts * feature creating groups * Groups Cards now Work WE DID IT BOYYYYYYSSS * Got rid of tab (modal instead) * a * list view working for questions * fix: ssr window undefined scroll error * question cards * removed global styles for vx_body * enhance: paginate groups store * feat: groups modal, discover, your groups, _id * Fancy Card Functionality??? * feat: create group transition * Finish Cards * feat: redesign home layout * fix: update auxilium link * list view for questions and correcting scroll load issues * css error fix * Follow feature finished * added ability to unfollow people that you currently follow * Changes? * feat: i did some shit * feat: join groups * join group modal finished * fix : fixed yeet errors * feat: personalized questions feed * feat: combined notes and questions personalized feed * Feature Group Notes * again * feat: post notes and questions to groups * list view labels, questions list view bug fix * Cards with filtering! * fix: fix groups card on groups index * fixed linting errors * groups fixes * groups id page redesign * fix group type * Feature: group questions added * feat : groups layouts, leave and join, post from groups page * fix: groups cards on discover shrinking * fixed Justin's requests * fixed some other stuff * fix: update auxilium + sbb content * fix: fixed links lol * feat: rename newsletters on sidebar to updates * fix: sidebar spacer responsive size * Changes to transitions * fixed jeffrey's troll question note query * fix: groups filter error * goes back to first modal on button click in groups create/join * fix: reset tailwind down to prev version * remove console logs * cleanup * NotesCard Cosmetic Fix * Revert "Merge branch 'development' into developement-real" This reverts commit 30e3147b69ed2e6f3dc96c10826b154ee09579c7. * feat: category pills and better question card padding * enhance: reduce padding on responses * remove double name fields * Like Button FIXED * refactor: make groups logic one page * refactor : v-for indices on profile page * feat: upload cover images Co-authored-by: Andre Benedito <38482987+andr-dev@users.noreply.github.com> Co-authored-by: Vansh Sethi <44345210+Vansh-Sethi@users.noreply.github.com> Co-authored-by: Jeff Huang Co-authored-by: Eshwar Chock Co-authored-by: Jeffrey Zhang Co-authored-by: Edwin Zheng Co-authored-by: Blue-FlipFlop <57815456+Blue-FlipFlop@users.noreply.github.com> --- components/NotesCard.vue | 14 ++++---- mixins/PasteImagesMixin.ts | 35 ++++---------------- screens/notes/PostNotesModal.vue | 57 ++++++++++++++++++++++++++------ store/notes.ts | 5 ++- types/notes.ts | 3 ++ utils/uploadImage.ts | 28 ++++++++++++++++ 6 files changed, 96 insertions(+), 46 deletions(-) create mode 100644 utils/uploadImage.ts diff --git a/components/NotesCard.vue b/components/NotesCard.vue index e23e760..9a3b827 100644 --- a/components/NotesCard.vue +++ b/components/NotesCard.vue @@ -124,7 +124,7 @@
- + @@ -141,7 +141,7 @@ > @@ -248,9 +248,9 @@ import CategoryPills from '~/components/CategoryPills.vue' @Component({ components: {DeleteNotesModal, AvatarBar, CategoryPills}, mounted() { - if (this.note.images && this.note.images.length) { + if (this.note.coverImages && this.note.coverImages.length) { this.image = new Image() - this.image.src = this.note.images[0] + this.image.src = this.note.coverImages[0]?.imageURL // this.note.userP this.hasImage = true } @@ -269,6 +269,9 @@ export default class NotesCard extends Vue { deleteNotesOpen = false + get coverImages() { + return this.note.coverImages?.map((img) => img?.imageURL) || [] + } OpenDeleteModal() { this.deleteNotesOpen = true } @@ -292,7 +295,6 @@ export default class NotesCard extends Vue { async toggleLike(id: string, time?: any) { if (this.disabled) return - const a = this.$vs.loading() await notesStore.ToggleLikedNote(id) a.close() diff --git a/mixins/PasteImagesMixin.ts b/mixins/PasteImagesMixin.ts index f64db81..cfdffcc 100644 --- a/mixins/PasteImagesMixin.ts +++ b/mixins/PasteImagesMixin.ts @@ -1,40 +1,19 @@ import {Component, Vue} from 'nuxt-property-decorator' import functions from '~/plugins/firebaseFunctions' import type {StoredImage} from '~/types/firebaseTypes' +import UploadImage from '~/utils/uploadImage' @Component({}) export default class PasteImagesMixin extends Vue { images: StoredImage[] = [] contents!: string async uploadImage(image: File, evt?: any) { - const reader = new FileReader() - const promise = new Promise<{imageURL : string, fileName : string}>((resolve, reject) => { - reader.addEventListener('load', async () => { - const base64image = reader.result - try { - const imageResponse = await functions.httpsCallable( - 'functionPostImage' - )({name: image.name, image: base64image}) - - const imageURL = imageResponse.data.imageURL as string - const fileName = imageResponse.data.fileName as string - if (evt) { - this.insertAtCursor(evt.target, `\n![image](${imageURL})\n`) - } - - this.images.push({ - imageURL, - fileName - }) - return resolve({imageURL, fileName}) - } catch (error) { - console.log({error}) - return reject(error) - } - }) - }) - reader.readAsDataURL(image) - return promise + const imageUpload = await UploadImage(image) + if (evt) { + this.insertAtCursor(evt.target, `\n![image](${imageUpload.imageURL})\n`) + } + this.images.push(imageUpload) + return imageUpload; } async onPaste(evt: any) { diff --git a/screens/notes/PostNotesModal.vue b/screens/notes/PostNotesModal.vue index 388d1ac..3fcb811 100644 --- a/screens/notes/PostNotesModal.vue +++ b/screens/notes/PostNotesModal.vue @@ -47,7 +47,7 @@ class="block mb-3 w-6 mt-3 w-full lg:w-1/2" placeholder="Subject" v-model="subjectSelect" - :disabled="group" + :disabled="!!group" >
@@ -70,7 +70,7 @@ class="block mb-3 w-6 mt-3 w-full lg:w-1/2" placeholder="Grade" v-model="gradeSelect" - :disabled="group" + :disabled="!!group" > + +