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

Cleaned and refactored app buttons #269

Merged
merged 3 commits into from
Feb 20, 2018
Merged

Cleaned and refactored app buttons #269

merged 3 commits into from
Feb 20, 2018

Conversation

JuanjiJG
Copy link
Contributor

@JuanjiJG JuanjiJG commented Feb 20, 2018

Hello all,

Description

This pull request introduces the first approach to refactoring the app buttons. The objective is to unify the HTML and CSS code throughout the app. In order to achieve this, a new CSS class, wazuh-button, was created in order to store the customizations from the original AngularJS Material.

This work involves removing old CSS classes and styles, who were creating incompatibilities not only between the different buttons but also with different components such as the navbar. Now we have less CSS code with the same effect as before, and with unified buttons.

Example screenshots

botones1
botones2
botones3

Description of new HTML code

In order to prevent the same HTML code when new buttons are added to the app, I'll show an example HTML code describing the structure:

<div layout="row" layout-align="center center">
    <md-button flex="15" type="submit" class="wazuh-button md-raised md-primary" aria-label="Save API button">
        <i class="fa fa-floppy-o fa-fw" aria-hidden="true"></i> Save API
    </md-button>
</div>

Important things:

  • The div element helps to organize the button on the layout. Not all the buttons have this structure, and more future work will be needed to clean this. The flex attribute defines the width, which is better than define a custom CSS class with hard-coded pixel width.
    • Note: I'm not sure if the flex attribute is appropriate on buttons, but we'll keep that until we do more research.
  • The wazuh-button md-raised md-primary classes are mandatory in every new button. Some buttons have one more class defining some custom width or height, but in the future, this should be removed too.
  • If we use a FontAwesome icon, we should always use the fa-fw class to align the icon with the text, and not use other classes, (except fa and fa-<icon_name>).
  • aria-label is mandatory, no button shouldn't miss this attribute. This should describe the button and its action (for example, "Decoders table button").

Hoping this likes, any feedback or suggestions are welcome.

Regards,
Juanjo

@havidarou
Copy link
Member

LGTM!

@havidarou havidarou merged commit 7887e7f into 3.2 Feb 20, 2018
@havidarou havidarou deleted the 3.2-dev-buttons-cleanup branch February 20, 2018 12:31
JuanjiJG added a commit that referenced this pull request Feb 20, 2018
JuanjiJG added a commit that referenced this pull request Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants