This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from SELab-2/web/feature/round-planning-rework
Frontend: planning herwerkt
- Loading branch information
Showing
12 changed files
with
610 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2025,4 +2025,4 @@ | |
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<v-file-input | ||
label="File input" | ||
outlined | ||
dense | ||
capture="user" | ||
accept="image/*" | ||
></v-file-input> | ||
</template> | ||
|
||
<script setup lang="ts"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<template> | ||
<BorderCard @click="$emit('clicked')" class="my-2"> | ||
<template v-slot:prepend> | ||
<v-icon icon="mdi-office-building"></v-icon> | ||
</template> | ||
<template v-slot:title>{{ name }}</template | ||
><template v-slot:subtitle>{{ address }}</template> | ||
</BorderCard> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import BorderCard from "@/layouts/CardLayout.vue"; | ||
defineProps({ | ||
name: String, | ||
address: String, | ||
id: String, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<template> | ||
<BorderCard class="my-2"> | ||
<template v-slot:prepend> | ||
<v-icon icon="mdi-office-building"></v-icon> | ||
</template> | ||
<template v-slot:title>{{ name }}</template | ||
><template v-slot:subtitle>{{ address }}</template> | ||
<template v-slot:append> | ||
<v-icon | ||
@click="$emit('up')" | ||
class="mx-1" | ||
color="primary" | ||
icon="mdi-chevron-up" | ||
/> | ||
<v-icon | ||
@click="$emit('down')" | ||
class="mx-1" | ||
color="primary" | ||
icon="mdi-chevron-down" | ||
/> | ||
<v-icon | ||
@click="$emit('remove')" | ||
class="mx-1" | ||
color="error" | ||
icon="mdi-close" | ||
/> | ||
</template> | ||
<v-expand-transition> | ||
<v-table v-show="garbageinfo" class="mx-2 my-2" density="compact"> | ||
<thead> | ||
<tr> | ||
<th | ||
v-for="day in ['MA', 'DI', 'WO', 'DO', 'VR', 'ZA', 'ZO']" | ||
:key="day" | ||
class="text-center" | ||
> | ||
{{ day }} | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr v-for="item in ['REST', 'GFT', 'PMD']" :key="item"> | ||
<td class="text-center" v-for="index in 7" :key="index"> | ||
<v-chip size="small" v-if="handleGarbageMap(item, index)">{{ | ||
item | ||
}}</v-chip> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</v-table> | ||
</v-expand-transition> | ||
</BorderCard> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import BorderCard from "@/layouts/CardLayout.vue"; | ||
import { ref, onMounted } from "vue"; | ||
import { GarbageQuery } from "@selab-2/groep-1-query"; | ||
import { tryOrAlertAsync } from "@/try"; | ||
// TODO: discuss with group proper format temp actions | ||
const tempActions = ["REST", "GFT", "PMD"]; | ||
const garbageMap = ref<Map<String, Boolean[]>>(new Map()); | ||
onMounted(() => { | ||
for (const action of tempActions) { | ||
garbageMap.value.set(action, new Array(7).fill(false)); | ||
} | ||
tryOrAlertAsync(async () => { | ||
const garbageOfBuilding = await new GarbageQuery().getAll({ | ||
building_id: props.buildingId, | ||
}); | ||
for (const garbage of garbageOfBuilding) { | ||
const dayIndex = new Date(garbage.pickup_time).getDay(); | ||
const actionDesc = garbage.action.description; | ||
// See if it is garbage to pick up or just a task | ||
if (actionDesc.includes("Ophaling")) { | ||
const garbageType = actionDesc.split(" ")[1]; | ||
garbageMap.value.get( | ||
garbageType === "restafval" ? "REST" : garbageType, | ||
)![dayIndex] = true; | ||
} | ||
} | ||
}); | ||
}); | ||
const props = defineProps({ | ||
name: { type: String, required: true }, | ||
address: { type: String, required: true }, | ||
buildingId: { type: Number, required: true }, | ||
garbageinfo: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
}); | ||
function handleGarbageMap(garbageType: String, day: number) { | ||
const planningArray = garbageMap.value.get(garbageType); | ||
if (planningArray) { | ||
return planningArray[day]; | ||
} else { | ||
return false; | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
td { | ||
border-right: solid 1px rgb(216, 216, 216); | ||
border-left: solid 1px rgb(216, 216, 216); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<BorderCard class="my-2"> | ||
<template v-slot:title>{{ date?.toLocaleDateString() }}</template | ||
><template v-slot:append> | ||
<div class="mx-1 pb-5"> | ||
<v-chip class="mr-4" prepend-icon="mdi-clock-time-two-outline">{{ | ||
time | ||
}}</v-chip> | ||
<v-icon @click="$emit('remove')" color="error" icon="mdi-close" /> | ||
</div> | ||
</template> | ||
<template v-slot:subtitle> | ||
<div class="d-flex"> | ||
<Avatar class="mx-1" size="x-small" :name="name" /><v-card-subtitle>{{ | ||
name | ||
}}</v-card-subtitle> | ||
</div></template | ||
> | ||
</BorderCard> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import BorderCard from "@/layouts/CardLayout.vue"; | ||
import Avatar from "@/components/Avatar.vue"; | ||
defineProps({ | ||
name: String, | ||
date: Date, | ||
time: String, | ||
id: String, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Round from "./Round"; | ||
|
||
export default interface RoundPlanning { | ||
date: string; | ||
round: Round | null; | ||
showinfo: boolean; | ||
edit: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.