Recipes, orders and scheduled jobs
Job Panel <smart-job-panel>
JobPanel shows what a station does on its own - the jobs it runs because of the clock rather than because of a person - with what each does, when it runs and how it went last time.
Accessibility Attributes
The JobPanel is a table: one row per job, with the job's name as the row header and what it does, when it runs and how it last went as cells, all as text. A job runs without anybody pressing anything, so its result is exactly the kind of thing that would otherwise never reach somebody who cannot see the table: the newest outcome is announced once - assertively when a job failed, politely when it ran. A failure is also written as the word failed, not only coloured, and a switched-off job carries the word off as well as fading.
The following ARIA attributes are used inside the JobPanel:
- role="group" - set on the container, with an aria-label naming the panel - "Line 3 jobs".
- scope="col" and scope="row" - set on the column headers and on each job's name, so a reader moving through a row hears which job and which column it is in. The actions column has a header too, visually hidden.
- aria-label - set on each row, as the job's name, when it runs and what it does - "Night setback, every day at 22:00, loads standby".
- aria-label - set on each button, as its visible words and the job it acts on - "Run now: Night setback", "Disable: Night setback" - so five buttons called Run now are five different buttons to a reader. The visible words come first, so a speech user can still say them.
- role="alertdialog" - set on the confirmation, named by its title and described by what the job does, and taking focus on its confirming button.
- aria-disabled - indicates that the panel is disabled.
The Enable/Disable button carries no aria-pressed. Its words already say what it will do; a pressed state on top would make a reader say "Disable, pressed", which is two answers to one question.
Keyboard Interaction
The following keyboard shortcuts are available to interact with the JobPanel:
| Key | Action |
|---|---|
| Tab | Moves through the Run now and Enable/Disable buttons, row by row. With allowToggle false there is no Enable/Disable button; with readOnly there are no buttons and the panel has no stop. |
| Enter or Space | On Run now, asks for confirmation, or raises jobRun when confirm is false. On Enable/Disable, raises jobToggle. The list is not changed; the application does the work and hands back the updated jobs. |
| Escape | Closes the confirmation without running the job. |
The rows take no keyboard focus. A job's schedule and outcome are facts reported by the station, and the only things the panel offers are on its buttons.
Localization
All strings the JobPanel exposes to assistive technology come from its messages property, so they can be provided in the user's language. Set locale to select a language and add a language through messages. Assigning messages replaces the whole object, so include the existing languages when adding one: el.messages = Object.assign({}, el.messages, { de: pack }); If the built-in en pack is dropped, switching back to English shows raw message keys.
Day names in a weekly schedule are not in the pack: they come from the browser, in the language locale names, so "sun" is shown as Sunday, Sonntag or dimanche without anybody translating it.
The JobPanel uses the following message keys:
- panelLabel, noJobs, count
- columnName, columnWhen, columnDoes, columnLast
- run, running, enable, disable, off
- never, ok, failed, ranAt
- everyDay, weekly, everyMinutes, everySeconds
- loadsRecipe, writesTag, runsFlow
- confirmTitle, confirmBody, confirmRun, confirmCancel
- jobLabel, runLabel, runningLabel, enableLabel, disableLabel
German, French, Spanish and Chinese packs are included in the Smart.Industrial package. Strings that are also exposed as properties default to empty and fall back to the pack, so the default text stays translatable while an explicit property value takes precedence.
Additional information on WAI-ARIA for the SMART Framework can be found here.