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
0c590be4
Commit
0c590be4
authored
1 year ago
by
Ingrid Martinsheimen Egge
Browse files
Options
Downloads
Patches
Plain Diff
rettet opp feilmeldinger
parent
0b1018f0
No related branches found
Branches containing commit
No related tags found
1 merge request
!21
Merge profilinnstillinger into main
Pipeline
#224733
failed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/EditProfile.vue
+14
-10
14 additions, 10 deletions
src/components/EditProfile.vue
with
14 additions
and
10 deletions
src/components/EditProfile.vue
+
14
−
10
View file @
0c590be4
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
<h2>
Profilinnstillinger
</h2>
<h2>
Profilinnstillinger
</h2>
<div
v-if=
"hasProfileImage"
id =
"profilepicture-container"
>
<div
v-if=
"hasProfileImage"
id =
"profilepicture-container"
>
<img
width=
"100"
:src=
"this.updatedProfile.upImage"
alt=
"profile picture"
>
<img
width=
"100"
:src=
"this.updatedProfile.upImage"
alt=
"profile picture"
>
</div>
</div>
<div
v-else
id
=
"profilepicture-contain
er"
>
<div
v-else
id
=
"#placehold
er"
>
<Icon
icon=
"material-symbols:person"
:color=
iconColor
:style=
"
{ fontSize: '500px'}" />
<Icon
icon=
"material-symbols:person"
:color=
iconColor
:style=
"
{ fontSize: '500px'}" />
</div>
</div>
<h3>
{{
this
.
profile
.
name
}}
</h3>
<h3>
{{
this
.
profile
.
name
}}
</h3>
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<form
@
submit.prevent=
"submit"
>
<form
@
submit.prevent=
"submit"
>
<label
for=
"brukernavn"
>
Profilnavn
</label><br>
<label
for=
"brukernavn"
>
Profilnavn
</label><br>
<input
type=
"text"
required
v-model=
"this.updatedProfile.upName"
><br>
<input
type=
"text"
required
id=
"brukernavn"
v-model=
"this.updatedProfile.upName"
><br>
<br>
<br>
<h3>
Brukertype
</h3>
<h3>
Brukertype
</h3>
<input
type=
"radio"
id=
"normal"
value=
"false"
name=
"restrict"
v-model=
"this.updatedProfile.upRestricted"
>
<input
type=
"radio"
id=
"normal"
value=
"false"
name=
"restrict"
v-model=
"this.updatedProfile.upRestricted"
>
...
@@ -33,8 +33,8 @@
...
@@ -33,8 +33,8 @@
</div>
</div>
<label
for=
"chooseImageUrl"
>
Bilde-URL:
</label><br>
<label
for=
"chooseImageUrl"
>
Bilde-URL:
</label><br>
<input
type=
"file"
id=
"chooseImage"
v-on:change=
"updateImage"
>
<!--
<input
type=
"file"
id=
"chooseImage"
v-on:change=
"updateImage"
>
-->
<!--
<input
type=
"text"
id=
"chooseImageUrl"
v-model=
"this.updatedProfile.upImage"
>
-->
<input
type=
"text"
id=
"chooseImageUrl"
v-model=
"this.updatedProfile.upImage"
>
</div>
</div>
<br><br>
<br><br>
...
@@ -115,17 +115,21 @@ export default {
...
@@ -115,17 +115,21 @@ export default {
id
,{
id
,{
name
:
newName
,
name
:
newName
,
profileImageUrl
:
this
.
updatedProfile
.
upImage
,
profileImageUrl
:
this
.
updatedProfile
.
upImage
,
r
estricted
:
newRestricted
,
isR
estricted
:
newRestricted
,
}
}
).
then
((
savedProfile
)
=>
{
).
then
((
savedProfile
)
=>
{
useAuthStore
().
setProfile
(
savedProfile
);
useAuthStore
().
setProfile
(
savedProfile
);
this
.
alertMsg
=
"
Profil oppdatert.
"
this
.
alertMsg
=
"
Profil oppdatert.
"
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
error
)
if
(
error
.
message
===
'
400
'
)
{
if
(
error
.
message
===
'
400
'
)
{
if
(
this
.
updatedProfile
.
name
!==
this
.
initialName
){
this
.
alertMsg
=
'
‼️Det oppsto en feil: Det finnes allerede en bruker med samme navn‼️
'
if
(
newRestricted
){
}
else
{
this
.
alertMsg
=
'
‼️Det oppsto en feil: Sørg for at det finnes mist en standard profil på kontoen‼️
'
this
.
alertMsg
=
'
‼️Det oppsto en feil: Sørg for at det finnes mist en standard profil på kontoen‼️
'
}
else
if
(
this
.
updatedProfile
.
name
!==
this
.
initialName
||
this
.
updatedProfile
.
name
)
{
this
.
alertMsg
=
'
‼️Det oppsto en feil: Det finnes allerede en bruker med samme navn‼️
'
}
}
}
else
{
}
else
{
this
.
alertMsg
=
"
‼️Det oppsto en feil.‼️
"
this
.
alertMsg
=
"
‼️Det oppsto en feil.‼️
"
...
...
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