From 61828e5be72361634e78e791983c39fcaaff06e4 Mon Sep 17 00:00:00 2001 From: Me Date: Sat, 10 Dec 2022 07:13:28 +0100 Subject: [PATCH] much progress on layout the foundations of the Friendship page in the front, also refactored some code to reuse displaying a users profile info --- .../api_back/src/users/users.controller.ts | 1 + .../DisplayAUser_backup_copy.svelte | 112 +++++++ .../ProfileDisplay_backup_copy.svelte | 305 ++++++++++++++++++ .../src/pages/profile/ProfileDisplay.svelte | 128 ++------ .../src/pages/profile/ProfileFriends.svelte | 212 ++++++++---- .../src/pages/profile/ProfilePage.svelte | 5 +- .../api_front/src/pieces/DisplayAUser.svelte | 33 ++ .../src/pieces/GenerateUserDisplay.svelte | 251 ++++++++++++++ 8 files changed, 874 insertions(+), 173 deletions(-) create mode 100644 srcs/requirements/svelte/api_front/old_unused/DisplayAUser_backup_copy.svelte create mode 100644 srcs/requirements/svelte/api_front/old_unused/ProfileDisplay_backup_copy.svelte create mode 100644 srcs/requirements/svelte/api_front/src/pieces/DisplayAUser.svelte create mode 100644 srcs/requirements/svelte/api_front/src/pieces/GenerateUserDisplay.svelte diff --git a/srcs/requirements/nestjs/api_back/src/users/users.controller.ts b/srcs/requirements/nestjs/api_back/src/users/users.controller.ts index 22b70512..6b4a4b58 100644 --- a/srcs/requirements/nestjs/api_back/src/users/users.controller.ts +++ b/srcs/requirements/nestjs/api_back/src/users/users.controller.ts @@ -50,6 +50,7 @@ export class UsersController { @Get('search') findOneByUsername(@Query('username') username: string, @Req() req) { const user : User = req.user; + console.log('searching for user' + user.username); return this.usersService.findOneByUsername(user.id.toString(),username); } diff --git a/srcs/requirements/svelte/api_front/old_unused/DisplayAUser_backup_copy.svelte b/srcs/requirements/svelte/api_front/old_unused/DisplayAUser_backup_copy.svelte new file mode 100644 index 00000000..85d8fe4e --- /dev/null +++ b/srcs/requirements/svelte/api_front/old_unused/DisplayAUser_backup_copy.svelte @@ -0,0 +1,112 @@ + + +{#if user !== undefined} + +{:else} +

Sorry

+
Failed to load user {aUsername}
+{/if} + + + + \ No newline at end of file diff --git a/srcs/requirements/svelte/api_front/old_unused/ProfileDisplay_backup_copy.svelte b/srcs/requirements/svelte/api_front/old_unused/ProfileDisplay_backup_copy.svelte new file mode 100644 index 00000000..2dd2ac44 --- /dev/null +++ b/srcs/requirements/svelte/api_front/old_unused/ProfileDisplay_backup_copy.svelte @@ -0,0 +1,305 @@ + + + +
+ {#if user !== undefined} +
+ + + default user icon +
{user.username}
+
Rank: + + + + + + + + + + + + + + + + + {rank} + +
+
+

Match Statistics

+

Total: {user.stats.totalGame}

+

Victories: {user.stats.winGame}

+

Losses: {user.stats.loseGame}

+

Draws: {user.stats.drawGame}

+
+
+ {/if} +
+ +
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+
testing when there's tons of stuff
+ + + + + \ No newline at end of file diff --git a/srcs/requirements/svelte/api_front/src/pages/profile/ProfileDisplay.svelte b/srcs/requirements/svelte/api_front/src/pages/profile/ProfileDisplay.svelte index e7095d88..46b7c62b 100644 --- a/srcs/requirements/svelte/api_front/src/pages/profile/ProfileDisplay.svelte +++ b/srcs/requirements/svelte/api_front/src/pages/profile/ProfileDisplay.svelte @@ -1,129 +1,32 @@ -{#if user !== undefined} -
- - - default user icon -
{user.username}
-
Rank: - - - - - - - - - - - - - - - - - {rank} - -
-
-

Match Statistics

-

Total: {user.stats.totalGame}

-

Victories: {user.stats.winGame}

-

Losses: {user.stats.loseGame}

-

Draws: {user.stats.drawGame}

-
-
-{/if} +
+ + {#if user !== undefined} + + {:else} + +

Sorry

+
Failed to load current
+ {/if} +
testing when there's tons of stuff
testing when there's tons of stuff
@@ -161,6 +64,11 @@ \ No newline at end of file diff --git a/srcs/requirements/svelte/api_front/src/pieces/GenerateUserDisplay.svelte b/srcs/requirements/svelte/api_front/src/pieces/GenerateUserDisplay.svelte new file mode 100644 index 00000000..2cbde491 --- /dev/null +++ b/srcs/requirements/svelte/api_front/src/pieces/GenerateUserDisplay.svelte @@ -0,0 +1,251 @@ + + + +
+ {#if user !== undefined} +
+ + + default user icon +
{user.username}
+
Rank: + + + + + + + + + + + + + + + + + {rank} + +
+
+

Match Statistics

+

Total: {user.stats.totalGame}

+

Victories: {user.stats.winGame}

+

Losses: {user.stats.loseGame}

+

Draws: {user.stats.drawGame}

+
+
+ {/if} +
+ + + + \ No newline at end of file