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

Scheduler a11y: appointments does not have info about reccurence #28165

Merged
merged 5 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
31 changes: 28 additions & 3 deletions e2e/testcafe-devextreme/tests/scheduler/a11y/appointment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fixture.disablePageReloads`a11y - appointment`
const attrs = await scheduler.getAppointment('App 1').element.attributes;

await t
.expect(attrs['aria-label'])
.expect(attrs['aria-roledescription'])
.eql('February 1, 2021, Group: resource1, ');
}).before(async () => {
await createWidget('dxScheduler', {
Expand Down Expand Up @@ -63,7 +63,7 @@ fixture.disablePageReloads`a11y - appointment`
const attrs = await scheduler.getAppointment('App 1').element.attributes;

await t
.expect(attrs['aria-label'])
.expect(attrs['aria-roledescription'])
.eql('February 1, 2021, Group: resource11, resource21, ');
}).before(async () => {
await createWidget('dxScheduler', {
Expand Down Expand Up @@ -128,7 +128,7 @@ fixture.disablePageReloads`a11y - appointment`
async (i) => {
const appt = scheduler.getAppointment('App 1', i);
const attrs = await appt.element.attributes;
return attrs['aria-label'];
return attrs['aria-roledescription'];
},
));

Expand Down Expand Up @@ -231,3 +231,28 @@ test('appointments & collector buttons can be navigated', async (t) => {
currentDate: new Date(2021, 1, 1),
});
});

test('Scheduler a11y: appointments does not have info about reccurence', async (t) => {
const scheduler = new Scheduler('#container');
const recurrenceIcon = scheduler.getAppointment('Website Re-Design Plan').getRecurrenceElement();

await t
.expect(recurrenceIcon.getAttribute('aria-label'))
.eql('Recurring Appointment');
}).before(async () => {
await createWidget('dxScheduler', {
timeZone: 'America/Los_Angeles',
dataSource: [
{
text: 'Website Re-Design Plan',
startDate: new Date('2021-04-26T16:30:00.000Z'),
endDate: new Date('2021-04-26T18:30:00.000Z'),
recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10',
},
],
views: ['day', 'week', 'workWeek', 'month'],
currentView: 'day',
currentDate: new Date(2021, 3, 29),
startDayHour: 9,
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,9 @@ export class Appointment extends DOMComponent {
this._renderDragSourceClass();
this._renderDirection();

(this.$element() as any).data('dxAppointmentStartDate', this.option('startDate'));

const text = ExpressionUtils.getField(this.option('dataAccessors'), 'text', this.rawAppointment);
(this.$element() as any).attr('title', text);
(this.$element() as any).data('dxAppointmentStartDate', this.option('startDate'));
(this.$element() as any).attr('role', 'button');

this._renderRecurrenceClass();
Expand Down Expand Up @@ -208,14 +207,13 @@ export class Appointment extends DOMComponent {
_renderAriaLabel() {
// @ts-expect-error
const $element: dxElementWrapper = this.$element();

const ariaLabel = [
this._getDateText(),
this._getGroupText(),
]
.filter((label) => !!label)
.join(', ');
$element.attr('aria-label', `${ariaLabel}, `);
$element.attr('aria-roledescription', `${ariaLabel}, `);
}

_renderAppointmentGeometry() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import messageLocalization from '@js/localization/message';
import { APPOINTMENT_CONTENT_CLASSES } from '../m_classes';

const allDayText = ` ${messageLocalization.format('dxScheduler-allDay')}: `;
const recurringText = messageLocalization.format('dxScheduler-appointmentAriaLabel-recurring');

export const createAppointmentLayout = (formatText, config) => {
const result = $((domAdapter as any).createDocumentFragment());
Expand All @@ -23,7 +24,8 @@ export const createAppointmentLayout = (formatText, config) => {
$('<div>').addClass(APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_DATE).text(formatText.formatDate).appendTo($contentDetails);

config.isRecurrence
&& $('<span>').addClass(`${APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).appendTo(result);
&& $('<span>').addClass(`${APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).attr('aria-label', recurringText)
.appendTo(result);

config.isAllDay
&& $('<div>')
Expand Down Expand Up @@ -51,7 +53,8 @@ export const createAgendaAppointmentLayout = (formatText, config) => {
.appendTo(leftLayoutContainer);

config.isRecurrence
&& $('<span>').addClass(`${APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).appendTo(marker);
&& $('<span>').addClass(`${APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).attr('aria-label', recurringText)
.appendTo(marker);

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const text = $('<div>')
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "إفلات حقول التصفية هنا",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "الموضوع",
"dxScheduler-editorLabelStartDate": "تاريخ البدء",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Els camps de filtre de baixada aquí",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Assignatura",
"dxScheduler-editorLabelStartDate": "Data d'inici",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Zde vložte filtr pole",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Předmět",
"dxScheduler-editorLabelStartDate": "Počáteční datum",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Filterfelder hierher ziehen",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Betreff",
"dxScheduler-editorLabelStartDate": "Anfangszeit",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Τοποθετήστε τα πεδία φίλτρων εδώ",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Θέμα",
"dxScheduler-editorLabelStartDate": "Ημερομηνία έναρξης",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Drop Filter Fields Here",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",
tongsonbarbs marked this conversation as resolved.
Show resolved Hide resolved

"dxScheduler-editorLabelTitle": "Subject",
"dxScheduler-editorLabelStartDate": "Start Date",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Arrastra campos de filtro aquí",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Asunto",
"dxScheduler-editorLabelStartDate": "Fecha inicial",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "فیلدهای مربوط به فیلتر را به اینجا انتقال دهید (درگ نمایید)",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "موضوع",
"dxScheduler-editorLabelStartDate": "تاریخ شروع",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Pudota suodatinkentät tähän",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Aihe",
"dxScheduler-editorLabelStartDate": "Alkamispäivä",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Déposer les champs de filtre ici",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Titre",
"dxScheduler-editorLabelStartDate": "Date de début",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Húzza a szűrőmezőket ide",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Tárgy",
"dxScheduler-editorLabelStartDate": "Kezdés dátuma",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Trascina qui i campi filtro",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Oggetto",
"dxScheduler-editorLabelStartDate": "Data inizio",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "フィルター フィールドをこちらへドラッグ&ドロップ",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "件名",
"dxScheduler-editorLabelStartDate": "開始時刻",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Numeskite filtrų laukus čia",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Tema",
"dxScheduler-editorLabelStartDate": "Pradžios data",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/lv.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Nomest Filtra Laukus Šeit",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Nosaukums",
"dxScheduler-editorLabelStartDate": "Sākuma Datums",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Slipp filterfelter her",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Emne",
"dxScheduler-editorLabelStartDate": "Startdato",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Sleep Filtervelden Hier",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Onderwerp",
"dxScheduler-editorLabelStartDate": "Startdatum",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Przeciągnij pola filtra tutaj",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Dotyczy",
"dxScheduler-editorLabelStartDate": "Czas rozpoczęcia",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Arraste os campos de filtro até aqui",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Assunto",
"dxScheduler-editorLabelStartDate": "Data de Início",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Plasați câmpurile de filtrare aici",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Subiect",
"dxScheduler-editorLabelStartDate": "Data de început",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Перетащите поля фильтров cюда",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Название",
"dxScheduler-editorLabelStartDate": "Дата начала",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Povleci filtre tukaj",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Predmet",
"dxScheduler-editorLabelStartDate": "Datum začetka",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Släpp filterfält här",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Ämne",
"dxScheduler-editorLabelStartDate": "Startdatum",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Filtre Alanlarını Buraya Bırak",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Konu",
"dxScheduler-editorLabelStartDate": "Başlangıç Tarihi",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "Thả bộ lọc các trường vào đây",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "Chủ đề",
"dxScheduler-editorLabelStartDate": "Ngày bắt đầu",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "拖動篩選欄位到此處",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "標題",
"dxScheduler-editorLabelStartDate": "開始日期",
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme/js/localization/messages/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
"dxPivotGrid-filterFieldArea": "拖动筛选字段到此处",

"dxScheduler-appointmentAriaLabel-group": "Group: {0}",
"dxScheduler-appointmentAriaLabel-recurring": "Recurring Appointment",

"dxScheduler-editorLabelTitle": "标题",
"dxScheduler-editorLabelStartDate": "开始日期",
Expand Down
5 changes: 5 additions & 0 deletions packages/testcafe-models/scheduler/appointment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const CLASS = {
appointment: 'dx-scheduler-appointment',
appointmentContentDate: 'dx-scheduler-appointment-content-date',
dateTableCell: 'dx-scheduler-date-table-cell',
appoinmentRecurrenceIcon: 'dx-scheduler-appointment-recurrence-icon',
resizableHandleBottom: 'dx-resizable-handle-bottom',
resizableHandleLeft: 'dx-resizable-handle-left',
resizableHandleRight: 'dx-resizable-handle-right',
Expand Down Expand Up @@ -109,4 +110,8 @@ export default class Appointment {
.parent(0).find(`.${CLASS.resources.value}`)
.innerText;
}

getRecurrenceElement(): Selector {
return this.element.find(`.${CLASS.appoinmentRecurrenceIcon}`);
}
}
Loading