Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link edit datepicker sets event to a string date prop #5663

Closed
kiranparajuli589 opened this issue Aug 12, 2021 · 1 comment
Closed

link edit datepicker sets event to a string date prop #5663

kiranparajuli589 opened this issue Aug 12, 2021 · 1 comment
Labels
Topic:good-first-issue beginner friendly task

Comments

@kiranparajuli589
Copy link
Contributor

Description

Datepicker in LinkEdit component is described as:

<div v-if="$_expirationDate" class="uk-width-1-1 uk-width-2-5@m">
<div class="uk-position-relative">
<oc-datepicker
id="oc-files-file-link-expire-date"
:key="'oc-datepicker-' + expireDate"
:label="expirationDateLabel"
:date="expireDate"
:max-datetime="$_maxExpirationDate"
:min-datetime="$_minExpirationDate"
@input="expireDate = $event"
/>
<oc-button
v-if="!$_expirationDate.enforced && !!expireDate"
id="oc-files-file-link-expire-date-delete"
class="oc-mt-s"
appearance="raw"
@click="expireDate = null"
v-text="$gettext('Remove expiration date')"
/>
</div>

whenever the input event is emitted from oc-datepicker it sends a date string value
https://github.com/owncloud/owncloud-design-system/blob/490bd01a4cdd46d84f881ec04f0de700af10621f/src/components/OcDatepicker.vue#L61

but inside link edit, that input event is watched to set that event to the form value

due to this, date prop on datepicker input is unhappy about the receiving value type and these console errors are generated:

console.error
    [Vue warn]: Invalid prop: type check failed for prop "date". Expected String, got Event 
    
    found in
    
    ---> <OcDatepicker>
           <Anonymous>
             <Root>

      at warn (node_modules/vue/dist/vue.runtime.common.dev.js:621:15)
      at assertProp (node_modules/vue/dist/vue.runtime.common.dev.js:1702:5)
      at validateProp (node_modules/vue/dist/vue.runtime.common.dev.js:1628:5)
      at loop (node_modules/vue/dist/vue.runtime.common.dev.js:4664:17)
      at initProps (node_modules/vue/dist/vue.runtime.common.dev.js:4695:33)
      at initState (node_modules/vue/dist/vue.runtime.common.dev.js:4638:21)
      at VueComponent.Vue._init (node_modules/vue/dist/vue.runtime.common.dev.js:5001:5)
@pascalwengerter
Copy link
Contributor

Closing here, we've redesigned the link edit functionality and some issues around date changes have been resolved, e.g. #6865

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic:good-first-issue beginner friendly task
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants