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
3ec77a69
Commit
3ec77a69
authored
1 year ago
by
Ingrid Martinsheimen Egge
Browse files
Options
Downloads
Patches
Plain Diff
profilbildet kan oppdateres
parent
2ee1fd44
No related branches found
No related tags found
1 merge request
!21
Merge profilinnstillinger into main
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/EditProfile.vue
+4
-1
4 additions, 1 deletion
src/components/EditProfile.vue
src/views/HomeView.vue
+1
-3
1 addition, 3 deletions
src/views/HomeView.vue
src/views/ProfileSettings.vue
+3
-80
3 additions, 80 deletions
src/views/ProfileSettings.vue
with
8 additions
and
84 deletions
src/components/EditProfile.vue
+
4
−
1
View file @
3ec77a69
...
...
@@ -2,7 +2,7 @@
<h1><br><br>
Profilinnstillinger
<br></h1>
<div
v-if=
"hasProfileImage"
id =
"profilepicture-container"
>
<img
width=
"100"
:src=
"
this.updated
Profile
.up
Image"
alt=
"profile picture"
>
<img
width=
"100"
:src=
"
get
ProfileImage"
alt=
"profile picture"
>
</div>
<div
v-else
id =
"profilepicture-container"
>
<Icon
icon=
"material-symbols:person"
:color=
iconColor
:style=
"
{ fontSize: '500px'}" />
...
...
@@ -71,6 +71,9 @@ export default {
},
hasProfileImage
()
{
return
this
.
updatedProfile
.
upImage
.
length
>
0
;
},
getProfileImage
(){
return
this
.
updatedProfile
.
upImage
;
}
},
methods
:
{
...
...
This diff is collapsed.
Click to expand it.
src/views/HomeView.vue
+
1
−
3
View file @
3ec77a69
<
script
>
import
{
useAuthStore
}
from
"
@/stores/authStore.js
"
;
import
{
mapState
}
from
'
pinia
'
import
router
from
"
@/router
"
;
export
default
{
data
()
{
return
{
}
},
computed
:
{
...
mapState
(
useAuthStore
,
[
'
profile
'
])
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
src/views/ProfileSettings.vue
+
3
−
80
View file @
3ec77a69
...
...
@@ -6,9 +6,6 @@
</
template
>
<
script
setup
>
import
EditProfile
from
"
../components/EditProfile.vue
"
;
import
EditAccount
from
"
../components/EditAccount.vue
"
;
</
script
>
...
...
@@ -25,89 +22,15 @@ export default {
components
:
{
Icon
},
computed
:
{
...
mapStores
(
useAuthStore
),
profile
()
{
let
store
=
useAuthStore
();
this
.
currentProfile
.
name
=
store
.
profile
.
name
;
this
.
currentProfile
.
isRestricted
=
store
.
profile
.
restricted
;
this
.
currentProfile
.
image
=
store
.
profile
.
profileImageUrl
;
return
store
.
profile
},
user
()
{
const
store
=
useAuthStore
();
return
store
.
user
},
iconColor
()
{
return
"
#000000
"
},
hasProfileImage
()
{
return
this
.
currentProfile
.
image
.
length
>
0
;
}
},
data
()
{
return
{
currentUser
:
{
newPassword
:
""
,
},
currentProfile
:
{
name
:
""
,
isRestricted
:
true
,
image
:
""
,
},
foodPreferences
:
[],
allergens
:
[],
deletionConfirmation
:
false
,
beforeMount
()
{
if
(
!
useAuthStore
().
isLoggedIn
)
{
router
.
push
(
'
/login
'
)
}
},
methods
:
{
saveUserSettings
(){
//profilnavn, profilbilde, profilrestriksjoner
const
namee
=
this
.
currentProfile
.
name
;
const
isRestrictede
=
this
.
currentProfile
.
isRestricted
;
const
profileImageUrle
=
this
.
currentProfile
.
image
;
API
.
updateProfile
(
this
.
profile
.
id
,{
name
:
namee
,
profileImageUrl
:
profileImageUrle
,
restricted
:
isRestrictede
,
}
).
then
((
savedProfile
)
=>
{
useAuthStore
().
setProfile
(
savedProfile
);
}).
catch
((
error
)
=>
{
console
.
log
(
error
)
})
},
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
"
)
}
},
deleteAccount
(){
if
(
this
.
deletionConfirmation
===
false
){
alert
(
"
Du må bekrefte at du vil slette konto ved å huke av boksen
"
)
}
else
{
alert
(
"
(Denne knappen gjør ingen ting) men account deleted
"
)
//API.deleteAccount(this.user.id, token);
}
},
deleteUser
(){
alert
(
"
(Denne knappen gjør ingen ting) bruker slettet
"
)
//API.deleteAccount(this.user.id, token).then
},
changeProfile
(){
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