WIP: REFERENCE datepicker script setup alternative #1972
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#1972
Loading…
Reference in New Issue
No description provided.
Delete Branch "dpschen/frontend:feat-datepicker-script-setup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Please fix the lint errors.
I am actually not sure how to solve this correctly:
What I can do is to import the global i18n instance. Not sure that would be the way one is used to do this 🤔
Generally i18n annoys me. With the V9 version the way you are supposed to work is that you have local messages in every component…
What about making
chooseDateLabel
a computed and defining the default value in there?That's possible.
I just think it's a bit annoying because using props and falling back to default values is kind of "the vue way to do things" :D
Personally I think importing the i18n instance is the best way for now, but maybe I'll create an issue in the vue-i18n-next repo.
Are you fine with using the instance here?
I think that's okay, yes. Please follow up with an issue in the i18n repo though.
Question in vue-i18n-next discussion (author answers frequently):
https://github.com/intlify/vue-i18n-next/discussions/1012
f10849dbfd
to7fb5741615
Changed to use the global i18n instance.
Hi dpschen!
Thank you for creating a PR!
I've deployed the changes of this PR on a preview environment under this URL: https://1972-feat-datepicker-script-setup--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.
Have a nice day!
7fb5741615
toce65adca2a
Looks like the label now does not work at all:
ce65adca2a
tocf363aaf79
The problem was not vue-i18n but that the label didn't get displayed because we compared it with
null
. But I changed to type of the ref toDate | undefined
…@konrad This was fixed. Anything else missing here?
cf363aaf79
tob94ad289fc
It looks like when I click on "confirm" it will close the popup but not set a date.
Will check again. Thanks for testing
feat: datepicker script setupto WIP: feat: datepicker script setupb94ad289fc
to6d40c13f4b
WIP: feat: datepicker script setupto feat: datepicker script setup6d40c13f4b
tocd557f8c81
This should work now. I updated the code a bit so that now is live. Meaning that if you open the popup on 23:59 and the time changes to the next day the values stay up-to-date.
I kill the CI though because of recent problems. Please retrigger, when if runs again :)
When adding a new reminder I get a vuex mutation error:
@ -132,0 +67,4 @@
chooseDateLabel: {
type: String as PropType<string>,
default() {
const {t} = useI18n()
Why don't you add the
useI18n
before the props declaration?That wouldn't work. Because afaik the props, events declaration and imports are extracted from script setup and the rest will be wrapped by the setup function. Meaning that if I would use
use18n
beforedefineProps
it would still be inside the setup block after beeing compiled => no access inside the props.@ -239,1 +167,4 @@
})
function setDateValue(newVal: null | string | Date) {
console.log(newVal)
Please remove this.
@ -240,0 +199,4 @@
function close() {
// Kind of dirty, but the timeout allows us to enter a time and click on "confirm" without
// having to click on another input field before it is actually used.
I think this doesn't actually work? But that doesn't really work right now either, more of a mental note to properly fix this some time.
This should probably also happen with the current version.
This PR is again mostly about converting to script setup.
I didn't want to change the logic too much – I would change a lot :)
As far as I tested it, it does not happen on the main branch 🤔
cd557f8c81
to80e44741a7
I just tested this again. I can't reproduce the error that you have.
When does this happen to you?
Looks like the vuex error is gone.
But the styling is broken now:
Current main branch:
80e44741a7
to43b66d5759
Should be fixed. I think that would also have been resolved by rebasing :D
Now the button to add another reminder disappeared:
The style entanglement is so crazy :/
43b66d5759
to8612ca00b2
8612ca00b2
tob87436c35c
Looks like this is still a problem.
Yes. I couldn't find the underlying issue yet.
feat: datepicker script setupto WIP: feat: datepicker script setupKeeping this as reference. We do have one version merged now, but that was just a simple translation. In here are some nice ideas for improvement that I want to port over.
WIP: feat: datepicker script setupto WIP: ARCHIVE datepicker script setup alternativeWIP: ARCHIVE datepicker script setup alternativeto WIP: REFERENCE datepicker script setup alternativeClosing this as it appears stale.
Please rebase and reopen if you think this is still relevant.