Commit d17df0d4 authored by Richard Blechinger's avatar Richard Blechinger
Browse files

Implement creation of repetition schedules (minus custom option)

parent 9bd21f43
...@@ -8077,9 +8077,9 @@ ...@@ -8077,9 +8077,9 @@
} }
}, },
"jquery": { "jquery": {
"version": "3.5.1", "version": "3.4.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
"integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==" "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw=="
}, },
"js-levenshtein": { "js-levenshtein": {
"version": "1.1.6", "version": "1.1.6",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"bootstrap-vue": "^2.16.0", "bootstrap-vue": "^2.16.0",
"dompurify": "^2.0.12", "dompurify": "^2.0.12",
"filesize": "^4.2.1", "filesize": "^4.2.1",
"jquery": "^3.5.1", "jquery": "3.4.1",
"moment": "^2.27.0", "moment": "^2.27.0",
"node-polyglot": "^2.4.0", "node-polyglot": "^2.4.0",
"oidc-client": "^1.10.1", "oidc-client": "^1.10.1",
...@@ -52,9 +52,13 @@ ...@@ -52,9 +52,13 @@
"curly": "error", "curly": "error",
"block-spacing": "error", "block-spacing": "error",
"keyword-spacing": "error", "keyword-spacing": "error",
"vue/html-indent": ["warning", 4, { "vue/html-indent": [
"baseIndent": 1 "warning",
}] 4,
{
"baseIndent": 1
}
]
}, },
"parserOptions": { "parserOptions": {
"parser": "babel-eslint" "parser": "babel-eslint"
......
<template> <template>
<div id="app" class="tw-flex tw-flex-col tw-min-h-screen" :key="localeKey"> <div
id="app"
:key="localeKey"
class="tw-flex tw-flex-col tw-min-h-screen"
>
<app-header <app-header
:modules="modules" :modules="modules"
:user="user" :user="user"
/> />
<div class="tw-flex-1 tw-flex tw-my-8"> <div class="tw-flex-1 tw-flex tw-my-8">
<router-view :modules="modules" :user="user"/> <router-view
:modules="modules"
:user="user"
/>
</div> </div>
<app-footer :modules="modules"/> <app-footer :modules="modules" />
</div> </div>
</template> </template>
......
<template> <template>
<auth-wall> <b-container>
<b-container> <auth-wall>
<show-selector <show-selector
ref="showSelector" ref="showSelector"
:title="$t('navigation.calendar')" :title="$t('navigation.calendar')"
...@@ -82,18 +82,18 @@ ...@@ -82,18 +82,18 @@
@event-resize="eventResize" @event-resize="eventResize"
@event-created="eventCreated" @event-created="eventCreated"
/> />
</auth-wall>
<app-modalEmissionManagerCreate
ref="appModalEmissionManagerCreate" <app-modalEmissionManagerCreate
/> ref="appModalEmissionManagerCreate"
<app-modalEmissionManagerResolve />
ref="appModalEmissionManagerResolve" <app-modalEmissionManagerResolve
/> ref="appModalEmissionManagerResolve"
<app-modalEmissionManagerEdit />
ref="appModalEmissionManagerEdit" <app-modalEmissionManagerEdit
/> ref="appModalEmissionManagerEdit"
</b-container> />
</auth-wall> </b-container>
</template> </template>
<script> <script>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</b-container> </b-container>
</footer> </footer>
</template> </template>
npm
<script> <script>
export default { export default {
props: { props: {
......
...@@ -49,9 +49,9 @@ ...@@ -49,9 +49,9 @@
</div> </div>
<div v-else> <div v-else>
<p> <p>
This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
prettyDate(schedule.until) }} prettyDate(schedule.until) }}
</p> </p>
<p>All timeslots of this schedule:</p> <p>All timeslots of this schedule:</p>
<b-table <b-table
...@@ -105,7 +105,10 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{ ...@@ -105,7 +105,10 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
/> />
</label> </label>
<b-checkbox v-model="useSameTime"> <b-checkbox
v-if="repetitionRule !== 4"
v-model="useSameTime"
>
Use same start and end time Use same start and end time
</b-checkbox> </b-checkbox>
</b-col> </b-col>
...@@ -140,6 +143,13 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{ ...@@ -140,6 +143,13 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
</b-col> </b-col>
</b-row> </b-row>
<b-row
v-if="repetitionRule === 4"
class="tw-mt-4"
>
Wir arbeiten dran. :)
</b-row>
<b-row class="mt-4"> <b-row class="mt-4">
<b-col> <b-col>
<b-button <b-button
...@@ -242,12 +252,6 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{ ...@@ -242,12 +252,6 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
onlyBusinessDays: false, onlyBusinessDays: false,
addNoOfDays: 1, addNoOfDays: 1,
repetitionRule: 1, repetitionRule: 1,
repetitionOptions: [
{value: 1, text: "On the following day"},
{value: 2, text: "On the following business day"},
{value: 3, text: "Number of days later"},
{value: 4, text: "Custom (WIP)"},
]
} }
}, },
...@@ -260,6 +264,15 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{ ...@@ -260,6 +264,15 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
} }
}, },
repetitionOptions() {
return [
{value: 1, text: this.$t("On the following day")},
{value: 2, text: this.$t("On the following business day")},
{value: 3, text: this.$t("Number of days later")},
// {value: 4, text: this.$t("Custom")},
];
},
...mapGetters({ ...mapGetters({
selectedShow: 'shows/selectedShow', selectedShow: 'shows/selectedShow',
schedule: 'shows/schedule', schedule: 'shows/schedule',
...@@ -294,7 +307,7 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{ ...@@ -294,7 +307,7 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
byweekday, byweekday,
is_repetition: true, is_repetition: true,
add_business_days_only: onlyBusinessDays, add_business_days_only: onlyBusinessDays,
add_days_no: addNoOfDays, add_days_no: parseInt(addNoOfDays, 10),
} }
}; };
...@@ -416,7 +429,18 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{ ...@@ -416,7 +429,18 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
// initialise a new schedule and open the modal // initialise a new schedule and open the modal
open(timeslot) { open(timeslot) {
const timeslotIndex = this.scheduleTimeslots.findIndex(item => item.id === timeslot.id);
let timeslotPage = Math.ceil(timeslotIndex / this.perPage);
const timeslotIsFirstEntryOnPage = timeslotIndex === ((timeslotPage) * this.perPage);
// The math above is slightly off for every first entry on the page
// So we add 1 to adjust the page to the correct one
if (timeslotIsFirstEntryOnPage) {
timeslotPage += 1;
}
this.timeslot = timeslot this.timeslot = timeslot
this.currentPage = timeslotPage;
this.$refs.modalEmissionManagerEdit.show() this.$refs.modalEmissionManagerEdit.show()
this.loadSchedule(timeslot.schedule) this.loadSchedule(timeslot.schedule)
}, },
......
export default { export default {
computed: {
rruleOptions () {
return [
{ value: 1, text: 'einmalig' },
{ value: 2, text: 'täglich' },
{ value: 3, text: 'werktäglich' },
{ value: 4, text: 'wöchentlich' },
{ value: 5, text: 'zweiwöchentlich' },
{ value: 6, text: 'vierwöchentlich' },
{ value: 7, text: 'gerade Kalenderwoche' },
{ value: 8, text: 'ungerade Kalenderwoche' },
{ value: 9, text: 'Jede 1. Woche im Monat' },
{ value: 10, text: 'Jede 2. Woche im Monat' },
{ value: 11, text: 'Jede 3. Woche im Monat' },
{ value: 12, text: 'Jede 4. Woche im Monat' },
{ value: 13, text: 'Jede 5. Woche im Monat' },
]
}
},
methods: { methods: {
rruleRender(rrule) { rruleRender(rrule) {
return this.$t(`rrule.rule.${rrule}`) return this.$t(`rrule.rule.${rrule}`)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment