Skip to content

Commit

Permalink
Merge branch 'release/0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveryh committed Oct 24, 2021
2 parents 9c236c8 + 48ee514 commit dcbeb99
Show file tree
Hide file tree
Showing 173 changed files with 10,047 additions and 17,543 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clear-habits-client",
"version": "0.5.0",
"version": "0.6.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
Binary file added client/public/favicon-recording.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed client/public/favicon.ico
Binary file not shown.
Binary file added client/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="icon" id="favicon" href="<%= BASE_URL %>favicon.png" />
<title>Clear Habits</title>
<link
href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css"
rel="stylesheet"
Expand Down
8 changes: 8 additions & 0 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
<q-btn padding="sm" outline icon="mdi-chart-bar" to="/stats" exact
><q-tooltip>Stats</q-tooltip></q-btn
>
<q-btn
padding="sm"
outline
icon="mdi-bullseye-arrow"
to="/targets"
exact
><q-tooltip>Targets</q-tooltip></q-btn
>
<q-btn
padding="sm"
outline
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/Category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
outlined
v-model="newProjectDescription"
label="New Project"
@keydown.enter="projectCreateLocal"
@keydown.enter="createProjectLocal"
></q-input>
</q-form>
</q-card-section>
<q-card-actions align="right" class="text-primary">
<q-btn flat label="Cancel" @click="addProjectDialog = false" />
<q-btn flat label="Add" @click="projectCreateLocal" />
<q-btn flat label="Add" @click="createProjectLocal" />
</q-card-actions>
</q-card>
</q-dialog>
Expand Down Expand Up @@ -146,13 +146,13 @@ export default {
newProjectDescription: null,
}),
methods: {
projectCreateLocal() {
createProjectLocal() {
this.addProjectDialog = false
const newProject = {
categoryId: this.category.id,
description: this.newProjectDescription,
}
this.projectCreate(newProject)
this.createProject(newProject)
this.newProjectDescription = null
},
// editor
Expand Down
11 changes: 8 additions & 3 deletions client/src/components/ChartPieCategorical.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<template>
<div>
<q-card>
<q-card v-if="series.length > 0">
<q-card-section>
<div class="text-h4 text-weight-light">Time Taken</div>
<apexchart type="pie" :options="options" :series="series"></apexchart>
</q-card-section>
</q-card>
<q-card v-else>
<div class="q-pa-xl text-h4 text-weight-light text-grey-5">
<q-icon name="mdi-database-off" /> No Data to Show
</div>
</q-card>
</div>
</template>
<script>
Expand Down Expand Up @@ -46,7 +51,7 @@ export default {
},
computed: {
series() {
return this.data.series
return this.data?.series || []
},
options() {
return {
Expand All @@ -55,7 +60,7 @@ export default {
type: 'donut',
},
colors: this.colors != null ? this.colors : this.tenColorPalette,
labels: this.data.labels,
labels: this.data?.labels,
legend: {
show: true,
},
Expand Down
9 changes: 7 additions & 2 deletions client/src/components/ChartTimeCategorical.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<q-card>
<q-card v-if="series.length > 0">
<q-card-section>
<div class="row">
<div class="col col-8">
Expand Down Expand Up @@ -31,6 +31,11 @@
></apexchart>
</q-card-section>
</q-card>
<q-card v-else>
<div class="q-pa-xl text-h4 text-weight-light text-grey-5">
<q-icon name="mdi-database-off" /> No Data to Show
</div>
</q-card>
</div>
</template>
<script>
Expand Down Expand Up @@ -152,7 +157,7 @@ export default {
}
},
series() {
return this.data
return this.data || []
},
},
}
Expand Down
11 changes: 2 additions & 9 deletions client/src/components/DateSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,10 @@ export default {
this.mondayThisWeek()
}
},
mondayOfWeek(date) {
var newDate = date
const dayOffset = newDate.getDay()
newDate.setDate(newDate.getDate() - ((dayOffset + 6) % 7))
const tzOffset = newDate.getTimezoneOffset()
newDate = new Date(newDate.getTime() - tzOffset * 60 * 1000)
this.setValue(newDate)
},
mondayThisWeek() {
var today = new Date()
this.mondayOfWeek(today)
var mondayOfToday = this.mondayOfWeek(today)
this.setValue(mondayOfToday)
},
today() {
var today = new Date()
Expand Down
38 changes: 27 additions & 11 deletions client/src/components/Entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'background-color: ' +
entry.task.project.category.color +
'; color: ' +
highContrastColor(entry.task.project.category.color)
(entry.task.project.category.colorContrast ? 'black' : 'white')
"
style="
border-radius: 5px;
Expand Down Expand Up @@ -40,7 +40,7 @@
class="font-m-medium"
style="border-radius: 10px; border: 4px"
v-if="entry.timerActive"
@click="entryTimerStop(entry)"
@click="stopEntry(entry)"
icon="mdi-stop"
>
<div v-html="timerLabel"></div
Expand All @@ -52,7 +52,7 @@
class="font-m-medium"
style="background: #ff0080; border-radius: 10px; border: 4px"
v-else
@click="entryTimerStart(entry)"
@click="startEntry(entry)"
icon="mdi-play"
>
<div v-html="timerLabel"></div
Expand All @@ -65,7 +65,7 @@
color="orange"
@click="
entry.complete = false
entryRestart(entry)
restartEntry(entry)
"
icon="mdi-undo-variant"
></q-btn>
Expand All @@ -75,7 +75,7 @@
color="green"
dense
round
@click="entryComplete(entry.id)"
@click="completeEntry(entry.id)"
icon="mdi-check"
></q-btn>
<q-btn
Expand Down Expand Up @@ -117,6 +117,14 @@
label="Description"
></q-input>
</q-form>
<q-btn
class="q-mt-md"
outlined
icon="mdi-sticker-plus-outline"
label="Copy Task"
@click="copyTaskWithEntry"
v-close-popup
/>
<q-card-actions align="right" class="text-primary">
<q-btn
flat
Expand All @@ -128,7 +136,6 @@
/>
<q-btn flat label="Save" @click="saveTask()" />
</q-card-actions>

<div class="text-h6">Edit Entry</div>
<q-form ref="entryForm" class="q-gutter-md" @submit.prevent>
<q-input
Expand Down Expand Up @@ -261,7 +268,7 @@
flat
label="Delete"
color="warning"
@click="entryDelete(entry)"
@click="deletePaginatedEntry(entry) && (editorDialog = false)"
v-close-popup
/>
</q-card-actions>
Expand Down Expand Up @@ -375,21 +382,30 @@ export default {
description: this.entry.description,
date: this.entry.date,
taskId: this.entry.task.id,
timerEstimatedTime: this.entry.timerEstimatedTime,
}
this.entryCreate(entry)
this.createEntryPaginated(entry)
this.editorDialog = false
},
copyTaskWithEntry() {
var entryWithTask = {
description: this.entry.task.description,
projectId: this.entry.task.project.id,
date: this.entry.date,
timerEstimatedTime: this.entry.timerEstimatedTime,
}
this.createEntryWithTask(entryWithTask)
},
// editor
editorOpen() {
this.editedEntry = Object.assign({}, this.entry)
if (this.entry.timerActive) this.entryTimerStop(this.entry)
this.editorDialog = true
},
saveEntry() {
this.$refs.entryForm.validate().then((success) => {
if (success) {
this.editorDialog = false
this.entryUpdate(this.editedEntry)
this.updateEntry(this.editedEntry)
}
})
},
Expand All @@ -399,7 +415,7 @@ export default {
if (success) {
this.editorDialog = false
const task = this.editedEntry.task
this.taskUpdate({
this.updateTask({
id: task.id,
projectId: task.project.id,
description: task.description,
Expand Down
Loading

0 comments on commit dcbeb99

Please sign in to comment.