Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filters #159

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions components/GoalFilters.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<template>
<v-combobox
v-model="form.status"
label="Status"
:items="options.status"
item-value="type"
item-title="text"
variant="outlined"
@update:model-value="print"
></v-combobox>
</template>

<script>
import { GOAL_STATUS } from "~/constants/goal";

import { useGoalsStore } from "~/store/goals";

export default {
name: "GoalTab",
props: {
isEditable: Boolean,
},
data() {
return {
form: {
title: "",
type: "",
status: "",
},
options: {
status: [
GOAL_STATUS.COMPLETED,
GOAL_STATUS.ONGOING,
GOAL_STATUS.PAUSED,
],
},
};
},
methods: {
print: (value) => {
const goalStore = useGoalsStore();
// goalStore.fetchGoals({ status: value.type });
// console.log({ status: value.type });
},
},
};
</script>
1 change: 1 addition & 0 deletions components/GoalList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<v-container>
<GoalFilters />
<span v-if="recentlyCreated.isLoading">Loading...</span>
<v-table v-else>
<thead>
Expand Down
12 changes: 12 additions & 0 deletions components/GoalListTabEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
{{ state.title }}
</nuxt-link>
<td>{{ state.status || "---" }}</td>
<td>{{ state.startsOn }}</td>
<td>
<v-progress-circular
:rotate="360"
:size="60"
:width="10"
:model-value="state.percentageCompleted"
color="teal"
>
{{ state.percentageCompleted }}
</v-progress-circular>
</td>
<td>
<v-menu v-model="state.assigneeMenu" location="bottom">
<template v-slot:activator="{ props }">
Expand Down
8 changes: 4 additions & 4 deletions constants/goal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ export const GOAL_TYPE = {
}

export const GOAL_STATUS = {
COMPLETED: { type: 'COMPLETED', text: 'Completed' },
ONGOING: { type: 'ONGOING', text: 'Ongoing' },
PAUSED: { type: 'PAUSED', text: 'Paused' }
}
COMPLETED: { type: "completed", text: "Completed" },
ONGOING: { type: "ongoing", text: "Ongoing" },
PAUSED: { type: "paused", text: "Paused" },
};

export const DEFAULT_GOAL = {
title: '',
Expand Down
4 changes: 2 additions & 2 deletions models/Goal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class Goal extends Model {
createdBy: this.attr(null),
startsOn: this.string(''),
endsOn: this.string(''),
precentageCompleted: this.number(0),
percentageCompleted: this.number(0),
status: this.string(null),
assignedTo: this.attr(null),
assignedBy: this.string(null)
Expand All @@ -26,7 +26,7 @@ export class Goal extends Model {
declare createdBy: string
declare startsOn: string
declare endsOn: string
declare precentageCompleted: number
declare percentageCompleted: number
declare status: string
declare assignedTo: string
declare assignedBy: string
Expand Down