Skip to content

Commit

Permalink
fix Circular structure in calendar object
Browse files Browse the repository at this point in the history
Signed-off-by: hamza mahjoubi <hamzamahjoubi221@gmail.com>
  • Loading branch information
hamza221 committed Dec 29, 2023
1 parent 23e3320 commit cac9396
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/components/Shared/CalendarPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<Select label="displayName"
input-id="url"
:disabled="isDisabled"
:options="calendars"
:value="value"
:options="options"
:value="removeCircularStructure(value)"
:multiple="multiple"
@input="change"
@remove="remove">
@option:deselected="remove">
<template #option="option">
<CalendarPickerOption :color="option.color"
:display-name="option.displayName"
Expand Down Expand Up @@ -55,6 +55,12 @@ export default {
// for calendars where only one calendar can be selected, disable if there are < 2
return this.multiple ? this.calendars.length < 1 : this.calendars.length < 2
},
options() {

Check warning on line 58 in src/components/Shared/CalendarPicker.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Shared/CalendarPicker.vue#L58

Added line #L58 was not covered by tests
return this.calendars.map(calendar => {
const { dav, ...rest } = calendar;
return rest;
});

Check warning on line 62 in src/components/Shared/CalendarPicker.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Shared/CalendarPicker.vue#L60-L62

Added lines #L60 - L62 were not covered by tests
}

Check warning on line 63 in src/components/Shared/CalendarPicker.vue

View workflow job for this annotation

GitHub Actions / eslint

Missing trailing comma
},
methods: {
/**
Expand All @@ -80,6 +86,10 @@ export default {
this.$emit('remove-calendar', calendar)
}
},
removeCircularStructure(calendar) {
const { dav, ...rest } = calendar
return rest
},

Check warning on line 92 in src/components/Shared/CalendarPicker.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Shared/CalendarPicker.vue#L91-L92

Added lines #L91 - L92 were not covered by tests
},
}
</script>
Expand Down

0 comments on commit cac9396

Please sign in to comment.