Skip to content

Commit

Permalink
Worked on some enhancementes <settings and user profile update and da…
Browse files Browse the repository at this point in the history
…shboard.>
  • Loading branch information
Mahmoud-Emad committed Oct 30, 2023
1 parent 02db95a commit 33979fd
Show file tree
Hide file tree
Showing 17 changed files with 584 additions and 433 deletions.
8 changes: 4 additions & 4 deletions client/src/apis/users/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class Users {
}
}

public async getUserByID(id: number) {
// Request to get user based on his user id.
public async getUserByID(id: number): Promise<UserInterface> {
// Request to get user based on his user id.
try {
return await (
await http.get(`/users?id=${id}`)
await http.get(`/users/${id}`)
).data.results;
} catch (error) {
throw new Error(error.response.data.message);
Expand Down Expand Up @@ -125,7 +125,7 @@ class Users {
}
}

async updateProfile(registerData: registeringData) {
async updateProfile(registerData: UserInterface) {
// Update user profile
try {
return await (
Expand Down
4 changes: 2 additions & 2 deletions client/src/componants/dashboard/GreatAndHint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
</script>

<strong>
Hello
Hey
<span class="text-primary">
{$UserStore.full_name}!,
{$UserStore.full_name.length > 2 ? $UserStore.full_name : 'There'}!,
</span>
{header}
</strong>
Expand Down
52 changes: 39 additions & 13 deletions client/src/componants/dashboard/Tabs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import VacationBalance from "../vacations/VacationBalance.svelte"
import UserVacationBalance from "../vacations/UserVacationBalance.svelte"
import GreatAndHint from "./GreatAndHint.svelte"
import UpdateProfile from '../settings/UpdateProfile.svelte';
let date: Date = new Date();
</script>

Expand Down Expand Up @@ -38,7 +39,7 @@
aria-selected="false"
>Update User Vacation Balance</a
>
<a
<!-- RFNV1.0 <a
class="nav-link navtab mb-2"
id="v-tabs-home-tab"
data-mdb-toggle="tab"
Expand All @@ -47,8 +48,8 @@
aria-controls="v-tabs-home"
aria-selected="true"
>Evaluation Form</a
>
<a
> -->
<!-- RFNV1.0 <a
class="nav-link navtab mb-2"
id="v-tabs-user-eval-tab"
data-mdb-toggle="tab"
Expand All @@ -57,8 +58,8 @@
aria-controls="v-tabs-user-eval"
aria-selected="false"
>User Evaluation Form</a
>
<a
> -->
<!-- RFNV1.0 <a
class="nav-link navtab mb-2"
id="v-tabs-user-docs-tab"
data-mdb-toggle="tab"
Expand All @@ -67,7 +68,7 @@
aria-controls="v-tabs-user-docs"
aria-selected="false"
>User Documents</a
>
> -->
<a
class="nav-link navtab mb-2"
id="v-tabs-office-tab"
Expand All @@ -88,6 +89,17 @@
aria-selected="false"
>Add new user</a
>
<a
class="nav-link navtab mb-2"
id="v-tabs-update-user-tab"
data-mdb-toggle="tab"
href="#v-tabs-update-user"
role="tab"
aria-controls="v-tabs-update-user"
aria-selected="false"
>
Update user profile
</a>
</div>
</div>
<div class="col-9">
Expand Down Expand Up @@ -115,13 +127,13 @@
>
<div class="height-100">
<GreatAndHint
header={"tThis is the user balance of year " + date.getFullYear()}
header={"This is the user balance of year " + date.getFullYear()}
hint={"The user also has an old balance object, we reset this old balance values to zeros on the first day of march month every year as a cron job, you can always check and if you find these values not zeros after `1/3/*years` you can delete all old balances by checking the checkbox below."}
/>
<UserVacationBalance />
</div>
</div>
<div
<!-- RFNV1.0 <div
class="tab-pane fade"
id="v-tabs-home"
role="tabpanel"
Expand All @@ -134,8 +146,8 @@
/>
<Evaluation />
</div>
</div>
<div
</div> -->
<!-- RFNV1.0 <div
class="tab-pane fade"
id="v-tabs-user-eval"
role="tabpanel"
Expand All @@ -148,8 +160,8 @@
/>
<UserEvaluation />
</div>
</div>
<div
</div> -->
<!-- RFNV1.0 <div
class="tab-pane fade"
id="v-tabs-user-docs"
role="tabpanel"
Expand All @@ -162,7 +174,7 @@
/>
<UserDocuments />
</div>
</div>
</div> -->
<div
class="tab-pane fade"
id="v-tabs-office"
Expand Down Expand Up @@ -191,6 +203,20 @@
<Register />
</div>
</div>
<div
class="tab-pane fade"
id="v-tabs-update-user"
role="tabpanel"
aria-labelledby="v-tabs-update-user-tab"
>
<div class="height-100">
<GreatAndHint
header={"Update user profile"}
hint={"You can update the user information using this form."}
/>
<UpdateProfile />
</div>
</div>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions client/src/componants/settings/ChangePassword.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-6">
<div class="col-12">
<div class="form-outline">
<Input
type="password"
Expand All @@ -37,7 +37,7 @@
/>
</div>
</div>
<div class="col-6">
<div class="col-12">
<div class="form-outline">
<Input
type="password"
Expand Down
2 changes: 1 addition & 1 deletion client/src/componants/settings/ColorPicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</script>

<ColorInput bind:color className={"input"} title={color.toHexString()} showAlphaSlider />
<ColorInput bind:color title={color.toHexString()} showAlphaSlider />

<svelte:head>
<style>
Expand Down
Loading

0 comments on commit 33979fd

Please sign in to comment.