-
Notifications
You must be signed in to change notification settings - Fork 3
Teams 2 #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Teams 2 #123
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
f7fd2a7
wip, one request, one team, via foreign keys
sezanzeb 537c065
project image fix, notification when saving team or project, readme s…
sezanzeb 3a12ffd
readme
sezanzeb a62f678
readme
sezanzeb abd1fd5
change screenshot-1.jpg
sezanzeb b1b4379
fix docs link
sezanzeb f2bd846
Merge branch 'main' into teams2
sezanzeb 299124c
backend tests passing
sezanzeb babc71a
lint and typecheck
sezanzeb e8bd20c
Some work on the frontend
sezanzeb 9cd0b92
typecheck
sezanzeb ac55538
eager load user.team
sezanzeb b973f6c
lasjdflksajd
sezanzeb 76f75df
fix user.team missing in token response
sezanzeb 5e88293
wip
sezanzeb 71e71eb
potentially working
sezanzeb 12b5949
wip team.owner
sezanzeb 740e5ce
various
sezanzeb e0cd89f
various
sezanzeb c129d71
Add types to StackWithBorder and TeamMember, fix all typecheck errors…
Copilot 688e098
add setOwner to mock-teams-service
sezanzeb 0259f85
wip auth.spec.ts
sezanzeb ed21c5f
wip auth.spec.ts
sezanzeb 4d8b226
wip auth.spec.ts
sezanzeb 98bb0fc
wip auth.spec.ts
sezanzeb b79f486
auth.spec.ts done
sezanzeb 8b56b4b
lint, prettier
sezanzeb a4c983f
reload parent component instead of history go
sezanzeb 7fdc4a8
copilot review
sezanzeb 2584796
copilot review
sezanzeb 7d276da
Add tests for `// TODO test` comments; remove resolved TODOs (#126)
Copilot cbf1ba7
add test
sezanzeb 52e1e72
fix recursion depth error when creating team. Some css fixes
sezanzeb 80ca3bd
small stuff
sezanzeb 95b835f
unused import
sezanzeb 3aeef99
user.team set after team created, warning if not allowed to rate
sezanzeb 844ce4f
prettier
sezanzeb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,56 @@ | ||
| import { Column, Entity, PrimaryGeneratedColumn } from "typeorm"; | ||
| import { | ||
| Column, | ||
| Entity, | ||
| PrimaryGeneratedColumn, | ||
| OneToMany, | ||
| OneToOne, | ||
| JoinColumn, | ||
| } from "typeorm"; | ||
| import { Longtext } from "./longtext"; | ||
| import { User } from "./user"; | ||
|
|
||
| @Entity() | ||
| export class Team { | ||
| @PrimaryGeneratedColumn() | ||
| public readonly id!: number; | ||
| @Column({ length: 1024 }) | ||
| public title!: string; | ||
| // TODO many-to-many instead of simple-array (array of userId strings) | ||
| @Column("simple-array") | ||
| public users!: string[]; | ||
| // TODO rename teamImg to image | ||
| @Column() | ||
| public teamImg!: string; | ||
| @Longtext() | ||
| public description!: string; | ||
| // TODO many-to-many instead of simple-array (array of userId strings) | ||
| @Column("simple-array") | ||
| public requests!: string[]; | ||
| // The owner also has to have their user.team property set to this team. | ||
| // Beware that this is not eagerly loaded, because it will throw recursion depth | ||
| // errors due to user.team being eagerly loaded already. Add it to "relations" | ||
| // when doing database queries instead. | ||
| @OneToOne(() => User) | ||
| @JoinColumn() | ||
| public owner!: User; | ||
| @OneToMany(() => User, (user) => user.teamRequest) | ||
| public requests!: User[]; | ||
| @OneToMany(() => User, (user) => user.team) | ||
| public users!: User[]; | ||
|
|
||
|
sezanzeb marked this conversation as resolved.
|
||
| /** | ||
| * List of user ids that are part of the team. | ||
| */ | ||
| public userIds(): number[] { | ||
| if (!this.users) { | ||
| return []; | ||
| } | ||
|
|
||
| return this.users.map(({ id }) => id); | ||
| } | ||
|
|
||
| /** | ||
| * List of user ids that requested to join the team. | ||
| */ | ||
| public requestUserIds(): number[] { | ||
| if (!this.requests) { | ||
| return []; | ||
| } | ||
|
|
||
| return this.requests.map(({ id }) => id); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.