Skip to content

Commit

Permalink
Development (#369)
Browse files Browse the repository at this point in the history
* 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 54b9d37.

* 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 54b9d37.

* 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 <[email protected]>
Co-authored-by: Vansh Sethi <[email protected]>
Co-authored-by: Jeff Huang <[email protected]>
Co-authored-by: Eshwar Chock <[email protected]>
Co-authored-by: Jeffrey Zhang <[email protected]>

Co-authored-by: Andre Benedito <[email protected]>
Co-authored-by: Vansh Sethi <[email protected]>
Co-authored-by: Jeff Huang <[email protected]>
Co-authored-by: Eshwar Chock <[email protected]>
Co-authored-by: Jeffrey Zhang <[email protected]>

* 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 54b9d37.

* 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 <[email protected]>
Co-authored-by: Vansh Sethi <[email protected]>
Co-authored-by: Jeff Huang <[email protected]>
Co-authored-by: Eshwar Chock <[email protected]>
Co-authored-by: Jeffrey Zhang <[email protected]>

* 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 54b9d37.

* 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 <[email protected]>
Co-authored-by: Vansh Sethi <[email protected]>
Co-authored-by: Jeff Huang <[email protected]>
Co-authored-by: Eshwar Chock <[email protected]>
Co-authored-by: Jeffrey Zhang <[email protected]>

* 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

Co-authored-by: Andre Benedito <[email protected]>
Co-authored-by: Vansh Sethi <[email protected]>
Co-authored-by: Jeff Huang <[email protected]>
Co-authored-by: Eshwar Chock <[email protected]>
Co-authored-by: Jeffrey Zhang <[email protected]>
Co-authored-by: Edwin Zheng <[email protected]>
Co-authored-by: Blue-FlipFlop <[email protected]>
  • Loading branch information
8 people authored Sep 11, 2020
1 parent 12412e6 commit 3df58b0
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 106 deletions.
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Welcome to Quento, a collection of utilities created by students, for students. Quento is an open source web app created by high school students using Vue.js, with the sole purpose of creating and compiling useful software to a single location to help students better manage their education.

## Build Setup
```
```bash
# install dependencies
$ npm install # Or yarn install

Expand Down Expand Up @@ -115,6 +115,54 @@ div Layout Main
(etc.)
```

# Types and Objects which power this project
All files are imported to the Vue Application through `~\types\index.ts`

```bash
index.ts
├── Notes.ts
|________OBJECTS_____
├── class Note
├── interface Note_t
├── interface Note_t_F
├── type Note_t_A
├── interface Note extends Note_t
├── DEPEDANT ON: Subjects.ts
├── Subjects.ts
|________OBJECTS_____
├── const{Group} SubjectGroups -> Sub-Subjects
├── const[number] AllSubjects -> Subjects
├── type Subject_O
├── const[Subjects] SubjectList -> default:empty
├── const{Subject} SubjectOptions -> true|false
├── const{Subject} SubjectIconList -> bx-___
├── type SubjectGroup_O
├── const[SubjectGroup_O] SubjectGroupList -> default:empty
├ DEPENDANT ON : Schools.ts
├── Schools.ts
|________OBJECTS_____
├── const[number] SchoolList -> Schools
├── type School_O
├── Suggestions.ts
├──
├── Users.ts
├── DEPENDANT ON: Subjects.ts, Groups.ts
├── Questions.ts
├── DEPENDANT ON: Schools.ts, Subjects.ts, firebaseTypes.ts
├── Responses.ts
├── DEPENDANT ON: firebaseTypes.ts
├── Newsletters.ts
├──
├── firebaseTypes.ts
├── DEPENDANT ON: Not firebase apparently
```

# Store Management
All store is based around util/store-accessor.ts

# Firebase
Store files -> firestore.ts -> firebase.ts

## Documentation/Dependencies
For detailed explanation on how things work, checkout the following docs:

Expand Down
5 changes: 3 additions & 2 deletions components/NotesCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,9 @@ export default class NotesCard extends Vue {
return notesStore.likedPosts?.includes(id)
}
async toggleLike(id?: string, time?: any) {
if (!id || this.disabled) return
async toggleLike(id: string, time?: any) {
if (this.disabled) return
const a = this.$vs.loading()
await notesStore.ToggleLikedNote(id)
a.close()
Expand Down
2 changes: 2 additions & 0 deletions pages/notes/_id.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export default class NotesContentPage extends Vue {
}
notesStore.IncrementView(this.noteId);
this.note = Note.fromFirebase(noteData, doc.id)
//Add note to activeNotes so functions work
notesStore.pushActiveNotes(this.note)
loading.close()
return
} catch (error) {
Expand Down
45 changes: 33 additions & 12 deletions store/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ import { authStore } from './index'
import { firestore as store } from 'firebase/app'
import { Note, Note_t, Note_t_F } from '~/types/notes'
import storage from '~/plugins/firebaseStorage'

// Fix the google
import {
Grade_O,
SubjectList,
Subject_O,
SortOptions_O,
SubjectList,
FilterOptions
} from '~/types/subjects'

import { School_O } from '~/types/schools'
import functions from '~/plugins/firebaseFunctions'
import { HourDiff } from '~/utils/time'


let LastVisible: store.QueryDocumentSnapshot<store.DocumentData> | null = null

@Module({ stateFactory: true, name: 'notes', namespaced: true })
Expand Down Expand Up @@ -69,7 +68,7 @@ export default class NotesModule extends VuexModule {
LastVisible = null
this.EndOfList = false
}

@Action({ rawError: true })
public SetEditNote(note: Note | null) {
this.SET_EDIT_NOTE(note)
Expand Down Expand Up @@ -129,43 +128,64 @@ export default class NotesModule extends VuexModule {

@Action({ rawError: true })
public async ToggleLikedNote(id: string) {
//==============Change server side==============
const batch = firestore.batch()
//Getting the docuument in which the users, and notes live in
const userRef = firestore.collection('users').doc(authStore.user?.uid)
const noteRef = firestore.collection('notes').doc(id)

//id = xr2pf0aOW4ZZgIBefOXA

if (this.likedPosts?.includes(id)) {
//Unliking the post
batch.update(userRef, {
likedNotes: store.FieldValue.arrayRemove(id)
})
batch.update(noteRef, {
upVotes: store.FieldValue.increment(-1)
})
} else {
//Liking the post
batch.update(userRef, {
likedNotes: store.FieldValue.arrayUnion(id)
})
batch.update(noteRef, {
upVotes: store.FieldValue.increment(1)
})
}

//Commit the change
await batch.commit()
this.TOGGLE_LIKED_SUGGESTION(id)

//==============Change client side==============
this.toggleLikedClient(id)
return
}

@Mutation
private TOGGLE_LIKED_SUGGESTION(suggestionId: string) {
private toggleLikedClient(suggestionId: string) {
//If userdata doesn't exist
if (!authStore.userData) return
//Get liked notes from userData
const { likedNotes } = authStore.userData
var index = likedNotes?.indexOf(suggestionId)
const suggestionIndex = this.ActiveNotes.findIndex(
(doc) => doc.id! == suggestionId
)!
const suggestionIndex = this.ActiveNotes.findIndex((doc) => doc.id! == suggestionId)!

if (index !== -1) {
//Liking a post
this.ActiveNotes[suggestionIndex].upVotes++
} else {
this.ActiveNotes[suggestionIndex].upVotes != 0
//Disliking a post
this.ActiveNotes[suggestionIndex].upVotes > 0
? this.ActiveNotes[suggestionIndex].upVotes--
: ''
: console.log("YOU TRIED TO DISLIKE A POST WITH > 0 LIKES")
}
}

@Mutation
public pushActiveNotes(noteInQuestion: Note){
if (!this.ActiveNotes.some(note => note.id === noteInQuestion.id)) {
this.ActiveNotes.push(noteInQuestion)
}
}

Expand All @@ -177,6 +197,7 @@ export default class NotesModule extends VuexModule {
this.ActiveNotes.push(...notes)
}

//Load more notes for a list
@Action({ rawError: true })
public async GetMoreNotes(start = false) {
if (this.EndOfList) {
Expand Down Expand Up @@ -224,7 +245,7 @@ export default class NotesModule extends VuexModule {
const notes = await Promise.all(
rankingDocs.docs
.map((doc) => {
if(!doc.data().parentPath) console.log({ parentPath: doc.data().parentPath, docData : doc.data() });
if(!doc.data().parentPath) console.log("(In noteStore/NotesModule/GetMoreNotes function " , { parentPath: doc.data().parentPath, docData : doc.data() });
return firestore.doc(doc.data().parentPath).get()
})
.map(async (docPromise) =>
Expand Down
21 changes: 13 additions & 8 deletions types/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ export interface Note_t {

subject: Subject_O
grade: Grade_O
//Unique
id?: string

groupId ?: string;
groupName ?: string;
}

// Firebase Interface
export interface Note_t_F {
// How the data is stored in firebase
title: string
uid: string
userDisplayName: string
Expand All @@ -42,28 +44,30 @@ export interface Note_t_F {
images?: string[]
contents : string
storedImages?: StoredImage[]
school ?: School_O;

createdAt: Date_t_F

upVotes: number
views: number

subject: Subject_O
school ?: School_O;
grade: Grade_O
views: number

groupId?: string
groupName ?: string;
//Unique to this one
magicRank?: number
groupId?: string
}

//Julius Caesar, to Brutus in actual Latin (circa 45 BC)
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
export type Note_t_A = Omit<Note_t_F, 'createdAt'> & {
createdAt: Date_t_A | Date
gradeName: string
objectID: string
}


export class Note {
export class Note{
constructor(opts: Note_t) {
return Object.assign(this, opts)
}
Expand Down Expand Up @@ -93,4 +97,5 @@ export class Note {
return new Note(obj)
}
}
export interface Note extends Note_t {}

export interface Note extends Note_t {}
4 changes: 2 additions & 2 deletions types/schools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const SchoolList = [
'Longfields-Davidson Heights Secondary School',
'Merivale High School',
'John McCrae Secondary School',
"École Secondaire Catholique Pierre-Savard",
'École Secondaire Catholique Pierre-Savard',
'Other'
] as const

export type School_O = typeof SchoolList[number]
export type School_O = typeof SchoolList[number]
Loading

0 comments on commit 3df58b0

Please sign in to comment.