Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
55c5a856
Commit
55c5a856
authored
1 year ago
by
Jakob Grønhaug
Browse files
Options
Downloads
Patches
Plain Diff
småfikser i brukerflyt ved å opprette profil
parent
7fdc2962
No related branches found
No related tags found
1 merge request
!29
småfikser i brukerflyt ved å opprette profil
Pipeline
#226498
failed with stages
in 2 minutes and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/ProfileCreationView.vue
+39
-8
39 additions, 8 deletions
src/views/ProfileCreationView.vue
with
39 additions
and
8 deletions
src/views/ProfileCreationView.vue
+
39
−
8
View file @
55c5a856
...
...
@@ -12,7 +12,9 @@ export default {
profileImageUrl
:
""
,
name
:
""
,
isRestricted
:
false
}
},
pin
:
""
,
errorMsg
:
""
};
},
methods
:
{
...
...
@@ -25,15 +27,21 @@ export default {
if
(
typeof
image
===
'
undefined
'
)
{
this
.
authStore
.
profile
=
profile
;
this
.
authStore
.
profiles
.
push
(
profile
);
router
.
push
(
"
/
"
);
}
else
{
API
.
uploadProfileImage
(
image
,
id
)
.
then
((
updatedProfile
)
=>
{
this
.
authStore
.
profile
=
updatedProfile
;
this
.
authStore
.
profiles
.
push
(
profile
);
router
.
push
(
"
/
"
);
});
}
API
.
uploadProfileImage
(
image
,
id
)
.
then
((
updatedProfile
)
=>
{
this
.
authStore
.
profile
=
updatedProfile
;
router
.
push
(
"
/
"
);
});
})
.
catch
(()
=>
{
this
.
errorMsg
=
"
Oops! Dette navnet er allerede i bruk på en annen profil, bruk et annet navn
"
})
},
updateImg
()
{
let
file
=
document
.
getElementById
(
"
profile_img
"
).
files
[
0
];
...
...
@@ -68,9 +76,14 @@ export default {
<input
name=
"name"
type=
"text"
v-model=
"profile.name"
>
<div
class=
"check_container"
>
<label
for=
"limited"
>
Begrenset:
</label>
<input
type=
"checkbox"
name=
"limited"
id=
"limited"
>
<input
type=
"checkbox"
v-model=
"this.profile.isRestricted"
name=
"limited"
id=
"limited"
>
</div>
<div
v-if=
"!this.profile.isRestricted"
class=
"pincode-container"
>
<label
for=
"pincode-field"
>
PIN:
</label>
<input
id=
"pincode-field"
type=
"tel"
v-model=
"pin"
maxlength=
"4"
placeholder=
"0000"
/>
</div>
</form>
<p>
{{
this
.
errorMsg
}}
</p>
<button
@
click=
"submit"
>
Opprett
</button>
</main>
</
template
>
...
...
@@ -101,6 +114,10 @@ main {
form
{
gap
:
$gap
;
}
p
{
max-width
:
20em
;
}
}
#profile_img_label
{
...
...
@@ -153,6 +170,21 @@ main {
transition
:
all
350ms
eases
;
}
.pincode-container
{
width
:
100%
;
display
:
flex
;
input
{
border-radius
:
.2em
;
border
:
1px
solid
black
;
height
:
50px
;
width
:
105px
;
margin
:
0
5px
;
font-size
:
38px
;
padding
:
5px
;
}
}
form
{
display
:
flex
;
flex-direction
:
column
;
...
...
@@ -166,7 +198,6 @@ button {
border-radius
:
.5rem
;
background-color
:
$light-green
;
color
:
white
;
font-weight
:
bold
;
}
</
style
>
\ No newline at end of file
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