From fb3cf94cba99a497bf60533234bcc60d297fc738 Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 28 Nov 2020 13:59:27 +0000 Subject: [PATCH] Better reminders (#308) Fix setting the new reminder component to null after adding a new date Add "close on change" event which only fires if the component closed and the value actually changed Hide the "today" option after 21:00 Add "confirm" button to close the component Use disabled in reminders Add a disabled property to the datepicker Cleanup workarounds for flatpickr Use the new datepicker for end dates Use the new datepicker for start date Use the new datepicker for due dates Mobile styling Format Sync flatpickr when clicking on choose a date Make sure to only hide the popup when not clicked something inside of it Make flatpickr dates work Use datepicker component for reminders Merge branch 'master' into feature/better-reminders Fix bottom padding of inline flatpickr Set time Add method to calculate the neares time Move time helpers in separate folder Remove separate flatpickr date Cleanup Set the flatpickr date when setting changing the date Better formatting of the chosen date Bubble Set date when choosing one Fix test Show correct weekday in preview Change hover background color Make label to show if selected date is null configurable Use a different icon for weekend Ignore test files when linting Add tests to dron Move day interval calculation to separate file and test it Add next date calculation Add basic date picker component Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/308 Co-Authored-By: konrad Co-Committed-By: konrad --- .drone.yml | 7 +- package.json | 4 +- src/components/input/datepicker.vue | 246 +++ src/components/tasks/partials/reminders.vue | 101 +- src/helpers/time/calculateDayInterval.js | 26 + src/helpers/time/calculateDayInterval.test.js | 93 + src/helpers/time/calculateNearestHours.js | 21 + src/helpers/time/calculateNearestTime.test.js | 90 + src/main.js | 21 +- src/styles/components/_all.scss | 1 + src/styles/components/datepicker.scss | 68 + src/styles/components/reminders.scss | 14 +- src/styles/components/task.scss | 23 +- src/views/tasks/TaskDetailView.vue | 70 +- yarn.lock | 1620 ++++++++++++++++- 15 files changed, 2253 insertions(+), 152 deletions(-) create mode 100644 src/components/input/datepicker.vue create mode 100644 src/helpers/time/calculateDayInterval.js create mode 100644 src/helpers/time/calculateDayInterval.test.js create mode 100644 src/helpers/time/calculateNearestHours.js create mode 100644 src/helpers/time/calculateNearestTime.test.js create mode 100644 src/styles/components/datepicker.scss diff --git a/.drone.yml b/.drone.yml index e6567acbe..d605db138 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,7 +19,12 @@ steps: - yarn --frozen-lockfile --network-timeout 100000 - yarn run lint - yarn run build - + - name: test + image: node:13 + pull: true + group: build-static + commands: + - yarn test --- kind: pipeline name: release-latest diff --git a/package.json b/package.json index 8305f3287..bcdc9a962 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build --modern", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint --ignore-pattern '*.test.*'", + "test": "jest" }, "dependencies": { "bulma": "0.9.1", @@ -40,6 +41,7 @@ "babel-eslint": "10.1.0", "eslint": "7.14.0", "eslint-plugin-vue": "7.1.0", + "jest": "^26.6.3", "node-sass": "5.0.0", "sass-loader": "10.1.0", "vue-flatpickr-component": "8.1.6", diff --git a/src/components/input/datepicker.vue b/src/components/input/datepicker.vue new file mode 100644 index 000000000..9fea92888 --- /dev/null +++ b/src/components/input/datepicker.vue @@ -0,0 +1,246 @@ + + + diff --git a/src/components/tasks/partials/reminders.vue b/src/components/tasks/partials/reminders.vue index d08208850..f94ce3db0 100644 --- a/src/components/tasks/partials/reminders.vue +++ b/src/components/tasks/partials/reminders.vue @@ -1,70 +1,79 @@