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

Migrate existing buttons to vuetify #379

Open
wants to merge 8 commits into
base: devel
Choose a base branch
from

Conversation

gabrielademoraes
Copy link
Contributor

Proposed Changes

It was done the migration of the accessible buttons to vuetify. #376

Type of Changes

What type of change this Pull Request brings to Falko?
Put an x in the boxes that apply

  • Bugfix
  • New Feature

Checklist

Put an x in the boxes that apply. If you're confused about any of the following topics, ask us. We're here to help you!

  • This Pull Request has a significant name.
  • The build is okay (tests, code climate).
  • This Pull Request mentions a related issue.

guilhermesiqueira and others added 2 commits September 19, 2019 16:51
Co-authored-by gabrielademoraes <[email protected]>
Co-authored-by: guilhermesiqueira <[email protected]>
@MatheusRich
Copy link
Member

MatheusRich commented Oct 10, 2019

Hi @gabrielademoraes! Thanks for you contribution. That's quite a lot of changes here. There are many little things to address here, though. I've added some comments, but most of them are one of these categories:

  • Hardcoded colors
  • Indent tags with many attributes

Call me again once you fix this (or if you need help).

@gabrielademoraes
Copy link
Contributor Author

First, thanks for the feedback but I still have some doubts... I'm having trouble to see the comments you added, so, could you give some examples, please ?

@@ -44,7 +44,7 @@
<p class="text-danger" v-if="errors.has('form-register.password_confirmation')">{{ errors.first('form-register.password_confirmation') }}</p>
</div>
<div class="text-center">
<button type="submit" :disabled="disableRegisterButton()" class="btn btn-primary falko-button" id="">Register</button>
<v-btn type="submit" :disabled="disableRegisterButton()" class="primary falko-button white--text" id="" color="#86B1B1">Register</v-btn>
Copy link
Member

Choose a reason for hiding this comment

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

It's not good to hardcode this color. Use variables instead.

type="button"
class="primary falko-button white--text"
id="addButton"
color="#86B1B1"
Copy link
Member

Choose a reason for hiding this comment

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

Same here

v-bind:class="buttonClass()"
v-bind:disabled="!this.isGitHubAuthenticated"
v-on:click="getRepos()"
v-bind:data-toggle="buttonDataToggle()"
Copy link
Member

Choose a reason for hiding this comment

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

Replace all this v-bing:something to the short version :something.
Ex:
:disabled="!this.isGitHubAuthenticated"

>
Close
</button>
<v-btn type="button" :disabled="disableImportButton()" class="primary falko-button white--text" color="#86B1B1" v-on:click="importGithubProjects" data-dismiss="modal">
Copy link
Member

Choose a reason for hiding this comment

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

Indent this block

Suggested change
<v-btn type="button" :disabled="disableImportButton()" class="primary falko-button white--text" color="#86B1B1" v-on:click="importGithubProjects" data-dismiss="modal">
<v-btn
type="button"
:disabled="disableImportButton()"
class="primary falko-button white--text"
color="#86B1B1"
v-on:click="importGithubProjects"
data-dismiss="modal"
>```

<v-btn type="button" :disabled="disableImportButton()" class="primary falko-button white--text" color="#86B1B1" v-on:click="importGithubProjects" data-dismiss="modal">
Import
</v-btn>
<v-btn type="button" class="secondary falko-button white--text" color="#868e96" v-on:click="clean" data-dismiss="modal">
Copy link
Member

Choose a reason for hiding this comment

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

Indent this too

@@ -1,19 +1,19 @@
<template>
<div class="">
<div class="text-center">
<button type="button" class="btn btn-info btn-md falko-button" id="addButton" data-toggle="modal" data-target="#addIssueModal">
<v-btn type="button" class="info falko-button white--text" id="addButton" color="#86B1B1" data-toggle="modal" data-target="#addIssueModal">
Copy link
Member

Choose a reason for hiding this comment

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

Don't hardcode colors

@@ -43,8 +43,9 @@
</div>
</div>
<div class="modal-footer">
<button type="button" :disabled="errors.has('name') || errors.has('body')" class="btn btn-info btn-md falko-button" v-on:click="editIssue(), setAssignees()" data-dismiss="modal">Save</button>
<button type="button" class="btn btn-info btn-md falko-button-grey" data-dismiss="modal">Close</button>
<v-btn type="button" :disabled="errors.has('name') || errors.has('body')" class="info btn-md falko-button"
Copy link
Member

Choose a reason for hiding this comment

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

Fix this indentation

@MatheusRich
Copy link
Member

@gabrielademoraes can you see them now?

@gabrielademoraes
Copy link
Contributor Author

Yes... thanks! We will fix it as soon as possible!

@gabrielademoraes
Copy link
Contributor Author

gabrielademoraes commented Oct 15, 2019

We guess all the changes you requested were done.

@@ -115,4 +115,20 @@ export default {
font-size: 14px;
padding-top: 1px;
}

.button-test {
Copy link
Member

Choose a reason for hiding this comment

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

Should this really be here?

font-weight: bold;
}

#closeButton {
Copy link
Member

Choose a reason for hiding this comment

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

The code for this id is basically the same of the id above it. If you want the same style in several places, create a css class and added it, instead of Ids.

color: #ffffff;
}

#loginButton {
Copy link
Member

Choose a reason for hiding this comment

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

I see that you repeated this css code in several places. You're still defining the button colors hardcoded, which is not good for maintainability.

Think about this scenario:

  • You have repeated this hardcoded color through the whole code.
  • Now you want to change the color of all buttons.
  • You'll have to update EVERY css file to update the colors.
  • This isn't a maintainable approach.

Let's think about this other scenario:

  • You've defined a primary color on the Vuetify config file (you can find instructions here)
  • You've used the class primary to set all the buttons to the primary color defined previously. Ex:
<v-btn color="primary">
...
</v-btn>
  • Now you want to change the color of all buttons.
  • The only thing you need to do is update the color in the Vuetify config file. Ex:
export default new Vuetify({
  theme: {
    themes: {
      light: {
        primary: colors.red, // A new color
      },
    },
  },

@guilhermesiqueira
Copy link
Contributor

No more hardcoded colors, @MatheusRich. We were able to encapsulate the entire application with Vuetify and now it was possible to use "tags" to the colors.

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.

3 participants