feat: datepicker script setup #1972
Open
dpschen
wants to merge 2 commits from dpschen/frontend:feat-datepicker-script-setup
into main
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'dpschen/frontend:feat-datepicker-script-setup'
Deleting a branch is permanent. It CANNOT be undone. 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
3 months agoChanged 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
3 months agoLooks like the label now does not work at all:
ce65adca2a
tocf363aaf79
3 months agoThe 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
2 months agoIt 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 setup 1 month agob94ad289fc
to6d40c13f4b
1 month agoWIP: feat: datepicker script setupto feat: datepicker script setup 1 month ago6d40c13f4b
tocd557f8c81
1 month agoThis 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:
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.})
function setDateValue(newVal: null | string | Date) {
console.log(newVal)
Please remove this.
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
7 days agoI 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
4 days agoShould 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 :/
Reviewers