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
6094f1a3
Commit
6094f1a3
authored
2 years ago
by
Ingrid Martinsheimen Egge
Browse files
Options
Downloads
Patches
Plain Diff
beskrivende feilmeldinger ved filopplasting på profilside
parent
c17b9024
No related branches found
No related tags found
1 merge request
!26
Profilmeldinger
Pipeline
#226113
passed
2 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/EditProfile.vue
+27
-6
27 additions, 6 deletions
src/components/EditProfile.vue
src/views/SettingsView.vue
+0
-3
0 additions, 3 deletions
src/views/SettingsView.vue
with
27 additions
and
9 deletions
src/components/EditProfile.vue
+
27
−
6
View file @
6094f1a3
...
...
@@ -52,7 +52,6 @@ import { useAuthStore } from "@/stores/authStore";
import
router
from
"
../router
"
;
export
default
{
name
:
"
EditProfile
"
,
components
:
{
Icon
},
data
()
{
return
{
alertMsg
:
''
,
...
...
@@ -69,11 +68,8 @@ export default {
upImage
:
"
profile/default_avatar.png
"
,
}
},
iconColor
()
{
return
"
#D9D9D9
"
},
},
beforeMount
()
{
//used to compare with changed values
beforeMount
()
{
if
(
this
.
profile
.
profileImageUrl
!==
''
){
this
.
image
=
this
.
profile
.
profileImageUrl
;
}
...
...
@@ -83,12 +79,23 @@ export default {
router
.
push
(
"
/selectProfile
"
);
},
updateImg
()
{
this
.
alertMsg
=
""
let
file
=
document
.
getElementById
(
"
profile_img
"
).
files
[
0
];
let
fileSize
=
file
.
size
let
reader
=
new
FileReader
();
reader
.
onload
=
function
(
ev
)
{
document
.
getElementById
(
"
profile_img_preview
"
).
src
=
ev
.
target
.
result
;
};
reader
.
readAsDataURL
(
file
);
if
(
fileSize
>
524288
){
//if image is bigger than 512kB
this
.
alertMsg
=
"
Bildet er for stort (
"
+
Math
.
ceil
(
fileSize
/
1024
)
+
"
kB) Maksimal bildestørrelse er 512kB
"
}
if
(
file
.
name
.
split
(
'
.jpeg
'
).
length
===
1
&&
file
.
name
.
split
(
'
.jpg
'
).
length
===
1
){
this
.
alertMsg
=
"
filtypen støttes ikke (bildet må være av type .jpg/.jpeg)
"
}
},
async
deleteProfile
()
{
const
id
=
this
.
profile
.
id
;
...
...
@@ -198,7 +205,22 @@ img {
justify-content
:
space-between
;
}
input
[
type
=
file
]
::file-selector-button
{
background-color
:
base
.
$light-green
;
color
:
base
.
$white
;
border
:
none
;
font-weight
:
bold
;
padding
:
8px
14px
;
width
:
50%
;
border-radius
:
10px
;
cursor
:
pointer
;
margin
:
10px
;
transition
:
color
.2s
;
}
input
[
type
=
file
]
::file-selector-button:hover
{
background-color
:
base
.
$light-green-hover
;
}
...
...
@@ -263,7 +285,6 @@ button {
display
:
flex
;
width
:
100%
;
justify-content
:
center
;
color
:
base
.
$light-green
;
font-weight
:
bold
;
}
</
style
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/views/SettingsView.vue
+
0
−
3
View file @
6094f1a3
...
...
@@ -27,9 +27,6 @@ export default {
components
:
{
Icon
},
computed
:
{
...
mapStores
(
useAuthStore
),
iconColor
()
{
return
"
#000000
"
},
},
beforeMount
()
{
if
(
!
useAuthStore
().
isLoggedIn
)
{
...
...
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