Skip to content

Improve the ScheduleForm #294

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
20 changes: 18 additions & 2 deletions application/forms/ScheduleForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
use Icinga\Module\Notifications\Model\RuleEscalationRecipient;
use Icinga\Module\Notifications\Model\Schedule;
use Icinga\Web\Session;
use ipl\Html\Attributes;
use ipl\Html\HtmlDocument;
use ipl\Html\HtmlElement;
use ipl\Html\Text;
use ipl\Sql\Connection;
use ipl\Stdlib\Filter;
use ipl\Web\Common\CsrfCounterMeasure;
Expand Down Expand Up @@ -152,9 +155,22 @@ public function removeSchedule(int $id): void

protected function assemble()
{
if (! $this->showRemoveButton) {
$this->addHtml(new HtmlElement(
'p',
new Attributes(['class' => 'description']),
new Text($this->translate(
'Organize contacts and contact groups in a time based schedule and let them rotate'
. ' automatically. Multiple rotations can be added to your schedule to represent the rotating'
. ' members in your admin team. Schedules can be used as recipients of event rules.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This poses another question for me 🤣 : What is an admin team?

I think a less specific but still not too abstract example is required, to explain why multiple rotations are useful.

Something along this line:

Multiple rotations allow differing rotation patterns to override others.

But not quite this line, I just cannot come up with a better alternative right now. But I hope you get the idea.

))
));
}

$this->addElement('text', 'name', [
'required' => true,
'label' => $this->translate('Name')
'required' => true,
'label' => $this->translate('Schedule Name'),
'placeholder' => $this->translate('e.g. working hours, on call, etc ...')
]);

$this->addElement('submit', 'submit', [
Expand Down
5 changes: 5 additions & 0 deletions public/css/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,8 @@
border-color: transparent;
}
}

.icinga-controls .description {
color: @text-color-light;
}

Loading