Skip to content

Commit

Permalink
Merge pull request #176 from dtom90/develop
Browse files Browse the repository at this point in the history
Allows disabling notifications for a specific task
  • Loading branch information
dtom90 committed Jul 15, 2021
2 parents 2d8dfb5 + 3d0c2e6 commit 6d5b18d
Show file tree
Hide file tree
Showing 12 changed files with 3,368 additions and 3,887 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
- image: cimg/base:stable
steps:
- setup_remote_docker:
version: 20.10.6
docker_layer_caching: true
- checkout
- run:
Expand All @@ -16,6 +17,7 @@ jobs:
- image: cimg/base:stable
steps:
- setup_remote_docker:
version: 20.10.6
docker_layer_caching: true
- checkout
- run:
Expand All @@ -33,6 +35,7 @@ jobs:
- image: cimg/node:lts
steps:
- setup_remote_docker:
version: 20.10.6
docker_layer_caching: true
- add_ssh_keys:
fingerprints:
Expand Down
2 changes: 1 addition & 1 deletion docker/base.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12.18.4-alpine
FROM node:14.17.3-alpine

RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
2 changes: 1 addition & 1 deletion docker/prod.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build stage
FROM node:12.18.4-alpine as build-stage
FROM node:14.17.3-alpine as build-stage
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion docker/temp.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12.18.4-alpine
FROM node:14.17.3-alpine

RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
Expand Down
24 changes: 7 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "devtrack",
"version": "0.9.6",
"version": "0.10.0",
"private": true,
"description": "An app for productive developers",
"author": {
Expand All @@ -10,7 +10,7 @@
"scripts": {
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint --no-fix",
"audit:packages": "yarn audit --level moderate || test $? -le 2",
"audit:packages": "yarn audit --groups dependencies",
"electron:build": "vue-cli-service electron:build --dir",
"electron:dev": "vue-cli-service electron:serve",
"electron:release": "vue-cli-service electron:build",
Expand All @@ -34,8 +34,8 @@
"@fortawesome/free-solid-svg-icons": "^5.9.0",
"@fortawesome/vue-fontawesome": "^0.1.6",
"bootstrap": "^4.4.1",
"bootstrap-vue": "^2.10.1",
"chart.js": "^2.9.1",
"bootstrap-vue": "^2.21.2",
"chart.js": "^2.9.4",
"chartjs-plugin-annotation": "^0.5.7",
"chartjs-plugin-datalabels": "^0.6.0",
"color-manager": "https://github.com/dtom90/color-manager",
Expand All @@ -61,12 +61,12 @@
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@testing-library/jest-dom": "^5.11.3",
"@testing-library/jest-dom": "5.11.9",
"@vue/cli-plugin-babel": "^4.4.6",
"@vue/cli-plugin-eslint": "^4.4.6",
"@vue/cli-plugin-unit-jest": "^4.4.6",
"@vue/cli-service": "^4.5.9",
"@vue/test-utils": "^1.0.3",
"@vue/test-utils": "^1.2.1",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^24.8.0",
"dotenv": "^8.2.0",
Expand Down Expand Up @@ -102,15 +102,5 @@
],
"displayName": "DevTrack",
"homepage": "https://github.com/dtom90/DevTrack",
"repository": "https://github.com/dtom90/DevTrack",
"resolutions": {
"dot-prop": ">=4.2.1",
"lodash": ">=4.17.19",
"minimist": ">=0.2.1 <1.0.0 || >=1.2.3",
"node-forge": ">=0.10.0",
"node-notifier": ">=8.0.1",
"yargs-parser": ">=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2",
"kind-of": ">=6.0.3",
"serialize-javascript": ">=3.1.0"
}
"repository": "https://github.com/dtom90/DevTrack"
}
7 changes: 5 additions & 2 deletions src/components/Countdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
</template>

<script>
import { mapMutations, mapState } from 'vuex'
import { mapState, mapGetters, mapMutations } from 'vuex'
import CountdownTimer from '../lib/CountdownTimer'
import notifications from '../lib/notifications'
Expand Down Expand Up @@ -176,7 +176,10 @@ export default {
...mapState([
'activeMinutes',
'restMinutes',
'running',
'running'
]),
...mapGetters([
'notificationsEnabled'
]),
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
computed: {
...mapState([
'notificationsEnabled',
'globalNotificationsEnabled',
'timeFormat24'
]),
Expand All @@ -83,7 +83,7 @@ export default {
checkboxEnableNotifications: {
get () {
return this.notificationsEnabled
return this.globalNotificationsEnabled
},
set (newValue) {
this.setNotificationsEnabled(newValue)
Expand Down
31 changes: 27 additions & 4 deletions src/components/SelectedTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,23 @@
<font-awesome-icon icon="trash-alt" />
</button>
</div>
<div class="dropdown-divider" />
<div
class="form-check form-check-inline"
style="margin-left: 0.75rem"
>
<input
id="disableNotifications"
v-model="disableNotifications"
type="checkbox"
class="form-check-input"
>
<label
class="form-check-label"
for="disableNotifications"
@click.stop=""
>Disable Notifications For This Task</label>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -264,6 +281,15 @@ export default {
return this.task.completed !== null
},
disableNotifications: {
get () {
return this.task.disableNotifications || false
},
set (value) {
this.disableTaskNotifications({ taskId: this.task.id, disableNotifications: value })
}
},
taskTags () {
return this.task.tags
},
Expand All @@ -279,6 +305,7 @@ export default {
...mapMutations([
'startTask',
'stopTask',
'disableTaskNotifications',
'addTaskTag',
'removeTaskTag',
'deleteTask'
Expand Down Expand Up @@ -401,10 +428,6 @@ export default {
margin: 0 8px;
}
.dropdown-menu {
min-width: 40px;
}
$play-btn-size: 75px;
#play-btn {
Expand Down
7 changes: 7 additions & 0 deletions src/store/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ const getters = {
return state.tasks.find(t => t.id === state.activeTaskID)
},

notificationsEnabled (state) {
const selectedTask = state.tasks.find(t => t.id === state.selectedTaskID)
return state.globalNotificationsEnabled && (
selectedTask ? !(selectedTask.disableNotifications === true) : true
)
},

incompleteTasks: state => state.tasks.filter(t => !t.completed),

completedTasks (state) {
Expand Down
2 changes: 1 addition & 1 deletion src/store/initialState.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const initialState = {
secondReminderMinutes: 5,
restMinutes: 5,
running: false,
notificationsEnabled: true,
globalNotificationsEnabled: true,
continueOnComplete: false,
timeFormat24: false
}
Expand Down
11 changes: 11 additions & 0 deletions src/store/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ const mutations = {
state.continueOnComplete = newValue
},

disableTaskNotifications (state, { taskId, disableNotifications }) {
const task = state.tasks.find(t => t.id === taskId)
if (task) {
if (disableNotifications) {
task.disableNotifications = true
} else {
delete task.disableNotifications
}
}
},

startTask (state, payload) {
const task = state.tasks.find(t => t.id === payload.id)
if (task) {
Expand Down

0 comments on commit 6d5b18d

Please sign in to comment.