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

[ui] Text field to update enrollment dates #823

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions releases/unreleased/text-field-to-upate-enrollment-dates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Text field to update enrollment dates
category: added
author: Eva Millán <[email protected]>
issue: 819
notes: >
Users have the option to enter the dates on a text
field when editing affiliations.
137 changes: 73 additions & 64 deletions ui/src/components/EnrollmentList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,39 +80,41 @@
<v-icon small right> mdi-lead-pencil </v-icon>
</button>
</template>
<v-date-picker
v-model="enrollment.form.fromDate"
:max="enrollment.end"
color="primary"
no-title
scrollable
>
<v-spacer></v-spacer>
<v-btn
text
color="primary"
@click="enrollment.form.fromDateMenu = false"
>
Cancel
</v-btn>
<v-btn
text
color="primary"
@click="
$emit('updateEnrollment', {
fromDate: enrollment.start,
toDate: enrollment.end,
newFromDate: new Date(
enrollment.form.fromDate
).toISOString(),
group: enrollment.group.name,
});
enrollment.form.fromDateMenu = false;
"
>
Save
</v-btn>
</v-date-picker>
<v-card>
<v-card-text>
<date-input
v-model="enrollment.form.fromDate"
label="Date from"
:max="enrollment.end"
/>
</v-card-text>
<v-card-actions class="pt-0">
<v-spacer></v-spacer>
<v-btn
text
color="primary"
@click="enrollment.form.fromDateMenu = false"
>
Cancel
</v-btn>
<v-btn
:disabled="!enrollment.form.fromDate"
color="primary"
text
@click="
$emit('updateEnrollment', {
fromDate: enrollment.start,
toDate: enrollment.end,
newFromDate: enrollment.form.fromDate,
group: enrollment.group.name,
});
enrollment.form.fromDateMenu = false;
"
>
Save
</v-btn>
</v-card-actions>
</v-card>
</v-menu>
-
<v-menu
Expand All @@ -136,37 +138,41 @@
<v-icon small right> mdi-lead-pencil </v-icon>
</button>
</template>
<v-date-picker
v-model="enrollment.form.toDate"
:min="enrollment.start"
color="primary"
no-title
scrollable
>
<v-spacer></v-spacer>
<v-btn
text
color="primary"
@click="enrollment.form.toDateMenu = false"
>
Cancel
</v-btn>
<v-btn
text
color="primary"
@click="
$emit('updateEnrollment', {
fromDate: enrollment.start,
toDate: enrollment.end,
newToDate: new Date(enrollment.form.toDate).toISOString(),
group: enrollment.group.name,
});
enrollment.form.toDateMenu = false;
"
>
Save
</v-btn>
</v-date-picker>
<v-card>
<v-card-text>
<date-input
v-model="enrollment.form.toDate"
:min="enrollment.start"
label="Date to"
/>
</v-card-text>
<v-card-actions class="pt-0">
<v-spacer></v-spacer>
<v-btn
text
color="primary"
@click="enrollment.form.toDateMenu = false"
>
Cancel
</v-btn>
<v-btn
:disabled="!enrollment.form.toDate"
color="primary"
text
@click="
$emit('updateEnrollment', {
fromDate: enrollment.start,
toDate: enrollment.end,
newToDate: enrollment.form.toDate,
group: enrollment.group.name,
});
enrollment.form.toDateMenu = false;
"
>
Save
</v-btn>
</v-card-actions>
</v-card>
</v-menu>
</div>
<div>
Expand Down Expand Up @@ -352,8 +358,11 @@
</template>

<script>
import DateInput from "./DateInput.vue";
export default {
name: "EnrollmentList",
components: { DateInput },
props: {
enrollments: {
type: Array,
Expand Down
Loading