Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IDATT2106 Scrum Team 02
Frontend
Commits
3b1f9f80
Commit
3b1f9f80
authored
1 year ago
by
Ingrid Martinsheimen Egge
Browse files
Options
Downloads
Patches
Plain Diff
gjemmer matpreferanseinnstillinger
parent
21bbe407
No related branches found
Branches containing commit
No related tags found
1 merge request
!21
Merge profilinnstillinger into main
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/ProfileSettings.vue
+30
-28
30 additions, 28 deletions
src/views/ProfileSettings.vue
with
30 additions
and
28 deletions
src/views/ProfileSettings.vue
+
30
−
28
View file @
3b1f9f80
...
...
@@ -3,14 +3,14 @@
<h1><br><br>
Profilinnstillinger
<br></h1>
<div
v-if=
"hasProfileImage"
id =
"profilepicture-container"
>
<img
width=
"100"
src=
"
../components/images/w66XcIlw.jpeg
"
alt=
"profile picture"
>
<img
width=
"100"
:
src=
"
this.currentProfile.image
"
alt=
"profile picture"
>
</div>
<div
v-else
id =
"profilepicture-container"
>
<Icon
icon=
"material-symbols:person"
:color=
iconColor
:style=
"
{ fontSize: '500px'}" />
</div>
<h2>
{{
this
.
currentP
rofile
.
name
}}
</h2>
<button
id=
"changeUserBtn"
>
Bytt bruker
</button>
<h2>
{{
p
rofile
.
name
}}
</h2>
<button
@
click=
"changeProfile"
id=
"changeUserBtn"
>
Bytt bruker
</button>
<form
@
submit.prevent=
"submit"
>
<label
for=
"brukernavn"
>
Profilnavn
</label><br>
...
...
@@ -27,12 +27,12 @@
<h3>
Profilbilde
</h3>
<div
id=
"changeUserImage"
>
<div
v-if=
"hasProfileImage"
id =
"profilepicture-container"
>
<img
width=
"50"
src=
"
../components/images/w66XcIlw.jpeg
"
alt=
"profile picture"
>
<img
width=
"50"
:
src=
"
this.currentProfile.image
"
alt=
"profile picture"
>
</div>
<div
v-else
id =
"profilepicture-container"
>
<Icon
icon=
"material-symbols:person"
:color=
iconColor
:style=
"
{ fontSize: '30px'}" />
</div>
<button>
Endre bilde
</button>
<button
@
click=
"chooseProfilePicture"
>
Endre bilde
</button>
</div>
<div
id =
"submitbuttonBox"
>
...
...
@@ -75,12 +75,12 @@
<p
class=
"infoText"
>
OBS: Kontakt admin dersom du ønsker å oppdatere epost
</p><br>
<p>
Epost:
</p
>
<p>
Epost:
{{
user
.
email
}}
</p><br
>
<label
for=
"password"
>
Endre passord
</label><br>
<input
type=
"password"
id=
"password"
>
<input
type=
"password"
id=
"password"
v-model=
"this.currentUser.newPassword"
>
<button
class=
"saveBtn"
@
click=
"saveAccountSettings"
>
Lagre
kontoinnstillinger
</button>
<button
class=
"saveBtn"
@
click=
"saveAccountSettings"
>
Lagre
nytt passord
</button>
</form>
<br>
...
...
@@ -110,8 +110,8 @@
import
{
mapStores
}
from
"
pinia
"
;
import
{
Icon
}
from
"
@iconify/vue
"
;
import
{
API
}
from
"
@/util/API
"
;
//import {useAuthStore} from "../stores/authStore";
import
{
useAuthStore
}
from
"
@/stores/authStore
"
;
import
router
from
"
../router
"
;
export
default
{
name
:
"
ProfileSettings
"
,
components
:
{
Icon
},
...
...
@@ -121,6 +121,7 @@ export default {
const
store
=
useAuthStore
();
this
.
currentProfile
.
name
=
store
.
profile
.
name
;
this
.
currentProfile
.
isRestricted
=
store
.
profile
.
restricted
;
this
.
currentProfile
.
image
=
store
.
profile
.
profileImageUrl
;
return
store
.
profile
},
user
()
{
...
...
@@ -131,36 +132,27 @@ export default {
return
"
#000000
"
},
hasProfileImage
()
{
return
false
;
//return this.profile.image.length > 0;
return
this
.
currentProfile
.
image
.
length
>
0
;
}
},
data
()
{
return
{
currentUser
:
{
username
:
"
petter@hello.no
"
,
password
:
""
,
newPassword
:
""
,
},
currentProfile
:
{
name
:
""
,
isRestricted
:
true
,
image
:
"
../components/images/w66XcIlw.jpeg
"
,
image
:
""
,
},
foodPreferences
:
[],
allergens
:
[],
deletionConfirmation
:
false
,
}
},
beforeMount
(){
//...mapStores(useAuthStore),
//TODO: Hent bruker
//todo hent profil
},
methods
:
{
saveUserSettings
(){
console
.
log
(
this
.
currentProfile
.
i
sRestricted
)
saveUserSettings
(){
//profilnavn, profilbilde, profilrestriksjoner
console
.
log
(
this
.
currentProfile
.
i
mage
)
alert
(
"
(Denne knappen gjør ingen ting) brukerinnstillinger lagret!
"
)
API
.
updateProfile
(
this
.
user
.
id
,
...
...
@@ -169,8 +161,17 @@ export default {
this
.
profile
.
image
,
);
},
saveAccountSettings
(){
alert
(
"
(Denne knappen gjør ingen ting) konto oppdatert
"
)
chooseProfilePicture
(){
alert
(
"
velgBilde
"
)
},
saveAccountSettings
(){
//passord
if
(
this
.
currentUser
.
newPassword
.
length
===
0
){
alert
(
"
Det er ikke gjort endringer, og passordet vil ikke bli oppdatert
"
)
}
else
{
alert
(
"
(Denne knappen gjør ingen ting) konto oppdatert
"
)
}
/*API.updateAccount(
this.user.id,
this.user.password,
...
...
@@ -188,10 +189,11 @@ export default {
},
deleteUser
(){
alert
(
"
(Denne knappen gjør ingen ting) bruker slettet
"
)
//API.deleteAccount(this.user.id, token).then
},
saveFoodPreferenc
e
()
{
alert
(
"
(Denne knappen gjør ingen ting) matpreferanser lagret
"
)
}
changeProfil
e
(){
router
.
push
(
"
/selectProfile
"
)
;
}
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment