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
c553fc48
Commit
c553fc48
authored
1 year ago
by
Ingrid Martinsheimen Egge
Browse files
Options
Downloads
Patches
Plain Diff
Fjernet komponent
parent
f91b7cc5
No related branches found
Branches containing commit
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/AppSettings.vue
+0
-38
0 additions, 38 deletions
src/components/AppSettings.vue
src/components/FridgeItem.vue
+8
-10
8 additions, 10 deletions
src/components/FridgeItem.vue
src/views/FridgeView.vue
+1
-1
1 addition, 1 deletion
src/views/FridgeView.vue
with
9 additions
and
49 deletions
src/components/AppSettings.vue
deleted
100644 → 0
+
0
−
38
View file @
f91b7cc5
<
template
>
<h1>
App-innstillinger
</h1>
<form
@
submit.prevent=
"submit"
>
<h2>
-Matpreferanser-
</h2>
<p
class =
"infoText"
>
Hvis huket av, så vil du kun få oppskrifter av disse typene:
</p>
<input
type=
"checkbox"
id=
"vegetar"
name=
"vegetar"
value=
"vegetar"
>
<label
for=
"vegetar"
>
vegetar
</label><br>
<input
type=
"checkbox"
id=
"vegan"
name=
"vegan"
value=
"vegan"
>
<label
for=
"vegan"
>
vegan
</label><br>
<br>
<h2>
-Allergener-
</h2>
<p
class =
"infoText"
>
Du vil ikke få forslag om oppskrifter med disse varene:
</p>
<input
type=
"checkbox"
id=
"gluten"
name=
"gluten"
value=
"Gluten"
>
<label
for=
"allergen"
>
gluten
</label><br>
<input
type=
"checkbox"
id=
"nøtter"
name=
"nøtter"
value=
"nøtter"
>
<label
for=
"allergen"
>
nøtter
</label><br>
<input
type=
"checkbox"
id=
"melk"
name=
"melk"
value=
"melk"
>
<label
for=
"allergen"
>
melk
</label><br>
<button
class=
"saveBtn"
@
click=
"saveFoodPreference"
>
Lagre matpreferanser
<br>
og allergener
</button>
</form>
</
template
>
<
script
>
export
default
{
name
:
"
AppSettings
"
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/components/FridgeItem.vue
+
8
−
10
View file @
c553fc48
...
...
@@ -2,7 +2,9 @@
<div
id =
"item"
>
<img
:src=
"getImage"
alt=
""
>
<div
id=
"itemInfo"
>
<p
id=
"fridgeItemName"
>
{{
this
.
actualItem
.
item
.
name
}}
{{
this
.
actualItem
.
amount
.
quantity
}}{{
this
.
actualItem
.
item
.
amount
.
unit
}}
</p>
<p
id=
"fridgeItemName"
>
{{
this
.
fridgeItem
.
item
.
name
}}
{{
this
.
fridgeItem
.
amount
.
quantity
}}{{
this
.
fridgeItem
.
item
.
amount
.
unit
}}
</p>
<p
class=
"expText"
:style=
"
{color:expirationTextColor}">
{{
expirationText
}}
</p>
</div>
<div
id =
"appleBtn"
@
click=
"appleBtnPressed"
>
...
...
@@ -36,7 +38,7 @@ export default {
}
},
getImage
(){
return
this
.
actual
Item
.
item
.
image_url
;
return
this
.
fridge
Item
.
item
.
image_url
;
},
expirationText
()
{
...
...
@@ -66,11 +68,7 @@ export default {
}
},
props
:
{
item
:
{
type
:
Object
,
required
:
false
,
},
actualItem
:
{
fridgeItem
:
{
type
:
Object
,
required
:
false
,
},
...
...
@@ -82,7 +80,7 @@ export default {
},
methods
:
{
getDateDifference
(){
//returns the difference in days between the expiration date and today
let
date
=
this
.
actual
Item
.
exp_date
;
let
date
=
this
.
fridge
Item
.
exp_date
;
const
epDate
=
new
Date
(
date
);
const
parsedDate
=
Date
.
parse
(
epDate
)
...
...
@@ -94,10 +92,10 @@ export default {
return
numOfDays
;
},
appleBtnPressed
(){
this
.
$emit
(
'
appleBtnPressed
'
,
this
.
actual
Item
);
this
.
$emit
(
'
appleBtnPressed
'
,
this
.
fridge
Item
);
},
formatDate
(){
//formats expiration date as dd.mm.yyyy
let
fullExpirationDate
=
new
Date
(
this
.
actual
Item
.
exp_date
);
let
fullExpirationDate
=
new
Date
(
this
.
fridge
Item
.
exp_date
);
let
day
=
fullExpirationDate
.
getDate
();
let
month
=
(
fullExpirationDate
.
getMonth
()
+
1
).
toString
();
let
year
=
fullExpirationDate
.
getFullYear
().
toString
();
...
...
This diff is collapsed.
Click to expand it.
src/views/FridgeView.vue
+
1
−
1
View file @
c553fc48
...
...
@@ -6,7 +6,7 @@
<eat-fridge-item-modal
@
closeModal=
"hideModal"
v-if=
"visible"
:fridge-item=
"selectedItem"
></eat-fridge-item-modal>
<div
id =
"itemContainer"
>
<FridgeItem
v-for=
"item in fridgeItems"
:
actual
Item =
"item"
@
appleBtnPressed=
"showModal"
></FridgeItem>
<FridgeItem
v-for=
"item in fridgeItems"
:
fridge
Item =
"item"
@
appleBtnPressed=
"showModal"
></FridgeItem>
</div>
<div
id=
"addItemBtn-container"
>
...
...
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