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-2024-07
frontend
Commits
21dce708
Commit
21dce708
authored
1 year ago
by
Victor Ekholt Gunrell Kaste
Browse files
Options
Downloads
Patches
Plain Diff
feat: Translated to norwegian
parent
c11f9f51
No related branches found
Branches containing commit
No related tags found
1 merge request
!82
feat: Added info for saved so far and end date to elements in list. And...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/SavingGoal/SavingGoalCreate.vue
+23
-20
23 additions, 20 deletions
src/components/SavingGoal/SavingGoalCreate.vue
with
23 additions
and
20 deletions
src/components/SavingGoal/SavingGoalCreate.vue
+
23
−
20
View file @
21dce708
<
script
setup
lang=
"ts"
>
import
{
GoalService
,
type
CreateGoalDTO
,
type
GoalDTO
}
from
"
@/api
"
import
{
ref
}
from
"
vue
"
;
import
{
ref
,
defineProps
,
defineEmits
}
from
"
vue
"
;
const
emits
=
defineEmits
([
'
createGoalClicked
'
]);
const
name
=
ref
(
""
)
const
desc
=
ref
(
""
)
...
...
@@ -10,13 +12,6 @@ const createdConfirm = ref("");
const
errorMessage
=
ref
(
""
)
const
createGoalClick
=
async
()
=>
{
console
.
log
(
"
create goal clicked
"
)
console
.
log
(
name
.
value
)
console
.
log
(
desc
.
value
)
console
.
log
(
date
.
value
)
console
.
log
(
amount
.
value
)
const
createGoalPayload
:
CreateGoalDTO
=
{
name
:
name
.
value
,
description
:
desc
.
value
,
...
...
@@ -28,8 +23,9 @@ const createGoalClick = async () => {
try
{
let
response
=
await
GoalService
.
createGoal
({
requestBody
:
createGoalPayload
});
if
(
response
.
name
!=
""
)
{
createdConfirm
.
value
=
"
Your goal has been created!
Refresh the page to se it in the list
"
createdConfirm
.
value
=
"
Your goal has been created!
"
errorMessage
.
value
=
""
emits
(
'
createGoalClicked
'
,
response
)
}
}
catch
(
error
:
any
)
{
console
.
log
(
error
.
message
);
...
...
@@ -41,36 +37,37 @@ const createGoalClick = async () => {
<
template
>
<div
class=
"col-lg-8"
>
<h1>
Create a new saving goa
l!
</h1>
<h1>
Lag et nytt sparemå
l!
</h1>
<br>
<p>
Create a name for this saving goal
</p>
<p>
Gi sparemålet et navn
</p>
<div
class=
"input-group mb-3"
>
<span
class=
"input-group-text"
id=
"basic-addon1"
>
Name
</span>
<input
v-model=
"name"
type=
"text"
class=
"form-control"
placeholder=
"Name of Saving Goal"
aria-label=
"Username"
aria-describedby=
"basic-addon1"
required
>
<span
class=
"input-group-text"
id=
"basic-addon1"
>
Navn
</span>
<input
v-model=
"name"
type=
"text"
class=
"form-control"
placeholder=
"Navn på sparemålet"
aria-label=
"Username"
aria-describedby=
"basic-addon1"
required
>
</div>
<p>
Add a d
es
c
ri
ption to this saving goal
</p>
<p>
Legg til en b
es
k
ri
velse for sparemålet
</p>
<div
class=
"input-group mb-3"
>
<span
class=
"input-group-text"
id=
"basic-addon2"
>
D
es
c
ri
ption
</span>
<span
class=
"input-group-text"
id=
"basic-addon2"
>
B
es
k
ri
velse
</span>
<textarea
v-model=
"desc"
class=
"form-control"
aria-label=
"With textarea"
></textarea>
</div>
<!--Change this to date picker?-->
<p>
When should this saving goal end
?
</p>
<p>
Når skal pengene være spart
?
</p>
<div
class=
"input-group mb-3"
>
<input
v-model=
"date"
type=
"date"
class=
"form-control"
aria-label=
"Amount of days"
placeholder=
"Amount of days (as number)"
required
>
<input
v-model=
"date"
type=
"date"
class=
"form-control"
aria-label=
"Amount of days"
required
>
</div>
<p>
H
ow much do you want to save during this saving goal?
</p>
<p>
H
vor mye vil du spare?
</p>
<div
class=
"input-group"
>
<input
v-model=
"amount"
type=
"number"
class=
"form-control"
aria-label=
"
"
placeholder=
"NOK (as number)
"
required
>
<input
v-model=
"amount"
type=
"number"
class=
"form-control"
aria-label=
"
NOK
"
required
>
<span
class=
"input-group-text"
>
NOK
</span>
</div>
<br>
<button
class=
"btn btn-primary btn-lg"
@
click=
"createGoalClick"
>
Create goal!
</button>
<div
style=
"color: green; font-size: 32px
"
>
<div
class=
"confirmMessage
"
>
{{
createdConfirm
}}
</div>
...
...
@@ -87,4 +84,10 @@ const createGoalClick = async () => {
padding-right
:
56px
;
padding-bottom
:
28px
;
}
.confirmMessage
{
color
:
green
;
font-size
:
32px
;
min-height
:
100px
;
}
</
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