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

General Style/Layout enhancements #103

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

flourish86
Copy link
Contributor

Fixes some minor style and ui issues:

  • Clarifies button labels
  • Makes disabled state of buttons more obvious
  • Makes button styles more consistent

@flourish86 flourish86 requested a review from nilmerg May 22, 2023 11:59
@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label May 22, 2023
@flourish86 flourish86 force-pushed the fix/address-style-issues branch from c3c3c8a to 28475d4 Compare May 22, 2023 12:24
Copy link
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

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

image

t('Add Contact'),
'notifications/contacts/add',
t('New Contact'),
'noma/contacts/add',
Copy link
Member

Choose a reason for hiding this comment

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

wrong module name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -46,6 +46,7 @@ public function init()

public function indexAction(): void
{
$this->content->getAttributes()->add(['class' => 'full-width']);
Copy link
Member

Choose a reason for hiding this comment

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

Please move this to the bottom where the list is added to the content.

Copy link
Contributor Author

Choose a reason for hiding this comment

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


Also did this for the other occurrences:

  • IncidentsController
  • EventsController

$this->addTitleTab(t('Add Event Rule'));
$this->getTabs()->setRefreshUrl(Url::fromPath('notifications/event-rules/add'));
$this->addTitleTab(t('New Event Rule'));
$this->getTabs()->setRefreshUrl(Url::fromPath('noma/event-rules/add'));
Copy link
Member

Choose a reason for hiding this comment

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

wrong module name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -89,7 +90,7 @@ public function indexAction(): void
'notifications/event-rules/add',
'plus'
))->setBaseTarget('_next')
->addAttributes(['class' => 'new-event-rule'])
Copy link
Member

Choose a reason for hiding this comment

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

Please also remove the class then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -28,6 +28,7 @@ class EventsController extends CompatController
public function indexAction(): void
{
$this->addTitleTab(t('Events'));
$this->content->getAttributes()->add(['class' => 'full-width']);
Copy link
Member

Choose a reason for hiding this comment

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

to the bottom where the list is added please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -22,6 +22,7 @@ class IncidentsController extends CompatController
public function indexAction(): void
{
$this->addTitleTab(t('Incidents'));
$this->content->getAttributes()->add(['class' => 'full-width']);
Copy link
Member

Choose a reason for hiding this comment

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

to the bottom where... please

Copy link
Contributor Author

@flourish86 flourish86 May 23, 2023

Choose a reason for hiding this comment

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

@@ -118,7 +118,7 @@ public function assemble()
new Link(
[
new Icon('plus'),
t('Add new entry')
t('Add Entry')
Copy link
Member

Choose a reason for hiding this comment

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

You've standardized it everywhere else to New ..., why not here??

Copy link
Contributor Author

@flourish86 flourish86 May 23, 2023

Choose a reason for hiding this comment

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

So the idea behind this is:

  • You create/delete an Object (e.g. "New Schedule”), when you’re in the “schedules” views (Create)
  • You add/remove “entry" objects to that “schedule", when you’re in the “schedules” view (Create and link)

This helps

  • to clarify the different relations and
  • with distinguishing the different actions better, especially in a view with many buttons in the same design

I decided against additionally highlighting the “add entry” button as a primary button, because it’s not that important in that view and would distract from the actual content which is the schedule itself.

Screenshot 2023-05-23 at 13 27 30

Copy link
Member

Choose a reason for hiding this comment

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

Ah, okay, but I also add a new rule to the list of already existing event rules. I also add a new contact to the list of available contacts. In both cases, the relation is the list on the left. And to a list you add new items. The perfect label would be Add New Contact, but that's a bit redundant IMHO.

So if you think Add Entry is fine on the schedules view, I don't understand why you think Add Contact is not, on the contacts list.

Copy link
Contributor Author

@flourish86 flourish86 May 23, 2023

Choose a reason for hiding this comment

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

Yes, don't you see the difference?

contact (list): new contact
schedule (list): new schedule
schedule: add entry

Not sure, how to make it clearer.

It also helps clarify the difference when there's that many different buttons of the same style, as shown on the screenshot.

I agree on the redundancy, especially as it doesn't add any value and distracts from the actual important term "Contact".

I don't want to discuss this to death. If you insist or it doesn't make sense to you, we can label it "+ New Entry".

Copy link
Member

Choose a reason for hiding this comment

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

Everything you've added in here should be moved to Icinga Web 2. Add it there to forms.less please.

While you do that, please make btn-default a standalone class (should not require btn-cancel). This should also solve the issue that once again there are no focus styles!

Copy link
Contributor Author

@flourish86 flourish86 May 23, 2023

Choose a reason for hiding this comment

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

✅ As discussed “offline”, I dropped the custom styles for .form-controls.

Copy link
Member

Choose a reason for hiding this comment

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

This is a well tested and proven layout. Your changes break overflow and lead to different sized gaps:
image

Please revert all changes in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly, you’re right. But inconsistent spacing was the reason I went for this in the first place.

Artboard 2
Artboard

@nilmerg nilmerg added enhancement New feature or improvement area/ui Affects the user interface labels May 23, 2023
@nilmerg nilmerg changed the title Fix/address style issues General Style/Layout enhancements May 23, 2023
@flourish86 flourish86 force-pushed the fix/address-style-issues branch from 69643e2 to 4b33a04 Compare May 24, 2023 09:15
@flourish86 flourish86 requested a review from nilmerg May 24, 2023 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui Affects the user interface cla/signed CLA is signed by all contributors of a PR enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants